saimod text proto, updated system api calls
This commit is contained in:
parent
ffb0479165
commit
d56fead738
@ -104,8 +104,11 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (710, 42, 2, 700, 'singleload', 'id', 'ALL');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (711, 42, 2, 700, 'singleload', 'lang', 'ALL');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (712, 42, 2, 700, 'edittext', 'id', 'ALL');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (713, 42, 2, 700, 'loadByTag', 'lang', 'LANG');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (714, 42, 2, 700, 'edittext', 'lang', 'LANG');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (713, 42, 2, 700, 'edittext', 'lang', 'LANG');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (714, 42, 2, 700, 'loadByTag', 'lang', 'LANG');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (715, 42, 2, 700, 'editor', 'id', 'ALL');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (716, 42, 2, 700, 'editor', 'lang', 'LANG');
|
||||
|
||||
--
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (720, 42, 2, 700, 'delete', 'id', 'ALL');
|
||||
--
|
||||
|
||||
@ -37,9 +37,11 @@ INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`,
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (103, 42, 'user', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=user&username=${username}', 'init_saimod_sys_security_user', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (104, 42, 'newright', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright', 'init_saimod_sys_security_newright', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (105, 42, 'delright', 'security', 100, 0, 1, '#tab_security', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleterightconfirm&id=${id}', 'init_saimod_sys_security_delright', '\\SYSTEM\\SAI\\saimod_sys_security');
|
||||
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (110, 42, 'text', 'text', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text', 'init_saimod_sys_text', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (111, 42, 'tag', 'text', 110, 0, 1, '#tab_content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=tag&tag=${tag}', 'init_saimod_sys_text_tag', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (112, 42, 'edittext', 'text', 110, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=edittext&id=${id}&lang=${lang}', 'init_saimod_sys_text_edit', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (111, 42, 'tag', 'text', 110, 0, 0, '#tab_content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=tag&tag=${tag}', 'init_saimod_sys_text_tag', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (115, 42, 'edittext', 'text', 110, 0, 1, '#tab_content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=edittext&id=${id}&lang=${lang}', 'init_saimod_sys_text_edittext', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (116, 42, 'editor', 'text', 115, 0, 0, '#tab_editor', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=editor&id=${id}&lang=${lang}', 'init_saimod_sys_text_editor', '\\SYSTEM\\SAI\\saimod_sys_text');
|
||||
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (120, 42, 'todo', 'todo', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo', 'init_saimod_sys_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (121, 42, 'todolist', 'todo', 120, 0, 0, '#tab_todo', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todolist', 'init_saimod_sys_todo_todo', '\\SYSTEM\\SAI\\saimod_sys_todo');
|
||||
|
||||
@ -1,267 +1,40 @@
|
||||
/*
|
||||
*
|
||||
* @type ModuleText
|
||||
* Object to manage text-modul data
|
||||
*
|
||||
* copyright - WebCraft Media GbR
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function init_saimod_sys_text() {
|
||||
|
||||
//angularModule();
|
||||
/*
|
||||
init_tinymce();
|
||||
$('#addtext').show();
|
||||
if(!cData.lang && !cData.group) {
|
||||
cData.group = $('.groups').first().attr('id');
|
||||
cData.lang = $('.langli').first().attr('id');
|
||||
$('#langtabs_ li#'+cData.lang).addClass('active');
|
||||
$('#'+cData.group).addClass('active');
|
||||
$('#'+cData.lang).addClass('active');
|
||||
saimod_sys_text_loadcontent(cData.lang, cData.group);
|
||||
}
|
||||
|
||||
$('.content_add').click(function(){
|
||||
saimod_sys_text_newtext();});
|
||||
|
||||
$('#edit_close').click(function(){
|
||||
$('#addtext').show();
|
||||
cData.editmode = false;});
|
||||
|
||||
$('#newtext').click(function(){
|
||||
$('#addtext').show();
|
||||
saimod_sys_text_savenewcontent();
|
||||
$('#new_text_id_input').val('');
|
||||
$('#new_category_id_input').val('');
|
||||
cData.editmode = false;});
|
||||
|
||||
$('.groups').click(function(){
|
||||
if (cData.group){
|
||||
$('#'+cData.group).removeClass('active');}
|
||||
if (cData.group && cData.lang && (cData.group !== $(this).attr('id'))){
|
||||
cData.group = $(this).attr('id');
|
||||
saimod_sys_text_loadcontent(cData.lang, cData.group);}
|
||||
cData.group = $(this).attr('id');
|
||||
$(this).addClass('active');
|
||||
});
|
||||
$('#langtabs_').click(function(){
|
||||
cData.editmode = true;
|
||||
$('#tabs_text a').click(function (e) {
|
||||
$('#tabs_text li').each(function(){
|
||||
$(this).removeClass('active');});
|
||||
$(this).parent().addClass('active');
|
||||
});
|
||||
$('.langli').click(function(){
|
||||
console.log(cData.editmode);
|
||||
if (cData.group && cData.lang){
|
||||
$('#langtabs_ li#'+cData.lang).removeClass('active');
|
||||
$('#'+cData.lang).removeClass('active');}
|
||||
cData.lang = $(this).attr('id');
|
||||
$('#langtabs_ li#'+cData.lang).addClass('active');
|
||||
$('#'+cData.lang).addClass('active');
|
||||
saimod_sys_text_loadcontent(cData.lang, cData.group);
|
||||
if (cData.editmode === true){
|
||||
console.log("now i am true");
|
||||
saimod_sys_text_loadsinglecontent(cData.id, cData.lang);
|
||||
}});
|
||||
|
||||
$('#changetext').click(function(){
|
||||
saimod_sys_text_savecontent(cData.id, cData.lang);});
|
||||
|
||||
$('#del_text').click(function(){
|
||||
saimod_sys_text_delete($('#modaltitle').html());
|
||||
cData.editmode = false;});
|
||||
$(document).keyup(function(e) {
|
||||
if (e.keyCode === 27) { $('#addtext').show(); } // esc
|
||||
});
|
||||
//tiny mce modal fix
|
||||
$(document).on('focusin', function(e) {
|
||||
if ($(e.target).closest(".mce-window").length) {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}); */
|
||||
text_menu();
|
||||
}
|
||||
|
||||
function init_saimod_sys_text_test(){
|
||||
console.log(moduleText);
|
||||
};
|
||||
|
||||
ModuleText = function(){};
|
||||
|
||||
ModuleText.prototype.init = function(){
|
||||
//this.getTextsByTag("bla", "deDE");
|
||||
};
|
||||
ModuleText.prototype.getTexts = function(lang){
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'load',
|
||||
language: lang},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
$('#tab_content').html(data);
|
||||
//$('#tab'+lang).addClass('active');
|
||||
}});
|
||||
};
|
||||
ModuleText.prototype.getText = function(id, lang){
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'singleload',
|
||||
id: id,
|
||||
language: lang},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
console.log("success");
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
ModuleText.prototype.getTextsByTag = function(tag, lang){
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'loadByTag',
|
||||
tag: tag,
|
||||
language: lang},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
$('#tab_content').html(data);
|
||||
}});
|
||||
};
|
||||
ModuleText.prototype.updateText = function(){};
|
||||
ModuleText.prototype.deleteText = function(){};
|
||||
ModuleText.prototype.saveText = function(){};
|
||||
ModuleText.prototype.apiMenu = function(){
|
||||
$('#texttabs li').each(function(){
|
||||
function text_menu(){
|
||||
$('#tabs_text li').each(function(){
|
||||
$(this).removeClass('active');});
|
||||
if($('saimod_text_tagtab_'+system.cur_state().split('.')[1]).length){
|
||||
$('#saimod_text_tagtab_'+system.cur_state().split('.')[1]).parent().addClass('active');
|
||||
if(system.cur_state().split('.')[1]){
|
||||
$('#menu_tag_'+system.cur_state().split(';')[1].split('.')[1]).parent().addClass('active');
|
||||
} else {
|
||||
$('#menu_all').parent().addClass('active');}
|
||||
$('#menu_tag_all').parent().addClass('active');}
|
||||
};
|
||||
|
||||
var moduleText = new ModuleText();
|
||||
function text2_menu(){
|
||||
$('#tabs2_text li').each(function(){
|
||||
$(this).removeClass('active');});
|
||||
if($('#menu_lang_'+system.cur_state().split('.')[2]).length){
|
||||
$('#menu_lang_'+system.cur_state().split('.')[2]).parent().addClass('active');
|
||||
} else {
|
||||
$('.menu_lang_default').parent().addClass('active');}
|
||||
};
|
||||
|
||||
function saimod_sys_text_newtext(){
|
||||
cData.editmode = true;
|
||||
$('#modaltitle').hide();
|
||||
$('#modaltextarea').hide();
|
||||
$('#del_text').hide();
|
||||
$('#addtext').hide();
|
||||
//call not available - check
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'newtext'},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
$('#contenttextarea').text('');
|
||||
$('#new_category_id input').attr('value', cData.group);
|
||||
$('#new_category_id').show();
|
||||
$('#new_text_id').show();
|
||||
$('#newtext').show();
|
||||
$('#changetext').hide();
|
||||
$('#newcontenttextarea').hide();
|
||||
$('#modal_main').modal('show');
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_saimod_sys_text_tag(){
|
||||
text_menu();
|
||||
text2_menu();
|
||||
};
|
||||
|
||||
function saimod_sys_text_savecontent(id, lang){
|
||||
tinyMCE.triggerSave();
|
||||
newtext = $('#contenttextarea').val();
|
||||
newgroup = $('#new_category_id_input').val();
|
||||
console.log($('#new_category_id_input'));
|
||||
console.log(newgroup);
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'edit',
|
||||
id: id,
|
||||
lang: lang,
|
||||
category: cData.group,
|
||||
newtext: newtext},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
if (data.status == false){
|
||||
$('#modal_success').hide();
|
||||
$('#modal_fail').show();
|
||||
} else {
|
||||
$('#modal_fail').hide();
|
||||
$('#modal_success').show();
|
||||
saimod_sys_text_loadcontent(cData.lang,cData.group);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saimod_sys_text_savenewcontent(){
|
||||
tinyMCE.triggerSave();
|
||||
id = $('#new_text_id_input').val();
|
||||
cData.group = $('#new_category_id_input').val();
|
||||
console.log("id: "+id);
|
||||
console.log("category: "+cData.group);
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'add',
|
||||
id: id,
|
||||
category: cData.group},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
saimod_sys_text_loadcontent(cData.lang,cData.group);
|
||||
saimod_sys_text_loadsinglecontent(id, cData.lang);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saimod_sys_text_loadsinglecontent(id, lang){
|
||||
$('#new_text_id').hide();
|
||||
$('#new_category_id').hide();
|
||||
$('#newtext').hide();
|
||||
$('#modaltextarea').show();
|
||||
$('#changetext').show();
|
||||
$('#del_text').show();
|
||||
init_tinymce();
|
||||
|
||||
$.ajax({
|
||||
url: 'sai.php',
|
||||
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_text',
|
||||
action: 'singleload',
|
||||
id: id,
|
||||
lang: lang},
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
init_tinymce();
|
||||
tinyMCE.activeEditor.setContent(data);
|
||||
$('#modal_success').hide();
|
||||
$('#modal_fail').hide();
|
||||
$('#modaltitle').html(id);
|
||||
$('#modaltitle').show();
|
||||
cData.id = id;
|
||||
$('#modal_main').modal('show');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saimod_sys_text_loadcontent(id, group){
|
||||
cData.editmode = true;
|
||||
$('#tab-content').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=load&id='+id+'&group='+group, function(){
|
||||
$('.tableentry').click(function(){
|
||||
cData.editmode = true;
|
||||
saimod_sys_text_loadsinglecontent($(this).attr('text_id'), cData.lang);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function saimod_sys_text_delete(buttonID){
|
||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_text&action=delete&id='+buttonID,
|
||||
function(data){if (data.status == false){ alert("Failed to delete text!"); } else {
|
||||
alert("Text deleted!");
|
||||
saimod_sys_text_loadcontent(cData.lang,cData.group);}});
|
||||
|
||||
saimod_sys_text_loadcontent(cData.lang,cData.group);
|
||||
$('#modal_main').modal('hide');
|
||||
}
|
||||
function init_saimod_sys_text_editor(){
|
||||
text_menu();
|
||||
text2_menu();
|
||||
init_tinymce();
|
||||
};
|
||||
|
||||
function init_tinymce(){
|
||||
tinymce.init({ // General options
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace SYSTEM\DBD;
|
||||
|
||||
class SYS_SAIMOD_TEXT_GETTEXT_LANG extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
"SELECT * FROM system_text WHERE id = ? AND language = ?"
|
||||
);}}
|
||||
@ -10,12 +10,8 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
|
||||
$vars = array();
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_LOCALE_TAGS::QQ();
|
||||
$vars['tabopts'] = '';
|
||||
$first = true;
|
||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/tabopt.tpl'), array( 'active' => ($first ? 'active' : ''), 'tag' => 'All'));
|
||||
while($r = $res->next()){
|
||||
$vars2 = array( 'active' => ($first ? 'active' : ''),
|
||||
'tag' => $r['tag']);
|
||||
$first = false;
|
||||
$vars2 = array('tag' => $r['tag']);
|
||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/tabopt.tpl'), $vars2);
|
||||
}
|
||||
$langtab_ = '';
|
||||
@ -38,12 +34,10 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
|
||||
//$query = 'SELECT id, "'.$lang.'" FROM '.\SYSTEM\DBD\system_locale_string::NAME_PG.' WHERE category='.$group.' ORDER BY category ASC;';
|
||||
} else {
|
||||
$query = 'SELECT * FROM system_text;';
|
||||
new \SYSTEM\LOG\WARNING($query);
|
||||
}
|
||||
$res = $con->query($query);
|
||||
$entries = '';
|
||||
$temparr = array();
|
||||
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/table_start.tpl'), array());
|
||||
while($r = $res->next()){
|
||||
$temparr['id'] = $r['id'];
|
||||
$temparr['text'] = $r['text'];
|
||||
@ -51,8 +45,8 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
|
||||
$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/table_end.tpl'), array());
|
||||
return $entries;
|
||||
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/table.tpl'), array('entries' => $entries));
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_loadByTag($tag, $lang){
|
||||
@ -92,14 +86,22 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_edittext($id, $lang){
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
$result = "";
|
||||
$entries = '';
|
||||
$res = \SYSTEM\DBD\SYS_SAIMOD_TEXT_GETTEXT::QQ(array($id));
|
||||
while($r = $res->next()){
|
||||
$entries .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/edit.tpl'), $r);
|
||||
$langs = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
|
||||
$vars = array();
|
||||
$vars['tabopts'] = '';
|
||||
foreach($langs as $l){
|
||||
$vars2 = array( 'id' => $id,
|
||||
'lang' => $l,
|
||||
'default' => $l == $lang ? 'menu_lang_default' : '');
|
||||
$vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/tabopt2.tpl'), $vars2);
|
||||
}
|
||||
return $entries;
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_text/tpl/edit.tpl'), $vars);
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_text_action_editor($id, $lang){
|
||||
$vars = array();
|
||||
$vars['content'] = \SYSTEM\DBD\SYS_SAIMOD_TEXT_GETTEXT_LANG::Q1(array($id, $lang))['text'];
|
||||
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){
|
||||
|
||||
@ -1,21 +1,8 @@
|
||||
<h4>Texteditor</h4>
|
||||
<hr>
|
||||
<div class="tabbable">
|
||||
<div class="panel panel-default">
|
||||
<ul class="nav nav-tabs" id="langtabs_">
|
||||
${langs}
|
||||
</ul>
|
||||
<div class="panel-body">
|
||||
<input type="text" value="${title}" />
|
||||
<textarea id="contenttextarea" name="content" style="width:100%">${text}</textarea>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button type="button" id="del_text" class="btn-small btn-danger" style="float: left;">Delete</button>
|
||||
<button type="button" class="btn" data-dismiss="modal" id="edit_close">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="changetext">Save changes</button>
|
||||
<button type="button" class="btn btn-primary" id="newtext" style="display: none;">Save new text</button>
|
||||
</div>
|
||||
<div class="tabbable tabs-left" id="tabs2_text">
|
||||
<ul class="nav nav-tabs">
|
||||
${tabopts}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_editor"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
1
sai/modules/saimod_sys_text/tpl/editor.tpl
Normal file
1
sai/modules/saimod_sys_text/tpl/editor.tpl
Normal file
@ -0,0 +1 @@
|
||||
<textarea id="texteditor" name="texteditor" style="width:100%">${content}</textarea>
|
||||
@ -1,15 +1,12 @@
|
||||
<div class="saimodule_container">
|
||||
<h4>Texts</h4>
|
||||
<h4>System Texts</h4>
|
||||
<hr>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="texttabs">
|
||||
<li><a href="#!text" id="menu_all">All</a></li>
|
||||
<ul class="nav nav-tabs" id="tabs_text">
|
||||
<li><a href="#!text" id="menu_tag_all">All</a></li>
|
||||
${tabopts}
|
||||
<input type="submit" value="Add" class="btn-small btn-success content_add" style="margin-left: 15px;">
|
||||
<input type="submit" value="Add" class="btn-small btn-success content_add" style="margin-left: 15px; float: right;">
|
||||
</ul>
|
||||
<div class="tab-content" id="tab_content">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="tab-content" id="tab_content"></div>
|
||||
</div>
|
||||
</div>
|
||||
8
sai/modules/saimod_sys_text/tpl/table.tpl
Normal file
8
sai/modules/saimod_sys_text/tpl/table.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<table class="sai_table table table-hover table-condensed" style="overflow: auto;">
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>Text</th>
|
||||
<th>Author</th>
|
||||
</tr>
|
||||
${entries}
|
||||
</table>
|
||||
@ -1 +0,0 @@
|
||||
</table>
|
||||
@ -1 +0,0 @@
|
||||
<table class="sai_table">
|
||||
@ -1 +1 @@
|
||||
<li><a href="#!text;tag.${tag}" id="saimod_text_tagtab_${tag}">Tag ${tag}</a></li>
|
||||
<li><a href="#!text;tag.${tag}" id="menu_tag_${tag}">${tag}</a></li>
|
||||
1
sai/modules/saimod_sys_text/tpl/tabopt2.tpl
Normal file
1
sai/modules/saimod_sys_text/tpl/tabopt2.tpl
Normal file
@ -0,0 +1 @@
|
||||
<li><a href="#!text(edittext);id.${id};lang.${lang}" class="${default}" id="menu_lang_${lang}">${lang}</a></li>
|
||||
@ -1,49 +0,0 @@
|
||||
<h4>Texts</h4>
|
||||
<hr>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="localetab">
|
||||
${tabopts}
|
||||
<input type="submit" value="Add" class="btn-small btn-success content_add" style="margin-left: 15px;">
|
||||
</ul>
|
||||
<div class="tab-content" id="tab_content">
|
||||
${tabs}
|
||||
</div>
|
||||
</div>
|
||||
<div id="editfield">
|
||||
<div class="modal fade" id="modal_main" style="width: 700px;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="modaltitle">${id}</h4>
|
||||
<div id="new_category_id" style="display: none;">
|
||||
<h5>Category ID</h5>
|
||||
<input id="new_category_id_input" type="text" placeholder="New category ID here..."/>
|
||||
</div>
|
||||
<div id="new_text_id" style="display: none;">
|
||||
<h5>Text ID</h5>
|
||||
<input id="new_text_id_input" type="text" placeholder="New text ID here..."/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="addtext" style="display: none;">
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="langtabs_">
|
||||
${langs}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-body" id="modaltextarea" style="display: none;">
|
||||
<textarea id="contenttextarea" name="content" style="width:100%"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div id="modal_success" style="display: none;"><font color="green">Changes have been saved!</font></div>
|
||||
<div id="modal_fail" style="display: none;"><font color="red">Changes could not be saved!</font></div>
|
||||
<Button type="button" id="del_text" class="btn-small btn-danger" style="float: left;">Delete</button>
|
||||
<button type="button" class="btn" data-dismiss="modal" id="edit_close">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="changetext">Save changes</button>
|
||||
<button type="button" class="btn btn-primary" id="newtext" style="display: none;">Save new text</button>
|
||||
</div>
|
||||
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user