fixes for editor encoding etc
This commit is contained in:
parent
7cd4291271
commit
efe6c102a8
@ -29,9 +29,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
|||||||
while($r = $res->next()){
|
while($r = $res->next()){
|
||||||
$result .= '<tr>'.'<td style="padding-bottom: 5px;">'.$r["id"].'<br><br><input type="submit" class="btn-danger delete_content" value="delete" id="'.$r["id"].'">'.'<input type="submit" class="btn" value="edit" style="margin-left: 3px;" name="'.$r["id"].'">'.'</td>'.'<td>'.$r["category"].'</td>';
|
$result .= '<tr>'.'<td style="padding-bottom: 5px;">'.$r["id"].'<br><br><input type="submit" class="btn-danger delete_content" value="delete" id="'.$r["id"].'">'.'<input type="submit" class="btn" value="edit" style="margin-left: 3px;" name="'.$r["id"].'">'.'</td>'.'<td>'.$r["category"].'</td>';
|
||||||
foreach ($languages as $columns){
|
foreach ($languages as $columns){
|
||||||
//echo "+tututututututut:".$r[$columns]."nochmal tututututututut";
|
$result .= '<td>'.$r[$columns].'</td>';
|
||||||
$result .= '<td>'.utf8_encode($r[$columns]).'</td>';
|
|
||||||
//$_POST[$r["id"]] = $r[$columns];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= '</tr>';
|
$result .= '</tr>';
|
||||||
@ -49,7 +47,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
|||||||
if(\SYSTEM\system::isSystemDbInfoPG()){
|
if(\SYSTEM\system::isSystemDbInfoPG()){
|
||||||
$res = $con->prepare('newText' ,'UPDATE system.locale_string SET "'.$lang.'"=$1 WHERE id=$2;', array($newtext, $id));
|
$res = $con->prepare('newText' ,'UPDATE system.locale_string SET "'.$lang.'"=$1 WHERE id=$2;', array($newtext, $id));
|
||||||
} else {
|
} else {
|
||||||
$res = $con->prepare('newText' ,'UPDATE system_locale_string SET '.$lang.'=? WHERE id=?;', array(utf8_decode($newtext), $id));
|
$res = $con->prepare('newText' ,'UPDATE system_locale_string SET '.$lang.'=? WHERE id=?;', array($newtext, $id));
|
||||||
}
|
}
|
||||||
return $res->affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no rows affected")) : \SYSTEM\LOG\JsonResult::ok();
|
return $res->affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no rows affected")) : \SYSTEM\LOG\JsonResult::ok();
|
||||||
}
|
}
|
||||||
@ -114,7 +112,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
|||||||
foreach ($languages as $columns){
|
foreach ($languages as $columns){
|
||||||
$result .= '<td>
|
$result .= '<td>
|
||||||
<div class="dialog" style="padding-bottom: 5px;">'.
|
<div class="dialog" style="padding-bottom: 5px;">'.
|
||||||
'<textarea name="content" class="tinymce" style="width: 100%" id="edit_field_'.$r["id"].'_'.$columns.'">'.utf8_encode($r[$columns]).'</textarea>'.
|
'<textarea name="content" class="tinymce" style="width: 100%" id="edit_field_'.$r["id"].'_'.$columns.'">'.$r[$columns].'</textarea>'.
|
||||||
'</div>
|
'</div>
|
||||||
<input type="submit" class="btn edit_content" value="edit" lang="'.$columns.'" name="'.$r["id"].'"><br></td>';
|
<input type="submit" class="btn edit_content" value="edit" lang="'.$columns.'" name="'.$r["id"].'"><br></td>';
|
||||||
}
|
}
|
||||||
@ -122,7 +120,8 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
|||||||
}
|
}
|
||||||
$result .= '<br><input type="submit" class="btn localeMain" value="back">'.'<script>tinymce.init({
|
$result .= '<br><input type="submit" class="btn localeMain" value="back">'.'<script>tinymce.init({
|
||||||
selector: "textarea",
|
selector: "textarea",
|
||||||
entity_encoding : "raw",
|
force_p_newlines : false,
|
||||||
|
forced_root_block : false,
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
||||||
plugins: [
|
plugins: [
|
||||||
"advlist autolink lists link image charmap print preview anchor",
|
"advlist autolink lists link image charmap print preview anchor",
|
||||||
@ -130,7 +129,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
|
|||||||
"insertdatetime media table contextmenu paste moxiemanager",
|
"insertdatetime media table contextmenu paste moxiemanager",
|
||||||
"textcolor"
|
"textcolor"
|
||||||
],
|
],
|
||||||
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"
|
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
|
||||||
});</script>';
|
});</script>';
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,17 @@ function init__SYSTEM_SAI_saimod_sys_locale_edit(){
|
|||||||
});
|
});
|
||||||
$('.edit_content').click(function(){
|
$('.edit_content').click(function(){
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
$.getJSON(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_locale&action=edit&id='+$(this).attr('name')+'&lang='+$(this).attr('lang')+'&newtext='+$('#edit_field_'+$(this).attr('name')+'_'+$(this).attr('lang')).val(),
|
$.ajax({
|
||||||
function(data){
|
url: SAI_ENDPOINT,
|
||||||
if (data.status == false){ alert("Changes could not be changed."); } else { alert("Changes has been saved.");}
|
data: { sai_mod: '.SYSTEM.SAI.saimod_sys_locale',
|
||||||
});
|
action: 'edit',
|
||||||
|
id: $(this).attr('name'),
|
||||||
|
lang: $(this).attr('lang'),
|
||||||
|
newtext: $('#edit_field_'+$(this).attr('name')+'_'+$(this).attr('lang')).val()},
|
||||||
|
type: 'POST',
|
||||||
|
success: function(data) {
|
||||||
|
if (data.status == false){ alert("Changes could not be changed."); } else { alert("Changes has been saved.");}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user