BackuPs-nl

RT 18 Add Free Tabs

Mar 2nd, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.60 KB | None | 0 0
  1. <?php
  2. #-----------------------------------------
  3. #   RT-Theme product_custom_fields.php
  4. #   version: 1.0
  5. #-----------------------------------------
  6.  
  7. #
  8. #   Portfolio Custom Fields
  9. #
  10.  
  11. /**
  12. * @var  array  $customFields  Defines the custom fields available
  13. */
  14.  
  15. $sample_attachment_code = '
  16. <pre>
  17. File Name or Title | file_url
  18. File Name or Title | file_url
  19. File Name or Title | file_url | new_window
  20. File Name or Title | file_url          
  21. </pre>
  22. ';
  23.  
  24. $customFields = array(
  25.      
  26.  
  27.  
  28.  
  29.     array(   
  30.         "type"    => "group_start",
  31.         "name"    => "_product_tabs",
  32.         "class"   => "vertical_tabs rt_tabs",
  33.     ), 
  34.  
  35.  
  36.             array(   
  37.                 "type"    => "group_start",
  38.                 "name"    => "_product_tabs_titles",
  39.             ),             
  40.  
  41.                     array(   
  42.                         "type"           => "tab_titles",
  43.                         "tab_names"      => array(
  44.                                                 RT_COMMON_THEMESLUG."-product-tab-1"=>array("Product Info","icon-info-circled"),
  45.                                                 RT_COMMON_THEMESLUG."-product-tab-2"=>array("Free Tab 1","icon-pencil"),
  46.                                                 RT_COMMON_THEMESLUG."-product-tab-3"=>array("Free Tab 2","icon-pencil"),
  47.                                                 RT_COMMON_THEMESLUG."-product-tab-4"=>array("Free Tab 3","icon-pencil"),
  48.                                                 RT_COMMON_THEMESLUG."-product-tab-5"=>array("Free Tab 4","icon-pencil"),
  49.                                                 RT_COMMON_THEMESLUG."-product-tab-8"=>array("Free Tab 5","icon-pencil"),
  50.                                                 RT_COMMON_THEMESLUG."-product-tab-9"=>array("Free Tab 6","icon-pencil"),
  51.                                                 RT_COMMON_THEMESLUG."-product-tab-6"=>array("Related Products","icon-link"),                                               
  52.                                                 RT_COMMON_THEMESLUG."-product-tab-7"=>array("Attached Documents","icon-docs"),
  53.                                         ),
  54.                     ),
  55.  
  56.             array(   
  57.                 "type"    => "group_end"
  58.             ),             
  59.  
  60.  
  61.  
  62.  
  63.             array(   
  64.                 "type"    => "group_start",
  65.                 "name"    => "-product-tab-1",
  66.             ), 
  67.  
  68.                     array(
  69.                         "description"   => __('Product Information. Note : A Product can have more then one  Gallery image attached to it. The moment more then one (1) image is added to the product they will be shown as a gallery in the single product page.','rt_theme_admin'),                  
  70.                         "type"          => "info_text_only",
  71.                         "hr"            => "true",
  72.                     ),         
  73.            
  74.                     array(
  75.                         "name"          => "sku",
  76.                         "title"         => __('SKU','rt_theme_admin'),
  77.                         "type"          => "inline_text",
  78.                         "description"   => __("Stock Keeping Unit : Enter the productnumber which your company uses internally to keep track of this product, it's stock, it's location etc.",'rt_theme_admin'),
  79.                         "hr"            => true
  80.                     ),  
  81.  
  82.                     array(
  83.                         "name"          => "price_regular",
  84.                         "description"   => __('Regular Price : Enter the normal/regular price at which the product is sold. No discount offer.','rt_theme_admin'),
  85.                         "title"         => __('Regular Price','rt_theme_admin'),
  86.                         "type"          => "inline_text",
  87.                     ),  
  88.  
  89.                     array(
  90.                         "name"          => "sale_price",
  91.                         "title"         => __("Sale Price",'rt_theme_admin'),                      
  92.                         "description"   => __("Sale Price : Enter the discount price at which the product now is being sold during the discount period (NOTE : don't forget to remove the discount price after the discount period is over).",'rt_theme_admin'),
  93.                         "type"          => "inline_text",
  94.                         "hr"            => true
  95.                     ),  
  96.  
  97.                     array(
  98.                         "name"          => "short_description",
  99.                         "title"         => __("Short Description",'rt_theme_admin'),
  100.                         "description"   => __('The Product Short description : Enter a short description for this product. The short description will be shown in : <br /><br />1) The Single Product page on the right side of the product image or slider below the product price.<br />2) The Product Listing Pages <br />3) Product Category Listing Pages<br /><br />Any valid HTML is allowed. ','rt_theme_admin'),
  101.                         "type"          => "textarea"
  102.                     ),  
  103.  
  104.  
  105.             array(   
  106.                 "type"    => "group_end"
  107.             ),             
  108.  
  109.  
  110.             //Related Product
  111.             array(   
  112.                 "type"    => "group_start",
  113.                 "name"    => "-product-tab-6",
  114.             ), 
  115.  
  116.                 array(
  117.                     "description"   => __('Related Products: Select the products to be listed as related products to this product. They will appear below the single product content or in a tab when tabbed layout is activated.','rt_theme_admin'),                  
  118.                     "type"          => "info_text_only",
  119.                     "hr"            => "true",
  120.                 ),         
  121.            
  122.                 array(
  123.                     "title"         => __("Select Related Products",'rt_theme_admin'),
  124.                     "description"   => __('Select and add a related product one by one by selecting and clicking on the listed products in the dropdown list. A added related product can be removed again by clicking the "x" at the end of the line of each related product which has been added. Related products will only show one product image in the single product page. If a related product has more then one image attached to it they will not be shown as a slider in the single product related products section.','rt_theme_admin'),
  125.                     "name"          => "related_products[]",
  126.                     "options"       => RTTheme::rt_get_products(),
  127.                     "select"        => __("Select products",'rt_theme_admin'),
  128.                     "type"          => "selectmultiple"
  129.                 ),
  130.  
  131.             array(   
  132.                 "type"    => "group_end"
  133.             ), 
  134.  
  135.  
  136.  
  137.  
  138.             //Attached Documents
  139.             array(   
  140.                 "type"    => "group_start",
  141.                 "name"    => "-product-tab-7",
  142.             ),                 
  143.                  
  144.                 array(
  145.                     "description"   => __('Product Attachments : To each product multiple attachments can be added. Multiple attachments are allowed. Per attachment one can set : <br /><br /><strong>1) The Title or Filename</strong>,<br />2) <strong>The Url to the attachment</strong>,<br />3)<strong> The Target</strong> (Set the target if the attachment should open in a new window. Default it will open in the same parent window).<br /><br />A delimiter "|" is required to split The Title/Filename, The URL and the Target information. Example;','rt_theme_admin').$sample_attachment_code,                 
  146.                     "type"          => "info_text_only",
  147.                     "hr"            => "true",
  148.                 ),               
  149.                  
  150.                 array(
  151.                     "name"          => "attached_documents",
  152.                     "title"         => __("Attached Files", 'rt_theme_admin'),
  153.                     "description"   => __('Use one line per attachment. Use a delimiter "|" to add and split The Title, The URL and the Target information.<br /><br /><pre style=\"font-style:normal;\">For example: <br /><br /><strong>File Name or Title|http://file_url</strong> (Only Filename / Title and URL to the attachment are set)<br /><br /><strong>File Name or Title|http://file_url|_blank</strong> (Filename / Title, URL and Target are set)<br /><br /><strong>|http://file_url|_blank</strong> (No Filename / Title, the delimiter is still added!, URL and Target are set only.)<br /><br />Note : <strong>If no Filename / Title is required one still needs to add a delimiter / splitter to tell the code that it needs to skip the title.</strong></pre><br />More info on the target directive can be found here : <a href="http://www.w3schools.com/tags/att_a_target.asp" target="_blank"><strong>W3School A-Tag Target</strong></a>','rt_theme_admin'),
  154.                     "type"          => "textarea"
  155.                 ),
  156.  
  157.  
  158.             array(   
  159.                 "type"    => "group_end"
  160.             ), 
  161.  
  162.  
  163.  
  164.  
  165.             //Free Tab 1
  166.             array(   
  167.                 "type"    => "group_start",
  168.                 "name"    => "-product-tab-2",
  169.             ), 
  170.  
  171.                 array(
  172.                     "description"   => __("Free Tab : Each product can have one to four tabs with any information of choice. They are called Free Tabs. The moment one or more Free Tabs are used the complete single product page changes to a tabbed layout. <br /><br />1) The normal product information content goes into a tab called 'General Details',<br />2) The Attachments go into a tab called 'Attachments',<br />3) The Related Products go into a Tab called 'Related Products'<br />4) The Comments go into a tab called 'Comments'.<br /><br />The Free Tabs are also added. Each one shown with its own title and content as set below in the free tab settings. <br /><br />The titles of the <strong>default product tabs</strong> (not the free tabs) can be changed by the use of the default language file that comes with the theme and a program called <a href='http://www.poedit.net/' target='_blank'>PoEdit</a>. This is called localizing the theme. Even if your native language is English you can create your own language file and change the wording used in the tabs. Follow the <a href='http://codex.wordpress.org/WordPress_in_Your_Language' target='_blank'> wordpress codex</a> on this on the how to <a href='http://codex.wordpress.org/Translating_WordPress' target='_blank'>localize your theme</a>. You can change/translated any text string used in the frontend of your website. All the frontend website strings are available for translation in the default language file which is included in the package and which can be found in the RtThemeXX/languages folder.",'rt_theme_admin'),                
  173.                     "type"          => "info_text_only",
  174.                     "hr"            => "true",
  175.                 ),     
  176.            
  177.                 array(
  178.                     "name"          => "free_tab_1_title",
  179.                     "title"         => __("#1 - Free Tab Name ", 'rt_theme_admin'),
  180.                     "description"   => __('Free Tab Title : Enter the tab title to identify and select the tab. The tab title is shown above the tab content.','rt_theme_admin'),                                                      
  181.                     "type"          => "inline_text"
  182.                 ),
  183.  
  184.                 array(
  185.                     "name"          => "free_tab_1_icon",
  186.                     "title"         => __("#1 - Free Tab Icon ", 'rt_theme_admin'),
  187.                     "description"   => __('Free Tab Icon: Choose a Icon to show before the Free Tab Title making identifying the tab more easier, but also gives the tab a nicer look and feel.','rt_theme_admin'),                                                                        
  188.                     "type"          => "inline_text",
  189.                     "class"         => "icon_selection",
  190.                     "hr"            => "true"
  191.                 ),
  192.  
  193.                 array(
  194.                     "name"          => "free_tab_1_content",
  195.                     "title"         => __("#1 - Free Tab Content", 'rt_theme_admin'),
  196.                     "description"   => __("Free Tab Content : Enter the content that should be shown when the tab is activated/clicked upon. Any valid html, shortcode containing a image, slider or video, etc. is allowed.",'rt_theme_admin'),                                                                           
  197.                     "type"          => "textarea",
  198.                     "richeditor"    => "true",
  199.                     "label_position"=> "block"     
  200.                 ),
  201.  
  202.  
  203.             array(   
  204.                 "type"    => "group_end"
  205.             ), 
  206.  
  207.  
  208.  
  209.             //Free Tab 2       
  210.             array(   
  211.                 "type"    => "group_start",
  212.                 "name"    => "-product-tab-3",
  213.             ), 
  214.            
  215.                 array(
  216.                     "description"   => __('Free Tab : Each product can have one to four tabs with any information of choice. They are called Free Tabs. For more detailed information click on the <strong>Free Tab 1</strong>.','rt_theme_admin'),                
  217.                     "type"          => "info_text_only",
  218.                     "hr"            => "true",
  219.                 ),         
  220.  
  221.                 array(
  222.                     "name"          => "free_tab_2_title",
  223.                     "title"         => __("#2 - Free Tab Name ", 'rt_theme_admin'),
  224.                     "description"   => __('Free Tab Title : Enter the tab title to identify and select the tab. The tab title is shown above the tab content.','rt_theme_admin'),                                                      
  225.                     "type"          => "inline_text"
  226.                 ),
  227.      
  228.                 array(
  229.                     "name"          => "free_tab_2_icon",
  230.                     "title"         => __("#2 - Free Tab Icon ", 'rt_theme_admin'),
  231.                     "description"   => __('Free Tab Icon: Choose a Icon to show before the Free Tab Title making identifying the tab more easier, but also gives the tab a nicer look and feel.','rt_theme_admin'),                                                                                            
  232.                     "type"          => "inline_text",
  233.                     "class"         => "icon_selection",
  234.                     "hr"            => "true"
  235.                 ),
  236.      
  237.                 array(
  238.                     "name"          => "free_tab_2_content",
  239.                     "title"         => __("#2 - Free Tab Content", 'rt_theme_admin'),
  240.                     "description"   => __("Free Tab Content : Enter the content that should be shown when the tab is activated/clicked upon. Any valid html, shortcode containing a image, slider or video, etc. is allowed.",'rt_theme_admin'),                                                                                               
  241.                     "type"          => "textarea",
  242.                     "richeditor"    => "true",
  243.                     "label_position"=> "block"         
  244.                 ),
  245.  
  246.      
  247.             array(   
  248.                 "type"    => "group_end"
  249.             ), 
  250.  
  251.  
  252.  
  253.             //Free Tab 3
  254.             array(   
  255.                 "type"    => "group_start",
  256.                 "name"    => "-product-tab-4",
  257.             ), 
  258.  
  259.                 array(
  260.                     "description"   => __('Free Tab : Each product can have one to four tabs with any information of choice. They are called Free Tabs. For more detailed information click on the <strong>Free Tab 1</strong>.','rt_theme_admin'),                
  261.                     "type"          => "info_text_only",
  262.                     "hr"            => "true",
  263.                 ),         
  264.      
  265.                 array(
  266.                     "name"          => "free_tab_3_title",
  267.                     "title"         => __("#3 - Free Tab Name ", 'rt_theme_admin'),
  268.                     "description"   => __('Free Tab Title : Enter the tab title to identify and select the tab. The tab title is shown above the tab content.','rt_theme_admin'),                                                      
  269.                     "type"          => "inline_text"
  270.                 ),
  271.      
  272.                 array(
  273.                     "name"          => "free_tab_3_icon",
  274.                     "title"         => __("#3 - Free Tab Icon ", 'rt_theme_admin'),
  275.                     "description"   => __('Free Tab Icon: Choose a Icon to show before the Free Tab Title making identifying the tab more easier, but also gives the tab a nicer look and feel.','rt_theme_admin'),                                                                        
  276.                     "type"          => "inline_text",
  277.                     "class"         => "icon_selection",
  278.                     "hr"            => "true"
  279.                 ),
  280.  
  281.                 array(
  282.                     "name"          => "free_tab_3_content",
  283.                     "title"         => __("#3 - Free Tab Content", 'rt_theme_admin'),
  284.                     "description"   => __("Free Tab Content : Enter the content that should be shown when the tab is activated/clicked upon. Any valid html, shortcode containing a image, slider or video, etc. is allowed.",'rt_theme_admin'),                                                                                               
  285.                     "type"          => "textarea",
  286.                     "richeditor"    => "true",
  287.                     "label_position"=> "block"         
  288.                 ),
  289.  
  290.             array(   
  291.                 "type"    => "group_end"
  292.             ), 
  293.  
  294.  
  295.  
  296.             //Free Tab 4
  297.             array(   
  298.                 "type"    => "group_start",
  299.                 "name"    => "-product-tab-5",
  300.             ), 
  301.  
  302.                 array(
  303.                     "description"   => __('Free Tab : Each product can have one to four tabs with any information of choice. They are called Free Tabs. For more detailed information click on the <strong>Free Tab 1</strong>.','rt_theme_admin'),                
  304.                     "type"          => "info_text_only",
  305.                     "hr"            => "true",
  306.                 ),         
  307.  
  308.                 array(
  309.                     "name"          => "free_tab_4_title",
  310.                     "title"         => __("#4 - Free Tab Name ", 'rt_theme_admin'),
  311.                     "description"   => __('Free Tab Title : Enter the tab title to identify and select the tab. The tab title is shown above the tab content.','rt_theme_admin'),                                                      
  312.                     "type"          => "inline_text"
  313.                 ),
  314.      
  315.  
  316.                 array(
  317.                     "name"          => "free_tab_4_icon",
  318.                     "title"         => __("#4 - Free Tab Icon ", 'rt_theme_admin'),
  319.                     "description"   => __('Free Tab Icon: Choose a Icon to show before the Free Tab Title making identifying the tab more easier, but also gives the tab a nicer look and feel.','rt_theme_admin'),                                                                        
  320.                     "type"          => "inline_text",
  321.                     "class"         => "icon_selection",
  322.                     "hr"            => "true"
  323.                 ),
  324.      
  325.                 array(
  326.                     "name"          => "free_tab_4_content",
  327.                     "title"         => __("#4 - Free Tab Content", 'rt_theme_admin'),
  328.                     "description"   => __("Free Tab Content : Enter the content that should be shown when the tab is activated/clicked upon. Any valid html, shortcode containing a image, slider or video, etc. is allowed.",'rt_theme_admin'),                                                                           
  329.                     "type"          => "textarea",
  330.                     "richeditor"    => "true",
  331.                     "label_position"=> "block"         
  332.                 ),
  333.      
  334.             array(   
  335.                 "type"    => "group_end"
  336.             ),
  337.  
  338.             //Free Tab 5
  339.             array(   
  340.                 "type"    => "group_start",
  341.                 "name"    => "-product-tab-8",
  342.             ), 
  343.  
  344.                 array(
  345.                     "description"   => __('Free Tab : Each product can have one to four tabs with any information of choice. They are called Free Tabs. For more detailed information click on the <strong>Free Tab 1</strong>.','rt_theme_admin'),                
  346.                     "type"          => "info_text_only",
  347.                     "hr"            => "true",
  348.                 ),         
  349.  
  350.                 array(
  351.                     "name"          => "free_tab_5_title",
  352.                     "title"         => __("#5 - Free Tab Name ", 'rt_theme_admin'),
  353.                     "description"   => __('Free Tab Title : Enter the tab title to identify and select the tab. The tab title is shown above the tab content.','rt_theme_admin'),                                                      
  354.                     "type"          => "inline_text"
  355.                 ),
  356.      
  357.                 array(
  358.                     "name"          => "free_tab_5_icon",
  359.                     "title"         => __("#5 - Free Tab Icon ", 'rt_theme_admin'),
  360.                     "description"   => __('Free Tab Icon: Choose a Icon to show before the Free Tab Title making identifying the tab more easier, but also gives the tab a nicer look and feel.','rt_theme_admin'),                                                                        
  361.                     "type"          => "inline_text",
  362.                     "class"         => "icon_selection",
  363.                     "hr"            => "true"
  364.                 ),
  365.      
  366.                 array(
  367.                     "name"          => "free_tab_5_content",
  368.                     "title"         => __("#5 - Free Tab Content", 'rt_theme_admin'),
  369.                     "description"   => __("Free Tab Content : Enter the content that should be shown when the tab is activated/clicked upon. Any valid html, shortcode containing a image, slider or video, etc. is allowed.",'rt_theme_admin'),                                                                           
  370.                     "type"          => "textarea",
  371.                     "richeditor"    => "true",
  372.                     "label_position"=> "block"         
  373.                 ),
  374.      
  375.             array(   
  376.                 "type"    => "group_end"
  377.             ),
  378.  
  379.             //Free Tab 6
  380.             array(   
  381.                 "type"    => "group_start",
  382.                 "name"    => "-product-tab-9",
  383.             ), 
  384.  
  385.                 array(
  386.                     "description"   => __('Free Tab : Each product can have one to four tabs with any information of choice. They are called Free Tabs. For more detailed information click on the <strong>Free Tab 1</strong>.','rt_theme_admin'),                
  387.                     "type"          => "info_text_only",
  388.                     "hr"            => "true",
  389.                 ),         
  390.  
  391.                 array(
  392.                     "name"          => "free_tab_6_title",
  393.                     "title"         => __("#6 - Free Tab Name ", 'rt_theme_admin'),
  394.                     "description"   => __('Free Tab Title : Enter the tab title to identify and select the tab. The tab title is shown above the tab content.','rt_theme_admin'),                                                      
  395.                     "type"          => "inline_text"
  396.                 ),
  397.      
  398.  
  399.                 array(
  400.                     "name"          => "free_tab_6_icon",
  401.                     "title"         => __("#6 - Free Tab Icon ", 'rt_theme_admin'),
  402.                     "description"   => __('Free Tab Icon: Choose a Icon to show before the Free Tab Title making identifying the tab more easier, but also gives the tab a nicer look and feel.','rt_theme_admin'),                                                                        
  403.                     "type"          => "inline_text",
  404.                     "class"         => "icon_selection",
  405.                     "hr"            => "true"
  406.                 ),
  407.      
  408.                 array(
  409.                     "name"          => "free_tab_6_content",
  410.                     "title"         => __("#6 - Free Tab Content", 'rt_theme_admin'),
  411.                     "description"   => __("Free Tab Content : Enter the content that should be shown when the tab is activated/clicked upon. Any valid html, shortcode containing a image, slider or video, etc. is allowed.",'rt_theme_admin'),                                                                           
  412.                     "type"          => "textarea",
  413.                     "richeditor"    => "true",
  414.                     "label_position"=> "block"         
  415.                 ),
  416.  
  417.      
  418.             array(   
  419.                 "type"    => "group_end"
  420.             ), 
  421.            
  422.  
  423.     array(   
  424.         "type"    => "group_end"
  425.     ),     
  426.  
  427. );
  428.  
  429. $settings  = array(
  430.     "name"       => RT_THEMENAME ." Product Options",
  431.     "scope"      => "products",
  432.     "slug"       => "product_custom_fields",
  433.     "capability" => "edit_post",
  434.     "context"    => "normal",
  435.     "priority"   => "high"
  436. );
  437.  
  438. ?>
Add Comment
Please, Sign In to add comment