Merge branch 'master' of mojotrollz.eu:system
This commit is contained in:
commit
a7fe462c98
@ -14,12 +14,16 @@ abstract class api_default extends api_system {
|
|||||||
parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params);
|
parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params);
|
||||||
$class = static::get_class($params);
|
$class = static::get_class($params);
|
||||||
if($class){
|
if($class){
|
||||||
|
\libxml_use_internal_errors(true);
|
||||||
$frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false));
|
$frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false));
|
||||||
$html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true));
|
$html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true));
|
||||||
|
if($error = \libxml_get_last_error()){
|
||||||
|
new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$html->saveHTML());}
|
||||||
|
\libxml_clear_errors();
|
||||||
//Load subpage css
|
//Load subpage css
|
||||||
foreach($row['css'] as $css){
|
foreach($row['css'] as $css){
|
||||||
$css_frag = new \DOMDocument();
|
$css_frag = new \DOMDocument();
|
||||||
$css_frag->loadHTML('<link href="'.$css.'" rel="stylesheet">');
|
$css_frag->loadHTML('<link href="'.$css.'" rel="stylesheet" type="text/css">');
|
||||||
$html->getElementsByTagName('head')[0]->appendChild($html->importNode($css_frag->documentElement,true));
|
$html->getElementsByTagName('head')[0]->appendChild($html->importNode($css_frag->documentElement,true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
cron/cron_cache_delete.php
Normal file
9
cron/cron_cache_delete.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\CRON;
|
||||||
|
class cron_cache_delete extends \SYSTEM\CRON\cronjob{
|
||||||
|
public static function run(){
|
||||||
|
if(!\SYSTEM\DBD\SYS_CACHE_DELETE_ALL::QI()){
|
||||||
|
return cronstatus::CRON_STATUS_FAIL;}
|
||||||
|
return cronstatus::CRON_STATUS_SUCCESFULLY;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,11 +9,9 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
|
|||||||
if( $oldest['year'] >= $now_year &&
|
if( $oldest['year'] >= $now_year &&
|
||||||
$oldest['month'] >= $now_month){
|
$oldest['month'] >= $now_month){
|
||||||
return cronstatus::CRON_STATUS_SUCCESFULLY;}
|
return cronstatus::CRON_STATUS_SUCCESFULLY;}
|
||||||
|
|
||||||
$filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db';
|
$filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db';
|
||||||
//extract whole month to file
|
//extract whole month to file
|
||||||
$con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename));
|
$con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename));
|
||||||
|
|
||||||
//create table
|
//create table
|
||||||
$con->query('CREATE TABLE IF NOT EXISTS `system_log` ('.
|
$con->query('CREATE TABLE IF NOT EXISTS `system_log` ('.
|
||||||
' `ID` INT(10) NOT NULL,'.
|
' `ID` INT(10) NOT NULL,'.
|
||||||
@ -38,11 +36,11 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
|
|||||||
|
|
||||||
//write data as trasaction
|
//write data as trasaction
|
||||||
$con->exec('begin transaction');
|
$con->exec('begin transaction');
|
||||||
|
set_time_limit(30);
|
||||||
$res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year']));
|
$res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year']));
|
||||||
$i = 0;
|
|
||||||
while($row = $res->next()){
|
while($row = $res->next()){
|
||||||
set_time_limit(30);
|
set_time_limit(30);
|
||||||
$i++;
|
$row['time'] = array_key_exists('time_pg', $row) ? date("Y-m-d H:i:s", $row['time_pg']) : $row['time'];
|
||||||
if(!$con->exec('INSERT OR IGNORE INTO '.\SYSTEM\DBD\system_log::NAME_MYS.
|
if(!$con->exec('INSERT OR IGNORE INTO '.\SYSTEM\DBD\system_log::NAME_MYS.
|
||||||
'(`ID`, `class`, `message`, `code`, `file`, `line`, `trace`, `ip`, `querytime`, `time`,'.
|
'(`ID`, `class`, `message`, `code`, `file`, `line`, `trace`, `ip`, `querytime`, `time`,'.
|
||||||
' `server_name`, `server_port`, `request_uri`, `post`,'.
|
' `server_name`, `server_port`, `request_uri`, `post`,'.
|
||||||
@ -50,21 +48,21 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
|
|||||||
'VALUES ('.$row['ID'].', \''.\SQLite3::escapeString($row['class']).'\', \''.\SQLite3::escapeString($row['message']).'\', '.
|
'VALUES ('.$row['ID'].', \''.\SQLite3::escapeString($row['class']).'\', \''.\SQLite3::escapeString($row['message']).'\', '.
|
||||||
$row['code'].', \''.\SQLite3::escapeString($row['file']).'\', '.$row['line'].', \''.\SQLite3::escapeString($row['trace']).'\', \''.
|
$row['code'].', \''.\SQLite3::escapeString($row['file']).'\', '.$row['line'].', \''.\SQLite3::escapeString($row['trace']).'\', \''.
|
||||||
$row['ip'].'\', '.$row['querytime'].', \''.$row['time'].'\', \''.
|
$row['ip'].'\', '.$row['querytime'].', \''.$row['time'].'\', \''.
|
||||||
\SQLite3::escapeString($row['server_name']).'\', '.$row['server_port'].', \''.\SQLite3::escapeString($row['request_uri']).'\', \''.\SQLite3::escapeString($row['post']).'\', \''.
|
\SQLite3::escapeString($row['server_name']).'\', '.($row['server_port'] ? $row['server_port'] : 'NULL').', \''.\SQLite3::escapeString($row['request_uri']).'\', \''.\SQLite3::escapeString($row['post']).'\', \''.
|
||||||
\SQLite3::escapeString($row['http_referer']).'\', \''.\SQLite3::escapeString($row['http_user_agent']).'\', '.$row['user'].','.true.');')){
|
\SQLite3::escapeString($row['http_referer']).'\', \''.\SQLite3::escapeString($row['http_user_agent']).'\', '.($row['user'] ? $row['user'] : 'NULL').','.true.');')){
|
||||||
new \SYSTEM\LOG\ERROR('failed to insert into log archiev');
|
new \SYSTEM\LOG\ERROR('failed to insert into log archiev');
|
||||||
return cronstatus::CRON_STATUS_FAIL;
|
return cronstatus::CRON_STATUS_FAIL;
|
||||||
}
|
}
|
||||||
|
//Delete single
|
||||||
|
if(!\SYSTEM\DBD\SYS_LOG_DEL::QI(array($row['ID']))){
|
||||||
|
new \SYSTEM\LOG\ERROR('failed to delete log entries');
|
||||||
|
return cronstatus::CRON_STATUS_FAIL;}
|
||||||
}
|
}
|
||||||
|
set_time_limit(30);
|
||||||
if(!$con->exec('end transaction')){
|
if(!$con->exec('end transaction')){
|
||||||
new \SYSTEM\LOG\ERROR('failed to insert into log archiev');
|
new \SYSTEM\LOG\ERROR('failed to insert into log archiev');
|
||||||
return cronstatus::CRON_STATUS_FAIL;};
|
return cronstatus::CRON_STATUS_FAIL;};
|
||||||
|
|
||||||
//delete from database
|
|
||||||
if(!\SYSTEM\DBD\SYS_LOG_MONTH_DEL::QI(array($oldest['month'],$oldest['year']))){
|
|
||||||
new \SYSTEM\LOG\ERROR('failed to delete log entries');
|
|
||||||
return cronstatus::CRON_STATUS_FAIL;}
|
|
||||||
|
|
||||||
return cronstatus::CRON_STATUS_SUCCESFULLY;
|
return cronstatus::CRON_STATUS_SUCCESFULLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
10
dbd/qq/SYS_CACHE_DELETE_ALL.php
Normal file
10
dbd/qq/SYS_CACHE_DELETE_ALL.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CACHE_DELETE_ALL extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'DELETE FROM system.cache;'
|
||||||
|
//mys
|
||||||
|
);}}
|
||||||
11
dbd/qq/SYS_LOG_DEL.php
Normal file
11
dbd/qq/SYS_LOG_DEL.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_LOG_DEL extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE "ID" = $1;',
|
||||||
|
//mys
|
||||||
|
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE ID = ?;'
|
||||||
|
);}}
|
||||||
@ -5,7 +5,7 @@ class SYS_LOG_MONTH extends \SYSTEM\DB\QP {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'SELECT * FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE MONTH(time) = $1 AND YEAR(time) = $2 ORDER BY time ASC',
|
'SELECT extract(epoch from time) as time_pg,* FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE EXTRACT(MONTH FROM time)::INTEGER = $1 AND EXTRACT(YEAR FROM time)::INTEGER = $2 LIMIT 10000;',//ORDER BY time ASC
|
||||||
//mys
|
//mys
|
||||||
'SELECT * FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE MONTH(time) = ? AND YEAR(time) = ? ORDER BY time ASC'
|
'SELECT * FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE MONTH(time) = ? AND YEAR(time) = ? ORDER BY time ASC LIMIT 10000;'
|
||||||
);}}
|
);}}
|
||||||
@ -5,7 +5,7 @@ class SYS_LOG_MONTH_DEL extends \SYSTEM\DB\QP {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE MONTH(time) = $1 AND YEAR(time) = $2;',
|
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE EXTRACT(MONTH FROM time)::INTEGER = $1 AND EXTRACT(YEAR FROM time)::INTEGER = $2;',
|
||||||
//mys
|
//mys
|
||||||
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE MONTH(time) = ? AND YEAR(time) = ?;'
|
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE MONTH(time) = ? AND YEAR(time) = ?;'
|
||||||
);}}
|
);}}
|
||||||
@ -5,7 +5,7 @@ class SYS_LOG_OLDEST extends \SYSTEM\DB\QQ {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'SELECT MONTH(time) as month, YEAR(time) as year FROM '.\SYSTEM\DBD\system_log::NAME_PG.' ORDER BY time ASC LIMIT 1',
|
'SELECT EXTRACT(MONTH FROM time)::INTEGER as month, EXTRACT(YEAR FROM time)::INTEGER as year FROM '.\SYSTEM\DBD\system_log::NAME_PG.' ORDER BY time ASC LIMIT 1',
|
||||||
//mys
|
//mys
|
||||||
'SELECT MONTH(time) as month, YEAR(time) as year FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' ORDER BY time ASC LIMIT 1'
|
'SELECT MONTH(time) as month, YEAR(time) as year FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' ORDER BY time ASC LIMIT 1'
|
||||||
);}}
|
);}}
|
||||||
@ -7,11 +7,11 @@ class SYS_PAGE_GROUP extends \SYSTEM\DB\QP {
|
|||||||
//pg
|
//pg
|
||||||
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_PG
|
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_PG
|
||||||
.' WHERE "'.\SYSTEM\DBD\system_page::FIELD_GROUP.'" = $1'
|
.' WHERE "'.\SYSTEM\DBD\system_page::FIELD_GROUP.'" = $1'
|
||||||
.' AND "'.\SYSTEM\DBD\system_page::FIELD_ID.'" = $2'
|
.' AND "'.\SYSTEM\DBD\system_page::FIELD_STATE.'" = $2'
|
||||||
.' ORDER BY "'.\SYSTEM\DBD\system_page::FIELD_ID.'"',
|
.' ORDER BY "'.\SYSTEM\DBD\system_page::FIELD_ID.'" ASC;',
|
||||||
//mys
|
//mys
|
||||||
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_MYS
|
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_MYS
|
||||||
.' WHERE `'.\SYSTEM\DBD\system_page::FIELD_GROUP.'` = ?'
|
.' WHERE `'.\SYSTEM\DBD\system_page::FIELD_GROUP.'` = ?'
|
||||||
.' AND `'.\SYSTEM\DBD\system_page::FIELD_ID.'` = ?'
|
.' AND `'.\SYSTEM\DBD\system_page::FIELD_STATE.'` = ?'
|
||||||
.' ORDER BY '.\SYSTEM\DBD\system_page::FIELD_ID
|
.' ORDER BY '.\SYSTEM\DBD\system_page::FIELD_ID.' ASC;'
|
||||||
);}}
|
);}}
|
||||||
@ -5,7 +5,6 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 42, 1, 0, NULL, 'js', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 42, 1, 0, NULL, 'js', NULL);
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 42, 1, 0, NULL, 'css', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 42, 1, 0, NULL, 'css', NULL);
|
||||||
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL);
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL);
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING');
|
|
||||||
|
|
||||||
-- system_api
|
-- system_api
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 0, -1, NULL, 'call', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 0, -1, NULL, 'call', NULL);
|
||||||
@ -30,6 +29,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 42, 2, 55, NULL, 'group', 'UINT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 42, 2, 55, NULL, 'group', 'UINT');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 42, 4, -1, NULL, '_lang', 'LANG');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 42, 4, -1, NULL, '_lang', 'LANG');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 42, 4, -1, NULL, '_result', 'RESULT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 42, 4, -1, NULL, '_result', 'RESULT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (92, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING');
|
||||||
|
|
||||||
-- specific stuff for mods
|
-- specific stuff for mods
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL);
|
||||||
@ -74,7 +74,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (341, 42, 2, 300, 'deleterightuser', 'userid', 'UINT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (341, 42, 2, 300, 'deleterightuser', 'userid', 'UINT');
|
||||||
|
|
||||||
|
|
||||||
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (400, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_sai_mods', 'action', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (400, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_mod', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL);
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL);
|
||||||
@ -89,7 +89,10 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (606, 42, 2, 600, 'addcall', 'name', 'STRING');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (606, 42, 2, 600, 'addcall', 'name', 'STRING');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (607, 42, 2, 600, 'addcall', 'verify', 'ALL');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (607, 42, 2, 600, 'addcall', 'verify', 'ALL');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (608, 42, 2, 600, 'deletecall', 'ID', 'INT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (608, 42, 2, 600, 'deletecall', 'ID', 'INT');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (609, 42, 2, 600, 'deletedialog', 'ID', 'INT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (609, 42, 2, 600, 'deletecall', 'group', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (610, 42, 2, 600, 'deletedialog', 'ID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (611, 42, 2, 600, 'deletedialog', 'group', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (620, 42, 3, 600, 'list', 'group', 'INT');
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_text', 'action', NULL);
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_text', 'action', NULL);
|
||||||
@ -150,3 +153,17 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 2, 1200, 'change', 'cls', 'STRING');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 2, 1200, 'change', 'cls', 'STRING');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1211, 42, 2, 1200, 'change', 'status', 'INT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1211, 42, 2, 1200, 'change', 'status', 'INT');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_page', 'action', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1301, 42, 2, 1300, 'addcall', 'ID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1302, 42, 2, 1300, 'addcall', 'group', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1303, 42, 2, 1300, 'addcall', 'type', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1304, 42, 2, 1300, 'addcall', 'parentID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1305, 42, 2, 1300, 'addcall', 'parentValue', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1306, 42, 2, 1300, 'addcall', 'name', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1307, 42, 2, 1300, 'addcall', 'verify', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1308, 42, 2, 1300, 'deletecall', 'ID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1309, 42, 2, 1300, 'deletecall', 'group', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1310, 42, 2, 1300, 'deletedialog', 'ID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1311, 42, 2, 1300, 'deletedialog', 'group', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1320, 42, 3, 1300, 'list', 'group', 'INT');
|
||||||
@ -23,3 +23,4 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
|||||||
|
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 0, 4, -1, NULL, '_lang', 'LANG');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 0, 4, -1, NULL, '_lang', 'LANG');
|
||||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 0, 4, -1, NULL, '_result', 'RESULT');
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 0, 4, -1, NULL, '_result', 'RESULT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (92, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING');
|
||||||
@ -1 +1,2 @@
|
|||||||
INSERT INTO `system_cron` (`class`, `min`, `hour`, `day`, `day_week`, `month`, `last_run`, `status`) VALUES ('\\SYSTEM\\CRON\\cron_log2sqlite', 0, 0, 0, 0, 0, '2015-01-01 01:00:00', 0);
|
INSERT INTO `system_cron` (`class`, `min`, `hour`, `day`, `day_week`, `month`, `last_run`, `status`) VALUES ('\\SYSTEM\\CRON\\cron_log2sqlite', 0, 0, 1, 0, 0, '2015-01-01 01:00:00', 0);
|
||||||
|
INSERT INTO `system_cron` (`class`, `min`, `hour`, `day`, `day_week`, `month`, `last_run`, `status`) VALUES ('\\SYSTEM\\CRON\\cron_cache_delete', 0, 0, 1, 0, 0, '2015-01-01 01:00:00', 0);
|
||||||
|
|||||||
@ -1,13 +1,47 @@
|
|||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'api', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api', 'init_saimod_sys_api', '\\SYSTEM\\SAI\\saimod_sys_api');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (0, 'start', 42, 'start', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saistart_sys_sai', 'init_saistart_sys_sai', '\\SYSTEM\\SAI\\saistart_sys_sai');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'cache', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cache', 'init_saimod_sys_cache', '\\SYSTEM\\SAI\\saimod_sys_cache');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (1, 'todo', 42, 'start', 0, 0, '#todo_entries', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todolist', '', '');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'config', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_config', 'init_saimod_sys_config', '\\SYSTEM\\SAI\\saimod_sys_config');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (2, 'log', 42, 'start', 0, 0, '#log_entries', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter', '', '');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'cron', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cron', 'init_saimod_sys_cron', '\\SYSTEM\\SAI\\saimod_sys_cron');
|
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'docu', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (10, 'api', 42, 'api', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api', 'init_saimod_sys_api', '\\SYSTEM\\SAI\\saimod_sys_api');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'files', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files', 'init_saimod_sys_files', '\\SYSTEM\\SAI\\saimod_sys_files');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (11, 'all', 42, 'api', 10, 0, '#tab_api', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api&action=list&group=${group}', 'init_saimod_sys_api_list', '\\SYSTEM\\SAI\\saimod_sys_api');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'log', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log', 'init_saimod_sys_log', '\\SYSTEM\\SAI\\saimod_sys_log');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (12, 'delete', 42, 'api', 10, 1, '#tab_api', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api&action=deletedialog&group=${group}&ID=${id}', 'init_saimod_sys_api_delete', '\\SYSTEM\\SAI\\saimod_sys_api');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'login', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_login', 'init_saimod_sys_login', '\\SYSTEM\\SAI\\saimod_sys_login');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (13, 'new', 42, 'api', 10, 1, '#tab_api', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api&action=newdialog', 'init_saimod_sys_api_new', '\\SYSTEM\\SAI\\saimod_sys_api');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'mod', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_mod', 'init_saimod_sys_mod', '\\SYSTEM\\SAI\\saimod_sys_mod');
|
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'security', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security', 'init_saimod_sys_security', '\\SYSTEM\\SAI\\saimod_sys_security');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (20, 'cache', 42, 'cache', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cache', 'init_saimod_sys_cache', '\\SYSTEM\\SAI\\saimod_sys_cache');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'start', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saistart_sys_sai', 'init_saistart_sys_sai', '\\SYSTEM\\SAI\\saistart_sys_sai');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (30, 'config', 42, 'config', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_config', 'init_saimod_sys_config', '\\SYSTEM\\SAI\\saimod_sys_config');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'text', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text', 'init_saimod_sys_text', '\\SYSTEM\\SAI\\saimod_sys_text');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (40, 'cron', 42, 'cron', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cron', 'init_saimod_sys_cron', '\\SYSTEM\\SAI\\saimod_sys_cron');
|
||||||
INSERT INTO `system_page` (`group`, `id`, `div`, `url`, `func`, `php_class`) VALUES (42, 'todo', '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo', 'init_saimod_sys_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (50, 'docu', 42, 'docu', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (60, 'files', 42, 'files', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files', 'init_saimod_sys_files', '\\SYSTEM\\SAI\\saimod_sys_files');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (70, 'log', 42, 'log', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log', 'init_saimod_sys_log', '\\SYSTEM\\SAI\\saimod_sys_log');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (71, 'list', 42, 'log', 70, 0, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter&filter=${filter}', 'init_saimod_sys_log_log', '\\SYSTEM\\SAI\\saimod_sys_log');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (72, 'stats', 42, 'log', 70, 1, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=stats', 'init_saimod_sys_log_stats', '\\SYSTEM\\SAI\\saimod_sys_log');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (73, 'error', 42, 'log', 70, 1, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=error&error=${error}', '', '');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (80, 'login', 42, 'login', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_login', 'init_saimod_sys_login', '\\SYSTEM\\SAI\\saimod_sys_login');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (90, 'mod', 42, 'mod', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_mod', 'init_saimod_sys_mod', '\\SYSTEM\\SAI\\saimod_sys_mod');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (91, 'system', 42, 'mod', 90, 0, '#tab_mod', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_mod&action=system', 'init_saimod_sys_mod_system', '\\SYSTEM\\SAI\\saimod_sys_mod');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (92, 'project', 42, 'mod', 90, 1, '#tab_mod', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_mod&action=project', 'init_saimod_sys_mod_project', '\\SYSTEM\\SAI\\saimod_sys_mod');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (100, 'security', 42, 'security', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security', 'init_saimod_sys_security', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (101, 'users', 42, 'security', 100, 0, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=users&search=${search}', 'init_saimod_sys_security_users', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (102, 'rights', 42, 'security', 100, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=rights', 'init_saimod_sys_security_rights', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (103, 'user', 42, 'security', 100, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=user&username=${username}', 'init_saimod_sys_security_user', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (104, 'newright', 42, 'security', 100, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright', 'init_saimod_sys_security_newright', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (105, 'delright', 42, 'security', 100, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleterightconfirm&id=${id}', 'init_saimod_sys_security_delright', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (110, 'text', 42, 'text', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text', 'init_saimod_sys_text', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (120, 'todo', 42, 'todo', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo', 'init_saimod_sys_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (121, 'todolist', 42, 'todo', 120, 0, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todolist', 'init_saimod_sys_todo_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (122, 'doto', 42, 'todo', 120, 1, '#tab_todo', '/sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=dotolist', 'init_saimod_sys_todo_doto', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (123, 'stats', 42, 'todo', 120, 1, '#tab_todo', '/sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=stats', 'init_saimod_sys_todo_stats', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (124, 'todoopen', 42, 'todo', 120, 1, '#tab_todo', '/sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todo&todo=${todo}', 'init_saimod_sys_todo_todoopen', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (125, 'todoclose', 42, 'todo', 120, 1, '#tab_todo', '/sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todo&todo=${todo}', 'init_saimod_sys_todo_todoclose', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (126, 'new', 42, 'todo', 120, 1, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=new', 'init_saimod_sys_todo_new', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||||
|
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (130, 'page', 42, 'page', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_page', 'init_saimod_sys_page', '\\SYSTEM\\SAI\\saimod_sys_page');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (131, 'all', 42, 'page', 130, 0, '#tab_page', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_page&action=list&group=${group}', 'init_saimod_sys_page_list', '\\SYSTEM\\SAI\\saimod_sys_page');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (132, 'delete', 42, 'page', 130, 1, '#tab_page', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_page&action=deletedialog&group=${group}&ID=${id}', 'init_saimod_sys_page_delete', '\\SYSTEM\\SAI\\saimod_sys_page');
|
||||||
|
INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (133, 'new', 42, 'page', 130, 1, '#tab_page', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_page&action=newdialog', 'init_saimod_sys_page_new', '\\SYSTEM\\SAI\\saimod_sys_page');
|
||||||
@ -1,11 +1,16 @@
|
|||||||
CREATE TABLE `system_page` (
|
CREATE TABLE `system_page` (
|
||||||
|
`id` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`name` CHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
|
||||||
`group` INT(10) UNSIGNED NOT NULL,
|
`group` INT(10) UNSIGNED NOT NULL,
|
||||||
`id` CHAR(50) NOT NULL,
|
`state` CHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
|
||||||
`div` CHAR(50) NOT NULL,
|
`parent_id` INT(10) UNSIGNED NOT NULL,
|
||||||
`url` TEXT NOT NULL,
|
`type` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
`func` CHAR(50) NOT NULL,
|
`div` CHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
|
||||||
`php_class` CHAR(50) NOT NULL,
|
`url` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
|
||||||
PRIMARY KEY (`id`, `div`, `group`)
|
`func` CHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
|
||||||
|
`php_class` CHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
|
||||||
|
PRIMARY KEY (`id`, `group`, `state`, `name`)
|
||||||
)
|
)
|
||||||
COLLATE='utf8_unicode_ci'
|
COLLATE='utf8_unicode_ci'
|
||||||
ENGINE=InnoDB;
|
ENGINE=InnoDB
|
||||||
|
;
|
||||||
|
|||||||
@ -19,6 +19,11 @@ INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, ve
|
|||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (50, 42, 2, 10, 'pagestates', 'group', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (51, 42, 1, 50, NULL, 'js', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (52, 42, 2, 51, NULL, 'group', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (55, 42, 1, 50, NULL, 'css', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (56, 42, 2, 55, NULL, 'group', 'UINT');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (40, 42, 4, -1, NULL, '_lang', 'LANG');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (40, 42, 4, -1, NULL, '_lang', 'LANG');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (41, 42, 4, -1, NULL, '_result', 'RESULT');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (41, 42, 4, -1, NULL, '_result', 'RESULT');
|
||||||
|
|
||||||
@ -43,6 +48,7 @@ INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, ve
|
|||||||
--
|
--
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (220, 42, 0, 200, 'stats', 'name', null);
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (220, 42, 0, 200, 'stats', 'name', null);
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (221, 42, 3, 220, null, 'filter', 'UINT');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (221, 42, 3, 220, null, 'filter', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (222, 42, 3, 220, null, 'db', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL);
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL);
|
||||||
@ -70,7 +76,16 @@ INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, ve
|
|||||||
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL);
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (600, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_api', 'action', NULL);
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (600, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_api', 'action', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (601, 42, 2, 600, 'addcall', 'ID', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (602, 42, 2, 600, 'addcall', 'group', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (603, 42, 2, 600, 'addcall', 'type', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (604, 42, 2, 600, 'addcall', 'parentID', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (605, 42, 2, 600, 'addcall', 'parentValue', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (606, 42, 2, 600, 'addcall', 'name', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (607, 42, 2, 600, 'addcall', 'verify', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (608, 42, 2, 600, 'deletecall', 'ID', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (609, 42, 2, 600, 'deletedialog', 'ID', 'INT');
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_locale', 'action', NULL);
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_locale', 'action', NULL);
|
||||||
@ -114,6 +129,8 @@ INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, ve
|
|||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1010, 42, 2, 1000, 'edit', 'todo', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1011, 42, 2, 1000, 'edit', 'message', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL);
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL);
|
||||||
@ -127,3 +144,5 @@ INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, ve
|
|||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1206, 42, 2, 1200, 'add', 'month', 'INT');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1206, 42, 2, 1200, 'add', 'month', 'INT');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1208, 42, 2, 1200, 'del', 'cls', 'STRING');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1208, 42, 2, 1200, 'del', 'cls', 'STRING');
|
||||||
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING');
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1210, 42, 2, 1200, 'change', 'cls', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1211, 42, 2, 1200, 'change', 'status', 'INT');
|
||||||
1
dbd/sql/pg/data/system_cron.sql
Normal file
1
dbd/sql/pg/data/system_cron.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
INSERT INTO system.cron (class, min, hour, day, day_week, month, last_run, status) VALUES ('\SYSTEM\CRON\cron_log2sqlite', 0, 0, 0, 0, 0, NULL, 0);
|
||||||
@ -5,8 +5,12 @@ class system_page {
|
|||||||
const NAME_PG = 'system.page';
|
const NAME_PG = 'system.page';
|
||||||
const NAME_MYS = 'system_page';
|
const NAME_MYS = 'system_page';
|
||||||
|
|
||||||
const FIELD_GROUP = 'group';
|
|
||||||
const FIELD_ID = 'id';
|
const FIELD_ID = 'id';
|
||||||
|
const FIELD_NAME = 'name';
|
||||||
|
const FIELD_GROUP = 'group';
|
||||||
|
const FIELD_STATE = 'state';
|
||||||
|
const FIELD_PARENT_ID = 'parent_id';
|
||||||
|
const FIELD_TYPE = 'type';
|
||||||
const FIELD_DIV = 'div';
|
const FIELD_DIV = 'div';
|
||||||
const FIELD_URL = 'url';
|
const FIELD_URL = 'url';
|
||||||
const FIELD_FUNC = 'func';
|
const FIELD_FUNC = 'func';
|
||||||
|
|||||||
@ -28,6 +28,9 @@ class files {
|
|||||||
}else{
|
}else{
|
||||||
\SYSTEM\HEADER::FILE($id);}
|
\SYSTEM\HEADER::FILE($id);}
|
||||||
|
|
||||||
|
//Allow Caching for all files
|
||||||
|
header('Cache-Control: public;');
|
||||||
|
|
||||||
if(!self::file_get_contents_chunked(self::$folders[$cat].$id,4096,function($chunk,&$handle,$iteration){echo $chunk;})){
|
if(!self::file_get_contents_chunked(self::$folders[$cat].$id,4096,function($chunk,&$handle,$iteration){echo $chunk;})){
|
||||||
throw new \SYSTEM\LOG\ERROR("Could not transfere File.");}
|
throw new \SYSTEM\LOG\ERROR("Could not transfere File.");}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
var system = null;
|
var system = null;
|
||||||
|
|
||||||
//mother object
|
//mother object
|
||||||
function SYSTEM(endpoint, group,start_state,hashchange){
|
function SYSTEM(endpoint,group,start_state,hash_change){
|
||||||
system = this;
|
system = this;
|
||||||
|
|
||||||
this.LOG_START = 0;
|
this.LOG_START = 0;
|
||||||
@ -10,104 +10,147 @@ function SYSTEM(endpoint, group,start_state,hashchange){
|
|||||||
|
|
||||||
this.endpoint = endpoint;
|
this.endpoint = endpoint;
|
||||||
this.group = group;
|
this.group = group;
|
||||||
this.pages = null;
|
this.start_state = start_state;
|
||||||
|
this.hash_change = hash_change;
|
||||||
|
|
||||||
this.state = {};
|
this.state = {};
|
||||||
this.state_info = {};
|
this.state_info = {};
|
||||||
this.start_state = start_state;
|
this.state_js = {};
|
||||||
this.go_state(start_state);
|
this.state_css = {};
|
||||||
|
|
||||||
$(window).bind('hashchange', function( event ) {
|
this.hashchange();
|
||||||
system.go_state();
|
$(window).bind('hashchange', this.hashchange);
|
||||||
//user callback
|
|
||||||
if(hashchange){
|
|
||||||
hashchange(system.cur_state());}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
//internal function to handle pagestate results
|
SYSTEM.prototype.hashchange = function () {
|
||||||
SYSTEM.prototype.handle_call_pages = function (data,id,forced,cached) {
|
system.go_state(system.start_state);
|
||||||
if(data['status']){
|
//user callback
|
||||||
system.log_info('load pages: endpoint '+system.endpoint+' group:'+system.group+' state:'+id+' - '+(cached ? 'cached ' : 'success'));
|
if(system.hash_change){
|
||||||
//state not found?
|
system.hash_change(system.cur_state().split(';')[0].split('(')[0]);}
|
||||||
if(data['result'].length === 0){
|
};
|
||||||
system.log_error('load pages: endpoint '+system.endpoint+' group:'+system.group+' state:'+id+' - state not found - redirecting to start state: '+system.start_state);
|
SYSTEM.prototype.handle_call_pages_page = function (html,entry,id,forced,cached,trycount) {
|
||||||
system.load(system.start_state);
|
var url = entry['url']+(window.location.search.substr(1) ? '&'+window.location.search.substr(1) : '' );
|
||||||
return;}
|
if(!trycount){
|
||||||
//cache state info data
|
trycount = 0;}
|
||||||
system.state_info[id] = data;
|
trycount++;
|
||||||
//update history?
|
if($(entry['div']).length){
|
||||||
if(id !== system.cur_state()){
|
$(entry['div']).html(html);
|
||||||
window.history.pushState(null, "", '#!'+id);}
|
this.log_info('load page: '+id+entry['div']+' '+url+' - try '+trycount+' - success');
|
||||||
data['result'].forEach(function(entry) {
|
} else {
|
||||||
//check loaded state of div - reload only if required
|
this.log_error('load page: '+id+entry['div']+' '+url+' - try '+trycount+' - div not found');
|
||||||
if(forced || system.state[entry['div']] !== entry['url']+'&'+window.location.search.substr(1)){
|
//Try again
|
||||||
//load pages
|
if(trycount < 3){
|
||||||
$.ajax({
|
var tc = trycount;
|
||||||
async: false,
|
setTimeout(function() { system.handle_call_pages_page(html,entry,id,forced,cached,tc); },1000);
|
||||||
data: {},
|
}
|
||||||
dataType: 'html',
|
return;
|
||||||
url: entry['url']+'&'+window.location.search.substr(1),
|
}
|
||||||
success: function(data){
|
//load css
|
||||||
if($(entry['div']).length){
|
for(var i=0; i < entry['css'].length; i++){
|
||||||
$(entry['div']).html(data);
|
this.load_css(entry['css'][i],forced);}
|
||||||
system.log_info('load page: '+id+entry['div']+' '+entry['url']+'&'+window.location.search.substr(1)+' - success');
|
//load js
|
||||||
} else {
|
var call_func = true;
|
||||||
system.log_error('load page: '+id+entry['div']+' '+entry['url']+'&'+window.location.search.substr(1)+' - div not found');
|
var loaded = 0;
|
||||||
}},
|
for(var i=0; i < entry['js'].length; i++){
|
||||||
error: function(XMLHttpRequest, textStatus, errorThrown){system.log(system.LOG_ERROR,errorThrown);}
|
if(forced || !this.state_js[entry['js'][i]]){
|
||||||
});
|
this.log_info('load js: '+entry['js'][i]+(forced ? ' - forced' : ''));
|
||||||
//load css
|
$.getScript(entry['js'][i])
|
||||||
for(var i=0; i < entry['css'].length; i++){
|
.done(function(response, status, jqxhr) {
|
||||||
system.load_css(entry['css'][i]);}
|
system.log_info('load js: '+status);
|
||||||
//load js
|
system.state_js[entry['js'][i]] = true;
|
||||||
var call_func = true;
|
if(loaded++ === entry['js'].length-1){
|
||||||
var loaded = 0;
|
var fn = window[entry['func']];
|
||||||
for(var i=0; i < entry['js'].length; i++){
|
if(call_func ){
|
||||||
system.log(system.LOG_INFO,'load js: '+entry['js'][i]);
|
if(typeof fn === 'function'){
|
||||||
$.getScript(entry['js'][i]).done(function(response, status) {
|
|
||||||
system.log(system.LOG_INFO,'load js: '+status);
|
|
||||||
if(loaded++ === entry['js'].length-1){
|
|
||||||
var fn = window[entry['func']];
|
|
||||||
if(call_func && typeof fn === 'function'){
|
|
||||||
call_func = false;
|
call_func = false;
|
||||||
fn();
|
fn();
|
||||||
system.log_info('call func: '+entry['func']);
|
system.log_info('call func: '+entry['func']);
|
||||||
} else {
|
} else {
|
||||||
system.log_error('call func: '+entry['func']+' - fail');
|
system.log_error('call func: '+entry['func']+' - fail');
|
||||||
}}
|
}
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.fail(function( jqxhr, settings, exception ) {
|
||||||
|
system.log_error( "Something went wrong"+exception );
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.log_info('load js: '+entry['js'][i]+' - cached');
|
||||||
|
if(loaded++ === entry['js'].length-1){
|
||||||
|
var fn = window[entry['func']];
|
||||||
|
if(call_func && typeof fn === 'function'){
|
||||||
|
call_func = false;
|
||||||
|
fn();
|
||||||
|
this.log_info('call func: '+entry['func']);
|
||||||
|
} else {
|
||||||
|
this.log_error('call func: '+entry['func']+' - fail');
|
||||||
}
|
}
|
||||||
//update state
|
|
||||||
system.state[entry['div']] = entry['url']+'&'+window.location.search.substr(1);
|
|
||||||
} else {
|
|
||||||
system.log_info('load page: '+id+entry['div']+' '+entry['url']+'&'+window.location.search.substr(1)+' - skipped - already loaded');
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
//try 2 call function even when no js is loaded(substates do that)
|
||||||
|
var fn = window[entry['func']];
|
||||||
|
if(call_func && typeof fn === 'function'){
|
||||||
|
call_func = false;
|
||||||
|
fn();
|
||||||
|
this.log_info('call func: '+entry['func']);
|
||||||
|
}
|
||||||
|
//update state
|
||||||
|
this.state[entry['div']] = url;
|
||||||
|
}
|
||||||
|
SYSTEM.prototype.handle_call_pages_entry = function (entry,id,forced,cached) {
|
||||||
|
var url = entry['url']+(window.location.search.substr(1) ? '&'+window.location.search.substr(1) : '' );
|
||||||
|
//check loaded state of div - reload only if required
|
||||||
|
if(forced || this.state[entry['div']] !== url || !$(entry['div']).length || $(entry['div']).html() === ''){
|
||||||
|
//load page
|
||||||
|
this.call_url(url,function(data){system.handle_call_pages_page(data,entry,id,forced,cached);},{},'html',true);
|
||||||
} else {
|
} else {
|
||||||
console.log(data);
|
this.log_info('load page: '+id+entry['div']+' '+url+' - cached');
|
||||||
system.log_info('Problem with your Pages: '+data['result']['message']);
|
}
|
||||||
|
}
|
||||||
|
//internal function to handle pagestate results
|
||||||
|
SYSTEM.prototype.handle_call_pages = function (data,id,forced,cached) {
|
||||||
|
if(data['status']){
|
||||||
|
this.log_info('load pages: endpoint '+this.endpoint+' group:'+this.group+' state:'+id+' - '+(cached ? 'cached ' : (forced ? 'forced' : 'success')));
|
||||||
|
//state not found?
|
||||||
|
if(data['result'].length === 0){
|
||||||
|
this.log_error('load pages: endpoint '+this.endpoint+' group:'+this.group+' state:'+id+' - state not found - redirecting to start state: '+this.start_state);
|
||||||
|
this.load(this.start_state);
|
||||||
|
return;}
|
||||||
|
//cache state info data
|
||||||
|
this.state_info[id] = data;
|
||||||
|
//update history?
|
||||||
|
if(id !== this.cur_state()){
|
||||||
|
window.history.pushState(null, "", '#!'+id);}
|
||||||
|
data['result'].forEach(
|
||||||
|
function(entry) { system.handle_call_pages_entry(entry,id,forced,cached);});
|
||||||
|
} else {
|
||||||
|
this.log_info('Problem with your Pages: '+data['result']['message']);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//send a call to the endpoint
|
//send a call to the endpoint
|
||||||
SYSTEM.prototype.call = function(call,success,data,data_type,async){
|
SYSTEM.prototype.call = function(call,success,data,data_type,async){
|
||||||
|
this.call_url(this.endpoint+'?'+call,success,data,data_type,async);
|
||||||
|
};
|
||||||
|
SYSTEM.prototype.call_url = function(url,success,data,data_type,async){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
async: async,
|
async: async,
|
||||||
data: data,
|
data: data,
|
||||||
dataType: data_type,
|
dataType: data_type,
|
||||||
url: this.endpoint+'?'+call,
|
url: url,
|
||||||
success: success,
|
success: success,
|
||||||
error: function(XMLHttpRequest, textStatus, errorThrown){system.log(system.LOG_ERROR,call+' '+XMLHttpRequest+' '+textStatus+' '+errorThrown);}
|
error: function(XMLHttpRequest, textStatus, errorThrown){system.log_error(call+' '+XMLHttpRequest+' '+textStatus+' '+errorThrown);}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
SYSTEM.prototype.log = function(type,msg){
|
SYSTEM.prototype.log = function(type,msg){
|
||||||
var res = '';
|
var res = '';
|
||||||
switch(type){
|
switch(type){
|
||||||
case system.LOG_START:
|
case this.LOG_START:
|
||||||
res = '#SYSTEM: ';
|
res = '#SYSTEM: ';
|
||||||
break;
|
break;
|
||||||
case system.LOG_INFO:
|
case this.LOG_INFO:
|
||||||
res = '-SYSTEM: ';
|
res = '-SYSTEM: ';
|
||||||
break;
|
break;
|
||||||
case system.LOG_ERROR:
|
case this.LOG_ERROR:
|
||||||
res = '!SYSTEM-ERROR: ';
|
res = '!SYSTEM-ERROR: ';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -119,30 +162,33 @@ SYSTEM.prototype.log_error = function(msg){
|
|||||||
this.log(this.LOG_ERROR,msg);}
|
this.log(this.LOG_ERROR,msg);}
|
||||||
//load a pagestatewith given id
|
//load a pagestatewith given id
|
||||||
SYSTEM.prototype.load = function(id,forced){
|
SYSTEM.prototype.load = function(id,forced){
|
||||||
this.log(system.LOG_START,'load page: '+id+(forced ? ' - forced' : ''));
|
this.log(this.LOG_START,'load page: '+id+(forced ? ' - forced' : ''));
|
||||||
if(!forced && this.state_info[id]){
|
if(!forced && this.state_info[id]){
|
||||||
this.handle_call_pages(this.state_info[id],id,forced,true);
|
this.handle_call_pages(this.state_info[id],id,forced,true);
|
||||||
}else {
|
}else {
|
||||||
this.call('call=pages&group='+this.group+'&state='+id,function(data){system.handle_call_pages(data,id,forced,false);},{},"json",false);}
|
this.call('call=pages&group='+this.group+'&state='+id,function(data){system.handle_call_pages(data,id,forced,false);},{},"json",false);}
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSTEM.prototype.load_css = function loadCSS(csssrc) {
|
SYSTEM.prototype.load_css = function loadCSS(csssrc,forced) {
|
||||||
var snode = document.createElement('link');
|
if(forced || !this.state_css[csssrc]){
|
||||||
snode.setAttribute('type','text/css');
|
var snode = document.createElement('link');
|
||||||
snode.setAttribute('rel', 'stylesheet');
|
snode.setAttribute('type','text/css');
|
||||||
snode.setAttribute('href',csssrc);
|
snode.setAttribute('rel', 'stylesheet');
|
||||||
document.getElementsByTagName('head')[0].appendChild(snode);
|
snode.setAttribute('href',csssrc);
|
||||||
system.log(system.LOG_INFO,'load css '+csssrc);
|
document.getElementsByTagName('head')[0].appendChild(snode);
|
||||||
|
this.state_css[csssrc] = true;
|
||||||
|
this.log_info('load css '+csssrc+' - '+(forced ? 'forced' : 'success'));
|
||||||
|
} else {
|
||||||
|
this.log_info('load css '+csssrc+' - cached');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//what?
|
|
||||||
SYSTEM.prototype.cur_state = function() {
|
SYSTEM.prototype.cur_state = function() {
|
||||||
var pathName = window.location.href;
|
var pathName = window.location.href;
|
||||||
if (pathName.indexOf('#!') != -1) {
|
if (pathName.indexOf('#!') != -1) {
|
||||||
return pathName.split('#!').pop();}
|
return pathName.split('#!').pop();}
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSTEM.prototype.go_state = function(default_state,forced){
|
SYSTEM.prototype.go_state = function(default_state,forced){
|
||||||
var pageName = this.cur_state();
|
var pageName = this.cur_state();
|
||||||
this.load(pageName ? pageName : default_state,forced);
|
this.load(pageName ? pageName : default_state,forced);
|
||||||
|
|||||||
136
page/State.php
136
page/State.php
@ -2,26 +2,146 @@
|
|||||||
namespace SYSTEM\PAGE;
|
namespace SYSTEM\PAGE;
|
||||||
class State {
|
class State {
|
||||||
public static function get($group,$state,$returnasjson=true){
|
public static function get($group,$state,$returnasjson=true){
|
||||||
$state = \explode(';', $state);
|
//seperate state from vars
|
||||||
|
$state_vars = \explode(';', $state);
|
||||||
|
//parse substates
|
||||||
|
$state_all = \explode('(', $state_vars[0]);
|
||||||
|
$state_name = $state_all[0];
|
||||||
|
$substate = substr($state_vars[0], strlen($state_name));
|
||||||
|
$substate = self::parse_substate($substate);
|
||||||
|
//vars
|
||||||
$vars = array();
|
$vars = array();
|
||||||
for($i=1;$i<count($state);$i++){
|
for($i=1;$i<count($state_vars);$i++){
|
||||||
$var = \explode('.',$state[$i]);
|
$var = \explode('.',$state_vars[$i]);
|
||||||
$vars[$var[0]] = $var[1];}
|
$vars[$var[0]] = $var[1];}
|
||||||
$result = array();
|
$result = array();
|
||||||
$res = \SYSTEM\DBD\SYS_PAGE_GROUP::QQ(array($group,$state[0]));
|
$res = \SYSTEM\DBD\SYS_PAGE_GROUP::QQ(array($group,$state_name));
|
||||||
while($row = $res->next()){
|
while($row = $res->next()){
|
||||||
|
if(!self::is_loaded($row,$substate,$state_name) && $row['type'] == 1){
|
||||||
|
continue;}
|
||||||
$row['url'] = \SYSTEM\PAGE\replace::replace($row['url'], $vars);
|
$row['url'] = \SYSTEM\PAGE\replace::replace($row['url'], $vars);
|
||||||
$row['url'] = \SYSTEM\PAGE\replace::clean($row['url']);
|
$row['url'] = \SYSTEM\PAGE\replace::clean($row['url']);
|
||||||
//clean url of empty variables
|
//clean url of empty variables
|
||||||
$row['url'] = preg_replace('/&.*?=(&|$)/', '&', $row['url']);
|
//$row['url'] = preg_replace('/&.*?=(&|$)/', '&', $row['url']);
|
||||||
$row['url'] = preg_replace('/&$/', '', $row['url']);
|
$row['url'] = preg_replace('/[^=&]+=(&|$)/', '&', $row['url']);
|
||||||
|
$row['url'] = preg_replace('/&&$/', '', $row['url']);
|
||||||
$row['css'] = $row['js'] = array();
|
$row['css'] = $row['js'] = array();
|
||||||
if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){
|
if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){
|
||||||
$row['css'] = array_merge($row['css'], call_user_func($row['php_class'].'::css'));}
|
$row['css'] = array_merge($row['css'], call_user_func($row['php_class'].'::css'));}
|
||||||
if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){
|
if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){
|
||||||
$row['js'] = array_merge($row['js'], call_user_func($row['php_class'].'::js'));}
|
$row['js'] = array_merge($row['js'], call_user_func($row['php_class'].'::js'));}
|
||||||
$row['php_class'] = '';
|
$row['php_class'] = '';
|
||||||
$result[] = $row;
|
|
||||||
|
$skip = false;
|
||||||
|
for($i=0;$i<count($result);$i++){
|
||||||
|
if($result[$i]['div'] == $row['div']){
|
||||||
|
$skip = true;
|
||||||
|
if($row['type'] == 1){
|
||||||
|
$result[$i] = $row;}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!$skip){
|
||||||
|
$result[] = $row;}
|
||||||
}
|
}
|
||||||
return $returnasjson ? \SYSTEM\LOG\JsonResult::toString($result) : $result;}
|
return $returnasjson ? \SYSTEM\LOG\JsonResult::toString($result) : $result;
|
||||||
|
}
|
||||||
|
public static function parse_substate($substate){
|
||||||
|
return (new ParensParser())->parse($substate);
|
||||||
|
}
|
||||||
|
private static function is_loaded($row,&$substate,$state_name,$parent_id = -1){
|
||||||
|
for($i=0;$i<count($substate);$i++){
|
||||||
|
if($row['name'] == $state_name){
|
||||||
|
$substate[$i]['parent_id'] = $row['id'];}
|
||||||
|
if($substate[$i]['name'] == $row['name'] && $substate[$i]['parent_id'] == $row['parent_id']){
|
||||||
|
$substate[$i]['parent_id'] = $parent_id;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(array_key_exists('parent_id', $substate[$i])){
|
||||||
|
if(self::is_loaded($row,$substate[$i]['sub'],$state_name,$substate[$i]['parent_id'])){
|
||||||
|
return true;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ParensParser
|
||||||
|
{
|
||||||
|
// something to keep track of parens nesting
|
||||||
|
protected $stack = null;
|
||||||
|
// current level
|
||||||
|
protected $current = null;
|
||||||
|
|
||||||
|
// input string to parse
|
||||||
|
protected $string = null;
|
||||||
|
// current character offset in string
|
||||||
|
protected $position = null;
|
||||||
|
// start of text-buffer
|
||||||
|
protected $buffer_start = null;
|
||||||
|
|
||||||
|
public function parse($string)
|
||||||
|
{
|
||||||
|
if (!$string) {
|
||||||
|
// no string, no data
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($string[0] == '(') {
|
||||||
|
// killer outer parens, as they're unnecessary
|
||||||
|
$string = substr($string, 1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->current = array();
|
||||||
|
$this->stack = array();
|
||||||
|
|
||||||
|
$this->string = $string;
|
||||||
|
$this->length = strlen($this->string);
|
||||||
|
// look at each character
|
||||||
|
for ($this->position=0; $this->position < $this->length; $this->position++) {
|
||||||
|
switch ($this->string[$this->position]) {
|
||||||
|
case '(':
|
||||||
|
$this->push();
|
||||||
|
// push current scope to the stack an begin a new scope
|
||||||
|
array_push($this->stack, $this->current);
|
||||||
|
$this->current = array();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ')':
|
||||||
|
$this->push();
|
||||||
|
// save current scope
|
||||||
|
$t = $this->current;
|
||||||
|
// get the last scope from stack
|
||||||
|
$this->current = array_pop($this->stack);
|
||||||
|
// add just saved scope to current scope
|
||||||
|
$this->current[count($this->current)-1]['sub'] = $t;
|
||||||
|
break;
|
||||||
|
case '|':
|
||||||
|
// make each word its own token
|
||||||
|
$this->push();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// remember the offset to do a string capture later
|
||||||
|
// could've also done $buffer .= $string[$position]
|
||||||
|
// but that would just be wasting resources…
|
||||||
|
if ($this->buffer_start === null) {
|
||||||
|
$this->buffer_start = $this->position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->push();
|
||||||
|
return $this->current;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function push()
|
||||||
|
{
|
||||||
|
if ($this->buffer_start !== null) {
|
||||||
|
// extract string from buffer start to current position
|
||||||
|
$buffer = substr($this->string, $this->buffer_start, $this->position - $this->buffer_start);
|
||||||
|
// clean buffer
|
||||||
|
$this->buffer_start = null;
|
||||||
|
// throw token into current scope
|
||||||
|
$this->current[] = array('name' => $buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -7,10 +7,12 @@ require_once dirname(__FILE__).'/saimod_sys_security/autoload.inc';
|
|||||||
require_once dirname(__FILE__).'/saimod_sys_mod/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_mod/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_config/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_config/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_api/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_api/autoload.inc';
|
||||||
|
require_once dirname(__FILE__).'/saimod_sys_page/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_text/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_text/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_files/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_files/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_cache/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_cache/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_cron/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_cron/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_todo/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_todo/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_docu/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_docu/autoload.inc';
|
||||||
|
require_once dirname(__FILE__).'/saimod_sys_langswitcher/autoload.inc';
|
||||||
require_once dirname(__FILE__).'/saimod_sys_login/autoload.inc';
|
require_once dirname(__FILE__).'/saimod_sys_login/autoload.inc';
|
||||||
@ -1,64 +0,0 @@
|
|||||||
p {
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
.tree {
|
|
||||||
min-height:20px;
|
|
||||||
padding:19px;
|
|
||||||
margin-bottom:20px;
|
|
||||||
background-color:#fbfbfb;
|
|
||||||
border:1px solid #999;
|
|
||||||
-webkit-border-radius:4px;
|
|
||||||
-moz-border-radius:4px;
|
|
||||||
border-radius:4px;
|
|
||||||
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
|
||||||
-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);
|
|
||||||
box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05)
|
|
||||||
}
|
|
||||||
.tree li {
|
|
||||||
list-style-type:none;
|
|
||||||
margin:0;
|
|
||||||
padding:10px 5px 0 5px;
|
|
||||||
position:relative
|
|
||||||
}
|
|
||||||
.tree li::before, .tree li::after {
|
|
||||||
content:'';
|
|
||||||
left:-20px;
|
|
||||||
position:absolute;
|
|
||||||
right:auto
|
|
||||||
}
|
|
||||||
.tree li::before {
|
|
||||||
border-left:1px solid #999;
|
|
||||||
bottom:50px;
|
|
||||||
height:100%;
|
|
||||||
top:0;
|
|
||||||
width:1px
|
|
||||||
}
|
|
||||||
.tree li::after {
|
|
||||||
border-top:1px solid #999;
|
|
||||||
height:20px;
|
|
||||||
top:25px;
|
|
||||||
width:25px
|
|
||||||
}
|
|
||||||
.tree li span {
|
|
||||||
-moz-border-radius:5px;
|
|
||||||
-webkit-border-radius:5px;
|
|
||||||
border:1px solid #999;
|
|
||||||
border-radius:5px;
|
|
||||||
display:inline-block;
|
|
||||||
padding:3px 8px;
|
|
||||||
text-decoration:none
|
|
||||||
}
|
|
||||||
.tree li.parent_li>span {
|
|
||||||
cursor:pointer
|
|
||||||
}
|
|
||||||
.tree>ul>li::before, .tree>ul>li::after {
|
|
||||||
border:0
|
|
||||||
}
|
|
||||||
.tree li:last-child::before {
|
|
||||||
height:30px
|
|
||||||
}
|
|
||||||
.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span {
|
|
||||||
background:#eee;
|
|
||||||
border:1px solid #94a0b4;
|
|
||||||
color:#000
|
|
||||||
}
|
|
||||||
@ -1,97 +1,54 @@
|
|||||||
var currentID = '';
|
|
||||||
|
|
||||||
function init_saimod_sys_api() {
|
function init_saimod_sys_api() {
|
||||||
saimod_sys_api_tree();
|
$('#tabs_log a').click(function (e) {
|
||||||
saimod_sys_api_register_clickevents();
|
$('#tabs_log li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
}
|
$(this).parent().addClass('active');
|
||||||
|
|
||||||
function saimod_sys_api_loadcontent(){
|
|
||||||
$('#api_wrapper').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api', function(){
|
|
||||||
console.log('api module loaded');
|
|
||||||
saimod_sys_api_register_clickevents();
|
|
||||||
});
|
});
|
||||||
|
api_menu();
|
||||||
}
|
}
|
||||||
|
|
||||||
function saimod_sys_api_register_clickevents(){
|
function init_saimod_sys_api_new(){
|
||||||
$('tr.api_entries').click(function() {
|
|
||||||
currentID = $(this).attr("id");
|
|
||||||
$.ajax({
|
|
||||||
url: './sai.php',
|
|
||||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api',
|
|
||||||
action: 'deletedialog',
|
|
||||||
ID: currentID},
|
|
||||||
type: 'GET',
|
|
||||||
success: function(data) {
|
|
||||||
console.log("works");
|
|
||||||
$('#api_content').html(data);
|
|
||||||
$('#del_api_close').click(function() {
|
|
||||||
console.log("olenski");
|
|
||||||
$('#del_api_description').hide();
|
|
||||||
$('#del_api_del').show();
|
|
||||||
saimod_sys_api_loadcontent();
|
|
||||||
});
|
|
||||||
$('#del_api_del').click(function() {
|
|
||||||
$.ajax({
|
|
||||||
url: './sai.php',
|
|
||||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api',
|
|
||||||
action: 'deletecall',
|
|
||||||
ID: currentID},
|
|
||||||
type: 'GET',
|
|
||||||
success: function(data) {
|
|
||||||
console.log("api call deleted");
|
|
||||||
$('#api_deletedialog').html('<p>Api call deleted!</p>');
|
|
||||||
$('#del_api_del').hide();
|
|
||||||
}});});}});});
|
|
||||||
|
|
||||||
$('#addcall').click(function() {
|
$('#addcall').click(function() {
|
||||||
var id = $('#new_call_id').val();
|
$.ajax({ url: './sai.php',
|
||||||
var group = $('#new_call_group').val();
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api',
|
||||||
var type = $('#new_call_type').val();
|
action: 'addcall',
|
||||||
var parentid = $('#new_call_parentid').val();
|
ID: $('#new_call_id').val(),
|
||||||
var parentvalue = $('#new_call_parentvalue').val();
|
group: $('#new_call_group').val(),
|
||||||
var name = $('#new_call_name').val();
|
type: $('#new_call_type').val(),
|
||||||
var verify = $('#new_call_verify').val();
|
parentID: $('#new_call_parentid').val(),
|
||||||
$.ajax({
|
parentValue : $('#new_call_parentvalue').val(),
|
||||||
url: './sai.php',
|
name: $('#new_call_name').val(),
|
||||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api',
|
verify: $('#new_call_verify').val()},
|
||||||
action: 'addcall',
|
type: 'GET',
|
||||||
ID: id,
|
success: function(data) {
|
||||||
group: group,
|
system.load('api;group.'+$('#new_call_group').val());}
|
||||||
type: type,
|
});
|
||||||
parentID: parentid,
|
});
|
||||||
parentValue : parentvalue,
|
}
|
||||||
name: name,
|
|
||||||
verify: verify},
|
function api_menu(){
|
||||||
type: 'GET',
|
$('#tabs_log li').each(function(){
|
||||||
success: function(data) {
|
$(this).removeClass('active');});
|
||||||
console.log("new api call added");
|
if($('#menu_group_'+system.cur_state().split('.')[1]).length){
|
||||||
saimod_sys_api_loadcontent();
|
$('#menu_group_'+system.cur_state().split('.')[1]).parent().addClass('active');
|
||||||
}
|
} else {
|
||||||
});
|
$('#menu_all').parent().addClass('active');}
|
||||||
|
}
|
||||||
});
|
function init_saimod_sys_api_list(){
|
||||||
$('#del_api_close').click(function() {
|
api_menu();}
|
||||||
console.log("olenski");
|
function init_saimod_sys_api_delete(){
|
||||||
$('#del_api_description').hide();
|
$('#del_api_del').click(function() {
|
||||||
$('#del_api_del').show();
|
$.ajax({ url: './sai.php',
|
||||||
saimod_sys_api_loadcontent();
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api',
|
||||||
});
|
action: 'deletecall',
|
||||||
$('#localetab a').click(function (e) {e.preventDefault(); $(this).tab('show');});
|
ID: $(this).attr('api_id'),
|
||||||
}
|
group: $(this).attr('api_group')},
|
||||||
|
type: 'GET',
|
||||||
function saimod_sys_api_tree(){
|
success: function(data) {
|
||||||
$('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
|
console.log("api call deleted");
|
||||||
$('.tree li.parent_li > span').on('click', function (e) {
|
$('#api_deletedialog').html('<p>Api call deleted!</p>');
|
||||||
var children = $(this).parent('li.parent_li').find(' > ul > li');
|
$('#del_api_del').hide();
|
||||||
if (children.is(":visible")) {
|
}
|
||||||
children.hide('fast');
|
});
|
||||||
$(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
|
|
||||||
} else {
|
|
||||||
children.show('fast');
|
|
||||||
$(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
|
|
||||||
}
|
|
||||||
e.stopPropagation();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -5,7 +5,7 @@ class SYS_SAIMOD_API_DEL extends \SYSTEM\DB\QP {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_PG.' WHERE `ID` = $1;',
|
'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_PG.' WHERE `ID` = $1 AND group = $2;',
|
||||||
//mys
|
//mys
|
||||||
'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_MYS.' WHERE `ID` = ?;'
|
'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_MYS.' WHERE `ID` = ? AND `group` = ?;'
|
||||||
);}}
|
);}}
|
||||||
|
|||||||
11
sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GET.php
Normal file
11
sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GET.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_API_GET extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM system_api ORDER BY `group`, `ID` ASC;',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM system_api ORDER BY `group`, `ID` ASC;'
|
||||||
|
);}}
|
||||||
11
sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GROUPS.php
Normal file
11
sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GROUPS.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_API_GROUPS extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT "group", count(*) as "count" FROM system.api GROUP BY "group" ORDER BY "group" ASC;',
|
||||||
|
//mys
|
||||||
|
'SELECT `group`, count(*) as `count` FROM system_api GROUP BY `group` ORDER BY `group` ASC;'
|
||||||
|
);}}
|
||||||
@ -5,7 +5,7 @@ class SYS_SAIMOD_API_SINGLE_SELECT extends \SYSTEM\DB\QP {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'SELECT * FROM '.\SYSTEM\DBD\system_api::NAME_PG.' WHERE ID = $1;',
|
'SELECT * FROM '.\SYSTEM\DBD\system_api::NAME_PG.' WHERE ID = $1 AND group = $2;',
|
||||||
//mys
|
//mys
|
||||||
'SELECT * FROM '.\SYSTEM\DBD\system_api::NAME_MYS.' WHERE ID = ?;'
|
'SELECT * FROM '.\SYSTEM\DBD\system_api::NAME_MYS.' WHERE ID = ? AND `group` = ?;'
|
||||||
);}}
|
);}}
|
||||||
|
|||||||
@ -1,59 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace SYSTEM\SAI;
|
namespace SYSTEM\SAI;
|
||||||
|
|
||||||
class saimod_sys_api extends \SYSTEM\SAI\SaiModule {
|
class saimod_sys_api extends \SYSTEM\SAI\SaiModule {
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_api(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_api(){
|
||||||
//$last_group = -1;
|
|
||||||
$vars = array();
|
$vars = array();
|
||||||
|
|
||||||
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
|
|
||||||
if(\SYSTEM\system::isSystemDbInfoPG()){
|
|
||||||
$res = $con->query('SELECT "group", count(*) as "count" FROM system.api GROUP BY "group" ORDER BY "group" ASC;');
|
|
||||||
} else {
|
|
||||||
$res = $con->query('SELECT `group`, count(*) as `count` FROM system_api GROUP BY `group` ORDER BY `group` ASC;');
|
|
||||||
}
|
|
||||||
|
|
||||||
$vars['tabopts'] = '';
|
$vars['tabopts'] = '';
|
||||||
$first = true;
|
|
||||||
while($r = $res->next()){
|
|
||||||
$vars2 = array( 'active' => ($first ? 'active' : ''),
|
|
||||||
'tab_id' => $r['group']);
|
|
||||||
$first = false;
|
|
||||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), $vars2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(\SYSTEM\system::isSystemDbInfoPG()){
|
$res = \SYSTEM\DBD\SYS_SAIMOD_API_GROUPS::QQ();
|
||||||
$res = $con->query('SELECT * FROM system.api ORDER BY "group", "ID" ASC;');
|
|
||||||
} else {
|
|
||||||
$res = $con->query('SELECT * FROM system_api ORDER BY `group`, `ID` ASC;');
|
|
||||||
}
|
|
||||||
|
|
||||||
while($r = $res->next()){
|
while($r = $res->next()){
|
||||||
$tabs[$r['group']]['tab_id'] = $r['group'];
|
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), array( 'tab_id' => $r['group']));}
|
||||||
$tabs[$r['group']]['content'] = isset($tabs[$r['group']]['content']) ? $tabs[$r['group']]['content'] : '';
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/saimod_sys_api.tpl'), $vars);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_api_action_list($group=null){
|
||||||
|
$res = \SYSTEM\DBD\SYS_SAIMOD_API_GET::QQ();
|
||||||
|
$tab = array('content' => '');
|
||||||
|
while($r = $res->next()){
|
||||||
|
if($group != null && $r['group'] != $group){
|
||||||
|
continue;}
|
||||||
|
$tab['tab_id'] = $r['group'];
|
||||||
$r['tr_class'] = self::tablerow_class($r['type']);
|
$r['tr_class'] = self::tablerow_class($r['type']);
|
||||||
$r['type'] = self::type_names($r['type']);
|
$r['type'] = self::type_names($r['type']);
|
||||||
$tabs[$r['group']]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/list_entry.tpl'), $r);
|
$tab['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/list_entry.tpl'), $r);
|
||||||
}
|
}
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl'), $tab);
|
||||||
$vars['tabs'] = '';
|
|
||||||
$first = true;
|
|
||||||
foreach($tabs as $tab){
|
|
||||||
$tab['active'] = ($first ? 'active' : '');
|
|
||||||
$first = false;
|
|
||||||
$vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tab.tpl'), $tab);}
|
|
||||||
|
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabs.tpl'), $vars);
|
|
||||||
|
|
||||||
/* $result = "";
|
|
||||||
$result .= '<tr class="'.self::tablerow_class($r['type']).'">'.'<td>'.$r['ID'].'</td>'.'<td>'.$r['group'].'</td>'.'<td>'.$r['type'].'</td>'.'<td>'.$r['parentID'].'</td>'.'<td>'.$r['parentValue'].'</td>'.'<td>'.$r['name'].'</td>'.'<td>'.$r['verify'].'</td>'.'</tr>';
|
|
||||||
return $result;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID){
|
public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID,$group){
|
||||||
$res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID));
|
$res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID,$group));
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/delete_dialog.tpl'), $res);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/delete_dialog.tpl'), $res);
|
||||||
}
|
}
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_api_action_newdialog(){
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/new_dialog.tpl'));}
|
||||||
|
|
||||||
public static function sai_mod__system_sai_saimod_sys_api_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){
|
public static function sai_mod__system_sai_saimod_sys_api_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){
|
||||||
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){
|
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){
|
||||||
@ -64,10 +42,10 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule {
|
|||||||
return \SYSTEM\LOG\JsonResult::ok();
|
return \SYSTEM\LOG\JsonResult::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID){
|
public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID,$group){
|
||||||
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){
|
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){
|
||||||
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}
|
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}
|
||||||
\SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID));
|
\SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID,$group));
|
||||||
return \SYSTEM\LOG\JsonResult::ok();
|
return \SYSTEM\LOG\JsonResult::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,5 +22,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-small btn-danger" id="del_api_del">Delete</button>
|
<button type="button" class="btn btn-small btn-danger" id="del_api_del" api_id="${ID}" api_group="${group}">Delete</button>
|
||||||
<button type="button" class="btn btn-small" id="del_api_close">Close</button>
|
<button type="button" class="btn btn-small" onClick="system.load('api;group.${group}');">Close</button>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<tr class="${tr_class} api_entries" id="${ID}" group="${group}" typ="${type}" parentID="${parentID}" parentValue="${parentValue}" name="${name}" verify="${verify}">
|
<tr class="${tr_class} api_entries" onClick="system.load('api(delete);group.${group};id.${ID}');" id="${ID}" group="${group}" typ="${type}" parentID="${parentID}" parentValue="${parentValue}" name="${name}" verify="${verify}">
|
||||||
<td>${ID}</td>
|
<td>${ID}</td>
|
||||||
<td>${group}</td>
|
<td>${group}</td>
|
||||||
<td>${type}</td>
|
<td>${type}</td>
|
||||||
|
|||||||
32
sai/modules/saimod_sys_api/tpl/new_dialog.tpl
Normal file
32
sai/modules/saimod_sys_api/tpl/new_dialog.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<table class="table table-hover table-condensed" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<td><input type="text" id="new_call_id" placeholder="new id" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Group</th>
|
||||||
|
<td><input type="text" id="new_call_group" placeholder="new group" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Type</th>
|
||||||
|
<td><input type="text" id="new_call_type" placeholder="new type" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ParentID</th>
|
||||||
|
<td><input type="text" id="new_call_parentid" placeholder="parent id" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ParentValue</th>
|
||||||
|
<td><input type="text" id="new_call_parentvalue" placeholder="parent value" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<td><input type="text" id="new_call_name" placeholder="name" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Verify</th>
|
||||||
|
<td><input type="text" id="new_call_verify" placeholder="verify" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<button type="button" class="btn-small" onClick="system.load('api');">Back</button>
|
||||||
|
<button type="button" class="btn-small btn-success" id="addcall" style="float: right;">Add</button>
|
||||||
12
sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl
Normal file
12
sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<h4>System API</h4>
|
||||||
|
<hr>
|
||||||
|
<div class="tabbable">
|
||||||
|
<ul class="nav nav-tabs" id="tabs_api">
|
||||||
|
<li><a href="#!api" id="menu_all">All</a></li>
|
||||||
|
${tabopts}
|
||||||
|
<button onClick="system.load('api(new)',true);" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">New</button>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="tab_api"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
12
sai/modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl
Normal file
12
sai/modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<table class="table table-hover table-condensed" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Group</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>ParentID</th>
|
||||||
|
<th>ParentValue</th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Verify</th>
|
||||||
|
</tr>
|
||||||
|
${content}
|
||||||
|
</table>
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<div class="tab-pane ${active}" id="tab_${tab_id}">
|
|
||||||
<table class="table table-hover table-condensed" style="overflow: auto;">
|
|
||||||
<tr>
|
|
||||||
<th>ID</th>
|
|
||||||
<th>Group</th>
|
|
||||||
<th>Type</th>
|
|
||||||
<th>ParentID</th>
|
|
||||||
<th>ParentValue</th>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Verify</th>
|
|
||||||
</tr>
|
|
||||||
${content}
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
@ -1 +1 @@
|
|||||||
<li class="${active}"><a href="#tab_${tab_id}">Group ${tab_id}</a></li>
|
<li><a href="#!api;group.${tab_id}" id="menu_group_${tab_id}">Group ${tab_id}</a></li>
|
||||||
@ -1,36 +0,0 @@
|
|||||||
<div id="api_wrapper">
|
|
||||||
<h4>System API</h4>
|
|
||||||
<hr>
|
|
||||||
<div id="api_content">
|
|
||||||
<div class="tabbable">
|
|
||||||
<ul class="nav nav-tabs" id="localetab">
|
|
||||||
${tabopts}
|
|
||||||
</ul>
|
|
||||||
<div class="tab-content">
|
|
||||||
${tabs}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<table class="table table-hover table-condensed" style="overflow: auto;">
|
|
||||||
<tr>
|
|
||||||
<th>ID</th>
|
|
||||||
<th>Group</th>
|
|
||||||
<th>Type</th>
|
|
||||||
<th>ParentID</th>
|
|
||||||
<th>ParentValue</th>
|
|
||||||
<th>Name</th>
|
|
||||||
<th>Verify</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><input type="text" id="new_call_id" placeholder="new id" style="width: 140px;"></td>
|
|
||||||
<td><input type="text" id="new_call_group" placeholder="new group" style="width: 140px;"></td>
|
|
||||||
<td><input type="text" id="new_call_type" placeholder="new type" style="width: 140px;"></td>
|
|
||||||
<td><input type="text" id="new_call_parentid" placeholder="parent id" style="width: 140px;"></td>
|
|
||||||
<td><input type="text" id="new_call_parentvalue" placeholder="parent value" style="width: 140px;"></td>
|
|
||||||
<td><input type="text" id="new_call_name" placeholder="name" style="width: 140px;"></td>
|
|
||||||
<td><input type="text" id="new_call_verify" placeholder="verify" style="width: 140px;"></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
<button type="button" class="btn-small btn-success" id="addcall">Add</button>
|
|
||||||
</div><!-- /.modal -->
|
|
||||||
</div>
|
|
||||||
@ -12,7 +12,7 @@ class saimod_sys_cache extends \SYSTEM\SAI\SaiModule {
|
|||||||
|
|
||||||
$r = $res->next();
|
$r = $res->next();
|
||||||
|
|
||||||
$result = '<h4>Cache</h4><hr>'.
|
$result = '<h4>System Cache</h4><hr>'.
|
||||||
'Entries: '.$r['count'].' showing 100'.
|
'Entries: '.$r['count'].' showing 100'.
|
||||||
'<table class="sai_table table table-hover table-condensed" style="overflow: auto;">'.
|
'<table class="sai_table table table-hover table-condensed" style="overflow: auto;">'.
|
||||||
'<tr>'.'<th>'.'ID'.'</th>'.'<th>'.'CacheID'.'</th>'.'<th>'.'Ident'.'</th>'.'<th>'.'Data'.'</th>'.'</tr>';
|
'<tr>'.'<th>'.'ID'.'</th>'.'<th>'.'CacheID'.'</th>'.'<th>'.'Ident'.'</th>'.'<th>'.'Data'.'</th>'.'</tr>';
|
||||||
|
|||||||
@ -2,33 +2,75 @@
|
|||||||
namespace SYSTEM\SAI;
|
namespace SYSTEM\SAI;
|
||||||
class saimod_sys_config extends \SYSTEM\SAI\SaiModule {
|
class saimod_sys_config extends \SYSTEM\SAI\SaiModule {
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_config(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_config(){
|
||||||
$result = '<h4>System Config</h4><hr>'.
|
$vars = array();
|
||||||
'<table class="table table-hover table-condensed sai_table" style="overflow: auto;">'.
|
$vars['basics'] = $vars['database'] = $vars['sai'] = '';
|
||||||
'<tr>'.'<th>'.'Config ID'.'</th>'.'<th>'.'Config Name'.'</th>'.'<th>'.'Value'.'</th>'.'</tr>';
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING)));
|
||||||
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)));
|
||||||
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH)));
|
||||||
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL)));
|
||||||
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT)));
|
||||||
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS',
|
||||||
|
'value' =>implode(',',\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS))));
|
||||||
|
$vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG)));
|
||||||
|
|
||||||
$result .= '<tr>'.'<th>Basics</th>'.'<th></th><th></th>'.'</tr>';
|
$vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING). '</td>'.'</tr>';
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE,
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL). '</td>'.'</tr>';
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE',
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH). '</td>'.'</tr>';
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE)));
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL). '</td>'.'</tr>';
|
$vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT). '</td>'.'</tr>';
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST,
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS'. '</td>'.'<td>'.implode(',',\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS)). '</td>'.'</tr>';
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST',
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG). '</td>'.'</tr>';
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST)));
|
||||||
$result .= '<tr>'.'<th>Database</th>'.'<th></th><th></th>'.'</tr>';
|
$vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE). '</td>'.'</tr>';
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT,
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST). '</td>'.'</tr>';
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT',
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT). '</td>'.'</tr>';
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT)));
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER). '</td>'.'</tr>';
|
$vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD'. '</td>'.'<td>'.'<hidden>'. '</td>'.'</tr>';
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER,
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME). '</td>'.'</tr>';
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER',
|
||||||
$result .= '<tr>'.'<th>System Admin Interface</th>'.'<th></th><th></th>'.'</tr>';
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER)));
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT). '</td>'.'</tr>';
|
$vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT). '</td>'.'</tr>';
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD,
|
||||||
$result .= '<tr>'.'<td>'.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE. '</td>'.'<td>'.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE'. '</td>'.'<td>'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE). '</td>'.'</tr>';
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD',
|
||||||
|
'value' =>'<hidden>'));
|
||||||
|
$vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME)));
|
||||||
|
|
||||||
$result .= '</table>';
|
$vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT,
|
||||||
return $result;
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT)));
|
||||||
|
$vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT)));
|
||||||
|
$vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'),
|
||||||
|
array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE,
|
||||||
|
'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE',
|
||||||
|
'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE)));
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config.tpl'),$vars);
|
||||||
}
|
}
|
||||||
public static function html_li_menu(){return '<li><a id="menu_config" href="#!config">Config</a></li>';}
|
public static function html_li_menu(){return '<li><a id="menu_config" href="#!config">Config</a></li>';}
|
||||||
public static function right_public(){return false;}
|
public static function right_public(){return false;}
|
||||||
|
|||||||
27
sai/modules/saimod_sys_config/tpl/config.tpl
Normal file
27
sai/modules/saimod_sys_config/tpl/config.tpl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<h4>System Config</h4>
|
||||||
|
<hr>
|
||||||
|
<table class="table table-hover table-condensed sai_table" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>Config ID</th>
|
||||||
|
<th>Config Name</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Basics</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
${basics}
|
||||||
|
<tr>
|
||||||
|
<th>Database</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
${database}
|
||||||
|
<tr>
|
||||||
|
<th>System Admin Interface</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
${sai}
|
||||||
|
</table>
|
||||||
5
sai/modules/saimod_sys_config/tpl/config_tr.tpl
Normal file
5
sai/modules/saimod_sys_config/tpl/config_tr.tpl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<tr>
|
||||||
|
<td>${id}</td>
|
||||||
|
<td>${name}</td>
|
||||||
|
<td>${value}</td>
|
||||||
|
</tr>
|
||||||
@ -5,7 +5,7 @@ class SYS_SAIMOD_CRON_CHANGE extends \SYSTEM\DB\QP {
|
|||||||
protected static function query(){
|
protected static function query(){
|
||||||
return new \SYSTEM\DB\QQuery(get_class(),
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
//pg
|
//pg
|
||||||
'UPDATE '.\SYSTEM\DBD\system_cron::NAME_PG.' SET status = $1 WHERE `class` = $2;',
|
'UPDATE '.\SYSTEM\DBD\system_cron::NAME_PG.' SET status = $1 WHERE class = $2;',
|
||||||
//mys
|
//mys
|
||||||
'UPDATE '.\SYSTEM\DBD\system_cron::NAME_MYS.' SET status = ? WHERE `class` = ?;'
|
'UPDATE '.\SYSTEM\DBD\system_cron::NAME_MYS.' SET status = ? WHERE `class` = ?;'
|
||||||
);}}
|
);}}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class saimod_sys_cron extends \SYSTEM\SAI\SaiModule {
|
|||||||
public static function sai_mod__system_sai_saimod_sys_cron_action_change($cls,$status){
|
public static function sai_mod__system_sai_saimod_sys_cron_action_change($cls,$status){
|
||||||
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){
|
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){
|
||||||
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}
|
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}
|
||||||
\SYSTEM\DBD\SYS_SAIMOD_CRON_CHANGE::QI(array($status,$cls));
|
\SYSTEM\DBD\SYS_SAIMOD_CRON_CHANGE::QI(array($status, $cls));
|
||||||
return \SYSTEM\LOG\JsonResult::ok();
|
return \SYSTEM\LOG\JsonResult::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
sai/modules/saimod_sys_langswitcher/autoload.inc
Normal file
4
sai/modules/saimod_sys_langswitcher/autoload.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\SAI');
|
||||||
|
|
||||||
|
\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_langswitcher');
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\SAI;
|
||||||
|
|
||||||
|
class saimod_sys_langswitcher extends \SYSTEM\SAI\SaiModule {
|
||||||
|
public static function html_li_menu(){
|
||||||
|
return self::lang_menu('./sai.php');}
|
||||||
|
public static function right_public(){return true;}
|
||||||
|
public static function right_right(){return true;}
|
||||||
|
|
||||||
|
public static function lang_menu($endpoint = './api.php'){
|
||||||
|
$result = '';
|
||||||
|
$langs = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
|
||||||
|
foreach($langs as $lang){
|
||||||
|
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_langswitcher/tpl/language.tpl'),array('lang' => $lang,'endpoint' => $endpoint));}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//public static function css(){}
|
||||||
|
//public static function js(){}
|
||||||
|
}
|
||||||
1
sai/modules/saimod_sys_langswitcher/tpl/language.tpl
Normal file
1
sai/modules/saimod_sys_langswitcher/tpl/language.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
<a href="javascript:system.language('${lang}');"><img src="${endpoint}?call=files&cat=saistart_sys_sai&id=flag_${lang}.png" alt="${lang}" width="16" height="11"></a>
|
||||||
@ -1,60 +1,19 @@
|
|||||||
google.load("visualization", "1", {packages:["corechart"]});
|
google.load("visualization", "1", {packages:["corechart"]});
|
||||||
function init_saimod_sys_log() {
|
function init_saimod_sys_log() {
|
||||||
$('#tabs_log a').click(function (e) {
|
$('#tabs_log a').click(function (e) {
|
||||||
e.preventDefault();
|
$('#tabs_log li').each(function(){
|
||||||
$(this).tab('show');
|
|
||||||
load_log_tab($(this).attr('action'));
|
|
||||||
});
|
|
||||||
|
|
||||||
load_log_tab("log");
|
|
||||||
};
|
|
||||||
|
|
||||||
function load_log_tab(action){
|
|
||||||
$('img#loader').show();
|
|
||||||
switch(action){
|
|
||||||
case 'log':
|
|
||||||
$('#tab_log').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action='+action, function(){
|
|
||||||
register_log();
|
|
||||||
register_error();
|
|
||||||
$('img#loader').hide();});
|
|
||||||
return;
|
|
||||||
case 'stats':
|
|
||||||
$('#tab_stats').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action='+action, function(){
|
|
||||||
register_stats();
|
|
||||||
$('img#loader').hide();});
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
$('img#loader').hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function register_error(){
|
|
||||||
$('.sai_log_error').click(function(){
|
|
||||||
$('img#loader').show();
|
|
||||||
$('#table_log').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=error&error='+$(this).attr('error'), function(){
|
|
||||||
$('img#loader').hide();})});
|
|
||||||
}
|
|
||||||
|
|
||||||
function load_table_log(filter){
|
|
||||||
$('img#loader').show();
|
|
||||||
$('#table_log').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter&filter='+filter, function(){
|
|
||||||
register_error();
|
|
||||||
$('img#loader').hide();});
|
|
||||||
}
|
|
||||||
|
|
||||||
var filter = "%";
|
|
||||||
function register_log(){
|
|
||||||
$('#refresh_error_table').click(function(){
|
|
||||||
load_table_log(filter);});
|
|
||||||
$("#error_filter a").click(function(){
|
|
||||||
$('#error_filter li').each(function(){
|
|
||||||
$(this).removeClass('active');});
|
$(this).removeClass('active');});
|
||||||
$(this).parent().addClass('active');
|
$(this).parent().addClass('active');
|
||||||
filter = $(this).attr('filter');
|
|
||||||
load_table_log($(this).attr('filter'));
|
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function init_saimod_sys_log_log() {
|
||||||
|
$('#tabs_log li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_loglist').parent().addClass('active');
|
||||||
}
|
}
|
||||||
function register_stats(){
|
|
||||||
|
function init_saimod_sys_log_stats() {
|
||||||
load_visualisation();
|
load_visualisation();
|
||||||
$('#vis_filter_time').change(function(){
|
$('#vis_filter_time').change(function(){
|
||||||
load_visualisation();})
|
load_visualisation();})
|
||||||
@ -65,8 +24,10 @@ function register_stats(){
|
|||||||
$(this).tab('show');
|
$(this).tab('show');
|
||||||
load_visualisation();
|
load_visualisation();
|
||||||
});
|
});
|
||||||
|
$('#tabs_log li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_stats').parent().addClass('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_visualisation(){
|
function load_visualisation(){
|
||||||
$('img#loader').show();
|
$('img#loader').show();
|
||||||
var name = $('#vis_filter_type').val();;
|
var name = $('#vis_filter_type').val();;
|
||||||
@ -89,7 +50,7 @@ function load_visualisation(){
|
|||||||
data.addColumn('number',key);
|
data.addColumn('number',key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? 0.1 : parseFloat(v)];}}));});
|
$.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? parseFloat(0.00001) : parseFloat(v)];}}));});
|
||||||
|
|
||||||
var options = {title: name, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:100,top:40}, vAxis:{logScale: true}, interpolateNulls: false, width: "1200", height: "500"};
|
var options = {title: name, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:100,top:40}, vAxis:{logScale: true}, interpolateNulls: false, width: "1200", height: "500"};
|
||||||
new google.visualization.LineChart(document.getElementById('vis')).draw(data, options);
|
new google.visualization.LineChart(document.getElementById('vis')).draw(data, options);
|
||||||
|
|||||||
18
sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php
Normal file
18
sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_LOG_ANALYTICS extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'',
|
||||||
|
//mys
|
||||||
|
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
||||||
|
.'count(*) as count,'
|
||||||
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
||||||
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
||||||
|
.' GROUP BY day'
|
||||||
|
.' ORDER BY day DESC'
|
||||||
|
.' LIMIT 1;'
|
||||||
|
);}}
|
||||||
@ -7,7 +7,7 @@ class SYS_SAIMOD_LOG_BASIC_VISITOR extends \SYSTEM\DB\QP {
|
|||||||
//pg
|
//pg
|
||||||
'SELECT to_char(to_timestamp(extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int - (extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int % $1)), \'YYYY/MM/DD HH24:MI:SS\') as day,'
|
'SELECT to_char(to_timestamp(extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int - (extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int % $1)), \'YYYY/MM/DD HH24:MI:SS\') as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
||||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_PG
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_PG
|
||||||
.' GROUP BY day'
|
.' GROUP BY day'
|
||||||
@ -16,7 +16,7 @@ class SYS_SAIMOD_LOG_BASIC_VISITOR extends \SYSTEM\DB\QP {
|
|||||||
//mys
|
//mys
|
||||||
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
||||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
||||||
.' GROUP BY day'
|
.' GROUP BY day'
|
||||||
|
|||||||
@ -7,7 +7,7 @@ class SYS_SAIMOD_LOG_UNIQUE_BASIC extends \SYSTEM\DB\QP {
|
|||||||
//pg
|
//pg
|
||||||
'SELECT to_char(to_timestamp(extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int - (extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int % $1)), \'YYYY/MM/DD HH24:MI:SS\') as day,'
|
'SELECT to_char(to_timestamp(extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int - (extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int % $1)), \'YYYY/MM/DD HH24:MI:SS\') as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique'
|
||||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_PG
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_PG
|
||||||
@ -17,7 +17,7 @@ class SYS_SAIMOD_LOG_UNIQUE_BASIC extends \SYSTEM\DB\QP {
|
|||||||
//mys
|
//mys
|
||||||
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique'
|
||||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
||||||
|
|||||||
@ -7,7 +7,7 @@ class SYS_SAIMOD_LOG_UNIQUE_REFERER extends \SYSTEM\DB\QP {
|
|||||||
//pg
|
//pg
|
||||||
'SELECT to_char(to_timestamp(extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int - (extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int % $1)), \'YYYY/MM/DD HH24:MI:SS\') as day,'
|
'SELECT to_char(to_timestamp(extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int - (extract(epoch from '.\SYSTEM\DBD\system_log::FIELD_TIME.')::int % $1)), \'YYYY/MM/DD HH24:MI:SS\') as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique'
|
||||||
@ -18,7 +18,7 @@ class SYS_SAIMOD_LOG_UNIQUE_REFERER extends \SYSTEM\DB\QP {
|
|||||||
//mys
|
//mys
|
||||||
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique'
|
||||||
|
|||||||
@ -5,6 +5,26 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
\SYSTEM\DBD\SYS_SAIMOD_LOG_TRUNCATE::QQ();
|
\SYSTEM\DBD\SYS_SAIMOD_LOG_TRUNCATE::QQ();
|
||||||
return \SYSTEM\LOG\JsonResult::ok();}
|
return \SYSTEM\LOG\JsonResult::ok();}
|
||||||
|
|
||||||
|
public static function analytics(){
|
||||||
|
$vars = array();
|
||||||
|
$data = \SYSTEM\DBD\SYS_SAIMOD_LOG_ANALYTICS::Q1(array(86400));
|
||||||
|
$vars['log_today'] = $data['count'];
|
||||||
|
$vars['ip_today'] = $data['ip_unique'];
|
||||||
|
$vars['user_today'] = $data['user_unique'];
|
||||||
|
$data = \SYSTEM\DBD\SYS_SAIMOD_LOG_ANALYTICS::Q1(array(604800));
|
||||||
|
$vars['log_week'] = $data['count'];
|
||||||
|
$vars['ip_week'] = $data['ip_unique'];
|
||||||
|
$vars['user_week'] = $data['user_unique'];
|
||||||
|
$data = \SYSTEM\DBD\SYS_SAIMOD_LOG_ANALYTICS::Q1(array(2692000));
|
||||||
|
$vars['log_month'] = $data['count'];
|
||||||
|
$vars['ip_month'] = $data['ip_unique'];
|
||||||
|
$vars['user_month'] = $data['user_unique'];
|
||||||
|
$vars['page_value'] = \round( $vars['log_today']+$vars['ip_today']*10+$vars['user_today']*100+
|
||||||
|
($vars['log_week']+$vars['ip_week']*10+$vars['user_week']*100)/7+
|
||||||
|
($vars['log_month']+$vars['ip_month']*10+$vars['user_week']*100)/31,0);
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl'), $vars);
|
||||||
|
}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats(){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
$vars['dbfile_entries'] = '';
|
$vars['dbfile_entries'] = '';
|
||||||
@ -13,6 +33,8 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
foreach($scanned_directory as $file){
|
foreach($scanned_directory as $file){
|
||||||
$vars['dbfile_entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl'), array('file' => $file));}
|
$vars['dbfile_entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl'), array('file' => $file));}
|
||||||
}
|
}
|
||||||
|
//positioning problem
|
||||||
|
//$vars['analytics'] = self::analytics();
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl'), $vars);}
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl'), $vars);}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db){
|
||||||
@ -99,7 +121,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
$res = $con->prepare('unique_basic',
|
$res = $con->prepare('unique_basic',
|
||||||
'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,'
|
'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique'
|
||||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
||||||
@ -169,7 +191,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
$res = $con->prepare('unique_referer',
|
$res = $con->prepare('unique_referer',
|
||||||
'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,'
|
'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique'
|
||||||
@ -193,7 +215,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
$res = $con->prepare('basic_visitor',
|
$res = $con->prepare('basic_visitor',
|
||||||
'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,'
|
'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,'
|
||||||
.'count(*) as count,'
|
.'count(*) as count,'
|
||||||
.'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,'
|
||||||
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
.'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique'
|
||||||
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
.' FROM '.\SYSTEM\DBD\system_log::NAME_MYS
|
||||||
.' GROUP BY day'
|
.' GROUP BY day'
|
||||||
@ -268,6 +290,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl'), $vars);}
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl'), $vars);}
|
||||||
|
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter($filter = "%"){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter($filter = "%"){
|
||||||
|
$filter_ = $filter;
|
||||||
$filter = str_replace('\\', '\\\\', $filter);
|
$filter = str_replace('\\', '\\\\', $filter);
|
||||||
$count = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER_COUNT::Q1(array($filter));
|
$count = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER_COUNT::Q1(array($filter));
|
||||||
$res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER::QQ(array($filter));
|
$res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER::QQ(array($filter));
|
||||||
@ -276,20 +299,17 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
//print_r($r);
|
//print_r($r);
|
||||||
$r['class_row'] = self::tablerow_class($r['class']);
|
$r['class_row'] = self::tablerow_class($r['class']);
|
||||||
$r['time'] = self::time_elapsed_string(strtotime($r['time']));
|
$r['time'] = self::time_elapsed_string(strtotime($r['time']));
|
||||||
$r['message'] = substr($r['message'],0,255);
|
$r['message'] = htmlspecialchars(substr($r['message'],0,255));
|
||||||
|
$r['request_uri'] = htmlspecialchars($r['request_uri']);
|
||||||
$table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r);
|
$table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r);
|
||||||
}
|
}
|
||||||
$vars = array();
|
$vars = array();
|
||||||
$vars['count'] = $count['count'];
|
$vars['count'] = $count['count'];
|
||||||
$vars['table'] = $table;
|
$vars['table'] = $table;
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl'), $vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'),
|
||||||
}
|
array( 'table' => \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl'), $vars),
|
||||||
|
'error_filter' => self::generate_error_filters($filter_),
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_log(){
|
'active' => $filter == '%' ? 'active' : ''));
|
||||||
$vars = array();
|
|
||||||
$vars['table'] = self::sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter();
|
|
||||||
$vars['error_filter'] = self::generate_error_filters();
|
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'), $vars);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function time_elapsed_string($ptime){
|
private static function time_elapsed_string($ptime){
|
||||||
@ -312,11 +332,11 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function generate_error_filters(){
|
private static function generate_error_filters($filter){
|
||||||
$res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ();
|
$res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ();
|
||||||
$result = '';
|
$result = '';
|
||||||
while($row = $res->next()){
|
while($row = $res->next()){
|
||||||
$result .= '<li><a href="#!log" filter="'.$row['class'].'">'.$row['class'].'</a></li>';}
|
$result .= '<li'.($filter == $row['class'] ? ' class="active"' : '').'><a href="#!log;filter.'.$row['class'].'">'.$row['class'].'</a></li>';}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,12 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
<ul class="nav nav-tabs" id="tabs_log">
|
<ul class="nav nav-tabs" id="tabs_log">
|
||||||
<li class="active"><a href="#tab_log" action="log">Log</a></li>
|
<li class="active"><a href="#!log" id="menu_loglist">Log</a></li>
|
||||||
<li><a href="#tab_stats" action="stats">Statistics</a></li>
|
<li><a href="#!log(stats)" id="menu_stats">Statistics</a></li>
|
||||||
<img id="loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
<img id="loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
||||||
<button id="refresh_error_table" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Refresh</button>
|
<button onClick="system.load('log',true);" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Refresh</button>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_log"></div>
|
<div class="tab-pane active" id="tab_log"></div>
|
||||||
<div class="tab-pane" id="tab_stats" style="overflow: hidden;"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
26
sai/modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl
Normal file
26
sai/modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<table class="table table-hover table-condensed">
|
||||||
|
<tr>
|
||||||
|
<th>PV: ${page_value}</th>
|
||||||
|
<th>Today</th>
|
||||||
|
<th>Week</th>
|
||||||
|
<th>Month</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Log</th>
|
||||||
|
<td>${log_today}</td>
|
||||||
|
<td>${log_week}</td>
|
||||||
|
<td>${log_month}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>IPs</th>
|
||||||
|
<td>${ip_today}</td>
|
||||||
|
<td>${ip_week}</td>
|
||||||
|
<td>${ip_month}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Users</th>
|
||||||
|
<td>${user_today}</td>
|
||||||
|
<td>${user_week}</td>
|
||||||
|
<td>${user_month}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<ul class="nav nav-pills" id="error_filter">
|
<ul class="nav nav-pills" id="error_filter">
|
||||||
<li class="active"><a href="#!log" filter="%">All</a></li>
|
<li class="${active}"><a href="#!log" filter="%">All</a></li>
|
||||||
${error_filter}
|
${error_filter}
|
||||||
</ul>
|
</ul>
|
||||||
<div id="table_log">${table}</div>
|
<div id="table_log">${table}</div>
|
||||||
@ -6,7 +6,7 @@
|
|||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_stats">
|
<div class="tab-pane active" id="tab_stats">
|
||||||
<select id="vis_filter_time">
|
<select id="vis_filter_time">
|
||||||
<option value="2592000">30d</option>
|
<option value="2692000">30d</option>
|
||||||
<option value="1209600">14d</option>
|
<option value="1209600">14d</option>
|
||||||
<option value="604800">7d</option>
|
<option value="604800">7d</option>
|
||||||
<option value="172800">2d</option>
|
<option value="172800">2d</option>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<tr class="sai_log_error ${class_row}" error="${ID}">
|
<tr class="sai_log_error ${class_row}" onClick="system.load('log(error);error.${ID}');">
|
||||||
<td>${time}</td>
|
<td>${time}</td>
|
||||||
<td>${class}</td>
|
<td>${class}</td>
|
||||||
<td style="word-break: break-all;">${message}</td>
|
<td style="word-break: break-all;">${message}</td>
|
||||||
|
|||||||
@ -1,6 +1,19 @@
|
|||||||
function init_saimod_sys_mod() {
|
function init_saimod_sys_mod() {
|
||||||
$('#modstab a').click(function (e) {
|
$('#tabs_mod a').click(function (e) {
|
||||||
e.preventDefault();
|
$('#tabs_mod li').each(function(){
|
||||||
$(this).tab('show');
|
$(this).removeClass('active');});
|
||||||
})
|
$(this).parent().addClass('active');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function init_saimod_sys_mod_system() {
|
||||||
|
$('#tabs_mod li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_mod_system').parent().addClass('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_saimod_sys_mod_project() {
|
||||||
|
$('#tabs_mod li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_mod_project').parent().addClass('active');
|
||||||
|
}
|
||||||
@ -2,36 +2,33 @@
|
|||||||
namespace SYSTEM\SAI;
|
namespace SYSTEM\SAI;
|
||||||
|
|
||||||
class saimod_sys_mod extends \SYSTEM\SAI\SaiModule {
|
class saimod_sys_mod extends \SYSTEM\SAI\SaiModule {
|
||||||
public static function html_content_sys(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_mod_action_system(){
|
||||||
$result = '<table class="table table-hover table-condensed" style="overflow: auto;">'.
|
$vars = array('entries' => '');
|
||||||
'<tr>'.'<th>'.'Classname'.'</th>'.'<th>'.'Public'.'</th>'.'<th>'.'You can Access?'.'</th>'.'</tr>';
|
|
||||||
|
|
||||||
$sys_mods = \SYSTEM\SAI\sai::getSysModules();
|
$sys_mods = \SYSTEM\SAI\sai::getSysModules();
|
||||||
foreach($sys_mods as $mod){
|
foreach($sys_mods as $mod){
|
||||||
$result .= '<tr>'.'<td>'.$mod.'</td>'.'<td>'.(\call_user_func(array($mod, 'right_public')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>').'</td>'.'<td>'.(\call_user_func(array($mod, 'right_right')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>').'</td>'.'</tr>';}
|
$v = array();
|
||||||
$result .= '</table>';
|
$v['mod'] = $mod;
|
||||||
|
$v['public'] = \call_user_func(array($mod, 'right_public')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>';
|
||||||
return $result;
|
$v['you'] = \call_user_func(array($mod, 'right_right')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>';
|
||||||
|
$vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_tr.tpl'),$v);
|
||||||
|
}
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_table.tpl'),$vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function html_content_project(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_mod_action_project(){
|
||||||
$result = '<table class="table table-hover table-condensed" style="overflow: auto;">'.
|
$vars = array('entries' => '');
|
||||||
'<tr>'.'<th>'.'Classname'.'</th>'.'<th>'.'Public'.'</th>'.'<th>'.'You can Access?'.'</th>'.'</tr>';
|
|
||||||
|
|
||||||
$mods = \SYSTEM\SAI\sai::getModules();
|
$mods = \SYSTEM\SAI\sai::getModules();
|
||||||
foreach($mods as $mod){
|
foreach($mods as $mod){
|
||||||
$result .= '<tr>'.'<td>'.$mod.'</td>'.'<td>'.(\call_user_func(array($mod, 'right_public')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>').'</td>'.'<td>'.(\call_user_func(array($mod, 'right_right')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>').'</td>'.'</tr>';}
|
$v = array();
|
||||||
$result .= '</table>';
|
$v['mod'] = $mod;
|
||||||
|
$v['public'] = \call_user_func(array($mod, 'right_public')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>';
|
||||||
return $result;
|
$v['you'] = \call_user_func(array($mod, 'right_right')) ? '<span class="badge badge-success">true</span>' : '<span class="badge badge-important">false</span>';
|
||||||
|
$vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_tr.tpl'),$v);
|
||||||
|
}
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_table.tpl'),$vars);
|
||||||
}
|
}
|
||||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_mod(){
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_mod(){
|
||||||
$vars=array();
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mods.tpl'));}
|
||||||
$vars['content_sys'] = self::html_content_sys();
|
|
||||||
$vars['content_project'] = self::html_content_project();
|
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mods.tpl'), $vars);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function html_li_menu(){return '<li><a id="menu_mod" href="#!mod">SAI Mods</a></li>';}
|
public static function html_li_menu(){return '<li><a id="menu_mod" href="#!mod">SAI Mods</a></li>';}
|
||||||
public static function right_public(){return false;}
|
public static function right_public(){return false;}
|
||||||
|
|||||||
8
sai/modules/saimod_sys_mod/tpl/mod_table.tpl
Normal file
8
sai/modules/saimod_sys_mod/tpl/mod_table.tpl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<table class="table table-hover table-condensed sai_table" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>Classname</th>
|
||||||
|
<th>Public</th>
|
||||||
|
<th>You can Access?</th>
|
||||||
|
</tr>
|
||||||
|
${entries}
|
||||||
|
</table>
|
||||||
5
sai/modules/saimod_sys_mod/tpl/mod_tr.tpl
Normal file
5
sai/modules/saimod_sys_mod/tpl/mod_tr.tpl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<tr>
|
||||||
|
<td>${mod}</td>
|
||||||
|
<td>${public}</td>
|
||||||
|
<td>${you}</td>
|
||||||
|
</tr>
|
||||||
@ -1,12 +1,11 @@
|
|||||||
<h4>SAI Mods</h4>
|
<h4>System Admin Interface Mods</h4>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
<ul class="nav nav-tabs" id="modstab">
|
<ul class="nav nav-tabs" id="tabs_mod">
|
||||||
<li class="active"><a href="#tab_sys">System Mods</a></li>
|
<li class="active"><a href="#!mod" id="menu_mod_system">System Mods</a></li>
|
||||||
<li><a href="#tab_project">Project Mods</a></li>
|
<li><a href="#!mod(project)" id="menu_mod_project">Project Mods</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_sys">${content_sys}</div>
|
<div class="tab-pane active" id="tab_mod"></div>
|
||||||
<div class="tab-pane" id="tab_project">${content_project}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
5
sai/modules/saimod_sys_page/autoload.inc
Normal file
5
sai/modules/saimod_sys_page/autoload.inc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\SAI');
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq/','SYSTEM\DBD');
|
||||||
|
|
||||||
|
\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_page');
|
||||||
0
sai/modules/saimod_sys_page/css/saimod_sys_page.css
Normal file
0
sai/modules/saimod_sys_page/css/saimod_sys_page.css
Normal file
54
sai/modules/saimod_sys_page/js/saimod_sys_page.js
Normal file
54
sai/modules/saimod_sys_page/js/saimod_sys_page.js
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
function init_saimod_sys_page() {
|
||||||
|
$('#tabs_page a').click(function (e) {
|
||||||
|
$('#tabs_page li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$(this).parent().addClass('active');
|
||||||
|
});
|
||||||
|
api_menu();
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_saimod_sys_page_new(){
|
||||||
|
$('#addpage').click(function() {
|
||||||
|
$.ajax({ url: './sai.php',
|
||||||
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_page',
|
||||||
|
action: 'addcall',
|
||||||
|
ID: $('#new_page_id').val(),
|
||||||
|
group: $('#new_page_group').val(),
|
||||||
|
type: $('#new_page_type').val(),
|
||||||
|
parentID: $('#new_page_parentid').val(),
|
||||||
|
parentValue : $('#new_page_parentvalue').val(),
|
||||||
|
name: $('#new_page_name').val(),
|
||||||
|
verify: $('#new_page_verify').val()},
|
||||||
|
type: 'GET',
|
||||||
|
success: function(data) {
|
||||||
|
system.load('page;group.'+$('#new_page_group').val());}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_menu(){
|
||||||
|
$('#tabs_page li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
if($('#menu_group_'+system.cur_state().split('.')[1]).length){
|
||||||
|
$('#menu_group_'+system.cur_state().split('.')[1]).parent().addClass('active');
|
||||||
|
} else {
|
||||||
|
$('#menu_all').parent().addClass('active');}
|
||||||
|
}
|
||||||
|
function init_saimod_sys_page_list(){
|
||||||
|
api_menu();}
|
||||||
|
function init_saimod_sys_page_delete(){
|
||||||
|
$('#del_page_del').click(function() {
|
||||||
|
$.ajax({ url: './sai.php',
|
||||||
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_page',
|
||||||
|
action: 'deletecall',
|
||||||
|
ID: $(this).attr('page_id'),
|
||||||
|
group: $(this).attr('page_group')},
|
||||||
|
type: 'GET',
|
||||||
|
success: function(data) {
|
||||||
|
console.log("page call deleted");
|
||||||
|
$('#page_deletedialog').html('<p>Api call deleted!</p>');
|
||||||
|
$('#del_page_del').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_ADD.php
Normal file
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_ADD.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_PAGE_ADD extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'INSERT INTO '.\SYSTEM\DBD\system_page::NAME_PG.' (ID, group, type, parentID, parentValue, name, verify) VALUES ($1, $2, $3, $4, $5, $6, $7);',
|
||||||
|
//mys
|
||||||
|
'INSERT INTO '.\SYSTEM\DBD\system_page::NAME_MYS.' (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (?, ?, ?, ?, ?, ?, ?);'
|
||||||
|
);}}
|
||||||
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_DEL.php
Normal file
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_DEL.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_PAGE_DEL extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'DELETE FROM '.\SYSTEM\DBD\system_page::NAME_PG.' WHERE `ID` = $1 AND group = $2;',
|
||||||
|
//mys
|
||||||
|
'DELETE FROM '.\SYSTEM\DBD\system_page::NAME_MYS.' WHERE `ID` = ? AND `group` = ?;'
|
||||||
|
);}}
|
||||||
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_GET.php
Normal file
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_GET.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_PAGE_GET extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM system_page ORDER BY `group`, `ID` ASC;',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM system_page ORDER BY `group`, `ID` ASC;'
|
||||||
|
);}}
|
||||||
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_GROUPS.php
Normal file
11
sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_GROUPS.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_PAGE_GROUPS extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT "group", count(*) as "count" FROM system.page GROUP BY "group" ORDER BY "group" ASC;',
|
||||||
|
//mys
|
||||||
|
'SELECT `group`, count(*) as `count` FROM system_page GROUP BY `group` ORDER BY `group` ASC;'
|
||||||
|
);}}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SAIMOD_PAGE_SINGLE_SELECT extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_PG.' WHERE ID = $1 AND group = $2;',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_MYS.' WHERE ID = ? AND `group` = ?;'
|
||||||
|
);}}
|
||||||
76
sai/modules/saimod_sys_page/saimod_sys_page.php
Normal file
76
sai/modules/saimod_sys_page/saimod_sys_page.php
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\SAI;
|
||||||
|
class saimod_sys_page extends \SYSTEM\SAI\SaiModule {
|
||||||
|
public static function sai_mod__SYSTEM_SAI_saimod_sys_page(){
|
||||||
|
$vars = array();
|
||||||
|
$vars['tabopts'] = '';
|
||||||
|
|
||||||
|
$res = \SYSTEM\DBD\SYS_SAIMOD_PAGE_GROUPS::QQ();
|
||||||
|
|
||||||
|
while($r = $res->next()){
|
||||||
|
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/tabopt.tpl'), array( 'tab_id' => $r['group']));}
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/saimod_sys_page.tpl'), $vars);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_page_action_list($group=null){
|
||||||
|
$res = \SYSTEM\DBD\SYS_SAIMOD_PAGE_GET::QQ();
|
||||||
|
$tab = array('content' => '');
|
||||||
|
while($r = $res->next()){
|
||||||
|
if($group != null && $r['group'] != $group){
|
||||||
|
continue;}
|
||||||
|
$tab['tab_id'] = $r['group'];
|
||||||
|
$r['tr_class'] = self::tablerow_class($r['type']);
|
||||||
|
$r['type'] = self::type_names($r['type']);
|
||||||
|
$tab['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/list_entry.tpl'), $r);
|
||||||
|
}
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl'), $tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_page_action_deletedialog($ID,$group){
|
||||||
|
$res = \SYSTEM\DBD\SYS_SAIMOD_PAGE_SINGLE_SELECT::Q1(array($ID,$group));
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/delete_dialog.tpl'), $res);
|
||||||
|
}
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_page_action_newdialog(){
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/new_dialog.tpl'));}
|
||||||
|
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_page_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){
|
||||||
|
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}
|
||||||
|
if($parentValue == ''){ $parentValue = NULL;}
|
||||||
|
if($verify == ''){ $verify = NULL;}
|
||||||
|
\SYSTEM\DBD\SYS_SAIMOD_PAGE_ADD::QI(array($ID,$group,$type,$parentID,$parentValue,$name,$verify));
|
||||||
|
return \SYSTEM\LOG\JsonResult::ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sai_mod__system_sai_saimod_sys_page_action_deletecall($ID,$group){
|
||||||
|
if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");}
|
||||||
|
\SYSTEM\DBD\SYS_SAIMOD_PAGE_DEL::QI(array($ID,$group));
|
||||||
|
return \SYSTEM\LOG\JsonResult::ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function type_names($type){
|
||||||
|
switch($type){
|
||||||
|
case 0: return 'STATIC';
|
||||||
|
case 1: return 'DYNAMIC';
|
||||||
|
default: return 'Problem unknown type';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function tablerow_class($flag){
|
||||||
|
switch($flag){
|
||||||
|
case 0: return 'success';
|
||||||
|
case 1: return 'info';
|
||||||
|
default: return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function html_li_menu(){return '<li><a id="menu_page" href="#!page">Page</a></li>';}
|
||||||
|
public static function right_public(){return false;}
|
||||||
|
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API);}
|
||||||
|
|
||||||
|
public static function css(){
|
||||||
|
return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/css/saimod_sys_page.css'));}
|
||||||
|
public static function js(){
|
||||||
|
return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/js/saimod_sys_page.js'));}
|
||||||
|
}
|
||||||
32
sai/modules/saimod_sys_page/tpl/delete_dialog.tpl
Normal file
32
sai/modules/saimod_sys_page/tpl/delete_dialog.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<div id="page_deletedialog">
|
||||||
|
<h5>Page: ${id} - ${name} - ${group} - ${state}</h5>
|
||||||
|
<hr>
|
||||||
|
<table class="table table-hover table-condensed" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>id</th>
|
||||||
|
<th>name</th>
|
||||||
|
<th>group</th>
|
||||||
|
<th>state</th>
|
||||||
|
<th>parent_id</th>
|
||||||
|
<th>type</th>
|
||||||
|
<th>div</th>
|
||||||
|
<th>url</th>
|
||||||
|
<th>func</th>
|
||||||
|
<th>php_class</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>${id}</td>
|
||||||
|
<td>${name}</td>
|
||||||
|
<td>${group}</td>
|
||||||
|
<td>${state}</td>
|
||||||
|
<td>${parent_id}</td>
|
||||||
|
<td>${type}</td>
|
||||||
|
<td>${div}</td>
|
||||||
|
<td>${url}</td>
|
||||||
|
<td>${func}</td>
|
||||||
|
<td>${php_class}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn btn-small btn-danger" id="del_page_del" page_id="${ID}" page_group="${group}">Delete</button>
|
||||||
|
<button type="button" class="btn btn-small" onClick="system.load('page;group.${group}');">Close</button>
|
||||||
12
sai/modules/saimod_sys_page/tpl/list_entry.tpl
Normal file
12
sai/modules/saimod_sys_page/tpl/list_entry.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<tr class="${tr_class} page_entries" onClick="system.load('page(delete);group.${group};id.${id};name.${name};state.${state}');">
|
||||||
|
<td>${id}</td>
|
||||||
|
<td>${name}</td>
|
||||||
|
<td>${group}</td>
|
||||||
|
<td>${state}</td>
|
||||||
|
<td>${parent_id}</td>
|
||||||
|
<td>${type}</td>
|
||||||
|
<td>${div}</td>
|
||||||
|
<td>${url}</td>
|
||||||
|
<td>${func}</td>
|
||||||
|
<td>${php_class}</td>
|
||||||
|
</tr>
|
||||||
44
sai/modules/saimod_sys_page/tpl/new_dialog.tpl
Normal file
44
sai/modules/saimod_sys_page/tpl/new_dialog.tpl
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<table class="table table-hover table-condensed" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>id</th>
|
||||||
|
<td><input type="text" id="new_page_id" placeholder="new id" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>name</th>
|
||||||
|
<td><input type="text" id="new_page_name" placeholder="name" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>group</th>
|
||||||
|
<td><input type="text" id="new_page_group" placeholder="new group" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>state</th>
|
||||||
|
<td><input type="text" id="new_page_state" placeholder="new state" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>parent_id</th>
|
||||||
|
<td><input type="text" id="new_page_parentid" placeholder="parent id" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>type</th>
|
||||||
|
<td><input type="text" id="new_page_type" placeholder="new type" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>div</th>
|
||||||
|
<td><input type="text" id="new_page_div" placeholder="div" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>url</th>
|
||||||
|
<td><input type="text" id="new_page_url" placeholder="url" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>func</th>
|
||||||
|
<td><input type="text" id="new_page_func" placeholder="func" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>php_class</th>
|
||||||
|
<td><input type="text" id="new_page_php_class" placeholder="php class" style="width: 140px;"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<button type="button" class="btn-small" onClick="system.load('page');">Back</button>
|
||||||
|
<button type="button" class="btn-small btn-success" id="addpage" style="float: right;">Add</button>
|
||||||
12
sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl
Normal file
12
sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<h4>System Page</h4>
|
||||||
|
<hr>
|
||||||
|
<div class="tabbable">
|
||||||
|
<ul class="nav nav-tabs" id="tabs_page">
|
||||||
|
<li><a href="#!page" id="menu_all">All</a></li>
|
||||||
|
${tabopts}
|
||||||
|
<button onClick="system.load('page(new)',true);" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">New</button>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="tab_page"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
15
sai/modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl
Normal file
15
sai/modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<table class="table table-hover table-condensed" style="overflow: auto;">
|
||||||
|
<tr>
|
||||||
|
<th>id</th>
|
||||||
|
<th>name</th>
|
||||||
|
<th>group</th>
|
||||||
|
<th>state</th>
|
||||||
|
<th>parent_id</th>
|
||||||
|
<th>type</th>
|
||||||
|
<th>div</th>
|
||||||
|
<th>url</th>
|
||||||
|
<th>func</th>
|
||||||
|
<th>php_class</th>
|
||||||
|
</tr>
|
||||||
|
${content}
|
||||||
|
</table>
|
||||||
1
sai/modules/saimod_sys_page/tpl/tabopt.tpl
Normal file
1
sai/modules/saimod_sys_page/tpl/tabopt.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
<li><a href="#!page;group.${tab_id}" id="menu_group_${tab_id}">Group ${tab_id}</a></li>
|
||||||
@ -1,46 +1,47 @@
|
|||||||
var user_search = '';
|
|
||||||
function init_saimod_sys_security() {
|
function init_saimod_sys_security() {
|
||||||
$('#securitytab a').click(function (e) {
|
$('#securitytab a').click(function (e) {
|
||||||
e.preventDefault();
|
$('#securitytab li').each(function(){
|
||||||
$(this).tab('show');
|
$(this).removeClass('active');});
|
||||||
load_security_tab($(this).attr('action'));
|
$(this).parent().addClass('active');
|
||||||
})
|
});
|
||||||
|
|
||||||
load_security_tab('users');
|
$('#user_go').click(function(){
|
||||||
|
system.load('security;search.'+encodeURIComponent($('#user_search').val()));})
|
||||||
};
|
};
|
||||||
|
|
||||||
function load_security_tab(action){
|
function init_saimod_sys_security_users() {
|
||||||
$('img#loader').show();
|
$('#securitytab li').each(function(){
|
||||||
switch(action){
|
$(this).removeClass('active');});
|
||||||
case 'users':
|
$('#menu_users').parent().addClass('active');
|
||||||
$('#tab_users').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action+'&search='+encodeURIComponent(user_search), function(){
|
|
||||||
register_users();
|
|
||||||
$('img#loader').hide();});
|
|
||||||
return;
|
|
||||||
case 'rights':
|
|
||||||
$('#tab_rights').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action, function(){
|
|
||||||
register_rights();
|
|
||||||
$('img#loader').hide();});
|
|
||||||
return;
|
|
||||||
case 'groups':
|
|
||||||
$('#tab_groups').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action, function(){
|
|
||||||
$('img#loader').hide();});
|
|
||||||
return;
|
|
||||||
case 'stats':
|
|
||||||
$('#tab_stats').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action, function(){
|
|
||||||
$('img#loader').hide();});
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
$('img#loader').hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_rights(){
|
function init_saimod_sys_security_user() {
|
||||||
$('#new_right').click(function(){
|
$('.deleteuserright').click(function(){
|
||||||
$('#tab_rights').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright',function(){
|
$.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleterightuser&rightid='+$(this).attr('right_id')+
|
||||||
register_newright();
|
'&userid='+$(this).attr('user_id'),function(data){
|
||||||
});
|
if(data==1){
|
||||||
|
alert('sucess');
|
||||||
|
} else {
|
||||||
|
alert('fail');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
$('#adduserright_add').click(function(){
|
||||||
|
$.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addrightuser&rightid='+$('#adduserright_rightid').val()+
|
||||||
|
'&userid='+$(this).attr('user_id'),function(data){
|
||||||
|
if(data==1){
|
||||||
|
alert('sucess');
|
||||||
|
} else {
|
||||||
|
alert('fail');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_saimod_sys_security_rights() {
|
||||||
|
$('#securitytab li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_rights').parent().addClass('active');
|
||||||
|
|
||||||
$('.right_edit').click(function(){
|
$('.right_edit').click(function(){
|
||||||
alert('todo');
|
alert('todo');
|
||||||
@ -51,9 +52,28 @@ function register_rights(){
|
|||||||
register_deleteright();
|
register_deleteright();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#new_right').click(function(){
|
||||||
|
$('#tab_rights').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright',function(){
|
||||||
|
register_newright();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function init_saimod_sys_security_newright() {
|
||||||
|
$('#addright').click(function(){
|
||||||
|
$.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addright&id='+$('#addright_id').val()+
|
||||||
|
'&name='+encodeURIComponent($('#addright_name').val())+
|
||||||
|
'&description='+encodeURIComponent($('#addright_description').val()),function(data){
|
||||||
|
if(data==1){
|
||||||
|
alert('sucess');
|
||||||
|
} else {
|
||||||
|
alert('fail');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_deleteright(){
|
function init_saimod_sys_security_delright(){
|
||||||
$('#deleteright_confirm').click(function(){
|
$('#deleteright_confirm').click(function(){
|
||||||
$.get('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleteright&id='+$(this).attr('right_id'),
|
$.get('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleteright&id='+$(this).attr('right_id'),
|
||||||
function(data){
|
function(data){
|
||||||
@ -69,49 +89,3 @@ function register_deleteright(){
|
|||||||
load_security_tab('rights');
|
load_security_tab('rights');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_newright(){
|
|
||||||
$('#addright').click(function(){
|
|
||||||
$.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addright&id='+$('#addright_id').val()+
|
|
||||||
'&name='+encodeURIComponent($('#addright_name').val())+
|
|
||||||
'&description='+encodeURIComponent($('#addright_description').val()),function(data){
|
|
||||||
if(data==1){
|
|
||||||
alert('sucess');
|
|
||||||
} else {
|
|
||||||
alert('fail');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function register_users(){
|
|
||||||
$('#user_go').click(function(){
|
|
||||||
user_search = $('#user_search').val();
|
|
||||||
load_security_tab('users');
|
|
||||||
});
|
|
||||||
$('#user_search').val(user_search);
|
|
||||||
$('.user_entry').click(function(){
|
|
||||||
$('#tab_users').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=user&username='+encodeURIComponent($(this).attr('username')),function(){
|
|
||||||
$('.deleteuserright').click(function(){
|
|
||||||
$.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleterightuser&rightid='+$(this).attr('right_id')+
|
|
||||||
'&userid='+$(this).attr('user_id'),function(data){
|
|
||||||
if(data==1){
|
|
||||||
alert('sucess');
|
|
||||||
} else {
|
|
||||||
alert('fail');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
$('#adduserright_add').click(function(){
|
|
||||||
$.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addrightuser&rightid='+$('#adduserright_rightid').val()+
|
|
||||||
'&userid='+$(this).attr('user_id'),function(data){
|
|
||||||
if(data==1){
|
|
||||||
alert('sucess');
|
|
||||||
} else {
|
|
||||||
alert('fail');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@ -15,13 +15,13 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
|
|||||||
$res = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_RIGHTS::QQ();
|
$res = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_RIGHTS::QQ();
|
||||||
while($r = $res->next()){
|
while($r = $res->next()){
|
||||||
$r['right_edit_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ?
|
$r['right_edit_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ?
|
||||||
'<input type="submit" class="btn-danger right_delete" value="delete" right_id="'.$r['ID'].'">
|
'<input type="submit" class="btn-danger right_delete" value="delete" onClick="system.load(\'security(delright);id.'.$r['ID'].'\');">
|
||||||
<input type="submit" class="btn right_edit" value="edit" right_id="'.$r['ID'].'">' :
|
<input type="submit" class="btn right_edit" value="edit" right_id="'.$r['ID'].'">' :
|
||||||
'<font color="red">Missing rights.</font>';
|
'<font color="red">Missing rights.</font>';
|
||||||
$rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl'),$r);}
|
$rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl'),$r);}
|
||||||
$vars['rows'] = $rows;
|
$vars['rows'] = $rows;
|
||||||
$vars['addright_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ?
|
$vars['addright_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ?
|
||||||
'<input type="submit" class="btn" id="new_right" value="New Right">' :
|
'<input type="submit" onClick="system.load(\'security(newright)\');" class="btn" value="New Right">' :
|
||||||
'<font color="red">You are missing the required rights for adding or removing rights.</font>';
|
'<font color="red">You are missing the required rights for adding or removing rights.</font>';
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl'),$vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl'),$vars);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,16 +2,13 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
<ul class="nav nav-tabs" id="securitytab">
|
<ul class="nav nav-tabs" id="securitytab">
|
||||||
<li class="active"><a href="#tab_users" action="users">Users</a></li>
|
<li class="active"><a href="#!security" id="menu_users">Users</a></li>
|
||||||
<li><a href="#tab_rights" action="rights">Rights</a></li>
|
<li><a href="#!security(rights)" id="menu_rights">Rights</a></li>
|
||||||
<li><a href="#tab_groups" action="groups">Groups</a></li>
|
|
||||||
<li><a href="#tab_stats" action="stats">Stats</a></li>
|
|
||||||
<img id="loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
<img id="loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
||||||
|
<input class="btn-sm btn-success" id="user_go" type="submit" value="Search" style="float: right; margin-left: 10px;"/>
|
||||||
|
<input class="input-medium search-query" id="user_search" type="text" placeholder="EMail or Username" size="30" style="float: right;"/>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_users"></div>
|
<div class="tab-pane active" id="tab_security"></div>
|
||||||
<div class="tab-pane" id="tab_rights"></div>
|
|
||||||
<div class="tab-pane" id="tab_groups"></div>
|
|
||||||
<div class="tab-pane" id="tab_stats"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -14,4 +14,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<input id="deleteright_confirm" class="btn-danger btn" right_id="${ID}" type="submit" value="Delete"/>
|
<input id="deleteright_confirm" class="btn-danger btn" right_id="${ID}" type="submit" value="Delete"/>
|
||||||
<input id="deleteright_abort" class="btn" type="submit" value="Abort"/>
|
<input id="deleteright_abort" onClick="system.load('security(rights)');" class="btn" type="submit" value="Abort"/>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<tr class="user_entry ${class} sai_table" username="${username}">
|
<tr class="user_entry ${class} sai_table" onClick="system.load('security(user);username.${username}');">
|
||||||
<td>${id}</td>
|
<td>${id}</td>
|
||||||
<td>${username}</td>
|
<td>${username}</td>
|
||||||
<td>${email}</td>
|
<td>${email}</td>
|
||||||
|
|||||||
@ -1,7 +1,3 @@
|
|||||||
<input class="input-medium search-query" id="user_search" type="text" placeholder="EMail or Username" size="30"/>
|
|
||||||
<input class="btn-sm btn-success" id="user_go" type="submit" value="Search"/>
|
|
||||||
</br>
|
|
||||||
</br>
|
|
||||||
Users: ${count}
|
Users: ${count}
|
||||||
<table class="sai_table table table-hover table-condensed" style="overflow: auto;">
|
<table class="sai_table table table-hover table-condensed" style="overflow: auto;">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
|
|||||||
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
|
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
|
||||||
$res = null;
|
$res = null;
|
||||||
if(\SYSTEM\system::isSystemDbInfoPG()){
|
if(\SYSTEM\system::isSystemDbInfoPG()){
|
||||||
$res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_PG.' SET "'.$lang.'"=$1 WHERE category = $1 AND id=$2;', array($newtext, $category, $id));
|
$res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_PG.' SET "'.$lang.'"=$1 WHERE category = $2 AND id=$3;', array($newtext, $category, $id));
|
||||||
} else {
|
} else {
|
||||||
$res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' SET '.$lang.'=? WHERE category = ? AND id=?;', array($newtext, $category, $id));
|
$res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' SET '.$lang.'=? WHERE category = ? AND id=?;', array($newtext, $category, $id));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +1,77 @@
|
|||||||
function init_saimod_sys_todo() {
|
function init_saimod_sys_todo() {
|
||||||
$('#tabs_todo a').click(function (e) {
|
$('#tabs_todo a').click(function (e) {
|
||||||
e.preventDefault();
|
$('#tabs_todo li').each(function(){
|
||||||
$(this).tab('show');
|
$(this).removeClass('active');});
|
||||||
load_todo_tab($(this).attr('action'));
|
$(this).parent().addClass('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
load_todo_tab('todolist');
|
$('#btn_close_all').click(function(){
|
||||||
register_new();
|
if (confirm('Are you sure you want to delete all open entries in the todolist?')) {
|
||||||
|
$.ajax({ type :'GET',
|
||||||
|
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=close_all',
|
||||||
|
success : function(data) {
|
||||||
|
if(data.status){
|
||||||
|
system.load('todo');
|
||||||
|
}else{
|
||||||
|
alert('Problem: '+data);}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
function register_new(){
|
function init_saimod_sys_todo_todo() {
|
||||||
$('#btn_new').click(function(){
|
$('#tabs_todo li').each(function(){
|
||||||
$('#img_loader').show();
|
$(this).removeClass('active');});
|
||||||
$('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=new', function(){
|
$('#menu_todolist').parent().addClass('active');
|
||||||
register_newform();
|
|
||||||
$('#btn_back').click(function(){
|
|
||||||
load_todo_tab('todolist');});
|
|
||||||
$('#img_loader').hide();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_edit(){
|
function init_saimod_sys_todo_doto() {
|
||||||
|
$('#tabs_todo li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_doto').parent().addClass('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_saimod_sys_todo_stats() {
|
||||||
|
$('#tabs_todo li').each(function(){
|
||||||
|
$(this).removeClass('active');});
|
||||||
|
$('#menu_stats').parent().addClass('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
function init_saimod_sys_todo_todoopen(){
|
||||||
$('#btn_edit').click(function(){
|
$('#btn_edit').click(function(){
|
||||||
$.ajax({ type : 'GET',
|
$.ajax({ type : 'GET',
|
||||||
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()),
|
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()),
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
if(data.status){
|
if(data.status){
|
||||||
load_todo_tab('todolist');
|
system.load('todo');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
register_open();
|
||||||
|
}
|
||||||
|
function init_saimod_sys_todo_todoclose(){
|
||||||
|
$('#btn_edit').click(function(){
|
||||||
|
$.ajax({ type : 'GET',
|
||||||
|
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()),
|
||||||
|
success : function(data) {
|
||||||
|
if(data.status){
|
||||||
|
system.load('todo');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
register_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_newform(){
|
function init_saimod_sys_todo_new(){
|
||||||
$('#btn_add').click(function(){
|
$('#btn_add').click(function(){
|
||||||
$.ajax({ type : 'GET',
|
$.ajax({ type : 'GET',
|
||||||
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=add&todo='+encodeURIComponent($('#input_message').val()),
|
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=add&todo='+encodeURIComponent($('#input_message').val()),
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
if(data.status){
|
if(data.status){
|
||||||
load_todo_tab('todolist');
|
system.load('todo');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -48,42 +79,6 @@ function register_newform(){
|
|||||||
$('#input_message').focus();
|
$('#input_message').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_todo_tab(action){
|
|
||||||
$('#img_loader').show();
|
|
||||||
switch(action){
|
|
||||||
case 'todolist':
|
|
||||||
$('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action='+action, function(){
|
|
||||||
register_todolist();
|
|
||||||
register_listclick(true);
|
|
||||||
$('#img_loader').hide();});
|
|
||||||
return;
|
|
||||||
case 'dotolist':
|
|
||||||
$('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action='+action, function(){
|
|
||||||
register_doto();
|
|
||||||
register_listclick();
|
|
||||||
$('#img_loader').hide();});
|
|
||||||
return;
|
|
||||||
case 'stats':
|
|
||||||
$('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action='+action, function(){
|
|
||||||
register_stats();
|
|
||||||
$('#img_loader').hide();});
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
$('#img_loader').hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function register_listclick(todo){
|
|
||||||
$('.sai_todo_element').click(function(){
|
|
||||||
$('#img_loader').show();
|
|
||||||
$('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todo&todo='+$(this).attr('todo'), function(){
|
|
||||||
register_edit();
|
|
||||||
$('#btn_back').click(function(){
|
|
||||||
if(todo){load_todo_tab('todolist');}else{load_todo_tab('dotolist');}});
|
|
||||||
if(todo){register_close();}else{register_open();}
|
|
||||||
$('#img_loader').hide();})});
|
|
||||||
}
|
|
||||||
|
|
||||||
function register_open(){
|
function register_open(){
|
||||||
$('#btn_open').show();
|
$('#btn_open').show();
|
||||||
$('#btn_open').click(function(){
|
$('#btn_open').click(function(){
|
||||||
@ -113,39 +108,3 @@ function register_close(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function register_todolist(){
|
|
||||||
$('#btn_refresh').unbind('click');
|
|
||||||
$('#btn_refresh').click(function(){
|
|
||||||
load_todo_tab('todolist');});
|
|
||||||
$('#btn_close_all').unbind('click');
|
|
||||||
$('#btn_close_all').click(function(){
|
|
||||||
if (confirm('Are you sure you want to delete all open entries in the todolist?')) {
|
|
||||||
$.ajax({ type :'GET',
|
|
||||||
url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=close_all',
|
|
||||||
success : function(data) {
|
|
||||||
if(data.status){
|
|
||||||
load_todo_tab('todolist');
|
|
||||||
}else{
|
|
||||||
alert('Problem: '+data);}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
function register_doto(){
|
|
||||||
$('#btn_refresh').unbind('click');
|
|
||||||
$('#btn_refresh').click(function(){
|
|
||||||
load_todo_tab('dotolist');});
|
|
||||||
$('#btn_close_all').unbind('click');
|
|
||||||
$('#btn_close_all').click(function(){
|
|
||||||
alert('operation not possible on this list');});
|
|
||||||
}
|
|
||||||
function register_stats(){
|
|
||||||
$('#btn_refresh').unbind('click');
|
|
||||||
$('#btn_refresh').click(function(){
|
|
||||||
load_todo_tab('stats');});
|
|
||||||
$('#btn_close_all').unbind('click');
|
|
||||||
$('#btn_close_all').click(function(){
|
|
||||||
alert('operation not possible on this list');});
|
|
||||||
}
|
|
||||||
@ -47,6 +47,9 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
|
|||||||
//$row['report_type'] = self::reporttype($row['type']);
|
//$row['report_type'] = self::reporttype($row['type']);
|
||||||
$row['state_string'] = self::state($row['count']);
|
$row['state_string'] = self::state($row['count']);
|
||||||
$row['state_btn'] = self::statebtn($row['count']);
|
$row['state_btn'] = self::statebtn($row['count']);
|
||||||
|
$row['message'] = htmlspecialchars($row['message']);
|
||||||
|
$row['request_uri'] = htmlspecialchars($row['request_uri']);
|
||||||
|
$row['openclose'] = 'close';
|
||||||
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
|
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
|
||||||
$row['message'] = str_replace("\r", '<br/>', $row['message']);
|
$row['message'] = str_replace("\r", '<br/>', $row['message']);
|
||||||
$result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
|
$result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
|
||||||
@ -65,6 +68,9 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
|
|||||||
$row['time_elapsed'] = self::time_elapsed_string(strtotime($row['time']));
|
$row['time_elapsed'] = self::time_elapsed_string(strtotime($row['time']));
|
||||||
$row['state_string'] = self::state($row['count']);
|
$row['state_string'] = self::state($row['count']);
|
||||||
$row['state_btn'] = self::statebtn($row['count']);
|
$row['state_btn'] = self::statebtn($row['count']);
|
||||||
|
$row['message'] = htmlspecialchars($row['message']);
|
||||||
|
$row['request_uri'] = htmlspecialchars($row['request_uri']);
|
||||||
|
$row['openclose'] = 'open';
|
||||||
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
|
if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){
|
||||||
$row['message'] = str_replace("\r", '<br/>', $row['message']);
|
$row['message'] = str_replace("\r", '<br/>', $row['message']);
|
||||||
$result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
|
$result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row);
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
<ul class="nav nav-tabs" id="tabs_todo">
|
<ul class="nav nav-tabs" id="tabs_todo">
|
||||||
<li class="active"><a href="#tab_todo" action="todolist">ToDo</a></li>
|
<li class="active"><a href="#!todo" id="menu_todolist">ToDo</a></li>
|
||||||
<li><a href="#tab_todo" action="dotolist">DoTo</a></li>
|
<li><a href="#!todo(doto)" id="menu_doto">DoTo</a></li>
|
||||||
<li><a href="#tab_todo" action="stats">Statistics</a></li>
|
<li><a href="#!todo(stats)" id="menu_stats">Statistics</a></li>
|
||||||
<img id="img_loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
<img id="img_loader" src="${PICPATH}ajax-loader.gif" style="margin-left: 10px; margin-top: 10px; display: none; float: left"/>
|
||||||
<button id="btn_refresh" class="btn-primary" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Refresh</button>
|
<button id="btn_refresh" class="btn-primary" onClick="system.load('todo',true);" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Refresh</button>
|
||||||
<button id="btn_close_all" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Close All</button>
|
<button id="btn_close_all" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Close All</button>
|
||||||
<button id="btn_new" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Add</button>
|
<button id="btn_new" class="btn-success" onClick="system.load('todo(new)');" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Add</button>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane active" id="tab_todo"></div>
|
<div class="tab-pane active" id="tab_todo"></div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<table class="table table-hover table-condensed">
|
<table class="table table-hover table-condensed">
|
||||||
<tr><td>Message</td><td><textarea style="width: 80%; height: 400px;" id="input_message"></textarea></td></tr>
|
<tr><td>Message</td><td><textarea style="width: 80%; height: 400px;" id="input_message"></textarea></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<button id="btn_back" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
|
<button id="btn_back" class="btn-success" onClick="system.load('todo');" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
|
||||||
<button id="btn_add" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Add</button>
|
<button id="btn_add" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Add</button>
|
||||||
@ -21,6 +21,6 @@
|
|||||||
<tr><td>thrown</td><td>${thrown}</td></tr>
|
<tr><td>thrown</td><td>${thrown}</td></tr>
|
||||||
<tr><td>message</td><td>${message}</td></tr>
|
<tr><td>message</td><td>${message}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<button id="btn_back" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
|
<button id="btn_back" onClick="system.load('todo');" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
|
||||||
<button id="btn_close" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Close</button>
|
<button id="btn_close" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Close</button>
|
||||||
<button id="btn_open" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Open</button>
|
<button id="btn_open" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Open</button>
|
||||||
@ -10,7 +10,7 @@
|
|||||||
<tr><td>user</td><td>${username}</td></tr>
|
<tr><td>user</td><td>${username}</td></tr>
|
||||||
<tr><td>message</td><td><textarea id="ta_message" style="width: 80%; height: 400px;">${message}</textarea></td></tr>
|
<tr><td>message</td><td><textarea id="ta_message" style="width: 80%; height: 400px;">${message}</textarea></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<button id="btn_back" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
|
<button id="btn_back" onClick="system.load('todo');" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
|
||||||
<button id="btn_edit" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Edit</button>
|
<button id="btn_edit" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Edit</button>
|
||||||
<button id="btn_close" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Close</button>
|
<button id="btn_close" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Close</button>
|
||||||
<button id="btn_open" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Open</button>
|
<button id="btn_open" class="btn-danger" style="display: none; margin-right: 15px; height: 32px; font-size: 13px; float: right;" todo="${ID}">Open</button>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<tr class="sai_todo_element ${class_row}" todo="${ID}">
|
<tr class="sai_todo_element ${class_row}" onClick="system.load('todo(todo${openclose});todo.${ID}');">
|
||||||
<td>${time_elapsed}</td>
|
<td>${time_elapsed}</td>
|
||||||
<td>${class}</td>
|
<td>${class}</td>
|
||||||
<td style="word-break: break-all;">${message}</td>
|
<td style="word-break: break-all;">${message}</td>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<tr class="sai_todo_element ${class_row}" todo="${ID}">
|
<tr class="sai_todo_element ${class_row}" onClick="system.load('todo(todo${openclose});todo.${ID}');">
|
||||||
<td>${time_elapsed}</td>
|
<td>${time_elapsed}</td>
|
||||||
<td style="word-break: break-all;">${message}</td>
|
<td style="word-break: break-all;">${message}</td>
|
||||||
<td>${username}</td>
|
<td>${username}</td>
|
||||||
|
|||||||
@ -24,15 +24,16 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
|
|||||||
protected static function html_content(){
|
protected static function html_content(){
|
||||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
$vars['login'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/login.tpl'), array());
|
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content.tpl'),$vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content.tpl'),$vars);
|
||||||
}
|
}
|
||||||
$vars = array();
|
$vars = array();
|
||||||
$vars['project_name'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT);
|
$vars['project_name'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT);
|
||||||
$vars['project_url'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL);
|
$vars['project_url'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL);
|
||||||
$vars['todo_entries'] = \SYSTEM\SAI\saimod_sys_todo::sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist();
|
$vars['analytics'] = \SYSTEM\SAI\saimod_sys_log::analytics();
|
||||||
$vars['log_entries'] = \SYSTEM\SAI\saimod_sys_log::sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter();
|
$user = \SYSTEM\SECURITY\Security::getUser();
|
||||||
$vars['logout'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/logout.tpl'));
|
$vars['username'] = $user->username;
|
||||||
|
$vars['locale'] = $user->locale;
|
||||||
|
$vars['isadmin'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) ? "yes" : "no";
|
||||||
$vars = array_merge($vars,\SYSTEM\SAI\saimod_sys_todo::statistics());
|
$vars = array_merge($vars,\SYSTEM\SAI\saimod_sys_todo::statistics());
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content_loggedin.tpl'), $vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content_loggedin.tpl'), $vars);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,5 +16,37 @@
|
|||||||
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
|
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="well" id="login">
|
<div class="well" id="login">
|
||||||
${login}
|
<h2 class="muted">${basic_login}</h2>
|
||||||
|
${basic_text_login}
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<form class="textbox" style="" id="login_form">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<input type="text"
|
||||||
|
size="30"
|
||||||
|
style="margin-bottom: 15px;"
|
||||||
|
id="bt_login_user"
|
||||||
|
placeholder="${basic_placeholder_username}"
|
||||||
|
minlength="3" data-validation-minlength-message="${sai_error_username_short}"
|
||||||
|
maxlength="16" data-validation-maxlength-message="${sai_error_username_long}"
|
||||||
|
required data-validation-required-message="${sai_error_username_miss}"/>
|
||||||
|
</div>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="password"
|
||||||
|
size="30"
|
||||||
|
style="margin-bottom: 15px;"
|
||||||
|
id="bt_login_password"
|
||||||
|
placeholder="${basic_placeholder_password}"
|
||||||
|
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
|
||||||
|
maxlength="16" data-validation-maxlength-message="${sai_error_password_long}"
|
||||||
|
required data-validation-required-message="${sai_error_password_miss}"/>
|
||||||
|
</div>
|
||||||
|
<div class="help-block"></div>
|
||||||
|
<input type="hidden" />
|
||||||
|
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;"
|
||||||
|
type="submit"
|
||||||
|
id="login_submit">${basic_login}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -10,15 +10,8 @@
|
|||||||
<b>Progress:</b> ${project}%
|
<b>Progress:</b> ${project}%
|
||||||
</div>
|
</div>
|
||||||
<div class="well" id="analytics">
|
<div class="well" id="analytics">
|
||||||
<h2 class="muted"><a href="#!log">Analytics</a></h2>
|
<h2 class="muted"><a href="#!log(stats)">Analytics</a></h2>
|
||||||
<b>IPs today:</b> ${ip_today}<br/>
|
${analytics}
|
||||||
<b>Users today:</b> ${user_today}<br/>
|
|
||||||
<br/>
|
|
||||||
<b>IPs this week:</b> ${ip_week}<br/>
|
|
||||||
<b>Users this week:</b> ${user_week}<br/>
|
|
||||||
<br/>
|
|
||||||
<b>IPs this month:</b> ${ip_month}<br/>
|
|
||||||
<b>Users this month:</b> ${user_month}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="well" id="git">
|
<div class="well" id="git">
|
||||||
<h2 class="muted">Git</h2>
|
<h2 class="muted">Git</h2>
|
||||||
@ -26,17 +19,39 @@
|
|||||||
<b>Current SYSTEM Version:</b> ${git_system}
|
<b>Current SYSTEM Version:</b> ${git_system}
|
||||||
</div>
|
</div>
|
||||||
<div class="well" id="logout">
|
<div class="well" id="logout">
|
||||||
${logout}
|
<h2 class="muted"><a href="#!login">${basic_logout}</a></h2>
|
||||||
|
<table class="table table-hover table-condensed">
|
||||||
|
<tr>
|
||||||
|
<th>${basic_username}</th>
|
||||||
|
<td>${username}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>${basic_locale}</th>
|
||||||
|
<td>${locale}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>${basic_admin_rights}</th>
|
||||||
|
<td>${isadmin}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
${basic_text_logout}
|
||||||
|
<form class="textbox" style="" id="logout_form">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="help-block"></div>
|
||||||
|
<input type="hidden" />
|
||||||
|
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${basic_logout}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="well" id="todo">
|
<div class="well" id="todo">
|
||||||
<h2 class="muted"><a href="#!todo">Todo</a></h2>
|
<h2 class="muted"><a href="#!todo">Todo</a></h2>
|
||||||
<b>Status:</b> ${project_count}/${project_all}<br/>
|
<b>Status:</b> ${project_count}/${project_all}<br/>
|
||||||
<b>Progress:</b> ${project}%
|
<b>Progress:</b> ${project}%
|
||||||
${todo_entries}
|
<div id="todo_entries"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="well" id="log">
|
<div class="well" id="log">
|
||||||
<h2 class="muted"><a href="#!log">Log</a></h2>
|
<h2 class="muted"><a href="#!log">Log</a></h2>
|
||||||
<h4 class="muted">100 Latest Log Entries</h4>
|
<h4 class="muted">100 Latest Log Entries</h4>
|
||||||
${log_entries}
|
<div id="log_entries"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -1,33 +0,0 @@
|
|||||||
<h2 class="muted">${basic_login}</h2>
|
|
||||||
${basic_text_login}
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<form class="textbox" style="" id="login_form">
|
|
||||||
<div class="control-group">
|
|
||||||
<div class="controls">
|
|
||||||
<input type="text"
|
|
||||||
size="30"
|
|
||||||
style="margin-bottom: 15px;"
|
|
||||||
id="bt_login_user"
|
|
||||||
placeholder="${basic_placeholder_username}"
|
|
||||||
minlength="3" data-validation-minlength-message="${sai_error_username_short}"
|
|
||||||
maxlength="16" data-validation-maxlength-message="${sai_error_username_long}"
|
|
||||||
required data-validation-required-message="${sai_error_username_miss}"/>
|
|
||||||
</div>
|
|
||||||
<div class="controls">
|
|
||||||
<input type="password"
|
|
||||||
size="30"
|
|
||||||
style="margin-bottom: 15px;"
|
|
||||||
id="bt_login_password"
|
|
||||||
placeholder="${basic_placeholder_password}"
|
|
||||||
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
|
|
||||||
maxlength="16" data-validation-maxlength-message="${sai_error_password_long}"
|
|
||||||
required data-validation-required-message="${sai_error_password_miss}"/>
|
|
||||||
</div>
|
|
||||||
<div class="help-block"></div>
|
|
||||||
<input type="hidden" />
|
|
||||||
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;"
|
|
||||||
type="submit"
|
|
||||||
id="login_submit">${basic_login}</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
<h3 class="muted">${basic_logout}</h3>
|
|
||||||
${basic_text_logout}
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
<form class="textbox" style="" id="logout_form">
|
|
||||||
<div class="control-group">
|
|
||||||
<div class="help-block"></div>
|
|
||||||
<input type="hidden" />
|
|
||||||
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${basic_logout}</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
@ -1,24 +1,48 @@
|
|||||||
/*
|
#sai_logo {
|
||||||
Document : index.css
|
padding-left: 10px;
|
||||||
Created on : 31.01.2013, 01:59:37
|
|
||||||
Author : CHRIS MEURISCH
|
|
||||||
Description:
|
|
||||||
Purpose of the stylesheet follows.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.brand-logo{
|
|
||||||
float: left;
|
float: left;
|
||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
#sai_brand{
|
||||||
|
width: 170px;
|
||||||
|
}
|
||||||
|
|
||||||
.footer{
|
|
||||||
|
#sai_navbar{
|
||||||
|
height:40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project_navbar{
|
||||||
|
width:224px;
|
||||||
|
position: fixed;
|
||||||
|
left: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
top: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content-wrapper{
|
||||||
|
overflow: auto;
|
||||||
|
position: absolute;
|
||||||
|
top: 40px;
|
||||||
|
bottom: 0px;
|
||||||
|
left: 224px;
|
||||||
|
right: 0px;
|
||||||
|
padding: 15px;
|
||||||
|
min-width:1000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content{
|
||||||
|
width:100%
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer{
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer a{
|
#footer a{
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class default_page extends \SYSTEM\PAGE\Page {
|
|||||||
|
|
||||||
private static function css(){
|
private static function css(){
|
||||||
$result = '<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/libs/bootstrap.min.css').'" type="text/css" />'.
|
$result = '<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/libs/bootstrap.min.css').'" type="text/css" />'.
|
||||||
'<link rel="stylesheet" href="./api.php?call=files&cat=sys&id=system.css" type="text/css" />'.
|
'<link rel="stylesheet" href="./sai.php?call=files&cat=sys&id=system.css" type="text/css" />'.
|
||||||
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai.css').'" type="text/css" />';
|
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai.css').'" type="text/css" />';
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ class default_page extends \SYSTEM\PAGE\Page {
|
|||||||
private static function js(){
|
private static function js(){
|
||||||
$result = '<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/libs/jquery.min.js').'" type="text/javascript"></script>'.
|
$result = '<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/libs/jquery.min.js').'" type="text/javascript"></script>'.
|
||||||
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/libs/bootstrap.min.js').'" type="text/javascript"></script>'.
|
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/libs/bootstrap.min.js').'" type="text/javascript"></script>'.
|
||||||
'<script type="text/javascript" language="JavaScript" src="./api.php?call=files&cat=sys&id=system.js"></script>'.
|
'<script type="text/javascript" language="JavaScript" src="./sai.php?call=files&cat=sys&id=system.js"></script>'.
|
||||||
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/sai.js').'" type="text/javascript"></script>'.
|
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/sai.js').'" type="text/javascript"></script>'.
|
||||||
'<script src="https://www.google.com/jsapi" type="text/javascript"></script>'.
|
'<script src="https://www.google.com/jsapi" type="text/javascript"></script>'.
|
||||||
'<script src="https://maps.google.com/maps/api/js?v=3&sensor=false" type="text/javascript"></script>'.
|
'<script src="https://maps.google.com/maps/api/js?v=3&sensor=false" type="text/javascript"></script>'.
|
||||||
@ -49,14 +49,6 @@ class default_page extends \SYSTEM\PAGE\Page {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function lang_switcher(){
|
|
||||||
$result = '';
|
|
||||||
$langs = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
|
|
||||||
foreach($langs as $lang){
|
|
||||||
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/language.tpl'),array('lang' => $lang));}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function html($_escaped_fragment_ = NULL){
|
public function html($_escaped_fragment_ = NULL){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
$vars['css'] = self::css();
|
$vars['css'] = self::css();
|
||||||
@ -68,7 +60,6 @@ class default_page extends \SYSTEM\PAGE\Page {
|
|||||||
$vars['menu_proj'] = self::menu_proj();
|
$vars['menu_proj'] = self::menu_proj();
|
||||||
$vars['title'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE);
|
$vars['title'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE);
|
||||||
$vars['copyright'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT);
|
$vars['copyright'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT);
|
||||||
$vars['lang_switcher'] = self::lang_switcher();
|
|
||||||
|
|
||||||
$vars = array_merge($vars,\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI));
|
$vars = array_merge($vars,\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI));
|
||||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars);
|
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars);
|
||||||
|
|||||||
@ -14,7 +14,7 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function sys_hashchange(state){
|
function sys_hashchange(state){
|
||||||
$('#sai_navbar li, #project_navbar li').each(function(){
|
$('.nav li,#sai_navbar li, #project_navbar li').each(function(){
|
||||||
$(this).removeClass('active');});
|
$(this).removeClass('active');});
|
||||||
$('#menu_'+state).parent().addClass('active');
|
$('#menu_'+state).parent().addClass('active');
|
||||||
}
|
}
|
||||||
@ -1 +0,0 @@
|
|||||||
<a href="javascript:system.language('${lang}');"><img src="./api.php?call=files&cat=saistart_sys_sai&id=flag_${lang}.png" alt="${lang}"></a>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user