edited some stuff for the text editing mode
This commit is contained in:
parent
49160476fb
commit
bc2bf60d11
@ -21,12 +21,16 @@ if (get_magic_quotes_gpc()) $_POST = array_map('stripslashes', $_POST);
|
||||
$subject = isset($_POST['subject']) ? $_POST['subject'] : 'Subject';
|
||||
$message = isset($_POST['message']) ? $_POST['message'] : 'Message';
|
||||
|
||||
$test = \SYSTEM\SECURITY\Security::load("site_content");
|
||||
|
||||
print_r($test);
|
||||
|
||||
?>
|
||||
|
||||
<form action="demo.php" method="post">
|
||||
<form action="http://www.mojotrollz.eu/web/system/sai/modules/saimod_sys_locale/wysiwyg/demo.php" method="post">
|
||||
<table>
|
||||
<tr><td><input type="text" name="subject" value="<?=htmlspecialchars($subject);?>" /></td></tr>
|
||||
<tr><td><?php echo wysiwyg('wysiwyg_id', 'message', $message); ?></td></tr>
|
||||
<tr><td><?php echo wysiwyg('wysiwyg_id', 'message', $test); ?></td></tr>
|
||||
<tr><td><input type="submit" value="Submit" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@ -1,15 +1,25 @@
|
||||
<?php
|
||||
namespace SYSTEM\SAI;
|
||||
|
||||
class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
||||
class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
||||
|
||||
const INPUT_VAR = 'sai_input';
|
||||
|
||||
public static function getLanguages(){
|
||||
return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
|
||||
}
|
||||
|
||||
public static function html_content(){
|
||||
$entries = array_merge($_POST,$_GET);
|
||||
if(isset($entries[self::INPUT_VAR])){
|
||||
return self::html_content_entry_edit($entries[self::INPUT_VAR]);
|
||||
}
|
||||
return self::html_content_table();
|
||||
}
|
||||
|
||||
public static function html_content_table(){
|
||||
$result = '<h3>Locale String</h3>'.
|
||||
'<form action="http://www.mojotrollz.eu/danube/system/sai/modules/saimod_sys_locale/edit.php"><table class="table table-hover table-condensed" style="overflow: auto;">'.
|
||||
'<table class="table table-hover table-condensed" style="overflow: auto;">'.
|
||||
'<tr>'.'<th>'.'ID'.'</th>'.'<th>'.'Category'.'</th>';
|
||||
|
||||
foreach (self::getLanguages() as $lang){
|
||||
@ -25,21 +35,47 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
||||
} else {
|
||||
$res = $con->query('SELECT * FROM system_locale_string ORDER BY category ASC;');
|
||||
}
|
||||
|
||||
while($r = $res->next()){
|
||||
$result .= '<tr>'.'<td>'.$r["id"].'<br><input type="submit" class="btn-danger" value="delete" delete_ID="'.$r["id"].'">'.'</td>'.'<td>'.$r["category"].'</td>';
|
||||
foreach ($languages as $columns){
|
||||
$result .= '<td>'.$r[$columns].'<br><input type="submit" subject="testsubject" message="testmessage" class="btn" value="edit" lang="'.$columns.'" edit_ID="'.$r["id"].'">'.'</td>';
|
||||
//echo "+tututututututut:".$r[$columns]."nochmal tututututututut";
|
||||
$result .= '<td>'.$r[$columns].'<br><input type="submit" class="btn" value="edit" lang="'.$columns.'" name="'.$r["id"].'" onclick="javascript:init__SYSTEM_SAI_saimod_sys_locale();">'.'</td>';
|
||||
//$_POST[$r["id"]] = $r[$columns];
|
||||
}
|
||||
|
||||
$result .= '</tr>';
|
||||
|
||||
}
|
||||
|
||||
$result .= '</table></form>';
|
||||
$result .= '</table>';
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
public static function html_content_entry_edit($entry){
|
||||
$result =
|
||||
'<h3>'.$entry.'</h3>'.
|
||||
'<table class="table table-hover table-condensed" style="overflow: auto;">'.
|
||||
'<tr>';
|
||||
|
||||
foreach (self::getLanguages() as $lang){
|
||||
$result .= '<th>'.$lang.'</th>';
|
||||
$languages[] = $lang;
|
||||
}
|
||||
|
||||
$result .= '</tr>';
|
||||
|
||||
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
|
||||
$res = $con->prepare('edit', 'SELECT * FROM system_locale_string WHERE id=? ORDER BY "category" ASC;', array($entry));
|
||||
while($r = $res->next()){
|
||||
$result .= "<tr>";
|
||||
foreach ($languages as $columns){
|
||||
//echo "+tututututututut:".$r[$columns]."nochmal tututututututut";
|
||||
$result .= '<td><input type="textarea" value="'.$r[$columns].'"><br><input type="submit" class="btn" value="edit" lang="'.$columns.'" name="'.$r["id"].'" onclick="javascript:init__SYSTEM_SAI_saimod_sys_locale();"><br></td>';
|
||||
//$_POST[$r["id"]] = $r[$columns];
|
||||
}
|
||||
$result .= "</tr>";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function html_li_menu(){return '<li><a href="#" id=".SYSTEM.SAI.saimod_sys_locale">DB Text</a></li>';}
|
||||
public static function right_public(){return false;}
|
||||
|
||||
@ -1,3 +1,14 @@
|
||||
function init__SYSTEM_SAI_saimod_sys_locale() {
|
||||
//alert("huhu");
|
||||
// handle navigation link click
|
||||
$('.btn').click(function () {
|
||||
//loadEntry($(this).attr('url'));
|
||||
loadEntry($(this).attr('name'));
|
||||
//loadUrlPic($(this).attr('url'));
|
||||
});
|
||||
}
|
||||
|
||||
function loadEntry(buttonID) {
|
||||
$('div#content-wrapper').load('./?action=developer&sai_mod=.SYSTEM.SAI.saimod_sys_locale&sai_input='+buttonID, function(){
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
|
||||
<?php $wysiwyg_root = 'wysiwyg/'; include 'wysiwyg/php/init.php'; ?>
|
||||
<?php $wysiwyg_root = 'wysiwyg/'; include 'http://www.mojotrollz.eu/web/system/sai/modules/saimod_sys_locale/wysiwyg/php/init.php'; ?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user