saimod text update, added saimod_sys_text.css

This commit is contained in:
Messerbill 2015-04-14 22:44:53 +02:00
parent d56fead738
commit 57fa015f17
8 changed files with 27 additions and 17 deletions

View File

@ -1,4 +1,4 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\SAI');
\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_langswitcher');
\SYSTEM\SAI\sai::register('\SYSTEM\SAI\saimod_sys_langswitcher');

View File

@ -0,0 +1,3 @@
#tab_editor {
box-sizing: border-box;
}

View File

@ -53,9 +53,6 @@ function init_tinymce(){
theme_modern_statusbar_location : "bottom",
theme_modern_resizing : true,
width: "100%",
height: "250px",
// Example content CSS (should be your site CSS)
content_css : "../../page/index.css"*/
// General options
@ -78,7 +75,7 @@ function init_tinymce(){
// Skin options
//skin : "o2k7",
//skin_variant : "silver",
width: "100%",
width: "99%",
height: "250px",
// Example content CSS (should be your site CSS)

View File

@ -1,11 +1,12 @@
<?php
namespace SYSTEM\DBD;
class SYS_SAIMOD_LOCALE_ADD extends \SYSTEM\DB\QP {
class SYS_SAIMOD_TEXT_SAVE extends \SYSTEM\DB\QP {
protected static function query(){
return new \SYSTEM\DB\QQuery(get_class(),
//pg
'INSERT INTO '.\SYSTEM\DBD\system_locale_string::NAME_PG.' (id, category) VALUES ($1, $2);',
//mys
'INSERT INTO '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' (id, category) VALUES (?, ?);'
'INSERT INTO '.\SYSTEM\DBD\system_text::NAME_MYS.' (`id`, `language`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES (?,?,?,?,?,?,?) ON DUPLICATE ;'
);}}

View File

@ -37,13 +37,8 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
}
$res = $con->query($query);
$entries = '';
$temparr = array();
while($r = $res->next()){
$temparr['id'] = $r['id'];
$temparr['text'] = $r['text'];
$temparr['author'] = $r['author'];
$temparr['language'] = $r['language'];
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/entry.tpl'), $temparr);
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/entry.tpl'), $r);
}
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/table.tpl'), array('entries' => $entries));
@ -79,7 +74,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
while($r = $res->next()){
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/entry.tpl'), $r);
}
return $entries;
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/table.tpl'), array('entries' => $entries));
} else {
return self::sai_mod__SYSTEM_SAI_saimod_sys_text_action_loadAll();
}
@ -104,7 +99,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/editor.tpl'), $vars);
}
public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_add($id, $category){
public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_save($id, $lang, $tags){
return \SYSTEM\DBD\SYS_SAIMOD_LOCALE_ADD::QI(array($id, $category)) ? \SYSTEM\LOG\JsonResult::ok() : \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no data added"));}
public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_delete($id){
@ -114,7 +109,8 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_LOCALE);}
//public static function css(){}
public static function css(){
return array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/css/saimod_sys_text.css'));}
public static function js(){
return array( // \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tinymce/tinymce.min.js'),
\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/js/saimod_sys_text.js'));}

View File

@ -1 +1,6 @@
<textarea id="texteditor" name="texteditor" style="width:100%">${content}</textarea>
<textarea id="texteditor" name="texteditor" style="width:100%">${content}</textarea>
<br><br>
<input type="text" placeholder="Tags..." />
<button id="btn_back" class="btn" onClick="system.load('text');" style="margin-right: 15px; height: 32px; font-size: 13px; float: left;">Back</button>
<button id="btn_add" class="btn-danger" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Delete</button>
<button id="btn_add" class="btn-success" style="margin-right: 15px; height: 32px; font-size: 13px; float: right;">Save</button>

View File

@ -2,4 +2,8 @@
<td>${id}</td>
<td class="contenttext">${text}</td>
<td class="contenttext">${author}</td>
<td class="contenttext">${author_edit}</td>
<td class="contenttext">${language}</td>
<td class="contenttext">${time_create}</td>
<td class="contenttext">${time_edit}</td>
</tr>

View File

@ -3,6 +3,10 @@
<th>id</th>
<th>Text</th>
<th>Author</th>
<th>author_edit</th>
<th>language</th>
<th>time_create</th>
<th>time_edit</th>
</tr>
${entries}
</table>