fixed saimod_docu, system docu, updated all lib references

This commit is contained in:
Ulf Gebhardt 2017-07-25 11:18:12 +02:00
parent 5bb534ec04
commit 7dc84355d8
60 changed files with 309 additions and 130 deletions

View File

@ -11,6 +11,10 @@
*/
namespace SYSTEM\API;
/**
* api_default Interface used internally in api_default Class
* can be used insted of api_default if hashbang mechanic should not be used.
*/
interface api_default_interface {
/**
* API Group function - implement this function and return the Groupnumber

View File

@ -94,8 +94,8 @@ class api_login {
* System Account Change Password
*
* @param string $username Username
* @param sha1 $old_password_sha1 Users Old Password SHA1 String
* @param sha1 $new_password_sha1 Users New Password SHA1 String
* @param string $old_password_sha1 Users Old Password SHA1 String
* @param string $new_password_sha1 Users New Password SHA1 String
* @return JSON Returns JSON result with success/failure status
*/
public static function call_account_action_change_password($old_password_sha1,$new_password_sha1){
@ -105,7 +105,7 @@ class api_login {
* System Account Request Change EMail Token
*
* @param string $username Username
* @param email $new_email Users new EMail Address
* @param string $new_email Users new EMail Address
* @return JSON Returns JSON result with success/failure status
*/
public static function call_account_action_change_email($new_email){

View File

@ -58,6 +58,12 @@ class cron {
return \SYSTEM\LOG\JsonResult::ok();
}
/**
* Run a specific registered Cronjob by classname if its time to do so.
*
* @param string Classname of the cronjob
* @return JSON Returns Json::ok()
*/
public static function run_class($class){
$cron = \SYSTEM\SQL\SYS_SAIMOD_CRON_SINGLE_SELECT::Q1(array($class));
if(!$cron){

View File

@ -59,6 +59,7 @@ class Connection extends ConnectionAbstr{
* @param string $stmtName Name of the Statement - espec for PostgreSQL important
* @param string $stmt SQL string of the Statement
* @param array $values Array of Prepare Values
* @param string $types types sql prepare string
* @return Result Returns Database Query Result.
*/
public function prepare($stmtName, $stmt, $values, $types = null){

View File

@ -100,6 +100,7 @@ class ConnectionAMQP extends ConnectionAbstr {
* @param string $stmtName Name of the Statement - espec for PostgreSQL important
* @param string $stmt SQL string of the Statement
* @param array $values Array of Prepare Values
* @param string $types types sql prepare string
* @return Result Returns Database Query Result.
*/
public function prepare($stmtName, $stmt, $values, $types = null){

View File

@ -40,6 +40,7 @@ abstract class ConnectionAbstr {
* @param string $stmtName Name of the Statement - espec for PostgreSQL important
* @param string $stmt SQL string of the Statement
* @param array $values Array of Prepare Values
* @param string $types types sql prepare string
* @return Result Returns Database Query Result.
*/
abstract public function prepare($stmtName, $stmt, $values, $types = null);

View File

@ -57,6 +57,7 @@ class ConnectionMYS extends ConnectionAbstr {
* @param string $stmtName Name of the Statement - espec for PostgreSQL important
* @param string $stmt SQL string of the Statement
* @param array $values Array of Prepare Values
* @param string $types types sql prepare string
* @return Result Returns Database Query Result.
*/
public function prepare($stmtName, $stmt, $values, $types = null){

View File

@ -49,6 +49,7 @@ class ConnectionPG extends ConnectionAbstr {
* @param string $stmtName Name of the Statement - espec for PostgreSQL important
* @param string $stmt SQL string of the Statement
* @param array $values Array of Prepare Values
* @param string $types types sql prepare string
* @return Result Returns Database Query Result.
*/
public function prepare($stmtName, $stmt, $values, $types = null){

View File

@ -50,6 +50,7 @@ class ConnectionSQLite extends ConnectionAbstr {
* @param string $stmtName Name of the Statement - espec for PostgreSQL important
* @param string $stmt SQL string of the Statement
* @param array $values Array of Prepare Values
* @param string $types types sql prepare string
* @return Result Returns Database Query Result.
*/
public function prepare($stmtName, $stmt, $values, $types = null){

View File

@ -1,2 +1,3 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\DOCU');
\SYSTEM\DOCU\docu::register('\SYSTEM\DOCU\docu_system');

View File

@ -12,39 +12,70 @@
namespace SYSTEM\DOCU;
/**
* Docu Class provided by System to register phpdocumentor configs.
* Docu Class provided by System to register docu_packages.
*/
class docu {
/** array Variable to store all registred phpdocconfigs */
private static $phpdocconfigs = array();
/** array Variable to store all registred docu_package classes */
private static $docu_packages = array();
/**
* Register a phpdocconfig
* Register a docu package
*
* @param array $phpdocconfig Config to be registered
* @param string $docu_package Classname of Docu Package to be registered
* @return null Returns null.
*/
public static function register($phpdocconfig){
array_push(self::$phpdocconfigs,$phpdocconfig);}
public static function register($docu_package){
array_push(self::$docu_packages,$docu_package);}
/**
* Get all registered phpdocconfigs
* Get all registered docu packages
*
* @return array Returns array with all registered phpdocconfigs.
* @return array Returns array with all registered docu package class names.
*/
public static function getAll(){
return self::$phpdocconfigs;}
return self::$docu_packages;}
/**
* Get a specific phpdocconfig by id
* Get a specific docu package by classname
*
* @param string $id Phpdocconfig id to be found
* @param string $id Class name of the package to be found
* @return array Returns the specific config or throws an Error.
*/
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.');
foreach(self::$docu_packages as $package){
if($package == $id){
return \call_user_func($package.'::get_config');}}
throw new \SYSTEM\LOG\ERROR('Docu Package with classname "'.$id.'" not found.');
}
/**
* Generate HTML Docu by docu classname
*
* @param string $id Classname of Docu Package to generated
* @return array Returns array with logs.
*/
public static function generate($id){
\LIB\lib_phpdocumentor::php();
$config = \SYSTEM\DOCU\docu::get($id);
return \phpdocumentor::run( $config['inpath'],
$config['outpath'],
$config['cachepath'],
$config['ignore'],
$config['title'],
$config['sourcecode'],
$config['parseprivate']);
}
/**
* Generate Markdown Docu by docu classname
*
* @param string $id Classname of Docu Package to generated
* @return array Returns array with logs.
*/
public static function generate_md($id){
\LIB\lib_phpdoc_md::php();
$config = \SYSTEM\DOCU\docu::get($id);
\phpdoc_md::run( $config['inpath_md'],
$config['outpath_md']);
}
}

24
docu/docu_package.php Normal file
View File

@ -0,0 +1,24 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\DOCU
*/
namespace SYSTEM\DOCU;
/**
* Docu Package Interface to abstract from for every docu to be registered.
*/
interface docu_package {
/**
* Config of the Docu Package
*
* @return array Returns array with Config Options
*/
public static function get_config();
}

50
docu/docu_system.php Normal file
View File

@ -0,0 +1,50 @@
<?php
/**
* System - PHP Framework
*
* PHP Version 5.6
*
* @copyright 2016 Ulf Gebhardt (http://www.webcraft-media.de)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/webcraftmedia/system
* @package SYSTEM\DOCU
*/
namespace SYSTEM\DOCU;
/**
* Docu Package Class for System.
*/
class docu_system implements docu_package {
/**
* Config of the Docu Package
*
* @return array Returns array with Config Options
*/
public static function get_config(){
return array( 'id' => 'system',
'inpath' => new \SYSTEM\PSYSTEM(),
'outpath' => new \SYSTEM\PSYSTEM('docu/system/'),
'inpath_md' => new \SYSTEM\PSYSTEM('docu/system/structure.xml'),
'outpath_md' => new \SYSTEM\PSYSTEM('docu/system_wiki/'),
'cachepath' => new \SYSTEM\PSYSTEM('docu/system/cache/'),
'ignore' => array( 'lib/animate/*',
'lib/bootstrap/*',
'lib/bootstrap_growl/*',
'lib/git/*',
'lib/jqbootstrapvalidation/*',
'lib/jquery/*',
'lib/lettering/*',
'lib/markdown/*',
'lib/minify/*',
'lib/phpdocumentor/*',
'lib/scssphp/*',
'lib/tablesorter/*',
'lib/textillate/*',
'lib/tinymce/*',
'lib/jstree/*',
'lib/phpdoc_md/*'),
'sourcecode' => true,
'parseprivate' => false,
'title' => 'SYSTEM - PHP Framework');
}
}

@ -1 +1 @@
Subproject commit b117ce583f21c3258d73c0e336b5c511f5fe90a3
Subproject commit 6dd8080bcbc247178396e6f6d6cbf0fc0aae0b40

@ -1 +1 @@
Subproject commit a73141649db6e58fda9d4a0d1db271c38460bce5
Subproject commit b21ee2aa54e35388bcefbea05053045060abea8b

@ -1 +1 @@
Subproject commit aa913c90511b035125888fe45e41521f85dfbb56
Subproject commit b674508ed84fec7643dcc0be483841d4bf2ef1f9

@ -1 +1 @@
Subproject commit c0b6ba477ddef31f20b1363256e0a87c1c93b06e
Subproject commit 0372a2f50e97fe333f7eae0d3bfd2c47b8d4f697

@ -1 +1 @@
Subproject commit 1f6f4ea7e6eab0f9c0a740530e957d3d73851d14
Subproject commit ff0ae2033b0091f2ace860a683cedb931e2c5a9c

@ -1 +1 @@
Subproject commit 5cbffcf4e9a888ee0a80addaf2a68006cc8a7124
Subproject commit 967f38f6c8ca7569b063673f9083aa98e099be92

@ -1 +1 @@
Subproject commit b632e12b1f2ac67ab2a6a3cb09f93524f27348bd
Subproject commit 95926d395734a9ed7f958d5422b50f21dfb8dde4

@ -1 +1 @@
Subproject commit fa77e997e3fec513cf55416c9f21ce57abcdece4
Subproject commit 0d964b18551f61385da9208bc8daecf267d1398d

@ -1 +1 @@
Subproject commit 71b6af6e9b3750fdc54327b53bc09631ac48ef1d
Subproject commit 1caf5595d88a06e33795304b871d3c2330e408a8

@ -1 +1 @@
Subproject commit dcdc55caa503283a66a5a9a1325f3f27b1475f6c
Subproject commit 1e4a4f181d3b3c28c5ac292d8c23fe93bce6dd12

@ -1 +1 @@
Subproject commit 85f3a6b5a64fd99477d00e0f014789c81fa3c234
Subproject commit 848d57765b8fb9bed5c5ab6746301e8b0439c4ca

@ -1 +1 @@
Subproject commit f0c4f33ba8bfb1904b424e1611d93974d38aa808
Subproject commit ef39cf938da5165a38cf01b5ab980d0dbf2c1108

@ -1 +1 @@
Subproject commit bac779a7b9ef053b8253d4d76c594b03b19157aa
Subproject commit 84ca5459fda67dbd01c3a2f1e57ea72d50b938f0

@ -1 +1 @@
Subproject commit f8158bfdea25f8fae9687e5f999d2258a05f1965
Subproject commit 2492c3e6e1042d744320cfcf551b2da9e6d8068c

@ -1 +1 @@
Subproject commit 4ca4373942cce18aa11b59c7c5ddfd31181f757e
Subproject commit aab326ad891a1af1570bb2c8e51abc800fa85db6

@ -1 +1 @@
Subproject commit 6a3078b3f22b6d2189fdc3d5ddec49365120bc39
Subproject commit 48460acec927a79366c789e4ddf9e40cbc3db42e

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-console" aria-hidden="true"></span>&nbsp;&nbsp;${sai_api_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-console" aria-hidden="true"></span>&nbsp;&nbsp;${sai_api_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-level-up" aria-hidden="true"></span>&nbsp;&nbsp;${sai_cache_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-level-up" aria-hidden="true"></span>&nbsp;&nbsp;${sai_cache_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>&nbsp;&nbsp;${sai_config_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>&nbsp;&nbsp;${sai_config_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -50,6 +50,12 @@ class saimod_sys_cron extends \SYSTEM\SAI\SaiModule {
return \SYSTEM\LOG\JsonResult::ok();
}
/**
* Run a specifc Cron Job
*
* @param string $cls Classname of the Cron
* @return JSON Returns json with status true of error
*/
public static function sai_mod__system_sai_saimod_sys_cron_action_run($cls){
if(!\SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-time" aria-hidden="true"></span>&nbsp;&nbsp;${sai_cron_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-time" aria-hidden="true"></span>&nbsp;&nbsp;${sai_cron_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -4,7 +4,7 @@ function init_saimod_sys_docu() {
$(this).removeClass('active');});
$(this).parent().addClass('active');
});
docu_menu();
//docu_menu();
$('#btn_generate').click(function(){
$.ajax({ type :'GET',

View File

@ -18,33 +18,31 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule {
/**
* Generate the HTML for the Saimods startpage
*
* @param string $cat Docu selected
* @return string Returns HTML for the Saimods startpage
*/
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu(){
$phpdocconfigs = \SYSTEM\DOCU\docu::getAll();
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu($cat = '\SYSTEM\DOCU\docu_system'){
$docu_packages = \SYSTEM\DOCU\docu::getAll();
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU);
$vars['iframesrc'] = \SYSTEM\DOCU\docu::get($cat)['outpath']->WEBPATH(false);
$vars['tabopts'] = '';
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']));}
foreach($docu_packages as $package){
$config = \SYSTEM\DOCU\docu::get($package);
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt.tpl'))->SERVERPATH(), array('tab_id' => $package,'tab_id_pretty' => $config['title'], 'active' => $package == $cat ? 'active' : ''));}
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl'))->SERVERPATH(), $vars);
}
/**
* Generate the HTML Documentation
*
* @return null Returns null
* @return json Returns jsn with log
*/
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'],
$config['outpath'],
$config['cachepath'],
$config['ignore'],
$config['title'],
$config['sourcecode'],
$config['parseprivate']);}
$result = array();
$packages = \SYSTEM\DOCU\docu::getAll();
foreach($packages as $package){
$result[] = \SYSTEM\DOCU\docu::generate($package);}
return \SYSTEM\LOG\JsonResult::toString($result);
}
/**
@ -53,23 +51,11 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule {
* @return null Returns null
*/
public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_generate_md(){
\LIB\lib_phpdoc_md::php();
$configs = \SYSTEM\DOCU\docu::getAll();
foreach($configs as $config){
\phpdoc_md::run( $config['inpath_md'],
$config['outpath_md']);}
$packages = \SYSTEM\DOCU\docu::getAll();
foreach($packages as $package){
\SYSTEM\DOCU\docu::generate_md($package);}
}
/**
* Generate the HTML for the Iframe of the selected Category
*
* @param string $cat Category of the Documentation to be presented
* @return string Returns HTML
*/
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_iframe.tpl'))->SERVERPATH(), $vars);}
/**
* Generate <li> Menu for the Saimod
*

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-book" aria-hidden="true"></span>&nbsp;&nbsp;${sai_docu_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-book" aria-hidden="true"></span>&nbsp;&nbsp;${sai_docu_title}</h4>
</div>
</div>
<div class="row-fluid">
@ -17,7 +17,9 @@
<button id="btn_generate_md" 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} MD</button>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_docu"></div>
<div class="tab-pane active" id="tab_docu">
<iframe src="${iframesrc}" style="width: 100%; min-height: 700px;"></iframe>
</div>
</div>
</div>
</div>

View File

@ -1 +0,0 @@
<iframe src="${iframesrc}" style="width: 100%; min-height: 700px;"></iframe>

View File

@ -1 +1 @@
<li><a href="#!docu;cat.${tab_id}" id="menu_cat_${tab_id}">${tab_id_pretty}</a></li>
<li class="${active}"><a href="#!docu;cat.${tab_id}" id="menu_cat_${tab_id}">${tab_id_pretty}</a></li>

View File

@ -1,7 +1,7 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span>&nbsp;&nbsp;${sai_files_title}</h4>
<h5><font color="#d9534f">${sai_files_title_warning}</font></h6>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span>&nbsp;&nbsp;${sai_files_title}</h4>
<h5>&nbsp;<font color="#d9534f">${sai_files_title_warning}</font></h6>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-saved" aria-hidden="true"></span>&nbsp;&nbsp;${sai_git_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-saved" aria-hidden="true"></span>&nbsp;&nbsp;${sai_git_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;&nbsp;${sai_log_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-alert" aria-hidden="true"></span>&nbsp;&nbsp;${sai_log_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -61,6 +61,11 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule {
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_LOGIN);
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_login/tpl/register.tpl'))->SERVERPATH(), $vars);}
/**
* Request Password Reset
*
* @return string Returns HTML
*/
public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_resetpassword(){
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_LOGIN);
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_login/tpl/resetpassword.tpl'))->SERVERPATH(), $vars);}

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;&nbsp;${sai_mod_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;&nbsp;${sai_mod_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-blackboard" aria-hidden="true"></span>&nbsp;&nbsp;${sai_page_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-blackboard" aria-hidden="true"></span>&nbsp;&nbsp;${sai_page_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-lock" aria-hidden="true"></span>&nbsp;&nbsp;${sai_security_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>&nbsp;&nbsp;${sai_security_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-text-size" aria-hidden="true"></span>&nbsp;&nbsp;${sai_text_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-text-size" aria-hidden="true"></span>&nbsp;&nbsp;${sai_text_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -1,6 +1,6 @@
<div class="row-fluid">
<div class="col-md-12">
<h4><span class="glyphicon glyphicon-list" aria-hidden="true"></span>&nbsp;&nbsp;${sai_todo_title}</h4>
<div class="col-md-12 sai_padding_off">
<h4>&nbsp;<span class="glyphicon glyphicon-list" aria-hidden="true"></span>&nbsp;&nbsp;${sai_todo_title}</h4>
</div>
</div>
<div class="row-fluid">

View File

@ -24,33 +24,6 @@ class saigui {
* @return html Returns html of sai defaultpage.
*/
public function html(){
//register docu here, we require path so system must be started
\SYSTEM\DOCU\docu::register(array( 'id' => 'system',
'inpath' => new \SYSTEM\PSYSTEM(),
'outpath' => new \SYSTEM\PSYSTEM('docu/system/'),
'inpath_md' => new \SYSTEM\PSYSTEM('docu/system/structure.xml'),
'outpath_md' => new \SYSTEM\PSYSTEM('docu/system_wiki/'),
'cachepath' => new \SYSTEM\PSYSTEM('docu/system/cache/'),
'ignore' => array( 'lib/animate/*',
'lib/bootstrap/*',
'lib/bootstrap_growl/*',
'lib/git/*',
'lib/jqbootstrapvalidation/*',
'lib/jquery/*',
'lib/lettering/*',
'lib/markdown/*',
'lib/minify/*',
'lib/phpdocumentor/*',
'lib/scssphp/*',
'lib/tablesorter/*',
'lib/textillate/*',
'lib/tinymce/*',
'lib/jstree/*',
'lib/phpdoc_md/*'),
'sourcecode' => true,
'parseprivate' => false,
'title' => 'SYSTEM - PHP Framework'));
\SYSTEM\SECURITY\security::isLoggedIn(); // refresh session
//Direct JSON Input
$pg = json_decode(file_get_contents("php://input"), true);

View File

@ -22,6 +22,11 @@ class SYS_SECURITY_UPDATE_LASTACTIVE extends \SYSTEM\DB\QP {
*/
public static function get_class(){return \get_class();}
/**
* SQL Insert Types
*
* @return string Returns sql Insert Types
*/
public static function types(){return
'si';
}

View File

@ -363,6 +363,13 @@ class security {
$_SESSION['values'][\SYSTEM\locale::SESSION_KEY] = $_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)]->locale;}
}
/**
* Update Sessiondata upon user infos change
*
* @param $data Data which has changed
* @param $session_id Session ID to be changed or null
* @return null Returns null.
*/
public static function update_session_data($data,$session_id = null){
$old_session_id = \session_id();
if($session_id){

View File

@ -16,8 +16,8 @@ REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (40, 42, 'cron', 'cron', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cron', 'init_saimod_sys_cron', '\\SYSTEM\\SAI\\saimod_sys_cron');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (50, 42, 'docu', 'docu', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (51, 42, 'cat', 'docu', 50, 0, 0, '#tab_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=cat&cat=${cat}', 'init_saimod_sys_docu_cat', '\\SYSTEM\\SAI\\saimod_sys_docu');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (50, 42, 'docu', 'docu', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&cat=${cat}', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu');
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (51, 42, 'cat', 'docu', 50, 0, 0, '#tab_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=cat&cat=${cat}', 'init_saimod_sys_docu_cat', '\\SYSTEM\\SAI\\saimod_sys_docu');
-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (55, 42, 'doc', 'docu', 51, 0, 0, '#tab2_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=doc&cat=${cat}&doc=${doc}', 'init_saimod_sys_docu_doc', '\\SYSTEM\\SAI\\saimod_sys_docu');
REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (60, 42, 'files', 'files', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files', 'init_saimod_sys_files', '\\SYSTEM\\SAI\\saimod_sys_files');

View File

@ -186,7 +186,7 @@ REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `na
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL);
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1101, 42, 3, 1100, 'cat', 'cat', 'STRING');
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1101, 42, 3, 0, '_SYSTEM_SAI_saimod_sys_docu', 'cat', 'STRING');
-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1110, 42, 3, 1100, 'doc', 'cat', 'STRING');
-- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1111, 42, 3, 1100, 'doc', 'doc', 'STRING');

View File

@ -62,6 +62,14 @@ class time {
}
}
/**
* Calaculate the time which has to pass till the given timestamp.
* Scaling from seconds to years. Required strings from tag
* 'time' to be included.
*
* @param int $time Unixtimestamp to be converted
* @return string Returns scaled time string.
*/
public static function time_in_string($time){
$etime = $time - time();
if ($etime < 1){

View File

@ -22,6 +22,11 @@ class SYS_TOKEN_INSERT extends \SYSTEM\DB\QP {
*/
public static function get_class(){return \get_class();}
/**
* SQL Insert Types
*
* @return string Returns sql Insert Types
*/
public static function types(){return
'ssssis';
}

View File

@ -47,6 +47,7 @@ class token{
*
* @param string $class Token_handler Class
* @param array $data Data sved to Database for the token_handler on confirm
* @param string $post_script Function to be called after successfull token confirm
* @return string Returns token string.
*/
public static function request($class,$data=array(),$post_script=null){
@ -91,6 +92,12 @@ class token{
return \SYSTEM\SQL\SYS_TOKEN_CONFIRM::QI(array( \SYSTEM\SECURITY\security::isLoggedIn() ? \SYSTEM\SECURITY\security::getUser()->id : null, $token));
}
/**
* Call token text_success on success
*
* @param string $token token_handler Classname
* @return string Returns token success string.
*/
public static function text_success($token){
$res = self::get($token);
if(!\in_array($res['class'], self::$type_handlers)){
@ -98,6 +105,12 @@ class token{
return \call_user_func_array(array($res['class'], 'text_success'),array($res));
}
/**
* Call token text_fail on fail
*
* @param string $token token_handler Classname
* @return string Returns token fail string.
*/
public static function text_fail($token){
$res = self::get($token);
if(!\in_array($res['class'], self::$type_handlers)){

View File

@ -47,10 +47,22 @@ class token_change_email implements token_handler{
return $result;
}
/**
* Callback text_fail on fail
*
* @param array $token_data Token Data
* @return string Returns token fail string.
*/
public static function text_fail($token_data) {
$data = \json_decode($token_data['data'],true);
return 'Could NOT change your Account\'s EMail-Address to '.$data['email'].'. Token is expired or invalid.';}
/**
* Callback text_success on success
*
* @param array $token_data Token Data
* @return string Returns token success string.
*/
public static function text_success($token_data) {
$data = \json_decode($token_data['data'],true);
return 'Changed your Account\'s EMail-Address to '.$data['email'].'.';}

View File

@ -47,9 +47,21 @@ class token_confirm_email implements token_handler{
return $result;
}
/**
* Callback text_fail on fail
*
* @param array $token_data Token Data
* @return string Returns token fail string.
*/
public static function text_fail($token_data) {
return 'Could NOT confirm your EMail-Address. Token is expired or invalid.';}
/**
* Callback text_success on success
*
* @param array $token_data Token Data
* @return string Returns token success string.
*/
public static function text_success($token_data) {
return 'Confirmed your EMail-Address.';}
}

View File

@ -37,7 +37,19 @@ interface token_handler {
*/
static function confirm($token_data);
/**
* Callback text_success on success
*
* @param array $token_data Token Data
* @return string Returns token success string.
*/
static function text_success($token_data);
/**
* Callback text_success on success
*
* @param array $token_data Token Data
* @return string Returns token success string.
*/
static function text_fail($token_data);
}

View File

@ -42,9 +42,21 @@ class token_reset_password implements token_handler{
$data = \json_decode($token_data['data'],true);
return \SYSTEM\SQL\SYS_SECURITY_RESET_PASSWORD::QI(array($data['pw_sha1'],$data['user'])) ? true : false;}
/**
* Callback text_fail on fail
*
* @param array $token_data Token Data
* @return string Returns token fail string.
*/
public static function text_fail($token_data) {
return 'Could NOT reset your Password. Token is expired or invalid.';}
/**
* Callback text_success on success
*
* @param array $token_data Token Data
* @return string Returns token success string.
*/
public static function text_success($token_data) {
return 'Changed your Password successfully.';}
}