Example #1
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  */
 public function element_shortcode($atts = null, $content = null)
 {
     extract(JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts));
     $inner_content = JSNPagebuilderHelpersShortcode::removeAutop($content);
     $inner_content = JSNPagebuilderHelpersFunctions::add_absolute_path_to_image_url($inner_content);
     return "\n\t\t\t<div id='pane_{index}' class='tab-pane {active} {fade_effect}' STYLE>\n\t\t\t\t{$inner_content}\n\t\t\t</div><!--seperate-->";
 }
Example #2
0
 /**
  * Include admin scripts
  * 
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/js/colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/css/colorpicker.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/divider/assets/js/divider-setting.js', 'js');
 }
Example #3
0
 /**
  * Include admin scripts
  *
  * @return mixed
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JURI::root(true) . '/media/system/js/calendar.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JURI::root(true) . '/media/system/js/calendar-setup.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/articlelist/assets/css/articlelist.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/articlelist/assets/js/articlelist.js', 'js');
 }
Example #4
0
 /**
  * Include admin scripts
  *
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-iconsocialselector.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-general.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/3rd-party/font-awesome/css/font-awesome.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/css/jsn-fontawesome.css', 'css');
 }
Example #5
0
 /**
  * Include admin scripts
  *
  * @return mixed
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/market/assets/js/3rd-party/slick/slick.min.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/market/assets/js/3rd-party/slick/slick.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/market/assets/css/market.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/market/assets/js/market.js', 'js');
 }
Example #6
0
 /**
  * Include admin scripts
  *
  * @return type
  */
 public function backend_element_assets()
 {
     $document = JFactory::getDocument();
     JSNHtmlAsset::addScript(JSNPB_ELEMENT_URL . '/pricingtable/assets/js/pricingtable-settings.js', 'text/javascript');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/pricingtable/assets/js/item_pricingtable.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/pricingtable/assets/css/item_pricingtable.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-linktype.js', 'js');
 }
Example #7
0
 /**
  * Include admin scripts
  *
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/font-awesome/css/font-awesome.min.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-iconselector.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/js/colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/css/colorpicker.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/progresscircle/assets/js/progresscircle-settings.js', 'js');
 }
Example #8
0
 /**
  * Include admin scripts
  * 
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-select2/select2.min.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-select2/select2.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-iconselector.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-general.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-fonticomoon.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/font-awesome/css/font-awesome.min.css', 'css');
 }
Example #9
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  *
  * @return string
  */
 public function element_shortcode($atts = null, $content = null)
 {
     $content = JSNPagebuilderHelpersFunctions::add_absolute_path_to_image_url($content);
     $atts['testimonial_content'] = $content;
     return serialize($atts) . '<!--seperate-->';
     extract(JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts));
     $img = !empty($image_file) ? "<img class='pb-testimonial-image {style}' src='{$image_file}' />" : '';
     return "";
 }
Example #10
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  *
  * @return string
  */
 public function element_shortcode($atts = null, $content = null)
 {
     JSNPagebuilderHelpersFunctions::loadFancyboxJS();
     $document = JFactory::getDocument();
     $document->addScript(JSNPB_ELEMENT_URL . '/button/assets/js/button.js', 'text/javascript');
     $document->addStyleSheet(JSNPB_ELEMENT_URL . '/button/assets/css/button.css', 'text/css');
     $arr_params = JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts);
     extract($arr_params);
     $button_text = !$button_text ? '' : $button_text;
     $button_icon = !$icon ? '' : "<i class='{$icon}'></i>";
     $tag = 'a';
     $href = '';
     $script = '';
     @($single_item = explode('__#__', $single_item));
     $single_item = $single_item[0];
     if (!empty($link_type)) {
         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 = ' pb-button-fancy';
                 break;
         }
     }
     $button_type = $tag == 'button' ? " type='button'" : '';
     $cls_button_fancy = !isset($cls_button_fancy) ? '' : $cls_button_fancy;
     $script = !isset($script) ? '' : $script;
     $cls_alignment = $custom_style = '';
     if (strtolower($arr_params['button_alignment']) != 'inherit') {
         if (strtolower($arr_params['button_alignment']) == 'left') {
             $cls_alignment = 'pull-left';
         }
         if (strtolower($arr_params['button_alignment']) == 'right') {
             $cls_alignment = 'pull-right';
         }
         if (strtolower($arr_params['button_alignment']) == 'center') {
             $cls_alignment = 'text-center';
         }
     }
     $html_element = $script . "<div class='pb-element-button {$cls_alignment}'><{$tag} class='btn {$cls_alignment} {$button_size} {$button_color} {$cls_button_fancy}'{$href}{$target}{$button_type}>{$button_icon}{$button_text}</{$tag}></div>";
     return $this->element_wrapper($html_element, $arr_params, null, $custom_style);
 }
