Make WordPress Core


Ignore:
Timestamp:
08/20/2008 09:42:31 PM (17 years ago)
Author:
ryan
Message:

Collapse crazyhorse to trunk. Incoming! see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r8646 r8691  
    692692    return _wp_put_post_revision( $_POST, true );
    693693}
     694
     695/**
     696 * wp_teeny_mce() - adds a trimmed down version of the tinyMCE editor used on the Write -> Post screen.
     697 *
     698 * @package WordPress
     699 * @since 2.6
     700 */
     701function wp_teeny_mce( $args = null ) {
     702    if ( !user_can_richedit() )
     703        return;
     704
     705    $defaults = array(
     706        'buttons1' => 'bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink'
     707    );
     708    $args = wp_parse_args( $args, $defaults );
     709    if ( is_array( $args['buttons1'] ) )
     710        $args['buttons1'] = join( ',', $args['buttons1'] );
     711
     712    $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
     713
     714?>
     715
     716<script type="text/javascript" src="<?php echo clean_url( site_url( 'wp-includes/js/tinymce/tiny_mce.js' ) ); ?>"></script>
     717<script type="text/javascript">
     718/* <![CDATA[ */
     719<?php
     720    // Add TinyMCE languages
     721    @include_once( ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php' );
     722
     723    if ( isset($strings) )
     724        echo $strings;
     725
     726?>
     727    (function() {
     728        var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
     729
     730        sl.markDone(base + '/langs/' + ln + '.js');
     731        sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
     732        sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
     733    })();
     734   
     735    var wpTeenyMCEInit = function() {
     736    tinyMCE.init({
     737        mode: "textareas",
     738        editor_selector: "mceEditor",
     739        language : "<?php echo $language; ?>",
     740        width: "100%",
     741        theme : "advanced",
     742        theme_advanced_buttons1 : "<?php echo $args['buttons1']; ?>",
     743        theme_advanced_buttons2 : "",
     744        theme_advanced_buttons3 : "",
     745        theme_advanced_toolbar_location : "top",
     746        theme_advanced_toolbar_align : "left",
     747        theme_advanced_statusbar_location : "bottom",
     748        theme_advanced_resizing : true,
     749        theme_advanced_resize_horizontal : false,
     750        skin : "wp_theme",
     751        dialog_type : "modal",
     752        relative_urls : false,
     753        remove_script_host : false,
     754        convert_urls : false,
     755        apply_source_formatting : false,
     756        remove_linebreaks : true,
     757        accessibility_focus : false,
     758        tab_focus : ":next",
     759        plugins : "safari,inlinepopups",
     760        entities : "38,amp,60,lt,62,gt",
     761        force_p_newlines : true,
     762        save_callback : 'switchEditors.saveCallback'
     763    });
     764    };
     765    wpTeenyMCEInit();
     766/* ]]> */
     767</script>
     768
     769<?php
     770}
Note: See TracChangeset for help on using the changeset viewer.