function add_css()
    {
        $css = apply_filters('more_fields_write_css', '');
        $js = apply_filters('more_fields_write_js', '');
        ?>
		<script type="text/javascript">
		//<![CDATA[
			jQuery(document).ready(function($){
				$(".mf_update_on_edit").change(function() {
					var val = $(this).val();
					$(this).next().html(val);
				});
				<?php 
        echo $js;
        ?>
			});
		//]]>
		</script>
		<style type="text/css">
			<?php 
        echo $css;
        ?>
		</style>
		<?php 
        wp_tiny_mce(false);
        // true gives you a stripped down version of the editor
    }
Esempio n. 2
0
/**
 * Display the meta boxes
 *
 * @access      private
 * @since       1.0.0
 * @return      void
 */
function ctslider_show_slidecaption_1_box()
{
    global $post, $ctslider_slidecaption_1_metabox, $ctslider_prefix, $wp_version;
    // Use nonce for verification
    echo '<input type="hidden" name="ctslider_slidecaption_1_meta_box_nonce" value="' . wp_create_nonce(basename(__FILE__)) . '" />';
    echo '<table class="form-table">';
    foreach ($ctslider_slidecaption_1_metabox['fields'] as $field) {
        $meta = get_post_meta($post->ID, $field['id'], true);
        echo '<tr>', '<th style="width:20%"><label for="', $field['id'], '">', stripslashes($field['name']), '</label></th>', '<td class="ctslider_field_type_' . str_replace(' ', '_', $field['type']) . '">';
        switch ($field['type']) {
            case 'text':
                echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" /><br/>', '', __(stripslashes($field['desc']), 'ctslider');
                break;
            case 'textarea':
                if ($field['rich_editor'] == 1) {
                    if ($wp_version >= 3.3) {
                        echo wp_editor($meta, $field['id'], array('textarea_name' => $field['id']));
                    } else {
                        $editor = '';
                        if (!post_type_supports($post->post_type, 'editor')) {
                            $editor = wp_tiny_mce(true, array('editor_selector' => $field['class'], 'remove_linebreaks' => false));
                        }
                        $field_html = '<div style="width: 97%; border: 1px solid #DFDFDF;"><textarea name="' . $field['id'] . '" class="' . $field['class'] . '" id="' . $field['id'] . '" cols="60" rows="8" style="width:100%">' . $meta . '</textarea></div><br/>' . __(stripslashes($field['desc']), 'ctslider');
                        echo $editor . $field_html;
                    }
                } else {
                    echo '<div style="width: 100%;"><textarea name="', $field['id'], '" class="', $field['class'], '" id="', $field['id'], '" cols="60" rows="8" style="width:97%">', $meta ? $meta : $field['std'], '</textarea></div>', '', __(stripslashes($field['desc']), 'ctslider');
                }
                break;
        }
        echo '<td>', '</tr>';
    }
    echo '</table>';
}
Esempio n. 3
0
function simplepopup_enqueue_editor()
{
    wp_enqueue_script('common');
    wp_enqueue_script('jquery-affect');
    wp_admin_css('thickbox');
    wp_print_scripts('post');
    wp_print_scripts('media-upload');
    wp_print_scripts('jquery');
    wp_print_scripts('jquery-ui-core');
    wp_print_scripts('jquery-ui-tabs');
    wp_print_scripts('tiny_mce');
    wp_print_scripts('editor');
    wp_print_scripts('editor-functions');
    /* Include thе link dialog functions */
    require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
    wp_print_scripts('wplink');
    wp_print_styles('wplink');
    add_action('tiny_mce_preload_dialogs', 'wp_link_dialog');
    add_thickbox();
    wp_tiny_mce();
    wp_admin_css();
    wp_enqueue_script('utils');
    do_action("admin_print_styles-post-php");
    do_action('admin_print_styles');
    //remove_all_filters('mce_external_plugins');
}
Esempio n. 4
0
function my_enqueue_mce()
{
    wp_enqueue_script('tiny_mce');
    if (function_exists('wp_tiny_mce')) {
        wp_tiny_mce();
    }
}
Esempio n. 5
0
 function add_js()
 {
     global $bp;
     $baseurl = includes_url('js/tinymce');
     if ($this->enable_tinymce_on_page()) {
         wp_tiny_mce($this->is_teeny, array('mode' => 'textareas'));
     }
 }
