RtThemesSupport

RT16 Page Layout Banner wpml fix rt 16 V 2.3

Feb 7th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 87.58 KB | None | 0 0
  1. <?php
  2. #-----------------------------------------
  3. #   RT-Theme page_layout_options.php
  4. #   version: 1.0
  5. #
  6. #   Several functions for template builder
  7. #
  8. #-----------------------------------------
  9.  
  10.  
  11. class RTThemePageLayoutOptions extends RTThemeAdmin{
  12.      
  13.     #
  14.     #   Save Page Templates
  15.     #
  16.    
  17.     function rt_save_page_templates(){
  18.        
  19.         $savedTemplates       =  $_POST;
  20.         $savedTemplates_Array =  array();
  21.        
  22.         //Class For Templates
  23.         $templates  =  new stdClass;
  24.  
  25.         $box=0;
  26.         $template=0;
  27.         foreach($savedTemplates as $key=>$value){
  28.            
  29.              
  30.             $jump = stristr($key, '_template_name') == TRUE && $value==""  ? true : false ;
  31.              
  32.             if(!$jump){
  33.                 //template name and ID     
  34.                 if(stristr($key, '_template_name') == TRUE) {
  35.                    
  36.                     $template = str_replace('_template_name','',$key);
  37.                     $templates->templates[$template]->templateID    = $template;
  38.                     $templates->templates[$template]->templateName  = $value;
  39.  
  40.                     //save the templates as an array
  41.                     $savedTemplates_Array[$template] = $value;
  42.                 }
  43.  
  44.                 //Page layout - sidebar selection
  45.                 if(stristr($key, $templates->templates[$template]->templateID.'_sidebarSelection') == TRUE && $templates->templates[$template]->templateName) {
  46.                     $box++;
  47.                     $templates->templates[$template]->sidebar       = $value;
  48.                 }  
  49.    
  50.                 //group id
  51.                 if(stristr($key, 'theGroupID_') == TRUE) {         
  52.                     $group_id = $value;
  53.                 }
  54.                    
  55.                 //home page boxes
  56.                 if(stristr($key, '_home_page_box')                                   == TRUE) {
  57.                 $box++;
  58.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  59.                 $templates->templates[$template]->contents[$box]->content_type       =  'home_page_box';
  60.                 $templates->templates[$template]->contents[$box]->layout             =  $value[0];
  61.                 $templates->templates[$template]->contents[$box]->content_id         =  $value[1];
  62.                 }
  63.                
  64.                 //product list
  65.                 if(stristr($key, '_product_box')                                     == TRUE) {
  66.                 $box++;
  67.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  68.                 $templates->templates[$template]->contents[$box]->content_type       =  'product_box';
  69.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  70.                 $templates->templates[$template]->contents[$box]->item_width         =  $value["item_width"];
  71.                 $templates->templates[$template]->contents[$box]->box_border         =  $value["box_border"];
  72.                 $templates->templates[$template]->contents[$box]->pagination         =  $value["pagination"];
  73.                 $templates->templates[$template]->contents[$box]->list_orderby       =  $value["list_orderby"];
  74.                 $templates->templates[$template]->contents[$box]->list_order         =  $value["list_order"];
  75.                 $templates->templates[$template]->contents[$box]->item_per_page      =  $value["item_per_page"];
  76.                 $templates->templates[$template]->contents[$box]->categories         =  $value["categories"];
  77.                 }
  78.                
  79.                 //portfolio list
  80.                 if(stristr($key, '_portfolio_box')                                   == TRUE) {
  81.                 $box++;
  82.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  83.                 $templates->templates[$template]->contents[$box]->content_type       =  'portfolio_box';
  84.                 $templates->templates[$template]->contents[$box]->layout             =  $value[0];
  85.                 $templates->templates[$template]->contents[$box]->item_width         =  $value[1];
  86.                 $templates->templates[$template]->contents[$box]->box_border         =  $value["box_border"];
  87.                 $templates->templates[$template]->contents[$box]->pagination         =  $value["pagination"];
  88.                 $templates->templates[$template]->contents[$box]->portf_list_orderby =  $value["portf_list_orderby"];
  89.                 $templates->templates[$template]->contents[$box]->portf_list_order   =  $value["portf_list_order"];
  90.                 $templates->templates[$template]->contents[$box]->item_per_page      =  $value["item_per_page"];
  91.                 }
  92.                
  93.                 //portfolio categories
  94.                 if(stristr($key, '_portfolio_categories')                            == TRUE) {
  95.                 $templates->templates[$template]->contents[$box]->categories         =  $value;
  96.                 }
  97.                
  98.                 //sidebar boxes
  99.                 if(stristr($key, 'sidebar_box')                                      == TRUE) {
  100.                 $box++;
  101.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  102.                 $templates->templates[$template]->contents[$box]->content_type       =  'sidebar_box';
  103.                 $templates->templates[$template]->contents[$box]->layout             =  $value[0];
  104.                 $templates->templates[$template]->contents[$box]->sidebar_id         =  $value[1];
  105.                 $templates->templates[$template]->contents[$box]->widget_box_width   =  $value[2];
  106.                 $templates->templates[$template]->contents[$box]->widget_border      =  $value[3];
  107.                 }
  108.                
  109.                 //default content
  110.                 if(stristr($key, 'default_content')                                  == TRUE) {
  111.                 $box++;
  112.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  113.                 $templates->templates[$template]->contents[$box]->content_type       =  'default_content';
  114.                 $templates->templates[$template]->contents[$box]->layout             =  "one";
  115.                 $templates->templates[$template]->contents[$box]->heading            =  $value["heading"];
  116.                 }
  117.                
  118.                 //all content boxes
  119.                 if(stristr($key, '_all_content_boxes')                               == TRUE) {
  120.                 $box++;
  121.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  122.                 $templates->templates[$template]->contents[$box]->content_type       =  'all_content_boxes';
  123.                 $templates->templates[$template]->contents[$box]->content_id         =  $value["content_id"];                  
  124.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  125.                 $templates->templates[$template]->contents[$box]->item_width         =  $value["item_width"];
  126.                 $templates->templates[$template]->contents[$box]->box_border         =  $value["box_border"];
  127.                 $templates->templates[$template]->contents[$box]->list_orderby       =  $value["list_orderby"];
  128.                 $templates->templates[$template]->contents[$box]->list_order         =  $value["list_order"];
  129.                 }
  130.                
  131.                 //banner box
  132.                 if(stristr($key, '_banner_box')                                      == TRUE) {
  133.                 $box++;
  134.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  135.                 $templates->templates[$template]->contents[$box]->content_type       =  'banner_box';          
  136.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  137.                 $templates->templates[$template]->contents[$box]->text               =  $value["text"];
  138.                 $templates->templates[$template]->contents[$box]->button_text        =  $value["button_text"];
  139.                     //wpml register string
  140.                     wpml_register_string( THEMESLUG , 'Text for Banner '.$templates->templates[$template]->templateID.$group_id, $value["text"] );
  141.                     wpml_register_string( THEMESLUG , 'Button Text for Banner '.$templates->templates[$template]->templateID.$group_id, $value["button_text"] );
  142.                     wpml_register_string( THEMESLUG , 'Button Link for Banner '.$templates->templates[$template]->templateID.$group_id, $value["button_link"] );
  143.                    
  144.                 $templates->templates[$template]->contents[$box]->button_color       =  $value["button_color"];
  145.                 $templates->templates[$template]->contents[$box]->button_link        =  $value["button_link"];
  146.                 $templates->templates[$template]->contents[$box]->button_size        =  $value["button_size"];
  147.                 }
  148.                
  149.                 //Slider box
  150.                 if(stristr($key, '_slider_box')                                      == TRUE) {
  151.                 $box++;
  152.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  153.                 $templates->templates[$template]->contents[$box]->content_type       =  'slider_box';
  154.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  155.                 $templates->templates[$template]->contents[$box]->slider_script      =  $value["slider_script"];
  156.                 $templates->templates[$template]->contents[$box]->content_id         =  $value["content_id"];
  157.                 $templates->templates[$template]->contents[$box]->slider_timeout     =  $value["slider_timeout"];
  158.                 $templates->templates[$template]->contents[$box]->slider_height      =  $value["slider_height"];
  159.                 $templates->templates[$template]->contents[$box]->image_resize       =  $value["image_resize"];
  160.                 $templates->templates[$template]->contents[$box]->image_crop         =  $value["image_crop"];
  161.                 $templates->templates[$template]->contents[$box]->list_orderby       =  $value["list_orderby"];
  162.                 $templates->templates[$template]->contents[$box]->list_order         =  $value["list_order"];
  163.                 $templates->templates[$template]->contents[$box]->slider_effect      =  $value["slider_effect"];
  164.                 $templates->templates[$template]->contents[$box]->slider_buttons     =  $value["slider_buttons"];
  165.                 }
  166.                
  167.                 //google map
  168.                 if(stristr($key, '_google_map')                                      == TRUE) {
  169.                 $box++;
  170.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  171.                 $templates->templates[$template]->contents[$box]->content_type       =  'google_map';
  172.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  173.                 $templates->templates[$template]->contents[$box]->map_url            =  $value["map_url"];
  174.                 $templates->templates[$template]->contents[$box]->height             =  $value["height"];
  175.                 }
  176.                
  177.                 //contact form
  178.                 if(stristr($key, '_contact_form')                                    == TRUE) {
  179.                 $box++;
  180.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  181.                 $templates->templates[$template]->contents[$box]->content_type       =  'contact_form';
  182.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  183.                 $templates->templates[$template]->contents[$box]->title              =  $value["title"];
  184.                 $templates->templates[$template]->contents[$box]->email              =  $value["email"];
  185.                 $templates->templates[$template]->contents[$box]->shortcode          =  $value["shortcode"];
  186.                 $templates->templates[$template]->contents[$box]->box_border         =  $value["box_border"];
  187.                 $templates->templates[$template]->contents[$box]->description        =  $value["description"];
  188.                
  189.                     //wpml register string
  190.                     wpml_register_string( THEMESLUG , 'Text for Contact Form '.$templates->templates[$template]->templateID, $value["title"] );
  191.                     wpml_register_string( THEMESLUG , 'Description for Contact Form '.$templates->templates[$template]->templateID, $value["description"] );
  192.                 }
  193.                
  194.                 //contact info box
  195.                 if(stristr($key, '_contact_info_box')                                == TRUE) {
  196.                 $box++;
  197.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  198.                 $templates->templates[$template]->contents[$box]->content_type       =  'contact_info_box';
  199.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  200.                 $templates->templates[$template]->contents[$box]->contact_title      =  $value["contact_title"];
  201.                 $templates->templates[$template]->contents[$box]->contact_text       =  $value["contact_text"];
  202.                 $templates->templates[$template]->contents[$box]->address            =  $value["address"];
  203.                 $templates->templates[$template]->contents[$box]->phone              =  $value["phone"];
  204.                 $templates->templates[$template]->contents[$box]->email              =  $value["email"];
  205.                 $templates->templates[$template]->contents[$box]->support_email      =  $value["support_email"];
  206.                 $templates->templates[$template]->contents[$box]->fax                =  $value["fax"];
  207.                 $templates->templates[$template]->contents[$box]->box_border         =  $value["box_border"];
  208.  
  209.  
  210.                     //wpml register string
  211.                     wpml_register_string( THEMESLUG , 'Title for Contact Info '.$templates->templates[$template]->templateID, $value["contact_title"] );
  212.                     wpml_register_string( THEMESLUG , 'Text for Contact Info '.$templates->templates[$template]->templateID, $value["contact_text"] );
  213.                     wpml_register_string( THEMESLUG , 'Address for Contact Info '.$templates->templates[$template]->templateID, $value["address"] );
  214.                     wpml_register_string( THEMESLUG , 'Phone for Contact Info '.$templates->templates[$template]->templateID, $value["phone"] );
  215.                     wpml_register_string( THEMESLUG , 'Email for Contact Info '.$templates->templates[$template]->templateID, $value["email"] );
  216.                     wpml_register_string( THEMESLUG , 'Support Email for Contact Info '.$templates->templates[$template]->templateID, $value["support_email"] );
  217.                     wpml_register_string( THEMESLUG , 'Fax for Contact Info '.$templates->templates[$template]->templateID, $value["fax"] );               
  218.                 }
  219.                
  220.                 //blog posts
  221.                 if(stristr($key, '_blog_box')                                        == TRUE) {
  222.                 $box++;
  223.                 $templates->templates[$template]->contents[$box]->group_id           =  $group_id; // group id
  224.                 $templates->templates[$template]->contents[$box]->content_type       =  'blog_box';
  225.                 $templates->templates[$template]->contents[$box]->layout             =  $value["layout"];
  226.                 $templates->templates[$template]->contents[$box]->pagination         =  $value["pagination"];
  227.                 $templates->templates[$template]->contents[$box]->list_orderby       =  $value["list_orderby"];
  228.                 $templates->templates[$template]->contents[$box]->list_order         =  $value["list_order"];
  229.                 $templates->templates[$template]->contents[$box]->item_per_page      =  $value["item_per_page"];
  230.                 $templates->templates[$template]->contents[$box]->categories         =  $value["categories"];
  231.                 }
  232.  
  233.                 //line up boxes     templateid_50758_line_up_boxes
  234.                 if(stristr($key, $templates->templates[$template]->templateID.'_line_up_boxes') == TRUE && $templates->templates[$template]->templateName) {
  235.                     $box++;
  236.                     $templates->templates[$template]->lineup                        =  $value;
  237.                 }
  238.             }
  239.            
  240.             //save the object
  241.             update_option('rt_page_layouts', $templates);
  242.            
  243.             //save the template names array
  244.             update_option('rt_template_names_array', $savedTemplates_Array);
  245.          
  246.         }
  247.          
  248.            
  249.     }
  250.      
  251.  
  252.     #
  253.     #   Create Default Templates
  254.     #
  255.    
  256.     function rt_create_default_templates(){
  257.        
  258.  
  259.         $defaultTemplates = new stdClass;
  260.  
  261.  
  262.                 #
  263.                 #   Home Page default
  264.                 #
  265.        
  266.                 //create a default tempalte for products - no sidebar
  267.                 $templateID                                                                = "templateid_001";                             
  268.                 $defaultTemplates->templates[$templateID]->templateID                      = "templateid_001";
  269.                 $defaultTemplates->templates[$templateID]->templateName                    = __("Default Home Page Template","rt_theme_admin");
  270.                 $defaultTemplates->templates[$templateID]->sidebar                         = "full";
  271.                
  272.                
  273.                 //accordion slider with all avaiable slider contents
  274.                 $defaultTemplates->templates[$templateID]->contents[0]->group_id           = 1;
  275.                 $defaultTemplates->templates[$templateID]->contents[0]->content_type       = "slider_box";
  276.                 $defaultTemplates->templates[$templateID]->contents[0]->slider_script      = "accordion";
  277.                 $defaultTemplates->templates[$templateID]->contents[0]->content_id         = "";
  278.                 $defaultTemplates->templates[$templateID]->contents[0]->layout             = "one";
  279.                 $defaultTemplates->templates[$templateID]->contents[0]->slider_timeout     = 8;
  280.                 $defaultTemplates->templates[$templateID]->contents[0]->slider_height      = 400;
  281.                 $defaultTemplates->templates[$templateID]->contents[0]->image_resize       = "on";
  282.                 $defaultTemplates->templates[$templateID]->contents[0]->image_crop         = "on";
  283.                 $defaultTemplates->templates[$templateID]->contents[0]->list_orderby       = "date";
  284.                 $defaultTemplates->templates[$templateID]->contents[0]->list_order         = "DESC";
  285.                 $defaultTemplates->templates[$templateID]->contents[0]->slider_effect      = "scrollUp";
  286.                 $defaultTemplates->templates[$templateID]->contents[0]->slider_buttons     = "on";
  287.                
  288.                 //banner box
  289.                 $defaultTemplates->templates[$templateID]->contents[1]->group_id           = 2;
  290.                 $defaultTemplates->templates[$templateID]->contents[1]->content_type       = "banner_box";
  291.                 $defaultTemplates->templates[$templateID]->contents[1]->layout             = "one";
  292.                 $defaultTemplates->templates[$templateID]->contents[1]->text               = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor <a href="#" title="">do eius mod tempor</a> labore et dolore magna aliqua. Ut enim ad minim veniam.';
  293.                 $defaultTemplates->templates[$templateID]->contents[1]->button_text        = '';
  294.                 $defaultTemplates->templates[$templateID]->contents[1]->button_color       = 'light';
  295.                 $defaultTemplates->templates[$templateID]->contents[1]->button_link        = '';
  296.                 $defaultTemplates->templates[$templateID]->contents[1]->button_size        = 'small';
  297.                
  298.                 //home page contents  - home page custom posts - all - four columns in full width box
  299.                 $defaultTemplates->templates[$templateID]->contents[2]->group_id           = 3;
  300.                 $defaultTemplates->templates[$templateID]->contents[2]->content_type       = "all_content_boxes";
  301.                 $defaultTemplates->templates[$templateID]->contents[2]->content_id         = "";
  302.                 $defaultTemplates->templates[$templateID]->contents[2]->layout             = "one";
  303.                 $defaultTemplates->templates[$templateID]->contents[2]->item_width         = "4";
  304.                 $defaultTemplates->templates[$templateID]->contents[2]->box_border         = "on";
  305.                 $defaultTemplates->templates[$templateID]->contents[2]->list_orderby       = "date";
  306.                 $defaultTemplates->templates[$templateID]->contents[2]->list_order         = "DESC";
  307.                
  308.                 //call widgetized home page area
  309.                 $defaultTemplates->templates[$templateID]->contents[3]->group_id           = 4;
  310.                 $defaultTemplates->templates[$templateID]->contents[3]->content_type       = "sidebar_box";
  311.                 $defaultTemplates->templates[$templateID]->contents[3]->sidebar_id         = "home-page-contents";
  312.                 $defaultTemplates->templates[$templateID]->contents[3]->layout             = "one";
  313.                 $defaultTemplates->templates[$templateID]->contents[3]->widget_box_width   = "4";
  314.                 $defaultTemplates->templates[$templateID]->contents[3]->widget_border      = "on";
  315.                
  316.                 //save the templates as an array
  317.                 $savedTemplates_Array[$templateID]                                         = $defaultTemplates->templates[$templateID]->templateName;
  318.                
  319.                
  320.                 #
  321.                 #   Portfolio default
  322.                 #
  323.                
  324.                 //create a default tempalte for portfolio - no sidebar
  325.                 $templateID                                                                = "templateid_002";
  326.                 $defaultTemplates->templates[$templateID]->templateID                      = "templateid_002";
  327.                 $defaultTemplates->templates[$templateID]->templateName                    = __("Default Portfolio Template","rt_theme_admin");
  328.                 $defaultTemplates->templates[$templateID]->sidebar                         = "full";
  329.                
  330.                 //default content - 1/1 box with heading
  331.                 $defaultTemplates->templates[$templateID]->contents[0]->group_id           = 1;
  332.                 $defaultTemplates->templates[$templateID]->contents[0]->content_type       = "default_content";
  333.                 $defaultTemplates->templates[$templateID]->contents[0]->layout             = "one";
  334.                 $defaultTemplates->templates[$templateID]->contents[0]->heading            = "on";             
  335.                
  336.                 //all portfolio items with all categories - pagination ON - 1/1 box width - 1/4 item width     
  337.                 $defaultTemplates->templates[$templateID]->contents[1]->group_id           = 2;
  338.                 $defaultTemplates->templates[$templateID]->contents[1]->content_type       = "portfolio_box";
  339.                 $defaultTemplates->templates[$templateID]->contents[1]->layout             = "one";
  340.                 $defaultTemplates->templates[$templateID]->contents[1]->heading            = "on";
  341.                 $defaultTemplates->templates[$templateID]->contents[1]->item_width         = 4;
  342.                 $defaultTemplates->templates[$templateID]->contents[1]->pagination         = "on";
  343.                 $defaultTemplates->templates[$templateID]->contents[1]->item_per_page      = 12;
  344.                 $defaultTemplates->templates[$templateID]->contents[1]->portf_list_orderby = "date";
  345.                 $defaultTemplates->templates[$templateID]->contents[1]->portf_list_order   = "DESC";
  346.                
  347.                 //save the templates as an array
  348.                 $savedTemplates_Array[$templateID]                                         = $defaultTemplates->templates[$templateID]->templateName;
  349.                
  350.                
  351.                 #
  352.                 #   Product default
  353.                 #
  354.                
  355.                 //create a default tempalte for products - no sidebar
  356.                 $templateID                                                                = "templateid_003";                             
  357.                 $defaultTemplates->templates[$templateID]->templateID                      = "templateid_003";
  358.                 $defaultTemplates->templates[$templateID]->templateName                    = __("Default Product Template","rt_theme_admin");
  359.                 $defaultTemplates->templates[$templateID]->sidebar                         = "right";              
  360.                
  361.                 //default content - 1/1 box with heading
  362.                 $defaultTemplates->templates[$templateID]->contents[0]->group_id           = 1;
  363.                 $defaultTemplates->templates[$templateID]->contents[0]->content_type       = "default_content";
  364.                 $defaultTemplates->templates[$templateID]->contents[0]->layout             = "one";
  365.                 $defaultTemplates->templates[$templateID]->contents[0]->heading            = "on";
  366.                
  367.                 //all product items with all categories - pagination ON - 1/1 box width - 1/3 item width       
  368.                 $defaultTemplates->templates[$templateID]->contents[1]->group_id           = 2;
  369.                 $defaultTemplates->templates[$templateID]->contents[1]->content_type       = "product_box";
  370.                 $defaultTemplates->templates[$templateID]->contents[1]->layout             = "one";
  371.                 $defaultTemplates->templates[$templateID]->contents[1]->heading            = "on";
  372.                 $defaultTemplates->templates[$templateID]->contents[1]->item_width         = 3;
  373.                 $defaultTemplates->templates[$templateID]->contents[1]->pagination         = "on";
  374.                 $defaultTemplates->templates[$templateID]->contents[1]->item_per_page      = 9;
  375.                 $defaultTemplates->templates[$templateID]->contents[1]->list_orderby       = "date";
  376.                 $defaultTemplates->templates[$templateID]->contents[1]->list_order         = "DESC";
  377.                
  378.                 //save the templates as an array
  379.                 $savedTemplates_Array[$templateID]                                         = $defaultTemplates->templates[$templateID]->templateName;
  380.                
  381.                
  382.                 #
  383.                 #   Blog default
  384.                 #
  385.                
  386.                 //create a default tempalte for products - no sidebar
  387.                 $templateID                                                                = "templateid_004";                             
  388.                 $defaultTemplates->templates[$templateID]->templateID                      = "templateid_004";
  389.                 $defaultTemplates->templates[$templateID]->templateName                    = __("Default Blog Template","rt_theme_admin");
  390.                 $defaultTemplates->templates[$templateID]->sidebar                         = "right";              
  391.                
  392.                 //all posts with all categories - pagination ON - 1/1 box width - 1/1 item width       
  393.                 $defaultTemplates->templates[$templateID]->contents[0]->group_id           = 1;
  394.                 $defaultTemplates->templates[$templateID]->contents[0]->content_type       = "blog_box";
  395.                 $defaultTemplates->templates[$templateID]->contents[0]->layout             = "one";
  396.                 $defaultTemplates->templates[$templateID]->contents[0]->pagination         = "on";
  397.                 $defaultTemplates->templates[$templateID]->contents[0]->item_per_page      = 5;
  398.                 $defaultTemplates->templates[$templateID]->contents[0]->list_orderby       = "date";
  399.                 $defaultTemplates->templates[$templateID]->contents[0]->ist_order          = "DESC";
  400.                 $defaultTemplates->templates[$templateID]->contents[0]->categories         = "";
  401.                
  402.                 //save the templates as an array
  403.                 $savedTemplates_Array[$templateID]                                         = $defaultTemplates->templates[$templateID]->templateName;
  404.                
  405.                
  406.                
  407.                 #
  408.                 #   Contact Contact Page default
  409.                 #
  410.                
  411.                 //create a default tempalte for products - no sidebar
  412.                 $templateID                                                                = "templateid_005";                             
  413.                 $defaultTemplates->templates[$templateID]->templateID                      = "templateid_005";
  414.                 $defaultTemplates->templates[$templateID]->templateName                    = __("Default Contact Page Template","rt_theme_admin");
  415.                 $defaultTemplates->templates[$templateID]->sidebar                         = "full";               
  416.                
  417.                 //default content - 1/1 box with heading
  418.                 $defaultTemplates->templates[$templateID]->contents[0]->group_id           = 1;
  419.                 $defaultTemplates->templates[$templateID]->contents[0]->content_type       = "default_content";
  420.                 $defaultTemplates->templates[$templateID]->contents[0]->layout             = "one";
  421.                 $defaultTemplates->templates[$templateID]->contents[0]->heading            = "on";     
  422.                
  423.                 //sample google map
  424.                 $defaultTemplates->templates[$templateID]->contents[1]->group_id           = 2;
  425.                 $defaultTemplates->templates[$templateID]->contents[1]->content_type       = "google_map";
  426.                 $defaultTemplates->templates[$templateID]->contents[1]->layout             = "one";
  427.                 $defaultTemplates->templates[$templateID]->contents[1]->map_url            = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;ll=40.748151,-73.985131&amp;spn=0.012355,0.021007&amp;t=m&amp;z=16&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/?ie=UTF8&amp;ll=40.748151,-73.985131&amp;spn=0.012355,0.021007&amp;t=m&amp;z=16&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>';               
  428.                 $defaultTemplates->templates[$templateID]->contents[1]->height             = "270";
  429.                
  430.                
  431.                 //sample contact info box
  432.                 $defaultTemplates->templates[$templateID]->contents[2]->group_id           = 3;
  433.                 $defaultTemplates->templates[$templateID]->contents[2]->content_type       = "contact_info_box";
  434.                 $defaultTemplates->templates[$templateID]->contents[2]->layout             = "two";
  435.                 $defaultTemplates->templates[$templateID]->contents[2]->contact_title      = "Contact Details";
  436.                 $defaultTemplates->templates[$templateID]->contents[2]->contact_text       = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eius mod tempor incididunt ut lab ore et dolore magna aliqua.";
  437.                 $defaultTemplates->templates[$templateID]->contents[2]->address            = "63739 street lorem ipsum City, Country ";
  438.                 $defaultTemplates->templates[$templateID]->contents[2]->phone              = "+1 123 312 32 23";
  439.                 $defaultTemplates->templates[$templateID]->contents[2]->email              = "[email protected]";
  440.                 $defaultTemplates->templates[$templateID]->contents[2]->support_email      = "[email protected]";
  441.                 $defaultTemplates->templates[$templateID]->contents[2]->fax                = "+1 123 312 32 23";
  442.                 $defaultTemplates->templates[$templateID]->contents[2]->box_border         = "";
  443.                
  444.                 //sample contact form
  445.                 $defaultTemplates->templates[$templateID]->contents[3]->group_id           = 4;
  446.                 $defaultTemplates->templates[$templateID]->contents[3]->content_type       = "contact_form";
  447.                 $defaultTemplates->templates[$templateID]->contents[3]->layout             = "two";
  448.                 $defaultTemplates->templates[$templateID]->contents[3]->title              = "Contact Form";
  449.                 $defaultTemplates->templates[$templateID]->contents[3]->email              = get_option('admin_email');
  450.                 $defaultTemplates->templates[$templateID]->contents[3]->description        = "(*) lorem ipsum dolor sit amet!";
  451.                 $defaultTemplates->templates[$templateID]->contents[3]->shortcode          = "";
  452.  
  453.                 //save the templates as an array
  454.                 $savedTemplates_Array[$templateID]                                         = $defaultTemplates->templates[$templateID]->templateName;
  455.  
  456.  
  457.  
  458.  
  459.         //save the template names array
  460.         update_option('rt_template_names_array', $savedTemplates_Array);
  461.  
  462.         //save the object
  463.         update_option('rt_page_layouts', $defaultTemplates);
  464.        
  465.     }
  466.  
  467.  
  468.  
  469.     #
  470.     #   Banner Box
  471.     #
  472.     function rt_generate_banner_box($theGroupID,$theTemplateID,$options,$randomClass){
  473.  
  474.  
  475.             $boxName       = __("Banner Box", "rt_theme_admin");
  476.             $contet_type   = "banner_box";         
  477.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  478.            
  479.             $isNewBox      = (trim($randomClass)=="") ? false : true;
  480.            
  481.             $opacity       = 1;
  482.             $layout        = $isNewBox ? 'full expanded"':  $options['layout']      ;
  483.             $position      = $isNewBox ? 'open minus'   :   'plus'                  ;
  484.             $data_position = $isNewBox ? ''             :   'display: none;'        ;      
  485.             $text          = $isNewBox ? ''             :   $options['text']        ;  
  486.             $button_text   = $isNewBox ? ''             :   $options['button_text'] ;
  487.             $button_link   = $isNewBox ? ''             :   $options['button_link'] ;
  488.             $button_color  = $isNewBox ? ''             :   $options['button_color'];
  489.             $button_size   = $isNewBox ? ''             :   $options['button_size'] ;  
  490.  
  491.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  492.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  493.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  494.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  495.            
  496.             $options = array (
  497.  
  498.                    
  499.                     array(
  500.                                "desc"   => __("You can use this module to display a banner box.",'rt_theme_admin'),  
  501.                                "hr"         => "true",
  502.                                "type"   => "info_text_only"),
  503.  
  504.                     array(
  505.                             "value"     => "one",                        
  506.                             "id"        => $theTemplateID.'_'.$theGroupID."_banner_box[layout]",
  507.                             "type"      => "hidden",
  508.                     ),
  509.  
  510.                     array(
  511.                                "name" => __("Banner Text",'rt_theme_admin'),
  512.                                "desc" => __("Please select a box size for the content.",'rt_theme_admin'),
  513.                                "id" => $theTemplateID.'_'.$theGroupID."_banner_box[text]",
  514.                                "value"=>$text,
  515.                                "class"=>"banner_text",
  516.                                "hr" => "true",
  517.                                "type" => "textarea"),                
  518.  
  519.                     array(
  520.                                "name" => __("Button Text",'rt_theme_admin'),                         
  521.                                "id" => $theTemplateID.'_'.$theGroupID."_banner_box[button_text]",
  522.                                "value"=>$button_text,
  523.                                "class"=>"button_text",
  524.                                "hr" => "true",
  525.                                "type" => "text"),
  526.  
  527.                     array(
  528.                                "name" => __("Button Link",'rt_theme_admin'),                         
  529.                                "id" => $theTemplateID.'_'.$theGroupID."_banner_box[button_link]",
  530.                                "value"=>$button_link,
  531.                                "class"=>"button_link",
  532.                                "hr" => "true",
  533.                                "type" => "text"),
  534.                    
  535.                    
  536.                     array(
  537.                                "name" => __("Select Button Size",'rt_theme_admin'),
  538.                                "desc" => __("Please select a box size for the content.",'rt_theme_admin'),
  539.                                "id" => $theTemplateID.'_'.$theGroupID."_banner_box[button_size]",
  540.                                "options" => array(
  541.                                                 "small"     =>  __("Small Button",'rt_theme_admin'),
  542.                                                 "medium"        =>  __("Medium Button",'rt_theme_admin'),
  543.                                                 "big"       =>  __("Big Button",'rt_theme_admin'),                 
  544.                                             ),
  545.                                            
  546.                                "default"=>"medium",
  547.                                "value"=>$button_size,
  548.                                "hr" => "true",
  549.                                "type" => "select"),
  550.  
  551.                     array(
  552.                                "name" => __("Select Button Color",'rt_theme_admin'),
  553.                                "id" => $theTemplateID.'_'.$theGroupID."_banner_box[button_color]",
  554.                                "options" => array(
  555.                                                 "light"     =>  __("Light",'rt_theme_admin'),
  556.                                                 "dark"      =>  __("Dark",'rt_theme_admin'),
  557.                                                 "orange"        =>  __("Orange",'rt_theme_admin'),
  558.                                                 "green"     =>  __("Green",'rt_theme_admin'),
  559.                                                 "blue"      =>  __("Blue",'rt_theme_admin'),
  560.                                                 "red"       =>  __("Red",'rt_theme_admin'),                                                                
  561.                                             ),
  562.                                            
  563.                                "default"=>"orange",
  564.                                "value"=>$button_color,
  565.                                "hr" => "true",
  566.                                "type" => "select"),
  567.                    
  568.                     array(
  569.                             "name"      => __("delete",'rt_theme_admin'),
  570.                             "id"        => $theTemplateID.'_'.$theGroupID.'_'."_delete",
  571.                             "class"         => "deleteButton template_box_delete",
  572.                             "purpose"   => "page_template",
  573.                             "type"      => "button"),
  574.  
  575.  
  576.                     array(
  577.                             "name"      => __("close",'rt_theme_admin'),
  578.                             "id"        =>$theTemplateID.'_'.$theGroupID.'_'."_close",
  579.                             "class"         => "closeButton template_box_close",
  580.                             "purpose"   => "page_template",
  581.                             "type"      => "button")
  582.                     );
  583.                    
  584.            
  585.             echo  $this->rt_generate_forms($options);
  586.            
  587.             echo  '</div></div></div></li>';
  588.  
  589.     }
  590.  
  591.  
  592.     function rt_generate_slider_box($theGroupID,$theTemplateID,$options,$randomClass){
  593.  
  594.  
  595.             $boxName        = __("Slider", "rt_theme_admin");
  596.             $contet_type    = "slider_box";
  597.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  598.  
  599.             $isNewBox = (trim($randomClass)=="") ? false : true;
  600.            
  601.             $opacity        = 1;
  602.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  603.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  604.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;
  605.  
  606.            
  607.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  608.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  609.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  610.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  611.        
  612.                                
  613.             $options = array (
  614.  
  615.                     array(
  616.                             "value"     => "one",                        
  617.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[layout]",
  618.                             "type"      => "hidden",
  619.                     ),
  620.                            
  621.                     array(
  622.                             "desc"      => __("This module shows a slider.",'rt_theme_admin'),   
  623.                             "hr"        => "true",
  624.                             "type"      => "info_text_only"),                          
  625.        
  626.                     array(
  627.                             "name"      => __("Select Slider Script",'rt_theme_admin'),
  628.                             "desc"      => __("Please select a slider script for your home page.",'rt_theme_admin'),
  629.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[slider_script]",
  630.                             "options"   =>  array(
  631.                                                 "accordion" =>      "Accordion Slider",
  632.                                                 "cycle"     =>      "Cycle Slider",
  633.                                                 "nivo"      =>      "Nivo Slider",
  634.                                         ),
  635.                             "default"       => "cycle",
  636.                             "value"     => $options["slider_script"],
  637.                             "hr"        => "true",
  638.                             "dont_save" => true,
  639.                             "type"      => "select"),
  640.                    
  641.                     array(
  642.                             "name"      => __("Select Slides",'rt_theme_admin'),
  643.                             "desc"      => __("Please select contetst which you want to display in this box. If you don't select one, all contents will be displayed.",'rt_theme_admin'),
  644.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[content_id][]",
  645.                             "options"   => RTTheme::rt_get_slidercontents(),
  646.                             "purpose"       => "sidebar",
  647.                             "type"      => "selectmultiple",
  648.                             "class"     => $randomClass,
  649.                             "hr"            => true,
  650.                             "default"       => $options["content_id"]),
  651.                    
  652.        
  653.                     array(
  654.                             "name"      => __("Transition Timeout (seconds)",'rt_theme_admin'),
  655.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[slider_timeout]",
  656.                             "hr"        => "true",
  657.                             "min"       =>"1",
  658.                             "max"       =>"120",
  659.                             "default"       =>"8",
  660.                             "hr"            => true,
  661.                             "dont_save" => true,
  662.                             "value"     => $options["slider_timeout"],
  663.                             "class"     => $randomClass,
  664.                             "type"      => "rangeinput"),
  665.        
  666.        
  667.                     array(
  668.                             "name"      => __("Slider Height (px)",'rt_theme_admin'),
  669.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[slider_height]",
  670.                             "hr"            => "true",
  671.                             "min"       =>"100",
  672.                             "max"       =>"1000",
  673.                             "default"       =>"300",
  674.                             "hr"            => true,
  675.                             "dont_save" => true,
  676.                             "value"     => $options["slider_height"],
  677.                             "class"     => $randomClass,
  678.                             "type"      => "rangeinput"),
  679.        
  680.        
  681.                     array(
  682.                             "name"      => __("Resize Slider Images.",'rt_theme_admin'),
  683.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[image_resize]",
  684.                             "desc"      => __("If you turn on the crop feature, the image will be cropped as the width and the height values.",'rt_theme_admin'),
  685.                             "class"     => $randomClass,                           
  686.                             "value"     =>  $isNewBox ? "on" : $options["image_resize"],
  687.                             "hr"            => true,
  688.                             "type"      => "checkbox"),
  689.                    
  690.                     array(
  691.                             "name"      => __("Crop Slider Images.",'rt_theme_admin'),
  692.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[image_crop]",
  693.                             "desc"      => __("If you turn on the crop feature, the image will be cropped as the width and the height values.",'rt_theme_admin'),
  694.                             "hr"            => true,
  695.                             "class"     => $randomClass,
  696.                             "value"     =>  $isNewBox ? "on" : $options["image_crop"],
  697.                             "type"      => "checkbox"),
  698.                    
  699.                     array(
  700.                             "name"      => __("OrderBy Parameter",'rt_theme_admin'),
  701.                             "desc"      => __("sort your portfolio by this parameter",'rt_theme_admin'),
  702.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[list_orderby]",
  703.                             "options"   => array('author'=>'Author','date'=>'Date','title'=>'Title','modified'=>'Modified','ID'=>'ID','rand'=>'Randomized'),                   
  704.                             "hr"            => true,
  705.                             "value"     => $options["list_orderby"],
  706.                             "default"       => "date",
  707.                             "dont_save"     => true,
  708.                             "type"      => "select"),
  709.            
  710.                     array(
  711.                             "name"      => __("Order",'rt_theme_admin'),
  712.                             "desc"      => __("Designates the ascending or descending order of the ORDERBY parameter",'rt_theme_admin'),
  713.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[list_order]",
  714.                             "options"   => array('ASC'=>'Ascending','DESC'=>'Descending'),
  715.                             "value"     => $options["list_order"],
  716.                             "default"       => "DESC",
  717.                             "dont_save"     => true,           
  718.                             "type"      => "select"),                  
  719.  
  720.                     array(
  721.                             "name"      => __("OPTIONS JUST FOR THE CYCLE SLIDER",'rt_theme_admin'),
  722.                             "type"      => "heading"),
  723.                    
  724.                     array(
  725.                             "name"      => __("Transition Effect",'rt_theme_admin'),
  726.                             "desc"      => __("Please choose an effect for main page slider",'rt_theme_admin'),
  727.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[slider_effect]",
  728.                             "options"   =>  array(
  729.                                                 "blindX"            =>      "blindX",
  730.                                                 "blindY"            =>      "blindY",
  731.                                                 "blindZ"            =>      "blindZ",
  732.                                                 "cover"         =>      "cover",
  733.                                                 "fade"          =>      "fade",
  734.                                                 "none"          =>      "none",
  735.                                                 "scrollUp"      =>      "scrollUp",
  736.                                                 "scrollDown"        =>      "scrollDown",
  737.                                                 "scrollLeft"        =>      "scrollLeft",
  738.                                                 "scrollRight"       =>      "scrollRight",
  739.                                                 "scrollHorz"        =>      "scrollHorz",
  740.                                                 "scrollVert"        =>      "scrollVert",
  741.                                                 "slideX"            =>      "slideX",
  742.                                                 "slideY"            =>      "slideY",
  743.                                                 "turnUp"            =>      "turnUp",
  744.                                                 "turnDown"      =>      "turnDown",
  745.                                                 "turnLeft"      =>      "turnLeft",
  746.                                                 "turnRight"     =>      "turnRight"
  747.                                          ),
  748.                             "class"     => $randomClass,
  749.                             "value"     => $options["slider_effect"],
  750.                             "default"       =>"scrollUp",
  751.                             "dont_save"     =>"true",
  752.                             "hr"        => "true",
  753.                             "type"      => "select"),
  754.        
  755.        
  756.                     array(
  757.                             "name"      => __("Slider Buttons",'rt_theme_admin'),
  758.                             "desc"      => __("You can turn on/off the paging buttons of the slider",'rt_theme_admin'),
  759.                             "id"        => $theTemplateID.'_'.$theGroupID."_slider_box[slider_buttons]",
  760.                             "hr"        => "true",
  761.                             "class"     => $randomClass,
  762.                             "value"     => $isNewBox ? "on" : $options["slider_buttons"],
  763.                             "type"      => "checkbox"),
  764.            
  765.            
  766.                     array(
  767.                             "name"      => __("delete",'rt_theme_admin'),
  768.                             "id"        => $theTemplateID.'_'.$theGroupID.'_'."_delete",
  769.                             "class"         => "deleteButton template_box_delete",
  770.                             "purpose"   => "page_template",
  771.                             "type"      => "button"),
  772.  
  773.  
  774.                     array(
  775.                             "name"      => __("close",'rt_theme_admin'),
  776.                             "id"        =>$theTemplateID.'_'.$theGroupID.'_'."_close",
  777.                             "class"         => "closeButton template_box_close",
  778.                             "purpose"   => "page_template",
  779.                             "type"      => "button")
  780.                     );
  781.                    
  782.            
  783.             echo  $this->rt_generate_forms($options);
  784.            
  785.             echo  '</div></div></div></li>';
  786.  
  787.     }
  788.  
  789.  
  790.  
  791.     function rt_generate_all_content_boxes($theGroupID,$theTemplateID,$options,$randomClass){
  792.  
  793.  
  794.             $boxName        = __("Home Page Content", "rt_theme_admin");
  795.             $contet_type    = "all_content_boxes";
  796.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  797.            
  798.             $isNewBox = (trim($randomClass)=="") ? false : true;
  799.            
  800.             $opacity        = 1;
  801.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  802.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  803.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;      
  804.             $item_width = $isNewBox ? ''            :   $options['item_width']  ;
  805.             $box_border = $isNewBox ? ''            :   $options['box_border']  ;          
  806.             $list_orderby   = $isNewBox ? ''            :   $options['list_orderby'];
  807.             $list_order = $isNewBox ? ''            :   $options['list_order'];
  808.             $content_id = $isNewBox ? ''            :   $options['content_id'];
  809.            
  810.  
  811.            
  812.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  813.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  814.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  815.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  816.            
  817.             $options = array (
  818.  
  819.                    
  820.                     array(
  821.                                "desc"   => __("You can use this module to display posts that has been created with <a href='edit.php?post_type=home_page'>Home Page Custom Posts</a>",'rt_theme_admin'),     
  822.                                "hr"         => "true",
  823.                                "type"   => "info_text_only"),
  824.  
  825.                     array(
  826.                                "name" => __("Column Width",'rt_theme_admin'),
  827.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  828.                                "id" => $theTemplateID.'_'.$theGroupID."_all_content_boxes[layout]",
  829.                                "options" => array(
  830.                                                     "one"       =>      "Full Width",
  831.                                                     "two"       =>      "1:2 - One Second",
  832.                                                     "three"     =>      "1:3 - One Third",
  833.                                                     "four"      =>      "1:4 - One Fourth",
  834.                                                     "five"      =>      "1:5 - One Fifth",
  835.                                                     "two-three" =>      "2:3 - Second Third",
  836.                                                     "three-four"    =>      "3:4 - Third Fourth",
  837.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  838.                                             ),
  839.                                "default"=>"one",
  840.                                "value"=>$layout,
  841.                                "class"=>"layout_selector",
  842.                                "hr" => "true",
  843.                                "type" => "select"),                                
  844.                    
  845.                     array(
  846.                             "name"  => __("Select Contents",'rt_theme_admin'),
  847.                             "desc"  => __("You can filter posts by selecting from this list. If you don't select one, all home page contents will be displayed.",'rt_theme_admin'),
  848.                             "id"    => $theTemplateID.'_'.$theGroupID."_all_content_boxes[content_id][]",
  849.                             "options" => RTTheme::rt_get_homecontents(),
  850.                             "purpose" => "sidebar",
  851.                             "type"  => "selectmultiple",
  852.                             "class" => $randomClass,
  853.                             "default"   => $content_id
  854.                     ),
  855.                    
  856.                     array(
  857.                                "name"   => __("Content Layout",'rt_theme_admin'),
  858.                                "desc"   => __("Please select a layout for the contents that will be displayed in this column.",'rt_theme_admin'),
  859.                                "id"         => $theTemplateID.'_'.$theGroupID."_all_content_boxes[item_width]",
  860.                                "options"    =>  array(
  861.                                                     5 => "1/5",
  862.                                                     4 => "1/4",
  863.                                                     3 => "1/3",
  864.                                                     2 => "1/2",
  865.                                                     1 => "1/1"                                 
  866.                                             ),
  867.                                "default"    =>"4",
  868.                                "dont_save"  =>true,
  869.                                "value"  =>$item_width,
  870.                                "hr"         => "true",
  871.                                "type"   => "select"),
  872.                    
  873.                     array(
  874.                             "name"      => __("Box Border",'rt_theme_admin'),
  875.                             "desc"      => __('adds a border each contents if the "Full Width" selected as the column with, otherwise adds a border for the column only.','rt_theme_admin'),
  876.                             "id"        => $theTemplateID.'_'.$theGroupID."_all_content_boxes[box_border]",
  877.                             "type"      => "checkbox",
  878.                             "class"     => $randomClass,
  879.                             "value"     => $box_border,                            
  880.                             "hr"            => true,
  881.                             "default"       => "off",
  882.                             "std"       => "false"),
  883.                    
  884.                     array(
  885.                             "name"      => __("OrderBy Parameter",'rt_theme_admin'),
  886.                             "desc"      => __("sort your home page posts by this parameter",'rt_theme_admin'),
  887.                             "id"        => $theTemplateID.'_'.$theGroupID."_all_content_boxes[list_orderby]",
  888.                             "options"   => array('author'=>'Author','date'=>'Date','title'=>'Title','modified'=>'Modified','ID'=>'ID','rand'=>'Randomized'),                   
  889.                             "hr"            => true,
  890.                             "value"     => $list_orderby,
  891.                             "default"       => "date",
  892.                             "dont_save"     => true,
  893.                             "type"      => "select"),
  894.            
  895.                     array(
  896.                             "name"      => __("Order",'rt_theme_admin'),
  897.                             "desc"      => __("Designates the ascending or descending order of the ORDERBY parameter",'rt_theme_admin'),
  898.                             "id"        => $theTemplateID.'_'.$theGroupID."_all_content_boxes[list_order]",
  899.                             "options"   => array('ASC'=>'Ascending','DESC'=>'Descending'),
  900.                             "value"     => $list_order,
  901.                             "default"       => "DESC",
  902.                             "dont_save"     => true,
  903.                             "hr"            => true,                   
  904.                             "type"      => "select"),                  
  905.  
  906.                     array(
  907.                             "name"      => __("delete",'rt_theme_admin'),
  908.                             "id"        => $theTemplateID.'_'.$theGroupID.'_'."_delete",
  909.                             "class"         => "deleteButton template_box_delete",
  910.                             "purpose"   => "page_template",
  911.                             "type"      => "button"),
  912.  
  913.  
  914.                     array(
  915.                             "name"      => __("close",'rt_theme_admin'),
  916.                             "id"        => $theTemplateID.'_'.$theGroupID.'_'."_close",
  917.                             "class"         => "closeButton template_box_close",
  918.                             "purpose"   => "page_template",
  919.                             "type"      => "button")
  920.                     );
  921.                    
  922.            
  923.             echo  $this->rt_generate_forms($options);
  924.            
  925.             echo  '</div></div></div></li>';
  926.  
  927.     }
  928.  
  929.  
  930.     function rt_generate_default_content_box($theGroupID,$theTemplateID,$options,$randomClass){
  931.  
  932.  
  933.             $boxName        = __("Default Content", "rt_theme_admin");
  934.             $contet_type    = "default_content";
  935.             $theTemplateID  = str_replace('_'.$contet_type,'',$theTemplateID);
  936.            
  937.             $isNewBox       = (trim($randomClass)=="") ? false : true;
  938.            
  939.             $opacity        = 1;
  940.             $layout         = $isNewBox ? 'full expanded"':     $options['layout']      ;
  941.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  942.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;    
  943.             $heading        = $isNewBox ? 'on'          :   $options['heading']     ;
  944.        
  945.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  946.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  947.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  948.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  949.            
  950.             $options = array (
  951.  
  952.                    
  953.                     array(
  954.                             "desc" => __("This module displays the content of the page or post that used with.",'rt_theme_admin'),   
  955.                             "hr" => "true",
  956.                             "type" => "info_text_only",
  957.                     ),
  958.  
  959.    
  960.                     array(
  961.                             "name"  => __("Heading",'rt_theme_admin'),
  962.                             "desc"  => __("Turn Off this option if you don't want to show page/post heading.",'rt_theme_admin'),
  963.                             "id"    => $theTemplateID.'_'.$theGroupID."_default_content[heading]",
  964.                             "type"  => "checkbox",
  965.                             "class" => $randomClass,
  966.                             "value" => $heading,  
  967.                             "std"   => "false"),           
  968.  
  969.                     array(
  970.                             "value" => "1",
  971.                             "hr"    => "true",
  972.                             "id"    => $theTemplateID.'_'.$theGroupID."_default_content[hidden]",
  973.                             "type"  => "hidden",
  974.                     ),
  975.                    
  976.                     array(
  977.                             "name" => __("delete",'rt_theme_admin'),
  978.                             "id" => "_delete",
  979.                             "class" => "deleteButton template_box_delete",
  980.                             "purpose" => "page_template",
  981.                             "type" => "button",
  982.                     ),
  983.  
  984.  
  985.                     array(
  986.                             "name" => __("close",'rt_theme_admin'),
  987.                             "id" => "_close",
  988.                             "class" => "closeButton template_box_close",
  989.                             "purpose" => "page_template",
  990.                             "type" => "button",
  991.                     )
  992.                    
  993.                                        
  994.                     );
  995.                    
  996.            
  997.             echo  $this->rt_generate_forms($options);
  998.            
  999.             echo  '</div></div></div></li>';
  1000.  
  1001.     }
  1002.    
  1003.  
  1004.     function rt_generate_blog_box($theGroupID,$theTemplateID,$options,$randomClass){
  1005.        
  1006.        
  1007.             $boxName        = __("Blog Posts", "rt_theme_admin");
  1008.             $contet_type    = "blog_box";
  1009.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1010.            
  1011.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1012.            
  1013.             $opacity        = 1;
  1014.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1015.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1016.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;
  1017.             $categories = $isNewBox ? ''            :   $options['categories']  ;
  1018.             $pagination = $isNewBox ? ''            :   $options['pagination']  ;
  1019.             $list_orderby   = $isNewBox ? ''            :   $options['list_orderby'];
  1020.             $list_order = $isNewBox ? ''            :   $options['list_order'];
  1021.             $item_per_page  = $isNewBox ? ''            :   $options['item_per_page'];
  1022.        
  1023.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1024.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1025.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1026.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1027.            
  1028.  
  1029.             $options = array (
  1030.  
  1031.                     array(
  1032.                                "desc" => __("This module displays posts according the options below.",'rt_theme_admin'),     
  1033.                                "hr" => "true",
  1034.                                "type" => "info_text_only",
  1035.                     ),
  1036.                    
  1037.                     array(
  1038.                             "value"     => "one",                        
  1039.                             "id"        => $theTemplateID.'_'.$theGroupID."_blog_box[layout]",
  1040.                             "type"      => "hidden",
  1041.                     ),
  1042.                    
  1043.                     array(
  1044.                             "name"  => __("Select Post Categories",'rt_theme_admin'),
  1045.                             "desc"  => __("You can select categories to filter posts that will be displayed with this module. If you don't select one, this module will display all posts.",'rt_theme_admin'),
  1046.                             "id"    => $theTemplateID.'_'.$theGroupID."_blog_box[categories][]",
  1047.                             "options" => RTTheme::rt_get_categories(),
  1048.                             "purpose" => "sidebar",
  1049.                             "type"  => "selectmultiple",
  1050.                             "hr"        => true,   
  1051.                             "class" => $randomClass,
  1052.                             "default"   => $categories),
  1053.                    
  1054.                     array(
  1055.                             "name"  => __("OrderBy Parameter",'rt_theme_admin'),
  1056.                             "desc"  => __("sort your posts by this parameter",'rt_theme_admin'),
  1057.                             "id" => $theTemplateID.'_'.$theGroupID."_blog_box[list_orderby]",
  1058.                             "options" => array('author'=>'Author','date'=>'Date','title'=>'Title','modified'=>'Modified','ID'=>'ID','rand'=>'Randomized'),                 
  1059.                             "hr"        => true,
  1060.                             "value" => $list_orderby,
  1061.                             "default"   => "date",
  1062.                             "dont_save" => true,
  1063.                             "type"  => "select"),
  1064.            
  1065.                     array(
  1066.                             "name"  => __("Order",'rt_theme_admin'),
  1067.                             "desc"  => __("Designates the ascending or descending order of the ORDERBY parameter",'rt_theme_admin'),
  1068.                             "id" => $theTemplateID.'_'.$theGroupID."_blog_box[list_order]",
  1069.                             "options" => array('ASC'=>'Ascending','DESC'=>'Descending'),
  1070.                             "value" => $list_order,
  1071.                             "default"   => "DESC",
  1072.                             "dont_save" => true,
  1073.                             "hr"        => true,                   
  1074.                             "type"  => "select"),
  1075.    
  1076.                     array(
  1077.                             "name"  => __("Amount of blog post per page",'rt_theme_admin'),
  1078.                             "desc"  => __("How many posts do you want to display per page?",'rt_theme_admin'),
  1079.                             "id"    => $theTemplateID.'_'.$theGroupID."_blog_box[item_per_page]",
  1080.                             "min"   => "1",
  1081.                             "max"   => "200",
  1082.                             "class" => $randomClass,
  1083.                             "value" => $item_per_page,
  1084.                             "default"   => "9",
  1085.                             "dont_save" => true,
  1086.                             "hr"        => true,
  1087.                             "type"  => "rangeinput"),
  1088.              
  1089.                     array(
  1090.                             "name"  => __("Pagination",'rt_theme_admin'),
  1091.                             "desc"  => __("Adds page navigation under the posts.",'rt_theme_admin'),
  1092.                             "id"    => $theTemplateID.'_'.$theGroupID."_blog_box[pagination]",
  1093.                             "type"  => "checkbox",
  1094.                             "class" => $randomClass,
  1095.                             "value" => $pagination,                            
  1096.                             "hr"        => true,
  1097.                             "default"   => "off",
  1098.                             "std"   => "false"),
  1099.  
  1100.                     array(
  1101.                             "name" => __("delete",'rt_theme_admin'),
  1102.                             "id" => "_delete",
  1103.                             "class" => "deleteButton template_box_delete",
  1104.                             "purpose" => "page_template",
  1105.                             "type" => "button"),
  1106.                    
  1107.                     array(
  1108.                             "name" => __("close",'rt_theme_admin'),
  1109.                             "id" => "_close",
  1110.                             "class" => "closeButton template_box_close",
  1111.                             "purpose" => "page_template",
  1112.                             "type" => "button"),           
  1113.                    
  1114.                     );
  1115.                        
  1116.                        
  1117.            
  1118.             echo  $this->rt_generate_forms($options);
  1119.            
  1120.             echo  '</div></div></div></li>';
  1121.            
  1122.            
  1123.     }
  1124.  
  1125.  
  1126.     function rt_generate_portfolio_box($theGroupID,$theTemplateID,$options,$randomClass){
  1127.        
  1128.                
  1129.        
  1130.             $boxName        = __("Portfolio Posts", "rt_theme_admin");
  1131.             $contet_type    = "portfolio_box";
  1132.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1133.            
  1134.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1135.            
  1136.             $opacity        = 1;
  1137.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1138.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1139.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;          
  1140.             $categories = $isNewBox ? ''            :   $options['categories']  ;
  1141.             $pagination = $isNewBox ? ''            :   $options['pagination']  ;
  1142.             $item_width = $isNewBox ? ''            :   $options['item_width']  ;
  1143.             $box_border = $isNewBox ? ''            :   $options['box_border']  ;
  1144.             $portf_list_orderby = $isNewBox ? ''        :   $options['portf_list_orderby'];
  1145.             $portf_list_order   = $isNewBox ? ''        :   $options['portf_list_order'];
  1146.             $item_per_page      = $isNewBox ? ''        :   $options['item_per_page'];
  1147.        
  1148.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1149.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1150.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1151.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1152.            
  1153.  
  1154.             $options = array (
  1155.                    
  1156.                    
  1157.                     array(
  1158.                                "desc" => __("This module displays portfolio posts according the options below.",'rt_theme_admin'),   
  1159.                                "hr" => "true",
  1160.                                "type" => "info_text_only",
  1161.                     ),
  1162.                    
  1163.                     array(
  1164.                                "name" => __("Column Width",'rt_theme_admin'),
  1165.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  1166.                                "id" => $theTemplateID.'_'.$theGroupID."_portfolio_box[]",
  1167.                                "options" => array(
  1168.                                                     "one"       =>      "Full Width",
  1169.                                                     "two"       =>      "1:2 - One Second",
  1170.                                                     "three"     =>      "1:3 - One Third",
  1171.                                                     "four"      =>      "1:4 - One Fourth",
  1172.                                                     "five"      =>      "1:5 - One Fifth",
  1173.                                                     "two-three" =>      "2:3 - Second Third",
  1174.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1175.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1176.                                             ),
  1177.                                "default"=>"one",
  1178.                                "value"=>$layout,
  1179.                                "class"=>"layout_selector",
  1180.                                "hr" => "true",
  1181.                                "type" => "select"),
  1182.    
  1183.  
  1184.                     array(
  1185.                             "name"  => __("Select Portfolio Categories",'rt_theme_admin'),
  1186.                             "desc"  => __("You can filter posts by selecting categories from this list. If you don't select one, all portfolio posts will be displayed.",'rt_theme_admin'),
  1187.                             "id"    => $theTemplateID.'_'.$theGroupID."_portfolio_categories[]",
  1188.                             "options" => RTTheme::rt_get_portfolio_categories(),
  1189.                             "purpose" => "sidebar",
  1190.                             "type"  => "selectmultiple",
  1191.                             "class" => $randomClass,
  1192.                             "default"   => $categories),
  1193.                    
  1194.                     array(
  1195.                             "name"  => __("OrderBy Parameter",'rt_theme_admin'),
  1196.                             "desc"  => __("sort your portfolio by this parameter",'rt_theme_admin'),
  1197.                             "id" => $theTemplateID.'_'.$theGroupID."_portfolio_box[portf_list_orderby]",
  1198.                             "options" => array('author'=>'Author','date'=>'Date','title'=>'Title','modified'=>'Modified','ID'=>'ID','rand'=>'Randomized'),                 
  1199.                             "hr"        => true,
  1200.                             "value" => $portf_list_orderby,
  1201.                             "default"   => "date",
  1202.                             "dont_save" => true,
  1203.                             "type"  => "select"),
  1204.            
  1205.                     array(
  1206.                             "name"  => __("Order",'rt_theme_admin'),
  1207.                             "desc"  => __("Designates the ascending or descending order of the ORDERBY parameter",'rt_theme_admin'),
  1208.                             "id" => $theTemplateID.'_'.$theGroupID."_portfolio_box[portf_list_order]",
  1209.                             "options" => array('ASC'=>'Ascending','DESC'=>'Descending'),
  1210.                             "value" => $portf_list_order,
  1211.                             "default"   => "DESC",
  1212.                             "dont_save" => true,
  1213.                             "hr"        => true,                   
  1214.                             "type"  => "select"),
  1215.    
  1216.                     array(
  1217.                         "name"  => __("Amount of portfolio item per page",'rt_theme_admin'),
  1218.                         "desc"  => __("How many item do you want to display per page?",'rt_theme_admin'),
  1219.                         "id" => $theTemplateID.'_'.$theGroupID."_portfolio_box[item_per_page]",
  1220.                         "min"   => "1",
  1221.                         "max"   => "200",
  1222.                         "class" => $randomClass,
  1223.                         "value" => $item_per_page,
  1224.                         "default"   => "9",
  1225.                         "dont_save" => true,
  1226.                         "hr"        => true,
  1227.                         "type"  => "rangeinput"),
  1228.            
  1229.                     array(
  1230.                                "name"   => __("Content Layout",'rt_theme_admin'),
  1231.                                "desc"   => __("Please select a layout for the contents that will be displayed in this column.",'rt_theme_admin'),
  1232.                                "id" => $theTemplateID.'_'.$theGroupID."_portfolio_box[]",
  1233.                                "options" => array(
  1234.                                                     5 => "1/5",
  1235.                                                     4 => "1/4",
  1236.                                                     3 => "1/3",
  1237.                                                     2 => "1/2",
  1238.                                                     1 => "1/1"                                 
  1239.                                             ),
  1240.                                "default"=>"3",
  1241.                                "value"=>$item_width,
  1242.                                "hr" => "true",
  1243.                                "type" => "select"),
  1244.                    
  1245.                     array(
  1246.                             "name"  => __("Box Border",'rt_theme_admin'),
  1247.                             "desc"  => __('adds a border around all the portfolio posts if the "Full Width" is NOT selected as "Column Width".','rt_theme_admin'),
  1248.                             "id"    => $theTemplateID.'_'.$theGroupID."_portfolio_box[box_border]",
  1249.                             "type"  => "checkbox",
  1250.                             "class" => $randomClass,
  1251.                             "value" => $box_border,                            
  1252.                             "hr"        => true,
  1253.                             "default"   => "off",
  1254.                             "std"   => "false"),
  1255.                    
  1256.                     array(
  1257.                             "name"  => __("Pagination",'rt_theme_admin'),
  1258.                             "desc"  => __("Adds page navigation under the portfolio posts.",'rt_theme_admin'),
  1259.                             "id"    => $theTemplateID.'_'.$theGroupID."_portfolio_box[pagination]",
  1260.                             "type"  => "checkbox",
  1261.                             "class" => $randomClass,
  1262.                             "value" => $pagination,                            
  1263.                             "hr"        => true,
  1264.                             "default"   => "off",
  1265.                             "std"   => "false"),
  1266.  
  1267.                     array(
  1268.                             "name" => __("delete",'rt_theme_admin'),
  1269.                             "id" => "_delete",
  1270.                             "class" => "deleteButton template_box_delete",
  1271.                             "purpose" => "page_template",
  1272.                             "type" => "button"),
  1273.                    
  1274.                     array(
  1275.                             "name" => __("close",'rt_theme_admin'),
  1276.                             "id" => "_close",
  1277.                             "class" => "closeButton template_box_close",
  1278.                             "purpose" => "page_template",
  1279.                             "type" => "button"),           
  1280.                    
  1281.                     );
  1282.                        
  1283.            
  1284.             echo  $this->rt_generate_forms($options);
  1285.            
  1286.             echo  '</div></div></div></li>';
  1287.            
  1288.            
  1289.     }
  1290.  
  1291.     function rt_generate_product_box($theGroupID,$theTemplateID,$options,$randomClass){
  1292.        
  1293.                
  1294.        
  1295.             $boxName        = __("Product Posts", "rt_theme_admin");
  1296.             $contet_type    = "product_box";
  1297.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1298.            
  1299.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1300.            
  1301.             $opacity        = 1;
  1302.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1303.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1304.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;
  1305.             $categories = $isNewBox ? ''            :   $options['categories']  ;
  1306.             $pagination = $isNewBox ? ''            :   $options['pagination']  ;
  1307.             $item_width = $isNewBox ? ''            :   $options['item_width']  ;
  1308.             $box_border = $isNewBox ? ''            :   $options['box_border']  ;
  1309.             $list_orderby   = $isNewBox ? ''            :   $options['list_orderby'];
  1310.             $list_order = $isNewBox ? ''            :   $options['list_order'];
  1311.             $item_per_page  = $isNewBox ? ''            :   $options['item_per_page'];
  1312.        
  1313.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1314.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1315.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1316.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1317.            
  1318.  
  1319.             $options = array (
  1320.                    
  1321.                     array(
  1322.                                "desc" => __("This module displays product posts according the options below.",'rt_theme_admin'),     
  1323.                                "hr" => "true",
  1324.                                "type" => "info_text_only",
  1325.                     ),
  1326.                    
  1327.                     array(
  1328.                                "name" => __("Column Width",'rt_theme_admin'),
  1329.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  1330.                                "id" => $theTemplateID.'_'.$theGroupID."_product_box[layout]",
  1331.                                "options" => array(
  1332.                                                     "one"       =>      "Full Width",
  1333.                                                     "two"       =>      "1:2 - One Second",
  1334.                                                     "three"     =>      "1:3 - One Third",
  1335.                                                     "four"      =>      "1:4 - One Fourth",
  1336.                                                     "five"      =>      "1:5 - One Fifth",
  1337.                                                     "two-three" =>      "2:3 - Second Third",
  1338.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1339.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1340.                                             ),
  1341.                                "default"=>"one",
  1342.                                "value"=>$layout,
  1343.                                "class"=>"layout_selector",
  1344.                                "hr" => "true",
  1345.                                "type" => "select"),
  1346.    
  1347.  
  1348.                     array(
  1349.                             "name"  => __("Select Product Categories",'rt_theme_admin'),
  1350.                             "desc"  => __("You can filter posts by selecting categories from this list. If you don't select one, all product posts will be displayed.",'rt_theme_admin'),
  1351.                             "id"    => $theTemplateID.'_'.$theGroupID."_product_box[categories][]",
  1352.                             "options" => RTTheme::rt_get_product_categories(),
  1353.                             "purpose" => "sidebar",
  1354.                             "type"  => "selectmultiple",
  1355.                             "class" => $randomClass,
  1356.                             "default"   => $categories),
  1357.                    
  1358.                     array(
  1359.                             "name"  => __("OrderBy Parameter",'rt_theme_admin'),
  1360.                             "desc"  => __("sort your portfolio by this parameter",'rt_theme_admin'),
  1361.                             "id" => $theTemplateID.'_'.$theGroupID."_product_box[list_orderby]",
  1362.                             "options" => array('author'=>'Author','date'=>'Date','title'=>'Title','modified'=>'Modified','ID'=>'ID','rand'=>'Randomized'),                 
  1363.                             "hr"        => true,
  1364.                             "value" => $list_orderby,
  1365.                             "default"   => "date",
  1366.                             "dont_save" => true,
  1367.                             "type"  => "select"),
  1368.            
  1369.                     array(
  1370.                             "name"  => __("Order",'rt_theme_admin'),
  1371.                             "desc"  => __("Designates the ascending or descending order of the ORDERBY parameter",'rt_theme_admin'),
  1372.                             "id" => $theTemplateID.'_'.$theGroupID."_product_box[list_order]",
  1373.                             "options" => array('ASC'=>'Ascending','DESC'=>'Descending'),
  1374.                             "value" => $list_order,
  1375.                             "default"   => "DESC",
  1376.                             "dont_save" => true,
  1377.                             "hr"        => true,                   
  1378.                             "type"  => "select"),
  1379.    
  1380.                     array(
  1381.                         "name"  => __("Amount of product post per page",'rt_theme_admin'),
  1382.                         "desc"  => __("How many product do you want to display per page?",'rt_theme_admin'),
  1383.                         "id"    => $theTemplateID.'_'.$theGroupID."_product_box[item_per_page]",
  1384.                         "min"   => "1",
  1385.                         "max"   => "200",
  1386.                         "class" => $randomClass,
  1387.                         "value" => $item_per_page,
  1388.                         "default"   => "9",
  1389.                         "dont_save" => true,
  1390.                         "hr"        => true,
  1391.                         "type"  => "rangeinput"),
  1392.            
  1393.                     array(
  1394.                                "name"   => __("Content Layout",'rt_theme_admin'),
  1395.                                "desc"   => __("Please select a layout for the contents that will be displayed in this column.",'rt_theme_admin'),
  1396.                                "id" => $theTemplateID.'_'.$theGroupID."_product_box[item_width]",
  1397.                                "options" => array(
  1398.                                                     5 => "1/5",
  1399.                                                     4 => "1/4",
  1400.                                                     3 => "1/3",
  1401.                                                     2 => "1/2",
  1402.                                                     1 => "1/1"                                 
  1403.                                             ),
  1404.                                "default"=>"1",
  1405.                                "value"=>$item_width,
  1406.                                "hr" => "true",
  1407.                                "type" => "select"),
  1408.                    
  1409.                     array(
  1410.                             "name"  => __("Box Border",'rt_theme_admin'),
  1411.                             "desc"      => __('adds a border around all the product posts if the "Full Width" is NOT selected as "Column Width".','rt_theme_admin'),
  1412.                             "id"    => $theTemplateID.'_'.$theGroupID."_product_box[box_border]",
  1413.                             "type"  => "checkbox",
  1414.                             "class" => $randomClass,
  1415.                             "value" => $box_border,                            
  1416.                             "hr"        => true,
  1417.                             "default"   => "off",
  1418.                             "std"   => "false"),
  1419.                    
  1420.                     array(
  1421.                             "name"  => __("Pagination",'rt_theme_admin'),
  1422.                             "desc"  => __("Adds page navigation under the product posts.",'rt_theme_admin'),
  1423.                             "id"    => $theTemplateID.'_'.$theGroupID."_product_box[pagination]",
  1424.                             "type"  => "checkbox",
  1425.                             "class" => $randomClass,
  1426.                             "value" => $pagination,                            
  1427.                             "hr"        => true,
  1428.                             "default"   => "off",
  1429.                             "std"   => "false"),
  1430.  
  1431.                     array(
  1432.                             "name" => __("delete",'rt_theme_admin'),
  1433.                             "id" => "_delete",
  1434.                             "class" => "deleteButton template_box_delete",
  1435.                             "purpose" => "page_template",
  1436.                             "type" => "button"),
  1437.                    
  1438.                     array(
  1439.                             "name" => __("close",'rt_theme_admin'),
  1440.                             "id" => "_close",
  1441.                             "class" => "closeButton template_box_close",
  1442.                             "purpose" => "page_template",
  1443.                             "type" => "button"),           
  1444.                    
  1445.                     );
  1446.                        
  1447.            
  1448.             echo  $this->rt_generate_forms($options);
  1449.            
  1450.             echo  '</div></div></div></li>';
  1451.            
  1452.            
  1453.     }
  1454.    
  1455.    
  1456.     function rt_generate_homepage_box($theGroupID,$theTemplateID,$options,$randomClass){
  1457.  
  1458.  
  1459.             $boxName        = __("Home Page Post", "rt_theme_admin");
  1460.             $contet_type    = "home_page_content";
  1461.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1462.            
  1463.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1464.            
  1465.             $opacity        = 1;
  1466.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1467.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1468.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;
  1469.             $content_id = $isNewBox ? ''            :   $options['content_id']  ;
  1470.            
  1471.        
  1472.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1473.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1474.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1475.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1476.            
  1477.             $options = array (
  1478.  
  1479.                     array(
  1480.                                "name" => __("Select Box Size",'rt_theme_admin'),
  1481.                                "desc" => __("Please select a box size for the content.",'rt_theme_admin'),
  1482.                                "id" => $theTemplateID.'_'.$theGroupID."_home_page_box[]",
  1483.                                "options" => array(
  1484.                                                     "one"       =>      "Full Width",
  1485.                                                     "two"       =>      "1:2 - One Second",
  1486.                                                     "three"     =>      "1:3 - One Third",
  1487.                                                     "four"      =>      "1:4 - One Fourth",
  1488.                                                     "five"      =>      "1:5 - One Fifth",
  1489.                                                     "two-three" =>      "2:3 - Second Third",
  1490.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1491.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1492.                                             ),
  1493.                                "default"=>"one",
  1494.                                "value"=>$layout,
  1495.                                "class"=>"layout_selector",
  1496.                                "hr" => "true",
  1497.                                "type" => "select"
  1498.                     ),
  1499.                    
  1500.                    
  1501.                     array(
  1502.                                "name" => __("Select Box Content",'rt_theme_admin'),
  1503.                                "desc" => __("Please select a home page post for this box.",'rt_theme_admin'),
  1504.                                "id" => $theTemplateID.'_'.$theGroupID."_home_page_box[]",
  1505.                                "options" => RTTheme::rt_get_homecontents(),
  1506.                                "class"=>$randomClass,
  1507.                                "value"=>$content_id,
  1508.                                "hr" => "true",
  1509.                                "type" => "select",
  1510.                     ),
  1511.            
  1512.            
  1513.                     array(
  1514.                             "name" => __("delete",'rt_theme_admin'),
  1515.                             "id" => "_delete",
  1516.                             "class" => "deleteButton template_box_delete",
  1517.                             "purpose" => "page_template",
  1518.                             "type" => "button",
  1519.                     ),
  1520.  
  1521.                     array(
  1522.                             "name" => __("close",'rt_theme_admin'),
  1523.                             "id" => "_close",
  1524.                             "class" => "closeButton template_box_close",
  1525.                             "purpose" => "page_template",
  1526.                             "type" => "button"
  1527.                     ),                 
  1528.                     );
  1529.                    
  1530.            
  1531.             echo  $this->rt_generate_forms($options);
  1532.            
  1533.             echo  '</div></div></div></li>';
  1534.  
  1535.     }  
  1536.  
  1537.  
  1538.  
  1539.     function rt_generate_sidebar_box($theGroupID,$theTemplateID,$options,$randomClass){
  1540.             global $UserSidebarIDs;
  1541.  
  1542.             $boxName        = __("Sidebar", "rt_theme_admin");
  1543.             $contet_type    = "sidebar_box";
  1544.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1545.            
  1546.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1547.            
  1548.             $opacity            = 1;
  1549.             $layout         = $isNewBox ? 'full expanded"':     $options['layout']          ;  
  1550.             $position           = $isNewBox ? 'open minus'  :   'plus'                  ;
  1551.             $data_position      = $isNewBox ? ''            :   'display: none;'            ;
  1552.             $sidebar_id     = $isNewBox ? ''            :   $options['sidebar_id']      ;
  1553.             $widget_box_width   = $isNewBox ? ''            :   $options['widget_box_width']    ;
  1554.             $widget_border      = $isNewBox ? ''            :   $options['widget_border']   ;
  1555.            
  1556.        
  1557.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1558.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1559.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1560.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1561.            
  1562.             $options = array (
  1563.  
  1564.                     array(
  1565.                                "desc" => __("This module displays a sidebar (widget area) according the options below.",'rt_theme_admin'),   
  1566.                                "hr" => "true",
  1567.                                "type" => "info_text_only",
  1568.                     ),
  1569.                    
  1570.                     array(
  1571.                                "name" => __("Column Width",'rt_theme_admin'),
  1572.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  1573.                                "id" => $theTemplateID.'_'.$theGroupID."_sidebar_box[]",
  1574.                                "options" => array(
  1575.                                                     "one"       =>      "Full Width",
  1576.                                                     "two"       =>      "1:2 - One Second",
  1577.                                                     "three"     =>      "1:3 - One Third",
  1578.                                                     "four"      =>      "1:4 - One Fourth",
  1579.                                                     "five"      =>      "1:5 - One Fifth",
  1580.                                                     "two-three" =>      "2:3 - Second Third",
  1581.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1582.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1583.                                             ),
  1584.                                "default"=>"one",
  1585.                                "value"=>$layout,
  1586.                                "class"=>"layout_selector",
  1587.                                "hr" => "true",
  1588.                                "type" => "select"
  1589.                     ),
  1590.  
  1591.                     array(
  1592.                                "name" => __("Select Sidebar (Widget Area)",'rt_theme_admin'),
  1593.                                "desc" => __("select the sidebar you want to display in this module.",'rt_theme_admin'),
  1594.                                "id" => $theTemplateID.'_'.$theGroupID."_sidebar_box[]",
  1595.                                "options" => $UserSidebarIDs->sidebars,
  1596.                                "class"=>$randomClass,
  1597.                                "value"=>$sidebar_id,
  1598.                                "hr" => "true",
  1599.                                "type" => "select",
  1600.                     ),
  1601.  
  1602.                     array(
  1603.                                "name" => __("Select Widgets Size",'rt_theme_admin'),
  1604.                                "desc" => __("Please select a layout for the widgets that will be displayed in this column.",'rt_theme_admin'),
  1605.                                "id" => $theTemplateID.'_'.$theGroupID."_sidebar_box[]",
  1606.                                "options" => array(
  1607.                                                     5 => "1/5",
  1608.                                                     4 => "1/4",
  1609.                                                     3 => "1/3",
  1610.                                                     2 => "1/2",
  1611.                                                     1 => "1/1"                                 
  1612.                                             ),
  1613.                                "default"=>"1",
  1614.                                "value"=>$widget_box_width,
  1615.                                "hr" => "true",
  1616.                                "type" => "select"
  1617.                     ),
  1618.  
  1619.                     array(
  1620.                             "name"  => __("Box Border",'rt_theme_admin'),
  1621.                             "desc"  => __('adds a border each widget if the "Full Width" selected as the column with, otherwise adds a border for the column only.','rt_theme_admin'),
  1622.                             "id"    => $theTemplateID.'_'.$theGroupID."_sidebar_box[]",
  1623.                             "type"  => "checkbox",
  1624.                             "class" => $randomClass,
  1625.                             "value" => $widget_border,                         
  1626.                             "hr"        => true,
  1627.                             "default"   => "off",
  1628.                             "std"   => "false"),                   
  1629.  
  1630.                     array(
  1631.                             "name" => __("delete",'rt_theme_admin'),
  1632.                             "id" => "_delete",
  1633.                             "class" => "deleteButton template_box_delete",
  1634.                             "purpose" => "page_template",
  1635.                             "type" => "button",
  1636.                     ),
  1637.  
  1638.                     array(
  1639.                             "name" => __("close",'rt_theme_admin'),
  1640.                             "id" => "_close",
  1641.                             "class" => "closeButton template_box_close",
  1642.                             "purpose" => "page_template",
  1643.                             "type" => "button"),
  1644.                     );
  1645.  
  1646.  
  1647.             echo  $this->rt_generate_forms($options);
  1648.  
  1649.             echo  '</div></div></div></li>';
  1650.  
  1651.     }
  1652.  
  1653.  
  1654.  
  1655.     function rt_generate_google_map($theGroupID,$theTemplateID,$options,$randomClass){
  1656.  
  1657.  
  1658.             $boxName        = __("Google Map", "rt_theme_admin");
  1659.             $contet_type    = "google_map";
  1660.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1661.            
  1662.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1663.            
  1664.             $opacity        = 1;
  1665.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1666.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1667.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;    
  1668.        
  1669.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1670.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1671.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1672.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1673.            
  1674.             $options = array (
  1675.                    
  1676.                     array(
  1677.                                "desc"   => __("You can use this module to display a Google Map.",'rt_theme_admin'),  
  1678.                                "hr"         => "true",
  1679.                                "type"   => "info_text_only"),
  1680.  
  1681.                    
  1682.                     array(
  1683.                                "name" => __("Column Width",'rt_theme_admin'),
  1684.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  1685.                                "id" => $theTemplateID.'_'.$theGroupID."_google_map[layout]",
  1686.                                "options" => array(
  1687.                                                     "one"       =>      "Full Width",
  1688.                                                     "two"       =>      "1:2 - One Second",
  1689.                                                     "three"     =>      "1:3 - One Third",
  1690.                                                     "four"      =>      "1:4 - One Fourth",
  1691.                                                     "five"      =>      "1:5 - One Fifth",
  1692.                                                     "two-three" =>      "2:3 - Second Third",
  1693.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1694.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1695.                                             ),
  1696.                                "default"=>"one",
  1697.                                "value"=>$layout,
  1698.                                "class"=>"layout_selector",
  1699.                                "hr" => "true",
  1700.                                "type" => "select"
  1701.                     ),
  1702.  
  1703.                     array(
  1704.                             "name"      => __("Map URL",'rt_theme_admin'),
  1705.                             "desc"      => __('You can generate your own map code from <a href="http://maps.google.com">http://maps.google.com</a>  Find your address on the map, then click the link icon top of the Google Maps page and copy the embed code from the "Paste HTML to embed in website" field. If you customize the map, your height and width values will be ignored. You can choose a map height from the option below.','rt_theme_admin'),                         
  1706.                             "id"        => $theTemplateID.'_'.$theGroupID."_google_map[map_url]",
  1707.                             "value"     => $options["map_url"],                        
  1708.                             "type"      => "textarea"
  1709.                     ),     
  1710.  
  1711.                     array(
  1712.                             "name"      => __("Height of the map",'rt_theme_admin'),
  1713.                             "id"        => $theTemplateID.'_'.$theGroupID."_google_map[height]",
  1714.                             "hr"        => "true",
  1715.                             "min"       =>"1",
  1716.                             "max"       =>"800",
  1717.                             "default"       =>"200",
  1718.                             "hr"            => true,
  1719.                             "dont_save" => true,
  1720.                             "value"     => $options["height"],
  1721.                             "class"     => $randomClass,
  1722.                             "type"      => "rangeinput"),
  1723.  
  1724.                    
  1725.                     array(
  1726.                             "name" => __("delete",'rt_theme_admin'),
  1727.                             "id" => "_delete",
  1728.                             "class" => "deleteButton template_box_delete",
  1729.                             "purpose" => "page_template",
  1730.                             "type" => "button",
  1731.                     ),
  1732.  
  1733.  
  1734.                     array(
  1735.                             "name" => __("close",'rt_theme_admin'),
  1736.                             "id" => "_close",
  1737.                             "class" => "closeButton template_box_close",
  1738.                             "purpose" => "page_template",
  1739.                             "type" => "button",
  1740.                     )
  1741.                    
  1742.                                        
  1743.                     );
  1744.                    
  1745.            
  1746.             echo  $this->rt_generate_forms($options);
  1747.            
  1748.             echo  '</div></div></div></li>';
  1749.  
  1750.     }
  1751.  
  1752.  
  1753.     function rt_generate_contact_form($theGroupID,$theTemplateID,$options,$randomClass){
  1754.  
  1755.  
  1756.             $boxName        = __("Contact Form", "rt_theme_admin");
  1757.             $contet_type    = "contact_form";
  1758.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1759.            
  1760.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1761.            
  1762.             $opacity        = 1;
  1763.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1764.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1765.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;    
  1766.        
  1767.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1768.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1769.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1770.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1771.            
  1772.             $options = array (
  1773.                     array(
  1774.                                "desc" => __("You can use this module to add a contact form.",'rt_theme_admin'),  
  1775.                                "hr" => "true",
  1776.                                "type" => "info_text_only",
  1777.                     ),
  1778.                    
  1779.                     array(
  1780.                                "name" => __("Select Column Width",'rt_theme_admin'),
  1781.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  1782.                                "id" => $theTemplateID.'_'.$theGroupID."_contact_form[layout]",
  1783.                                "options" => array(
  1784.                                                     "one"       =>      "Full Width",
  1785.                                                     "two"       =>      "1:2 - One Second",
  1786.                                                     "three"     =>      "1:3 - One Third",
  1787.                                                     "four"      =>      "1:4 - One Fourth",
  1788.                                                     "five"      =>      "1:5 - One Fifth",
  1789.                                                     "two-three" =>      "2:3 - Second Third",
  1790.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1791.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1792.                                             ),
  1793.                                "default"=>"one",
  1794.                                "value"=>$layout,
  1795.                                "class"=>"layout_selector",
  1796.                                "hr" => "true",
  1797.                                "type" => "select"
  1798.                     ),
  1799.  
  1800.                    
  1801.                     array(
  1802.                             "name" => __("Module Title",'rt_theme_admin'),
  1803.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_form[title]",
  1804.                             "value"=>$options['title'],
  1805.                             "type" => "text"),
  1806.  
  1807.                     array(
  1808.                             "name"      => __("Description",'rt_theme_admin'),
  1809.                             "id"        => $theTemplateID.'_'.$theGroupID."_contact_form[description]",
  1810.                             "value"     => $options["description"],                        
  1811.                             "type"      => "textarea"
  1812.                     ),                         
  1813.        
  1814.                     array(
  1815.                             "name"  => __("Contact Form Email",'rt_theme_admin'),
  1816.                             "desc"  => __("the contact form will be submited this email",'rt_theme_admin'),
  1817.                             "id"    => $theTemplateID.'_'.$theGroupID."_contact_form[email]",
  1818.                             "default"   => get_option('admin_email'),
  1819.                             "dont_save"=> true,
  1820.                             "value" =>$options['email'],
  1821.                             "type"  => "text"),
  1822.  
  1823.                     array(
  1824.                             "name"  => __("OR",'rt_theme_admin'),
  1825.                             "type"  => "heading"),
  1826.        
  1827.                     array(
  1828.                             "name"  => __("3rd Party Contact Form Plugin",'rt_theme_admin'),
  1829.                             "desc"  => __('You are free to use 3rd party contact form plugins on the contact box. There are great contact form plugins on the <a href="http://wordpress.org/extend/plugins/">WordPress plugins page</a> like <a href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a>. Paste the plugin shortcode in the box below to use it instead of the default form.','rt_theme_admin'),
  1830.                             "id"    => $theTemplateID.'_'.$theGroupID."_contact_form[shortcode]",
  1831.                             "value" =>$options['shortcode'],
  1832.                             "type"  => "textarea"),          
  1833.        
  1834.                     array(
  1835.                             "name"  => __("STYLING",'rt_theme_admin'),
  1836.                             "type"  => "heading"),
  1837.        
  1838.                     array(
  1839.                             "name"  => __("Box Border",'rt_theme_admin'),
  1840.                             "desc"  => __('adds a border for this module.','rt_theme_admin'),
  1841.                             "id"    => $theTemplateID.'_'.$theGroupID."_contact_form[box_border]",
  1842.                             "type"  => "checkbox",
  1843.                             "class" => $randomClass,
  1844.                             "value" => $options['box_border'],                         
  1845.                             "hr"        => true,
  1846.                             "default"   => "off",
  1847.                             "std"   => "false"),
  1848.                    
  1849.                     array(
  1850.                             "name" => __("delete",'rt_theme_admin'),
  1851.                             "id" => "_delete",
  1852.                             "class" => "deleteButton template_box_delete",
  1853.                             "purpose" => "page_template",
  1854.                             "type" => "button",
  1855.                     ),
  1856.  
  1857.  
  1858.                     array(
  1859.                             "name" => __("close",'rt_theme_admin'),
  1860.                             "id" => "_close",
  1861.                             "class" => "closeButton template_box_close",
  1862.                             "purpose" => "page_template",
  1863.                             "type" => "button",
  1864.                     )
  1865.                    
  1866.                                        
  1867.                     );
  1868.                    
  1869.            
  1870.             echo  $this->rt_generate_forms($options);
  1871.            
  1872.             echo  '</div></div></div></li>';
  1873.  
  1874.     }
  1875.  
  1876.     function rt_generate_contact_info_box($theGroupID,$theTemplateID,$options,$randomClass){
  1877.  
  1878.  
  1879.             $boxName        = __("Contact Info", "rt_theme_admin");
  1880.             $contet_type    = "contact_info_box";
  1881.             $theTemplateID = str_replace('_'.$contet_type,'',$theTemplateID);
  1882.            
  1883.             $isNewBox = (trim($randomClass)=="") ? false : true;
  1884.            
  1885.             $opacity        = 1;
  1886.             $layout     = $isNewBox ? 'full expanded"':     $options['layout']      ;
  1887.             $position       = $isNewBox ? 'open minus'  :   'plus'              ;
  1888.             $data_position  = $isNewBox ? ''            :   'display: none;'        ;    
  1889.        
  1890.             echo  '<li class="ui-state-default '.$layout.'" style="opacity:'.$opacity.';">';
  1891.             echo  '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>'.$boxName.'</h5>';
  1892.             echo     '<div class="expand '.$position.'"></div><div class="move"></div></div> <div class="ItemData" style="'.$data_position.'">';
  1893.             echo  '<input type="hidden" name="theTemplateID_'.$theGroupID.'" value="'.$theTemplateID.'"><input type="hidden" name="theGroupID_'.$theGroupID.'" value="'.$theGroupID.'"><input type="hidden" name="source_type_'.$theGroupID.'" value="'.$contet_type.'">';
  1894.            
  1895.             $options = array (
  1896.                     array(
  1897.                                "desc" => __("You can use this module to add your contact details with icons.",'rt_theme_admin'),     
  1898.                                "hr" => "true",
  1899.                                "type" => "info_text_only",
  1900.                     ),
  1901.                    
  1902.                     array(
  1903.                                "name" => __("Select Column Width",'rt_theme_admin'),
  1904.                                "desc" => __("Please select a column size for this module.",'rt_theme_admin'),
  1905.                                "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[layout]",
  1906.                                "options" => array(
  1907.                                                     "one"       =>      "Full Width",
  1908.                                                     "two"       =>      "1:2 - One Second",
  1909.                                                     "three"     =>      "1:3 - One Third",
  1910.                                                     "four"      =>      "1:4 - One Fourth",
  1911.                                                     "five"      =>      "1:5 - One Fifth",
  1912.                                                     "two-three" =>      "2:3 - Second Third",
  1913.                                                     "three-four"    =>      "3:4 - Third Fourth",
  1914.                                                     "four-five" =>      "4:5 - Four Fifth",                                        
  1915.                                             ),
  1916.                                "default"=>"one",
  1917.                                "value"=>$layout,
  1918.                                "class"=>"layout_selector",
  1919.                                "hr" => "true",
  1920.                                "type" => "select"
  1921.                     ),
  1922.  
  1923.                     array(
  1924.                             "name" => __("Module Title",'rt_theme_admin'),
  1925.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[contact_title]",
  1926.                             "hr" => "true",
  1927.                             "value"=>$options["contact_title"],
  1928.                             "type" => "text"),
  1929.                    
  1930.                     array(
  1931.                             "name" => __("Text",'rt_theme_admin'),
  1932.                             "desc" => __("adds a text before the contact details.",'rt_theme_admin'),
  1933.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[contact_text]",
  1934.                             "hr" => "true",
  1935.                             "value"=>$options["contact_text"],
  1936.                             "type" => "textarea"),
  1937.                    
  1938.                     array(
  1939.                             "name" => __("Address",'rt_theme_admin'),
  1940.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[address]",
  1941.                             "hr" => "true",
  1942.                             "value"=>$options["address"],
  1943.                             "type" => "textarea"),
  1944.        
  1945.                     array(
  1946.                             "name" => __("Phone",'rt_theme_admin'),
  1947.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[phone]",
  1948.                             "hr" => "true",
  1949.                             "value"=>$options["phone"],
  1950.                             "type" => "text"),
  1951.        
  1952.                     array(
  1953.                             "name" => __("Email",'rt_theme_admin'),
  1954.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[email]",
  1955.                             "hr" => "true",
  1956.                             "value"=>$options["email"],
  1957.                             "type" => "text"),
  1958.        
  1959.                     array(
  1960.                             "name" => __("Support Email",'rt_theme_admin'),
  1961.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[support_email]",
  1962.                             "hr" => "true",
  1963.                             "value"=>$options["support_email"],
  1964.                             "type" => "text"),
  1965.        
  1966.                     array(
  1967.                             "name" => __("Fax",'rt_theme_admin'),
  1968.                             "id" => $theTemplateID.'_'.$theGroupID."_contact_info_box[fax]",
  1969.                             "value"=>$options["fax"],
  1970.                             "type" => "text"),  
  1971.  
  1972.        
  1973.                     array(
  1974.                             "name"      => __("STYLING",'rt_theme_admin'),
  1975.                             "type"      => "heading"),
  1976.        
  1977.                     array(
  1978.                             "name"  => __("Box Border",'rt_theme_admin'),
  1979.                             "desc"  => __('adds a border for this module.','rt_theme_admin'),
  1980.                             "id"    => $theTemplateID.'_'.$theGroupID."_contact_info_box[box_border]",
  1981.                             "type"  => "checkbox",
  1982.                             "class" => $randomClass,
  1983.                             "value" => $options['box_border'],                         
  1984.                             "hr"        => true,
  1985.                             "default"   => "off",
  1986.                             "std"   => "false"),
  1987.                    
  1988.                    
  1989.                     array(
  1990.                             "name" => __("delete",'rt_theme_admin'),
  1991.                             "id" => "_delete",
  1992.                             "class" => "deleteButton template_box_delete",
  1993.                             "purpose" => "page_template",
  1994.                             "type" => "button",
  1995.                     ),
  1996.  
  1997.  
  1998.                     array(
  1999.                             "name" => __("close",'rt_theme_admin'),
  2000.                             "id" => "_close",
  2001.                             "class" => "closeButton template_box_close",
  2002.                             "purpose" => "page_template",
  2003.                             "type" => "button",
  2004.                     )
  2005.                    
  2006.                     );
  2007.                                        
  2008.            
  2009.             echo  $this->rt_generate_forms($options);
  2010.            
  2011.             echo  '</div></div></div></li>';
  2012.  
  2013.     }      
  2014. }
  2015.  
  2016.  
  2017. $RTThemePageLayoutOptionsClass = new RTThemePageLayoutOptions();
  2018. ?>
Advertisement
Add Comment
Please, Sign In to add comment