/** * Returns <options> tags for theme selectors * * @param int $selectedValue group id * @return string */ function TMCE_getThemeOptions($selectedId) { global $_CONF; $retval = array(); $themes = TMCE_getDirList($_CONF['path_html'] . 'tinymce/js/tiny_mce/themes'); foreach ($themes as $theme) { $selected = $theme === $selectedId ? ' selected="seleced"' : ''; $retval[] = '<option value="' . TMCE_esc($theme) . '"' . $selected . '>' . TMCE_esc($theme) . '</option>'; } return implode(LB, $retval); }
// Security token expirary in editing config (in seconds) $_TMCE_CONF['token_expirary'] = 30 * 60; // The number of TinyMCE plugins displayed in a row in admin editor $_TMCE_CONF['plugin_num_columns'] = 4; // Template header $_TMCE_CONF['template_header'] = <<<EOD <!-- DO NOT REMOVE THIS HTML COMMENT! TINYMCE TEMPLATE HEADER Title: __TITLE_START__{title}__TITLE_END__ Description: __DESC_START__{description}__DESC_END__ Updated: {updated} --> EOD; // Default config data $_TMCE_CONF['default_data'] = array('cid' => 0, 'title' => 'new', 'theme' => 'advanced', 'buttons' => serialize(array('buttons1' => 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect', 'buttons2' => 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor', 'buttons3' => 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen', 'buttons4' => 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft')), 'plugins' => implode(',', TMCE_getDirList($_CONF['path_html'] . 'tinymce/js/tiny_mce/plugins')), 'tb_allow_upload' => 1, 'tb_allow_edit' => 0, 'tb_allow_delete' => 0, 'tb_allow_folders' => 1, 'enter_function' => 0, 'group_id' => 2); // Default definitions for style selector $_TMCE_CONF['default_styles'] = <<<EOD gl_tinymce.style_formats = [ \t{title : 'Bold text', inline : 'b'}, \t{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}}, \t{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}}, \t{title : 'Table styles'}, \t{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}\t// Don't put a comma in the last line ]; EOD ;