Esempio n. 6
0
 function admin_head()
 {
     // Add TinyMCE
     wp_print_scripts('editor');
     if (function_exists('wp_tiny_mce')) {
         wp_tiny_mce();
     }
 }
Esempio n. 7
0
 function add_tiny_mce()
 {
     global $post;
     if ($post && post_type_supports($post->post_type, 'editor')) {
         // do nothing, wysiwyg will render correctly!
     } else {
         wp_tiny_mce();
     }
 }
Esempio n. 8
0
 function wpframe_add_editor_js()
 {
     wp_enqueue_script('common');
     wp_enqueue_script('jquery-color');
     wp_print_scripts('editor');
     if (function_exists('add_thickbox')) {
         add_thickbox();
     }
     wp_print_scripts('media-upload');
     if (function_exists('wp_tiny_mce')) {
         wp_tiny_mce();
     }
     wp_admin_css();
     wp_enqueue_script('utils');
     do_action("admin_print_styles-post-php");
     do_action('admin_print_styles');
 }
    function mod_tinymce()
    {
        add_filter('tiny_mce_before_init', create_function('$a', '
	    $a["theme"] = "advanced";
	    $a["onpageload"] = "";
	    $a["width"] = "100";
	    $a["height"] = "300";
	    $a["mode"] = "specific_textareas";
	    $a["editor_selector"] = "wpui-active-edit";
	    $a["plugins"] = "safari,inlinepopups,spellchecker";
	    $a["forced_root_block"] = false;
	    $a["force_br_newlines"] = true;
	    $a["force_p_newlines"] = false;
	    $a["convert_newlines_to_brs"] = true;
	   	$a["setup"] = \'function(ed) { ed.onChange.add(function(ed, l){  tinymce.triggerSave(); })   }\';		
	    return $a;'));
        wp_tiny_mce(false);
    }
Esempio n. 10
0
 function admin_head()
 {
     if (!array_key_exists('options_page', $this->parent->activated_fields)) {
         exit;
     }
     // save
     if (isset($_POST['update_options'])) {
         $this->update_options();
     }
     // create tyn mce instance for wysiwyg
     wp_tiny_mce();
     // add these acf's to the page
     echo '<link rel="stylesheet" type="text/css" href="' . $this->dir . '/css/style.global.css" />';
     echo '<link rel="stylesheet" type="text/css" href="' . $this->dir . '/css/style.input.css" />';
     echo '<script type="text/javascript" src="' . $this->dir . '/js/functions.input.js" ></script>';
     // date picker!
     echo '<link rel="stylesheet" type="text/css" href="' . $this->dir . '/core/fields/date_picker/style.date_picker.css" />';
     echo '<script type="text/javascript" src="' . $this->dir . '/core/fields/date_picker/jquery.ui.datepicker.js" ></script>';
 }
function ecpt_show_research_meta_box()
{
    global $post;
    global $research_meta_metabox;
    global $ecpt_prefix;
    global $wp_version;
    // Use nonce for verification
    echo '<input type="hidden" name="ecpt_research_meta_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    echo '<table class="form-table">';
    foreach ($research_meta_metabox['fields'] as $field) {
        // get current post meta data
        $meta = get_post_meta($post->ID, $field['id'], true);
        echo '<tr>', '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', '<td class="ecpt_field_type_' . str_replace(' ', '_', $field['type']) . '">';
        switch ($field['type']) {
            case 'text':
                echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" /><br/>', '', $field['desc'];
                break;
            case 'textarea':
                if ($field['rich_editor'] == 1) {
                    if ($wp_version >= 3.3) {
                        echo wp_editor($meta, $field['id'], array('textarea_name' => $field['id'], 'wpautop' => false));
                    } else {
                        // older versions of WP
                        $editor = '';
                        if (!post_type_supports($post->post_type, 'editor')) {
                            $editor = wp_tiny_mce(true, array('editor_selector' => $field['class'], 'remove_linebreaks' => false));
                        }
                        $field_html = '<div style="width: 97%; border: 1px solid #DFDFDF;"><textarea name="' . $field['id'] . '" class="' . $field['class'] . '" id="' . $field['id'] . '" cols="60" rows="8" style="width:100%">' . $meta . '</textarea></div><br/>' . __($field['desc']);
                        echo $editor . $field_html;
                    }
                } else {
                    echo '<div style="width: 100%;"><textarea name="', $field['id'], '" class="', $field['class'], '" id="', $field['id'], '" cols="60" rows="8" style="width:97%">', $meta ? $meta : $field['std'], '</textarea></div>', '', $field['desc'];
                }
                break;
            case 'upload':
                echo '<input type="text" class="ecpt_upload_field" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:80%" /><input class="ecpt_upload_image_button" type="button" value="Upload" /><br/>', '', $field['desc'];
                break;
        }
        echo '<td>', '</tr>';
    }
    echo '</table>';
}
Esempio n. 12
0
 function admin_head_addition()
 {
     global $am_option;
     echo '<link rel="stylesheet" href="' . $am_option['url']['themeoptions_url'] . '/admin.css" type="text/css" />';
     echo '<script type="text/javascript" src="' . $am_option['url']['themeoptions_url'] . '/supporting_scripts.js"></script>';
     wp_enqueue_script('common');
     wp_enqueue_script('jquery-color');
     wp_print_scripts('editor');
     if (function_exists('add_thickbox')) {
         add_thickbox();
     }
     wp_print_scripts('media-upload');
     if (function_exists('wp_tiny_mce')) {
         wp_tiny_mce();
     }
     wp_admin_css();
     wp_enqueue_script('utils');
     do_action('admin_print_styles-post-php');
     do_action('admin_print_styles');
 }
/**
* WP Super Edit Default User
*
* Sets default user settings from most recent TinyMCE scan, sets initial options, and removes unnecessary WordPress options
*/
function wp_super_edit_set_user_default()
{
    global $wp_super_edit, $wp_super_edit_tinymce_default;
    // Output buffering to get default TinyMCE init
    ob_start();
    wp_tiny_mce();
    ob_end_clean();
    $wp_super_edit->register_user_settings('wp_super_edit_default', 'Default Editor Settings', $wp_super_edit_tinymce_default, 'single');
    $wp_super_edit->set_option('tinymce_scan', $wp_super_edit_tinymce_default);
    $wp_super_edit->set_option('management_mode', 'single');
    /**
     * Remove old options for versions 2.2
     */
    delete_option('wp_super_edit_tinymce_scan');
    /**
     * Remove old options for versions 1.5 
     */
    delete_option('superedit_options');
    delete_option('superedit_buttons');
    delete_option('superedit_plugins');
}
Esempio n. 14
0
    public static function admin_head()
    {
        if ($_REQUEST['action'] == 'edit') {
            $elements = 'description';
            $selector = 'form#addtag #submit, form#addtag';
        } else {
            $elements = 'tag-description';
            $selector = 'form#edittag #submit, form#edittag';
        }
        wp_tiny_mce(true, array('mode' => 'exact', 'elements' => $elements, 'width' => '100%', 'theme_advanced_buttons1' => 'bold,italic,strikethrough,|,bullist,numlist,blockquote,|,link,unlink,|,undo,redo,|,removeformat'));
        echo <<<SCRIPT
\t\t<script type="text/javascript">
\t\tjQuery(function() {
\t\t\t
\t\t\tjQuery('{$selector}').submit(function(){
\t\t\t\ttinyMCE.getInstanceById("tag-description").save()\t
\t\t\t})
\t\t\t
\t\t} )
\t\t</script>
SCRIPT;
    }
    function render()
    {
        global $comicpress_manager;
        if (is_null(get_category($comicpress_manager->properties['comiccat']))) {
            ?>
      <p><strong>You don't have a comics category defined!</strong> Go to the
      <a href="?page=<?php 
            echo plugin_basename(__FILE__);
            ?>
-config">ComicPress Config</a> screen and choose a category.
      <?php 
            return;
        }
        $this->category_checkboxes = $this->_generate_additional_categories_checkboxes();
        if ($comicpress_manager->scale_method != false) {
            $this->thumbnail_writes = $comicpress_manager->get_thumbnails_to_generate();
        }
        $this->all_tags = get_tags();
        if (function_exists('wp_tiny_mce')) {
            wp_tiny_mce();
        }
        include $this->_partial_path('table');
    }
Esempio n. 16
0
function events_editor_admin_head()
{
    wp_tiny_mce();
}
Esempio n. 17
0
        if (get_option('users_can_register') == 1) {
            $userinfo_html .= "Or <a href='" . wp_login_url(get_permalink()) . "'>log in</a>";
        }
        $userinfo_html .= "</div>";
    }
}
//==========================================================OUTPUT============================
$html .= $userinfo_html;
//include user name and email textboxes if required
$t1 = __("Enter Question Title", 'qna-forum');
$t2 = __("Enter Your Question Here", 'qna-forum');
$html .= <<<HTML
<input type="text" class="question-title-box" value="{$qtitle}" id="question-title-box-{$questionformid}" name="title" onfocus="if(this.value == '{$t1}'){this.value = '';}" onblur="if(this.value == ''){this.value = '{$t1}';}" />
HTML;
if (get_option('qanda_rteditor') == 'TRUE' && function_exists('wp_tiny_mce')) {
    wp_tiny_mce(false, array("editor_selector" => "question-box-{$questionformid}"));
}
$html .= <<<HTML
<textarea class="question-box" cols="80" rows="5" id="question-box-{$questionformid}" name="question" onfocus="if(this.value == '{$t2}'){this.value = '';}" onblur="if(this.value == ''){this.value = '{$t2}';}">{$Qtext}</textarea>
HTML;
// categories==================================
$html .= "<div class='question-form-bottom'>" . __('Category', 'qna-forum') . ":<select name='category' id='category-" . $questionformid . "'>";
$categories = get_categories(array('type' => 'post', 'orderby' => 'count', 'order' => 'DESC', 'hide_empty' => 0));
foreach ($categories as $cat) {
    if (get_option('q_cat_' . $cat->term_id) == "TRUE") {
        $html .= '<option value="' . $cat->term_id . '">' . $cat->cat_name . '</option>';
    }
}
$html .= "</select>";
$html .= "<input type='hidden' value='" . wp_create_nonce('q_question_form') . "' name='nonce' />";
$html .= "<input type='hidden' name='action' value='q_ask_question' />";
function huge_it_videogallery_ShowTinyMCE()
{
    // conditions here
    wp_enqueue_script('common');
    wp_enqueue_script('jquery-color');
    wp_print_scripts('editor');
    if (function_exists('add_thickbox')) {
        add_thickbox();
    }
    wp_print_scripts('media-upload');
    if (version_compare(get_bloginfo('version'), 3.3) < 0) {
        if (function_exists('wp_tiny_mce')) {
            wp_tiny_mce();
        }
    }
    wp_admin_css();
    wp_enqueue_script('utils');
    do_action("admin_print_styles-post-php");
    do_action('admin_print_styles');
}
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this';
var photostorage = false;
//]]>
</script>

