From b7d8a48710fa4211dff705166a28b809261bda75 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 18 Jan 2016 03:10:58 +0100 Subject: [PATCH 01/22] dump errors to user --- log/error_handler/error_handler_dbwriter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/log/error_handler/error_handler_dbwriter.php b/log/error_handler/error_handler_dbwriter.php index 100fa0a..e9d4c89 100644 --- a/log/error_handler/error_handler_dbwriter.php +++ b/log/error_handler/error_handler_dbwriter.php @@ -9,7 +9,7 @@ class error_handler_dbwriter extends \SYSTEM\LOG\error_handler { try{ if(\property_exists(get_class($E), 'logged') && $E->logged){ return false;} //alrdy logged(this prevents proper thrown value for every system exception) - \SYSTEM\SQL\SYS_LOG_INSERT::Q1( /*array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + $result = \SYSTEM\SQL\SYS_LOG_INSERT::QI( /*array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5), $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, @@ -20,10 +20,14 @@ class error_handler_dbwriter extends \SYSTEM\LOG\error_handler { $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, - ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null,$thrown ? 1 : 0)); + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null,$thrown ? 1 : 0)); + if(\property_exists(get_class($E), 'logged')){ $E->logged = true;} //we just did log - } catch (\Exception $E){return false;} //Error -> Ignore + } catch (\Exception $E){ + //Dump the Error + echo \SYSTEM\LOG\JsonResult::toString((array)$E); + return false;} //Error -> Ignore return false; //We just log and do not handle the error! } From 0c8e11f2d9a2d22430cb94f41070d80ef18caec9 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 18 Jan 2016 05:28:04 +0100 Subject: [PATCH 02/22] cache changes to support scss, scssphp library reference included, system api contains cache call now --- api/api_system.php | 3 +++ cache/cache.php | 33 ++++++++++++++++---------------- cache/cache_scss.php | 15 +++++++++++++++ cache/qq/SYS_CACHE_CHECK.php | 8 ++++++-- cache/qq/SYS_CACHE_PUT.php | 6 +++++- files/files.php | 2 +- html/html.php | 2 ++ lib/autoload.inc | 3 ++- page/State.php | 8 ++++++++ sql/qt/mysql/data/system_api.sql | 3 +++ 10 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 cache/cache_scss.php diff --git a/api/api_system.php b/api/api_system.php index 64fd869..436bacd 100644 --- a/api/api_system.php +++ b/api/api_system.php @@ -22,4 +22,7 @@ class api_system extends api_login{ public static function call_bug($message,$data){ return \SYSTEM\SAI\saimod_sys_todo::report($message,$data);} + + public static function call_cache($id,$ident){ + return \SYSTEM\CACHE\cache::get($id, $ident,true);} } \ No newline at end of file diff --git a/cache/cache.php b/cache/cache.php index 6fbfee6..d297a35 100644 --- a/cache/cache.php +++ b/cache/cache.php @@ -1,30 +1,29 @@ ';} public static function script($src,$type = 'text/javascript',$rel = 'stylesheet', $language = 'JavaScript', $script = ''){ return '';} + public static function style($style){ + return '';} } diff --git a/lib/autoload.inc b/lib/autoload.inc index 1b369e5..c203dd5 100644 --- a/lib/autoload.inc +++ b/lib/autoload.inc @@ -11,4 +11,5 @@ require_once dirname(__FILE__).'/animate/autoload.inc'; require_once dirname(__FILE__).'/lettering/autoload.inc'; require_once dirname(__FILE__).'/bootstrap_growl/autoload.inc'; require_once dirname(__FILE__).'/git/autoload.inc'; -require_once dirname(__FILE__).'/jqbootstrapvalidation/autoload.inc'; \ No newline at end of file +require_once dirname(__FILE__).'/jqbootstrapvalidation/autoload.inc'; +require_once dirname(__FILE__).'/scssphp/autoload.inc'; \ No newline at end of file diff --git a/page/State.php b/page/State.php index 51a995a..1fde7ac 100644 --- a/page/State.php +++ b/page/State.php @@ -31,6 +31,14 @@ class State { $row['css'] = $row['js'] = array(); 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'));} + \LIB\lib_scssphp::php(); + if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'scss') && \is_callable($row['php_class'].'::scss')){ + $scss = \call_user_func($row['php_class'].'::scss'); + foreach($scss as $s){ + if(!\SYSTEM\CACHE\cache_scss::get($s)){ + \SYSTEM\CACHE\cache_scss::put($s, (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($s)));} + $row['css'][] = \SYSTEM\CACHE\cache_scss::url($s);} + } 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['php_class'] = ''; diff --git a/sql/qt/mysql/data/system_api.sql b/sql/qt/mysql/data/system_api.sql index 8e48fb9..e236252 100644 --- a/sql/qt/mysql/data/system_api.sql +++ b/sql/qt/mysql/data/system_api.sql @@ -28,6 +28,9 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (60, 0, 2, 10, 'bug', 'message', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (61, 0, 2, 10, 'bug', 'data', 'JSON'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (70, 0, 2, 10, 'cache', 'id', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (71, 0, 2, 10, 'cache', 'ident', 'STRING'); + 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 (92, 0, 4, -1, NULL, '_escaped_fragment_', 'STRING'); \ No newline at end of file From 5bc1c6cd11273562427f3f097d300b6cad32a453 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 18 Jan 2016 05:28:34 +0100 Subject: [PATCH 03/22] added lib scssphp reference --- .gitmodules | 3 +++ lib/scssphp | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/scssphp diff --git a/.gitmodules b/.gitmodules index a37a6b8..29f0a32 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "lib/jqbootstrapvalidation"] path = lib/jqbootstrapvalidation url = ../lib_jqbootstrapvalidation.git +[submodule "lib/scssphp"] + path = lib/scssphp + url = ../lib_scssphp diff --git a/lib/scssphp b/lib/scssphp new file mode 160000 index 0000000..bac779a --- /dev/null +++ b/lib/scssphp @@ -0,0 +1 @@ +Subproject commit bac779a7b9ef053b8253d4d76c594b03b19157aa From 8930981821a9df20e88f9d4c289e6a79f5ef1d06 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 18 Jan 2016 07:22:28 +0100 Subject: [PATCH 04/22] js & css cache, minify --- api/api_system.php | 3 +++ cache/cache_css.php | 26 ++++++++++++++++++++++++++ cache/cache_js.php | 26 ++++++++++++++++++++++++++ cache/cache_scss.php | 3 +++ lib/autoload.inc | 3 ++- page/State.php | 7 +++---- sql/qt/mysql/data/system_api.sql | 3 ++- 7 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 cache/cache_css.php create mode 100644 cache/cache_js.php diff --git a/api/api_system.php b/api/api_system.php index 436bacd..7c70678 100644 --- a/api/api_system.php +++ b/api/api_system.php @@ -19,6 +19,9 @@ class api_system extends api_login{ \SYSTEM\locale::set($lang);} public static function static__result($result){ \SYSTEM\CONFIG\config::set(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT, $result);} + public static function static__($_){ + //cache avoidance + } public static function call_bug($message,$data){ return \SYSTEM\SAI\saimod_sys_todo::report($message,$data);} diff --git a/cache/cache_css.php b/cache/cache_css.php new file mode 100644 index 0000000..b357a86 --- /dev/null +++ b/cache/cache_css.php @@ -0,0 +1,26 @@ +add($f);} + \SYSTEM\CACHE\cache_css::put($ident, $minifier->minify());} + return './api.php?call=cache&id='.self::CACHE_CSS.'&ident='.$ident; + } +} \ No newline at end of file diff --git a/cache/cache_js.php b/cache/cache_js.php new file mode 100644 index 0000000..48f5f38 --- /dev/null +++ b/cache/cache_js.php @@ -0,0 +1,26 @@ +add($f);} + \SYSTEM\CACHE\cache_js::put($ident, $minifier->minify());} + return './api.php?call=cache&id='.self::CACHE_JS.'&ident='.$ident; + } +} \ No newline at end of file diff --git a/cache/cache_scss.php b/cache/cache_scss.php index e3b1599..3f86400 100644 --- a/cache/cache_scss.php +++ b/cache/cache_scss.php @@ -10,6 +10,9 @@ class cache_scss { return sha1($file.';'.filemtime($file)); } public static function url($file){ + if(!\SYSTEM\CACHE\cache_scss::get($file)){ + \LIB\lib_scssphp::php(); + \SYSTEM\CACHE\cache_scss::put($file, (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($file)));} return './api.php?call=cache&id='.self::CACHE_SCSS.'&ident='.self::ident($file); } } \ No newline at end of file diff --git a/lib/autoload.inc b/lib/autoload.inc index c203dd5..4999dbf 100644 --- a/lib/autoload.inc +++ b/lib/autoload.inc @@ -12,4 +12,5 @@ require_once dirname(__FILE__).'/lettering/autoload.inc'; require_once dirname(__FILE__).'/bootstrap_growl/autoload.inc'; require_once dirname(__FILE__).'/git/autoload.inc'; require_once dirname(__FILE__).'/jqbootstrapvalidation/autoload.inc'; -require_once dirname(__FILE__).'/scssphp/autoload.inc'; \ No newline at end of file +require_once dirname(__FILE__).'/scssphp/autoload.inc'; +require_once dirname(__FILE__).'/minify/autoload.inc'; \ No newline at end of file diff --git a/page/State.php b/page/State.php index 1fde7ac..7e2a465 100644 --- a/page/State.php +++ b/page/State.php @@ -31,17 +31,16 @@ class State { $row['css'] = $row['js'] = array(); 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'));} - \LIB\lib_scssphp::php(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'scss') && \is_callable($row['php_class'].'::scss')){ $scss = \call_user_func($row['php_class'].'::scss'); foreach($scss as $s){ - if(!\SYSTEM\CACHE\cache_scss::get($s)){ - \SYSTEM\CACHE\cache_scss::put($s, (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($s)));} $row['css'][] = \SYSTEM\CACHE\cache_scss::url($s);} } + $row['css'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); 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['php_class'] = ''; + //$row['js'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); + unset($row['php_class']); $skip = false; for($i=0;$i Date: Mon, 18 Jan 2016 07:23:04 +0100 Subject: [PATCH 05/22] minify lib reference --- .gitmodules | 3 +++ lib/minify | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/minify diff --git a/.gitmodules b/.gitmodules index 29f0a32..a17de5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,6 @@ [submodule "lib/scssphp"] path = lib/scssphp url = ../lib_scssphp +[submodule "lib/minify"] + path = lib/minify + url = ../lib_minify.git diff --git a/lib/minify b/lib/minify new file mode 160000 index 0000000..e77f5c5 --- /dev/null +++ b/lib/minify @@ -0,0 +1 @@ +Subproject commit e77f5c58c7774d43a52d1aa121add82a3edcd443 From 432b63edc3f89be0f45e863e431285ef9547e145 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 19 Jan 2016 21:47:06 +0100 Subject: [PATCH 06/22] new chache functionality, minify css/js --- cache/cache_filemask.php | 26 ++++++++++++++++++++++++++ path/autoload.inc | 3 +++ {system => path}/path.php | 0 3 files changed, 29 insertions(+) create mode 100644 cache/cache_filemask.php create mode 100644 path/autoload.inc rename {system => path}/path.php (100%) diff --git a/cache/cache_filemask.php b/cache/cache_filemask.php new file mode 100644 index 0000000..b357a86 --- /dev/null +++ b/cache/cache_filemask.php @@ -0,0 +1,26 @@ +add($f);} + \SYSTEM\CACHE\cache_css::put($ident, $minifier->minify());} + return './api.php?call=cache&id='.self::CACHE_CSS.'&ident='.$ident; + } +} \ No newline at end of file diff --git a/path/autoload.inc b/path/autoload.inc new file mode 100644 index 0000000..fc3ae69 --- /dev/null +++ b/path/autoload.inc @@ -0,0 +1,3 @@ + Date: Tue, 19 Jan 2016 21:53:27 +0100 Subject: [PATCH 07/22] updated lib references 2 correct paths, minify lib --- lib/animate | 2 +- lib/bootstrap | 2 +- lib/bootstrap_growl | 2 +- lib/jqbootstrapvalidation | 2 +- lib/jquery | 2 +- lib/minify | 2 +- lib/tablesorter | 2 +- lib/tinymce | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/animate b/lib/animate index 6665446..b117ce5 160000 --- a/lib/animate +++ b/lib/animate @@ -1 +1 @@ -Subproject commit 666544655bf5365e4f77aec0fa0f497673f6e69a +Subproject commit b117ce583f21c3258d73c0e336b5c511f5fe90a3 diff --git a/lib/bootstrap b/lib/bootstrap index 7ec24da..61480a2 160000 --- a/lib/bootstrap +++ b/lib/bootstrap @@ -1 +1 @@ -Subproject commit 7ec24da73d3de379567f8cf27f4c5e860b1a724a +Subproject commit 61480a2725cc6663f7edecfbffbc1f2983137cb6 diff --git a/lib/bootstrap_growl b/lib/bootstrap_growl index 5940b96..aa913c9 160000 --- a/lib/bootstrap_growl +++ b/lib/bootstrap_growl @@ -1 +1 @@ -Subproject commit 5940b96a932d940580ccf0d3ba46b4c381f90c08 +Subproject commit aa913c90511b035125888fe45e41521f85dfbb56 diff --git a/lib/jqbootstrapvalidation b/lib/jqbootstrapvalidation index fed52e4..1f6f4ea 160000 --- a/lib/jqbootstrapvalidation +++ b/lib/jqbootstrapvalidation @@ -1 +1 @@ -Subproject commit fed52e48a2d1185b1700f3d6901cc10c24b2ed86 +Subproject commit 1f6f4ea7e6eab0f9c0a740530e957d3d73851d14 diff --git a/lib/jquery b/lib/jquery index 24eb1a0..5cbffcf 160000 --- a/lib/jquery +++ b/lib/jquery @@ -1 +1 @@ -Subproject commit 24eb1a096cb4509a1d9643292f846295d6903a33 +Subproject commit 5cbffcf4e9a888ee0a80addaf2a68006cc8a7124 diff --git a/lib/minify b/lib/minify index e77f5c5..30f29c3 160000 --- a/lib/minify +++ b/lib/minify @@ -1 +1 @@ -Subproject commit e77f5c58c7774d43a52d1aa121add82a3edcd443 +Subproject commit 30f29c3607b99ec458f3ccac2d5b5eb1e3792b13 diff --git a/lib/tablesorter b/lib/tablesorter index 54f8142..f8158bf 160000 --- a/lib/tablesorter +++ b/lib/tablesorter @@ -1 +1 @@ -Subproject commit 54f81421b3002be930ab53e560cb658e5c11bcfa +Subproject commit f8158bfdea25f8fae9687e5f999d2258a05f1965 diff --git a/lib/tinymce b/lib/tinymce index 84856bd..6a3078b 160000 --- a/lib/tinymce +++ b/lib/tinymce @@ -1 +1 @@ -Subproject commit 84856bd3b982d11942ae84cfe3cb8cc27c273fe8 +Subproject commit 6a3078b3f22b6d2189fdc3d5ddec49365120bc39 From 1a09c9bf5581110fbd35cc8fea9644a40c6bcb64 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 01:55:18 +0100 Subject: [PATCH 08/22] first part of missing commit regarding cache & minify & mask --- autoload.inc | 2 +- cache/cache.php | 2 +- cache/cache_css.php | 9 ++- cache/cache_filemask.php | 30 +++----- cache/cache_js.php | 9 ++- cache/cache_scss.php | 2 +- {files/sys => lib/system/lib}/system.css | 0 {files/sys => lib/system/lib}/system.js | 0 lib/system/lib_system.php | 4 +- page/State.php | 2 +- path/path.php | 69 +++++++++++-------- .../saimod_sys_langswitcher.php | 2 +- sai/modules/saimod_sys_log/saimod_sys_log.php | 20 +++--- sai/modules/saimod_sys_mod/saimod_sys_mod.php | 18 ++--- .../saimod_sys_security.php | 56 +++++++-------- .../saimod_sys_todo/saimod_sys_todo.php | 26 +++---- .../saistart_sys_sai/saistart_sys_sai.php | 16 ++--- sai/page/default_page.php | 35 +++++----- 18 files changed, 150 insertions(+), 152 deletions(-) rename {files/sys => lib/system/lib}/system.css (100%) rename {files/sys => lib/system/lib}/system.js (100%) diff --git a/autoload.inc b/autoload.inc index a5e809b..50353fd 100644 --- a/autoload.inc +++ b/autoload.inc @@ -1,6 +1,6 @@ SERVERPATH().';';} return sha1($ident); } public static function url($files){ @@ -19,7 +18,7 @@ class cache_css { \LIB\lib_minify::php(); $minifier = new \MatthiasMullie\Minify\CSS(); foreach($files as $f){ - $minifier->add($f);} + $minifier->add($f->SERVERPATH());} \SYSTEM\CACHE\cache_css::put($ident, $minifier->minify());} return './api.php?call=cache&id='.self::CACHE_CSS.'&ident='.$ident; } diff --git a/cache/cache_filemask.php b/cache/cache_filemask.php index b357a86..e9c08c9 100644 --- a/cache/cache_filemask.php +++ b/cache/cache_filemask.php @@ -1,26 +1,14 @@ add($f);} - \SYSTEM\CACHE\cache_css::put($ident, $minifier->minify());} - return './api.php?call=cache&id='.self::CACHE_CSS.'&ident='.$ident; + return \SYSTEM\CACHE\cache::get(self::CACHE_FILEMASK, $ident,$header);} + public static function ident($file){ + return sha1($file); } } \ No newline at end of file diff --git a/cache/cache_js.php b/cache/cache_js.php index 48f5f38..a8fc211 100644 --- a/cache/cache_js.php +++ b/cache/cache_js.php @@ -1,16 +1,15 @@ SERVERPATH().';';} return sha1($ident); } public static function url($files){ @@ -19,7 +18,7 @@ class cache_js { \LIB\lib_minify::php(); $minifier = new \MatthiasMullie\Minify\JS(); foreach($files as $f){ - $minifier->add($f);} + $minifier->add($f->SERVERPATH());} \SYSTEM\CACHE\cache_js::put($ident, $minifier->minify());} return './api.php?call=cache&id='.self::CACHE_JS.'&ident='.$ident; } diff --git a/cache/cache_scss.php b/cache/cache_scss.php index 3f86400..2d30e70 100644 --- a/cache/cache_scss.php +++ b/cache/cache_scss.php @@ -1,7 +1,7 @@ 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); 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'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); + $row['js'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); unset($row['php_class']); $skip = false; diff --git a/path/path.php b/path/path.php index d013031..e17d90f 100644 --- a/path/path.php +++ b/path/path.php @@ -1,46 +1,59 @@ '; -const C_SUBPATH = ''; - -abstract class PATH { - static public function getPath(){ - throw new \RuntimeException("Not Implemented");} +class PATH { + private $basepath = NULL; + private $path = NULL; + private $subpath = NULL; + public function __construct(\SYSTEM\PATH $basepath, $path, $subpath = '') { + $this->basepath = $basepath; + $this->path = $path; + $this->subpath = $subpath; + } + public function SERVERPATH(){ + return $this->basepath->SERVERPATH().$this->path.$this->subpath;} + function WEBPATH($mask = true){ + if($mask){ + $path = $this->basepath->SERVERPATH().$this->path.$this->subpath; + \SYSTEM\CACHE\cache_filemask::put($path); + return './api.php?call=cache&id='.\SYSTEM\CACHE\cache_filemask::CACHE_FILEMASK.'&ident='.\SYSTEM\CACHE\cache_filemask::ident($path); + } else { + return $this->basepath->WEBPATH($mask).$this->path.$this->subpath; + } + } } class PROOT extends PATH { - static public function getPath(){ - return C_ROOT.C_SUBPATH;} + public function __construct($subpath = '') { + $this->subpath = $subpath;} + public function SERVERPATH(){ + return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH).$this->subpath;} + function WEBPATH($mask = true){ + if($mask){ + $path = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).$this->subpath; + \SYSTEM\CACHE\cache_filemask::put($path); + return './api.php?call=cache&id='.\SYSTEM\CACHE\cache_filemask::CACHE_FILEMASK.'&ident='.\SYSTEM\CACHE\cache_filemask::ident($path); + } else { + return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).$this->subpath; + } + } } class PSYSTEM extends PATH { - static public function getPath(){ - return C_ROOT.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL).C_SUBPATH;} + public function __construct($subpath = '') { + parent::__construct(new \SYSTEM\PROOT(), \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL), $subpath);} } class PSAI extends PATH { - static public function getPath(){ - return C_ROOT.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL).'sai/'.C_SUBPATH;} + public function __construct($subpath = '') { + parent::__construct(new \SYSTEM\PSYSTEM(), 'sai/', $subpath);} } class PLIB extends PATH { - static public function getPath(){ - return C_ROOT.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL).'lib/'.C_SUBPATH;} + public function __construct($subpath = '') { + parent::__construct(new \SYSTEM\PSYSTEM(), 'lib/', $subpath);} } class PSQL extends PATH { - static public function getPath(){ - return C_ROOT.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL).'sql/'.C_SUBPATH;} -} - -function SERVERPATH(\SYSTEM\PATH $basepath, $subpath = ''){ - return str_replace( array(C_ROOT,C_SUBPATH), - array(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH),$subpath), - $basepath->getPath()); -} -function WEBPATH(\SYSTEM\PATH $basepath, $subpath = ''){ - return str_replace( array(C_ROOT,C_SUBPATH), - array(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL) ,$subpath), - $basepath->getPath()); + public function __construct($subpath = '') { + parent::__construct(new \SYSTEM\PSYSTEM(), 'sql/', $subpath);} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php b/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php index 72da105..5ce391d 100644 --- a/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php +++ b/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php @@ -13,7 +13,7 @@ class saimod_sys_langswitcher extends \SYSTEM\SAI\SaiModule { $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));} + $result .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_langswitcher/tpl/language.tpl'))->SERVERPATH(),array('lang' => $lang,'endpoint' => $endpoint));} return $result; } diff --git a/sai/modules/saimod_sys_log/saimod_sys_log.php b/sai/modules/saimod_sys_log/saimod_sys_log.php index abec10c..8a998aa 100644 --- a/sai/modules/saimod_sys_log/saimod_sys_log.php +++ b/sai/modules/saimod_sys_log/saimod_sys_log.php @@ -22,7 +22,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $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); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats(){ @@ -32,11 +32,11 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { file_exists(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH))){ $scanned_directory = array_diff(scandir(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH)), array('..', '.')); 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((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_stats_menu.tpl'))->SERVERPATH(), 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((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl'))->SERVERPATH(), $vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db){ $result = array(); @@ -309,30 +309,30 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $r['time'] = \SYSTEM\time::time_ago_string(strtotime($r['time'])); $r['message'] = htmlspecialchars(substr($r['message'],0,255)); $r['request_uri'] = htmlspecialchars($r['request_uri']); - $vars['table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r); + $vars['table'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'))->SERVERPATH(),$r); $count_filtered++; } $vars['pagination'] = ''; $vars['page_last'] = ceil($count/100)-1; for($i=0;$i < ceil($count/100);$i++){ $data = array('page' => $i,'search' => $search, 'filter' => $filter, 'active' => ($i == $page) ? 'active' : ''); - $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_pagination.tpl'), $data); + $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_pagination.tpl'))->SERVERPATH(), $data); } $vars['count'] = $count_filtered.'/'.$count; $vars['error_filter'] = ''; $res = \SYSTEM\SQL\SYS_SAIMOD_LOG_FILTERS::QQ(); while($row = $res->next()){ $data = array('active' => ($filter == $row['class'] ? 'active' : ''), 'filter' => $row['class'], 'search' => $search); - $vars['error_filter'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error_filter.tpl'),$data);} + $vars['error_filter'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_error_filter.tpl'))->SERVERPATH(),$data);} $vars['active'] = ($filter == '%' ? 'active' : ''); $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_LOG)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_log(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_LOG); - $vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/'); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log.tpl'), $vars); + $vars['PICPATH'] = (new \SYSTEM\PSAI('modules/saimod_sys_log/img/'))->WEBPATH(false); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_log/tpl/saimod_sys_log.tpl'))->SERVERPATH(), $vars); } public static function tablerow_class($class){ @@ -358,5 +358,5 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { //public static function css(){} public static function js(){ - return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/js/saimod_sys_log.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_log/js/saimod_sys_log.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_mod/saimod_sys_mod.php b/sai/modules/saimod_sys_mod/saimod_sys_mod.php index 76fac79..02c0659 100644 --- a/sai/modules/saimod_sys_mod/saimod_sys_mod.php +++ b/sai/modules/saimod_sys_mod/saimod_sys_mod.php @@ -11,15 +11,15 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule { $v['mod'] = $mod; $v['public'] = \call_user_func(array($mod, 'right_public')) ? '' : ''; $v['you'] = \call_user_func(array($mod, 'right_right')) ? '' : ''; - $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_tr.tpl'),$v); + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/mod_tr.tpl'))->SERVERPATH(),$v); } $mod = \SYSTEM\SAI\sai::getStartModule(); $start = array(); $start['start_class'] = $mod; $start['start_public'] = \call_user_func(array($mod, 'right_public')) ? '' : ''; $start['start_access'] = \call_user_func(array($mod, 'right_right')) ? '' : ''; - $vars['saistart'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/saistart.tpl'),$start); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_table.tpl'),$vars); + $vars['saistart'] = \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/saistart.tpl'))->SERVERPATH(),$start); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/mod_table.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_mod_action_project(){ @@ -31,9 +31,9 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule { $v['mod'] = $mod; $v['public'] = \call_user_func(array($mod, 'right_public')) ? '' : ''; $v['you'] = \call_user_func(array($mod, 'right_right')) ? '' : ''; - $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_tr.tpl'),$v); + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/mod_tr.tpl'))->SERVERPATH(),$v); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mod_table.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/mod_table.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_mod_action_lib(){ @@ -50,14 +50,14 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule { (\array_search('LIB\lib_css', $parents) ? 'css, ' : ''). (\array_search('LIB\lib_jscss', $parents) ? 'js, css, ' : ''); $vars2['interface'] = \substr($vars2['interface'],0,-2); - $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/lib_tr.tpl'),$vars2); + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/lib_tr.tpl'))->SERVERPATH(),$vars2); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/lib_table.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/lib_table.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_mod(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/tpl/mods.tpl'),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_MOD));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_mod/tpl/mods.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_MOD));} //public static function html_li_menu(){return '
  • ${sai_menu_mod}
  • ';} public static function html_li_menu(){return '
  • ';} @@ -66,5 +66,5 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule { //public static function css(){} public static function js(){ - return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/js/saimod_sys_mod.js'));} + return array(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/js/saimod_sys_mod.js');} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.php b/sai/modules/saimod_sys_security/saimod_sys_security.php index a1e9311..3f6604c 100644 --- a/sai/modules/saimod_sys_security/saimod_sys_security.php +++ b/sai/modules/saimod_sys_security/saimod_sys_security.php @@ -4,25 +4,25 @@ namespace SYSTEM\SAI; class saimod_sys_security extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_groups(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_groups.tpl'),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_groups.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY));} public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_newright(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_newright.tpl'),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_newright.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY));} public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_rights(){ $rows = ''; $res = \SYSTEM\SQL\SYS_SAIMOD_SECURITY_RIGHTS::QQ(); while($r = $res->next()){ $r['right_edit_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/right_edit.tpl'),array('id' => $r['ID'])) : - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/missing_edit_right.tpl')); - $rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl'),$r);} + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/right_edit.tpl'))->SERVERPATH(),array('id' => $r['ID'])) : + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/missing_edit_right.tpl'))->SERVERPATH()); + $rows .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl'))->SERVERPATH(),$r);} $vars['rows'] = $rows; $vars['addright_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/right_add.tpl')): - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/missing_remove_right.tpl')); + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/right_add.tpl'))->SERVERPATH()): + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/missing_remove_right.tpl'))->SERVERPATH()); $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); - 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((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_deleterightuser($rightid,$userid){ @@ -49,7 +49,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT)){ return false;} $vars = \SYSTEM\SQL\SYS_SAIMOD_SECURITY_RIGHT_CHECK::Q1(array($id)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl'),$vars);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl'))->SERVERPATH(),$vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_deleteright($id){ if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT)){ @@ -65,13 +65,13 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { $r['class_row'] = \SYSTEM\SAI\saimod_sys_log::tablerow_class($r['class']); $r['time'] = \SYSTEM\time::time_ago_string(strtotime($r['time'])); $r['message'] = substr($r['message'],0,255); - $table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_actions_row.tpl'),$r); + $table .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_actions_row.tpl'))->SERVERPATH(),$r); } $vars = array(); $vars['count'] = $count['count']; $vars['table'] = $table; $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_actions.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_actions.tpl'))->SERVERPATH(), $vars); } private static function user_rights($userid){ @@ -80,11 +80,11 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { while($r = $res->next()){ $r['user_id'] = $userid; $r['remove_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/right_remove.tpl'),array('id' => $r['ID'])) : - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/missing_edit_right.tpl')); - $vars['user_rights_table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_right.tpl'), $r);} + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/right_remove.tpl'))->SERVERPATH(),array('id' => $r['ID'])) : + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/missing_edit_right.tpl'))->SERVERPATH()); + $vars['user_rights_table'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_right.tpl'))->SERVERPATH(), $r);} - $vars['user_rights_add'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/missing_add_right.tpl')); + $vars['user_rights_add'] = \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/missing_add_right.tpl'))->SERVERPATH()); if(\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT)){ $opts = ''; $res = \SYSTEM\SQL\SYS_SAIMOD_SECURITY_RIGHTS::QQ(); @@ -92,18 +92,18 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { while($r = $res->next()){ $r['selected'] = $b ? 'selected="selected"' : ''; $b = false; - $opts .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_right_add.tpl'), $r);} + $opts .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_right_add.tpl'))->SERVERPATH(), $r);} $v = array(); $v['user_id'] = $userid; $v['right_options'] = $opts; - $vars['user_rights_add'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_rights_add.tpl'), $v); + $vars['user_rights_add'] = \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_rights_add.tpl'))->SERVERPATH(), $v); } $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_rights.tpl'), $vars);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_rights.tpl'))->SERVERPATH(), $vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_stats(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_stats.tpl'),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_stats.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_user($username){ @@ -112,7 +112,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { $vars['user_rights'] = array_key_exists('id', $vars) ? self::user_rights($vars['id']) : ''; $vars['user_actions'] = array_key_exists('id', $vars) ? self::user_actions($vars['id']) : ''; $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_users($filter = "all",$search="%",$page=0){ @@ -130,30 +130,30 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { while(($r = $res->next()) && ($count_filtered < 100)){ $r['class'] = self::tablerow_class($r['last_active']); $r['time_elapsed'] = \SYSTEM\time::time_ago_string($r['last_active']); - $vars['table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl'),$r); + $vars['table'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl'))->SERVERPATH(),$r); $count_filtered++; } $vars['pagination'] = ''; $vars['page_last'] = ceil($count/100)-1; for($i=0;$i < ceil($count/100);$i++){ $data = array('page' => $i,'search' => $search, 'filter' => $filter, 'active' => ($i == $page) ? 'active' : ''); - $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_pagination.tpl'), $data); + $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_pagination.tpl'))->SERVERPATH(), $data); } $vars['count'] = $count_filtered.'/'.$count; $vars['right_filter'] = ''; $res = \SYSTEM\SQL\SYS_SAIMOD_SECURITY_RIGHTS::QQ(); while($row = $res->next()){ $data = array('active' => ($filter == $row['ID'] ? 'active' : ''), 'filter' => $row['ID'], 'search' => $search, 'name' => $row['name']); - $vars['right_filter'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right_filter.tpl'),$data);} + $vars['right_filter'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_right_filter.tpl'))->SERVERPATH(),$data);} $vars['active'] = ($filter == 'all' ? 'active' : ''); $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_SECURITY); - $vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/'); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security.tpl'), $vars);} + $vars['PICPATH'] = (new \SYSTEM\PSAI('modules/saimod_sys_log/img/'))->WEBPATH(false); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_security/tpl/saimod_sys_security.tpl'))->SERVERPATH(), $vars);} private static function tablerow_class($last_active){ $time = time() - $last_active; @@ -173,7 +173,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY);} public static function css(){ - return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/css/saimod_sys_security.css'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_security/css/saimod_sys_security.css'));} public static function js(){ - return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/js/saimod_sys_security.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_security/js/saimod_sys_security.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/saimod_sys_todo.php b/sai/modules/saimod_sys_todo/saimod_sys_todo.php index 27b8469..1941d8f 100644 --- a/sai/modules/saimod_sys_todo/saimod_sys_todo.php +++ b/sai/modules/saimod_sys_todo/saimod_sys_todo.php @@ -40,13 +40,13 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_todo(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TODO); - $vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/'); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl'), $vars); + $vars['PICPATH'] = (new \SYSTEM\PSAI('modules/saimod_sys_log/img/'))->WEBPATH(false); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_new(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TODO); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist($filter='all',$search='%',$page=0){ @@ -113,19 +113,19 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { $row['request_uri'] = htmlspecialchars($row['request_uri']); $row['openclose'] = $state == \SYSTEM\SQL\system_todo::FIELD_STATE_OPEN ? 'close' : 'open'; $row['message'] = str_replace("\n", '
    ', $row['message']); - $vars['todo_list_elements'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row); + $vars['todo_list_elements'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'))->SERVERPATH(), $row); $count_filtered++; } $vars['pagination'] = ''; $vars['page_last'] = ceil($count/100)-1; for($i=0;$i < ceil($count/100);$i++){ $data = array('page' => $i,'search' => $search, 'filter' => $filter, 'active' => ($i == $page) ? 'active' : ''); - $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list_pagination.tpl'), $data); + $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_list_pagination.tpl'))->SERVERPATH(), $data); } $vars['count'] = $count_filtered.'/'.$count; $vars['state'] = $state == \SYSTEM\SQL\system_todo::FIELD_STATE_OPEN ? 'todo' : 'todo(doto)'; $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TODO)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_list.tpl'))->SERVERPATH(), $vars); } public static function statistics(){ @@ -152,15 +152,15 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TODO)); $vars['entries'] = ''; foreach($vars['data'] as $stat){ - $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats_entry.tpl'), $stat); + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_stats_entry.tpl'))->SERVERPATH(), $stat); } $vars['userstats'] = ''; $userstats = \SYSTEM\SQL\SYS_SAIMOD_TODO_STATS_USERS::QQ(); while($stat = $userstats->next()){ $stat['perc'] = sprintf("%.2f",($stat['state_closed'] / ($stat['state_open']+$stat['state_closed']))*100); - $vars['userstats'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats_users_entry.tpl'), $stat); + $vars['userstats'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_stats_users_entry.tpl'))->SERVERPATH(), $stat); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_stats.tpl'))->SERVERPATH(), $vars); } private static function state($state){ @@ -219,12 +219,12 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { $vars['assignees'] = ''; $res = \SYSTEM\SQL\SYS_SAIMOD_TODO_ASSIGNEES::QQ(array($todo,$userid)); while($row = $res->next()){ - $vars['assignees'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user_assignee.tpl'), $row); + $vars['assignees'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user_assignee.tpl'))->SERVERPATH(), $row); } $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TODO)); return $vars[\SYSTEM\SQL\system_todo::FIELD_TYPE] == \SYSTEM\SQL\system_todo::FIELD_TYPE_USER ? - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl'), $vars) : - \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl'), $vars);} + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl'))->SERVERPATH(), $vars) : + \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl'))->SERVERPATH(), $vars);} public static function html_li_menu(){return '
  • ';} public static function right_public(){return false;} @@ -232,7 +232,7 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { //public static function css(){} public static function js(){ - return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/js/saimod_sys_todo.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_todo/js/saimod_sys_todo.js'));} public static function report($message,$data){ $_POST = $data; //save data in post diff --git a/sai/modules/saistart_sys_sai/saistart_sys_sai.php b/sai/modules/saistart_sys_sai/saistart_sys_sai.php index dc34633..e992a8c 100644 --- a/sai/modules/saistart_sys_sai/saistart_sys_sai.php +++ b/sai/modules/saistart_sys_sai/saistart_sys_sai.php @@ -5,18 +5,18 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){ $vars = array_merge(array( 'content' => self::html_content()), \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_START)); - return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/saistart.tpl'),$vars);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saistart_sys_sai/tpl/saistart.tpl'))->SERVERPATH(),$vars);} //public static function html_li_menu(){return '
  • ${sai_menu_start}
  • ';} public static function html_li_menu(){return '
  • ';} public static function right_public(){return true;} public static function right_right(){return true;} public static function css(){ - return array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/css/saistart_sys_sai.css'));} + return array(new \SYSTEM\PSAI('modules/saistart_sys_sai/css/saistart_sys_sai.css'));} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/js/saistart_sys_sai.js'), - \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/crypto/jquery.md5.js'), - \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/crypto/jquery.sha1.js'), + return array( new \SYSTEM\PSAI('modules/saistart_sys_sai/js/saistart_sys_sai.js'), + new \SYSTEM\PSAI('js/crypto/jquery.md5.js'), + new \SYSTEM\PSAI('js/crypto/jquery.sha1.js'), \LIB\lib_jqbootstrapvalidation::js()); } @@ -26,7 +26,7 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { $date = date("l M Y", time()); if(!\SYSTEM\SECURITY\Security::isLoggedIn() || !\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI)){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content.tpl'));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saistart_sys_sai/tpl/content.tpl'))->SERVERPATH());} $vars = array(); $vars['week_number'] = $week_number; $vars['date'] = $date; @@ -41,12 +41,12 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { $userstats = \SYSTEM\SQL\SYS_SAIMOD_TODO_STATS_USERS::QQ(); while($stat = $userstats->next()){ $stat['perc'] = round($stat['state_closed'] / ($stat['state_open']+$stat['state_closed']),2)*100; - $vars['userstats'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats_users_entry.tpl'), $stat); + $vars['userstats'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_stats_users_entry.tpl'))->SERVERPATH(), $stat); } $vars = array_merge( $vars, \SYSTEM\SAI\saimod_sys_todo::statistics(), \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_START), \SYSTEM\SAI\saimod_sys_git::getGitInfo()); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content_loggedin.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saistart_sys_sai/tpl/content_loggedin.tpl'))->SERVERPATH(), $vars); } } \ No newline at end of file diff --git a/sai/page/default_page.php b/sai/page/default_page.php index 004c18e..d3c0c4e 100644 --- a/sai/page/default_page.php +++ b/sai/page/default_page.php @@ -31,26 +31,25 @@ class default_page extends \SYSTEM\PAGE\Page { throw new \SYSTEM\LOG\ERROR('Your SAI-Start-Module haz a Problem - either it does not exist or it is not public - which is required!');} private static function css(){ - $result = ''. - ''. - ''. - ''. - ''; - return $result; + return \SYSTEM\HTML\html::link(\LIB\lib_bootstrap::css()->WEBPATH(false)). + \SYSTEM\HTML\html::link(\LIB\lib_tablesorter::css()->WEBPATH(false)). + \SYSTEM\HTML\html::link(\SYSTEM\CACHE\cache_css::url( + array( \LIB\lib_system::css(), + new \SYSTEM\PSAI('page/css/sai_classes.css'), + new \SYSTEM\PSAI('page/css/sai.css')))); } private static function js(){ - $result = ''. - ''. - ''. - ''. - ''. - ''. - ''. - //''. - ''. - ''; - return $result; + return \SYSTEM\HTML\html::script(\LIB\lib_jquery::js()->WEBPATH()). + \SYSTEM\HTML\html::script(\LIB\lib_bootstrap::js()->WEBPATH()). + \SYSTEM\HTML\html::script(\LIB\lib_tablesorter::js()->WEBPATH()). + \SYSTEM\HTML\html::script(\LIB\lib_bootstrap_growl::js()->WEBPATH()). + \SYSTEM\HTML\html::script(\LIB\lib_tinymce::js()->WEBPATH()). + \SYSTEM\HTML\html::script( \SYSTEM\CACHE\cache_js::url( + array( \LIB\lib_system::js(), + new \SYSTEM\PSAI('page/js/sai.js')))). + \SYSTEM\HTML\html::script('https://www.google.com/jsapi'). + ''; } public function html($_escaped_fragment_ = NULL){ @@ -66,6 +65,6 @@ class default_page extends \SYSTEM\PAGE\Page { $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DEFAULT), array( 'project' => \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT), 'project_url' => \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL))); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('page/tpl/sai.tpl'))->SERVERPATH(), $vars); } } \ No newline at end of file From 7b20ce7cc8c2bbad3e2f9e95e7dd7512c4f33252 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 02:33:53 +0100 Subject: [PATCH 09/22] remaining fixes regarding caching, js&css minify --- page/State.php | 2 +- sai/modules/saimod_sys_api/saimod_sys_api.php | 16 ++--- .../saimod_sys_cache/qq/SYS_SAIMOD_CACHE.php | 4 +- .../saimod_sys_cache/saimod_sys_cache.php | 6 +- .../saimod_sys_cache/tpl/saimod_sys_cache.tpl | 4 +- .../tpl/saimod_sys_cache_entry.tpl | 6 +- .../saimod_sys_config/saimod_sys_config.php | 68 +++++++++---------- .../saimod_sys_cron/saimod_sys_cron.php | 8 +-- .../saimod_sys_docu/saimod_sys_docu.php | 10 +-- .../saimod_sys_files/saimod_sys_files.php | 10 +-- sai/modules/saimod_sys_git/saimod_sys_git.php | 2 +- .../saimod_sys_login/saimod_sys_login.php | 10 +-- .../saimod_sys_page/saimod_sys_page.php | 16 ++--- .../saimod_sys_text/saimod_sys_text.php | 26 +++---- 14 files changed, 94 insertions(+), 94 deletions(-) diff --git a/page/State.php b/page/State.php index 7503ff4..4789166 100644 --- a/page/State.php +++ b/page/State.php @@ -39,7 +39,7 @@ class State { $row['css'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); 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'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); + $row['js'] = count($row['js']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); unset($row['php_class']); $skip = false; diff --git a/sai/modules/saimod_sys_api/saimod_sys_api.php b/sai/modules/saimod_sys_api/saimod_sys_api.php index eba27ba..01b672a 100644 --- a/sai/modules/saimod_sys_api/saimod_sys_api.php +++ b/sai/modules/saimod_sys_api/saimod_sys_api.php @@ -8,8 +8,8 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { $res = \SYSTEM\SQL\SYS_SAIMOD_API_GROUPS::QQ(); while($r = $res->next()){ - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), array( 'tab_id' => $r['group']));} - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/saimod_sys_api.tpl'), $vars); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_api/tpl/tabopt.tpl'))->SERVERPATH(), array( 'tab_id' => $r['group']));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_api/tpl/saimod_sys_api.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__system_sai_saimod_sys_api_action_list($group=null){ @@ -21,19 +21,19 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { $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_api/tpl/list_entry.tpl'), $r); + $tab['content'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_api/tpl/list_entry.tpl'))->SERVERPATH(), $r); } $tab = array_merge($tab,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_API)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl'), $tab); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl'))->SERVERPATH(), $tab); } public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID,$group){ $res = \SYSTEM\SQL\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID,$group)); $res = array_merge($res,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_API)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/delete_dialog.tpl'), $res); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_api/tpl/delete_dialog.tpl'))->SERVERPATH(), $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'),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_API));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_api/tpl/new_dialog.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_API));} 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)){ @@ -77,7 +77,7 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { 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_api/css/saimod_sys_api.css'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_api/css/saimod_sys_api.css'));} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/js/saimod_sys_api.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_api/js/saimod_sys_api.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_cache/qq/SYS_SAIMOD_CACHE.php b/sai/modules/saimod_sys_cache/qq/SYS_SAIMOD_CACHE.php index 466eed6..01a0d48 100644 --- a/sai/modules/saimod_sys_cache/qq/SYS_SAIMOD_CACHE.php +++ b/sai/modules/saimod_sys_cache/qq/SYS_SAIMOD_CACHE.php @@ -2,10 +2,10 @@ namespace SYSTEM\SQL; class SYS_SAIMOD_CACHE extends \SYSTEM\DB\QQ { public static function get_class(){return \get_class();} - public static function pgsql(){return + public static function pTsql(){return 'SELECT *, encode(data,\'base64\') FROM system.cache ORDER BY "ID" ASC LIMIT 100;'; } public static function mysql(){return -'SELECT * FROM system_cache ORDER BY ID ASC LIMIT 100;'; +'SELECT * FROM system_cache LIMIT 100;'; } } \ No newline at end of file diff --git a/sai/modules/saimod_sys_cache/saimod_sys_cache.php b/sai/modules/saimod_sys_cache/saimod_sys_cache.php index cda82a6..a64fe09 100644 --- a/sai/modules/saimod_sys_cache/saimod_sys_cache.php +++ b/sai/modules/saimod_sys_cache/saimod_sys_cache.php @@ -7,9 +7,9 @@ class saimod_sys_cache extends \SYSTEM\SAI\SaiModule { $vars['entries'] = ''; $res = \SYSTEM\SQL\SYS_SAIMOD_CACHE::QQ(); while($r = $res->next()){ - $r['class'] = self::tablerow_class($r['CacheID']); - $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl'), $r);} - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl'), $vars); + $r['class'] = self::tablerow_class($r['cache']); + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl'))->SERVERPATH(), $r);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl'))->SERVERPATH(), $vars); } private static function tablerow_class($cacheID){ diff --git a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl index 5044a08..87d2be3 100644 --- a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl +++ b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl @@ -2,9 +2,9 @@ Entries: ${count} showing 100 - - + + ${entries} diff --git a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl index e4bf11e..865ecf7 100644 --- a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl +++ b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl @@ -1,6 +1,6 @@ - - - + + + \ No newline at end of file diff --git a/sai/modules/saimod_sys_config/saimod_sys_config.php b/sai/modules/saimod_sys_config/saimod_sys_config.php index 022e4f6..cd7b91e 100644 --- a/sai/modules/saimod_sys_config/saimod_sys_config.php +++ b/sai/modules/saimod_sys_config/saimod_sys_config.php @@ -4,145 +4,145 @@ class saimod_sys_config extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_config(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_CONFIG); $vars['basics'] = $vars['database'] = $vars['sai'] = ''; - $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, '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'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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))); - $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT))); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config.tpl'))->SERVERPATH(),$vars); } //public static function html_li_menu(){return '
  • ${sai_menu_config}
  • ';} public static function sai_mod__SYSTEM_SAI_saimod_sys_config_action_basics(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_CONFIG); $vars['basics'] = $vars['database'] = $vars['sai'] = ''; - $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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'), + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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))); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_basics.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_basics.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_config_action_database(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_CONFIG); $vars['database'] = ''; - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER))); - $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, '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'), + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), 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))); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_database.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_database.tpl'))->SERVERPATH(),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_config_action_sai(){ $vars['sai'] = ''; - $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_tr.tpl'))->SERVERPATH(), array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT, 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT', 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT))); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_sai.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_sai.tpl'))->SERVERPATH(),$vars); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_database.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_config/tpl/config_database.tpl'))->SERVERPATH(),$vars); } public static function html_li_menu(){return '
  • ';} public static function right_public(){return false;} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/js/saimod_sys_config.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_config/js/saimod_sys_config.js'));} //public static function css(){} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/saimod_sys_cron.php b/sai/modules/saimod_sys_cron/saimod_sys_cron.php index b974cd4..af62d48 100644 --- a/sai/modules/saimod_sys_cron/saimod_sys_cron.php +++ b/sai/modules/saimod_sys_cron/saimod_sys_cron.php @@ -12,9 +12,9 @@ class saimod_sys_cron extends \SYSTEM\SAI\SaiModule { $r['next'] = date('Y-m-d H:i:s',\SYSTEM\CRON\cron::next($r['class'])); $r['selected_'.$r['status']] = 'selected'; $r['i'] = $i++; - $vars['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tpl/list_entry.tpl'), $r);} + $vars['content'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_cron/tpl/list_entry.tpl'))->SERVERPATH(), $r);} $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_CRON), \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_TIME)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tpl/tabs.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_cron/tpl/tabs.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__system_sai_saimod_sys_cron_action_change($cls,$status){ @@ -45,7 +45,7 @@ class saimod_sys_cron extends \SYSTEM\SAI\SaiModule { public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON);} public static function css(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/css/saimod_sys_cron.css'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_cron/css/saimod_sys_cron.css'));} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/js/saimod_sys_cron.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_cron/js/saimod_sys_cron.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_docu/saimod_sys_docu.php b/sai/modules/saimod_sys_docu/saimod_sys_docu.php index a52a082..4567655 100644 --- a/sai/modules/saimod_sys_docu/saimod_sys_docu.php +++ b/sai/modules/saimod_sys_docu/saimod_sys_docu.php @@ -7,8 +7,8 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU); $vars['tabopts'] = ''; foreach($documents as $cat => $docs){ - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabopt.tpl'), array( 'tab_id' => str_replace(' ', '_', $cat),'tab_id_pretty' => $cat));} - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl'), $vars); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt.tpl'))->SERVERPATH(), array( 'tab_id' => str_replace(' ', '_', $cat),'tab_id_pretty' => $cat));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_cat($cat = 'System'){ @@ -16,12 +16,12 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU); $vars['tabopts'] = ''; foreach($documents as $doc){ - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabopt2.tpl'), + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt2.tpl'))->SERVERPATH(), array( 'tab_id' => str_replace(' ', '_', $cat), 'doc_id' => str_replace(array('.',' '), '_', basename($doc)), 'doc_id_pretty' => basename($doc))); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/saimod_sys_docu_cat.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu_cat.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_doc($cat = 'System',$doc = '1_system_md'){ @@ -41,5 +41,5 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { //public static function css(){} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/js/saimod_sys_docu.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_docu/js/saimod_sys_docu.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_files/saimod_sys_files.php b/sai/modules/saimod_sys_files/saimod_sys_files.php index 83fa7a5..fba02f8 100644 --- a/sai/modules/saimod_sys_files/saimod_sys_files.php +++ b/sai/modules/saimod_sys_files/saimod_sys_files.php @@ -27,9 +27,9 @@ class saimod_sys_files extends \SYSTEM\SAI\SaiModule { $res = \SYSTEM\FILES\files::get(); foreach($res as $name=>$folder){ - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl'), array( 'name' => $name));} + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl'))->SERVERPATH(), array( 'name' => $name));} $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_FILES)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_files/tpl/saimod_sys_files.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name = 'sys'){ @@ -37,11 +37,11 @@ class saimod_sys_files extends \SYSTEM\SAI\SaiModule { $cat = \SYSTEM\FILES\files::get($name); $i = 0; foreach($cat as $file){ - $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_list_entry.tpl'), array('i' => $i++, 'cat' => $name, 'name' => $file, 'extension' => substr($file,-3,3), 'url' => 'api.php?call=files&cat='.$name.'&id='.$file));} + $result .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_files/tpl/saimod_sys_files_list_entry.tpl'))->SERVERPATH(), array('i' => $i++, 'cat' => $name, 'name' => $file, 'extension' => substr($file,-3,3), 'url' => 'api.php?call=files&cat='.$name.'&id='.$file));} $vars['cat'] = $name; $vars['content'] = $result; $vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_FILES)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_list.tpl'), $vars);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_files/tpl/saimod_sys_files_list.tpl'))->SERVERPATH(), $vars);} //public static function html_li_menu(){return '
  • ${sai_menu_files}
  • ';} public static function html_li_menu(){return '
  • ';} @@ -50,5 +50,5 @@ class saimod_sys_files extends \SYSTEM\SAI\SaiModule { //public static function css(){} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/js/saimod_sys_files.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_files/js/saimod_sys_files.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_git/saimod_sys_git.php b/sai/modules/saimod_sys_git/saimod_sys_git.php index 61ee0c1..d7affdf 100644 --- a/sai/modules/saimod_sys_git/saimod_sys_git.php +++ b/sai/modules/saimod_sys_git/saimod_sys_git.php @@ -5,7 +5,7 @@ class saimod_sys_git extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_git(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_GIT); $vars = array_merge($vars,self::getGitInfo()); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_git/tpl/saimod_sys_git.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_git/tpl/saimod_sys_git.tpl'))->SERVERPATH(), $vars); } public static function getGitInfo(){ diff --git a/sai/modules/saimod_sys_login/saimod_sys_login.php b/sai/modules/saimod_sys_login/saimod_sys_login.php index 2fa3ef0..2029658 100644 --- a/sai/modules/saimod_sys_login/saimod_sys_login.php +++ b/sai/modules/saimod_sys_login/saimod_sys_login.php @@ -12,9 +12,9 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule { $vars['isadmin'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) ? "yes" : "no"; if(\SYSTEM\SECURITY\Security::isLoggedIn()){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/tpl/logout.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_login/tpl/logout.tpl'))->SERVERPATH(), $vars); } else { - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/tpl/login.tpl'), $vars);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_login/tpl/login.tpl'))->SERVERPATH(), $vars);} } public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_logout(){ @@ -45,8 +45,8 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule { //public static function css(){} public static function js(){ return array( \LIB\lib_jqbootstrapvalidation::js(), - \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/js/sai_sys_login_submit.js'), - \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/crypto/jquery.md5.js'), - \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'js/crypto/jquery.sha1.js')); + new \SYSTEM\PSAI('modules/saimod_sys_login/js/sai_sys_login_submit.js'), + new \SYSTEM\PSAI('js/crypto/jquery.md5.js'), + new \SYSTEM\PSAI('js/crypto/jquery.sha1.js')); } } \ No newline at end of file diff --git a/sai/modules/saimod_sys_page/saimod_sys_page.php b/sai/modules/saimod_sys_page/saimod_sys_page.php index e618b90..e9467a4 100644 --- a/sai/modules/saimod_sys_page/saimod_sys_page.php +++ b/sai/modules/saimod_sys_page/saimod_sys_page.php @@ -7,8 +7,8 @@ class saimod_sys_page extends \SYSTEM\SAI\SaiModule { $res = \SYSTEM\SQL\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); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_page/tpl/tabopt.tpl'))->SERVERPATH(), array( 'tab_id' => $r['group']));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_page/tpl/saimod_sys_page.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__system_sai_saimod_sys_page_action_list($group=null){ @@ -21,18 +21,18 @@ class saimod_sys_page extends \SYSTEM\SAI\SaiModule { $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); + $tab['content'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_page/tpl/list_entry.tpl'))->SERVERPATH(), $r); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl'), $tab); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl'))->SERVERPATH(), $tab); } public static function sai_mod__system_sai_saimod_sys_page_action_deletedialog($ID,$group){ $res = \SYSTEM\SQL\SYS_SAIMOD_PAGE_SINGLE_SELECT::Q1(array($ID,$group)); $res = array_merge($res,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_PAGE)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_page/tpl/delete_dialog.tpl'), $res); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_page/tpl/delete_dialog.tpl'))->SERVERPATH(), $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'),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_PAGE));} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_page/tpl/new_dialog.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_PAGE));} 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)){ @@ -72,7 +72,7 @@ class saimod_sys_page extends \SYSTEM\SAI\SaiModule { 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'));} + return array(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'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_page/js/saimod_sys_page.js'));} } \ No newline at end of file diff --git a/sai/modules/saimod_sys_text/saimod_sys_text.php b/sai/modules/saimod_sys_text/saimod_sys_text.php index bc637b4..224815e 100644 --- a/sai/modules/saimod_sys_text/saimod_sys_text.php +++ b/sai/modules/saimod_sys_text/saimod_sys_text.php @@ -12,19 +12,19 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule { $r['style'] = ''; if(substr($r['tag'],0,3) == 'sai'){ $r['style'] = 'display:none;';} - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/tabopt.tpl'), $r);} - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text.tpl'), $vars); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/tabopt.tpl'))->SERVERPATH(), $r);} + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_notag(){ $res = \SYSTEM\SQL\SYS_SAIMOD_TEXT_GETTEXTS_NOTAG::QQ(); $entries = ''; while($r = $res->next()){ - $entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl'), $r); + $entries .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl'))->SERVERPATH(), $r); } $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TEXT); $vars['entries'] = $entries; - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_tag($tag = 'all',$filter = "all",$search="%",$page=0){ @@ -64,23 +64,23 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule { $count_filtered = 0; $res->seek(100*$page); while(($r = $res->next()) && ($count_filtered < 100)){ - $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl'), $r); + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl'))->SERVERPATH(), $r); $count_filtered++;} $vars['pagination'] = ''; $vars['page_last'] = ceil($count/100)-1; for($i=0;$i < ceil($count/100);$i++){ $data = array('page' => $i,'search' => $search, 'filter' => $filter, 'active' => ($i == $page) ? 'active' : '', 'tag' => $tag); - $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_pagination.tpl'), $data); + $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_pagination.tpl'))->SERVERPATH(), $data); } $vars['count'] = $count_filtered.'/'.$count; $vars['lang_filter'] = ''; $res = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS); foreach($res as $lang){ $data = array('active' => ($filter == $lang ? 'active' : ''), 'filter' => $lang, 'search' => $search, 'name' => $lang, 'tag' => $tag); - $vars['lang_filter'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_lang_filter.tpl'),$data);} + $vars['lang_filter'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_lang_filter.tpl'))->SERVERPATH(),$data);} $vars['active'] = ($filter == 'all' ? 'active' : ''); $vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_TEXT)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_edittext($id,$lang){ @@ -92,9 +92,9 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule { $vars2['id'] = $id; $vars2['lang'] = $l; $vars2['default'] = ($l == $lang ? 'menu_lang_default' : ''); - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/tabopt2.tpl'), $vars2); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/tabopt2.tpl'))->SERVERPATH(), $vars2); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_edit_langs.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_edit_langs.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_editor($id, $lang){ @@ -107,7 +107,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule { foreach($tags as $tag){ $vars['tags'] .= $tag['tag'].', '; } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_edit_editor.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_text/tpl/saimod_sys_text_edit_editor.tpl'))->SERVERPATH(), $vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_save($id, $new_id, $lang, $tags, $text){ @@ -122,7 +122,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule { public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_LOCALE);} public static function css(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/css/saimod_sys_text.css'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_text/css/saimod_sys_text.css'));} public static function js(){ - return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/js/saimod_sys_text.js'));} + return array(new \SYSTEM\PSAI('modules/saimod_sys_text/js/saimod_sys_text.js'));} } \ No newline at end of file From cc16a4fb4b5727b9d166812e0ff1a4599f4aefba Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 02:34:33 +0100 Subject: [PATCH 10/22] updated minify reference --- lib/minify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/minify b/lib/minify index 30f29c3..dcdc55c 160000 --- a/lib/minify +++ b/lib/minify @@ -1 +1 @@ -Subproject commit 30f29c3607b99ec458f3ccac2d5b5eb1e3792b13 +Subproject commit dcdc55caa503283a66a5a9a1325f3f27b1475f6c From 7eb1e726cfc16efdc46b39724718831c775272f6 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 02:41:43 +0100 Subject: [PATCH 11/22] fixed scss support --- cache/cache_scss.php | 6 +++--- page/State.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cache/cache_scss.php b/cache/cache_scss.php index 2d30e70..d2058f7 100644 --- a/cache/cache_scss.php +++ b/cache/cache_scss.php @@ -10,9 +10,9 @@ class cache_scss { return sha1($file.';'.filemtime($file)); } public static function url($file){ - if(!\SYSTEM\CACHE\cache_scss::get($file)){ + if(!\SYSTEM\CACHE\cache_scss::get($file->SERVERPATH())){ \LIB\lib_scssphp::php(); - \SYSTEM\CACHE\cache_scss::put($file, (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($file)));} - return './api.php?call=cache&id='.self::CACHE_SCSS.'&ident='.self::ident($file); + \SYSTEM\CACHE\cache_scss::put($file->SERVERPATH(), (new \Leafo\ScssPhp\Compiler())->compile(file_get_contents($file->SERVERPATH())));} + return './api.php?call=cache&id='.self::CACHE_SCSS.'&ident='.self::ident($file->SERVERPATH()); } } \ No newline at end of file diff --git a/page/State.php b/page/State.php index 4789166..7c6aa50 100644 --- a/page/State.php +++ b/page/State.php @@ -31,12 +31,12 @@ class State { $row['css'] = $row['js'] = array(); 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'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); if(\class_exists($row['php_class']) && \method_exists($row['php_class'], 'scss') && \is_callable($row['php_class'].'::scss')){ $scss = \call_user_func($row['php_class'].'::scss'); foreach($scss as $s){ $row['css'][] = \SYSTEM\CACHE\cache_scss::url($s);} } - $row['css'] = count($row['css']) > 0 ? array(\SYSTEM\CACHE\cache_css::url($row['css'])) : array(); 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'] = count($row['js']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array(); From fb2970fec49bf66c6d028ef41bea0d7adfcc8403 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 02:47:36 +0100 Subject: [PATCH 12/22] missing sql for cache --- sql/qt/mysql/data/system_sai_api.sql | 3 +++ sql/qt/mysql/schema/system_cache.sql | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sql/qt/mysql/data/system_sai_api.sql b/sql/qt/mysql/data/system_sai_api.sql index 454bc53..8e90970 100644 --- a/sql/qt/mysql/data/system_sai_api.sql +++ b/sql/qt/mysql/data/system_sai_api.sql @@ -29,9 +29,12 @@ 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 (60, 42, 2, 10, 'bug', 'message', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (61, 42, 2, 10, 'bug', 'data', 'JSON'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (70, 42, 2, 10, 'cache', 'id', 'INT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (71, 42, 2, 10, 'cache', 'ident', 'STRING'); 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 (92, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (93, 0, 4, -1, NULL, '_', 'STRING'); -- 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); diff --git a/sql/qt/mysql/schema/system_cache.sql b/sql/qt/mysql/schema/system_cache.sql index 18737d4..2708e0c 100644 --- a/sql/qt/mysql/schema/system_cache.sql +++ b/sql/qt/mysql/schema/system_cache.sql @@ -1,9 +1,10 @@ CREATE TABLE `system_cache` ( - `ID` INT(10) NOT NULL AUTO_INCREMENT, - `CacheID` INT(10) NOT NULL, - `Ident` CHAR(255) NOT NULL, - `data` BINARY(255) NOT NULL, - PRIMARY KEY (`ID`) + `cache` INT(10) NOT NULL, + `ident` CHAR(255) NOT NULL, + `type` CHAR(255) NOT NULL, + `data` MEDIUMTEXT NOT NULL, + PRIMARY KEY (`cache`, `ident`) ) COLLATE='utf8_general_ci' -ENGINE=MyISAM; \ No newline at end of file +ENGINE=MyISAM +; \ No newline at end of file From 7ae7dc87f5b4c54b7bc54115c85a7574f109cec8 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 03:08:39 +0100 Subject: [PATCH 13/22] fixed typo --- cache/cache_scss.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/cache_scss.php b/cache/cache_scss.php index d2058f7..d2bfd0b 100644 --- a/cache/cache_scss.php +++ b/cache/cache_scss.php @@ -3,7 +3,7 @@ namespace SYSTEM\CACHE; class cache_scss { const CACHE_SCSS = 1; public static function put($file,$data){ - return \SYSTEM\CACHE\cache::put(self::CACHE_SCSS, self::ident($file), 'css', $data);} + return \SYSTEM\CACHE\cache::put(self::CACHE_SCSS, self::ident($file), 'CSS', $data);} public static function get($file,$header = false){ return \SYSTEM\CACHE\cache::get(self::CACHE_SCSS, self::ident($file),$header);} public static function ident($file){ From ad53e4e2a10f0ac23735c55c09be1fed1f3dd471 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 03:14:32 +0100 Subject: [PATCH 14/22] fixed tinymce loading --- sai/page/default_page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sai/page/default_page.php b/sai/page/default_page.php index d3c0c4e..6ecc663 100644 --- a/sai/page/default_page.php +++ b/sai/page/default_page.php @@ -44,7 +44,7 @@ class default_page extends \SYSTEM\PAGE\Page { \SYSTEM\HTML\html::script(\LIB\lib_bootstrap::js()->WEBPATH()). \SYSTEM\HTML\html::script(\LIB\lib_tablesorter::js()->WEBPATH()). \SYSTEM\HTML\html::script(\LIB\lib_bootstrap_growl::js()->WEBPATH()). - \SYSTEM\HTML\html::script(\LIB\lib_tinymce::js()->WEBPATH()). + \SYSTEM\HTML\html::script(\LIB\lib_tinymce::js()->WEBPATH(false)). \SYSTEM\HTML\html::script( \SYSTEM\CACHE\cache_js::url( array( \LIB\lib_system::js(), new \SYSTEM\PSAI('page/js/sai.js')))). From 3c060538badab595c1954746f3e832c9b07d4659 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 1 Feb 2016 18:03:02 +0100 Subject: [PATCH 15/22] saimod files warning for pictures, updated system_text sql --- sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl | 1 + sql/qt/mysql/data/system_text.sql | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl b/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl index c704698..2c01d1b 100644 --- a/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl +++ b/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl @@ -1,4 +1,5 @@

    ${sai_files_title}

    +
    ${sai_files_title_warning}

    IDCacheIDCache IdentType Data
    ${ID}${CacheID}${Ident}${cache}${ident}${type}
    ${name} ${extension} - ${url} + ${url} From 9fc9f12d85390579eedc0f8cadbce88283f3de07 Mon Sep 17 00:00:00 2001 From: Ole Hoppe Date: Wed, 3 Feb 2016 22:55:23 +0100 Subject: [PATCH 18/22] added tooltip function for image preview --- sai/modules/saimod_sys_files/js/saimod_sys_files.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sai/modules/saimod_sys_files/js/saimod_sys_files.js b/sai/modules/saimod_sys_files/js/saimod_sys_files.js index 4bcbe6e..98b99fb 100644 --- a/sai/modules/saimod_sys_files/js/saimod_sys_files.js +++ b/sai/modules/saimod_sys_files/js/saimod_sys_files.js @@ -67,5 +67,6 @@ function files_menu(){ $('#menu_folder_sys').parent().addClass('active');} } -function test(){} - +function saimod_sys_files_tooltip(elementId, pictureId, pictureCategory) { + $( "#elementId" ).tooltip({ content: '' }); +} \ No newline at end of file From 90b2cf3a468d8e50d1c18167aca43cc3e6b936dc Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 4 Feb 2016 00:34:38 +0100 Subject: [PATCH 19/22] updated lettering & textilate lib references --- lib/lettering | 2 +- lib/textillate | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lettering b/lib/lettering index 8a7a337..fa77e99 160000 --- a/lib/lettering +++ b/lib/lettering @@ -1 +1 @@ -Subproject commit 8a7a3377e82231ecf09d40732c75e8bee032228e +Subproject commit fa77e997e3fec513cf55416c9f21ce57abcdece4 diff --git a/lib/textillate b/lib/textillate index 45ded03..4ca4373 160000 --- a/lib/textillate +++ b/lib/textillate @@ -1 +1 @@ -Subproject commit 45ded03fc9c45bb3e9fce61dd700a2acabc0b9db +Subproject commit 4ca4373942cce18aa11b59c7c5ddfd31181f757e From 99122f0d919a77a67c3f7b6939a1cd266257bf19 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 4 Feb 2016 04:04:18 +0100 Subject: [PATCH 20/22] fixed sql typo --- sql/qt/mysql/data/system_sai_api.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/qt/mysql/data/system_sai_api.sql b/sql/qt/mysql/data/system_sai_api.sql index 8e90970..1b3c56a 100644 --- a/sql/qt/mysql/data/system_sai_api.sql +++ b/sql/qt/mysql/data/system_sai_api.sql @@ -34,7 +34,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam 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 (92, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (93, 0, 4, -1, NULL, '_', 'STRING'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (93, 42, 4, -1, NULL, '_', 'STRING'); -- 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); From 76b2f71c2d2d5cbd2c2b3d9195db23828790d24f Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 4 Feb 2016 04:14:13 +0100 Subject: [PATCH 21/22] fixed path error in saimod sys mod --- sai/modules/saimod_sys_mod/saimod_sys_mod.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sai/modules/saimod_sys_mod/saimod_sys_mod.php b/sai/modules/saimod_sys_mod/saimod_sys_mod.php index 02c0659..998a5bd 100644 --- a/sai/modules/saimod_sys_mod/saimod_sys_mod.php +++ b/sai/modules/saimod_sys_mod/saimod_sys_mod.php @@ -1,6 +1,5 @@ Date: Sun, 7 Feb 2016 17:01:55 +0100 Subject: [PATCH 22/22] fixed installscript paths --- sql/qt/DATA_SYSTEM_API.php | 12 ++++----- sql/qt/DATA_SYSTEM_CRON.php | 4 +-- sql/qt/DATA_SYSTEM_PAGE.php | 4 +-- sql/qt/DATA_SYSTEM_RIGHTS.php | 4 +-- sql/qt/DATA_SYSTEM_TEXT.php | 4 +-- sql/qt/SCHEMA_SYSTEM.php | 48 +++++++++++++++++------------------ 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/sql/qt/DATA_SYSTEM_API.php b/sql/qt/DATA_SYSTEM_API.php index 6c79ddc..3c48826 100644 --- a/sql/qt/DATA_SYSTEM_API.php +++ b/sql/qt/DATA_SYSTEM_API.php @@ -3,13 +3,13 @@ namespace SYSTEM\SQL; class DATA_SYSTEM_API extends \SYSTEM\DB\QI { public static function get_class(){return \get_class();} public static function files_pgsql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_api.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_api_default.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_sai_api.sql')); + return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_api.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/data/system_api_default.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/data/system_sai_api.sql'))->SERVERPATH()); } public static function files_mysql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_api.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_api_default.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_sai_api.sql')); + return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_api.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/data/system_api_default.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/data/system_sai_api.sql'))->SERVERPATH()); } } \ No newline at end of file diff --git a/sql/qt/DATA_SYSTEM_CRON.php b/sql/qt/DATA_SYSTEM_CRON.php index 0fdf0c9..91b41ad 100644 --- a/sql/qt/DATA_SYSTEM_CRON.php +++ b/sql/qt/DATA_SYSTEM_CRON.php @@ -3,9 +3,9 @@ namespace SYSTEM\SQL; class DATA_SYSTEM_CRON extends \SYSTEM\DB\QI { public static function get_class(){return \get_class();} public static function files_pgsql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_cron.sql')); + return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_cron.sql'))->SERVERPATH()); } public static function files_mysql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_cron.sql')); + return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_cron.sql'))->SERVERPATH()); } } \ No newline at end of file diff --git a/sql/qt/DATA_SYSTEM_PAGE.php b/sql/qt/DATA_SYSTEM_PAGE.php index 048eb38..ef5f650 100644 --- a/sql/qt/DATA_SYSTEM_PAGE.php +++ b/sql/qt/DATA_SYSTEM_PAGE.php @@ -3,9 +3,9 @@ namespace SYSTEM\SQL; class DATA_SYSTEM_PAGE extends \SYSTEM\DB\QI { public static function get_class(){return \get_class();} public static function files_pgsql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_page.sql')); + return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_page.sql'))->SERVERPATH()); } public static function files_mysql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_page.sql')); + return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_page.sql'))->SERVERPATH()); } } \ No newline at end of file diff --git a/sql/qt/DATA_SYSTEM_RIGHTS.php b/sql/qt/DATA_SYSTEM_RIGHTS.php index 8d2ed40..5182bd3 100644 --- a/sql/qt/DATA_SYSTEM_RIGHTS.php +++ b/sql/qt/DATA_SYSTEM_RIGHTS.php @@ -3,9 +3,9 @@ namespace SYSTEM\SQL; class DATA_SYSTEM_RIGHTS extends \SYSTEM\DB\QI { public static function get_class(){return \get_class();} public static function files_pgsql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_rights.sql')); + return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_rights.sql'))->SERVERPATH()); } public static function files_mysql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_rights.sql')); + return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_rights.sql'))->SERVERPATH()); } } \ No newline at end of file diff --git a/sql/qt/DATA_SYSTEM_TEXT.php b/sql/qt/DATA_SYSTEM_TEXT.php index f15bc03..d00ef30 100644 --- a/sql/qt/DATA_SYSTEM_TEXT.php +++ b/sql/qt/DATA_SYSTEM_TEXT.php @@ -3,9 +3,9 @@ namespace SYSTEM\SQL; class DATA_SYSTEM_TEXT extends \SYSTEM\DB\QI { public static function get_class(){return \get_class();} public static function files_pgsql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/data/system_text.sql')); + return array( (new \SYSTEM\PSQL('/qt/pgsql/data/system_text.sql'))->SERVERPATH()); } public static function files_mysql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/data/system_text.sql')); + return array( (new \SYSTEM\PSQL('/qt/mysql/data/system_text.sql'))->SERVERPATH()); } } \ No newline at end of file diff --git a/sql/qt/SCHEMA_SYSTEM.php b/sql/qt/SCHEMA_SYSTEM.php index 6e76922..2760d35 100644 --- a/sql/qt/SCHEMA_SYSTEM.php +++ b/sql/qt/SCHEMA_SYSTEM.php @@ -3,31 +3,31 @@ namespace SYSTEM\SQL; class SCHEMA_SYSTEM extends \SYSTEM\DB\QI { public static function get_class(){return \get_class();} public static function files_pgsql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_api.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_cache.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_cron.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_log.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_page.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_rights.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_text.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_text_tag.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_todo.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_todo_assign.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_user.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/pgsql/schema/system_user_to_rights.sql')); + return array( (new \SYSTEM\PSQL('/qt/pgsql/schema/system_api.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_cache.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_cron.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_log.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_page.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_rights.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_text.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_text_tag.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_todo.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_todo_assign.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_user.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/pgsql/schema/system_user_to_rights.sql'))->SERVERPATH()); } public static function files_mysql(){ - return array( \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_api.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_cache.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_cron.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_log.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_page.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_rights.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_text.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_text_tag.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_todo.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_todo_assign.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_user.sql'), - \SYSTEM\SERVERPATH(new \SYSTEM\PSQL(),'/qt/mysql/schema/system_user_to_rights.sql')); + return array( (new \SYSTEM\PSQL('/qt/mysql/schema/system_api.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_cache.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_cron.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_log.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_page.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_rights.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_text.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_text_tag.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_todo.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_todo_assign.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_user.sql'))->SERVERPATH(), + (new \SYSTEM\PSQL('/qt/mysql/schema/system_user_to_rights.sql'))->SERVERPATH()); } } \ No newline at end of file