2006-03-30 09:50:33 +02:00
|
|
|
<?php
|
|
|
|
@ require('../../../wp-config.php');
|
2007-02-23 01:45:21 +01:00
|
|
|
cache_javascript_headers();
|
2006-03-30 09:50:33 +02:00
|
|
|
|
2008-02-09 07:43:15 +01:00
|
|
|
// deprecated
|
|
|
|
function wp_translate_tinymce_lang($text) {
|
2006-03-30 09:50:33 +02:00
|
|
|
if ( ! function_exists('__') ) {
|
|
|
|
return $text;
|
|
|
|
} else {
|
|
|
|
$search1 = "/^tinyMCELang\\[(['\"])(.*)\\1\]( ?= ?)(['\"])(.*)\\4/Uem";
|
|
|
|
$replace1 = "'tinyMCELang[\\1\\2\\1]\\3'.stripslashes('\\4').__('\\5').stripslashes('\\4')";
|
|
|
|
|
|
|
|
$search2 = "/ : (['\"])(.*)\\1/Uem";
|
|
|
|
$replace2 = "' : '.stripslashes('\\1').__('\\2').stripslashes('\\1')";
|
|
|
|
|
|
|
|
$search = array($search1, $search2);
|
|
|
|
$replace = array($replace1, $replace2);
|
|
|
|
|
|
|
|
$text = preg_replace($search, $replace, $text);
|
|
|
|
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set up init variables
|
2007-12-18 21:46:09 +01:00
|
|
|
$valid_elements = '*[*]';
|
2006-03-30 09:50:33 +02:00
|
|
|
$valid_elements = apply_filters('mce_valid_elements', $valid_elements);
|
2008-02-05 07:47:27 +01:00
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
$invalid_elements = apply_filters('mce_invalid_elements', '');
|
2006-03-30 09:50:33 +02:00
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' );
|
2006-03-30 09:50:33 +02:00
|
|
|
$plugins = apply_filters('mce_plugins', $plugins);
|
|
|
|
$plugins = implode($plugins, ',');
|
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'outdent', 'indent', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', '|', 'wp_help', 'wp_adv' ));
|
2006-03-30 09:50:33 +02:00
|
|
|
$mce_buttons = implode($mce_buttons, ',');
|
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
|
|
|
|
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', '|', 'removeformat', 'cleanup', '|', 'media', 'charmap', 'blockquote', '|', 'undo', 'redo', 'fullscreen' ));
|
2006-03-30 09:50:33 +02:00
|
|
|
$mce_buttons_2 = implode($mce_buttons_2, ',');
|
|
|
|
|
|
|
|
$mce_buttons_3 = apply_filters('mce_buttons_3', array());
|
|
|
|
$mce_buttons_3 = implode($mce_buttons_3, ',');
|
2008-02-05 07:47:27 +01:00
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
$mce_buttons_4 = apply_filters('mce_buttons_4', array());
|
|
|
|
$mce_buttons_4 = implode($mce_buttons_4, ',');
|
2006-03-30 09:50:33 +02:00
|
|
|
|
|
|
|
$mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera', 'safari'));
|
|
|
|
$mce_browsers = implode($mce_browsers, ',');
|
2007-02-27 16:24:54 +01:00
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
$mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/wordpress.css';
|
2006-03-30 09:50:33 +02:00
|
|
|
$mce_css = apply_filters('mce_css', $mce_css);
|
2008-01-31 19:10:46 +01:00
|
|
|
if ( $_SERVER['HTTPS'] == 'on' )
|
2006-08-09 21:39:17 +02:00
|
|
|
$mce_css = str_replace('http://', 'https://', $mce_css);
|
2007-06-14 04:25:30 +02:00
|
|
|
|
2008-02-09 07:43:15 +01:00
|
|
|
$mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
|
2006-03-30 09:50:33 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
initArray = {
|
2008-01-31 19:10:46 +01:00
|
|
|
mode : "none",
|
|
|
|
onpageload : "wpEditorInit",
|
|
|
|
width : "100%",
|
2006-03-30 09:50:33 +02:00
|
|
|
theme : "advanced",
|
2008-01-31 19:10:46 +01:00
|
|
|
skin : "wp_theme",
|
2006-03-30 09:50:33 +02:00
|
|
|
theme_advanced_buttons1 : "<?php echo $mce_buttons; ?>",
|
|
|
|
theme_advanced_buttons2 : "<?php echo $mce_buttons_2; ?>",
|
|
|
|
theme_advanced_buttons3 : "<?php echo $mce_buttons_3; ?>",
|
2008-01-31 19:10:46 +01:00
|
|
|
theme_advanced_buttons4 : "<?php echo $mce_buttons_4; ?>",
|
2007-04-09 18:33:43 +02:00
|
|
|
language : "<?php echo $mce_locale; ?>",
|
2006-03-30 09:50:33 +02:00
|
|
|
theme_advanced_toolbar_location : "top",
|
|
|
|
theme_advanced_toolbar_align : "left",
|
2008-01-17 16:44:05 +01:00
|
|
|
theme_advanced_statusbar_location : "bottom",
|
2006-03-30 09:50:33 +02:00
|
|
|
theme_advanced_resizing : true,
|
|
|
|
browsers : "<?php echo $mce_browsers; ?>",
|
|
|
|
dialog_type : "modal",
|
|
|
|
theme_advanced_resize_horizontal : false,
|
|
|
|
convert_urls : false,
|
|
|
|
relative_urls : false,
|
|
|
|
remove_script_host : false,
|
|
|
|
fix_list_elements : true,
|
2008-01-31 19:10:46 +01:00
|
|
|
fix_table_elements : true,
|
2007-02-24 00:50:23 +01:00
|
|
|
gecko_spellcheck : true,
|
2006-08-09 21:39:17 +02:00
|
|
|
entities : "38,amp,60,lt,62,gt",
|
2008-01-31 19:10:46 +01:00
|
|
|
accessibility_focus : false,
|
|
|
|
tab_focus : ":next",
|
2006-03-30 09:50:33 +02:00
|
|
|
content_css : "<?php echo $mce_css; ?>",
|
2008-01-31 19:10:46 +01:00
|
|
|
<?php if ( $valid_elements ) echo 'valid_elements : "' . $valid_elements . '",' . "\n"; ?>
|
|
|
|
<?php if ( $invalid_elements ) echo 'invalid_elements : "' . $invalid_elements . '",' . "\n"; ?>
|
2008-02-09 07:43:15 +01:00
|
|
|
save_callback : "switchEditors.saveCallback",
|
2006-03-30 09:50:33 +02:00
|
|
|
<?php do_action('mce_options'); ?>
|
|
|
|
plugins : "<?php echo $plugins; ?>"
|
|
|
|
};
|
|
|
|
|
|
|
|
<?php
|
|
|
|
// For people who really REALLY know what they're doing with TinyMCE
|
|
|
|
// You can modify initArray to add, remove, change elements of the config before tinyMCE.init
|
|
|
|
do_action('tinymce_before_init');
|
|
|
|
?>
|
|
|
|
|
2008-01-31 19:10:46 +01:00
|
|
|
tinyMCE_GZ.init(initArray);
|