Merge branch 'master' of mojotrollz.eu:system

This commit is contained in:
messerbill 2014-06-02 14:53:21 +02:00
commit 3295ae3f04
17 changed files with 148 additions and 92 deletions

View File

@ -63,17 +63,16 @@ class api {
$result = \SYSTEM\DBD\SYS_API_TREE::QA(array($group));
if(!isset($result) || !is_array($result) || count($result) <= 0){
throw new \SYSTEM\LOG\ERROR("Database Tree for Api empty - cannot proced! GROUP: ".$group);}
return $result;
}
private static function do_statics($params,$tree,$apiclassname,$verifyclassname,$default){
$statics = array();
$parentid = self::ROOT_PARENTID;
foreach($tree as $item){
foreach($tree as $item){
if( intval($item[\SYSTEM\DBD\system_api::FIELD_TYPE]) == \SYSTEM\DBD\system_api::VALUE_TYPE_STATIC &&
intval($item[\SYSTEM\DBD\system_api::FIELD_PARENTID]) == $parentid &&
isset($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
isset($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
$statics[] = array($item,$params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]]);
$call_funcname = 'static_'.$item[\SYSTEM\DBD\system_api::FIELD_NAME];

View File

@ -0,0 +1,22 @@
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_logout', 1, 'Logout', 'Ausloggen');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_login', 1, 'Login', 'Einloggen');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_register', 1, 'Register', 'Registrieren');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_username', 1, 'Username', 'Username');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_password', 1, 'Password', 'Passwort');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_email', 1, 'EMail', 'E-Mail2');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_last_active', 1, 'Last active', 'Zuletzt aktiv');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_join_date', 1, 'Joindate', 'Beitrittsdatum');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_locale', 1, 'Locale', 'Sprache');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_admin_rights', 1, 'Admin Rights', 'Admin Rechte');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_cancel', 1, 'Cancel', 'Abbrechen');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_logout', 1, 'Logout before you leave!', 'Loggen Sie sie sich aus bevor Sie gehen!');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_login', 1, 'Login to your Website.', 'Loggen Sie sich in ihre Website ein.');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_register', 1, 'Register an Account', 'Register an Account');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_password_miss', 1, 'Can\'t really remember your Password?', 'Can\'t really remember your Password?');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_username', 1, 'peter / peter@world.org', 'peter / peter@world.org');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_password', 1, 'my secret123', 'geheim567');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_email', 1, 'peter@world.org', 'peter@world.org');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_state_login', 1, 'You are logged in.', 'You are logged in.');

View File

@ -23,6 +23,10 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (35, 42, 2, 3, 'add', 'id', 'ALL');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (36, 42, 2, 3, 'add', 'category', 'INT');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (37, 42, 2, 3, 'load', 'id', 'LANG');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (38, 42, 2, 3, 'load', 'group', 'INT');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (39, 42, 2, 3, 'singleload', 'id', 'ALL');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 42, 2, 3, 'upload', 'cat', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 42, 2, 3, 'del', 'cat', 'STRING');
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (42, 42, 2, 3, 'del', 'id', 'STRING');

View File

@ -0,0 +1,8 @@
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_short', 43, 'Username is too short', 'Nutzername ist zu kurz');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_long', 43, 'Username is too long', 'Nutzername ist zu lang');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_miss', 43, 'Username required', 'Nutzername erfoderlich');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_miss', 43, 'Password required', 'Passwort erforderlich');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_long', 43, 'Password too long', 'Passwort zu lang');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_short', 43, 'Password too short', 'Passwort zu kurz');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_match', 43, 'Passwords do not match!', 'Passwords do not match!');
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_email_wrong', 43, 'Invalid EMail!', 'Invalid EMail!');

View File

@ -0,0 +1 @@
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_mod_login_text', 42, 'Please login for developer access (if you are a developer).', 'Please login for developer access (if you are a developer).');

View File