Example #11
0
 /**
  * Include admin scripts
  *
  * @return void
  */
 public function backend_element_assets()
 {
     $document = JFactory::getDocument();
     JSNPagebuilderHelpersFunctions::print_asset_tag(JURI::root(true) . '/media/jui/js/bootstrap.min.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/classygradient/css/jquery.classygradient.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/classygradient/js/jquery.classygradient.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/js/colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/css/colorpicker.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JUri::root(true) . '/administrator/components/com_pagebuilder/helpers/shortcode/row/assets/js/row.js', 'js');
 }
Example #12
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  *
  * @return string
  */
 public function element_shortcode($atts = null, $content = null)
 {
     JSNPagebuilderHelpersFunctions::loadFancyboxJS();
     $document = JFactory::getDocument();
     $document->addScript(JSNPB_ELEMENT_URL . '/buttonbar/assets/js/buttonbar.js', 'text/javascript');
     $document->addStyleSheet(JSNPB_ELEMENT_URL . '/buttonbar/assets/css/buttonbar.css', 'text/css');
     $arr_params = JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts);
     $html_element = '';
     $sub_shortcode = empty($content) ? JSNPagebuilderHelpersShortcode::removeAutop($content) : JSNPagebuilderHelpersBuilder::generateShortCode($content, false, 'frontend', true);
     $items = explode('<!--seperate-->', $sub_shortcode);
     // remove empty element
     $items = array_filter($items);
     $initial_open = !isset($initial_open) || $initial_open > count($items) ? 1 : $initial_open;
     foreach ($items as $idx => $item) {
         $open = $idx + 1 == $initial_open ? 'in' : '';
         $items[$idx] = $item;
     }
     $sub_htmls = implode('', $items);
     if ($arr_params['buttonbar_show_title'] == 'no') {
         $pattern = '\\[(\\[?)(title)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)';
         $sub_htmls = preg_replace('/' . $pattern . '/s', '', $sub_htmls);
     } else {
         $sub_htmls = str_replace('[title]', '', $sub_htmls);
         $sub_htmls = str_replace('[/title]', '', $sub_htmls);
     }
     if ($arr_params['buttonbar_show_icon'] == 'no') {
         $pattern = '\\[(\\[?)(icon)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)';
         $sub_htmls = preg_replace('/' . $pattern . '/s', '', $sub_htmls);
     } else {
         $sub_htmls = str_replace('[icon]', '', $sub_htmls);
         $sub_htmls = str_replace('[/icon]', '', $sub_htmls);
     }
     if ($arr_params['buttonbar_group'] == 'no') {
         $html_element = $sub_htmls;
     } else {
         $html_element = "<div class='btn-group' style='float: none;'>" . $sub_htmls . '</div>';
     }
     $cls_alignment = '';
     if (strtolower($arr_params['buttonbar_alignment']) != 'inherit') {
         if (strtolower($arr_params['buttonbar_alignment']) == 'left') {
             $cls_alignment = 'pull-left';
         }
         if (strtolower($arr_params['buttonbar_alignment']) == 'right') {
             $cls_alignment = 'pull-right';
         }
         if (strtolower($arr_params['buttonbar_alignment']) == 'center') {
             $cls_alignment = 'text-center';
         }
     }
     $html_element .= '<div style="clear: both"></div>';
     $html_element = "<div class='btn-toolbar {$cls_alignment}'>{$html_element}</div>";
     $html_element .= '<div style="clear: both"></div>';
     return $this->element_wrapper($html_element, $arr_params);
 }
Example #13
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  *
  * @return string
  */
 public function element_shortcode($atts = null, $content = null)
 {
     $params = JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts);
     extract($params);
     // reassign value for description from content of shortcode
     $content = JSNPagebuilderHelpersFunctions::add_absolute_path_to_image_url($content);
     $params['gmi_desc_content'] = $content;
     $html_element = "<input type='hidden' value='" . json_encode($params) . "' class='pb-gmi-lat-long' />";
     $html_element .= '<!--seperate-->';
     return $html_element;
 }
Example #14
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  */
 public function element_shortcode($atts = null, $content = null)
 {
     extract(JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts));
     $content = JSNPagebuilderHelpersShortcode::removeAutop($content);
     $rowstyle = !$rowstyle || strtolower($rowstyle) == 'default' ? '' : $rowstyle;
     if (in_array($tagname, array('tr_start', 'tr_end'))) {
         return "{$tagname}<!--seperate-->";
     }
     $width = !empty($width_value) ? "width='{$width_value}{$width_type}'" : '';
     $empty = empty($content) ? '<!--empty-->' : '';
     return "<CELL_WRAPPER class='{$rowstyle}' rowspan='{$rowspan}' colspan='{$colspan}' {$width}>" . JSNPagebuilderHelpersFunctions::add_absolute_path_to_image_url($content) . "</CELL_WRAPPER>{$empty}<!--seperate-->";
 }
Example #15
0
    /**
     * Include admin scripts
     */
    public function backend_element_assets()
    {
        JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/table/assets/css/table.css', 'css');
        $template = self::generateTableItemRowTemplate();
        $script = '
		var JSNPbParams = JSNPbParams || {pbstrings:{}};				
		JSNPbParams.tpml_table_item = \'' . addslashes($template) . '\';
		JSNPbParams.pbstrings.ROW_SPAN = \'' . JText::_("JSN_PAGEBUILDER_ELEMENT_TABLE_ROW_COLUMN_SPAN_CANT_BE_NAGETIVE") . '\';
		JSNPbParams.pbstrings.TABLE_COLUMNS = \'' . JText::_("JSN_PAGEBUILDER_ELEMENT_TABLE_TABLE_MUST_HAS_ATLEAST_1_COLUMN_YOU_CANT_REMOVE_THIS_COLUMN") . '\';
		JSNPbParams.pbstrings.TABLE_ROWS = \'' . JText::_("JSN_PAGEBUILDER_ELEMENT_TABLE_TABLE_MUST_HAS_ATLEAST_2_ROWS_YOUR_CANT_REMOVE_THIS_ROW") . '\';
		var JSNPbTableParams = JSNPbParams';
        JSNPagebuilderHelpersFunctions::print_asset_tag($script, 'js', null, true);
        JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/table/assets/js/table-setting.js', 'js');
    }
Example #16
0
 /**
  * Include admin scripts
  *
  * @return type
  */
 public function backend_element_assets()
 {
     //fix conflict with com_flexicontent
     $flexicontent = JSNPagebuilderHelpersPagebuilder::checkComponentEnabled('com_flexicontent');
     if ($flexicontent) {
         JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/video/assets/css/video.css', 'css');
     } else {
         JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-select2/select2.min.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-select2/select2.css', 'css');
     }
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/js/colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-colorpicker/css/colorpicker.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ADMIN_URL . '/assets/joomlashine/js/jsn-colorpicker.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/video/assets/js/video-setting.js', 'js');
 }
