public function init($settings) { parent::init($settings); $this->swift_page_builder = SwiftPageBuilder::getInstance(); $this->swift_page_builder->setTheme(); $this->setUpTheme(); }
public function singleParamHtmlHolder($param, $value) { $output = ''; $param_name = isset($param['param_name']) ? $param['param_name'] : ''; $type = isset($param['type']) ? $param['type'] : ''; $class = isset($param['class']) ? $param['class'] : ''; if (isset($param['holder']) == false || $param['holder'] == 'hidden') { $output .= '<input type="hidden" class="spb_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />'; if ($param['type'] == 'attach_image') { $img = spb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail')); $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . SwiftPageBuilder::getInstance()->assetURL('img/blank_f7.gif') . '" class="attachment-thumbnail" alt="" title="" />') . '<a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '"><i class="spb-icon-single-image"></i>' . __('No image yet! Click here to select it now.', 'swift-framework-plugin') . '</a>'; } } else { $output .= '<' . $param['holder'] . ' class="spb_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>'; } return $output; }
public function __construct($settings) { parent::__construct($settings); SwiftPageBuilder::getInstance()->addShortCode(array('base' => 'spb_tab')); }
public function contentAdmin($atts, $content = null) { $width = $row_el_class = $bg_color = $padding_vertical = ''; extract(shortcode_atts(array('wrap_type' => '', 'row_el_class' => '', 'row_bg_color' => '', 'color_row_height' => '', 'inner_column_height' => '', 'row_top_style' => '', 'row_bottom_style' => '', 'row_padding_vertical' => '', 'row_padding_horizontal' => '', 'row_margin_vertical' => '', 'row_overlay_opacity' => '0', 'remove_element_spacing' => '', 'vertical_center' => 'true', 'row_id' => '', 'row_name' => '', 'row_bg_type' => '', 'bg_image' => '', 'bg_video_mp4' => '', 'bg_video_webm' => '', 'bg_video_ogg' => '', 'parallax_video_height' => 'window-height', 'parallax_image_height' => 'content-height', 'parallax_video_overlay' => 'none', 'parallax_image_movement' => 'fixed', 'parallax_image_speed' => '0.5', 'bg_type' => '', 'row_expanding' => '', 'row_expading_text_closed' => '', 'row_expading_text_open' => '', 'row_animation' => '', 'row_animation_delay' => '', 'responsive_vis' => '', 'row_responsive_vis' => '', 'el_position' => '', 'width' => 'span12'), $atts)); $output = ''; $output .= '<div data-element_type="spb_row" class="spb_row spb_sortable span12 spb_droppable not-column-inherit">'; $output .= '<input type="hidden" class="spb_sc_base" name="element_name-spb_row" value="spb_row">'; $output .= '<div class="controls sidebar-name"><span class="asset-name">' . __("Row", 'swiftframework') . '</span><div class="controls_right"><a class="column_edit" href="#" title="Edit"></a> <a class="column_clone" href="#" title="Clone"></a> <a class="column_delete" href="#" title="Delete"></a></div></div>'; $output .= '<div class="spb_element_wrapper">'; $output .= '<div class="row-fluid spb_column_container spb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= SwiftPageBuilder::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; if (isset($this->settings['params'])) { $inner = ''; foreach ($this->settings['params'] as $param) { $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : ''; //var_dump($param_value); if (is_array($param_value)) { // Get first element from the array reset($param_value); $first_key = key($param_value); $param_value = $param_value[$first_key]; } $inner .= $this->singleParamHtmlHolder($param, $param_value); } $output .= $inner; } $output .= '</div>'; $output .= '</div>'; return $output; }
public static function dropShortcode($name) { unset(self::$sc[$name]); SwiftPageBuilder::getInstance()->removeShortCode($name); }
public function singleParamHtmlHolder($param, $value) { $output = ''; // Compatibility fixes $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange'); $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning'); $value = str_ireplace($old_names, $new_names, $value); //$value = __($value, "swift-framework-admin"); // $param_name = isset($param['param_name']) ? $param['param_name'] : ''; $type = isset($param['type']) ? $param['type'] : ''; $class = isset($param['class']) ? $param['class'] : ''; if (isset($param['holder']) == false || $param['holder'] == 'hidden') { $output .= '<input type="hidden" class="spb_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />'; if ($param['type'] == 'attach_image') { $img = spb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail')); $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . SwiftPageBuilder::getInstance()->assetURL('img/blank_f7.gif') . '" class="attachment-thumbnail" alt="" title="" />') . '<a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '"><i class="spb-icon-single-image"></i>' . __('No image yet! Click here to select it now.', 'swift-framework-admin') . '</a>'; } } else { $output .= '<' . $param['holder'] . ' class="spb_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>'; } return $output; }
public function contentAdmin($atts, $content = null) { $width = ''; extract(shortcode_atts(array('width' => 'column_12'), $atts)); $output = ''; $column_controls = $this->getColumnControls('column'); if ($width == 'column_14' || $width == '1/4') { $width = array('span3'); } else { if ($width == 'column_14-14-14-14') { $width = array('span3', 'span3', 'span3', 'span3'); } else { if ($width == 'column_14-12-14') { $width = array('span3', 'span6', 'span3'); } else { if ($width == 'column_12-14-14') { $width = array('span6', 'span3', 'span3'); } else { if ($width == 'column_14-14-12') { $width = array('span3', 'span3', 'span6'); } else { if ($width == 'column_13' || $width == '1/3') { $width = array('span4'); } else { if ($width == 'column_13-23') { $width = array('span4', 'span8'); } else { if ($width == 'column_23-13') { $width = array('span8', 'span4'); } else { if ($width == 'column_13-13-13') { $width = array('span4', 'span4', 'span4'); } else { if ($width == 'column_12' || $width == '1/2') { $width = array('span6'); } else { if ($width == 'column_12-12') { $width = array('span6', 'span6'); } else { if ($width == 'column_23' || $width == '2/3') { $width = array('span8'); } else { if ($width == 'column_34' || $width == '3/4') { $width = array('span9'); } else { if ($width == 'column_16' || $width == '1/6') { $width = array('span2'); } else { $width = array('span12'); } } } } } } } } } } } } } } for ($i = 0; $i < count($width); $i++) { $output .= '<div data-element_type="spb_column" class="spb_column spb_sortable spb_droppable ' . $width[$i] . ' not-column-inherit">'; $output .= '<input type="hidden" class="spb_sc_base" name="" value="spb_column" />'; $output .= str_replace("%column_size%", spb_translateColumnWidthToFractional($width[$i]), $column_controls); $output .= '<div class="spb_element_wrapper">'; $output .= '<div class="row-fluid spb_column_container spb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= SwiftPageBuilder::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; } return $output; }
public function contentAdmin($atts, $content = null) { $width = $custom_css_percentage = $row_el_class = $el_class = $bg_color = $element_name = $minimize_row = $row_responsive_vis = $padding_vertical = ''; extract(shortcode_atts(array('wrap_type' => 'content-width', 'row_el_class' => '', 'row_bg_color' => '', 'color_row_height' => '', 'row_style' => '', 'inner_column_height' => '', 'row_top_style' => '', 'row_bottom_style' => '', 'row_padding_vertical' => '', 'row_padding_horizontal' => '', 'row_margin_vertical' => '30', 'row_overlay_opacity' => '0', 'remove_element_spacing' => '', 'vertical_center' => 'true', 'row_id' => '', 'row_name' => '', 'row_header_style' => '', 'row_bg_type' => '', 'bg_image' => '', 'bg_video_mp4' => '', 'bg_video_webm' => '', 'bg_video_ogg' => '', 'bg_video_loop' => 'yes', 'parallax_video_height' => 'window-height', 'parallax_image_height' => 'content-height', 'parallax_video_overlay' => 'none', 'parallax_image_movement' => 'fixed', 'parallax_image_speed' => '0.5', 'bg_type' => '', 'row_expanding' => '', 'row_expading_text_closed' => '', 'row_expading_text_open' => '', 'row_animation' => '', 'row_animation_delay' => '', 'responsive_vis' => '', 'row_responsive_vis' => '', 'el_position' => '', 'element_name' => '', 'minimize_row' => '', 'width' => 'span12', 'custom_css' => '', 'simplified_controls' => '', 'custom_css_percentage' => '', 'border_color_global' => '', 'border_styling_global' => '', 'back_color_global' => '', 'border_styling_global' => '', 'el_class' => ''), $atts)); if ($element_name == '') { $element_name = __("Row", 'swift-framework-plugin'); } $output = ''; $output .= '<div data-element_type="spb_row" class="spb_row spb_sortable span12 spb_droppable not-column-inherit">'; $output .= '<input type="hidden" class="spb_sc_base" name="element_name-spb_row" value="spb_row">'; $output .= '<div class="controls sidebar-name"><span class="asset-name">' . $element_name . '</span>'; $output .= $this->getResponsiveIndicatorHtml($row_responsive_vis); $output .= '<div class="controls_right row_controls"><a class="column_delete" href="#" title="Delete"><span class="icon-delete"></span></a><a class="element-save" href="#" title="Save"><span class="icon-save"></span></a><a class="column_clone" href="#" title="Duplicate"><span class="icon-duplicate"></span></a><a class="column_edit" href="#" title="Edit"><span class="icon-edit"></span></a>'; if ($minimize_row == 'yes') { $output .= ' <a class="column_minimize" href="#" title="Minimize" style="display:none;"><i class="fa-minus"></i></a><a class="column_maximize" href="#" title="Maximize"><i class="fa-plus"></i></a></div></div><div class="spb_element_wrapper" style="display:none;">'; } else { $output .= ' <a class="column_minimize" href="#" title="Minimize"><i class="fa-minus"></i></a><a class="column_maximize" href="#" title="Maximize" style="display:none;"><i class="fa-plus"></i></a></div></div><div class="spb_element_wrapper">'; } $output .= '<div class="row-fluid spb_column_container spb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= SwiftPageBuilder::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; if (isset($this->settings['params'])) { $inner = ''; foreach ($this->settings['params'] as $param) { $param_value = isset(${$param['param_name']}) ? ${$param['param_name']} : ''; //var_dump($param_value); if (is_array($param_value)) { // Get first element from the array reset($param_value); $first_key = key($param_value); $param_value = $param_value[$first_key]; } $inner .= $this->singleParamHtmlHolder($param, $param_value); } $output .= $inner; } $output .= '</div>'; $output .= '</div>'; return $output; }
public function contentAdmin($atts, $content = null) { $width = ''; extract(shortcode_atts(array('width' => 'column_12', 'col_bg_color' => '', 'col_bg_image' => '', 'col_bg_type' => '', 'col_parallax_image_movement' => '', 'col_parallax_image_speed' => '', 'col_padding' => '', 'col_animation' => '', 'col_animation_delay' => '', 'col_responsive_vis' => '', 'el_position' => '', 'col_el_class' => ''), $atts)); $output = ''; $column_controls = $this->getColumnControls('column'); if ($width == 'column_14' || $width == '1/4') { $width = array('span3'); } else { if ($width == 'column_14-14-14-14') { $width = array('span3', 'span3', 'span3', 'span3'); } else { if ($width == 'column_14-12-14') { $width = array('span3', 'span6', 'span3'); } else { if ($width == 'column_12-14-14') { $width = array('span6', 'span3', 'span3'); } else { if ($width == 'column_14-14-12') { $width = array('span3', 'span3', 'span6'); } else { if ($width == 'column_13' || $width == '1/3') { $width = array('span4'); } else { if ($width == 'column_13-23') { $width = array('span4', 'span8'); } else { if ($width == 'column_23-13') { $width = array('span8', 'span4'); } else { if ($width == 'column_13-13-13') { $width = array('span4', 'span4', 'span4'); } else { if ($width == 'column_12' || $width == '1/2') { $width = array('span6'); } else { if ($width == 'column_12-12') { $width = array('span6', 'span6'); } else { if ($width == 'column_23' || $width == '2/3') { $width = array('span8'); } else { if ($width == 'column_34' || $width == '3/4') { $width = array('span9'); } else { if ($width == 'column_16' || $width == '1/6') { $width = array('span2'); } else { $width = array('span12'); } } } } } } } } } } } } } } for ($i = 0; $i < count($width); $i++) { $output .= '<div data-element_type="spb_column" class="spb_column spb_sortable spb_droppable ' . $width[$i] . ' not-column-inherit">'; $output .= '<input type="hidden" class="spb_sc_base" name="" value="spb_column" />'; $output .= str_replace("%column_size%", spb_translateColumnWidthToFractional($width[$i]), $column_controls); $output .= '<div class="spb_element_wrapper">'; $output .= '<div class="row-fluid spb_column_container spb_sortable_container not-column-inherit">'; $output .= do_shortcode(shortcode_unautop($content)); $output .= SwiftPageBuilder::getInstance()->getLayout()->getContainerHelper(); $output .= '</div>'; if (isset($this->settings['params'])) { $inner = ''; foreach ($this->settings['params'] as $param) { $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : ''; //var_dump($param_value); if (is_array($param_value)) { // Get first element from the array reset($param_value); $first_key = key($param_value); $param_value = $param_value[$first_key]; } $inner .= $this->singleParamHtmlHolder($param, $param_value); } $output .= $inner; } $output .= '</div>'; $output .= '</div>'; } return $output; }