1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: cInclude('includes', 'functions.lang.php');
17:
18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43:
44: class cTinyMCEEditor extends cWYSIWYGEditor {
45:
46: 47: 48: 49: 50:
51: protected $_baseURL = '';
52:
53: 54: 55: 56: 57:
58: protected $_useGZIP = false;
59:
60:
61: 62: 63: 64: 65: 66:
67: public function __construct($editorName, $editorContent) {
68:
69: $belang = cRegistry::getBackendLanguage();
70: $cfgClient = cRegistry::getClientConfig();
71: $client = cRegistry::getClientId();
72: $lang = cRegistry::getLanguageId();
73: $idart = cRegistry::getArticleId();
74:
75: parent::__construct($editorName, $editorContent);
76:
77: $this->_setEditor("tinymce3");
78:
79:
80: $this->_aSettings = getEffectiveSettingsByType("tinymce");
81:
82:
83: $this->_aSettings = array_merge(getEffectiveSettingsByType("wysiwyg"), $this->_aSettings);
84:
85:
86: $this->setSetting(null, "article_url_suffix", 'front_content.php?idart=' . $idart, true);
87:
88:
89: $this->setSetting(null, "mode", "exact");
90: $aPathFragments = explode('/', $cfgClient[$client]["path"]["htmlpath"]);
91: $this->setSetting(null, "content_css", $cfgClient[$client]["path"]["htmlpath"] . "css/style_tiny.css");
92:
93: $this->setSetting(null, "theme", "advanced");
94: $this->setSetting(null, "theme_advanced_toolbar_location", "top");
95: $this->setSetting(null, "theme_advanced_path_location", "bottom");
96: $this->setSetting(null, "remove_script_host", false);
97: $this->setSetting(null, "file_browser_callback", "Con.Tiny.customFileBrowserCallback", true);
98:
99:
100: $this->setSetting(null, "theme_advanced_resizing", true);
101: $this->setSetting(null, "pagebreak_separator", "<!-- my page break -->");
102:
103: $this->setSetting(null, "apply_source_formatting", true);
104: $this->setSetting(null, "remove_linebreaks", false);
105:
106:
107: $this->setSetting(null, "convert_urls", false);
108: $this->setSetting(null, "relative_urls", false);
109:
110:
111: $this->setSetting(null, "elements", $editorName);
112:
113:
114: $langs = i18nGetAvailableLanguages();
115: $this->setSetting(null, "language", $langs[$belang][4]);
116: unset($langs);
117:
118:
119: $this->setSetting(null, 'document_base_url', cRegistry::getFrontendUrl(), true);
120:
121:
122:
123:
124: $this->setBaseURL($this->_getEditorPath());
125:
126:
127: if (getEffectiveSetting("generator", "xhtml", false) == "true") {
128: $this->setXHTMLMode(true);
129: } else {
130: $this->setXHTMLMode(false);
131: }
132:
133:
134: if ($this->_aSettings["contenido_gzip"] == "true") {
135: $this->setGZIPMode(true);
136: } else {
137: $this->setGZIPMode(false);
138: }
139:
140:
141: if (!array_key_exists("content_css", $this->_aSettings) && array_key_exists("tinymce-stylesheet-file", $this->_aSettings)) {
142: $this->setSetting(null, "content_css", $this->_aSettings["tinymce-stylesheet-file"], true);
143: }
144:
145:
146: $this->setLists();
147:
148:
149: $this->setUserDefinedStyles();
150:
151:
152: $this->setSetting(null, "width", "100%");
153: $this->setSetting(null, "height", "480px");
154:
155:
156: $sDirection = langGetTextDirection($lang);
157: $this->setSetting(null, "directionality", $sDirection);
158:
159: if ($sDirection == "rtl") {
160: $this->setSetting(null, "theme_advanced_toolbar_align", "right", true);
161: } else {
162: $this->setSetting(null, "theme_advanced_toolbar_align", "left", true);
163: }
164:
165:
166: $this->setSetting(null, "plugin_insertdate_dateFormat", $this->convertFormat(getEffectiveSetting("dateformat", "date", "Y-m-d")));
167: $this->setSetting(null, "plugin_insertdate_timeFormat", $this->convertFormat(getEffectiveSetting("dateformat", "time", "H:i:s")));
168:
169:
170: $mode = "full";
171: if (array_key_exists("tinymce-toolbar-mode", $this->_aSettings)) {
172: $mode = $this->_aSettings["tinymce-toolbar-mode"];
173: }
174: if (array_key_exists("contenido_toolbar_mode", $this->_aSettings)) {
175: $mode = $this->_aSettings["contenido_toolbar_mode"];
176: }
177: $this->setToolbar(trim(strtolower($mode)));
178:
179: $autoFullElements = $this->_aSettings['auto_full_elements'];
180: unset($this->_aSettings['auto_full_elements']);
181:
182:
183: if (!array_key_exists("valid_elements", $this->_aSettings) && array_key_exists("tinymce-valid-elements", $this->_aSettings)) {
184: $this->setSetting(null, "valid_elements", $this->_aSettings["tinymce-valid-elements"], true);
185: }
186:
187:
188: if ($autoFullElements === 'true') {
189: $this->setSetting(null, 'valid_elements', '*[*]');
190: $this->setSetting(null, 'extended_valid_elements', '*[*]');
191: }
192:
193: $this->setSetting(null, "valid_elements", "a[name|href|target|title],strong/b[class],em/i[class],strike[class],u[class],p[dir|class|align],ol,ul,li,br,img[class|src|border=0|alt|title|hspace|vspace|width|height|align],sub,sup,blockquote[dir|style],table[border=0|cellspacing|cellpadding|width|height|class|align|style],tr[class|rowspan|width|height|align|valign|style],td[dir|class|colspan|rowspan|width|height|align|valign|style],div[dir|class|align],span[class|align],pre[class|align],address[class|align],h1[dir|class|align],h2[dir|class|align],h3[dir|class|align],h4[dir|class|align],h5[dir|class|align],h6[dir|class|align],hr");
194:
195:
196: if (!array_key_exists("extended_valid_elements", $this->_aSettings) && array_key_exists("tinymce-extended-valid-elements", $this->_aSettings)) {
197: $this->setSetting(null, "extended_valid_elements", $this->_aSettings["tinymce-extended-valid-elements"]);
198: }
199:
200:
201:
202:
203: $this->setSetting(null, "extended_valid_elements", "form[name|action|method],textarea[name|style|cols|rows],input[type|name|value|style|onclick],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]");
204:
205:
206: $this->cleanURLs();
207:
208:
209: unset($this->_aSettings["contenido_toolbar_mode"], $this->_aSettings["contenido_lists"]);
210:
211: unset($this->_aSettings["tinymce-stylesheet-file"], $this->_aSettings["tinymce-valid-elements"], $this->_aSettings["tinymce-extended-valid-elements"], $this->_aSettings["tinymce-lists"], $this->_aSettings["tinymce-styles"], $this->_aSettings["tinymce-toolbar-mode"], $this->_aSettings["tinymce-toolbar1"], $this->_aSettings["tinymce-toolbar2"], $this->_aSettings["tinymce-toolbar3"], $this->_aSettings["tinymce-plugins"]);
212: }
213:
214: 215: 216: 217: 218: 219: 220: 221: 222:
223: public function cTinyMCEEditor($editorName, $editorContent) {
224: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
225: return $this->__construct($editorName, $editorContent);
226: }
227:
228: 229: 230: 231: 232: 233:
234: public function convertFormat($input) {
235: $aFormatCodes = array(
236: "y" => "%y", "Y" => "%Y", "d" => "%d", "m" => "%m", "H" => "%H", "h" => "%I", "i" => "%M", "s" => "%S", "a" => "%P", "A" => "%P"
237: );
238:
239: foreach ($aFormatCodes as $sFormatCode => $sReplacement) {
240: $input = str_replace($sFormatCode, $sReplacement, $input);
241: }
242:
243: return $input;
244: }
245:
246: 247: 248: 249:
250: public function setUserDefinedStyles() {
251: $styles = "";
252:
253: if (array_key_exists("theme_advanced_styles", $this->_aSettings)) {
254: $styles = $this->_aSettings["theme_advanced_styles"];
255: } else if (array_key_exists("tinymce-styles", $this->_aSettings)) {
256: $styles = $this->_aSettings["tinymce-styles"];
257: }
258:
259: if ($styles) {
260: $this->setSetting(null, "theme_advanced_styles", preg_replace('/;$/i', '', str_replace("|", "=", trim($styles))), true);
261: }
262: }
263:
264: 265: 266: 267: 268: 269: 270:
271: public function setLists($lists = "") {
272:
273: $lang = cRegistry::getLanguageId();
274: $client = cRegistry::getClientId();
275:
276: if ($lists == "") {
277: if (array_key_exists("contenido_lists", $this->_aSettings)) {
278: $lists = $this->_aSettings["contenido_lists"];
279: } else if (array_key_exists("tinymce-lists", $this->_aSettings)) {
280: $lists = $this->_aSettings["tinymce-lists"];
281: }
282: }
283:
284: $aLists = array();
285: $aLists = explode(",", strtolower(str_replace(" ", "", $lists)));
286:
287: if (in_array("link", $aLists)) {
288: $this->setSetting(null, "external_link_list_url", $this->_baseURL . "list.php?mode=link&lang=" . $lang . "&client=" . $client . "#", true);
289: }
290: if (in_array("image", $aLists)) {
291: $this->setSetting(null, "external_image_list_url", $this->_baseURL . "list.php?mode=image&lang=" . $lang . "&client=" . $client . "#", true);
292: }
293: if (in_array("media", $aLists)) {
294: $this->setSetting(null, "media_external_list_url", $this->_baseURL . "list.php?mode=media&lang=" . $lang . "&client=" . $client . "#", true);
295: }
296: }
297:
298: 299: 300: 301: 302: 303:
304: public function setXHTMLMode($beabled = true) {
305: if ($beabled) {
306: $this->setSetting(null, "cleanup_callback", "", true);
307: } else {
308: $this->setSetting(null, "cleanup_callback", "Con.Tiny.customCleanupCallback", true);
309: }
310: }
311:
312: 313: 314: 315: 316: 317:
318: public function setGZIPMode($enabled = true) {
319: if ($enabled) {
320: $this->_useGZIP = true;
321: } else {
322: $this->_useGZIP = false;
323: }
324: }
325:
326: 327: 328: 329: 330:
331: public function getGZIPMode() {
332: return cSecurity::toBoolean($this->_useGZIP);
333: }
334:
335: 336: 337: 338: 339:
340: public function setToolbar($mode = "") {
341:
342: $cfgClient = cRegistry::getClientConfig();
343: $client = cRegistry::getClientId();
344:
345: switch ($mode) {
346: case "full":
347: $this->setSetting(null, "theme_advanced_buttons1", "cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,bold,italic,underline,strikethrough,sub,sup,|,insertdate,inserttime,preview,|,styleselect,|,visualchars,nonbreaking,template,pagebreak,|,help,|,fullscreen", true);
348: $this->setSetting(null, "theme_advanced_buttons2", "link,unlink,anchor,image,media,advhr,|,bullist,numlist,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,removeformat,|,forecolor,backcolor,|,ltr,rtl,|,visualaid,charmap,cleanup,|,code", true);
349: $this->setSetting(null, "theme_advanced_buttons3", "tablecontrols,|,formatselect,fontselect,fontsizeselect,|,styleprops,|,cite,abbr,acronym,del,ins,attribs", true);
350:
351: $this->setSetting(null, "plugins", "table,save,advhr,advimage,advlink,pagebreak,style,layer,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups", true);
352: $this->setSetting(null, "theme_advanced_toolbar_align", "left", true);
353:
354: $aCustSettings = getEffectiveSettingsByType("tinymce");
355: foreach ($aCustSettings as $key=> $value) {
356: $this->setSetting(null, $key, $value, true);
357: }
358:
359: break;
360: case "fullscreen":
361: $this->setSetting(null, "theme_advanced_buttons1", "cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,bold,italic,underline,strikethrough,sub,sup,|,insertdate,inserttime,preview,|,styleselect,|,visualchars,nonbreaking,template,pagebreak,|,help,|,fullscreen", true);
362: $this->setSetting(null, "theme_advanced_buttons2", "link,unlink,anchor,image,media,advhr,|,bullist,numlist,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,removeformat,|,forecolor,backcolor,|,ltr,rtl,|,visualaid,charmap,cleanup,|,code", true);
363: $this->setSetting(null, "theme_advanced_buttons3", "tablecontrols,|,formatselect,fontselect,fontsizeselect,|,styleprops,|,cite,abbr,acronym,del,ins,attribs", true);
364:
365: $this->setSetting(null, "plugins", "table,save,advhr,advimage,advlink,pagebreak,style,layer,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups", true);
366: $this->setSetting(null, "theme_advanced_toolbar_align", "left", true);
367:
368: $aCustSettings = getEffectiveSettingsByType("tinymce_fullscreen");
369: foreach ($aCustSettings as $key => $value) {
370: $this->setSetting(null, $key, $value, true);
371: }
372:
373: break;
374: case "simple":
375: $this->setSetting(null, "theme_advanced_buttons1", "cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,bold,italic,underline,strikethrough,sub,sup,|,insertdate,inserttime,preview,|,styleselect", true);
376: $this->setSetting(null, "theme_advanced_buttons2", "link,unlink,anchor,image,advhr,|,bullist,numlist,|,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,removeformat,|,forecolor,backcolor,|,ltr,rtl,|,visualaid,charmap,cleanup,|,code", true);
377: $this->setSetting(null, "theme_advanced_buttons3", "", true);
378: $this->setSetting(null, "plugins", "advhr,advimage,advlink,insertdatetime,preview,searchreplace,print,contextmenu,paste,directionality", true);
379:
380: $aCustSettings = getEffectiveSettingsByType("tinymce_simple");
381: foreach ($aCustSettings as $key => $value) {
382: $this->setSetting(null, $key, $value, true);
383: }
384:
385: break;
386: case "mini":
387: $this->setSetting(null, "theme_advanced_buttons1", "undo,redo,|,bold,italic,underline,strikethrough,|,link", true);
388: $this->setSetting(null, "theme_advanced_buttons2", "", true);
389: $this->setSetting(null, "theme_advanced_buttons3", "", true);
390:
391: $aCustSettings = getEffectiveSettingsByType("tinymce_mini");
392: foreach ($aCustSettings as $key => $value) {
393: $this->setSetting(null, $key, $value, true);
394: }
395:
396: break;
397: case "custom":
398:
399:
400:
401: $this->setSetting(null, "theme_advanced_buttons1", $this->_aSettings["tinymce-toolbar1"]);
402: $this->setSetting(null, "theme_advanced_buttons2", $this->_aSettings["tinymce-toolbar2"]);
403: $this->setSetting(null, "theme_advanced_buttons3", $this->_aSettings["tinymce-toolbar3"]);
404: $this->setSetting(null, "plugins", $this->_aSettings["tinymce-plugins"]);
405: $this->setSetting(null, "theme_advanced_toolbar_location", "bottom");
406:
407: $aCustSettings = getEffectiveSettingsByType("tinymce_custom");
408: foreach ($aCustSettings as $key => $value) {
409: $this->setSetting(null, $key, $value, true);
410: }
411:
412: break;
413: case "inline_edit":
414: $this->setSetting(null, "theme_advanced_buttons1", "bold,italic,underline,strikethrough,separator,undo,separator,bullist,numlist,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,separator,fullscreen,separator,save,close", true);
415: $this->setSetting(null, "theme_advanced_buttons2", "", true);
416: $this->setSetting(null, "theme_advanced_buttons3", "", true);
417:
418: $this->setSetting(null, "setupcontent_callback", "Con.Tiny.customSetupContentCallback", true);
419:
420: $this->_unsetSetting("width");
421: $this->_unsetSetting("theme_advanced_toolbar_location");
422: $this->setSetting(null, "theme_advanced_toolbar_location", "external");
423: $this->setSetting(null, "height", "210px", true);
424:
425: $this->setSetting(null, "plugins", "table,inlinepopups,fullscreen,close", true);
426: $this->setSetting(null, "mode", "exact", true);
427: $this->setSetting(null, "elements", "*", true);
428: $this->setSetting(null, "content_css", $cfgClient[$client]["path"]["htmlpath"] . "css/style_tiny.css", true);
429:
430: if (!array_key_exists("auto_resize", $this->_aSettings)) {
431: $this->setSetting(null, "auto_resize", "false", true);
432: }
433:
434: if (!array_key_exists("theme_advanced_toolbar_location", $this->_aSettings)) {
435: $this->setSetting(null, "theme_advanced_toolbar_location", "top", true);
436: }
437:
438: if (!array_key_exists("theme_advanced_resizing_use_cookie", $this->_aSettings)) {
439: $this->setSetting(null, "theme_advanced_resizing_use_cookie", "false", true);
440: }
441:
442: if (!array_key_exists("theme_advanced_toolbar_align", $this->_aSettings)) {
443: $this->setSetting(null, "theme_advanced_toolbar_align", "center", true);
444: }
445:
446: $aCustSettings = getEffectiveSettingsByType("tinymce_inline");
447: foreach ($aCustSettings as $key => $value) {
448: $this->setSetting(null, $key, $value, true);
449: }
450:
451: break;
452: default:
453: $this->setSetting(null, "theme_advanced_buttons1", "undo,redo,|,bold,italic,underline,strikethrough,|,link,unlink,anchor,image,advhr,|,tablecontrols", true);
454: $this->setSetting(null, "theme_advanced_buttons2", "styleselect,|,bullist,numlist,|,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,removeformat,|,forecolor,backcolor,|,sub,sup,|,code", true);
455: $this->setSetting(null, "theme_advanced_buttons3", "", true);
456: $this->setSetting(null, "plugins", "table,advhr,advimage,advlink,searchreplace,contextmenu,paste", true);
457:
458: $aCustSettings = getEffectiveSettingsByType("tinymce_default");
459: foreach ($aCustSettings as $key => $value) {
460: $this->setSetting(null, $key, $value, true);
461: }
462: }
463: }
464:
465: 466: 467: 468:
469: public function cleanURLs() {
470:
471: $sess = cRegistry::getBackendSessionId();
472:
473:
474: $aParameters = array(
475:
476: 'content_css', 'popups_css', 'popups_css_add', 'editor_css',
477: 'plugin_preview_pageurl',
478: 'media_external_list_url',
479: 'template_external_list_url'
480: );
481:
482: foreach ($aParameters as $sParameter) {
483: if (array_key_exists($sParameter, $this->_aSettings)) {
484: $this->setSetting(null, $sParameter, $this->addPath($this->_aSettings[$sParameter]), true);
485: }
486: }
487:
488:
489: $aParameters = array(
490: 'media_external_list_url',
491: 'template_external_list_url'
492: );
493:
494: foreach ($aParameters as $sParameter) {
495: if (array_key_exists($sParameter, $this->_aSettings) && preg_match('/\\.php$/i', $this->_aSettings[$sParameter])) {
496: $this->setSetting(null, $sParameter, $this->_aSettings[$sParameter] . '?contenido=' . $sess->id, true);
497: }
498: }
499: }
500:
501: 502: 503: 504: 505: 506:
507: public function addPath($file) {
508:
509: $cfgClient = cRegistry::getClientConfig();
510: $client = cRegistry::getClientId();
511:
512:
513: if (!preg_match('/^(http|https):\/\/((?:[a-zA-Z0-9_-]+\.?)+):?(\d*)/', $file)) {
514: if (preg_match('/^\//', $file)) {
515: $file = "http://" . $_SERVER['HTTP_HOST'] . $file;
516: } else {
517: $file = $cfgClient[$client]['htmlpath']['frontend'] . $file;
518: }
519: }
520:
521: return $file;
522: }
523:
524: 525: 526: 527: 528:
529: public function setBaseURL($baseUrl) {
530: $this->_baseURL = $baseUrl;
531: }
532:
533: 534: 535: 536: 537:
538: public function getScripts() {
539: if ($this->_useGZIP) {
540: $return = "\n<!-- tinyMCE -->\n" . '<script language="javascript" type="text/javascript" src="' . $this->_baseURL . 'jscripts/tiny_mce/tiny_mce_gzip.js"></script>';
541: } else {
542: $return = "\n<!-- tinyMCE -->\n" . '<script language="javascript" type="text/javascript" src="' . $this->_baseURL . 'jscripts/tiny_mce/tiny_mce.js"></script>';
543: }
544:
545: return $return;
546: }
547:
548: 549: 550: 551: 552:
553: public function getEditor() {
554:
555: $sess = cRegistry::getSession();
556: $cfg = cRegistry::getConfig();
557: $client = cRegistry::getClientId();
558: $cfgClient = cRegistry::getClientConfig();
559:
560:
561: $sess->register("browserparameters");
562:
563:
564: $this->setSetting(null, "setupcontent_callback", 'Con.Tiny.customSetupContentCallback', true);
565: $this->setSetting(null, "save_callback", 'Con.Tiny.customSaveCallback', true);
566:
567:
568:
569: $template = new cTemplate();
570: $template->set('s', 'IMAGEBROWSER', $cfg['path']['contenido_fullhtml'] . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=imagebrowser');
571: $template->set('s', 'FILEBROWSER', $cfg['path']['contenido_fullhtml'] . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=filebrowser');
572: $template->set('s', 'MEDIABROWSER', $cfg['path']['contenido_fullhtml'] . 'frameset.php?area=upl&contenido=' . $sess->id . '&appendparameters=imagebrowser');
573: $template->set('s', 'FRONTEND_PATH', $cfgClient[$client]['path']['htmlpath']);
574:
575:
576: $GZIPScript = '';
577: if ($this->_useGZIP) {
578:
579:
580: $GZIPScript = <<<JS
581: <script type="text/javascript">
582: tinyMCE_GZ.init({
583: plugins: '{$this->_aSettings["plugins"]}',
584: themes: '{$this->_aSettings["theme"]}',
585: languages: '{$this->_aSettings["language"]}',
586: disk_cache: true,
587: debug: false
588: });
589: </script>
590: JS;
591: }
592: $template->set('s', 'COMPRESSOR', $GZIPScript);
593:
594:
595: $config = '';
596:
597: foreach ($this->_aSettings as $key => $value) {
598: if (is_bool($value)) {
599: if ($value === true) {
600: $value = "true";
601: } else {
602: $value = "false";
603: }
604: }
605:
606: if ($value == "true" || $value == "false" || $key == "oninit" || $key == "onpageload" || $key == 'style_formats') {
607: $config .= "'$key': " . $value;
608: } else {
609: $config .= "'$key': '" . $value . "'";
610: }
611: $config .= ",\n\t";
612: }
613:
614: $config = substr($config, 0, -3);
615: $template->set('s', 'CONFIG', $config);
616:
617: $oTxtEditor = new cHTMLTextarea($this->_sEditorName, $this->_sEditorContent);
618: $oTxtEditor->setId($this->_sEditorName);
619:
620: $oTxtEditor->setStyle("width: " . $this->_aSettings["width"] . "; height: " . $this->_aSettings["height"] . ";");
621:
622: $return = $template->generate($cfg['path']['all_wysiwyg'] . $this->_sEditor . "/tinymce.tpl.html", true);
623: $return .= $oTxtEditor->render();
624:
625: return $return;
626: }
627:
628: 629: 630: 631: 632:
633: public function getConfigInlineEdit() {
634: $config = '';
635: $this->setToolbar('inline_edit');
636:
637: foreach ($this->_aSettings as $key => $value) {
638: if (is_bool($value)) {
639: if ($value === true) {
640: $value = "true";
641: } else {
642: $value = "false";
643: }
644: }
645:
646: if ($value == "true" || $value == "false" || $key == "oninit" || $key == "onpageload" || $key == 'style_formats') {
647: $config .= "'$key': " . $value;
648: } else {
649: $config .= "'$key': '" . $value . "'";
650: }
651: $config .= ",\n\t";
652: }
653:
654: $config = substr($config, 0, -3);
655:
656: return $config;
657: }
658:
659: 660: 661: 662: 663:
664: public function getConfigFullscreen() {
665: $config = '';
666: $this->setToolbar('fullscreen');
667:
668: $config .= "'theme_advanced_buttons1': '" . $this->_aSettings['theme_advanced_buttons1'] . "',\n";
669: $config .= "'theme_advanced_buttons2': '" . $this->_aSettings['theme_advanced_buttons2'] . "',\n";
670: $config .= "'theme_advanced_buttons3': '" . $this->_aSettings['theme_advanced_buttons3'] . "',\n";
671: $config .= "'theme_advanced_toolbar_align': '" . $this->_aSettings['theme_advanced_toolbar_align'] . "',\n";
672: $config .= "'plugins': '" . $this->_aSettings['plugins'] . "'\n";
673:
674: return $config;
675: }
676:
677: 678: 679: 680: 681:
682: public function getPlugins() {
683: return $this->_aSettings['plugins'];
684: }
685:
686: 687: 688: 689: 690:
691: public function getThemes() {
692: return $this->_aSettings['theme'];
693: }
694:
695: }
696: