first part of missing commit regarding cache & minify & mask

This commit is contained in:
Ulf Gebhardt 2016-01-20 01:55:18 +01:00
parent c7b419164c
commit 1a09c9bf55
18 changed files with 150 additions and 152 deletions

View File

@ -1,6 +1,6 @@
<?php
//include autoload class
require_once dirname(__FILE__).'/system/path.php';
require_once dirname(__FILE__).'/path/path.php';
require_once dirname(__FILE__).'/system/autoload.php';
//Register autoload

2
cache/cache.php vendored
View File

@ -11,7 +11,7 @@ class cache {
}else{
\SYSTEM\HEADER::FILE($ident);}
}
return $result['data'];
return $result['cache'] == \SYSTEM\CACHE\cache_filemask::CACHE_FILEMASK ? \file_get_contents($result['data']) : $result['data'];
}
public static function put($cache, $ident, $type, $data, $fail_on_exist = false){

9
cache/cache_css.php vendored
View File

@ -1,16 +1,15 @@
<?php
namespace SYSTEM\CACHE;
class cache_css {
const CACHE_CSS = 1;
const CACHE_CSS = 10;
public static function put($ident,$data){
return \SYSTEM\CACHE\cache::put(self::CACHE_CSS, $ident, 'css',$data);}
return \SYSTEM\CACHE\cache::put(self::CACHE_CSS, $ident, 'CSS', $data);}
public static function get($ident,$header = false){
return \SYSTEM\CACHE\cache::get(self::CACHE_CSS, $ident,$header);}
public static function ident($files){
$ident = '';
foreach($files as $f){
$unique = time() % 60*15;
$ident .= $f.';'.$unique.'|';}
$ident .= $f->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;
}

View File

@ -1,26 +1,14 @@
<?php
namespace SYSTEM\CACHE;
class cache_css {
const CACHE_CSS = 1;
public static function put($ident,$data){
return \SYSTEM\CACHE\cache::put(self::CACHE_CSS, $ident, 'css',$data);}
class cache_filemask {
const CACHE_FILEMASK = 12;
public static function put($file){
$ext = pathinfo($file);
$ext = strtoupper(array_key_exists('extension', $ext) ? $ext['extension'] : '');
return \SYSTEM\CACHE\cache::put(self::CACHE_FILEMASK, self::ident($file), $ext ,$file);}
public static function get($ident,$header = false){
return \SYSTEM\CACHE\cache::get(self::CACHE_CSS, $ident,$header);}
public static function ident($files){
$ident = '';
foreach($files as $f){
$unique = time() % 60*15;
$ident .= $f.';'.$unique.'|';}
return sha1($ident);
}
public static function url($files){
$ident = self::ident($files);
if(!\SYSTEM\CACHE\cache_css::get($ident)){
\LIB\lib_minify::php();
$minifier = new \MatthiasMullie\Minify\CSS();
foreach($files as $f){
$minifier->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);
}
}

9
cache/cache_js.php vendored
View File

@ -1,16 +1,15 @@
<?php
namespace SYSTEM\CACHE;
class cache_js {
const CACHE_JS = 1;
const CACHE_JS = 11;
public static function put($ident,$data){
return \SYSTEM\CACHE\cache::put(self::CACHE_JS, $ident, 'js',$data);}
return \SYSTEM\CACHE\cache::put(self::CACHE_JS, $ident, 'JS', $data);}
public static function get($ident,$header = false){
return \SYSTEM\CACHE\cache::get(self::CACHE_JS, $ident,$header);}
public static function ident($files){
$ident = '';
foreach($files as $f){
$unique = time() % 60*15;
$ident .= $f.';'.$unique.'|';}
$ident .= $f->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;
}

View File

@ -1,7 +1,7 @@
<?php
namespace SYSTEM\CACHE;
class cache_scss {
const CACHE_SCSS = 10;
const CACHE_SCSS = 1;
public static function put($file,$data){
return \SYSTEM\CACHE\cache::put(self::CACHE_SCSS, self::ident($file), 'css', $data);}
public static function get($file,$header = false){

View File

@ -4,9 +4,9 @@ class lib_system extends \LIB\lib_jscss{
public static function get_class(){
return self::class;}
public static function js_path(){
return './sai.php?call=files&amp;cat=sys&amp;id=system.js';}
return new \SYSTEM\PLIB('/system/lib/system.js');}
public static function css_path(){
return './sai.php?call=files&amp;cat=sys&amp;id=system.css';}
return new \SYSTEM\PLIB('/system/lib/system.css');}
public static function version(){
return 'pre alpha';}
}

View File

@ -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['css']) > 0 ? array(\SYSTEM\CACHE\cache_js::url($row['js'])) : array();
unset($row['php_class']);
$skip = false;

View File

@ -1,46 +1,59 @@
<?php
namespace SYSTEM;
const C_ROOT = '<root>';
const C_SUBPATH = '<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);}
}

View File

@ -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;
}

View File

@ -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'));}
}

View File

@ -11,15 +11,15 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule {
$v['mod'] = $mod;
$v['public'] = \call_user_func(array($mod, 'right_public')) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>';
$v['you'] = \call_user_func(array($mod, 'right_right')) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>';
$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')) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>';
$start['start_access'] = \call_user_func(array($mod, 'right_right')) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>';
$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')) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>';
$v['you'] = \call_user_func(array($mod, 'right_right')) ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>';
$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 '<li><a id="menu_mod" href="#!mod">${sai_menu_mod}</a></li>';}
public static function html_li_menu(){return '<li><a id="menu_mod" data-toggle="tooltip" data-placement="bottom" title="${sai_menu_mod}" href="#!mod"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a></li>';}
@ -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');}
}

View File

@ -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'));}
}

View File

@ -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", '<br/>', $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 '<li><a id="menu_todo" data-toggle="tooltip" data-placement="bottom" title="${sai_menu_todo}" href="#!todo"><span class="glyphicon glyphicon-list" aria-hidden="true"></span></a></li>';}
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

View File

@ -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 '<li class="active"><a id="menu_start" href="#">${sai_menu_start}</a></li>';}
public static function html_li_menu(){return '<li class="active sai_menu_first"><a id="menu_start" data-toggle="tooltip" data-placement="bottom" title="${sai_menu_start}" href="#"><span class="glyphicon glyphicon-home" aria-hidden="true"></span></a></li>';}
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);
}
}

View File

@ -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 = '<link rel="stylesheet" href="'.\LIB\lib_bootstrap::css().'" type="text/css" />'.
'<link rel="stylesheet" href="'.\LIB\lib_system::css().'" type="text/css" />'.
'<link rel="stylesheet" href="'.\LIB\lib_tablesorter::css().'" type="text/css" />'.
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai_classes.css').'" type="text/css" />'.
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai.css').'" type="text/css" />';
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 = '<script src="'.\LIB\lib_jquery::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_bootstrap::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_system::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_tablesorter::js().'" type="text/javascript"></script>'.
'<script src="'.\LIB\lib_bootstrap_growl::js().'" type="text/javascript"></script>'.
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/sai.js').'" type="text/javascript"></script>'.
'<script src="https://www.google.com/jsapi" type="text/javascript"></script>'.
//'<script src="https://maps.google.com/maps/api/js?v=3&amp;sensor=false" type="text/javascript"></script>'.
'<script type="text/javascript">google.load("visualization", "1", {packages:["corechart"]});</script>'.
'<script src="'.\LIB\lib_tinymce::js().'" type="text/javascript"></script>';
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').
'<script type="text/javascript">google.load("visualization", "1", {packages:["corechart"]});</script>';
}
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);
}
}