@ -11,8 +11,7 @@ class system_locale_string {
const FIELD_EN_US = 'enUS';
const FIELD_DE_DE = 'deDE';
const VALUE_CATEGORY_TEST1 = 1;
const VALUE_CATEGORY_TEST2 = 2;
const VALUE_CATEGORY_BASIC = 1;
const VALUE_CATEGORY_SYSTEM = 10;
const VALUE_CATEGORY_SYSTEM_ERROR = 11;

View File

@ -1,6 +1,6 @@
<div class="masthead">
<h3 class="muted">Login / Register</h3>
<h4 class="text-info">Please login for developer access (if you are a developer).</a></h4>
<h3 class="muted">${basic_login} / ${basic_register}</h3>
<h4 class="text-info">${sai_mod_login_text}</a></h4>
</div>
<form class="textbox" style="padding:10px" id="login_form">
<div class="control-group">
@ -9,27 +9,25 @@
size="30"
style="margin-bottom: 15px;"
id="bt_login_user"
placeholder="${sai_mod_login_username}"
minlength="3" data-validation-minlength-message="${sai_error_mod_login_username_too_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_mod_login_username_too_long}"
required data-validation-required-message="${sai_error_mod_login_username_required}"/>
placeholder="${basic_placeholder_username}"
minlength="3" data-validation-minlength-message="${sai_error_username_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_username_long}"
required data-validation-required-message="${sai_error_username_miss}"/>
</div>
<div class="controls">
<input type="password"
size="30"
style="margin-bottom: 15px;"
id="bt_login_password"
placeholder="${sai_mod_login_password}"
minlength="5" data-validation-minlength-message="${sai_error_mod_login_password_too_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_mod_login_password_too_long}"
required data-validation-required-message="${sai_error_mod_login_password_required}"/>
placeholder="${basic_placeholder_password}"
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_password_long}"
required data-validation-required-message="${sai_error_password_miss}"/>
</div>
<div class="help-block"></div>
<input type="hidden" />
<button class="btn btn-primary" style="clear: left; height: 32px; font-size: 13px;"
type="submit"
id="login_submit">${sai_mod_login_login}</button>
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="login_submit">${basic_login}</button>
</div>
</form>
<a href="#" id="register_link">Register an Account</a></br>
<a href="#" id="password_link">Can't really remember your Password?</a>
<a href="#" id="register_link">${basic_text_register}</a></br>
<a href="#" id="password_link">${basic_text_password_miss}</a>

View File

