本文整理汇总了PHP中csl18n函数的典型用法代码示例。如果您正苦于以下问题:PHP csl18n函数的具体用法?PHP csl18n怎么用?PHP csl18n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了csl18n函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name, $path, $definition, $native)
{
$this->name = $name;
$this->path = $path;
$this->definition = $definition;
$this->definition->register_shortcodes = true;
$this->definition->shortcodes = array();
if (isset($this->definition->shortcode_name) && is_scalar($this->definition->shortcode_name)) {
$this->shortcode_name = $this->definition->shortcode_name;
} else {
if (isset($this->definition->shortcode_prefix) && is_scalar($this->definition->shortcode_prefix)) {
$this->shortcode_prefix = $this->definition->shortcode_prefix;
}
$this->shortcode_name = $this->shortcode_prefix . str_replace('-', '_', $this->name);
}
$this->hook_prefix = "cs_element_{$this->name}_";
if ($native) {
add_filter($this->hook_prefix . 'ui', array($this, 'native_icons'), 20);
$this->definition->text_domain = csl18n();
}
if (isset($this->definition->text_domain)) {
$this->text_domain = $this->definition->text_domain;
}
if (isset($this->definition->preserve_content)) {
$this->preserve_content = $this->definition->preserve_content;
}
}
示例2: __construct
public function __construct()
{
include_once ABSPATH . '/wp-admin/includes/plugin.php';
deactivate_plugins(array('x-shortcodes/x-shortcodes.php'));
remove_action('init', 'x_shortcodes_init');
Cornerstone_Admin_Notice::updated(__('<strong>X – Shortcodes has been deactivated</strong>. Cornerstone will now provide your site with those shortcodes, and many new ones.', csl18n()), true);
}
示例3: controls
public function controls()
{
//
// Content.
//
$this->addControl('prefix', 'text', __('Prefix, Strings, & Suffix', csl18n()), __('Enter in your prefix text in the first input and suffix text in the last input. Typing strings go in the textarea and are separated by a new line.', csl18n()), __('This is the ', csl18n()));
$this->addControl('strings', 'textarea', NULL, NULL, __('first string' . "\n" . 'second string' . "\n" . 'third string', csl18n()), array('expandable' => false));
$this->addControl('suffix', 'text', NULL, NULL, __(' of the sentence.', csl18n()));
$this->addControl('tag', 'select', __('Tag', csl18n()), __('Specify the HTML tag you would like to use to output this shortcode.', csl18n()), 'h3', array('choices' => array(array('value' => 'h1', 'label' => __('h1', csl18n())), array('value' => 'h2', 'label' => __('h2', csl18n())), array('value' => 'h3', 'label' => __('h3', csl18n())), array('value' => 'h4', 'label' => __('h4', csl18n())), array('value' => 'h5', 'label' => __('h5', csl18n())), array('value' => 'h6', 'label' => __('h6', csl18n())), array('value' => 'p', 'label' => __('p', csl18n())), array('value' => 'div', 'label' => __('div', csl18n())), array('value' => 'span', 'label' => __('span', csl18n())))));
if (apply_filters('cornerstone_looks_like_support', false)) {
$this->addControl('looks_like', 'select', __('Looks Like', csl18n()), __('Allows you to alter the appearance of the heading, while still outputting it as a different HTML tag.', csl18n()), 'h3', array('choices' => array(array('value' => 'h1', 'label' => __('h1', csl18n())), array('value' => 'h2', 'label' => __('h2', csl18n())), array('value' => 'h3', 'label' => __('h3', csl18n())), array('value' => 'h4', 'label' => __('h4', csl18n())), array('value' => 'h5', 'label' => __('h5', csl18n())), array('value' => 'h6', 'label' => __('h6', csl18n()))), 'condition' => array('tag' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))));
}
//
// Timing.
//
$this->addControl('type_speed', 'number', __('Type Speed (ms)', csl18n()), __('How fast in milliseconds each character should appear.', csl18n()), 50);
$this->addControl('start_delay', 'number', __('Start Delay (ms)', csl18n()), __('How long in milliseconds until typing should start.', csl18n()), 0);
$this->addControl('back_speed', 'number', __('Back Speed (ms)', csl18n()), __('How fast in milliseconds each character should be deleted.', csl18n()), 50);
$this->addControl('back_delay', 'number', __('Back Delay (ms)', csl18n()), __('How long in milliseconds each string should remain visible.', csl18n()), 3000);
//
// Functionality.
//
$this->addControl('loop', 'toggle', __('Loop', csl18n()), __('Enable to have the typing effect loop continuously.', csl18n()), false);
$this->addControl('show_cursor', 'toggle', __('Show Cursor', csl18n()), __('Enable to display a cursor for your typing effect.', csl18n()), true);
$this->addControl('cursor', 'text', __('Cursor', csl18n()), __('Specify the character you would like to use for your cursor.', csl18n()), '|', array('condition' => array('show_cursor' => true)));
}
示例4: controls
public function controls()
{
//
// General.
//
$this->addControl('title', 'title', NULL, NULL, '');
$this->addControl('text', 'textarea', __('Content', csl18n()), __('Specify the content for your Feature List Item.', csl18n()), __('This is where the text for your Feature List Item should go. It's best to keep it short and sweet.', csl18n()), array('expandable' => __('Content', csl18n())));
$this->addControl('title_color', 'color', __('Title & Content Colors', csl18n()), __('Optionally specify colors for your title and content.', csl18n()), '');
$this->addControl('text_color', 'color', NULL, NULL, '');
//
// Graphic - icon and image.
//
$this->addControl('graphic_icon', 'icon-choose', __('Icon', csl18n()), __('Specify the icon you would like to use for your Feature List Item.', csl18n()), 'ship', array('condition' => array('parent:graphic' => 'icon')));
$this->addControl('graphic_image', 'image', __('Image', csl18n()), __('Specify the image you would like to use for your Feature List Item.', csl18n()), '', array('condition' => array('parent:graphic' => 'image')));
//
// Graphic - colors.
//
$this->addControl('graphic_color', 'color', __('Graphic Color & Background Color', csl18n()), __('Specify the color and background color of your graphic.', csl18n()), '#ffffff');
$this->addControl('graphic_bg_color', 'color', NULL, NULL, '#2ecc71');
//
// Graphic - shape.
//
$this->addControl('graphic_shape', 'select', __('Graphic Shape', csl18n()), __('Choose a shape for your Feature List Item graphic.', csl18n()), 'square', array('choices' => array(array('value' => 'square', 'label' => __('Square', csl18n())), array('value' => 'rounded', 'label' => __('Rounded', csl18n())), array('value' => 'circle', 'label' => __('Circle', csl18n())), array('value' => 'hexagon', 'label' => __('Hexagon (Icon and Numbers Only)', csl18n())), array('value' => 'badge', 'label' => __('Badge (Icon and Numbers Only)', csl18n())))));
//
// Graphic - border.
//
$this->addSupport('border', array('name' => 'graphic_border_style', 'controlTitle' => __('Graphic Border', csl18n()), 'options' => array('condition' => array('graphic_shape:not' => array('hexagon', 'badge')))), array('name' => 'graphic_border_color', 'options' => array('condition' => array('graphic_shape:not' => array('hexagon', 'badge'), 'graphic_border_style:not' => 'none'))), array('name' => 'graphic_border_width', 'defaultValue' => array('2px', '2px', '2px', '2px', 'linked'), 'options' => array('condition' => array('graphic_shape:not' => array('hexagon', 'badge'), 'graphic_border_style:not' => 'none'))));
//
// Link.
//
$this->addControl('link_text', 'text', __('Link Text', csl18n()), __('Enter the text for your Feature List Item link. Leave blank to remove.', csl18n()), '');
$this->addSupport('link');
$this->addControl('link_color', 'color', __('Link Color', csl18n()), __('Specify a custom color for your Feature List Item link.', csl18n()), '');
}
示例5: __construct
/**
* Instantiate element with supplied data
*/
public function __construct()
{
$this->data = wp_parse_args($this->data(), array('name' => '', 'title' => __('Generic Element', csl18n()), 'section' => 'content', 'description' => __('Generic Element', csl18n()), 'autofocus' => '', 'controls' => array(), 'empty' => false, 'context' => 'all', 'render' => true, 'htmlhint' => false, 'delegate' => false, 'childType' => false, 'childRender' => true, 'can_preview' => true, 'active' => $this->is_active()));
if (!isset($this->data['icon'])) {
$this->data['icon'] = 'elements/' . $this->data['name'];
}
}
示例6: controls
public function controls()
{
$this->addControl('src', 'text', __('Src & Poster', csl18n()), __('Include your video URL(s) here. If using multiple sources, separate them using the pipe character (|) and place fallbacks towards the end (i.e. .webm then .mp4 then .ogv).', csl18n()), '', array('expandable' => false, 'placeholder' => home_url(__('video.mp4', csl18n()))));
// $this->addControl(
// 'm4v',
// 'text',
// __( 'MP4', csl18n() ),
// __( 'Include a .mp4 version of your video.', csl18n() ),
// ''
// );
// $this->addControl(
// 'ogv',
// 'text',
// __( 'OGV', csl18n() ),
// __( 'Include a .ogv version of your video for additional native browser support.', csl18n() ),
// ''
// );
$this->addControl('poster', 'image', NULL, NULL, '');
$this->addControl('aspect_ratio', 'select', __('Aspect Ratio', csl18n()), __('Select your aspect ratio.', csl18n()), '16:9', array('choices' => array(array('value' => '16:9', 'label' => __('16:9', csl18n())), array('value' => '5:3', 'label' => __('5:3', csl18n())), array('value' => '5:4', 'label' => __('5:4', csl18n())), array('value' => '4:3', 'label' => __('4:3', csl18n())), array('value' => '3:2', 'label' => __('3:2', csl18n())))));
$this->addControl('hide_controls', 'toggle', __('Hide Controls', csl18n()), __('Select to hide the controls on your self-hosted video.', csl18n()), false);
$this->addControl('autoplay', 'toggle', __('Autoplay', csl18n()), __('Select to automatically play your self-hosted video.', csl18n()), false);
$this->addControl('no_container', 'toggle', __('No Container', csl18n()), __('Select to remove the container around the video.', csl18n()), false);
$this->addControl('preload', 'select', __('Preload', csl18n()), __('Specifies if and how the video should be loaded when the page loads. "None" means the video is not loaded when the page loads, "Auto" loads the video entirely, and "Metadata" loads only metadata.', csl18n()), 'none', array('choices' => array(array('value' => 'none', 'label' => __('None', csl18n())), array('value' => 'auto', 'label' => __('Auto', csl18n())), array('value' => 'metadata', 'label' => __('Metadata', csl18n())))));
$this->addControl('advanced_controls', 'toggle', __('Advanced Controls', csl18n()), __('Enable video player\'s advanced controls.', csl18n()), false);
$this->addControl('muted', 'toggle', __('Mute', csl18n()), __('Mute video player\'s audio.', csl18n()), false);
}
示例7: controls
public function controls()
{
$this->addControl('heading', 'text', __('Heading', csl18n()), __('Enter the heading of your Skill Bar.', csl18n()), __('Skill Bar Title', csl18n()));
$this->addControl('percent', 'text', __('Percent', csl18n()), __('Enter the percentage of your skill and be sure to include the percentage sign (e.g. 90%).', csl18n()), '90%');
$this->addControl('bar_text', 'text', __('Bar Text', csl18n()), __('Enter in some alternate text in place of the percentage inside the Skill Bar.', csl18n()), '');
$this->addControl('bar_bg_color', 'color', __('Bar Background Color', csl18n()), __('Select the background color of your Skill Bar.', csl18n()), '');
}
示例8: controls
public function controls()
{
$this->addControl('elements', 'sortable', __('Feature List Items', csl18n()), __('Add your Feature List Items here.', csl18n()), array(array('title' => __('Feature List Item', csl18n()), 'text' => __('This is an Feature List Item that is part of an Feature List. Notice the connector between the three graphics to show that they are related.', csl18n()), 'graphic_shape' => 'circle', 'graphic_icon' => 'diamond', 'graphic_icon_color' => '#3498db', 'graphic_icon_bg_color' => '#272727'), array('title' => __('Feature List Item', csl18n()), 'text' => __('This is an Feature List Item that is part of an Feature List. Notice the connector between the three graphics to show that they are related.', csl18n()), 'graphic_shape' => 'circle', 'graphic_icon' => 'bicycle', 'graphic_icon_color' => '#9b59b6', 'graphic_icon_bg_color' => '#272727'), array('title' => __('Feature List Item', csl18n()), 'text' => __('This is an Feature List Item that is part of an Feature List. Notice the connector between the three graphics to show that they are related.', csl18n()), 'graphic_shape' => 'circle', 'graphic_icon' => 'envelope-o', 'graphic_icon_color' => '#2ecc71', 'graphic_icon_bg_color' => '#272727')), array('element' => 'feature-list-item', 'newTitle' => __('Feature List Item %s', csl18n())));
//
// Graphic.
//
$this->addControl('graphic', 'select', __('Graphic', csl18n()), __('Choose between an icon, a custom image, or incremental numbers for your graphic.', csl18n()), 'icon', array('choices' => array(array('value' => 'icon', 'label' => __('Icon', csl18n())), array('value' => 'image', 'label' => __('Image', csl18n())), array('value' => 'numbers', 'label' => __('Numbers', csl18n())))));
$this->addControl('graphic_size', 'text', __('Graphic Size', csl18n()), __('Specify the size of your graphic.', csl18n()), '60px');
//
// Alignment.
//
$this->addControl('align_h', 'select', __('Horizontal Alignment', csl18n()), __('Select the horizontal alignment of the Feature List Item.', csl18n()), 'left', array('choices' => array(array('value' => 'left', 'label' => __('Left', csl18n())), array('value' => 'right', 'label' => __('Right', csl18n())))));
$this->addControl('align_v', 'select', __('Vertical Alignment', csl18n()), __('Select the vertical alignment of the Feature List Item.', csl18n()), 'top', array('choices' => array(array('value' => 'top', 'label' => __('Top', csl18n())), array('value' => 'middle', 'label' => __('Middle', csl18n())))));
$this->addControl('side_graphic_spacing', 'text', __('Graphic Spacing', csl18n()), __('Specify an amount of spacing you want between your side graphic and the content.', csl18n()), '20px');
$this->addControl('max_width', 'text', __('Max Width', csl18n()), __('Enter in a max width for your Feature List Item if desired. This will keep your Feature List Item from stretching out too far on smaller breakpoints.', csl18n()), 'none');
//
// Connector.
//
$this->addControl('connector_style', 'select', __('Connector Style, Color, & Width', csl18n()), __('Specify the style of the connector between graphics.', csl18n()), 'dashed', array('choices' => array(array('value' => 'solid', 'label' => __('Solid', csl18n())), array('value' => 'dashed', 'label' => __('Dashed', csl18n())), array('value' => 'dotted', 'label' => __('Dotted', csl18n())))));
$this->addControl('connector_color', 'color', NULL, NULL, '#272727');
$this->addControl('connector_width', 'text', NULL, NULL, '1px');
//
// Animations.
//
$this->addControl('graphic_animation', 'select', __('Graphic Animation', csl18n()), __('Optionally add animation to your element as users scroll down the page.', csl18n()), 'none', array('choices' => Cornerstone_Control_Mixins::animationChoices()));
$this->addControl('connector_animation', 'select', __('Connector Animation', csl18n()), __('Optionally add animation to your element as users scroll down the page.', csl18n()), 'none', array('choices' => Cornerstone_Control_Mixins::animationChoices()));
$this->addControl('animation_offset', 'text', __('Animation Offset (%)', csl18n()), __('Specify a percentage value where the element should appear on screen for the animation to take place.', csl18n()), '50', array('condition' => array('graphic_animation:not' => 'none', 'connector_animation:not' => 'none')));
$this->addControl('animation_delay_initial', 'text', __('Animation Initial Delay (ms)', csl18n()), __('Specify an amount of time before the graphic animation starts in milliseconds.', csl18n()), '0', array('condition' => array('graphic_animation:not' => 'none', 'connector_animation:not' => 'none')));
$this->addControl('animation_delay_between', 'text', __('Animation Delay Between (ms)', csl18n()), __('Specify an amount of time between graphic animations in milliseconds.', csl18n()), '300', array('condition' => array('graphic_animation:not' => 'none', 'connector_animation:not' => 'none')));
}
示例9: ajaxResponseSave
public function ajaxResponseSave()
{
if (!isset($_POST['post'])) {
wp_send_json_error('Invalid request.');
}
$post = json_decode(stripslashes(html_entity_decode($_POST['post'])), true);
if (!isset($post['elements'])) {
wp_send_json_error('Missing element data.');
}
if (!isset($post['type'])) {
$post['type'] = 'block';
}
if (!isset($post['title'])) {
$post['title'] = __('Untitled', csl18n());
}
$post['slug'] = uniqid(sanitize_key($post['title']) . '_');
// SAVE
$post_id = wp_insert_post(array('post_type' => 'cs_user_templates'));
update_post_meta($post_id, 'cs_template_title', $post['title']);
update_post_meta($post_id, 'cs_template_elements', $post['elements']);
update_post_meta($post_id, 'cs_template_type', $post['type']);
update_post_meta($post_id, 'cs_template_slug', $post['slug']);
// Set section before responding so it can be added immediately
$post['section'] = $post['type'] == 'page' ? 'user-pages' : 'user-blocks';
$result = array('template' => $post);
// Suppress PHP error output unless debugging
if (CS()->common()->isDebug()) {
return wp_send_json_success($result);
}
return @wp_send_json_success($result);
}
示例10: controls
public function controls()
{
$this->addControl('title', 'title', NULL, NULL, '');
$this->addControl('type', 'icon-choose', __('Icon', csl18n()), __('Specify the icon you would like to use as the bullet for your Icon List Item.', csl18n()), 'check');
$this->addControl('icon_color', 'color', __('Icon Color', csl18n()), __('Choose a custom color for your Icon List Item\'s icon.', csl18n()), '');
$this->addSupport('link');
}
示例11: controls
public function controls()
{
$this->addControl('image_style', 'select', __('Style', csl18n()), __('Select the image style.', csl18n()), 'none', array('choices' => array(array('value' => 'none', 'label' => __('None', csl18n())), array('value' => 'thumbnail', 'label' => __('Thumbnail', csl18n())), array('value' => 'rounded', 'label' => __('Rounded', csl18n())), array('value' => 'circle', 'label' => __('Circle', csl18n())))));
$this->addControl('src', 'image', __('Src', csl18n()), __('Enter your image.', csl18n()), '');
$this->addControl('alt', 'text', __('Alt', csl18n()), __('Enter in the alt text for your image', csl18n()), '');
$this->addControl('link', 'toggle', __('Link', csl18n()), __('Select to wrap your image in an anchor tag.', csl18n()), false);
$this->addSupport('link');
$this->addControl('info', 'select', __('Info', csl18n()), __('Select whether or not you want to add a popover or tooltip to your image.', csl18n()), 'none', array('choices' => array(array('value' => 'none', 'label' => __('None', csl18n())), array('value' => 'popover', 'label' => __('Popover', csl18n())), array('value' => 'tooltip', 'label' => __('Tooltip', csl18n())))), array('condition' => array('link' => true)));
$this->addControl('info_place', 'choose', __('Info Placement', csl18n()), __('Select where you want your popover or tooltip to appear.', csl18n()), 'top', array('columns' => '4', 'choices' => array(array('value' => 'top', 'icon' => fa_entity('arrow-up'), 'tooltip' => __('Top', csl18n())), array('value' => 'right', 'icon' => fa_entity('arrow-right'), 'tooltip' => __('Right', csl18n())), array('value' => 'bottom', 'icon' => fa_entity('arrow-down'), 'tooltip' => __('Bottom', csl18n())), array('value' => 'left', 'icon' => fa_entity('arrow-left'), 'tooltip' => __('Left', csl18n())))), array('condition' => array('link' => true, 'info' => array('popover', 'tooltip'))));
$this->addControl('info_trigger', 'select', __('Info Trigger', csl18n()), __('Select what actions you want to trigger the popover or tooltip.', csl18n()), 'hover', array('choices' => array(array('value' => 'hover', 'label' => __('Hover', csl18n())), array('value' => 'click', 'label' => __('Click', csl18n())), array('value' => 'focus', 'label' => __('Focus', csl18n()))), 'condition' => array('link' => true, 'info' => array('popover', 'tooltip'))));
$this->addControl('info_content', 'text', __('Info Content', csl18n()), __('Extra content for the popover.', csl18n()), '', array('condition' => array('link' => true, 'info' => array('popover', 'tooltip'))));
// $this->addControl(
// 'lightbox_thumb',
// 'image',
// __( 'Lightbox Thumbnail', csl18n() ),
// __( 'Use this option to select a different thumbnail for your lightbox thumbnail navigation or to set an image if you are linking out to a video. Will default to the "Src" image if nothing is set.', csl18n() ),
// ''
// );
// $this->addControl(
// 'lightbox_video',
// 'toggle',
// __( 'Lightbox Video', csl18n() ),
// __( 'Select if you are linking to a video from this image in the lightbox.', csl18n() ),
// false
// );
// $this->addControl(
// 'lightbox_caption',
// 'text',
// __( 'Lightbox Caption', csl18n() ),
// __( 'Lightbox caption text.', csl18n() ),
// ''
// );
}
示例12: xsg
public function xsg()
{
$this->sg_map(array('id' => 'x_tab_nav', 'title' => __('Tab Nav', csl18n()), 'weight' => 920, 'icon' => 'tab-nav', 'section' => __('Content', csl18n()), 'description' => __('Include a tab nav into your content', csl18n()), 'demo' => 'http://theme.co/x/demo/integrity/1/shortcodes/tabbed-content/', 'params' => array(array('param_name' => 'type', 'heading' => __('Tab Nav Items Per Row', csl18n()), 'description' => __('If your tab nav is on top, select how many tab nav items you want per row.', csl18n()), 'type' => 'dropdown', 'value' => array('Two' => 'two-up', 'Three' => 'three-up', 'Four' => 'four-up', 'Five' => 'five-up')), array('param_name' => 'float', 'heading' => __('Tab Nav Position', csl18n()), 'description' => __('Select the position of your tab nav.', csl18n()), 'type' => 'dropdown', 'value' => array('None' => 'none', 'Left' => 'left', 'Right' => 'right')), Cornerstone_Shortcode_Generator::map_default_id(), Cornerstone_Shortcode_Generator::map_default_class(), Cornerstone_Shortcode_Generator::map_default_style())));
$this->sg_map(array('id' => 'x_tab_nav_item', 'title' => __('Tab Nav Item', csl18n()), 'weight' => 910, 'icon' => 'tab-nav-item', 'section' => __('Content', csl18n()), 'description' => __('Include a tab nav item into your tab nav', csl18n()), 'demo' => 'http://theme.co/x/demo/integrity/1/shortcodes/tabbed-content/', 'params' => array(array('param_name' => 'title', 'heading' => __('Title', csl18n()), 'description' => __('Include a title for your tab nav item.', csl18n()), 'type' => 'textfield'), array('param_name' => 'active', 'heading' => __('Active', csl18n()), 'description' => __('Select to make this tab nav item active.', csl18n()), 'type' => 'checkbox', 'value' => 'true'), Cornerstone_Shortcode_Generator::map_default_id(), Cornerstone_Shortcode_Generator::map_default_class(), Cornerstone_Shortcode_Generator::map_default_style())));
$this->sg_map(array('id' => 'x_tabs', 'title' => __('Tabs', csl18n()), 'weight' => 900, 'icon' => 'tabs', 'section' => __('Content', csl18n()), 'description' => __('Include a tabs container after your tab nav', csl18n()), 'demo' => 'http://theme.co/x/demo/integrity/1/shortcodes/tabbed-content/', 'params' => array(array('param_name' => 'id', 'heading' => __('ID', csl18n()), 'description' => __('(Optional) Enter a unique ID.', csl18n()), 'type' => 'textfield'), Cornerstone_Shortcode_Generator::map_default_class(), Cornerstone_Shortcode_Generator::map_default_style())));
$this->sg_map(array('id' => 'x_tab', 'title' => __('Tab', csl18n()), 'weight' => 890, 'icon' => 'tab', 'section' => __('Content', csl18n()), 'description' => __('Include a tab into your tabs container', csl18n()), 'demo' => 'http://theme.co/x/demo/integrity/1/shortcodes/tabbed-content/', 'params' => array(array('param_name' => 'content', 'heading' => __('Text', csl18n()), 'description' => __('Enter your text.', csl18n()), 'type' => 'textarea_html', 'value' => ''), array('param_name' => 'active', 'heading' => __('Active', csl18n()), 'description' => __('Select to make this tab active.', csl18n()), 'type' => 'checkbox', 'value' => 'true'), Cornerstone_Shortcode_Generator::map_default_class(), Cornerstone_Shortcode_Generator::map_default_style())));
}
示例13: addMediaButton
public function addMediaButton($editor_id)
{
$this->enqueue();
$title = sprintf(__('Insert Shortcodes', csl18n()));
$contents = (include CS()->path('includes/builder/svg/nav-elements-solid.php'));
echo "<button href=\"#\" title=\"{$title}\" id=\"cs-insert-shortcode-button\" class=\"button cs-insert-btn\">{$contents}</button>";
}
示例14: x_shortcode_share
function x_shortcode_share($atts)
{
extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'title' => '', 'facebook' => '', 'twitter' => '', 'google_plus' => '', 'linkedin' => '', 'pinterest' => '', 'reddit' => '', 'email' => ''), $atts, 'x_share'));
$share_url = urlencode(get_permalink());
$share_title = urlencode(get_the_title());
$share_source = urlencode(get_bloginfo('name'));
$share_image_info = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$share_image = function_exists('x_get_featured_image_with_fallback_url') ? urlencode(x_get_featured_image_with_fallback_url()) : urlencode($share_image_info[0]);
if ($linkedin == 'true') {
$share_content = urlencode(cs_get_raw_excerpt());
}
$tooltip_attr = cs_generate_data_attributes_extra('tooltip', 'hover', 'bottom');
$id = $id != '' ? 'id="' . esc_attr($id) . '"' : '';
$class = $class != '' ? 'x-entry-share ' . esc_attr($class) : 'x-entry-share';
$style = $style != '' ? 'style="' . $style . '"' : '';
$title = $title != '' ? $title : __('Share this Post', csl18n());
$facebook = $facebook == 'true' ? "<a href=\"#share\" {$tooltip_attr} class=\"x-share\" title=\"" . __('Share on Facebook', csl18n()) . "\" onclick=\"window.open('http://www.facebook.com/sharer.php?u={$share_url}&t={$share_title}', 'popupFacebook', 'width=650, height=270, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;\"><i class=\"x-icon-facebook-square\" data-x-icon=\"\"></i></a>" : '';
$twitter = $twitter == 'true' ? "<a href=\"#share\" {$tooltip_attr} class=\"x-share\" title=\"" . __('Share on Twitter', csl18n()) . "\" onclick=\"window.open('https://twitter.com/intent/tweet?text={$share_title}&url={$share_url}', 'popupTwitter', 'width=500, height=370, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;\"><i class=\"x-icon-twitter-square\" data-x-icon=\"\"></i></a>" : '';
$google_plus = $google_plus == 'true' ? "<a href=\"#share\" {$tooltip_attr} class=\"x-share\" title=\"" . __('Share on Google+', csl18n()) . "\" onclick=\"window.open('https://plus.google.com/share?url={$share_url}', 'popupGooglePlus', 'width=650, height=226, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;\"><i class=\"x-icon-google-plus-square\" data-x-icon=\"\"></i></a>" : '';
$linkedin = $linkedin == 'true' ? "<a href=\"#share\" {$tooltip_attr} class=\"x-share\" title=\"" . __('Share on LinkedIn', csl18n()) . "\" onclick=\"window.open('http://www.linkedin.com/shareArticle?mini=true&url={$share_url}&title={$share_title}&summary={$share_content}&source={$share_source}', 'popupLinkedIn', 'width=610, height=480, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;\"><i class=\"x-icon-linkedin-square\" data-x-icon=\"\"></i></a>" : '';
$pinterest = $pinterest == 'true' ? "<a href=\"#share\" {$tooltip_attr} class=\"x-share\" title=\"" . __('Share on Pinterest', csl18n()) . "\" onclick=\"window.open('http://pinterest.com/pin/create/button/?url={$share_url}&media={$share_image}&description={$share_title}', 'popupPinterest', 'width=750, height=265, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;\"><i class=\"x-icon-pinterest-square\" data-x-icon=\"\"></i></a>" : '';
$reddit = $reddit == 'true' ? "<a href=\"#share\" {$tooltip_attr} class=\"x-share\" title=\"" . __('Share on Reddit', csl18n()) . "\" onclick=\"window.open('http://www.reddit.com/submit?url={$share_url}', 'popupReddit', 'width=875, height=450, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;\"><i class=\"x-icon-reddit-square\" data-x-icon=\"\"></i></a>" : '';
$email = $email == 'true' ? "<a href=\"mailto:?subject=" . get_the_title() . "&body=" . __('Hey, thought you might enjoy this! Check it out when you have a chance:', csl18n()) . " " . get_permalink() . "\" {$tooltip_attr} class=\"x-share email\" title=\"" . __('Share via Email', csl18n()) . "\"><span><i class=\"x-icon-envelope-square\" data-x-icon=\"\"></i></span></a>" : '';
$output = "<div {$id} class=\"{$class}\" {$style}>" . '<p>' . $title . '</p>' . '<div class="x-share-options">' . $facebook . $twitter . $google_plus . $linkedin . $pinterest . $reddit . $email . '</div>' . '</div>';
return $output;
}
示例15: controls
public function controls()
{
$this->addControl('heading', 'text', __('Heading & Content', csl18n()), __('Text for your alert heading and content.', csl18n()), __('Alert Title', csl18n()));
$this->addControl('content', 'textarea', NULL, NULL, __('Click to inspect, then edit as needed.', csl18n()), array('expandable' => true));
$this->addControl('type', 'choose', __('Type', csl18n()), __('There are multiple alert types for different situations. Select the one that best suits your needs.', csl18n()), 'success', array('columns' => '5', 'choices' => array(array('value' => 'muted', 'tooltip' => __('Muted', csl18n()), 'icon' => fa_entity('ban')), array('value' => 'success', 'tooltip' => __('Success', csl18n()), 'icon' => fa_entity('check')), array('value' => 'info', 'tooltip' => __('Info', csl18n()), 'icon' => fa_entity('info')), array('value' => 'warning', 'tooltip' => __('Warning', csl18n()), 'icon' => fa_entity('exclamation-triangle')), array('value' => 'danger', 'tooltip' => __('Danger', csl18n()), 'icon' => fa_entity('exclamation-circle')))));
$this->addControl('close', 'toggle', __('Close Button', csl18n()), __('Enabling the close button will make the alert dismissible, allowing your users to remove it if desired.', csl18n()), false);
}