Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 function getElementHolder($width)
 {
     if ($width == "undefined") {
         $width = "1/1";
     }
     $output = '';
     $column_controls = $this->getColumnControls($this->settings('controls'));
     $output .= '<div data-element_type="' . $this->settings["base"] . '" class="' . $this->settings["base"] . ' spb_content_element spb_sortable ' . spb_translateColumnWidthToSpanEditor($width) . ' ' . $this->settings["class"] . '">';
     $output .= '<input type="hidden" class="spb_sc_base" name="element_name-' . $this->shortcode . '" value="' . $this->settings["base"] . '" />';
     $output .= str_replace("%column_size%", spb_translateColumnWidthToFractional($width), $column_controls);
     $output .= $this->getCallbacks($this->shortcode);
     $output .= '<div class="spb_element_wrapper ' . $this->settings("wrapper_class") . '">';
     $output .= '%spb_element_content%';
     $output .= '</div> <!-- end .spb_element_wrapper -->';
     $output .= '</div> <!-- end #element-' . $this->shortcode . ' -->';
     return $output;
 }
Esempio n. 3
0
 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;
 }