Example #17
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  *
  * @return string
  */
 public function element_shortcode($atts = null, $content = null)
 {
     $html_element = '';
     $arr_params = JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts);
     extract($arr_params);
     $alert_style = !$arr_params['alert_style'] ? '' : $arr_params['alert_style'];
     $alert_close = !$arr_params['alert_close'] || $arr_params['alert_close'] == 'no' ? '' : '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
     $alert_dismis = !$arr_params['alert_close'] || $arr_params['alert_close'] == 'no' ? '' : ' alert-dismissable';
     $content = !$content ? $alert_content : $content;
     $content = JSNPagebuilderHelpersFunctions::add_absolute_path_to_image_url($content);
     $html_element .= "<div class='alert {$alert_style}{$alert_dismis}'>";
     $html_element .= $alert_close;
     $html_element .= $content;
     $html_element .= '</div>';
     $html_element .= '<div style="clear: both"></div>';
     return $this->element_wrapper($html_element, $arr_params);
 }
Example #18
0
 /**
  * Function to sync sub-shortcode content become sub-shortcode array
  *
  * @param array $arr_shortcodes
  */
 private function sync_sub_content($sub_shortcode = '')
 {
     $document = JFactory::getDocument();
     JSNPagebuilderHelpersFunctions::loadFancyboxJS();
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-tipsy/jquery.tipsy.js', 'text/javascript');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-tipsy/tipsy.css', 'text/css');
     $document->addStyleSheet(JSNPB_ELEMENT_URL . '/pricingtable/assets/css/pricingtable_frontend.css', 'text/css');
     $document->addScript(JSNPB_ELEMENT_URL . '/pricingtable/assets/js/pricingtable_frontend.js', 'text/javascript');
     $arr_shortcodes = array();
     if (!$sub_shortcode) {
         return;
     }
     // Convert to sub-shortcode array
     $arr_sub_shortcode = $arr_values = array();
     $pattern = '\\[(\\[?)(pb_pricingtableattr_item)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)';
     preg_match_all("/{$pattern}/s", $sub_shortcode, $matches);
     $arr_sub_shortcode['pb_pricingtableattr_item'] = $matches[0];
     if (isset($arr_sub_shortcode['pb_pricingtableattr_item']) && is_array($arr_sub_shortcode['pb_pricingtableattr_item'])) {
         $arr_shortcodes['pb_pricingtableattr_item'] = implode('', $arr_sub_shortcode['pb_pricingtableattr_item']);
     }
     $pattern = '\\[(\\[?)(pb_pricingtable_item)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)';
     preg_match_all("/{$pattern}/s", $sub_shortcode, $matches);
     $arr_sub_shortcode['pb_pricingtable_item'] = $matches[0];
     if (isset($arr_sub_shortcode['pb_pricingtable_item']) && is_array($arr_sub_shortcode['pb_pricingtable_item'])) {
         foreach ($arr_sub_shortcode['pb_pricingtable_item'] as $i => $item) {
             $pattern = '\\[(\\[?)(pb_pricingtable_item_item)(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\/\\2\\])[^\\[]*+)*+)\\[\\/\\2\\])?)(\\]?)';
             preg_match_all("/{$pattern}/s", $item, $matches);
             $arr_values['pb_pricingtable_item_item'] = $matches[0];
             $count = count($arr_values['pb_pricingtable_item_item']);
             $_item = preg_replace("/{$pattern}/s", '<!--pb-replace-flag-->', $item);
             // Simulate mechanism process sub-shortcode in modal template
             $sub_sc_data = JSNPBShortcodePricingTableItem::_sub_items_filter($arr_values, 'pb_pricingtable_item', $arr_sub_shortcode['pb_pricingtableattr_item']);
             if (isset($sub_sc_data['pb_pricingtable_item_item']) && is_array($sub_sc_data['pb_pricingtable_item_item'])) {
                 $str_pr_tbl_shortcode = str_replace(str_repeat('<!--pb-replace-flag-->', $count), implode('', $sub_sc_data['pb_pricingtable_item_item']), $_item);
             }
             $str_pr_tbl_shortcode = str_replace('"prtbl_item_attr_value', '" prtbl_item_attr_value', $str_pr_tbl_shortcode);
             $arr_shortcodes['pb_pricingtable_item'][] = $str_pr_tbl_shortcode;
         }
     }
     return $arr_shortcodes;
 }
Example #19
0
 /**
  * Include admin scripts
  * 
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-select2/select2.min.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-select2/select2.css', 'css');
 }
Example #20
0
 /**
  * Include admin scripts
  *
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-fonticomoon.css', 'css');
 }
 /**
  * Save custom css information: file, code
  * @return void
  *
  **/
 public function save_css_custom()
 {
     $content_id = $_POST['content_id'];
     JSNPagebuilderHelpersFunctions::custom_css($content_id, 'css_files', 'put', $_POST['css_files']);
     JSNPagebuilderHelpersFunctions::custom_css($content_id, 'css_custom', 'put', $_POST['css_custom']);
     exit;
 }
