basic system docu generation, updated phpdocumentor lib reference
This commit is contained in:
parent
7f7b5ad6f8
commit
068b635948
@ -1,4 +1,2 @@
|
||||
<?php
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\DOCU');
|
||||
|
||||
require_once dirname(__FILE__).'/register_sys_docu.php';
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\DOCU');
|
||||
@ -2,7 +2,7 @@
|
||||
namespace SYSTEM\DOCU;
|
||||
|
||||
class docu {
|
||||
private static $documents = array(); //only strings!
|
||||
/*private static $documents = array(); //only strings!
|
||||
|
||||
public static function registerFolder($folder,$category){
|
||||
if(!is_dir($folder)){
|
||||
@ -21,5 +21,23 @@ class docu {
|
||||
public static function getDocuments(){
|
||||
return self::$documents;}
|
||||
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__).'/jqbootstrapvalidation/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');
|
||||
});
|
||||
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() {
|
||||
|
||||
@ -1,36 +1,39 @@
|
||||
<?php
|
||||
namespace SYSTEM\SAI;
|
||||
|
||||
class saimod_sys_docu extends \SYSTEM\SAI\SaiModule {
|
||||
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['tabopts'] = '';
|
||||
foreach($documents as $cat => $docs){
|
||||
$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));}
|
||||
foreach($phpdocconfigs as $config){
|
||||
$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);
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_cat($cat = 'System'){
|
||||
$documents = \SYSTEM\DOCU\docu::getDocuments()[$cat];
|
||||
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU);
|
||||
$vars['tabopts'] = '';
|
||||
foreach($documents as $doc){
|
||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt2.tpl'))->SERVERPATH(),
|
||||
array( 'tab_id' => str_replace(' ', '_', $cat),
|
||||
'doc_id' => str_replace(array('.',' '), '_', basename($doc)),
|
||||
'doc_id_pretty' => basename($doc)));
|
||||
}
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_generate(){
|
||||
\LIB\lib_phpdocumentor::php();
|
||||
$configs = \SYSTEM\DOCU\docu::getAll();
|
||||
foreach($configs as $config){
|
||||
\phpdocumentor::run( $config['inpath']->SERVERPATH(),
|
||||
$config['outpath']->SERVERPATH(),
|
||||
$config['cachepath']->SERVERPATH(),
|
||||
$config['title'],
|
||||
$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);
|
||||
}
|
||||
|
||||
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];
|
||||
foreach($document as $docu){
|
||||
if(str_replace(array('.',' ','\\','/'), '_', basename($docu)) == $doc){
|
||||
return \Michelf\MarkdownExtra::defaultTransform(file_get_contents($docu));}
|
||||
}
|
||||
}*/
|
||||
return 'not found';
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="tabs_docu">
|
||||
${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>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_docu"></div>
|
||||
|
||||
@ -1,9 +1 @@
|
||||
<div class="tabbable tabs-left" id="tabs2_docu">
|
||||
<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>
|
||||
<iframe src="${iframesrc}" style="width: 100%; min-height: 700px;"></iframe>
|
||||
@ -17,6 +17,15 @@ class system {
|
||||
\SYSTEM\system::register_errorhandler_dbwriter();} //write errors to database (must be first errorhandler to register)
|
||||
if($error_json){
|
||||
\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(){
|
||||
\SYSTEM\time::start();}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user