handle empty or nulled content
Dieser Commit ist enthalten in:
Ursprung
606f48500f
Commit
fc6ea7746d
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
|
@ -31,13 +32,13 @@
|
|||
* }}
|
||||
*
|
||||
*/
|
||||
if(!defined('CON_FRAMEWORK')) {
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
// include editor config/combat file
|
||||
include (dirname(__FILE__).DIRECTORY_SEPARATOR."config.php"); // CONTENIDO
|
||||
include (dirname(__FILE__) . DIRECTORY_SEPARATOR . "config.php"); // CONTENIDO
|
||||
cInclude("external", "wysiwyg/tinymce3/editorclass.php");
|
||||
|
||||
// name of textarea element
|
||||
|
@ -53,25 +54,22 @@ if ($a_content[$type][$typenr]) {
|
|||
// if not set it is possible to use available content from var $editor_content
|
||||
}
|
||||
|
||||
$editor_content = clHtmlSpecialChars($editor_content);
|
||||
$editor_content = is_null($editor_content) ? '' : clHtmlSpecialChars($editor_content);
|
||||
|
||||
$cTinyMCEEditor = new cTinyMCEEditor($editor_name, $editor_content);
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
switch ($type) {
|
||||
case "CMS_HTML":
|
||||
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-html", false);
|
||||
|
||||
if ($editor_height == false)
|
||||
{
|
||||
if ($editor_height == false) {
|
||||
$editor_height = getEffectiveSetting("tinymce", "contenido_height_html", false);
|
||||
}
|
||||
break;
|
||||
case "CMS_HTMLHEAD":
|
||||
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height-head", false);
|
||||
|
||||
if ($editor_height == false)
|
||||
{
|
||||
if ($editor_height == false) {
|
||||
$editor_height = getEffectiveSetting("tinymce", "contenido_height_head", false);
|
||||
}
|
||||
break;
|
||||
|
@ -79,24 +77,22 @@ switch ($type)
|
|||
$editor_height = false;
|
||||
}
|
||||
|
||||
if ($editor_height !== false)
|
||||
{
|
||||
if ($editor_height !== false) {
|
||||
$cTinyMCEEditor->setSetting("height", $editor_height, true);
|
||||
}
|
||||
|
||||
/*
|
||||
TODO:
|
||||
TODO:
|
||||
|
||||
-> see editor_template.js
|
||||
-> create own theme template engine
|
||||
-> maybe change the way icons are displayed
|
||||
*/
|
||||
-> see editor_template.js
|
||||
-> create own theme template engine
|
||||
-> maybe change the way icons are displayed
|
||||
*/
|
||||
|
||||
$currentuser = new User;
|
||||
$currentuser->loadUserByUserID($auth->auth["uid"]);
|
||||
|
||||
if ($currentuser->getField("wysi") == 1)
|
||||
{
|
||||
if ($currentuser->getField("wysi") == 1) {
|
||||
echo $cTinyMCEEditor->getScripts();
|
||||
echo $cTinyMCEEditor->getEditor();
|
||||
} else {
|
||||
|
@ -107,7 +103,7 @@ if ($currentuser->getField("wysi") == 1)
|
|||
$editor_width = getEffectiveSetting("wysiwyg", "tinymce-width", "600");
|
||||
$editor_height = getEffectiveSetting("wysiwyg", "tinymce-height", "480");
|
||||
|
||||
$oTextarea->setStyle("width: ".$editor_width."px; height: ".$editor_height."px; background-color: ".$bgColor.";");
|
||||
$oTextarea->setStyle("width: " . $editor_width . "px; height: " . $editor_height . "px; background-color: " . $bgColor . ";");
|
||||
|
||||
echo $oTextarea->render();
|
||||
}
|
||||
|
|
Laden…
In neuem Issue referenzieren