Example #22
0
 /**
  * define shortcode structure of element
  *
  * @return string
  */
 function element_shortcode($atts = null, $content = null)
 {
     $extra_class = $style = $common_style = $data_attr = '';
     $extra_id = !empty($atts['id_wrapper']) ? $atts['id_wrapper'] : JSNPagebuilderHelpersShortcode::generateRandomString();
     if (isset($atts) && is_array($atts)) {
         $arr_styles = array();
         //            if(isset($atts['width'])){
         //                if($atts['width'] == 'full'){
         //                    $extra_class = 'pb_fullwidht';
         //                    $script = "$(body).addClass('pb_fullwidht');";
         //                    $custom_script = JSNPagebuilderHelpersShortcode::script_box($script);
         //                    $arr_styles[] = '-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;width: 100%;padding-left: 1000px;padding-right: 1000px;margin:0 -1000px;';
         //                }
         //            }
         $background = "";
         switch ($atts['background']) {
             case 'solid':
                 $solid_color = $atts['solid_color_value'];
                 $background = "background-color: {$solid_color};";
                 break;
             case 'gradient':
                 if (!isset($atts['gradient_color_css'])) {
                     $background = "background:linear-gradient(center top , #ffffff 0%, #000000 100%);background:-moz-linear-gradient(center top , #ffffff 0%, #000000 100%);    background: -webkit-linear-gradient(#FFFFFF, #000000);background:-o-linear-gradient(center top , #ffffff 0%, #000000 100%);background:-ms-linear-gradient(center top , #ffffff 0%, #000000 100%);";
                 } else {
                     $background = $atts['gradient_color_css'];
                 }
                 break;
             case 'pattern':
                 $pattern_img = isset($atts['pattern']) ? $atts['pattern'] : '';
                 $pattern_repeat = isset($atts['repeat']) ? $atts['repeat'] : '';
                 $background = "background-image:url('{$pattern_img}');";
                 switch ($pattern_repeat) {
                     case 'full':
                         $background_repeat = "repeat";
                         break;
                     case 'vertical':
                         $background_repeat = "repeat-y";
                         break;
                     case 'horizontal':
                         $background_repeat = "repeat-x";
                         break;
                     default:
                         $background_repeat = "repeat";
                 }
                 $background .= "background-repeat:{$background_repeat};";
                 break;
             case 'image':
                 if (isset($atts['image'])) {
                     $image = $atts['image'];
                 }
                 $image_position = $atts['position'];
                 $pattern_stretch = isset($atts['stretch']) ? $atts['stretch'] : '';
                 $url_pattern = '/^(http|https)/';
                 preg_match($url_pattern, $image, $_f);
                 if (!count($_f)) {
                     $image = JUri::root() . $image;
                 }
                 $background = "background-image:url('{$image}');background-position:{$image_position};";
                 switch ($pattern_stretch) {
                     case 'none':
                         $background_size = "";
                         break;
                     case 'full':
                         $background_size = "100% 100%";
                         break;
                     case 'cover':
                         $background_size = "cover";
                         break;
                     case 'contain':
                         $background_size = "contain";
                         break;
                 }
                 $background .= !empty($background_size) ? "background-size:{$background_size};" : "";
                 break;
             case 'video':
                 $url = $atts['video_url'];
                 // Youtube video
                 $pattern = '#^(?:https?://)?';
                 # Optional URL scheme. Either http or https.
                 $pattern .= '(?:www\\.)?';
                 #  Optional www subdomain.
                 $pattern .= '(?:';
                 #  Group host alternatives:
                 $pattern .= 'youtu\\.be/';
                 #    Either youtu.be,
                 $pattern .= '|youtube\\.com';
                 #    or youtube.com
                 $pattern .= '(?:';
                 #    Group path alternatives:
                 $pattern .= '/embed/';
                 #      Either /embed/,
                 $pattern .= '|/v/';
                 #      or /v/,
                 $pattern .= '|/watch\\?v=';
                 #      or /watch?v=,
                 $pattern .= '|/watch\\?.+&v=';
                 #      or /watch?other_param&v=
                 $pattern .= ')';
                 #    End path alternatives.
                 $pattern .= ')';
                 #  End host alternatives.
                 $pattern .= '([\\w-]{11})';
                 # 11 characters (Length of Youtube video ids).
                 $pattern .= '(?:.+)?$#x';
                 # Optional other ending URL parameters.
                 if (preg_match($pattern, $url, $matches)) {
                     $extra_class .= 'pb_video_bg';
                     $youtube_url = end($matches);
                     $data_attr = sprintf("data-property=\"{videoURL:'http://youtu.be/%s', containment:'%s', autoplay:%s, mute:true, startAt:0, opacity:1, showControls:false}\"", $youtube_url, "#{$extra_id}", $atts['autoplay']);
                     $script = "\n\t                        (function(\$){\n\t                            \$(document).ready(function(){\n\t                                \$('.pb_video_bg').mb_YTPlayer();\n\t                                    \$('.pb_video_bg').click(function(){ \$(this).playYTP()})\n\t                            })\n\t                            })(jQuery);\n\t                            ";
                     JFactory::getDocument()->addScriptDeclaration($script, 'text/javascript');
                     self::enqueue_player_scripts();
                 } else {
                     JSNPagebuilderHelpersFunctions::print_asset_tag(JUri::root(true) . '/administrator/components/com_pagebuilder/helpers/shortcode/row/assets/css/row.css', 'css');
                     $autoplay = $atts['autoplay'] == 1 ? 'autoplay="true"' : '';
                     $script = "\n\t\t\t\t\t\t\tjQuery(document).ready(function(\$){\n\t\t\t\t\t\t\tvar bgwidth = \$('#{$extra_id}').width();\n\t\t\t\t\t\t\tvar bgheight = \$('#{$extra_id}').height();\n\t\t\t\t\t\t\tconsole.log(bgwidth)\n\t\t\t\t\t\t\t\$('#{$extra_id}').css({'position':'relative','z-index':'1','overflow':'hidden'})\n\t\t\t\t\t\t\t\$('video').attr({'width':bgheight, 'height': bgheight});\n\t\t\t\t\t\t\t\$('object').attr({'width':bgheight, 'height': bgheight});\n\t\t\t\t\t\t\t\t\$('video').mediaelementplayer({\n\t\t\t\t\t\t\t\t'loop':true,\n\t\t\t\t\t\t\t\t'clickToPlayPause': false,\n\t\t\t\t\t\t\t\t'controls': false,\n\t\t\t\t\t\t\t\tsuccess: function(player, dom, mediaelement){\n\t\t\t\t\t\t\t\t\tmediaelement.container[0].style.position = 'absolute';\n\t\t\t\t\t\t\t\t\tmediaelement.container[0].style.zIndex = '1';\n\t\t\t\t\t\t\t\t\t\$('.mejs-controls').css('display', 'none');\n\t\t\t\t\t\t\t\t\tplayer.play();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tvar source = \$('<object type=\"application/x-shockwave-flash\" width=\"'+bgwidth+'\" height=\"'+bgheight+'\" data=\"" . JSNPB_PLG_SYSTEM_ASSETS_URL . "/3rd-party/mediaelement/flashmediaelement.swf\">'+\n\t\t\t\t\t\t\t\t\t\t\t\t'<param name=\"movie\" value=\"" . JSNPB_PLG_SYSTEM_ASSETS_URL . "/3rd-party/mediaelement/flashmediaelement.swf\" />'+\n                            \t\t\t\t\t'<param name=\"flashVars\" value=\"controls=false&file=" . $url . "\" />'+\n                            \t\t\t\t\t'</object>'+\n                                                '<img src=\"" . JSNPB_PLG_SYSTEM_ASSETS_URL . "/3rd-party/mediaelement/bigplay.png\" width=\"'+bgwidth+'\" height=\"'+bgheight+'\" title=\"No video playback capabilities\" />');\n\t\t\t\t\t            var video = \$('<video controls=\"controls\" width=\"'+bgwidth+'\" height=\"\" {$autoplay} loop=\"true\" style=\"position: absolute; left: 0px; top: -20px; overflow: hidden; opacity: 1; transition-property: opacity; transition-duration: 2000ms; z-index: -1; min-width: 101%; min-height: 100%;\" ><source src=\"" . $url . "\" /></video>').append(source);\n\n\t\t\t\t\t            \$('#{$extra_id}').append(video);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t";
                     JFactory::getDocument()->addScriptDeclaration($script, 'text/javascript');
                     $document = JFactory::getDocument();
                     $document->addStyleSheet(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/mediaelement/mediaelementplayer.min.css', 'text/css');
                     $document->addScript(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/mediaelement/mediaelement-and-player.min.js', 'text/javascript');
                 }
                 break;
         }
         $arr_styles[] = $background;
         if (isset($atts['paralax']) && $atts['paralax'] == 'yes') {
             $arr_styles[] = "background-attachment:fixed;";
         }
         if (isset($atts['parallax_scroll']) && $atts['parallax_scroll'] == 'yes') {
             $extra_class .= 'parallax';
             $document = JFactory::getDocument();
             $document->addScript(JUri::root(true) . '/administrator/components/com_pagebuilder/helpers/shortcode/row/assets/js/parallax.js', 'text/javascript');
         }
         if (isset($atts['border_width_value_']) && intval($atts['border_width_value_'])) {
             $border = array();
             $border[] = $atts['border_width_value_'] . "px";
             $border[] = $atts['border_style'];
             $border[] = $atts['border_color'];
             $border = implode(" ", $border);
             $arr_styles[] = "border-top:{$border}; border-bottom:{$border};";
         }
         $arr_styles[] = "padding-top:{$atts['div_padding_top']}px;";
         $arr_styles[] = "padding-bottom:{$atts['div_padding_bottom']}px;";
         $arr_styles[] = "padding-left:{$atts['div_padding_left']}px;";
         $arr_styles[] = "padding-right:{$atts['div_padding_right']}px;";
         if (@$atts['width_value']) {
             $arr_styles[] = "width:" . $atts['width_value'] . $atts['width_unit'] . '; margin:0 auto';
         }
         $arr_styles = implode("", $arr_styles);
         $style = !empty($arr_styles) ? "style=\"{$arr_styles}\"" : "";
     }
     $column_html = empty($content) ? JSNPagebuilderHelpersShortcode::removeAutop($content) : JSNPagebuilderHelpersBuilder::generateShortCode($content, true, 'frontend');
     $extra_class .= !empty($atts['css_suffix']) ? ' ' . htmlspecialchars($atts['css_suffix']) : '';
     $extra_class = ltrim($extra_class, ' ');
     return $common_style . "<div class='jsn-bootstrap3'><div id='{$extra_id}' class='{$extra_class} row' {$style} {$data_attr}>" . $column_html . "</div></div>";
 }
Example #23
0
 /**
  * Text area with WYSIWYG
  * 
  * @param type $element
  * 
  * @return type
  */
 static function tiny_mce($element)
 {
     // Load js and style sheet for frontend
     $base = JUri::root();
     $jCfg = JFactory::getConfig();
     $language = JFactory::getLanguage();
     $text_direction = 'data-direction="ltr"';
     if ($language->isRTL()) {
         $text_direction = 'data-direction="rtl"';
     }
     $urlbase = 'data-url=' . $base;
     if (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . $language->getTag() . ".js")) {
         $langPrefix = $language->getTag();
     } elseif (file_exists(JPATH_ROOT . "/media/editors/tinymce/langs/" . substr($language->getTag(), 0, strpos($language->getTag(), '-')) . ".js")) {
         $langPrefix = substr($language->getTag(), 0, strpos($language->getTag(), '-'));
     } else {
         $langPrefix = "en";
     }
     $langPrefix = "data-lang=" . $langPrefix;
     $jceData = "";
     if (file_exists(JPATH_ROOT . '/media/editors/tinymce/tinymce.min.js') && $jCfg->get('editor') != 'jce') {
         if ($jCfg->get('editor') != 'tinymce') {
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/tinymce.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/table/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/link/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/image/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/code/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/hr/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/charmap/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/autolink/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/lists/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/plugins/importcss/plugin.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/themes/modern/theme.min.js', 'js');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/content.inline.min.css', 'css');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/content.min.css', 'css');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/skin.min.css', 'css');
             JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'media/editors/tinymce/skins/lightgray/skin.ie7.min.css', 'css');
         }
         $editor = 'tinymce';
     } elseif ($jCfg->get('editor') == 'jce') {
         include_once JPATH_ROOT . "/administrator/components/com_jce/includes/loader.php";
         include_once JPATH_ROOT . "/administrator/components/com_jce/models/editor.php";
         include_once JPATH_ROOT . "/components/com_jce/editor/libraries/classes/token.php";
         // create token
         $token = WFToken::getToken();
         $jceData .= " data-token=" . $token;
         // etag - version
         $editor = new WFModelEditor();
         $setting = $editor->getEditorSettings();
         $etag = $setting['etag'];
         $jceData .= " data-etag=" . $etag;
         // get current component
         $option = JFactory::getApplication()->input->get('option');
         $component = WFExtensionHelper::getComponent(null, $option);
         // set default component id
         $component_id = 0;
         $component_id = isset($component->extension_id) ? $component->extension_id : ($component->id ? $component->id : 0);
         $jceData .= " data-component_id=" . $component_id;
         $editor = 'jce';
     } else {
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.css', 'css');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/jquery.wysiwyg-0.9.css', 'css');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.colorpicker.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.table.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.cssWrap.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'plugins/system/jsnframework/assets/3rd-party/jquery-jwysiwyg/controls/wysiwyg.image.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag($base . 'administrator/components/com_pagebuilder/assets/js/jquery-jwysiwyg/controls/wysiwyg.link.js', 'js');
         JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ASSETS_URL . 'css/jwysiwyg.css', 'css');
     }
     $element = self::get_extra_info($element);
     $label = self::get_label($element);
     $type = !empty($element["input-type"]) ? $element["input-type"] : "text";
     $role = isset($element['role']) ? "role_{$element['role']}" : '';
     $role2 = isset($element['role_2']) ? 'data-role="title"' : '';
     $output = "<textarea type='{$type}' class='{$element['class']} jsn_tiny_mce {$role} {$editor}' id='{$element['id']}' name='{$element['id']}' {$role2} {$text_direction} {$urlbase} {$langPrefix} {$jceData} DATA_INFO>{$element['std']}</textarea>";
     return self::final_element($element, $output, $label);
 }