@ -1,16 +1,16 @@
<div class="masthead">
<h3 class="muted">Logout</h3>
<h4 class="text-info">You are logged in.</h4>
<h3 class="muted">${basic_logout}</h3>
<h4 class="text-info">${basic_state_login}</h4>
</div>
<div>
<table id="userDetailsTable" class="table table-striped">
<tbody>
<tr>
<th style="width: 200px;">${sai_mod_login_username}</th>
<td><span id="user_username" /></td>
<th style="width: 200px;">${basic_username}</th>
<td><span id="user_username" /></td>
</tr>
<tr>
<th>${sai_mod_login_email}</th>
<th>${basic_email}</th>
<td>
<span id="user_email" />
<div class="control-group" id="change_user_email" style="display: none;">
@ -19,15 +19,15 @@
size="30"
style="margin-bottom: 15px; float: left;"
id="user_email_input"
data-validation-email-message="${ua_email_format_wrong}"
required data-validation-required-message="${login_password_required}"/>
data-validation-email-message="${sai_error_email_wrong}"
required data-validation-required-message="${sai_error_email_miss}"/>
</div>
<div class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
</td>
</tr>
<tr>
<th>${sai_mod_login_password}</th>
<th>${basic_password}</th>
<td>
<span id="user_password">****</span>
<div class="control-group" id="change_user_password" style="display: none;">
@ -36,9 +36,9 @@
size="30"
style="margin-bottom: 15px; float: left;"
id="user_old_password"
placeholder="${ua_insert_password}"
minlength="5" data-validation-minlength-message="${login_password_too_short}"
required data-validation-required-message="${login_password_required}"/>
placeholder="${basic_placeholder_user}"
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
required data-validation-required-message="${sai_error_password_miss}"/>
<div id="help-block-old-password" class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
<div class="control-group controls" style="clear: both">
@ -47,8 +47,8 @@
style="margin-bottom: 15px; float: left;"
id="user_new_password1"
name="user_new_password1"
placeholder="${ua_new_password_first}"
minlength="5" data-validation-minlength-message="${login_password_too_short}"/>
placeholder="${basic_placeholder_password}"
minlength="5" data-validation-minlength-message="${sai_error_password_short}"/>
<div class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
<div class="control-group controls" style="clear: both">
@ -57,24 +57,24 @@
style="margin-bottom: 15px; float: left;"
id="user_new_password2"
name="user_new_password2"
placeholder="${ua_new_password_second}"
placeholder="${basic_placeholder_password}"
data-validation-matches-match="user_new_password1"
data-validation-matches-message="${register_password_dont_math}"/>
data-validation-matches-message="${sai_error_password_match}"/>
<div class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
</div>
</td>
</tr>
<tr>
<th>${sai_mod_login_last_active}</th>
<th>${basic_last_active}</th>
<td><span id="user_last_active"></span></td>
</tr>
<tr>
<th>${sai_mod_login_join_date}</th>
<th>${basic_join_date}</th>
<td><span id="user_joindate"></span></td>
</tr>
<tr>
<th>${sai_mod_login_locale}</th>
<th>${basic_locale}</th>
<td>
<span id="user_locale"></span>
<div id="change_user_locale" style="display: none;">
@ -86,7 +86,7 @@
</td>
</tr>
<tr>
<th style="width: 200px;">${sai_mod_login_admin_rights}</th>
<th style="width: 200px;">${basic_admin_rights}</th>
<td><span id="user_adminrights" />${isadmin}</td>
</tr>
</tbody>
@ -96,7 +96,7 @@
<div class="control-group">
<div class="help-block"></div>
<input type="hidden" />
<button class="btn btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${logout}</button>
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${basic_logout}</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
<h1>${register}</h1>
<h1>${basic_register}</h1>
<br />
<br />
<form class="textbox" id="register_user_form">
@ -6,16 +6,16 @@
<table id="userRegisterTable" class="table table-striped">
<tbody>
<tr>
<th style="width: 200px;">${loginUsername}</th>
<th style="width: 200px;">${basic_username}</th>
<td>
<div class="control-group controls">
<input type="text"
size="30"
style="margin-bottom: 15px; float: left;"
id="register_username"
placeholder="${enter_username}"
minlength="3" data-validation-minlength-message="${login_username_too_short}"
required data-validation-required-message="${login_username_required}"/>
placeholder="${basic_placeholder_username}"
minlength="3" data-validation-minlength-message="${sai_error_username_short}"
required data-validation-required-message="${sai_error_username_miss}"/>
<br/>
<div id="register-help-block-username" class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
@ -29,16 +29,16 @@
size="30"
style="margin-bottom: 15px; float: left;"
id="register_email"
placeholder="${enter_email}"
data-validation-email-message="${check_mail_format}"
required data-validation-required-message="${email_required}"/>
placeholder="${basic_placeholder_email}"
data-validation-email-message="${sai_error_email_wrong}"
required data-validation-required-message="${sai_error_email_miss}"/>
<br/>
<div id="register-help-block-email" class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
</td>
</tr>
<tr>
<th>${loginPassword}</th>
<th>${basic_password}</th>
<td>
<div class="control-group" id="change_user_password">
<div class="control-group controls" style="clear: both">
@ -47,9 +47,9 @@
style="margin-bottom: 15px; float: left;"
id="user_register_password1"
name="user_register_password1"
placeholder="${enter_password}"
minlength="5" data-validation-minlength-message="${login_password_too_short}"
required data-validation-required-message="${login_password_required}"/>
placeholder="${basic_placeholder_password}"
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
required data-validation-required-message="${sai_error_password_miss}"/>
<br/>
<div class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
@ -59,9 +59,9 @@
style="margin-bottom: 15px; float: left;"
id="user_register_password2"
name="user_register_password2"
placeholder="${retype_password}"
placeholder="${basic_placeholder_password}"
data-validation-matches-match="user_register_password1"
data-validation-matches-message="${register_password_dont_math}"/>
data-validation-matches-message="${sai_error_password_match}"/>
<br/>
<div class="help-block" style="float: left; margin-top: 3px;"></div>
</div>
@ -69,7 +69,7 @@
</td>
</tr>
<tr>
<th>${locale}</th>
<th>${basic_locale}</th>
<td>
<div id="change_user_locale">
<select size="1" id="register_locale_select">
@ -81,7 +81,7 @@
</tr>
</tbody>
</table>
<button class="btn btn-primary" type="submit"><i class="icon-ok icon-white"></i> ${register}</button>
<button class="btn btn-primary" type="reset" id="btn_user_registration_cancel"><i class="icon-remove icon-white"></i> ${cancel}</button>
<button class="btn-sm btn-primary" type="submit"><i class="icon-ok icon-white"></i> ${basic_register}</button>
<button class="btn-sm btn-primary" type="reset" id="btn_user_registration_cancel"><i class="icon-remove icon-white"></i> ${basic_cancel}</button>
</div>
</form>

View File

