special characters now work in any contents

This commit is contained in:
messerbill 2013-09-29 15:42:07 +02:00
parent 9190846c82
commit 0822c5f9d2
2 changed files with 7 additions and 5 deletions

View File

@ -49,7 +49,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($newtext, $id)); $res = $con->prepare('newText' ,'UPDATE system_locale_string SET '.$lang.'=? WHERE id=?;', array(utf8_decode($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 +114,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.'">'.$r[$columns].'</textarea>'. '<textarea name="content" class="tinymce" style="width: 100%" id="edit_field_'.$r["id"].'_'.$columns.'">'.utf8_encode($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>';
} }
@ -123,12 +123,14 @@ 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", entity_encoding : "raw",
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",
"searchreplace visualblocks code fullscreen", "searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste moxiemanager" "insertdatetime media table contextmenu paste moxiemanager",
"textcolor"
], ],
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image" toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"
});</script>'; });</script>';
return $result; return $result;
} }

View File

@ -1,5 +1,5 @@
<div class="masthead"> <div class="masthead">
<h3 class="muted">Design.Simple.Fast.Reliable.Innovative.</h3> <h3 class="muted">Design. Simple. Fast. Reliable. Innovative.</h3>
<h4 class="text-info">We write awesome code and we use <a href="http://getbootstrap.com/">Twitter Bootstrap.</a></h4> <h4 class="text-info">We write awesome code and we use <a href="http://getbootstrap.com/">Twitter Bootstrap.</a></h4>
</div> </div>
<br> <br>