Example #24
0
 /**
  * DEFINE html structure of shortcode in Page Builder area
  *
  * @param type $content
  * @param type $shortcode_data: string stores params (which is modified default value) of shortcode
  * @param type $el_title: Element Title used to identifying elements in Pagebuilder
  * Ex:  param-tag=h6&param-text=Your+heading&param-font=custom&param-font-family=arial
  * 
  * @return type
  */
 public function element_in_pgbldr($content = '', $shortcode_data = '', $el_title = '')
 {
     // Assign Untitled
     $shortcode = $this->config['shortcode'];
     if ($el_title == '<i class=""></i>' && empty($content) || empty($el_title) && empty($content)) {
         if (strpos($shortcode, '_item') !== false) {
             $el_title = JText::_('JSN_PAGEBUILDER_LIB_SHORTCODE_ELEMENT_UNTITLED');
         } else {
             $el_title = '';
         }
     }
     $is_sub_element = isset($this->config['sub_element']) ? true : false;
     $parent_shortcode = $is_sub_element ? str_replace(array('pb_', '_item'), "", $shortcode) : $shortcode;
     $type = !empty($this->config['el_type']) ? $this->config['el_type'] : 'element';
     $buttons = array('edit' => '<a href="#" onclick="return false;" title="' . JText::_('JSN_PAGEBUILDER_HELPER_BUILDER_EDIT_ELEMENT') . '" data-shortcode="' . $shortcode . '" class="element-edit"><i class="icon-pencil"></i></a>', 'clone' => '<a href="#" onclick="return false;" title="' . JText::_('JSN_PAGEBUILDER_HELPER_BUILDER_DUPLICATE_ELEMENT') . '" data-shortcode="' . $shortcode . '" class="element-clone"><i class="icon-copy"></i></a>', 'delete' => '<a href="#" onclick="return false;" title="' . JText::_('JSN_PAGEBUILDER_HELPER_BUILDER_DELETE_ELEMENT') . '" class="element-delete"><i class="icon-trash"></i></a>');
     // Empty content if this is not sub element
     if (!$is_sub_element) {
         $content = "";
     }
     $exception = isset($this->config['exception']) ? $this->config['exception'] : array();
     $content = isset($exception['default_content']) ? $exception['default_content'] : $content;
     // if content is still empty, Generate it
     if (empty($content)) {
         if (!$is_sub_element) {
             $content = ucfirst(str_replace(JSNPB_SHORTCODE_PREFIX, "", $shortcode));
         } else {
             if (isset($exception['item_text'])) {
                 if (!empty($exception['item_text'])) {
                     $content = $exception['item_text'] . " PB_INDEX_TRICK";
                 }
             } else {
                 $content = JText::_(ucfirst($parent_shortcode)) . " " . JText::_('JSN_PAGEBUILDER_LIB_SHORTCODE_ELEMENT_ITEM') . " PB_INDEX_TRICK";
             }
         }
     }
     $content = !empty($el_title) ? $content . ": " . "<span>{$el_title}</span>" : $content;
     $content = !empty($el_title) && $is_sub_element == true ? $el_title : $content;
     // element name
     if ($type == "element") {
         if (!$is_sub_element) {
             $name = ucfirst(str_replace(JSNPB_SHORTCODE_PREFIX, "", $shortcode));
         } else {
             $name = JText::_(ucfirst($parent_shortcode)) . " " . JText::_('JSN_PAGEBUILDER_LIB_SHORTCODE_ELEMENT_ITEM');
         }
     } else {
         $name = $content;
     }
     if (empty($shortcode_data)) {
         $shortcode_data = $this->config['shortcode_structure'];
     }
     $shortcode_data = stripslashes($shortcode_data);
     $element_wrapper = !empty($exception['item_wrapper']) ? $exception['item_wrapper'] : ($is_sub_element ? "li" : "div");
     $content_class = $is_sub_element ? "jsn-item-content" : "pb-plg-element";
     $action_btns = empty($exception['action_btn']) ? implode("", $buttons) : $buttons[$exception['action_btn']];
     $modal_title = !empty($exception['data-modal-title']) ? "data-modal-title='{$exception['data-modal-title']}'" : "";
     $element_type = "data-el-type='{$type}'";
     $exclude_gen_shortcode = isset($exception['exclude_gen_shortcode']) ? 'exclude_gen_shortcode' : '';
     $data = array('element_wrapper' => $element_wrapper, 'modal_title' => $modal_title, 'element_type' => $element_type, 'name' => $name, 'shortcode' => $shortcode, 'shortcode_data' => $shortcode_data, 'content_class' => $content_class, 'content' => $content, 'action_btn' => empty($exception['action_btn']) ? '' : $exception['action_btn'], 'exclude_gen_shortcode' => $exclude_gen_shortcode);
     $extra = array();
     if (isset($this->config['exception']['disable_preview_container'])) {
         $extra = array('has_preview' => FALSE);
     }
     $data = array_merge($data, $extra);
     $html_preview = JSNPagebuilderHelpersFunctions::getElementItemHtml($data);
     return $html_preview;
 }