<?php
	do_action('admin_print_styles');
	do_action('admin_print_scripts');
	do_action('admin_head');

	if ( user_can_richedit() )
		wp_tiny_mce( true, array( 'height' => '370' ) );
?>
	<script type="text/javascript">
	function insert_plain_editor(text) {
		edCanvas = document.getElementById('content');
		edInsertContent(edCanvas, text);
	}
	function set_editor(text) {
		if ( '' == text || '<p></p>' == text ) text = '<p><br /></p>';
		if ( tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, text);
	}
	function insert_editor(text) {
		if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
			tinyMCE.execCommand('mceInsertContent', false, '<p>' + decodeURI(tinymce.DOM.decode(text)) + '</p>', {format : 'raw'});
		} else {
			insert_plain_editor(decodeURI(text));
 function _show_tinyMCE()
 {
     wp_print_scripts('editor');
     //add_filter('the_editor', array($this, 'editor_directionality'), 9999);
     add_filter('tiny_mce_before_init', array($this, '_mce_set_direction'), 9999);
     add_filter('mce_buttons', array($this, '_mce_remove_fullscreen'), 9999);
     if (version_compare($GLOBALS['wp_version'], '3.1.4', '<=') && function_exists('wp_tiny_mce')) {
         try {
             /** @noinspection PhpDeprecationInspection */
             @wp_tiny_mce();
         } catch (Exception $e) {
             /*don't do anything with this */
         }
     }
 }
<?php

bpsp_load_editor_files();
wp_tiny_mce();
?>
<form action="<?php 
echo $current_option;
?>
" method="post" class="standard-form" id="new-assignment-form">
    <div id="new-assignment-meta" class="courseware-sidebar">
        <h4 class="meta"><?php 
_e('Course &amp; Due Date', 'bpsp');
?>
</h4>
        <ul class="courseware-meta">
            <li id="new-assignment-course">
                    <select name="assignment[course_id]">
                        <?php 
foreach ($courses as $c) {
    ?>
                            <option value="<?php 
    echo $c->ID;
    ?>
"><?php 
    echo $c->post_title;
    ?>
</option>
                        <?php 
}
?>
                    </select>
Esempio n. 22
0
 function add_script_wysiwyg()
 {
     require_once ABSPATH . '/wp-admin/includes/post.php';
     wp_tiny_mce(false, array('editor_selector' => 'theEditor'));
     // wp_editor( '', 'theeditor', $settings = array() );
 }
Esempio n. 23
0
        function editor_js()
        {
            global $wp_db_version;
            $short_load = false;
            if (count($this->editor_ids) > 1) {
                $ids = $this->editor_ids;
                $id = array_shift($ids);
            } else {
                $id = $this->editor_ids[0];
            }
            if (!$this->editor_loaded) {
                if (!function_exists('wp_tiny_mce')) {
                    include_once ABSPATH . 'wp-admin/includes/post.php';
                }
                if (!function_exists('submit_button')) {
                    include_once ABSPATH . 'wp-admin/includes/template.php';
                }
                add_filter('tiny_mce_before_init', array($this, 'disable_fullscreen'));
                echo '<style type="text/css">.wp-dialog,.alternate{background-color:#F9F9F9;}</style>';
                if (function_exists('wp_tiny_mce_preload_dialogs')) {
                    add_action('wp_footer', 'wp_tiny_mce_preload_dialogs', 30);
                    add_action('admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30);
                }
                $set = $this->settings[$id];
                $set['elements'] = $id;
                $set['mode'] = 'exact';
                $set['editor_selector'] = null;
                wp_tiny_mce(false, $set);
                wp_print_scripts(array('quicktags', 'editor'));
                if (!empty($ids)) {
                    $short_load = $ids;
                }
                $first_load = $id;
                $this->editor_loaded = true;
            } else {
                $short_load = $this->editor_ids;
            }
            /* js source
            
            var wpEditor = {
            	wpautop : {
            		<?php echo $id.':';echo $this->settings[$id]['wpautop'] ? 'true' : 'false'; ? >
            	},
            
            	s : function(a) {
            		var t = this, aid = a.id, l = aid.length, id = aid.substr(0, l - 5), mode = aid.substr(l - 4),
            			I = t.I, ed = tinyMCE.get(id), qttb = 'qt_'+id+'_qtags', dom = tinymce.DOM;
            
            		if ( 'tmce' == mode ) {
            			if ( t.wpautop[id] )
            				I(id).value = switchEditors.wpautop( I(id).value );
            
            			if ( ed )
            				ed.show();
            			else
            				tinyMCE.execCommand("mceAddControl", false, id);
            
            			dom.hide(qttb);
            			dom.addClass(id+'-tmce', 'active');
            			dom.removeClass(id+'-html', 'active');
            
            		} else if ( 'html' == mode ) {
            			if ( ed ) {
            				if ( t.wpautop[id] === false ) {
            					switchEditors['old_wp_Nop'] = switchEditors._wp_Nop;
            					switchEditors._wp_Nop = function(c){ return c; };
            					ed.hide();
            					switchEditors._wp_Nop = switchEditors['old_wp_Nop'];
            				} else {
            					ed.hide();
            				}
            			}
            			dom.show(qttb);
            			dom.addClass(id+'-html', 'active');
            			dom.removeClass(id+'-tmce', 'active');
            		}
            	},
            
            	I : function(id) {
            		return document.getElementById(id);
            	},
            
            	ed_init : function(id, settings) {
            		var t = this, set = {};
            
            		settings = settings || {};
            
            		if ( 'undefined' != typeof(tinymce) && !tinyMCE.get(id) ) {
            
            			t.wpautop[id] = settings['wpautop'] ? true : false;
            
            			tinymce.extend( set, tinyMCEPreInit.mceInit, settings );
            			set.mode = 'exact';
            			set.elements = id;
            
            			tinyMCE.init(set);
            		}
            	},
            
            	qt_init : function(id, settings) {
            		var disabled, name;
            
            		id = id || 'content';
            		settings = settings || {};
            		disabled = settings.disabled;
            		name = 'qt_'+id;
            
            		if ( typeof(QTags) != 'undefined' )
            			window[name] = new QTags(name, id, 'wp-'+id+'-editor-container', disabled);
            
            		if ( typeof(tinymce) != 'undefined' )
            			tinymce.DOM.hide('qt_'+id+'_qtags');
            	}
            }
            
            */
            ?>

<script type="text/javascript">
<?php 
            if (!is_admin()) {
                echo 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";';
            }
            ?>

var wpEditor={wpautop:{<?php 
            echo $id . ':';
            echo $this->settings[$id]['wpautop'] ? 'true' : 'false';
            ?>
},s:function(i){var k=this,d=i.id,e=d.length,c=d.substr(0,e-5),g=d.substr(e-4),j=k.I,h=tinyMCE.get(c),b="qt_"+c+"_qtags",f=tinymce.DOM;if("tmce"==g){if(k.wpautop[c]){j(c).value=switchEditors.wpautop(j(c).value)}if(h){h.show()}else{tinyMCE.execCommand("mceAddControl",false,c)}f.hide(b);f.addClass(c+"-tmce","active");f.removeClass(c+"-html","active")}else{if("html"==g){if(h){if(k.wpautop[c]===false){switchEditors.old_wp_Nop=switchEditors._wp_Nop;switchEditors._wp_Nop=function(a){return a};h.hide();switchEditors._wp_Nop=switchEditors.old_wp_Nop}else{h.hide()}}f.show(b);f.addClass(c+"-html","active");f.removeClass(c+"-tmce","active")}}},I:function(a){return document.getElementById(a)},ed_init:function(d,b){var a=this,c={};b=b||{};if("undefined"!=typeof(tinymce)&&!tinyMCE.get(d)){a.wpautop[d]=b.wpautop?true:false;tinymce.extend(c,tinyMCEPreInit.mceInit,b);c.mode="exact";c.elements=d;tinyMCE.init(c)}},qt_init:function(d,c){var b,a;d=d||"content";c=c||{};b=c.disabled;a="qt_"+d;if(typeof(QTags)!="undefined"){window[a]=new QTags(a,d,"wp-"+d+"-editor-container",b)}if(typeof(tinymce)!="undefined"){tinymce.DOM.hide("qt_"+d+"_qtags")}}};
<?php 
            if (!empty($first_load)) {
                echo 'wpEditor.qt_init("' . $first_load . '", ' . json_encode($this->settings[$id]) . ");\n";
            }
            if (!empty($short_load)) {
                foreach ($short_load as $id) {
                    $jsn = json_encode($this->settings[$id]);
                    echo 'wpEditor.ed_init("' . $id . '", ' . $jsn . ");\n" . 'wpEditor.qt_init("' . $id . '", ' . $jsn . ");\n";
                }
            }
            ?>

</script>
<?php 
            if (!empty($first_load) && $this->media_buttons) {
                if (!is_admin()) {
                    wp_register_script('media-upload', admin_url('js/media-upload.js'), array('thickbox'), '20110113');
                }
                wp_print_scripts('media-upload');
                wp_print_styles('thickbox');
            }
        }
function editor_admin_head($hook)
{
    if ($hook == 'post.php' or $hook == 'post-new.php' or $hook == 'page-new.php' or $hook == 'page.php') {
        wp_tiny_mce();
    }
}
Esempio n. 25
0
 public function admin_head()
 {
     if (!function_exists('wp_editor')) {
         wp_tiny_mce();
     }
 }
Esempio n. 26
0
?>
'};
var ajaxurl = '<?php 
echo admin_url('admin-ajax.php');
?>
';
//]]>
</script>

<?php 
do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
if (user_can_richedit()) {
    add_filter('teeny_mce_before_init', create_function('$a', '$a["height"] = "400"; $a["onpageload"] = ""; $a["mode"] = "textareas"; $a["editor_selector"] = "mceEditor"; return $a;'));
    wp_tiny_mce(true);
}
?>
	<script type="text/javascript">
	function insert_plain_editor(text) {
		edCanvas = document.getElementById('content');
		edInsertContent(edCanvas, text);
	}
	function set_editor(text) {
		if ( '' == text || '<p></p>' == text ) text = '<p><br /></p>';
		if ( tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, text);
	}
	function insert_editor(text) {
		if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
			tinyMCE.execCommand('mceInsertContent', false, '<p>' + decodeURI(tinymce.DOM.decode(text)) + '</p>', {format : 'raw'});
		} else {
Esempio n. 27
0
function event_newsletter($event_id = 0)
{
    //print_r($_POST);
    if (isset($_POST['action']) && $_POST['action'] == 'send_newsletter') {
        espresso_event_reminder($event_id, $_POST['email_subject'], $_POST['email_text'], $_POST['email_name']);
    }
    //echo $event_id;
    global $wpdb, $org_options;
    wp_tiny_mce(false, array("editor_selector" => "theEditor"));
    $events = $wpdb->get_results("SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE id = '" . $event_id . "'");
    foreach ($events as $event) {
        $event_id = $event->id;
        $event_name = stripslashes_deep($event->event_name);
        $event_description = stripslashes_deep($event->event_desc);
        $start_date = $event->start_date;
        $end_date = $event->end_date;
        #$start_time = $event->start_time;
        #$end_time = $event->end_time;
        $conf_mail = stripslashes_deep($event->conf_mail);
    }
    ?>
  <div id="poststuff" class="metabox-holder has-right-sidebar">
  <?php 
    event_espresso_display_right_column();
    ?>
  <div id="post-body">
<div id="post-body-content">
 <div class="metabox-holder">
			<div class="postbox">
<h3><?php 
    _e('Send an Email to the Attendees of', 'event_espresso');
    ?>
 <a href="admin.php?page=events&amp;action=edit&amp;event_id=<?php 
    echo $event_id;
    ?>
"><?php 
    echo '"' . $event_name . '"';
    ?>
</a></h3>
 <div class="inside">
  <form method="post" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
">
  <input type="hidden" name="action" value="send_newsletter"><p><strong><?php 
    _e('Use a <a href="admin.php?page=event_emails">pre-existing email</a>? ', 'event_espresso');
    ?>
</strong> <?php 
    echo espresso_db_dropdown('id', 'email_name', EVENTS_EMAIL_TABLE, 'email_name', 'desc') . ' <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=email_manager_info"><img src="' . EVENT_ESPRESSO_PLUGINFULLURL . '/images/question-frame.png" width="16" height="16" /></a>';
    ?>
 </p>
  <p><strong><?php 
    _e('OR', 'event_espresso');
    ?>
</strong></p>
   <ul>
    <li><label for="email_subject"><?php 
    _e('Email Subject Line', 'event_espresso');
    ?>
</label> <input type="text" name="email_subject" size="25"></li>
   <li><label for="email_text"><?php 
    _e('Email Text', 'event_espresso');
    ?>
</label><br />
   <!-- <textarea class="theEditor" id="email_text" name="email_text"></textarea> -->
   <?php 
    wp_editor('', 'email_text');
    ?>
      <br />
<a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_email_info"><?php 
    _e('View Custom Email Tags', 'event_espresso');
    ?>
</a>  | <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_email_example"> <?php 
    _e('Email Example', 'event_espresso');
    ?>
</a>
   </li>
   <li>
    <p>
            <input class="button-primary" type="submit" name="Submit" value="<?php 
    _e('Send Email to Attendees');
    ?>
" id="add_new_email" />
            </p>
    </li>
   </ul>
     </form>
    
     </div>
	</div>
    <p><a href="admin.php?page=events&amp;action=edit&amp;event_id=<?php 
    echo $event_id;
    ?>
"><?php 
    _e('<< Back to', 'event_espresso');
    ?>
 <?php 
    echo $event_name;
    ?>
</a></p>
</div>
</div>
</div>
</div>
<div id="email_manager_info" style="display:none">
<h2><?php 
    _e('Pre-existing Emails', 'event_espresso');
    ?>
</h2>
      <p><?php 
    _e('This will override the custom email below if selected.', 'event_espresso');
    ?>
</p>
</div>
<?php 
    echo event_espresso_custom_email_info();
}
/**
 * Show the Post Body Template.
 * @param integer $width The width of the editor in pixels.
 */
function cpm_show_post_body_template($width = 435)
{
    global $cpm_config;
    ?>

  <?php 
    if (function_exists('wp_tiny_mce')) {
        wp_tiny_mce();
    }
    ?>

  <table class="form-table">
    <tr>
      <td>
        <strong>Post body template:</strong>
        <div id="title"></div>
        <div id="<?php 
    echo user_can_richedit() ? 'postdivrich' : 'postdiv';
    ?>
" class="postarea">
          <?php 
    the_editor(cpm_option('cpm-default-post-content'));
    ?>
        </div>

        <br />
        (<em><?php 
    _e("Available wildcards:", 'comicpress-manager');
    ?>
</em>)
        <ul>
          <li><strong>{category}</strong>: <?php 
    _e("The name of the category", 'comicpress-manager');
    ?>
</li>
          <li><strong>{date}</strong>: <?php 
    printf(__("The date of the comic (ex: <em>%s</em>)", 'comicpress-manager'), date("F j, Y", time()));
    ?>
</li>
          <li><strong>{title}</strong>: <?php 
    _e("The title of the comic", 'comicpress-manager');
    ?>
</li>
        </ul>
      </td>
    </tr>
  </table>
  <?php 
}
Esempio n. 29
0
/**
 * @since 2.1.0
 * @deprecated 2.1.0
 * @deprecated Use wp_editor().
 * @see wp_editor()
 */
function tinymce_include()
{
    _deprecated_function(__FUNCTION__, '2.1', 'wp_editor()');
    wp_tiny_mce();
}
function black_studio_tinymce_footer_scripts()
{
    // Setup for WP 3.1 and previous versions
    if (get_bloginfo('version') < "3.2") {
        if (function_exists('wp_tiny_mce')) {
            wp_tiny_mce(false, array());
        }
        if (function_exists('wp_tiny_mce_preload_dialogs')) {
            wp_tiny_mce_preload_dialogs();
        }
    } else {
        if (get_bloginfo('version') < "3.3") {
            if (function_exists('wp_tiny_mce')) {
                wp_tiny_mce(false, array());
            }
            if (function_exists('wp_preload_dialogs')) {
                wp_preload_dialogs(array('plugins' => 'wpdialogs,wplink,wpfullscreen'));
            }
        } else {
            wp_editor('', 'black-studio-tinymce-widget');
        }
    }
}