/** * Generate HTML code from shortcode content. * * @param array $atts Shortcode attributes. * @param string $content Current content. * * @return string */ public function element_shortcode_full($atts = null, $content = null) { $arr_params = shortcode_atts($this->config['params'], $atts); extract($arr_params); $button_text = !$button_text ? '' : $button_text; $button_size = !$button_size || strtolower($button_size) == 'default' ? '' : $button_size; $button_color = !$button_color || strtolower($button_color) == 'default' ? '' : $button_color; $button_icon = !$icon ? '' : "<i class='{$icon}'></i>"; $tag = 'a'; $href = ''; $single_item = explode('__#__', $single_item); $single_item = $single_item[0]; if (!empty($link_type)) { $taxonomies = IG_Pb_Helper_Type::get_public_taxonomies(); $post_types = IG_Pb_Helper_Type::get_post_types(); // single post if (array_key_exists($link_type, $post_types)) { $permalink = home_url() . "/?p={$single_item}"; $href = !$single_item ? ' href="#"' : " href='{$permalink}'"; } else { if (array_key_exists($link_type, $taxonomies)) { $permalink = get_term_link(intval($single_item), $link_type); if (!is_wp_error($permalink)) { $href = !$single_item ? ' href="#"' : " href='{$permalink}'"; } } else { switch ($link_type) { case 'no_link': $tag = 'button'; break; case 'url': $href = !$button_type_url ? ' href="#"' : " href='{$button_type_url}'"; break; } } } } $target = ''; if ($open_in) { switch ($open_in) { case 'current_browser': $target = ''; break; case 'new_browser': $target = ' target="_blank"'; break; case 'lightbox': $cls_button_fancy = 'ig-button-fancy'; $script = IG_Pb_Helper_Functions::fancybox(".{$cls_button_fancy}", array('type' => 'iframe', 'width' => '75%', 'height' => '75%')); break; } } $button_type = $tag == 'button' ? " type='button'" : ''; $cls_button_fancy = !isset($cls_button_fancy) ? '' : $cls_button_fancy; $script = !isset($script) ? '' : $script; $html_result = "<{$tag} class='btn {$button_size} {$button_color} {$cls_button_fancy}'{$href}{$target}{$button_type}>[icon]{$button_icon}[/icon][title]{$button_text}[/title]</{$tag}>"; return $html_result . $script . '<!--seperate-->'; }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('name' => __('Tag', IGPBL), 'id' => 'tag', 'type' => 'select', 'class' => 'input-sm', 'std' => 'h1', 'options' => array('h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6'), 'tooltip' => __('Support tags: H1, H2, H3, H4, H5, H6', IGPBL)), array('name' => __('Text', IGPBL), 'id' => 'text', 'type' => 'text_field', 'role' => 'content', 'class' => 'input-sm', 'std' => __('Your heading text', IGPBL), 'tooltip' => __('Insert your heading text', IGPBL))), 'styling' => array(array('type' => 'preview'), array('name' => __('Alignment', IGPBL), 'id' => 'text_align', 'type' => 'select', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_text_align()), 'options' => IG_Pb_Helper_Type::get_text_align(), 'class' => 'input-sm', 'tooltip' => __('Setting position: right, left, center, inherit parent style', IGPBL)), array('name' => __('Font', IGPBL), 'id' => 'font', 'type' => 'select', 'std' => 'inherit', 'options' => array('inherit' => __('Inherit', IGPBL), 'custom' => __('Custom', IGPBL)), 'has_depend' => '1', 'class' => 'input-sm', 'tooltip' => __('Select font type', IGPBL)), array('name' => __('Font Face', IGPBL), 'id' => 'font_family', 'type' => array(array('id' => 'font_face_type', 'type' => 'jsn_select_font_type', 'class' => 'input-sm', 'std' => 'standard fonts', 'options' => IG_Pb_Helper_Type::get_fonts(), 'parent_class' => 'combo-item'), array('id' => 'font_face_value', 'type' => 'jsn_select_font_value', 'class' => 'input-sm', 'std' => 'Verdana', 'options' => '', 'parent_class' => 'combo-item')), 'dependency' => array('font', '=', 'custom'), 'container_class' => 'combo-group', 'tooltip' => __('Select font', IGPBL)), array('name' => __('Font Attributes', IGPBL), 'type' => array(array('id' => 'font_size_value_', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '', 'append' => 'px', 'validate' => 'number', 'parent_class' => 'combo-item input-append-inline'), array('id' => 'font_style', 'type' => 'select', 'class' => 'input-sm ig-mini-input', 'std' => 'bold', 'options' => IG_Pb_Helper_Type::get_font_styles(), 'parent_class' => 'combo-item'), array('id' => 'color', 'type' => 'color_picker', 'std' => '#000000', 'parent_class' => 'combo-item')), 'dependency' => array('font', '=', 'custom'), 'container_class' => 'combo-group', 'tooltip' => __('Set font style', IGPBL)), array('name' => __('Bottom Border', IGPBL), 'type' => array(array('id' => 'border_bottom_width_value_', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '', 'append' => 'px', 'validate' => 'number', 'parent_class' => 'combo-item input-append-inline'), array('id' => 'border_bottom_style', 'type' => 'select', 'class' => 'input-sm ig-mini-input', 'std' => 'solid', 'options' => IG_Pb_Helper_Type::get_border_styles(), 'parent_class' => 'combo-item'), array('id' => 'border_bottom_color', 'type' => 'color_picker', 'std' => '', 'parent_class' => 'combo-item')), 'container_class' => 'combo-group', 'tooltip' => __('Set bottom border style', IGPBL)), array('name' => __('Bottom Padding', IGPBL), 'type' => array(array('id' => 'padding_bottom_value_', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '', 'append' => 'px', 'validate' => 'number')), 'tooltip' => __('Set bottom padding style', IGPBL)))); }
/** * setting option of element on modal box */ function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', 'plumtree'), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'jsn-input-xxlarge-fluid', 'std' => __('No Markup Text', 'plumtree'), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', 'plumtree')), array('name' => __('Image Type', 'plumtree'), 'id' => 'text_type', 'type' => 'select', 'std' => 'normal', 'options' => array('normal' => 'Regular Text', 'welc' => 'Welcome Text', 'qout' => 'Qoute'), 'tooltip' => __('Set alt text for image', 'plumtree')), array('name' => __('Text Content', 'plumtree'), 'desc' => __('Enter some content for this textblock', 'plumtree'), 'id' => 'text', 'type' => 'editor', 'role' => 'content', 'mce' => false, 'std' => IG_Pb_Helper_Type::lorem_text(), 'rows' => 15, 'tooltip' => __('Set content of element', 'plumtree'))), 'styling' => array(array('type' => 'preview'), array('name' => __('Enable Dropcap', 'plumtree'), 'id' => 'enable_dropcap', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', 'plumtree'), 'no' => __('No', 'plumtree')), 'tooltip' => __('Enable Dropcap', 'plumtree'), 'has_depend' => '1'), array('name' => __('Font Face', 'plumtree'), 'id' => 'dropcap_font_family', 'type' => array(array('id' => 'dropcap_font_face_type', 'type' => 'jsn_select_font_type', 'class' => 'input-medium', 'std' => 'standard fonts', 'options' => IG_Pb_Helper_Type::get_fonts(), 'parent_class' => 'combo-item'), array('id' => 'dropcap_font_face_value', 'type' => 'jsn_select_font_value', 'class' => 'input-medium', 'std' => 'Verdana', 'options' => '', 'parent_class' => 'combo-item')), 'dependency' => array('enable_dropcap', '=', 'yes'), 'tooltip' => __('Set Font Face', 'plumtree'), 'container_class' => 'combo-group'), array('name' => __('Font Attributes', 'plumtree'), 'type' => array(array('id' => 'dropcap_font_size', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '64', 'append' => 'px', 'validate' => 'number', 'parent_class' => 'combo-item'), array('id' => 'dropcap_font_style', 'type' => 'select', 'class' => 'input-medium', 'std' => 'bold', 'options' => IG_Pb_Helper_Type::get_font_styles(), 'parent_class' => 'combo-item'), array('id' => 'dropcap_font_color', 'type' => 'color_picker', 'std' => '#000000', 'parent_class' => 'combo-item')), 'dependency' => array('enable_dropcap', '=', 'yes'), 'tooltip' => __('Set Font Attribute', 'plumtree'), 'container_class' => 'combo-group'))); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('name' => __('Data', IGPBL), 'id' => 'qr_content', 'type' => 'text_area', 'class' => 'input-sm', 'std' => 'http://www.innogears.com', 'tooltip' => __('Add the data for the Qr box', IGPBL), 'exclude_quote' => '1'), array('name' => __('Image ALT Text', IGPBL), 'id' => 'qr_alt', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('Wordpress themes from www.innogears.com', IGPBL), 'tooltip' => __('Image ALT Text', IGPBL))), 'styling' => array(array('type' => 'preview'), array('name' => __('Container Style', IGPBL), 'id' => 'qr_container_style', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_qr_container_style()), 'options' => IG_Pb_Helper_Type::get_qr_container_style(), 'tooltip' => __('Select Container Style', IGPBL)), array('name' => __('Alignment', IGPBL), 'id' => 'qr_alignment', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_text_align()), 'options' => IG_Pb_Helper_Type::get_text_align(), 'tooltip' => __('Setting position: right, left, center, inherit parent style', IGPBL)), array('name' => __('QR Code Sizes', IGPBL), 'id' => 'qrcode_sizes', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '150', 'append' => 'px', 'validate' => 'number', 'tooltip' => __('Set size of QR code', IGPBL)))); }
/** * Generate HTML structure content * * @global type $wpdb * @param type $configs * @param type $atts * @param type $content * @param type $post_contents: if true, it will return array of post objects. otherwise, it will return content, which is wrapped in li, ul * @return string */ public function element_shortcode_($configs, $atts = null, $content = null, $contentclips = false) { global $wpdb; $html_element = $item_filter = ''; $data = $arr_ids = $source = array(); if ($atts == null) { $shortcode_params = shortcode_atts($configs, $atts); } else { $shortcode_params = $atts; } extract($shortcode_params); if (intval($cl_depth_level) == 0 or empty($ig_cl_source)) { return ''; } $arr_post_types = array(); foreach (IG_Pb_Helper_Type::get_post_types() as $slug => $name) { $arr_post_types[] = $slug; } $arr_taxonomies = array(); foreach (IG_Pb_Helper_Type::get_term_taxonomies() as $slug => $name) { $arr_taxonomies[] = $slug; } // progress order by $orderby = $order = $offset = null; if (isset($ig_cl_orderby) and isset($ig_cl_order) and $ig_cl_orderby != 'no_order') { $orderby = $ig_cl_orderby; $order = $ig_cl_order == 'desc' ? 'desc' : 'asc'; } $limit = isset($total_items) ? intval($total_items) : null; $items_per_page = isset($items_per_page) ? intval($items_per_page) : null; if (isset($items_per_page) && isset($limit) && $items_per_page < $limit) { $limit = $items_per_page; $offset = 0; } if (isset($contentclips_page)) { $offset = $items_per_page * ($contentclips_page - 1); $limit = intval($total_items) - $items_per_page * ($contentclips_page - 1); if ($limit > $items_per_page) { $limit = $items_per_page; } } $arr_has_parent = IG_Pb_Helper_Type::_get_exclude_taxonomies(); $is_parent = in_array($ig_cl_source, $arr_has_parent); // source is not a parent item if (!$is_parent) { // source = single entries if (in_array($ig_cl_source, $arr_post_types)) { // with filter value if (!empty($item_filter)) { IG_Pb_Helper_Type::post_by_termid($item_filter, $arr_ids, $source); } if (!empty($item_filter) && !count($arr_ids)) { return null; } // query post entry $data = $this->querypost($ig_cl_source, $arr_ids, $limit, $offset, $orderby, $order); if (count($data)) { $html_element = '<ul>'; foreach ($data as $i => $item) { $html_element = self::output_post($item, $html_element); } $html_element .= '</ul>'; } } elseif (in_array($ig_cl_source, $arr_taxonomies)) { // has filter items if ($item_filter) { $arr_filters = explode(',', $item_filter); // query post entry $data = get_terms($ig_cl_source, array('hide_empty' => false, 'orderby' => 'name')); if (count($data)) { $html_element = '<ul>'; if ($item_filter == 'root') { foreach ($data as $i => $item) { $html_element = self::output_taxonomy($item, $ig_cl_source, $html_element); } } else { foreach ($data as $i => $item) { if (in_array($item->term_id, $arr_filters)) { $html_element = self::output_taxonomy($item, $ig_cl_source, $html_element); } } } $html_element .= '</ul>'; } } else { $args = array('hide_empty' => false); if ($orderby and $order) { $args['orderby'] = $orderby; $args['order'] = $order; } else { $args['orderby'] = 'name'; } if (isset($limit)) { $args['number'] = $limit; } $data = get_terms($ig_cl_source, $args); if (count($data)) { $html_element = '<ul>'; foreach ($data as $i => $item) { $html_element = self::output_taxonomy($item, $ig_cl_source, $html_element); } $html_element .= '</ul>'; } } } } else { // source = single entries if (in_array($ig_cl_source, $arr_post_types)) { $data = $data_post = $this->querypost($ig_cl_source, $arr_ids, $limit, $offset, $orderby, $order); $level = $index = 0; if (count($data)) { $html_element = '<ul>'; if ($limit) { foreach ($data as $i => $item) { $html_element = self::output_post($item, $html_element); } } else { foreach ($data as $i => $item) { if ($item->ID == $item_filter or $item_filter == 'root' and $item->post_parent == 0) { unset($data[$i]); if (!isset($data_content)) { $data_content = array(); } $data_content[] = $item; $html_element = self::output_post($item, $html_element, false); $index = ''; self::_recur_tree($html_element, $data, $item->ID, $level, $cl_depth_level, '1', '', $index, '', $data_content); $html_element .= '</li>'; } } } $html_element .= '</ul>'; } } else { if (in_array($ig_cl_source, $arr_taxonomies)) { if ($limit) { $args = array('hide_empty' => false); if ($orderby and $order) { $args['orderby'] = $orderby; $args['order'] = $order; } else { $args['orderby'] = 'name'; } $args['number'] = $limit; $data = get_terms($ig_cl_source, $args); $html_element = '<ul>'; foreach ($data as $i => $item) { unset($data[$i]); $html_element = self::output_taxonomy($item, $ig_cl_source, $html_element); } $html_element .= '</ul>'; } else { $data = get_terms($ig_cl_source, array('hide_empty' => false, 'orderby' => 'name')); $item_filter = isset($item_filter) ? $item_filter : 'root'; $level = 0; $html_element = '<ul>'; foreach ($data as $i => $item) { if ($item->term_id == $item_filter or $item_filter == 'root' and $item->parent == 0) { unset($data[$i]); $html_element = self::output_taxonomy($item, $ig_cl_source, $html_element, false); self::_recur_tree($html_element, $data, $item->term_id, $level, $cl_depth_level, '-1', $ig_cl_source); $html_element .= '</li>'; } } $html_element .= '</ul>'; } } else { if ($ig_cl_source == 'nav_menu_item') { if (isset($item_filter)) { // process for menu case $menu_start_from = isset($ig_cl_menu_start_from) ? $ig_cl_menu_start_from : ''; if ($menu_start_from != 'root') { $menu_start_from = intval($menu_start_from); } else { $menu_start_from = '0'; } $level = 0; $data = wp_get_nav_menu_items($item_filter, array('update_post_term_cache' => false)); $html_element = '<ul>'; if ($data) { foreach ($data as $i => $item) { unset($data[$i]); if ($menu_start_from == 0 and $item->menu_item_parent == $menu_start_from or $menu_start_from != 0 and $item->ID == $menu_start_from) { $html_element = self::output_post($item, $html_element, false, '', 'title'); self::_recur_tree($html_element, $data, $item->ID, $level, $cl_depth_level, '0', '', $index, ''); $html_element .= '</li>'; } } } $html_element .= '</ul>'; } } } } } if ($contentclips) { return array('data' => isset($data_content) ? $data_content : $data, 'source' => $source); } return $html_element; }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('action' => array(array('id' => 'btn_convert', 'type' => 'button_group', 'bound' => 0, 'actions' => array(array('std' => __('Tab', IGPBL), 'action_type' => 'convert', 'action' => 'carousel_to_tab'), array('std' => __('Accordion', IGPBL), 'action_type' => 'convert', 'action' => 'carousel_to_accordion'), array('std' => __('List', IGPBL), 'action_type' => 'convert', 'action' => 'carousel_to_list')))), 'content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('id' => 'carousel_items', 'type' => 'group', 'shortcode' => ucfirst(__CLASS__), 'sub_item_type' => $this->config['has_subshortcode'], 'sub_items' => array(array('std' => ''), array('std' => '')))), 'styling' => array(array('type' => 'preview'), array('name' => __('Alignment', IGPBL), 'id' => 'align', 'type' => 'select', 'class' => 'input-sm', 'std' => 'center', 'options' => IG_Pb_Helper_Type::get_text_align(), 'tooltip' => __('Setting position: right, left, center, inherit parent style', IGPBL)), array('name' => __('Dimension', IGPBL), 'container_class' => 'combo-group dimension-inline', 'id' => 'dimension', 'type' => 'dimension', 'extended_ids' => array('dimension_width', 'dimension_height', 'dimension_width_unit'), 'dimension_width' => array('std' => ''), 'dimension_height' => array('std' => ''), 'dimension_width_unit' => array('options' => array('px' => 'px', '%' => '%'), 'std' => 'px'), 'tooltip' => __('Set width and height of element', IGPBL)), array('name' => __('Show Indicator', IGPBL), 'id' => 'show_indicator', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show/hide navigation buttons inside your carousel', IGPBL)), array('name' => __('Show Arrows', IGPBL), 'id' => 'show_arrows', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show/hide arrow buttons', IGPBL)), array('name' => __('Automatic Cycling', IGPBL), 'id' => 'automatic_cycling', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'has_depend' => '1', 'tooltip' => __('Whether to running your carousel automatically or not', IGPBL)), array('name' => __('Cycling Interval', IGPBL), 'type' => array(array('id' => 'cycling_interval', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '5', 'append' => 'second(s)', 'validate' => 'number')), 'dependency' => array('automatic_cycling', '=', 'yes'), 'tooltip' => __('Set interval for each cycling', IGPBL)), array('name' => __('Pause on mouse over', IGPBL), 'id' => 'pause_mouseover', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'dependency' => array('automatic_cycling', '=', 'yes'), 'tooltip' => __('Pause cycling on mouse over', IGPBL)))); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL))), 'styling' => array(array('type' => 'preview'), array('name' => __('Border', IGPBL), 'type' => array(array('id' => 'div_border_width', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '2', 'append' => 'px', 'validate' => 'number', 'parent_class' => 'combo-item input-append-inline'), array('id' => 'div_border_style', 'type' => 'select', 'class' => 'input-sm', 'std' => 'solid', 'options' => IG_Pb_Helper_Type::get_border_styles(), 'parent_class' => 'combo-item'), array('id' => 'div_border_color', 'type' => 'color_picker', 'std' => '#E0DEDE', 'parent_class' => 'combo-item')), 'tooltip' => __('Set border style', IGPBL), 'container_class' => 'combo-group'))); }
/** * DEFINE setting options of shortcode */ public function element_items() { $this->items = array('Notab' => array(array('name' => __('Heading', 'plumtree'), 'id' => 'heading', 'type' => 'text_field', 'class' => 'jsn-input-xxlarge-fluid', 'role' => 'title', 'std' => __(IG_Pb_Utils_Placeholder::add_placeholder('Carousel Item %s', 'index'), 'plumtree'), 'tooltip' => __('Set the text of your heading items', 'plumtree')), array('name' => __('Body', 'plumtree'), 'id' => 'body', 'role' => 'content', 'type' => 'editor', 'std' => IG_Pb_Helper_Type::lorem_text(), 'tooltip' => __('Set content of element', 'plumtree')), array('name' => __('Icon', 'plumtree'), 'id' => 'icon', 'type' => 'icons', 'std' => '', 'role' => 'title_prepend', 'title_prepend_type' => 'icon', 'tooltip' => __('Select an icon', 'plumtree')))); }
public function element_items() { $this->items = array('Notab' => array(array('name' => __('Text', IGPBL), 'id' => 'pbar_text', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __(IG_Pb_Utils_Placeholder::add_placeholder('Progress Bar Item %s', 'index'), IGPBL), 'role' => 'title', 'tooltip' => __('Text', IGPBL)), array('name' => __('Percentage', IGPBL), 'id' => 'pbar_percentage', 'type' => 'text_append', 'input_type' => 'number', 'class' => 'input-mini', 'std' => '25', 'append' => '%', 'validate' => 'number', 'parent_class' => 'combo-item', 'tooltip' => __('Percentage', IGPBL)), array('name' => __('Color', IGPBL), 'id' => 'pbar_color', 'type' => 'select', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_progress_bar_color()), 'options' => IG_Pb_Helper_Type::get_progress_bar_color(), 'tooltip' => __('Color', IGPBL), 'container_class' => 'color_select2'), array('name' => __('Style', IGPBL), 'id' => 'pbar_item_style', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_progress_bar_item_style()), 'options' => IG_Pb_Helper_Type::get_progress_bar_item_style(), 'tooltip' => __('Style', IGPBL)), array('name' => __('Icon', IGPBL), 'id' => 'pbar_icon', 'type' => 'icons', 'std' => '', 'role' => 'title_prepend', 'title_prepend_type' => 'icon', 'tooltip' => __('Select an icon', IGPBL)), array('id' => 'pbar_group', 'class' => 'pbar_group_type', 'type' => 'hidden', 'std' => 'multiple-bars'))); }
public function element_shortcode_full($atts = null, $content = null) { $arr_params = shortcode_atts($this->config['params'], $atts); extract($arr_params); $html_elemments = $script = ''; $alt_text = $image_alt ? " alt='{$image_alt}'" : 'alt=""'; $image_styles = array(); if ($image_margin_top) { $image_styles[] = "margin-top:{$image_margin_top}px"; } if ($image_margin_bottom) { $image_styles[] = "margin-bottom:{$image_margin_bottom}px"; } if ($image_margin_right) { $image_styles[] = "margin-right:{$image_margin_right}px"; } if ($image_margin_left) { $image_styles[] = "margin-left:{$image_margin_left}px"; } $styles = count($image_styles) ? ' style="' . implode(';', $image_styles) . '"' : ''; $class_img = $image_container_style != 'no-styling' ? $image_container_style : ''; $class_img = $image_effect == 'yes' ? $class_img . ' image-scroll-fade' : $class_img; $class_img = !empty($class_img) ? ' class="' . $class_img . '"' : ''; if ($image_type == 'banner') { $img_banner = ' data-image-type="banner" data-image-text="' . $banner_text . '" '; } if ($image_file) { $image_id = IG_Pb_Helper_Functions::get_image_id($image_file); $attachment = wp_prepare_attachment_for_js($image_id); $image_file = !empty($attachment['sizes'][$image_size]['url']) ? $attachment['sizes'][$image_size]['url'] : $image_file; if ($image_type != 'banner_wel') { $html_elemments .= "<img src='{$image_file}'{$alt_text}{$styles}{$class_img}{$img_banner} />"; } else { $html_elemments .= "<div class=\"wel-banner\"><img src='{$image_file}'{$alt_text}{$styles}{$class_img} />\n <div class=\"wel-b-overlay\">{$welcome_text}</div>\n </div>"; } $script = ''; $target = ''; if ($open_in) { switch ($open_in) { case 'current_browser': $target = ''; break; case 'new_browser': $target = ' target="_blank"'; break; case 'lightbox': $cls_button_fancy = ' pt-image-fancy'; $img_gal = ' rel="prettyPhoto" '; break; } } $class = !empty($cls_button_fancy) ? "class='{$cls_button_fancy}'" : ''; $img_gal = !empty($img_gal) ? $img_gal : ''; // get Single Item and check type to get right link @($single_item = explode('__#__', $single_item)); $single_item = $single_item[0]; $taxonomies = IG_Pb_Helper_Type::get_public_taxonomies(); $post_types = IG_Pb_Helper_Type::get_post_types(); // single post if (array_key_exists($link_type, $post_types)) { $permalink = home_url() . "/?p={$single_item}"; $html_elemments = "<a href='{$permalink}'{$target}{$class}{$img_gal}>" . $html_elemments . '</a>'; } else { if (array_key_exists($link_type, $taxonomies)) { $permalink = get_term_link(intval($single_item), $link_type); if (!is_wp_error($permalink)) { $html_elemments = "<a href='{$permalink}'{$target}{$class}{$img_gal}>" . $html_elemments . '</a>'; } } else { switch ($link_type) { case 'url': $html_elemments = "<a href='{$image_type_url}'{$target}{$class}{$img_gal}>" . $html_elemments . '</a>'; break; case 'large_image': $image_id = IG_Pb_Helper_Functions::get_image_id($image_file); $attachment = wp_prepare_attachment_for_js($image_id); $image_url = !empty($attachment['sizes'][$image_image_size]['url']) ? $attachment['sizes'][$image_image_size]['url'] : $image_file; $html_elemments = "<a href='{$image_url}'{$target}{$class}{$img_gal}>" . $html_elemments . '</a>'; break; } } } if (strtolower($image_alignment) != 'inherit') { if (strtolower($image_alignment) == 'left') { $cls_alignment = 'pull-left'; } if (strtolower($image_alignment) == 'right') { $cls_alignment = 'pull-right'; } if (strtolower($image_alignment) == 'center') { $cls_alignment = 'text-center'; } $html_elemments = "<div class='{$cls_alignment}'>" . $html_elemments . '</div>'; } } return $this->element_wrapper($html_elemments . $script, $arr_params); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('id' => 'buttonbar_items', 'type' => 'group', 'shortcode' => ucfirst(__CLASS__), 'sub_item_type' => $this->config['has_subshortcode'], 'sub_items' => array(array('std' => ''), array('std' => ''), array('std' => '')))), 'styling' => array(array('type' => 'preview'), array('name' => __('Alignment', IGPBL), 'id' => 'buttonbar_alignment', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_text_align()), 'options' => IG_Pb_Helper_Type::get_text_align(), 'tooltip' => __('Setting position: right, left, center, inherit parent style', IGPBL)), array('name' => __('Show Title', IGPBL), 'id' => 'buttonbar_show_title', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show/ hide the title of buttons', IGPBL)), array('name' => __('Show Icon', IGPBL), 'id' => 'buttonbar_show_icon', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show/ hide the icon of buttons', IGPBL)), array('name' => __('Group Buttons', IGPBL), 'id' => 'buttonbar_group', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Arrange button bars into a group in a single row', IGPBL)))); }
public function element_shortcode_full($atts = null, $content = null) { $html_element = ''; $arr_params = shortcode_atts($this->config['params'], $atts); extract($arr_params); $styles = array(); if ($pb_bg_color) { $styles[] = 'background-color:' . $pb_bg_color; } if (intval($pb_border_top) > 0) { $styles[] = 'border-top-width:' . (int) $pb_border_top . 'px'; $styles[] = 'border-top-style: solid'; } if (intval($pb_border_left) > 0) { $styles[] = 'border-left-width:' . (int) $pb_border_left . 'px'; $styles[] = 'border-left-style: solid'; } if (intval($pb_border_bottom) > 0) { $styles[] = 'border-bottom-width:' . (int) $pb_border_bottom . 'px'; $styles[] = 'border-bottom-style: solid'; } if (intval($pb_border_right) > 0) { $styles[] = 'border-right-width:' . (int) $pb_border_right . 'px'; $styles[] = 'border-right-style: solid'; } if ($pb_border_color) { $styles[] = 'border-color:' . $pb_border_color; } $elements = explode('__#__', $elements); $class = ''; if ($pb_show_drop == 'yes') { $class .= 'promo-box-shadow'; } $single_item = explode('__#__', $single_item); $single_item = $single_item[0]; $script = $cls_button_fancy = $target = $button = ''; if (in_array('button', $elements)) { $taxonomies = IG_Pb_Helper_Type::get_public_taxonomies(); $post_types = IG_Pb_Helper_Type::get_post_types(); // single post if (array_key_exists($link_type, $post_types)) { $permalink = home_url() . "/?p={$single_item}"; $button_href = "href='{$permalink}'"; } else { if (array_key_exists($link_type, $taxonomies)) { $permalink = get_term_link(intval($single_item), $link_type); if (!is_wp_error($permalink)) { $button_href = "href='{$permalink}'"; } } else { switch ($link_type) { case 'no_link': $button_href = ''; break; case 'url': $button_href = "href='{$pb_button_url}'"; break; } } } if ($pb_button_open_in and $link_type != 'no_link') { switch ($pb_button_open_in) { case 'current_browser': $target = ''; break; case 'new_browser': $target = ' target="_blank"'; break; case 'lightbox': $cls_button_fancy = ' pt-pb-button-fancy'; break; } } $pb_button_size = isset($pb_button_size) && $pb_button_size != 'default' ? $pb_button_size : ''; $pb_button_color = isset($pb_button_color) && $pb_button_color != 'default' ? $pb_button_color : ''; } $styles = implode(';', $styles); //$styles = ( $styles ) ? "style='{$styles}'" : ''; $html_element .= "<div class='pricing block {$box_type}'>"; $html_element .= $button; if (in_array('title', $elements)) { $html_element .= "<h5 class='title'>{$pb_title}</h5>"; } $html_element .= "<span class=\"price-box\"><span class=\"price\"><span class=\"currency\">{$pb_currency}</span>\t{$pb_price}</span><span class=\"rp\">{$pb_info}</span></span>"; $content = !$content ? '' : $content; if (in_array('content', $elements)) { $html_element .= "<div class=\"features\">{$content}</div>"; } $html_element .= "<a {$target} href=\"{$button_href}\" class=\"button\">{$pb_button_title}</a>"; $html_element .= '</div>'; return $this->element_wrapper($html_element . $script, $arr_params); }
/** * DEFINE setting options of shortcode */ public function element_items() { $this->items = array('Notab' => array(array('name' => __('Width', IGPBL), 'type' => array(array('id' => 'width_value', 'type' => 'text_number', 'std' => '', 'class' => 'input-mini', 'validate' => 'number', 'parent_class' => 'combo-item merge-data'), array('id' => 'width_type', 'type' => 'select', 'class' => 'input-mini', 'options' => array('%' => '%', 'px' => 'px'), 'std' => '%', 'parent_class' => 'combo-item merge-data')), 'container_class' => 'combo-group', 'tooltip' => __('Set the width of a row (px or %)', IGPBL)), array('name' => __('Tag Name', IGPBL), 'id' => 'tagname', 'type' => 'text_field', 'std' => 'td', 'input_type' => 'hidden', 'container_class' => 'hidden', 'tooltip' => __('', IGPBL)), array('name' => __('Row Span', IGPBL), 'id' => 'rowspan', 'type' => 'text_number', 'std' => '1', 'class' => 'input-mini positive-val', 'validate' => 'number', 'role' => 'extract', 'tooltip' => __('Enable extending over multiple rows', IGPBL)), array('name' => __('Column Span', IGPBL), 'id' => 'colspan', 'type' => 'text_number', 'std' => '1', 'class' => 'input-mini positive-val', 'validate' => 'number', 'role' => 'extract', 'tooltip' => __('Enable extending over multiple columns', IGPBL)), array('name' => __('Row Style', IGPBL), 'id' => 'rowstyle', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_table_row_color()), 'options' => IG_Pb_Helper_Type::get_table_row_color(), 'tooltip' => __('Select a style for a row', IGPBL)), array('name' => __('Content', IGPBL), 'id' => 'cell_content', 'role' => 'content', 'role_2' => 'title', 'type' => 'editor', 'std' => __('', IGPBL), 'tooltip' => __('Table content', IGPBL)))); }
/** * Generate HTML code from shortcode content. * * @param array $atts Shortcode attributes. * @param string $content Current content. * * @return string */ public function element_shortcode_full($atts = null, $content = null) { $arr_params = shortcode_atts($this->config['params'], $atts); extract($arr_params); $html_elemments = $script = ''; $alt_text = $image_alt ? " alt='{$image_alt}'" : ''; $image_styles = array(); if ($image_margin_top) { $image_styles[] = "margin-top:{$image_margin_top}px"; } if ($image_margin_bottom) { $image_styles[] = "margin-bottom:{$image_margin_bottom}px"; } if ($image_margin_right) { $image_styles[] = "margin-right:{$image_margin_right}px"; } if ($image_margin_left) { $image_styles[] = "margin-left:{$image_margin_left}px"; } $styles = count($image_styles) ? ' style="' . implode(';', $image_styles) . '"' : ''; $class_img = $image_container_style != 'no-styling' ? $image_container_style : ''; $class_img = $image_effect == 'yes' ? $class_img . ' image-scroll-fade' : $class_img; $class_img = !empty($class_img) ? ' class="' . $class_img . '"' : ''; if ($image_file) { $image_id = IG_Pb_Helper_Functions::get_image_id($image_file); $attachment = wp_prepare_attachment_for_js($image_id); $image_file = !empty($attachment['sizes'][$image_size]['url']) ? $attachment['sizes'][$image_size]['url'] : $image_file; $html_elemments .= "<img src='{$image_file}'{$alt_text}{$styles}{$class_img} />"; $script = ''; $target = ''; if ($image_effect == 'yes' and !isset($_POST['action'])) { $data = getimagesize($image_file); $width = $data[0]; $height = $data[1]; $html_elemments = "<img src='" . IG_Pb_Helper_Functions::path('assets/3rd-party') . '/jquery-lazyload/grey.gif' . "' data-original='{$image_file}' width='{$width}' height='{$height}' {$alt_text}{$styles} {$class_img}/>"; } if ($open_in) { switch ($open_in) { case 'current_browser': $target = ''; break; case 'new_browser': $target = ' target="_blank"'; break; case 'lightbox': $cls_button_fancy = 'ig-image-fancy'; break; } } $class = isset($cls_button_fancy) && !empty($cls_button_fancy) ? " class='{$cls_button_fancy}'" : ''; // get Single Item and check type to get right link $single_item = explode('__#__', $single_item); $single_item = $single_item[0]; $taxonomies = IG_Pb_Helper_Type::get_public_taxonomies(); $post_types = IG_Pb_Helper_Type::get_post_types(); // single post if (array_key_exists($link_type, $post_types)) { $permalink = home_url() . "/?p={$single_item}"; $html_elemments = "<a href='{$permalink}'{$target}{$class}>" . $html_elemments . '</a>'; } else { if (array_key_exists($link_type, $taxonomies)) { $permalink = get_term_link(intval($single_item), $link_type); if (!is_wp_error($permalink)) { $html_elemments = "<a href='{$permalink}'{$target}{$class}>" . $html_elemments . '</a>'; } } else { switch ($link_type) { case 'url': $html_elemments = "<a href='{$image_type_url}'{$target}{$class}>" . $html_elemments . '</a>'; break; case 'large_image': $image_id = IG_Pb_Helper_Functions::get_image_id($image_file); $attachment = wp_prepare_attachment_for_js($image_id); $image_url = !empty($attachment['sizes'][$image_image_size]['url']) ? $attachment['sizes'][$image_image_size]['url'] : $image_file; $html_elemments = "<a href='{$image_url}'{$target}{$class}>" . $html_elemments . '</a>'; break; } } } if (strtolower($image_alignment) != 'inherit') { if (strtolower($image_alignment) == 'left') { $cls_alignment = 'pull-left'; } if (strtolower($image_alignment) == 'right') { $cls_alignment = 'pull-right'; } if (strtolower($image_alignment) == 'center') { $cls_alignment = 'text-center'; } $html_elemments = "<div class='{$cls_alignment}'>" . $html_elemments . '</div>'; } } return $this->element_wrapper($html_elemments . $script, $arr_params); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('name' => __('Alert Content', IGPBL), 'id' => 'alert_content', 'type' => 'editor', 'role' => 'content', 'rows' => '12', 'std' => IG_Pb_Helper_Type::lorem_text(), 'tooltip' => __('Set content of elementm', IGPBL))), 'styling' => array(array('type' => 'preview'), array('name' => __('Style', IGPBL), 'id' => 'alert_style', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_alert_type()), 'options' => IG_Pb_Helper_Type::get_alert_type(), 'tooltip' => __('Set style for item', IGPBL)), array('name' => __('Allow to close', IGPBL), 'id' => 'alert_close', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Whether the customers can close the alert or not', IGPBL)))); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('name' => __('Text', IGPBL), 'id' => 'text', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('Your text', IGPBL), 'tooltip' => __('Set content of element', IGPBL)), array('name' => __('Tooltip Content', IGPBL), 'id' => 'tooltip_content', 'role' => 'content', 'type' => 'editor', 'std' => __('Your tooltip content', IGPBL), 'tooltip' => __('Set tooltip content', IGPBL))), 'styling' => array(array('type' => 'preview'), array('name' => __('Tooltip Position', IGPBL), 'id' => 'position', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_full_positions()), 'options' => IG_Pb_Helper_Type::get_full_positions(), 'tooltip' => __('Set position where your tooltip will appear', IGPBL)), array('name' => __('Tooltips In Button', IGPBL), 'id' => 'tooltips_button', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'has_depend' => '1', 'tooltip' => __('Create a button for your text', IGPBL)), array('name' => __('Button Color', IGPBL), 'type' => array(array('id' => 'button_color', 'type' => 'select', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_button_color()), 'options' => IG_Pb_Helper_Type::get_button_color())), 'dependency' => array('tooltips_button', '=', 'yes'), 'container_class' => 'color_select2', 'tooltip' => __('Select color for button', IGPBL)), array('name' => __('Delay', IGPBL), 'container_class' => 'combo-group', 'type' => array(array('id' => 'show', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '500', 'append_before' => 'Show', 'append' => 'ms', 'parent_class' => 'combo-item col-xs-5', 'validate' => 'number'), array('id' => 'hide', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini', 'std' => '100', 'append_before' => 'Hide', 'append' => 'ms', 'parent_class' => 'combo-item col-xs-5', 'validate' => 'number')), 'tooltip' => __('Set time (ms) to show/ hide tooltip when hover/ leave', IGPBL)))); }
/** * contain setting items of this element ( use for modal box ) * */ function element_items() { $this->items = array('Notab' => array(array('name' => __('Width', IGPBL), 'id' => 'width', 'type' => 'radio', 'std' => 'boxed', 'options' => array('boxed' => __('Boxed', IGPBL), 'full' => __('Full', IGPBL))), array('name' => __('Background', IGPBL), 'id' => 'background', 'type' => 'select', 'std' => 'none', 'class' => 'input-sm', 'options' => array('none' => __('None', IGPBL), 'solid' => __('Solid Color', IGPBL), 'gradient' => __('Gradient Color', IGPBL), 'pattern' => __('Pattern', IGPBL), 'image' => __('Image', IGPBL)), 'has_depend' => '1'), array('name' => __('Solid Color', IGPBL), 'type' => array(array('id' => 'solid_color_value', 'type' => 'text_field', 'class' => 'input-small', 'std' => '#FFFFFF', 'parent_class' => 'combo-item'), array('id' => 'solid_color_color', 'type' => 'color_picker', 'std' => '#ffffff', 'parent_class' => 'combo-item')), 'container_class' => 'combo-group', 'dependency' => array('background', '=', 'solid')), array('name' => __('Gradient Color', IGPBL), 'id' => 'gradient_color', 'type' => 'gradient_picker', 'std' => '0% #FFFFFF,100% #000000', 'dependency' => array('background', '=', 'gradient')), array('id' => 'gradient_color_css', 'type' => 'text_field', 'std' => '', 'input_type' => 'hidden', 'container_class' => 'hidden', 'dependency' => array('background', '=', 'gradient')), array('name' => __('Gradient Direction', IGPBL), 'id' => 'gradient_direction', 'type' => 'select', 'std' => 'vertical', 'options' => array('vertical' => __('Vertical', IGPBL), 'horizontal' => __('Horizontal', IGPBL)), 'dependency' => array('background', '=', 'gradient')), array('name' => __('Pattern', IGPBL), 'id' => 'pattern', 'type' => 'select_media', 'std' => '', 'class' => 'jsn-input-large-fluid', 'dependency' => array('background', '=', 'pattern')), array('name' => __('Repeat', IGPBL), 'id' => 'repeat', 'type' => 'radio_button_group', 'std' => 'full', 'options' => array('full' => __('Full', IGPBL), 'vertical' => __('Vertical', IGPBL), 'horizontal' => __('Horizontal', IGPBL)), 'dependency' => array('background', '=', 'pattern')), array('name' => __('Image', IGPBL), 'id' => 'image', 'type' => 'select_media', 'std' => '', 'class' => 'jsn-input-large-fluid', 'dependency' => array('background', '=', 'image')), array('name' => __('Stretch', IGPBL), 'id' => 'stretch', 'type' => 'radio_button_group', 'std' => 'none', 'options' => array('none' => __('None', IGPBL), 'full' => __('Full', IGPBL), 'cover' => __('Cover', IGPBL), 'contain' => __('Contain', IGPBL)), 'dependency' => array('background', '=', 'pattern')), array('name' => __('Position', IGPBL), 'id' => 'position', 'type' => 'radio', 'label_type' => 'image', 'dimension' => array(23, 23), 'std' => 'center center', 'options' => array('left top' => array('left top'), 'center top' => array('center top'), 'right top' => array('right top', 'linebreak' => true), 'left center' => array('left center'), 'center center' => array('center center'), 'right center' => array('right center', 'linebreak' => true), 'left bottom' => array('left bottom'), 'center bottom' => array('center bottom'), 'right bottom' => array('right bottom')), 'dependency' => array('background', '=', 'image')), array('name' => __('Enable Paralax', IGPBL), 'id' => 'paralax', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'dependency' => array('background', '=', 'pattern__#__image')), array('name' => __('Border', IGPBL), 'type' => array(array('id' => 'border_width_value_', 'type' => 'text_append', 'input_type' => 'number', 'class' => 'input-mini', 'std' => '0', 'append' => 'px', 'validate' => 'number', 'parent_class' => 'combo-item'), array('id' => 'border_style', 'type' => 'select', 'class' => 'input-sm', 'std' => 'solid', 'options' => IG_Pb_Helper_Type::get_border_styles(), 'parent_class' => 'combo-item'), array('id' => 'border_color', 'type' => 'color_picker', 'std' => '#000', 'parent_class' => 'combo-item')), 'container_class' => 'combo-group'), array('name' => __('Padding', IGPBL), 'container_class' => 'combo-group', 'id' => 'div_padding', 'type' => 'margin', 'extended_ids' => array('div_padding_top', 'div_padding_bottom', 'div_padding_right', 'div_padding_left'), 'div_padding_top' => array('std' => '10'), 'div_padding_bottom' => array('std' => '10'), 'div_padding_right' => array('std' => '10'), 'div_padding_left' => array('std' => '10')), array('name' => __('CSS Class', IGPBL), 'id' => 'css_suffix', 'type' => 'text_field', 'std' => __('', IGPBL), 'tooltip' => __('Add custom css class for the wrapper div of this element', IGPBL)), array('name' => __('ID', IGPBL), 'id' => 'id_wrapper', 'type' => 'text_field', 'std' => __('', IGPBL), 'tooltip' => __('Add custom id for the wrapper div of this element', IGPBL)))); }
/** * DEFINE setting options of shortcode */ public function element_items() { $this->items = array('Notab' => array(array('name' => __('Heading', IGPBL), 'id' => 'heading', 'type' => 'text_field', 'class' => 'input-sm', 'role' => 'title', 'std' => __(IG_Pb_Utils_Placeholder::add_placeholder('Accordion Item %s', 'index'), IGPBL), 'tooltip' => __('Set heading text of item', IGPBL)), array('name' => __('Body', IGPBL), 'id' => 'body', 'role' => 'content', 'type' => 'editor', 'std' => IG_Pb_Helper_Type::lorem_text(), 'tooltip' => __('Set content of element', IGPBL)), array('name' => __('Icon', IGPBL), 'id' => 'icon', 'type' => 'icons', 'std' => '', 'role' => 'title_prepend', 'title_prepend_type' => 'icon', 'tooltip' => __('Select an icon', IGPBL)), array('name' => __('Tag', IGPBL), 'id' => 'tag', 'type' => 'tag', 'std' => '', 'tooltip' => __('Organize your content and group items by tags', IGPBL)))); }
/** * Generate HTML code from shortcode content. * * @param array $atts Shortcode attributes. * @param string $content Current content. * * @return string */ public function element_shortcode_full($atts = null, $content = null) { $html_element = ''; $arr_params = shortcode_atts($this->config['params'], $atts); extract($arr_params); $styles = array(); if ($pb_bg_color) { $styles[] = 'background-color:' . $pb_bg_color; } if (intval($pb_border_top) > 0) { $styles[] = 'border-top-width:' . (int) $pb_border_top . 'px'; $styles[] = 'border-top-style: solid'; } if (intval($pb_border_left) > 0) { $styles[] = 'border-left-width:' . (int) $pb_border_left . 'px'; $styles[] = 'border-left-style: solid'; } if (intval($pb_border_bottom) > 0) { $styles[] = 'border-bottom-width:' . (int) $pb_border_bottom . 'px'; $styles[] = 'border-bottom-style: solid'; } if (intval($pb_border_right) > 0) { $styles[] = 'border-right-width:' . (int) $pb_border_right . 'px'; $styles[] = 'border-right-style: solid'; } if ($pb_border_color) { $styles[] = 'border-color:' . $pb_border_color; } $elements = explode('__#__', $elements); $class = ''; if ($pb_show_drop == 'yes') { $class .= 'promo-box-shadow'; } $single_item = explode('__#__', $single_item); $single_item = $single_item[0]; $script = $cls_button_fancy = $target = $button = ''; if (in_array('button', $elements)) { $taxonomies = IG_Pb_Helper_Type::get_public_taxonomies(); $post_types = IG_Pb_Helper_Type::get_post_types(); // single post if (array_key_exists($link_type, $post_types)) { $permalink = home_url() . "/?p={$single_item}"; $button_href = "href='{$permalink}'"; } else { if (array_key_exists($link_type, $taxonomies)) { $permalink = get_term_link(intval($single_item), $link_type); if (!is_wp_error($permalink)) { $button_href = "href='{$permalink}'"; } } else { switch ($link_type) { case 'no_link': $button_href = ''; break; case 'url': $button_href = "href='{$pb_button_url}'"; break; } } } if ($pb_button_open_in and $link_type != 'no_link') { switch ($pb_button_open_in) { case 'current_browser': $target = ''; break; case 'new_browser': $target = ' target="_blank"'; break; case 'lightbox': $cls_button_fancy = 'ig-pb-button-fancy'; break; } } $pb_button_size = isset($pb_button_size) && $pb_button_size != 'default' ? $pb_button_size : ''; $pb_button_color = isset($pb_button_color) && $pb_button_color != 'default' ? $pb_button_color : ''; $button = "<a class='pull-right btn {$pb_button_size} {$pb_button_color} {$cls_button_fancy}' {$target} {$button_href}>{$pb_button_title}</a>"; if (isset($cls_button_fancy) && !empty($cls_button_fancy)) { $button .= ' <script type="text/javascript"> (function($) { $(document).ready(function() { $(".' . $cls_button_fancy . '" ).fancybox({type:"iframe",autoScale:"false",transitionIn:"elastic",transitionOut:"elastic",width:"75%",height:"75%"}); }); })(jQuery); </script>'; } } $styles = implode(';', $styles); $styles = $styles ? "style='{$styles}'" : ''; $html_element .= "<div class='ig-promobox'>"; $html_element .= "<section class='{$class}' {$styles}>"; $html_element .= $button; if (in_array('title', $elements)) { $style_title = array(); if ($title_font == 'custom') { if ($title_font_face_type == 'google fonts') { $script .= IG_Pb_Helper_Functions::add_google_font_link_tag($title_font_face_value); $style_title[] = 'font-family:' . $title_font_face_value; } elseif ($title_font_face_value) { $style_title[] = 'font-family:' . $title_font_face_value; } if (intval($title_font_size) > 0) { $style_title[] = 'font-size:' . intval($title_font_size) . 'px'; } switch ($title_font_style) { case 'bold': $style_title[] = 'font-weight:700'; break; case 'italic': $style_title[] = 'font-style:italic'; break; case 'normal': $style_title[] = 'font-weight:normal'; break; } if (strpos($title_font_color, '#') !== false) { $style_title[] = 'color:' . $title_font_color; } } if ($title_padding_bottom) { $style_title[] = 'padding-bottom:' . $title_padding_bottom . 'px'; } if ($title_margin_bottom) { $style_title[] = 'margin-bottom:' . $title_margin_bottom . 'px'; } if (count($style_title)) { $style_title = 'style="' . implode(';', $style_title) . '"'; } else { $style_title = ''; } $html_element .= "<h2 {$style_title}>{$pb_title}</h2>"; } $content = !$content ? '' : $content; if (in_array('content', $elements)) { $html_element .= "<p>{$content}</p>"; } $html_element .= '</section>'; $html_element .= '</div>'; return $this->element_wrapper($html_element . $script, $arr_params); }
/** * DEFINE setting options of shortcode */ public function element_items() { $this->items = array('Notab' => array(array('name' => __('Heading', 'plumtree'), 'id' => 'heading', 'type' => 'text_field', 'class' => 'jsn-input-xxlarge-fluid', 'role' => 'title', 'std' => __(IG_Pb_Utils_Placeholder::add_placeholder('Testimonials Item %s', 'index'), 'plumtree'), 'tooltip' => __('Set the text of your heading items', 'plumtree')), array('name' => __('Image File', 'plumtree'), 'id' => 'image_file', 'type' => 'select_media', 'std' => '', 'class' => 'jsn-input-large-fluid', 'tooltip' => __('Select background image for item', 'plumtree')), array('name' => __('Body', 'plumtree'), 'id' => 'body', 'role' => 'content', 'type' => 'editor', 'std' => IG_Pb_Helper_Type::lorem_text(), 'tooltip' => __('Set content of element', 'plumtree')), array('name' => __('Signature', 'plumtree'), 'id' => 'sign', 'type' => 'text_field', 'class' => 'jsn-input-xxlarge-fluid', 'role' => 'title', 'std' => '', 'tooltip' => __('Set the text items', 'plumtree')))); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('action' => array(array('id' => 'btn_convert', 'type' => 'button_group', 'bound' => 0, 'actions' => array(array('std' => __('Tab', IGPBL), 'action_type' => 'convert', 'action' => 'list_to_tab'), array('std' => __('Accordion', IGPBL), 'action_type' => 'convert', 'action' => 'list_to_accordion'), array('std' => __('Carousel', IGPBL), 'action_type' => 'convert', 'action' => 'list_to_carousel')))), 'content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'jsn-input-xxlarge-fluid', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('id' => 'list_items', 'type' => 'group', 'shortcode' => ucfirst(__CLASS__), 'sub_item_type' => $this->config['has_subshortcode'], 'sub_items' => array(array('std' => ''), array('std' => '')))), 'styling' => array(array('type' => 'preview'), array('name' => __('Show Icon', IGPBL), 'id' => 'show_icon', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => 'Show selected icon', 'has_depend' => '1'), array('name' => __('Icon Position', IGPBL), 'id' => 'icon_position', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_icon_position()), 'options' => IG_Pb_Helper_Type::get_icon_position(), 'tooltip' => __('Set Icon Position', IGPBL), 'dependency' => array('show_icon', '=', 'yes')), array('name' => __('Icon Background', IGPBL), 'type' => array(array('id' => 'icon_size_value', 'type' => 'select', 'class' => 'input-mini input-sm', 'std' => '32', 'options' => IG_Pb_Helper_Type::get_icon_sizes(), 'parent_class' => 'combo-item input-append select-append input-group input-select-append', 'append_text' => 'px'), array('id' => 'icon_background_type', 'type' => 'select', 'class' => 'input-sm', 'std' => 'circle', 'options' => IG_Pb_Helper_Type::get_icon_background(), 'parent_class' => 'combo-item'), array('id' => 'icon_background_color', 'type' => 'color_picker', 'std' => '#0088CC', 'parent_class' => 'combo-item')), 'tooltip' => __('Set Icon Background', IGPBL), 'container_class' => 'combo-group', 'dependency' => array('show_icon', '=', 'yes')), array('name' => __('Icon Color', IGPBL), 'type' => array(array('id' => 'icon_c_value', 'type' => 'text_field', 'std' => '#FFFFFF', 'parent_class' => 'combo-item'), array('id' => 'icon_c_color', 'type' => 'color_picker', 'std' => '#ffffff', 'parent_class' => 'combo-item')), 'tooltip' => __('Set Icon Color', IGPBL), 'container_class' => 'combo-group', 'dependency' => array('show_icon', '=', 'yes')), array('type' => 'hr'), array('name' => __('Show Heading', IGPBL), 'id' => 'show_heading', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => 'Whether to Show Heading or not', 'has_depend' => '1'), array('name' => __('Heading Font', IGPBL), 'id' => 'font', 'type' => 'select', 'std' => 'inherit', 'options' => array('inherit' => __('Inherit', IGPBL), 'custom' => __('Custom', IGPBL)), 'has_depend' => '1', 'tooltip' => __('Set Heading Font type', IGPBL), 'class' => 'input-medium', 'dependency' => array('show_heading', '=', 'yes')), array('name' => __('Font Face', IGPBL), 'id' => 'font-family', 'type' => array(array('id' => 'font_face_type', 'type' => 'jsn_select_font_type', 'class' => 'input-medium input-sm', 'std' => 'standard fonts', 'options' => IG_Pb_Helper_Type::get_fonts(), 'parent_class' => 'combo-item'), array('id' => 'font_face_value', 'type' => 'jsn_select_font_value', 'class' => 'input-medium input-sm', 'std' => 'Verdana', 'options' => '', 'parent_class' => 'combo-item')), 'dependency' => array('font', '=', 'custom'), 'tooltip' => __('Select Font Face', IGPBL), 'container_class' => 'combo-group'), array('name' => __('Font Attributes', IGPBL), 'type' => array(array('id' => 'font_size_value', 'type' => 'text_append', 'type_input' => 'number', 'class' => 'input-mini input-sm', 'std' => '', 'append' => 'px', 'validate' => 'number', 'parent_class' => 'combo-item input-append-inline'), array('id' => 'font_style', 'type' => 'select', 'class' => 'input-medium ig-mini-input input-sm', 'std' => 'bold', 'options' => IG_Pb_Helper_Type::get_font_styles(), 'parent_class' => 'combo-item'), array('id' => 'color', 'type' => 'color_picker', 'std' => '#000000', 'parent_class' => 'combo-item')), 'dependency' => array('font', '=', 'custom'), 'tooltip' => __('Set size and text style for your heading', IGPBL), 'container_class' => 'combo-group'))); }
/** * Define shortcode settings. * * @return void */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', IGPBL), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'input-sm', 'std' => __('', IGPBL), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', IGPBL)), array('id' => 'progress_bar_items', 'type' => 'group', 'shortcode' => ucfirst(__CLASS__), 'sub_item_type' => $this->config['has_subshortcode'], 'sub_items' => array(array('std' => __('', IGPBL)), array('std' => __('', IGPBL)), array('std' => __('', IGPBL))))), 'styling' => array(array('type' => 'preview'), array('name' => __('Presentation', IGPBL), 'id' => 'progress_bar_style', 'type' => 'select', 'class' => 'input-sm', 'std' => IG_Pb_Helper_Type::get_first_option(IG_Pb_Helper_Type::get_progress_bar_style()), 'options' => IG_Pb_Helper_Type::get_progress_bar_style(), 'tooltip' => __('Presentation', IGPBL)), array('name' => __('Show Icon', IGPBL), 'id' => 'progress_bar_show_icon', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show selected icon', IGPBL)), array('name' => __('Show Title', IGPBL), 'id' => 'progress_bar_show_title', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show Title', IGPBL)), array('name' => __('Show Percentage', IGPBL), 'id' => 'progress_bar_show_percent', 'type' => 'radio', 'std' => 'yes', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Show Percentage', IGPBL)), array('name' => __('Make Active', IGPBL), 'id' => 'progress_bar_stack_active', 'type' => 'radio', 'std' => 'no', 'options' => array('yes' => __('Yes', IGPBL), 'no' => __('No', IGPBL)), 'tooltip' => __('Make Active', IGPBL)))); }
/** * DEFINE setting options of shortcode */ public function element_items() { $this->items = array('content' => array(array('name' => __('Element Title', 'plumtree'), 'id' => 'el_title', 'type' => 'text_field', 'class' => 'jsn-input-xxlarge-fluid', 'std' => __('Carousel', 'plumtree'), 'role' => 'title', 'tooltip' => __('Set title for current element for identifying easily', 'plumtree')), array('id' => 'carousel_items', 'type' => 'group', 'shortcode' => ucfirst(__CLASS__), 'sub_item_type' => $this->config['has_subshortcode'], 'sub_items' => array(array('std' => ''), array('std' => '')))), 'styling' => array(array('type' => 'preview'), array('name' => __('Alignment', 'plumtree'), 'id' => 'align', 'type' => 'select', 'std' => 'center', 'options' => IG_Pb_Helper_Type::get_text_align(), 'tooltip' => __('Setting position: right, left, center, inherit parent style', 'plumtree')), array('name' => __('Dimension', 'plumtree'), 'container_class' => 'combo-group', 'id' => 'dimension', 'type' => 'dimension', 'extended_ids' => array('dimension_width', 'dimension_height', 'dimension_width_unit'), 'dimension_width' => array('std' => ''), 'dimension_height' => array('std' => ''), 'dimension_width_unit' => array('options' => array('px' => 'px', '%' => '%'), 'std' => 'px'), 'tooltip' => __('Set width and height of element', 'plumtree')), array('name' => __('Autoplay', 'plumtree'), 'id' => 'autoplay', 'type' => 'radio', 'std' => 'false', 'options' => array('true' => __('Yes', 'plumtree'), 'false' => __('No', 'plumtree')), 'has_depend' => '1', 'tooltip' => __('Whether to running your carousel automatically or not', 'plumtree')), array('name' => __(' Type', 'plumtree'), 'id' => 'car_mode', 'type' => 'select', 'std' => 'block', 'options' => array('block' => 'Block', 'inline' => 'Inline'), 'tooltip' => __('Set the carousel mode', 'plumtree')))); }