'; } /** * Returns the config object. * * @return string */ function tinymce_config($cmsimple_editor, $config) { global $pth, $sl, $sn, $cf; $tiny_mode = isset($cf['editor']['tinymce_toolbar']) && file_exists($pth['folder']['plugins'] . 'tinymce/' . 'inits/init_' . $cf['editor']['tinymce_toolbar'] . '.js') ? $cf['editor']['tinymce_toolbar'] : 'full'; $initFile = $pth['folder']['plugins'] . 'tinymce/' . 'inits/init_' . $tiny_mode . '.js'; if ($config) { $initFile = false; $inits = glob($pth['folder']['plugins'] . 'tinymce/inits/*.js'); //$options = array(); foreach ($inits as $init) { $temp = explode('_', basename($init, '.js')); if (isset($temp[1]) && $temp[1] === $config) { $tiny_mode = $config; $isFile = false; $initFile = $pth['folder']['plugins'] . 'tinymce/' . 'inits/init_' . $tiny_mode . '.js'; break; } } } if ($initFile) { $temp = file_get_contents($initFile); } else { $temp = $config; } /* * use english if tiny doesn't know $sl resp. $cf['default']['language'] */ $tiny_language = file_exists($pth['folder']['plugins'] . 'tinymce/' . 'tiny_mce/langs/' . $sl . '.js') ? $sl : (file_exists($pth['folder']['plugins'] . 'tinymce/' . 'tiny_mce/langs/' . $cf['language']['default'] . '.js') ? $cf['language']['default'] : 'en'); /* * The styles of this sheet will be used inside the editor. * * All css classes will be available in the style-selectbox. * * If you have a lot of classes that are of no use for text editing, * you might want to create a special editor.css. */ $tiny_css = $pth['folder']['template'] . 'stylesheet.css'; $temp = str_replace('%TINY_FOLDER%', $pth['folder']['plugins'] . 'tinymce/', $temp); $temp = str_replace('%LANGUAGE%', $tiny_language, $temp); //$temp = str_replace('\'%IMAGES%\'', get_images($pth['folder']['images']), $temp); //$temp = str_replace('\'%INTERNAL_LINKS%\'', get_internal_links($h, $u, $l, $sn, $pth['folder']['downloads']), $temp); $temp = str_replace('%STYLESHEET%', $tiny_css, $temp); $temp = str_replace('%BASE_URL%', $sn, $temp); $elementFormat = $cf['xhtml']['endtags'] == 'true' ? 'xhtml' : 'html'; $temp = str_replace('%ELEMENT_FORMAT%', $elementFormat, $temp); if ($cmsimple_editor) { $temp = str_replace('"%EDITOR_HEIGHT%"', 'height : "'.$cf['editor']['height'].'",', $temp); } else { $temp = str_replace('"%EDITOR_HEIGHT%"', '', $temp); } //$temp = str_replace("%INIT_CLASSES%", $initClasses, $temp); $temp = str_replace("%FILEBROWSER_CALLBACK%", $_SESSION['tinymce_fb_callback'], $temp); return $temp; } /** * Returns the JS to actually instantiate a single editor on the textarea given by $element_id. * $config can be 'full', 'medium', 'minimal', 'sidebar' or '' (which will use the users default configuration). * Other values are editor dependent. Typically this will be a string in JSON format enclosed in { }, * that can contain %PLACEHOLDER%s, that will be substituted. * * To actually create the editor, the caller has to write the the return value to the (X)HTML output, * properly enclosed as '; $onload .= 'tinyMCE_initialize' . $run . '();'; $run++; return; } /* * End of file plugins/tinymce/tinymce.php */