Example #25
0
 /**
  * Return html structure of shortcode in Page Builder area
  * 
  * @param string $shortcode_name
  * @param string $content
  * @param string $shortcode_data
  * @param array $shortcode_params
  * 
  * @return string
  */
 public static function transformShortcodeToPagebuilder($shortcode_name, $content = '', $shortcode_data = '', $shortcode_params = '', $client = 'backend')
 {
     $class = JSNPagebuilderHelpersShortcode::getShortcodeClass($shortcode_name);
     if (class_exists($class)) {
         global $JSNPbElements;
         $JSNPbElements->setGeneratedStatus(true);
         $elements = $JSNPbElements->getElements();
         $instance = isset($elements[strtolower($class)]) ? $elements[strtolower($class)] : null;
         if (!is_object($instance)) {
             $instance = new $class();
         }
         $el_title = "";
         // extract param of shortcode (now for column)
         if (isset($instance->config['extract_param'])) {
             parse_str(trim($shortcode_params), $output);
             foreach ($instance->config['extract_param'] as $param) {
                 if (isset($output[$param])) {
                     $instance->params[$param] = JSNPagebuilderHelpersFunctions::removeQuotes($output[$param]);
                 }
             }
         }
         // get content in pagebuilder of shortcode: Element Title must always first option of Content tab
         if (isset($instance->items["content"]) && isset($instance->items["content"][0])) {
             $title = $instance->items["content"][0];
             if (@$title["role"] == "title") {
                 $params = JSNPagebuilderHelpersShortcode::shortcodeParseAtts($shortcode_params);
                 $el_title = !empty($params[$title["id"]]) ? $params[$title["id"]] : "";
             }
         }
         if ($client === 'backend') {
             $shortcode_view = $instance->element_in_pgbldr($content, $shortcode_data, $el_title);
         } else {
             // Render the shortcode frontend HTML
             $params = JSNPagebuilderHelpersShortcode::shortcodeParseAtts($shortcode_params);
             $shortcode_view = $instance->element_shortcode($params, $content);
         }
         return $shortcode_view;
     }
 }
