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
|
|
|
|
|
|
|
function wp_translate_tinymce_lang($text) {
|
|
|
|
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);
|
2007-12-18 21:46:09 +01:00
|
|
|
|
|
|
|
$invalid_elements = apply_filters('mce_invalid_elements', '');
|
2006-03-30 09:50:33 +02:00
|
|
|
|
|
|
|
$plugins = array('inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress');
|
|
|
|
$plugins = apply_filters('mce_plugins', $plugins);
|
|
|
|
$plugins = implode($plugins, ',');
|
|
|
|
|
2007-05-10 04:42:00 +02:00
|
|
|
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'image', 'wp_more', 'separator', 'spellchecker', 'separator', 'wp_help', 'wp_adv', 'wp_adv_start', 'formatselect', 'underline', 'justifyfull', 'forecolor', 'separator', 'pastetext', 'pasteword', 'separator', 'removeformat', 'cleanup', 'separator', 'charmap', 'separator', 'undo', 'redo', 'wp_adv_end'));
|
2006-03-30 09:50:33 +02:00
|
|
|
$mce_buttons = implode($mce_buttons, ',');
|
|
|
|
|
|
|
|
$mce_buttons_2 = apply_filters('mce_buttons_2', array());
|
|
|
|
$mce_buttons_2 = implode($mce_buttons_2, ',');
|
|
|
|
|
|
|
|
$mce_buttons_3 = apply_filters('mce_buttons_3', array());
|
|
|
|
$mce_buttons_3 = implode($mce_buttons_3, ',');
|
|
|
|
|
|
|
|
$mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera', 'safari'));
|
|
|
|
$mce_browsers = implode($mce_browsers, ',');
|
2007-02-27 16:24:54 +01:00
|
|
|
|
2006-03-30 09:50:33 +02:00
|
|
|
$mce_popups_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/popups.css';
|
|
|
|
$mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css';
|
|
|
|
$mce_css = apply_filters('mce_css', $mce_css);
|
2007-01-26 03:57:07 +01:00
|
|
|
if ( $_SERVER['HTTPS'] == 'on' ) {
|
2006-08-09 21:39:17 +02:00
|
|
|
$mce_css = str_replace('http://', 'https://', $mce_css);
|
|
|
|
$mce_popups_css = str_replace('http://', 'https://', $mce_popups_css);
|
|
|
|
}
|
2007-06-14 04:25:30 +02:00
|
|
|
|
2007-04-10 06:28:40 +02:00
|
|
|
$mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale());
|
2006-03-30 09:50:33 +02:00
|
|
|
?>
|
|
|
|
|
2008-01-06 20:01:32 +01:00
|
|
|
wpEditorInit = function() {
|
|
|
|
// Activate tinyMCE if it's the user's default editor
|
|
|
|
if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor )
|
|
|
|
tinyMCE.execCommand("mceAddControl", true, 'content');
|
|
|
|
};
|
|
|
|
|
2006-03-30 09:50:33 +02:00
|
|
|
initArray = {
|
|
|
|
mode : "specific_textareas",
|
|
|
|
editor_selector : "mceEditor",
|
2008-01-06 20:01:32 +01:00
|
|
|
oninit : "wpEditorInit",
|
2006-03-30 09:50:33 +02:00
|
|
|
width : "100%",
|
|
|
|
theme : "advanced",
|
|
|
|
theme_advanced_buttons1 : "<?php echo $mce_buttons; ?>",
|
|
|
|
theme_advanced_buttons2 : "<?php echo $mce_buttons_2; ?>",
|
|
|
|
theme_advanced_buttons3 : "<?php echo $mce_buttons_3; ?>",
|
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",
|
|
|
|
theme_advanced_path_location : "bottom",
|
|
|
|
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,
|
|
|
|
force_p_newlines : true,
|
|
|
|
force_br_newlines : false,
|
|
|
|
convert_newlines_to_brs : false,
|
|
|
|
remove_linebreaks : false,
|
|
|
|
fix_list_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-09 06:21:51 +01:00
|
|
|
button_tile_map : false,
|
2006-03-30 09:50:33 +02:00
|
|
|
content_css : "<?php echo $mce_css; ?>",
|
|
|
|
valid_elements : "<?php echo $valid_elements; ?>",
|
2007-12-18 21:46:09 +01:00
|
|
|
invalid_elements : "<?php echo $invalid_elements; ?>",
|
2006-03-30 09:50:33 +02:00
|
|
|
save_callback : 'TinyMCE_wordpressPlugin.saveCallback',
|
2006-04-13 04:57:25 +02:00
|
|
|
imp_version : "<?php echo intval($_GET['ver']); ?>",
|
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');
|
|
|
|
?>
|
|
|
|
|
|
|
|
tinyMCE.init(initArray);
|