diff --git a/dbd/qq/SYS_TEXT_GET_ID.php b/dbd/qq/SYS_TEXT_GET_ID.php
new file mode 100644
index 0000000..ede1011
--- /dev/null
+++ b/dbd/qq/SYS_TEXT_GET_ID.php
@@ -0,0 +1,11 @@
+ text)
+ public static function tag($tag, $lang = NULL) {
+ if($lang == NULL){
+ $lang = \SYSTEM\locale::get();}
+
+ if(!\SYSTEM\locale::isLang($lang)){
+ throw new \Exception("The requested language is not supported: ".$lang);}
+
+ $result = array();
+ $res = \SYSTEM\DBD\SYS_TEXT_GET_TAG::QQ(array($tag,$lang));
+ while($row = $res->next()){
+ $result[$row['id']] = $row['text'];}
+ return $result;
+ }
+ //return textstring with certain id and lang
+ public static function get($id, $lang = NULL,$fallback = true) {
+ if($lang == NULL){
+ $lang = \SYSTEM\locale::get();}
+
+ if(!\SYSTEM\locale::isLang($lang)){
+ throw new \Exception("The requested language is not supported: ".$lang);}
+
+ $res = \SYSTEM\DBD\SYS_TEXT_GET_ID::Q1(array($id,$lang));
+ if($fallback && !$res && $lang != \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG)){
+ new \SYSTEM\LOG\WARNING('Text with id: '.$id.' not found for lang: '.$lang.' - fallback to default lang.');
+ return self::get($id, \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG));}
+ return $res ? $res['text'] : '';
+ }
+}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_login/saimod_sys_login.php b/sai/modules/saimod_sys_login/saimod_sys_login.php
index 094e235..7c08f80 100644
--- a/sai/modules/saimod_sys_login/saimod_sys_login.php
+++ b/sai/modules/saimod_sys_login/saimod_sys_login.php
@@ -10,9 +10,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),
- \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR),
- \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC));
+ $vars = array_merge($vars,
+ \SYSTEM\PAGE\text::tag('basic'),
+ \SYSTEM\PAGE\text::tag('sys_sai'));
if(\SYSTEM\SECURITY\Security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/tpl/logout.tpl'), $vars);
@@ -38,10 +38,8 @@ 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),
- \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR),
- \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC));
+ $vars = array_merge(\SYSTEM\PAGE\text::tag('basic'),
+ \SYSTEM\PAGE\text::tag('sys_sai'));
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/tpl/register.tpl'), $vars);}
public static function html_li_menu(){return '
';}
diff --git a/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_GETTEXT.php b/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_GETTEXT.php
deleted file mode 100644
index eb5d0cc..0000000
--- a/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_GETTEXT.php
+++ /dev/null
@@ -1,11 +0,0 @@
-query($query);
$entries = '';
while($r = $res->next()){
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl'), $r);
@@ -45,7 +41,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
$vars = array();
$vars['id'] = $id;
$vars['lang'] = $lang;
- $vars['content'] = \SYSTEM\DBD\SYS_SAIMOD_TEXT_GETTEXT_LANG::Q1(array($id, $lang))['text'];
+ $vars['content'] = \SYSTEM\PAGE\text::get($id,$lang,false);
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/saimod_sys_text_edit_editor.tpl'), $vars);
}
diff --git a/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl b/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl
index 2cc4628..28d7f81 100644
--- a/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl
+++ b/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list.tpl
@@ -1,12 +1,12 @@
- | id |
+ ID |
+ Language |
Text |
Author |
- author_edit |
- language |
- time_create |
- time_edit |
+ Time_create |
+ Author_edit |
+ Time_edit |
${entries}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl b/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl
index eb05502..0fd81ff 100644
--- a/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl
+++ b/sai/modules/saimod_sys_text/tpl/saimod_sys_text_list_entry.tpl
@@ -1,9 +1,9 @@
-
+
| ${id} |
+ ${lang} |
${text} |
- ${author} |
- ${author_edit} |
- ${language} |
+ ${author_name} |
${time_create} |
+ ${author_edit_name} |
${time_edit} |
\ No newline at end of file
diff --git a/sai/modules/saistart_sys_sai/saistart_sys_sai.php b/sai/modules/saistart_sys_sai/saistart_sys_sai.php
index f0e949f..a88e600 100644
--- a/sai/modules/saistart_sys_sai/saistart_sys_sai.php
+++ b/sai/modules/saistart_sys_sai/saistart_sys_sai.php
@@ -3,10 +3,9 @@ namespace SYSTEM\SAI;
class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){
- $vars = array('content' => self::html_content());
- $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));
+ $vars = array_merge(array( 'content' => self::html_content()),
+ \SYSTEM\PAGE\text::tag('basic'),
+ \SYSTEM\PAGE\text::tag('sys_sai'));
return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/saistart.tpl'),$vars);}
public static function html_li_menu(){return '';}
public static function right_public(){return true;}
diff --git a/sai/page/default_page.php b/sai/page/default_page.php
index 0b7fec5..6a5a6fa 100644
--- a/sai/page/default_page.php
+++ b/sai/page/default_page.php
@@ -61,7 +61,7 @@ class default_page extends \SYSTEM\PAGE\Page {
$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 = array_merge($vars,\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI));
+ $vars = array_merge($vars,\SYSTEM\PAGE\text::tag('sys_sai'));
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars);
}
}
\ No newline at end of file
diff --git a/system/locale.php b/system/locale.php
index 5afee22..be42931 100644
--- a/system/locale.php
+++ b/system/locale.php
@@ -38,7 +38,7 @@ class locale {
*
* returns array or throws exception
*/
- public static function getStrings($request, $lang = NULL) {
+ /*public static function getStrings($request, $lang = NULL) {
if($lang == NULL){
$lang = self::get();}
@@ -82,5 +82,5 @@ class locale {
}
throw new \Exception("Could not understand given request: ".$request);
- }
+ }*/
}
\ No newline at end of file