Example #26
0
    /**
     * Method to print element settings
     */
    public function settings()
    {
        $js = '
			var JSNPbParams	= {pbstrings : {}};
			JSNPbParams.rootUrl = \'' . JUri::root() . '\';
			JSNPbParams.pbstrings.NO_ITEM_FOUND = \'' . JText::_('No %s found') . '\';
			JSNPbParams.pbstrings.SINGLE_ENTRY = \'' . JText::_('Single %s') . '\';
			JSNPbParams.pbstrings.SETTINGS = \'' . JText::_('Settings') . '\';
			JSNPbParams.pbstrings.INVALID_LINK = \'' . JText::_('The link is invalid') . '\';
			JSNPbParams.pbstrings.COPY = \'' . JText::_('copy') . '\';
			JSNPbParams.pbstrings.EMPTY = \'' . JText::_('(Untitled)') . '\';
			JSNPbParams.pbstrings.SELECT_DES_MARKER = \'' . JText::_('Select Destination Marker') . '\';
			JSNPbParams.pbstrings.ALERT_DELETE_ROW = \'' . JText::_('Are you sure you want to delete the whole row including all elements it contains?') . '\';
			JSNPbParams.pbstrings.ALERT_DELETE_COLUMN = \'' . JText::_('Are you sure you want to delete the whole column including all elements it contains?') . '\';
			JSNPbParams.pbstrings.ALERT_DELETE_ELEMENT = \'' . JText::_('Are you sure you want to delete the element?') . '\';
		';
        JSNPagebuilderHelpersFunctions::print_asset_tag($js, 'js', null, true);
        $shortcode = JRequest::getString('shortcode');
        $params = isset($_POST['params']) ? $_POST['params'] : '';
        // TODO: move under assets inside shortcode
        // Add common js library for elements.
        JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-tipsy/jquery.tipsy.js', 'js');
        JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-tipsy/tipsy.css', 'css');
        JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-general.css', 'css');
        // for accordion_item, buttonbar_item,
        JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-fonticomoon.css', 'css');
        // for accordion_item, buttonbar_item,
        $extract_params = '';
        $shortcodeHelper = new JSNPagebuilderHelpersShortcode();
        $data = array();
        if (!empty($shortcode)) {
            // elements
            $class = $shortcodeHelper->getShortcodeClass($shortcode);
            if (class_exists($class)) {
                // Get all regitered element shortcodes
                global $JSNPbElements;
                $elements = $JSNPbElements->getElements();
                $instance = isset($elements[strtolower($class)]) ? $elements[strtolower($class)] : null;
                // Init and register new instance if it not
                if (!is_object($instance)) {
                    $instance = new $class();
                }
                if (!empty($params)) {
                    $params = stripslashes($params);
                    $params = urldecode($params);
                } else {
                    $params = $instance->config['shortcode_structure'];
                }
                // Add neccessary assets for the shortcode
                $instance->backend_element_assets();
                if (!empty($params)) {
                    $extract_params = JSNPagebuilderHelpersShortcode::extractParams($params, $shortcode);
                    // if have sub-shortcode, get content
                    if (!empty($instance->config['has_subshortcode'])) {
                        $sub_sc_data = JSNPagebuilderHelpersShortcode::extractSubShortcode($params, true);
                        $extract_params['sub_sc_content'] = $sub_sc_data;
                    }
                    // MODIFY $instance->items
                    $shortcodeHelper->generateShortcodeParams($instance->items, NULL, $extract_params, TRUE);
                    // recall this to re-extract params
                    $instance->shortcode_data();
                }
                // get Modal setting box
                $settings = $instance->items;
                $shortcodeAterfix = substr($shortcode, -5);
                $showPreview = true;
                if ($shortcodeAterfix == '_item') {
                    $showPreview = false;
                }
                if ($shortcode == 'pb_row') {
                    $showPreview = false;
                }
                $modalContent = $shortcodeHelper->getShortcodeModalSettings($settings, $shortcode, $extract_params);
            }
        }
        $html[] = '';
        if ($showPreview) {
            $html[] = '<div id="jsn_column1" class="pull-left">';
        }
        $html[] = '<div class="jsn-bootstrap" id="settings-form-container">
			<div id="modalOptions" class="form-horizontal">
				' . $modalContent . '
				<div id="modalAction"></div>
			</div>
			<textarea class="hidden" id="shortcode_content" name="shortcode_content">' . $params . '</textarea>
			<textarea class="hidden" id="pb_share_data"  ></textarea>
			<textarea class="hidden" id="pb_merge_data"  ></textarea>
			<textarea class="hidden" id="pb_extract_data"  ></textarea>
			<input type="hidden" id="pb_previewing" value="0" />
			<input id="shortcode_name" name="shortcode_name" type="hidden" value="' . $shortcode . '" />
		</div>';
        if ($showPreview) {
            $html[] = '</div>';
        }
        if ($showPreview) {
            $html[] = '<div id="jsn_column2" class="pull-left">
			<div class="preview_title">' . JText::_("Preview") . '</div>
			<div id="framePreview" class="preview_border">
				<div id="iframeLoading" class="iframe_loading_border"><div class="iframe_loading_image"><img src="components/com_pagebuilder/assets/images/icons-32/ajax-loader.gif"></div></div>
				<div class="control-group">
					<div id="preview_container">
						<iframe id="shortcode_preview_iframe" scrolling="auto" name="shortcode_preview_iframe" class="shortcode_preview_iframe" width="100%"></iframe>
						<div id="preview"></div>
					</div>
				</div>
			</div>
		</div>';
        }
        $html[] = '<div class="clearfix"></div>';
        echo implode('', $html);
        exit;
    }
