本文整理汇总了PHP中user_can_richedit函数的典型用法代码示例。如果您正苦于以下问题:PHP user_can_richedit函数的具体用法?PHP user_can_richedit怎么用?PHP user_can_richedit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_can_richedit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sb_admin_load
function sb_admin_load()
{
global $sb_admin;
// Load the scripts for handling metaboxes
wp_enqueue_script('common');
wp_enqueue_script('wp-lists');
wp_enqueue_script('postbox');
// Load StartBox-specific scripts and styles
wp_enqueue_script('colorbox');
wp_enqueue_script('jquery-ajaxuploader', SCRIPTS_URL . '/jquery.ajaxupload.js');
wp_enqueue_script('jquery-colorpicker', SCRIPTS_URL . '/colorpicker/js/colorpicker.js');
wp_enqueue_script('sb-admin', SCRIPTS_URL . '/admin.js', array('jquery-colorpicker'));
wp_enqueue_style('colorpicker', SCRIPTS_URL . '/colorpicker/css/colorpicker.css');
wp_enqueue_style('sb-admin', STYLES_URL . '/admin.css');
wp_enqueue_style('colorbox');
// Load scripts for TinyMCE (Credit: Lee Doel)
if (user_can_richedit()) {
wp_enqueue_script('editor');
wp_enqueue_script('media-upload');
wp_enqueue_style('thickbox');
add_action('admin_head', 'wp_tiny_mce');
}
if (sb_get_option('reset')) {
sb_set_default_options();
wp_redirect(admin_url('admin.php?page=sb_admin&reset=true'));
}
}
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:27,代码来源:admin.php
示例2: parse_settings
public static function parse_settings($editor_id, $settings)
{
$set = wp_parse_args($settings, array('wpautop' => true, 'media_buttons' => true, 'textarea_name' => $editor_id, 'textarea_rows' => 20, 'tabindex' => '', 'tabfocus_elements' => ':prev,:next', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => true));
self::$this_tinymce = $set['tinymce'] && user_can_richedit();
self::$this_quicktags = (bool) $set['quicktags'];
if (self::$this_tinymce) {
self::$has_tinymce = true;
}
if (self::$this_quicktags) {
self::$has_quicktags = true;
}
if (empty($set['editor_height'])) {
return $set;
}
if ('content' === $editor_id) {
// A cookie (set when a user resizes the editor) overrides the height.
$cookie = (int) get_user_setting('ed_size');
// Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
if (!$cookie && isset($_COOKIE['TinyMCE_content_size'])) {
parse_str($_COOKIE['TinyMCE_content_size'], $cookie);
$cookie = $cookie['ch'];
}
if ($cookie) {
$set['editor_height'] = $cookie;
}
}
if ($set['editor_height'] < 50) {
$set['editor_height'] = 50;
} elseif ($set['editor_height'] > 5000) {
$set['editor_height'] = 5000;
}
return $set;
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:33,代码来源:class-wp-editor.php
示例3: parse_settings
/**
* Parse default arguments for the editor instance.
*
* @param string $editor_id ID for the current editor instance.
* @param array $settings {
* Array of editor arguments.
*
* @type bool $wpautop Whether to use wpautop(). Default true.
* @type bool $media_buttons Whether to show the Add Media/other media buttons.
* @type string $default_editor When both TinyMCE and Quicktags are used, set which
* editor is shown on page load. Default empty.
* @type bool $drag_drop_upload Whether to enable drag & drop on the editor uploading. Default false.
* Requires the media modal.
* @type string $textarea_name Give the textarea a unique name here. Square brackets
* can be used here. Default $editor_id.
* @type int $textarea_rows Number rows in the editor textarea. Default 20.
* @type string|int $tabindex Tabindex value to use. Default empty.
* @type string $tabfocus_elements The previous and next element ID to move the focus to
* when pressing the Tab key in TinyMCE. Defualt ':prev,:next'.
* @type string $editor_css Intended for extra styles for both Visual and Text editors.
* Should include <style> tags, and can use "scoped". Default empty.
* @type string $editor_class Extra classes to add to the editor textarea elemen. Default empty.
* @type bool $teeny Whether to output the minimal editor config. Examples include
* Press This and the Comment editor. Default false.
* @type bool $dfw Whether to replace the default fullscreen with "Distraction Free
* Writing". DFW requires specific DOM elements and css). Default false.
* @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to
* TinyMCE using an array. Default true.
* @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to
* Quicktags using an array. Default true.
* }
* @return array Parsed arguments array.
*/
public static function parse_settings($editor_id, $settings)
{
$set = wp_parse_args($settings, array('wpautop' => true, 'media_buttons' => true, 'default_editor' => '', 'drag_drop_upload' => false, 'textarea_name' => $editor_id, 'textarea_rows' => 20, 'tabindex' => '', 'tabfocus_elements' => ':prev,:next', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => true));
self::$this_tinymce = $set['tinymce'] && user_can_richedit();
if (self::$this_tinymce) {
if (false !== strpos($editor_id, '[')) {
self::$this_tinymce = false;
_deprecated_argument('wp_editor()', '3.9', 'TinyMCE editor IDs cannot have brackets.');
}
}
self::$this_quicktags = (bool) $set['quicktags'];
if (self::$this_tinymce) {
self::$has_tinymce = true;
}
if (self::$this_quicktags) {
self::$has_quicktags = true;
}
if (empty($set['editor_height'])) {
return $set;
}
if ('content' === $editor_id) {
// A cookie (set when a user resizes the editor) overrides the height.
$cookie = (int) get_user_setting('ed_size');
if ($cookie) {
$set['editor_height'] = $cookie;
}
}
if ($set['editor_height'] < 50) {
$set['editor_height'] = 50;
} elseif ($set['editor_height'] > 5000) {
$set['editor_height'] = 5000;
}
return $set;
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:67,代码来源:class-wp-editor.php
示例4: __construct
/**
* Categorize constructor
*
* @return void
**/
function __construct () {
parent::__construct();
if (!empty($_GET['id']) && !isset($_GET['a'])) {
wp_enqueue_script('postbox');
if ( user_can_richedit() ) {
wp_enqueue_script('editor');
wp_enqueue_script('quicktags');
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 20 );
}
ecart_enqueue_script('colorbox');
ecart_enqueue_script('editors');
ecart_enqueue_script('category-editor');
ecart_enqueue_script('priceline');
ecart_enqueue_script('ocupload');
ecart_enqueue_script('swfupload');
ecart_enqueue_script('ecart-swfupload-queue');
do_action('ecart_category_editor_scripts');
add_action('admin_head',array(&$this,'layout'));
} elseif (!empty($_GET['a']) && $_GET['a'] == 'arrange') {
ecart_enqueue_script('category-arrange');
do_action('ecart_category_arrange_scripts');
add_action('admin_print_scripts',array(&$this,'arrange_cols'));
} elseif (!empty($_GET['a']) && $_GET['a'] == 'products') {
ecart_enqueue_script('products-arrange');
do_action('ecart_category_products_arrange_scripts');
add_action('admin_print_scripts',array(&$this,'products_cols'));
} else add_action('admin_print_scripts',array(&$this,'columns'));
do_action('ecart_category_admin_scripts');
add_action('load-ecart_page_ecart-categories',array(&$this,'workflow'));
}
开发者ID:robbiespire,项目名称:paQui,代码行数:39,代码来源:Categorize.php
示例5: display_field
public function display_field($field, $group_index = 1, $field_index = 1)
{
global $mf_domain;
$class = '';
$max = '';
if (isset($field['options']['max_length'])) {
$max = sprintf('maxlength="%d"', $field['options']['height'] * $field['options']['width']);
}
$value = $field['input_value'];
$output = '';
$output .= '<div class="multiline_custom_field">';
if (mf_settings::get('hide_visual_editor') == '1') {
$field['options']['hide_visual'] = 1;
}
if ($field['options']['hide_visual'] == 0 && user_can_richedit()) {
$output .= sprintf('<div class="tab_multi_mf">');
$output .= sprintf('<a onclick="del_editor(\'%s\');" class="edButtonHTML_mf">HTML</a>', $field['input_id']);
$output .= sprintf('<a onclick="add_editor(\'%s\');" class="edButtonHTML_mf current" >Visual</a>', $field['input_id']);
$output .= sprintf('</div><br /><br />');
$class = 'pre_editor add_editor_mf';
if (mf_settings::get('dont_remove_tags') != '1') {
$value = apply_filters('the_editor_content', $value);
}
}
if ($field['options']['hide_visual'] == 0 && user_can_richedit()) {
printf('<div style="display: none1" id="wp-%s-media-buttons" class="wp-media-buttons mf_media_button_div" >', $field['input_id']);
require_once ABSPATH . 'wp-admin/includes/media.php';
media_buttons($field['input_id']);
printf('</div>');
}
$output .= sprintf('<textarea %s class="mf_editor %s" id="%s" name="%s" rows="%s" cols="%s" %s >%s</textarea>', $field['input_validate'], $class, $field['input_id'], $field['input_name'], $field['options']['height'], $field['options']['width'], $max, $value);
$output .= '</div>';
return $output;
}
开发者ID:GafaMX,项目名称:dev_funciones_basicas,代码行数:34,代码来源:multiline_field.php
示例6: parse_settings
public static function parse_settings($editor_id, $settings) {
$set = wp_parse_args( $settings, array(
'wpautop' => true, // use wpautop?
'media_buttons' => true, // show insert/upload button(s)
'textarea_name' => $editor_id, // set the textarea name to something different, square brackets [] can be used here
'textarea_rows' => get_option('default_post_edit_rows', 10), // rows="..."
'tabindex' => '',
'editor_css' => '', // intended for extra styles for both visual and HTML editors buttons, needs to include the <style> tags, can use "scoped".
'editor_class' => '', // add extra class(es) to the editor textarea
'teeny' => false, // output the minimal editor config used in Press This
'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
) );
self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );
self::$this_quicktags = (bool) $set['quicktags'];
if ( self::$this_tinymce )
self::$has_tinymce = true;
if ( self::$this_quicktags )
self::$has_quicktags = true;
return $set;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:26,代码来源:class-wp-editor.php
示例7: __construct
/**
* Store constructor
*
* @return void
**/
function __construct () {
parent::__construct();
if (!empty($_GET['id'])) {
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('suggest');
wp_enqueue_script('postbox');
if ( user_can_richedit() ) {
wp_enqueue_script('editor');
wp_enqueue_script('quicktags');
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 20 );
}
ecart_enqueue_script('colorbox');
ecart_enqueue_script('editors');
ecart_enqueue_script('scalecrop');
ecart_enqueue_script('calendar');
ecart_enqueue_script('product-editor');
ecart_enqueue_script('priceline');
ecart_enqueue_script('ocupload');
ecart_enqueue_script('swfupload');
ecart_enqueue_script('ecart-swfupload-queue');
do_action('ecart_product_editor_scripts');
add_action('admin_head',array(&$this,'layout'));
} elseif (!empty($_GET['f']) && $_GET['f'] == 'i') {
do_action('ecart_inventory_manager_scripts');
add_action('admin_print_scripts',array(&$this,'inventory_cols'));
} else add_action('admin_print_scripts',array(&$this,'columns'));
add_action('load-ecart_page_ecart-products',array(&$this,'workflow'));
do_action('ecart_product_admin_scripts');
// Load the search model for indexing
require_once(ECART_MODEL_PATH."/Search.php");
new ContentParser();
add_action('ecart_product_saved',array(&$this,'index'),99,1);
}
开发者ID:robbiespire,项目名称:paQui,代码行数:40,代码来源:Warehouse.php
示例8: load_admin_scripts
public function load_admin_scripts($hook)
{
global $sc_settings_page;
if ($hook != $sc_settings_page) {
return;
}
wp_enqueue_script('word-count');
wp_enqueue_script('post');
if (user_can_richedit()) {
wp_enqueue_script('editor');
}
add_thickbox();
wp_enqueue_script('media-upload');
wp_enqueue_media();
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
wp_enqueue_script('jquery-ui-slider');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-effects-core');
wp_enqueue_script('jquery-effects-slide');
wp_enqueue_style('jquery-ui-style', '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css');
// Codemirror
// wp_enqueue_script( 'codemirror-js', plugins_url( '/assets/codemirror-compressed.js', SC_ADS_DIR ), false, false, true );
// wp_enqueue_script( 'codemirror-closebrackets-js', plugins_url( '/assets/codemirror-closebrackets.js', SC_ADS_DIR ), false, false, true );
// wp_enqueue_style( 'codemirror-css', plugins_url( '/assets/codemirror.css', SC_ADS_DIR ) );
// Admin Assets
wp_enqueue_script('sc-ads-admin-js', plugins_url('/assets/admin-scripts.js', SC_ADS_DIR), array('jquery', 'wp-color-picker'), false, true);
wp_enqueue_style('sc-ads-admin-css', plugins_url('/assets/admin-style.css', SC_ADS_DIR));
}
开发者ID:developmentDM2,项目名称:The-Haute-Mess,代码行数:29,代码来源:class-scsa-admin.php
示例9: admin_scripts
function admin_scripts()
{
add_action('admin_print_footer_scripts', 'wp_tiny_mce', 25);
if (user_can_richedit()) {
wp_enqueue_script('editor');
}
}
开发者ID:AhmeddSayed,项目名称:MM_Portal,代码行数:7,代码来源:TouAppController.php
示例10: render_set_correct_default_editor
/**
* @test
*/
public function render_set_correct_default_editor()
{
$field_options = array('type' => 'tinymce', 'label' => 'A TinyMCE input', 'default_editor' => 'tmce');
/* @var $base_field SiteOrigin_Widget_Field_Textarea */
$field = new SiteOrigin_Widget_Field_TinyMCE('tinymce_input', 'tinymce_input_id', 'tinymce_input_name', $field_options);
$field_output = get_field_render_output($field);
$this->assertTrue(user_can_richedit());
$this->assertContains('tmce-active', $field_output);
}
开发者ID:azghanvi,项目名称:so-widgets-bundle,代码行数:12,代码来源:test-tinymce.class.php
示例11: display
/**
* Displays the input control for the field.
*
* @since 0.5.0
* @param string $val the current value of the field
* @param bool $echo whether to echo the output (default is true)
* @return string the HTML output of the field control
*/
public function display($val, $echo = true)
{
$wp_editor_settings = array('textarea_name' => $this->args['name'], 'textarea_rows' => $this->args['rows'], 'editor_class' => $this->args['class'], 'default_editor' => user_can_richedit() ? 'tinymce' : 'html', 'wpautop' => true, 'media_buttons' => true, 'quicktags' => array('buttons' => 'strong,em,u,link,block,del,ins,img,ul,ol,li,code,close'), 'tinymce' => array('toolbar1' => 'bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,spellchecker,wp_adv'));
ob_start();
wp_editor($val, $this->args['id'], $wp_editor_settings);
$output = ob_get_clean();
if ($echo) {
echo $output;
}
return $output;
}
开发者ID:felixarntz,项目名称:wpdlib,代码行数:19,代码来源:Wysiwyg.php
示例12: parse_settings
public static function parse_settings($editor_id, $settings)
{
$set = nxt_parse_args($settings, array('nxtautop' => true, 'media_buttons' => true, 'textarea_name' => $editor_id, 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => true));
self::$this_tinymce = $set['tinymce'] && user_can_richedit();
self::$this_quicktags = (bool) $set['quicktags'];
if (self::$this_tinymce) {
self::$has_tinymce = true;
}
if (self::$this_quicktags) {
self::$has_quicktags = true;
}
return $set;
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:13,代码来源:class-nxt-editor.php
示例13: init
/**
* Kick things off for the shortcode generator
*
* @since 1.3.0.2
*/
public function init()
{
if ($this->shortcode_tag) {
$this->self = get_class($this);
$this->errors = array();
$this->required = array();
// Generate the fields, errors, and requirements
$fields = $this->get_fields();
$defaults = array('btn_close' => esc_html__('Close', 'give'), 'btn_okay' => esc_html__('Insert Shortcode', 'give'), 'errors' => $this->errors, 'fields' => $fields, 'label' => '[' . $this->shortcode_tag . ']', 'required' => $this->required, 'title' => esc_html__('Insert Shortcode', 'give'));
if (user_can_richedit()) {
Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
}
}
}
开发者ID:wordimpress,项目名称:give,代码行数:19,代码来源:abstract-shortcode-generator.php
示例14: parse_settings
/**
* Parse default arguments for the editor instance.
*
* @param string $editor_id ID for the current editor instance.
* @param array $settings {
* Array of editor arguments.
*
* @type bool $wpautop Whether to use wpautop(). Default true.
* @type bool $media_buttons Whether to show the Add Media/other media buttons.
* @type string $default_editor When both TinyMCE and Quicktags are used, set which
* editor is shown on page load. Default empty.
* @type bool $drag_drop_upload Whether to enable drag & drop on the editor uploading. Default false.
* Requires the media modal.
* @type string $textarea_name Give the textarea a unique name here. Square brackets
* can be used here. Default $editor_id.
* @type int $textarea_rows Number rows in the editor textarea. Default 20.
* @type string|int $tabindex Tabindex value to use. Default empty.
* @type string $tabfocus_elements The previous and next element ID to move the focus to
* when pressing the Tab key in TinyMCE. Defualt ':prev,:next'.
* @type string $editor_css Intended for extra styles for both Visual and Text editors.
* Should include `<style>` tags, and can use "scoped". Default empty.
* @type string $editor_class Extra classes to add to the editor textarea elemen. Default empty.
* @type bool $teeny Whether to output the minimal editor config. Examples include
* Press This and the Comment editor. Default false.
* @type bool $dfw Whether to replace the default fullscreen with "Distraction Free
* Writing". DFW requires specific DOM elements and css). Default false.
* @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to
* TinyMCE using an array. Default true.
* @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to
* Quicktags using an array. Default true.
* }
* @return array Parsed arguments array.
*/
public static function parse_settings($editor_id, $settings)
{
/**
* Filter the wp_editor() settings.
*
* @since 4.0.0
*
* @see _WP_Editors()::parse_settings()
*
* @param array $settings Array of editor arguments.
* @param string $editor_id ID for the current editor instance.
*/
$settings = apply_filters('wp_editor_settings', $settings, $editor_id);
$set = wp_parse_args($settings, array('wpautop' => true, 'media_buttons' => true, 'default_editor' => '', 'drag_drop_upload' => false, 'textarea_name' => $editor_id, 'textarea_rows' => 20, 'tabindex' => '', 'tabfocus_elements' => ':prev,:next', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, '_content_editor_dfw' => false, 'tinymce' => true, 'quicktags' => true));
self::$this_tinymce = $set['tinymce'] && user_can_richedit();
if (self::$this_tinymce) {
if (false !== strpos($editor_id, '[')) {
self::$this_tinymce = false;
_deprecated_argument('wp_editor()', '3.9', 'TinyMCE editor IDs cannot have brackets.');
}
}
self::$this_quicktags = (bool) $set['quicktags'];
if (self::$this_tinymce) {
self::$has_tinymce = true;
}
if (self::$this_quicktags) {
self::$has_quicktags = true;
}
if (empty($set['editor_height'])) {
return $set;
}
if ('content' === $editor_id && empty($set['tinymce']['wp_autoresize_on'])) {
// A cookie (set when a user resizes the editor) overrides the height.
$cookie = (int) get_user_setting('ed_size');
// Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
if (!$cookie && isset($_COOKIE['TinyMCE_content_size'])) {
parse_str($_COOKIE['TinyMCE_content_size'], $cookie);
$cookie = $cookie['ch'];
}
if ($cookie) {
$set['editor_height'] = $cookie;
}
}
if ($set['editor_height'] < 50) {
$set['editor_height'] = 50;
} elseif ($set['editor_height'] > 5000) {
$set['editor_height'] = 5000;
}
return $set;
}
开发者ID:sb-xs,项目名称:que-pour-elle,代码行数:83,代码来源:class-wp-editor.php
示例15: parse_settings
public static function parse_settings($editor_id, $settings) {
$set = wp_parse_args( $settings, array(
'wpautop' => true, // use wpautop?
'media_buttons' => true, // show insert/upload button(s)
'textarea_name' => $editor_id, // set the textarea name to something different, square brackets [] can be used here
'textarea_rows' => 20,
'tabindex' => '',
'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE
'editor_css' => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped".
'editor_class' => '', // add extra class(es) to the editor textarea
'teeny' => false, // output the minimal editor config used in Press This
'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
) );
self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );
self::$this_quicktags = (bool) $set['quicktags'];
if ( self::$this_tinymce )
self::$has_tinymce = true;
if ( self::$this_quicktags )
self::$has_quicktags = true;
if ( empty( $set['editor_height'] ) )
return $set;
if ( 'content' === $editor_id ) {
// A cookie (set when a user resizes the editor) overrides the height.
$cookie = (int) get_user_setting( 'ed_size' );
// Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
if ( ! $cookie && isset( $_COOKIE['TinyMCE_content_size'] ) ) {
parse_str( $_COOKIE['TinyMCE_content_size'], $cookie );
$cookie = $cookie['ch'];
}
if ( $cookie )
$set['editor_height'] = $cookie;
}
if ( $set['editor_height'] < 50 )
$set['editor_height'] = 50;
elseif ( $set['editor_height'] > 5000 )
$set['editor_height'] = 5000;
return $set;
}
开发者ID:niharshah31,项目名称:wordpress,代码行数:49,代码来源:class-wp-editor.php
示例16: __construct
/**
* Store constructor
*
* @author Jonathan Davis
* @since 1.1
* @version 1.2
*
* @return void
**/
public function __construct()
{
parent::__construct();
Shopping::restore('worklist', $this->worklist);
if ('off' == shopp_setting('inventory')) {
array_splice($this->views, 4, 1);
}
if (isset($_GET['view']) && in_array($_GET['view'], $this->views)) {
$this->view = $_GET['view'];
}
if (get_current_screen()) {
get_current_screen()->post_type = ShoppProduct::$posttype;
}
if (!empty($_GET['id'])) {
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('postbox');
wp_enqueue_script('wp-lists');
if (user_can_richedit()) {
wp_enqueue_script('editor');
wp_enqueue_script('quicktags');
add_action('admin_print_footer_scripts', 'wp_tiny_mce', 20);
}
shopp_enqueue_script('colorbox');
shopp_enqueue_script('editors');
shopp_enqueue_script('scalecrop');
shopp_enqueue_script('calendar');
shopp_enqueue_script('product-editor');
shopp_enqueue_script('priceline');
shopp_enqueue_script('ocupload');
shopp_enqueue_script('swfupload');
shopp_enqueue_script('jquery-tmpl');
shopp_enqueue_script('suggest');
shopp_enqueue_script('search-select');
do_action('shopp_product_editor_scripts');
add_action('admin_head', array(&$this, 'layout'));
} else {
add_action('load-' . $this->screen, array($this, 'loader'));
add_action('admin_print_scripts', array($this, 'columns'));
}
if ('inventory' == $this->view && shopp_setting_enabled('inventory')) {
do_action('shopp_inventory_manager_scripts');
}
add_action('load-' . $this->screen, array($this, 'workflow'));
do_action('shopp_product_admin_scripts');
new ContentParser();
add_action('shopp_product_saved', array($this, 'index'), 99, 1);
}
开发者ID:forthrobot,项目名称:inuvik,代码行数:56,代码来源:Warehouse.php
示例17: admin_js
function admin_js()
{
if (isset($_GET) and isset($_GET['page']) and ($_GET['page'] == 'formidable-entries' or $_GET['page'] == 'formidable-entry-templates' or $_GET['page'] == 'formidable-import')) {
if (!function_exists('wp_editor')) {
add_action('admin_print_footer_scripts', 'wp_tiny_mce', 25);
add_filter('tiny_mce_before_init', array(&$this, 'remove_fullscreen'));
if (user_can_richedit()) {
wp_enqueue_script('editor');
wp_enqueue_script('media-upload');
}
wp_enqueue_script('common');
wp_enqueue_script('post');
}
if ($_GET['page'] == 'formidable-entries') {
wp_enqueue_script('jquery-ui-datepicker');
}
}
}
开发者ID:moscarar,项目名称:cityhow,代码行数:18,代码来源:FrmProEntriesController.php
示例18: kws_rich_text_tags
function kws_rich_text_tags()
{
global $wpdb, $user, $current_user, $pagenow, $wp_version;
load_plugin_textdomain('rich-text-tags', false, '/rich-text-tags/languages');
// I18n
// ADD EVENTS
if ($pagenow == 'edit-tags.php' || $pagenow == 'categories.php') {
if (!user_can_richedit()) {
return;
}
$taxonomies = get_taxonomies();
foreach ($taxonomies as $tax) {
add_action($tax . '_edit_form_fields', 'kws_add_form');
add_action($tax . '_add_form_fields', 'kws_add_form');
}
add_action('init', 'kws_rt_taxonomy_load_mce');
if ($pagenow == 'edit-tags.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && empty($_REQUEST['taxonomy'])) {
add_action('edit_term', 'kws_rt_taxonomy_save');
}
}
}
开发者ID:andychang88,项目名称:jianzhanseo.com,代码行数:21,代码来源:rich-text-tags.php
示例19: kws_rich_text_tags
function kws_rich_text_tags()
{
global $wpdb, $user, $current_user, $pagenow, $wp_version;
load_plugin_textdomain('rich-text-tags', false, '/rich-text-tags/languages');
// I18n
// ADD EVENTS
if ($pagenow == 'edit-tags.php' || $pagenow == 'categories.php' || $pagenow == 'media.php' || $pagenow == 'profile.php' || $pagenow == 'user-edit.php') {
if (!user_can_richedit()) {
return;
}
wp_enqueue_script('kws_rte', plugins_url('kws_rt_taxonomy.js', __FILE__), array('jquery'));
wp_enqueue_style('editor-buttons');
$taxonomies = get_taxonomies();
foreach ($taxonomies as $tax) {
add_action($tax . '_edit_form_fields', 'kws_add_form');
add_action($tax . '_add_form_fields', 'kws_add_form');
}
add_filter('attachment_fields_to_edit', 'kws_add_form_media', 1, 2);
add_filter('media_post_single_attachment_fields_to_edit', 'kws_add_form_media', 1, 2);
if ($pagenow == 'edit-tags.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && empty($_REQUEST['taxonomy'])) {
add_action('edit_term', 'kws_rt_taxonomy_save');
}
foreach (array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description') as $filter) {
remove_filter($filter, 'wp_filter_kses');
}
add_action('show_user_profile', 'kws_add_form', 1);
add_action('edit_user_profile', 'kws_add_form', 1);
add_action('edit_user_profile_update', 'kws_rt_taxonomy_save');
if (empty($_REQUEST['action'])) {
add_filter('get_terms', 'kws_shorten_term_description');
}
}
// Enable shortcodes in category, taxonomy, tag descriptions
if (function_exists('term_description')) {
add_filter('term_description', 'do_shortcode');
} else {
add_filter('category_description', 'do_shortcode');
}
}
开发者ID:JackBrit,项目名称:Team-London-Bridge,代码行数:39,代码来源:rich-text-tags.php
示例20: __construct
/**
* Categorize constructor
*
* @return void
* @author Jonathan Davis
**/
public function __construct()
{
parent::__construct();
Shopping::restore('worklist', $this->worklist);
if ('shopp-tags' == $_GET['page']) {
wp_redirect(add_query_arg(array('taxonomy' => ProductTag::$taxon), admin_url('edit-tags.php')));
return;
}
if (!empty($_GET['id']) && !isset($_GET['a'])) {
wp_enqueue_script('postbox');
wp_enqueue_script('swfupload-all');
if (user_can_richedit()) {
wp_enqueue_script('editor');
wp_enqueue_script('quicktags');
add_action('admin_print_footer_scripts', 'wp_tiny_mce', 20);
}
shopp_enqueue_script('colorbox');
shopp_enqueue_script('editors');
shopp_enqueue_script('category-editor');
shopp_enqueue_script('priceline');
shopp_enqueue_script('ocupload');
shopp_enqueue_script('swfupload');
shopp_enqueue_script('shopp-swfupload-queue');
do_action('shopp_category_editor_scripts');
add_action('admin_head', array($this, 'layout'));
} elseif (!empty($_GET['a']) && $_GET['a'] == 'arrange') {
shopp_enqueue_script('category-arrange');
do_action('shopp_category_arrange_scripts');
add_action('admin_print_scripts', array($this, 'arrange_cols'));
} elseif (!empty($_GET['a']) && $_GET['a'] == 'products') {
shopp_enqueue_script('products-arrange');
do_action('shopp_category_products_arrange_scripts');
add_action('admin_print_scripts', array($this, 'products_cols'));
} else {
add_action('admin_print_scripts', array($this, 'columns'));
}
do_action('shopp_category_admin_scripts');
add_action('load-' . $this->screen, array($this, 'workflow'));
}
开发者ID:BlessySoftwares,项目名称:anvelocom,代码行数:45,代码来源:Categorize.php
注:本文中的user_can_richedit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论