Esempio n. 1
0
 /**
  * Load all the category's elements
  */
 private function load_elements()
 {
     //load all layout category elements
     $full_width = new TF_FullWidthContainer();
     array_push($this->elements, $full_width->element_to_array());
     $grid_two = new TF_GridTwo();
     array_push($this->elements, $grid_two->element_to_array());
     $grid_three = new TF_GridThree();
     array_push($this->elements, $grid_three->element_to_array());
     $grid_two_third = new TF_GridTwoThird();
     array_push($this->elements, $grid_two_third->element_to_array());
     $grid_four = new TF_GridFour();
     array_push($this->elements, $grid_four->element_to_array());
     $grid_three_fourth = new TF_GridThreeFourth();
     array_push($this->elements, $grid_three_fourth->element_to_array());
     $grid_five = new TF_GridFive();
     array_push($this->elements, $grid_five->element_to_array());
     $grid_two_fifth = new TF_GridTwoFifth();
     array_push($this->elements, $grid_two_fifth->element_to_array());
     $grid_three_fifth = new TF_GridThreeFifth();
     array_push($this->elements, $grid_three_fifth->element_to_array());
     $grid_four_fifth = new TF_GridFourFifth();
     array_push($this->elements, $grid_four_fifth->element_to_array());
     $grid_one_six = new TF_GriOnedSix();
     array_push($this->elements, $grid_one_six->element_to_array());
     $grid_five_six = new TF_GridFiveSix();
     array_push($this->elements, $grid_five_six->element_to_array());
 }
Esempio n. 2
0
 public static function content_to_elements($content)
 {
     //turn off error reporting in order to avoid notices and errors. :: Required for compatiblity
     /*ini_set('display_errors',1);
     		ini_set('display_startup_errors',1);*/
     error_reporting(0);
     $index = 0;
     //echo memory_get_usage() . "\n";
     $content = Fusion_Core_Reversal::convert_to_builder_blocks($content);
     preg_match_all('/' . Fusion_Core_Reversal::get_shortcode_regex() . '/s', $content, Fusion_Core_Reversal::$matches, PREG_SET_ORDER);
     //$memory_1 = memory_get_usage();
     if (!empty(Fusion_Core_Reversal::$matches)) {
         foreach (Fusion_Core_Reversal::$matches as $match) {
             switch ($match[2]) {
                 case 'fullwidth':
                     $full_width = new TF_FullWidthContainer();
                     $full_width->config['index'] = $index;
                     $full_width->config['id'] = Fusion_Core_Reversal::GUID();
                     $index = $index + 1;
                     $attribs = Fusion_Core_Reversal::shortcode_parse_atts(stripslashes($match[3]));
                     if (method_exists('TF_FullWidthContainer', 'deprecated_args')) {
                         $attribs = $full_width->deprecated_args($attribs);
                     }
                     $children = Fusion_Core_Reversal::check_for_child_elements($match[5], $index, $full_width->config['id']);
                     if (!is_array($children)) {
                         $attribs['content'] = stripslashes($children);
                     } else {
                         if (is_array($children)) {
                             $full_width->config['childrenId'] = $children;
                         }
                     }
                     $full_width = Fusion_Core_Reversal::prepare_full_width($attribs, $full_width);
                     array_push(Fusion_Core_Reversal::$elements, $full_width->element_to_array());
                     break;
                 default:
                     Fusion_Core_Reversal::convert_builder_elements($match, $index);
                     break;
             }
         }
     }
     //var_dump(Fusion_Core_Reversal::$elements);
     header("Content-Type: application/json");
     //echo json_encode( array('count' => count( Fusion_Core_Reversal::$elements ) ) );
     echo json_encode(Fusion_Core_Reversal::$elements);
     //echo memory_get_usage() - $memory_1 . "\r\r";
     //echo memory_get_usage();
     exit;
 }