Example #27
0
 /**
  * Include admin scripts
  * 
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/font-awesome/css/font-awesome.min.css', 'css');
 }
Example #28
0
 /**
  * DEFINE shortcode content
  *
  * @param type $atts
  * @param type $content
  *
  * @return string
  */
 public function element_shortcode($atts = null, $content = null)
 {
     $pathRoot = JURI::root();
     extract(JSNPagebuilderHelpersShortcode::shortcodeAtts($this->config['params'], $atts));
     $content_class = !empty($image_file) ? 'carousel-caption' : 'carousel-content';
     $pathRoot = JURI::root();
     $url_pattern = '/^(http|https)/';
     preg_match($url_pattern, $image_file, $m);
     if (count($m)) {
         $pathRoot = '';
     }
     $hidden = empty($heading) && empty($content) ? 'style="display:none"' : '';
     $img = !empty($image_file) ? "<img  src='{$pathRoot}{$image_file}'>" : '';
     $icon = !empty($icon) ? "<i class='{$icon}'></i>" : '';
     $inner_content = JSNPagebuilderHelpersShortcode::removeAutop($content);
     $inner_content = JSNPagebuilderHelpersFunctions::add_absolute_path_to_image_url($inner_content);
     if (empty($heading) && empty($inner_content)) {
         $html_content = "";
     } else {
         $html_content = "<div class='{$content_class}' {$hidden}>";
         $html_content .= "<h4>{$icon}{$heading}</h4>";
         $html_content .= "<p>{$inner_content}</p></div>";
     }
     return "<div class='{active} item'>{$img}{$html_content}</div><!--seperate-->";
 }
Example #29
0
 /**
  * Include admin scripts
  * 
  * @return type
  */
 public function backend_element_assets()
 {
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_ELEMENT_URL . '/progressbar/assets/js/progressbar-setting.js', 'js');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-fonticomoon.css', 'css');
     JSNPagebuilderHelpersFunctions::print_asset_tag(JSNPB_PLG_SYSTEM_ASSETS_URL . '3rd-party/font-awesome/css/font-awesome.min.css', 'css');
 }
Example #30
0
 public function load_assets_frontend()
 {
     JSNPagebuilderHelpersFunctions::loadFancyboxJS();
     $document = JFactory::getDocument();
     $document->addScript(JSNPB_ELEMENT_URL . '/button/assets/js/button.js', 'text/javascript');
     $document->addStyleSheet(JSNPB_ELEMENT_URL . '/button/assets/css/button.css', 'text/css');
 }