@ -12,8 +12,9 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule {
$vars['login_username_too_short'] = 'Username to short.';
$vars['login_password_too_short'] = 'Password to short.';
$vars['isadmin'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) ? "yes" : "no";
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI));
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR));
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI),
\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR),
\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC));
if(\SYSTEM\SECURITY\Security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/logout.tpl'), $vars);
@ -39,8 +40,10 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule {
}
public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_registerform(){
$vars = \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI);
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR));
$vars = \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI);
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI),
\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR),
\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC));
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/register.tpl'), $vars);}
public static function html_li_menu(){return '</ul><ul class="nav pull-right"><li><a href="#" saimenu=".SYSTEM.SAI.saimod_sys_login" id="sai_login_loginmenuli">'.(\SYSTEM\SECURITY\Security::isLoggedIn() ? 'Logout' : 'Login').'</a></li>';}

View File

@ -1,4 +1,7 @@
<h2 class="muted">Login</h2>
<h2 class="muted">${basic_login}</h2>
${basic_text_login}
<br/>
<br/>
<form class="textbox" style="" id="login_form">
<div class="control-group">
<div class="controls">
@ -6,25 +9,25 @@
size="30"
style="margin-bottom: 15px;"
id="bt_login_user"
placeholder="${sai_mod_login_username}"
minlength="3" data-validation-minlength-message="${sai_error_mod_login_username_too_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_mod_login_username_too_long}"
required data-validation-required-message="${sai_error_mod_login_username_required}"/>
placeholder="${sai_placeholder_username}"
minlength="3" data-validation-minlength-message="${sai_error_username_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_username_long}"
required data-validation-required-message="${sai_error_username_miss}"/>
</div>
<div class="controls">
<input type="password"
size="30"
style="margin-bottom: 15px;"
id="bt_login_password"
placeholder="${sai_mod_login_password}"
minlength="5" data-validation-minlength-message="${sai_error_mod_login_password_too_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_mod_login_password_too_long}"
required data-validation-required-message="${sai_error_mod_login_password_required}"/>
placeholder="${sai_placeholder_password}"
minlength="5" data-validation-minlength-message="${sai_error_password_short}"
maxlength="16" data-validation-maxlength-message="${sai_error_password_long}"
required data-validation-required-message="${sai_error_password_miss}"/>
</div>
<div class="help-block"></div>
<input type="hidden" />
<button class="btn btn-primary" style="clear: left; height: 32px; font-size: 13px;"
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;"
type="submit"
id="login_submit">${sai_mod_login_login}</button>
id="login_submit">${basic_login}</button>
</div>
</form>

View File

@ -1,8 +1,11 @@
<h2 class="muted">Logout</h2>
<h3 class="muted">${basic_logout}</h3>
${basic_text_logout}
<br/>
<br/>
<form class="textbox" style="" id="logout_form">
<div class="control-group">
<div class="help-block"></div>
<input type="hidden" />
<button class="btn btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${logout}</button>
<button class="btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit">${basic_logout}</button>
</div>
</form>

View File

@ -3,8 +3,11 @@ namespace SYSTEM\SAI;
class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){
return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/saistart.tpl'),
array('content' => self::html_content(), 'login' => self::html_login()));}
$vars = array('content' => self::html_content(), 'login' => self::html_login());
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC),
\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI),
\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR));
return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/saistart.tpl'),$vars);}
public static function html_li_menu(){return '<li class="active"><a href="#" saimenu=".SYSTEM.SAI.saistart_sys_sai">'.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE).'</a></li>';}
public static function right_public(){return true;}
public static function right_right(){return true;}

View File

