From 1a09c9bf5581110fbd35cc8fea9644a40c6bcb64 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2016 01:55:18 +0100 Subject: [PATCH] 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