basic system docu generation, updated phpdocumentor lib reference
This commit is contained in:
parent
7f7b5ad6f8
commit
068b635948
@ -1,4 +1,2 @@
|
|||||||
<?php
|
<?php
|
||||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\DOCU');
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\DOCU');
|
||||||
|
|
||||||
require_once dirname(__FILE__).'/register_sys_docu.php';
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
namespace SYSTEM\DOCU;
|
namespace SYSTEM\DOCU;
|
||||||
|
|
||||||
class docu {
|
class docu {
|
||||||
private static $documents = array(); //only strings!
|
/*private static $documents = array(); //only strings!
|
||||||
|
|
||||||
public static function registerFolder($folder,$category){
|
public static function registerFolder($folder,$category){
|
||||||
if(!is_dir($folder)){
|
if(!is_dir($folder)){
|
||||||
@ -21,5 +21,23 @@ class docu {
|
|||||||
public static function getDocuments(){
|
public static function getDocuments(){
|
||||||
return self::$documents;}
|
return self::$documents;}
|
||||||
public static function getCategory($category){
|
public static function getCategory($category){
|
||||||
return self::$documents[$category];}
|
return self::$documents[$category];}*/
|
||||||
|
private static $phpdocconfigs = array();
|
||||||
|
//phpdocconfig
|
||||||
|
//array('inoath' => path, 'outpath' => path)
|
||||||
|
|
||||||
|
public static function register($phpdocconfig){
|
||||||
|
array_push(self::$phpdocconfigs,$phpdocconfig);}
|
||||||
|
|
||||||
|
public static function getAll(){
|
||||||
|
return self::$phpdocconfigs;}
|
||||||
|
|
||||||
|
public static function get($id){
|
||||||
|
foreach(self::$phpdocconfigs as $config){
|
||||||
|
if($config['id'] == $id){
|
||||||
|
return $config;}
|
||||||
|
}
|
||||||
|
throw new ERROR('PhpDocConfig for id '.$id.' not found.');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,2 +0,0 @@
|
|||||||
<?php
|
|
||||||
\SYSTEM\DOCU\docu::registerFolder(dirname(__FILE__).'/system',\SYSTEM\DOCU\docu_categories::DOCU_CAT_SYS);
|
|
||||||
@ -13,4 +13,5 @@ require_once dirname(__FILE__).'/bootstrap_growl/autoload.inc';
|
|||||||
require_once dirname(__FILE__).'/git/autoload.inc';
|
require_once dirname(__FILE__).'/git/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/jqbootstrapvalidation/autoload.inc';
|
require_once dirname(__FILE__).'/jqbootstrapvalidation/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/scssphp/autoload.inc';
|
require_once dirname(__FILE__).'/scssphp/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/minify/autoload.inc';
|
require_once dirname(__FILE__).'/minify/autoload.inc';
|
||||||
|
require_once dirname(__FILE__).'/phpdocumentor/autoload.inc';
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 3e9cbe234e4de6e50ba3cda1344abd982db5083f
|
Subproject commit fe1c3909426881fd10c55b688e0c48aa8acb9f13
|
||||||
@ -5,6 +5,18 @@ function init_saimod_sys_docu() {
|
|||||||
$(this).parent().addClass('active');
|
$(this).parent().addClass('active');
|
||||||
});
|
});
|
||||||
docu_menu();
|
docu_menu();
|
||||||
|
|
||||||
|
$('#btn_generate').click(function(){
|
||||||
|
$.ajax({ type :'GET',
|
||||||
|
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=generate',
|
||||||
|
success : function(data) {
|
||||||
|
if(data.status){
|
||||||
|
system.load('docu',true);
|
||||||
|
}else{
|
||||||
|
alert('Problem: '+data);}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function init_saimod_sys_docu_cat() {
|
function init_saimod_sys_docu_cat() {
|
||||||
|
|||||||
@ -1,36 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace SYSTEM\SAI;
|
namespace SYSTEM\SAI;
|
||||||
|
|
||||||
class saimod_sys_docu extends \SYSTEM\SAI\SaiModule {
|
class saimod_sys_docu extends \SYSTEM\SAI\SaiModule {
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu(){
|
||||||
$documents = \SYSTEM\DOCU\docu::getDocuments();
|
$phpdocconfigs = \SYSTEM\DOCU\docu::getAll();
|
||||||
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU);
|
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU);
|
||||||
$vars['tabopts'] = '';
|
$vars['tabopts'] = '';
|
||||||
foreach($documents as $cat => $docs){
|
foreach($phpdocconfigs as $config){
|
||||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt.tpl'))->SERVERPATH(), array( 'tab_id' => str_replace(' ', '_', $cat),'tab_id_pretty' => $cat));}
|
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt.tpl'))->SERVERPATH(), array('tab_id' => $config['id'],'tab_id_pretty' => $config['title']));}
|
||||||
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl'))->SERVERPATH(), $vars);
|
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl'))->SERVERPATH(), $vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_cat($cat = 'System'){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_generate(){
|
||||||
$documents = \SYSTEM\DOCU\docu::getDocuments()[$cat];
|
\LIB\lib_phpdocumentor::php();
|
||||||
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU);
|
$configs = \SYSTEM\DOCU\docu::getAll();
|
||||||
$vars['tabopts'] = '';
|
foreach($configs as $config){
|
||||||
foreach($documents as $doc){
|
\phpdocumentor::run( $config['inpath']->SERVERPATH(),
|
||||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt2.tpl'))->SERVERPATH(),
|
$config['outpath']->SERVERPATH(),
|
||||||
array( 'tab_id' => str_replace(' ', '_', $cat),
|
$config['cachepath']->SERVERPATH(),
|
||||||
'doc_id' => str_replace(array('.',' '), '_', basename($doc)),
|
$config['title'],
|
||||||
'doc_id_pretty' => basename($doc)));
|
$config['sourcecode'],
|
||||||
}
|
$config['parseprivate']);}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_cat($cat = 'system'){
|
||||||
|
$vars = array('iframesrc' => \SYSTEM\DOCU\docu::get($cat)['outpath']->WEBPATH(false));
|
||||||
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu_cat.tpl'))->SERVERPATH(), $vars);
|
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu_cat.tpl'))->SERVERPATH(), $vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_doc($cat = 'System',$doc = '1_system_md'){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_doc($cat = 'System',$doc = '1_system_md'){
|
||||||
\LIB\lib_markdown::php();
|
/*\LIB\lib_markdown::php();
|
||||||
$document = \SYSTEM\DOCU\docu::getDocuments()[$cat];
|
$document = \SYSTEM\DOCU\docu::getDocuments()[$cat];
|
||||||
foreach($document as $docu){
|
foreach($document as $docu){
|
||||||
if(str_replace(array('.',' ','\\','/'), '_', basename($docu)) == $doc){
|
if(str_replace(array('.',' ','\\','/'), '_', basename($docu)) == $doc){
|
||||||
return \Michelf\MarkdownExtra::defaultTransform(file_get_contents($docu));}
|
return \Michelf\MarkdownExtra::defaultTransform(file_get_contents($docu));}
|
||||||
}
|
}*/
|
||||||
return 'not found';
|
return 'not found';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
<ul class="nav nav-tabs" id="tabs_docu">
|
<ul class="nav nav-tabs" id="tabs_docu">
|
||||||
${tabopts}
|
${tabopts}
|
||||||
|
<button id="btn_generate" class="btn-primary btn btn-sm" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> ${basic_generate}</button>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_docu"></div>
|
<div class="tab-pane active" id="tab_docu"></div>
|
||||||
|
|||||||
@ -1,9 +1 @@
|
|||||||
<div class="tabbable tabs-left" id="tabs2_docu">
|
<iframe src="${iframesrc}" style="width: 100%; min-height: 700px;"></iframe>
|
||||||
<ul class="nav nav-stacked nav-pills col-md-3 sai_margin_top_10">
|
|
||||||
${tabopts}
|
|
||||||
</ul>
|
|
||||||
<div class="tab-content col-md-9">
|
|
||||||
<div class="tab-pane active" id="tab2_docu">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -17,6 +17,15 @@ class system {
|
|||||||
\SYSTEM\system::register_errorhandler_dbwriter();} //write errors to database (must be first errorhandler to register)
|
\SYSTEM\system::register_errorhandler_dbwriter();} //write errors to database (must be first errorhandler to register)
|
||||||
if($error_json){
|
if($error_json){
|
||||||
\SYSTEM\system::register_errorhandler_jsonoutput();} //print errors as json to caller (must be last errorhandler to register)
|
\SYSTEM\system::register_errorhandler_jsonoutput();} //print errors as json to caller (must be last errorhandler to register)
|
||||||
|
|
||||||
|
//register docu here, we require path
|
||||||
|
\SYSTEM\DOCU\docu::register(array( 'id' => 'system',
|
||||||
|
'inpath' => new \SYSTEM\PSYSTEM(),
|
||||||
|
'outpath' => new \SYSTEM\PSYSTEM('docu/system/'),
|
||||||
|
'cachepath' => new \SYSTEM\PSYSTEM('docu/system/cache/'),
|
||||||
|
'sourcecode' => true,
|
||||||
|
'parseprivate' => false,
|
||||||
|
'title' => 'SYSTEM - PHP Framework'));
|
||||||
}
|
}
|
||||||
public static function _start_time(){
|
public static function _start_time(){
|
||||||
\SYSTEM\time::start();}
|
\SYSTEM\time::start();}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user