@ -4,7 +4,7 @@ namespace SYSTEM\SAI;
class default_page extends \SYSTEM\PAGE\Page {
private function menu_sys(){
private static function menu_sys(){
$result = '';
$mods = \SYSTEM\SAI\sai::getSysModules();
@ -16,7 +16,7 @@ class default_page extends \SYSTEM\PAGE\Page {
return $result;
}
private function menu_proj(){
private static function menu_proj(){
$result = '';
$mods = \SYSTEM\SAI\sai::getModules();
foreach($mods as $mod){
@ -27,21 +27,21 @@ class default_page extends \SYSTEM\PAGE\Page {
return $result;
}
private function menu_start(){
private static function menu_start(){
$mod = \SYSTEM\SAI\sai::getStartModule();
if(\call_user_func(array($mod, 'right_public')) ||
\call_user_func(array($mod, 'right_right'))){
return \call_user_func(array($mod, 'html_li_menu'));}
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 function css(){
private static function css(){
$result = '<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/libs/bootstrap.min.css').'" type="text/css" />'.
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/index.css').'" type="text/css" />'.
'<link rel="stylesheet" href="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/css/sai_table.css').'" type="text/css" />';
return $result;
}
private function js(){
private static function js(){
$result = '<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/libs/jquery.min.js').'" type="text/javascript"></script>'.
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/libs/bootstrap.min.js').'" type="text/javascript"></script>'.
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/js/sai.js').'" type="text/javascript"></script>'.
@ -53,6 +53,19 @@ class default_page extends \SYSTEM\PAGE\Page {
'<script src="'.\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/tinymce/tinymce.min.js').'" type="text/javascript"></script>';
return $result;
}
private static function lang_switcher(){
$result = '';
$langs = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
if(in_array('deDE', $langs)){
$result .= '<a href="javascript:switchLocale(\'deDE\');"><img src="${PATH_LOCAL_IMG}flag_germany.png" alt="Deutsch"></a>&nbsp;';
}
if(in_array('enUS', $langs)){
$result .= '<a href="javascript:switchLocale(\'enUS\');"><img src="${PATH_LOCAL_IMG}flag_usa.png" alt="English"></a>';
}
return $result;
}
public function html(){
@ -60,12 +73,13 @@ class default_page extends \SYSTEM\PAGE\Page {
$vars['css'] = $this->css();
$vars['js'] = $this->js();
$vars['menu_start'] = $this->menu_start();
$vars['menu_sys'] = $this->menu_sys();
$vars['menu_proj'] = $this->menu_proj();
$vars['menu_start'] = self::menu_start();
$vars['menu_sys'] = self::menu_sys();
$vars['menu_proj'] = self::menu_proj();
$vars['navimg'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_NAVIMG);
$vars['title'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE); //da_sense | Developer Center
$vars['copyright'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT); //&copy; <a href="http://www.da-sense.de" target="_blank">da_sense</a>, TU Darmstadt 2013
$vars['title'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE);
$vars['copyright'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT);
$vars['lang_switcher'] = self::lang_switcher();
$vars['PATH_LOCAL_IMG'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/img/');
$vars = array_merge($vars,\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI));

View File

@ -15,8 +15,7 @@
<img src="${navimg}" height="24" width="24"/>
</div>
<a class="brand" href="#" style="width: 159px;">SAI</a>
<a href="javascript:switchLocale('deDE');"><img src="${PATH_LOCAL_IMG}flag_germany.png" alt="Deutsch"></a>
<a href="javascript:switchLocale('enUS');"><img src="${PATH_LOCAL_IMG}flag_usa.png" alt="English"></a>
${lang_switcher}
<ul class="nav">
${menu_start}
${menu_sys}

View File

@ -2,7 +2,7 @@
namespace SYSTEM\SAI;
abstract class SaiModule extends \SYSTEM\API\api_system{
class SaiModule extends \SYSTEM\API\api_system{
public static function default_page(){
$sai = new \SYSTEM\SAI\default_page();
return $sai->html();}

View File

@ -9,7 +9,7 @@ class saigui extends \SYSTEM\PAGE\Page {
//Direct JSON Input
$pg = json_decode(file_get_contents("php://input"), true);
if(!$pg){
$pg = array_merge($_POST,$_GET);}
$pg = array_merge($_POST,$_GET);}
if(isset($pg[SAI_MOD_POSTFIELD])){
$classname = \str_replace('.', '\\', $pg[SAI_MOD_POSTFIELD]);
$pg[SAI_MOD_POSTFIELD] = \str_replace('.', '_', $pg[SAI_MOD_POSTFIELD]);
@ -20,9 +20,9 @@ class saigui extends \SYSTEM\PAGE\Page {
( \call_user_func(array($classname, 'right_public')) ||
\call_user_func(array($classname, 'right_right')))){
return \SYSTEM\API\api::run('\SYSTEM\API\verify', $classname , $pg, 42, true, false);
} else {
} else {
return '<meta http-equiv="refresh" content="5">You are no longer logged in. Page reload in 5sec...';}
} else {
return \SYSTEM\API\api::run('\SYSTEM\API\verify', '\SYSTEM\SAI\SaiModule', array(), 42, false, true);}
return \SYSTEM\API\api::run('\SYSTEM\API\verify', '\SYSTEM\SAI\SaiModule', $pg, 42, false, true);}
}
}