Пример #1
0
 function rt_generate_blog_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Blog Posts", "rt_theme_admin");
     $contet_type = "blog_box";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $categories = $isNewBox ? '' : $options['categories'];
     $pagination = $isNewBox ? '' : $options['pagination'];
     $list_orderby = $isNewBox ? '' : $options['list_orderby'];
     $list_order = $isNewBox ? '' : $options['list_order'];
     $item_per_page = $isNewBox ? '' : $options['item_per_page'];
     $list_layout = isset($options["list_layout"]) ? $options["list_layout"] : "";
     $list_style = isset($options["list_style"]) ? $options["list_style"] : "";
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays a bloglist following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("value" => "one", "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[layout]", "type" => "hidden"), array("type" => "table_start"), array("name" => __("Select Post Categories", 'rt_theme_admin'), "desc" => __("Select and set categories to filter (shorten) the amount of posts presented in the bloglist. If you don't select and set a category, this module will list all blogposts.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[categories][]", "options" => RTTheme::rt_get_categories(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $categories), array("name" => __("Listing Style", 'rt_theme_admin'), "desc" => __('Select and set one of the three available styles for listing the blog posts.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[list_style]", "options" => array('style1' => 'Style One  ( Big Date Boxes )', 'style2' => 'Style Two ( Post Type Icons )', 'style3' => 'Style Three ( Classic ) '), "value" => $list_style, "default" => "style1", "dont_save" => true, "type" => "select"), array("name" => __("Listing Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for listing the blog posts. (<strong>Note</strong> : when used in a column module which is f.e. set to a 1/5 column it is better to set the blog column layout to a 1/1 layout.)', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[list_layout]", "options" => array('one' => 'One Column', 'two' => 'Two Columns', 'three' => 'Three Columns', 'four' => 'Four Columns', 'five' => 'Five Columns'), "value" => $list_layout, "default" => "one", "dont_save" => true, "type" => "select"), array("type" => "td_col"), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the blog posts within the bloglist by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("name" => __("Amount of blog post per page", 'rt_theme_admin'), "desc" => __("Set the amount of posts to display at once per page.<br /><strong>Note</strong> : works in conjunction with the pagination settings.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[item_per_page]", "min" => "1", "max" => "200", "class" => $randomClass, "value" => $item_per_page, "default" => "9", "dont_save" => true, "type" => "rangeinput"), array("name" => __("Pagination", 'rt_theme_admin'), "check_desc" => __("Enable (if checked) the pagination ability for the bloglist.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_blog_box[pagination]", "type" => "checkbox", "class" => $randomClass, "value" => $pagination, "default" => "off", "std" => "false"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #2
0
 function rt_generate_staff_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Staff List", "rt_theme_admin");
     $contet_type = "staff_box";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $ids = isset($options['ids']) ? $options['ids'] : "";
     $list_orderby = isset($options['list_orderby']) ? $options['list_orderby'] : "";
     $list_order = isset($options['list_order']) ? $options['list_order'] : "";
     $style = isset($options['style']) ? $options['style'] : "";
     $item_width = isset($options['item_width']) ? $options['item_width'] : "";
     $values = isset($options['values']) ? $options['values'] : array();
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays a team / staff memberlist from the team / staff post type following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Select Staff (Optional)", 'rt_theme_admin'), "desc" => __("You can filter team / staff members by selecting them from this list. If you don't select individual members, all team / staff members will be listed.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_staff_box[values][ids][]", "options" => RTTheme::rt_get_staff_list(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $ids), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the team / staff member items within the memberlist by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_staff_box[values][list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_staff_box[values][list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("type" => "td_col"), array("name" => __("List Style", 'rt_theme_admin'), "desc" => __('Select and set a style to display the team / staff memberlist.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_staff_box[values][style]", "options" => array("style-one" => "Style One", "style-two" => "Style Two", "style-three" => "Style Three"), "default" => "style-one", "value" => $style, "type" => "select"), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for the team / staff memberlist.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_staff_box[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "1", "value" => $item_width, "type" => "select"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #3
0
 function rt_generate_woo_products_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("WooCommerce Products", "rt_theme_admin");
     $contet_type = "woo_products_box";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $item_width = $isNewBox ? '' : $options['item_width'];
     $pagination = isset($options['pagination']) ? $options['pagination'] : "";
     $categories = isset($options['categories']) ? $options['categories'] : "";
     $list_orderby = $isNewBox ? '' : $options['list_orderby'];
     $list_order = $isNewBox ? '' : $options['list_order'];
     $item_per_page = $isNewBox ? '' : $options['item_per_page'];
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays WooCommerce products following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Select a WooCommerce Product Category", 'rt_theme_admin'), "desc" => __("You need to select a woocommerce product category from the list below. ", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_woo_products_box[categories]", "options" => RTTheme::rt_get_woo_product_categories(), "purpose" => "sidebar", "type" => "select", "class" => $randomClass, "default" => $categories, "value" => $categories), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the woocommerce products within the product list by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_woo_products_box[list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_woo_products_box[list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("type" => "td_col"), array("name" => __("Amount of products", 'rt_theme_admin'), "desc" => __("Set the amount of products to be displayed within this module box.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_woo_products_box[item_per_page]", "min" => "1", "max" => "200", "class" => $randomClass, "value" => $item_per_page, "default" => "9", "dont_save" => true, "type" => "rangeinput"), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for the listed products.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_woo_products_box[item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "1", "value" => $item_width, "type" => "select"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #4
0
 function load_rttheme()
 {
     if (rt_check_WP_version()) {
         if (is_admin()) {
             add_action('admin_notices', $c = create_function('', 'echo "' . addcslashes($load_msg, '"') . '";'));
         } else {
             exit($load_msg);
         }
     } else {
         require_once get_template_directory() . '/rt-framework/classes/loading.php';
         $rttheme = new RTTheme();
         /*
          * 	 DO NOT CHANGE slug => "" !!! 
          */
         $rttheme->start(array('theme' => 'RT-THEME 18', 'slug' => 'rttheme18', 'version' => '1.0'));
     }
 }
Пример #5
0
 function rt_generate_testimonial_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Testimonials", "rt_theme_admin");
     $contet_type = "testimonial_box";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $ids = $list_order = $item_width = $list_orderby = $style = $pagination = $item_per_page = "";
     $values = isset($options['values']) ? $options['values'] : array();
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays the testimonials created with the testimonials post type following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Select Testimonials (Optional)", 'rt_theme_admin'), "desc" => __("You can filter testimonial items by selecting them from this list. If you don't select individual testimonials, this module will show all testimonials.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][ids][]", "options" => RTTheme::rt_get_testimonial_list(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $ids), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the content layout for the testimonials.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "1", "value" => $item_width, "type" => "select"), array("name" => __("Style", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][style]", "options" => array("centered" => "Big Text / Center Aligned", "" => "Small Text / Left Aligned"), "value" => $style, "type" => "select"), array("type" => "td_col"), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the testimonial items within the list by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("name" => __("Posts per page", 'rt_theme_admin'), "desc" => __("Set the amount of testimonialto display at once per page.<br /><strong>Note</strong> : works in conjunction with the pagination settings.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][item_per_page]", "min" => "1", "max" => "200", "class" => $randomClass, "value" => $item_per_page, "default" => "9", "dont_save" => true, "type" => "rangeinput"), array("name" => __("Pagination", 'rt_theme_admin'), "desc" => __("Enable (if checked) the pagination ability for the product items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_box[values][pagination]", "type" => "checkbox2", "class" => $randomClass, "value" => $pagination, "default" => "off", "std" => "false"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
 function rt_generate_product_categories($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Product Categories", "rt_theme_admin");
     $contet_type = "product_categories";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $values = isset($options['values']) ? $options['values'] : array();
     $parent = $ids = $orderby = $order = $item_width = $crop = $image_max_height = $display_titles = $display_descriptions = $display_thumbnails = "";
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays product categories following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Select Parent Category", 'rt_theme_admin'), "desc" => __("(Optional) Select a parent category to list only the subcategories of the category.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][parent]", "options" => array_merge(array("" => "Select"), RTTheme::rt_get_product_categories()), "purpose" => "sidebar", "type" => "select", "class" => $randomClass, "default" => $parent), array("name" => __("Select Product Categories", 'rt_theme_admin'), "desc" => __("(Optional) List only selected categories. ", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][ids][]", "options" => RTTheme::rt_get_product_categories(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $ids), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the product items within the product list by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][orderby]", "options" => array('id' => __('ID', 'rt_theme_admin'), 'name' => __('Name', 'rt_theme_admin'), 'slug' => __('Slug', 'rt_theme_admin'), 'count' => __('Count', 'rt_theme_admin')), "value" => $orderby, "default" => "name", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("name" => __("List Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for listing list. ', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "1", "value" => $item_width, "type" => "select"), array("type" => "td_col"), array("name" => __("Display Titles", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][display_titles]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_titles, "default" => "on", "std" => "false"), array("name" => __("Display Descriptions", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][display_descriptions]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_descriptions, "default" => "on", "std" => "false"), array("name" => __("Display Thumbnails", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][display_thumbnails]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_thumbnails, "default" => "on", "std" => "false"), array("name" => __("Crop Thumnails", 'rt_theme_admin'), "desc" => __("Enable (if checked) the the category thumbnails will be cropped according the 'Maximum Thumbnail Height' value.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][crop]", "type" => "checkbox2", "class" => $randomClass, "value" => $crop, "std" => "false"), array("name" => __("Maximum Thumbnail Height", 'rt_theme_admin'), "desc" => __("Maximum image height for the category thumbnails. 'Crop Thumbnails' option must be checked in order to use this option.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_categories[values][image_max_height]", "min" => "20", "max" => "2000", "class" => $randomClass, "value" => $image_max_height, "default" => "400", "dont_save" => true, "type" => "rangeinput"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #7
0
 function rt_generate_product_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Product Posts", "rt_theme_admin");
     $contet_type = "product_box";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $values = isset($options['values']) ? $options['values'] : array();
     $heading = $pagination = $item_width = $list_orderby = $list_orderby = $list_order = $item_per_page = $categories = $display_descriptions = $display_price = $display_titles = $with_borders = $with_effect = $no_top_border = $no_bottom_border = "";
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays product items following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Embedded Heading", 'rt_theme_admin'), "desc" => __('Enter a title to be displayed as embedded to the grid.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][heading]", "value" => $heading, "type" => "text"), array("name" => __("Select Product Categories", 'rt_theme_admin'), "desc" => __("Select and set categories to filter (shorten) the amount of product items presented in the productlist. If you don't select and set a category, this module will list all product items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][categories][]", "options" => RTTheme::rt_get_product_categories(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $categories), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the product items within the product list by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("name" => __("Amount of product post per page", 'rt_theme_admin'), "desc" => __("Set the amount of product items to display at once per page.<br /><strong>Note</strong> : works in conjunction with the pagination settings.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][item_per_page]", "min" => "1", "max" => "200", "class" => $randomClass, "value" => $item_per_page, "default" => "9", "dont_save" => true, "type" => "rangeinput"), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for listing the product items. (<strong>Note</strong> : when used in a column module which is f.e. set to a 1/5 column it is better to set the content layout to a 1/1 layout.)', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "1", "value" => $item_width, "type" => "select"), array("type" => "td_col"), array("name" => __("Pagination", 'rt_theme_admin'), "desc" => __("Enable (if checked) the pagination ability for the product items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][pagination]", "type" => "checkbox2", "class" => $randomClass, "value" => $pagination, "default" => "off", "std" => "false"), array("name" => __("Display Titles", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][display_titles]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_titles, "default" => "on", "std" => "false"), array("name" => __("Display Descriptions", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][display_descriptions]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_descriptions, "default" => "on", "std" => "false"), array("name" => __("Display Prices", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][display_price]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_price, "default" => "on", "std" => "false"), array("name" => __("Display as Grid", 'rt_theme_admin'), "desc" => __("Enable (if checked) the list will be displayed in grid style.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][with_borders]", "type" => "checkbox2", "class" => $randomClass, "value" => $with_borders, "std" => "false"), array("name" => __("Enable Sliding Info", 'rt_theme_admin'), "desc" => __("Enable (if checked) the mouse over sliding info for the items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][with_effect]", "type" => "checkbox2", "class" => $randomClass, "value" => $with_effect, "default" => "off", "std" => "false"), array("name" => __("Remove Top Borders of the Grid", 'rt_theme_admin'), "desc" => __("Enable (if checked) to remove the top borders of the grid will be removed. In some cases you may need this option checked to make your design much beatuiful.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][no_top_border]", "type" => "checkbox2", "class" => $randomClass, "value" => $no_top_border, "std" => "false"), array("name" => __("Remove Bottom Borders of the Grid", 'rt_theme_admin'), "desc" => __("Enable (if checked) to remove the bottom borders of the grid will be removed. In some cases you may need this option checked to make your design much beatuiful.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_box[values][no_bottom_border]", "type" => "checkbox2", "class" => $randomClass, "value" => $no_bottom_border, "std" => "false"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #8
0
 function rt_generate_portfolio_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Portfolio Posts", "rt_theme_admin");
     $contet_type = "portfolio_box";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $values = isset($options['values']) ? $options['values'] : array();
     $pagination = $item_width = $item_per_page = $portf_list_orderby = $portf_list_order = $pagination = $filterable = $list_order = $categories = $display_descriptions = $display_embedded_titles = $display_titles = "";
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays portfolio list following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Select Portfolio Categories", 'rt_theme_admin'), "desc" => __("Select categories to filter (shorten) the amount of portfolio items presented in the portfolio list. If you don't select and set a category, this module will list all portfolio items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][categories][]", "options" => RTTheme::rt_get_portfolio_categories(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $categories), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the portfolio items within the portfolio list by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][portf_list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $portf_list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][portf_list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $portf_list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("name" => __("Amount of portfolio item per page", 'rt_theme_admin'), "desc" => __("Set the amount of portfolio items to display at once per page.<br /><strong>Note</strong> : works in conjunction with the pagination settings.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][item_per_page]", "min" => "1", "max" => "200", "class" => $randomClass, "value" => $item_per_page, "default" => "9", "dont_save" => true, "type" => "rangeinput"), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for listing the portfolio items. (<strong>Note</strong> : when used in a column module which is f.e. set to a 1/5 column it is better to set the portfolio column layout to a 1/1 layout.)', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "3", "value" => $item_width, "hr" => "true", "type" => "select"), array("type" => "td_col"), array("name" => __("Pagination", 'rt_theme_admin'), "desc" => __("Enable (if checked) the pagination ability for the portfolio list.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][pagination]", "type" => "checkbox2", "class" => $randomClass, "value" => $pagination, "default" => "off", "std" => "false"), array("name" => __("Filter Navigation", 'rt_theme_admin'), "desc" => __("Enable (if checked) toplevel filter navigation for the listed portfolio items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][filterable]", "type" => "checkbox2", "class" => $randomClass, "value" => $filterable, "default" => "off", "std" => "false"), array("name" => __("Display Titles", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][display_titles]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_titles, "default" => "on", "std" => "false"), array("name" => __("Display Descriptions", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][display_descriptions]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_descriptions, "default" => "on", "std" => "false"), array("name" => __("Display Embedded Titles", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_portfolio_box[values][display_embedded_titles]", "type" => "checkbox2", "class" => $randomClass, "value" => $display_embedded_titles, "default" => "on", "std" => "false"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #9
0
 function rt_generate_product_carousel($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Product Carousel", "rt_theme_admin");
     $contet_type = "product_carousel";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $values = isset($options['values']) ? $options['values'] : array();
     $item_width = $max_item = $crop = $list_order = $list_orderby = $categories = $heading_icon = $heading = "";
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays product items as a carousel following the settings below.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Heading", 'rt_theme_admin'), "desc" => __('Enter a title to be displayed above the product carousel.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][heading]", "value" => $heading, "type" => "text"), array("name" => __("Heading Icon", 'rt_theme_admin'), "desc" => __('Select and set a icon to precede the product carousel title.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][heading_icon]", "class" => "icon_selection", "value" => $heading_icon, "type" => "text"), array("name" => __("Select Product Categories", 'rt_theme_admin'), "desc" => __("Select and set categories to filter (shorten) the amount of product items presented in the carousel. If you don't select and set a category, this module will show all product items.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][categories][]", "options" => RTTheme::rt_get_product_categories(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $categories), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the product items within the product carousel by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("type" => "td_col"), array("name" => __("Crop Image", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][crop]", "check_desc" => __("Enable (if checked) cropping for product images", 'rt_theme_admin'), "type" => "checkbox", "class" => $randomClass, "value" => $crop, "default" => "on", "std" => "false"), array("name" => __("Carousel Style", 'rt_theme_admin'), "desc" => __('Select and set the carousel style.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][style]", "options" => array("plain_carousel" => "Plain Box", "rounded_carousel" => "With Borders"), "default" => "1", "value" => $item_width, "type" => "select"), array("name" => __("Maximum product", 'rt_theme_admin'), "desc" => __("Set the amount of product items to be displayed within the carousel.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][max_item]", "min" => "1", "max" => "200", "class" => $randomClass, "value" => $max_item, "default" => "9", "dont_save" => true, "type" => "rangeinput"), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for the carousel.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_product_carousel[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "default" => "1", "value" => $item_width, "type" => "select"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #10
0
 function rt_generate_testimonial_carousel($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Testimonial Carousel", "rt_theme_admin");
     $contet_type = "testimonial_carousel";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = "one passive_module";
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = 'display: none;';
     $ids = "";
     $values = isset($options['values']) ? $options['values'] : array();
     $heading = $heading_icon = $list_orderby = $list_order = $item_width = $style = "";
     extract($values);
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"><div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo $this->module_controls($isNewBox);
     echo '</div><div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("desc" => __("This module displays the testimonials created by the testimonial post type within a carousel.", 'rt_theme_admin'), "hr" => "true", "type" => "info"), array("type" => "table_start"), array("name" => __("Heading", 'rt_theme_admin'), "desc" => __('Enter a title to be displayed above the testimonials carousel.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][heading]", "value" => $heading, "type" => "text"), array("name" => __("Heading Icon", 'rt_theme_admin'), "desc" => __('Select and set a icon to precede the testimonials carousel title.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][heading_icon]", "class" => "icon_selection", "value" => $heading_icon, "type" => "text"), array("name" => __("Select Testimonials (Optional)", 'rt_theme_admin'), "desc" => __("You can filter testimonials by selecting them from this list. If you don't select one, all testimonials will be displayed.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][ids][]", "options" => RTTheme::rt_get_testimonial_list(), "purpose" => "sidebar", "type" => "selectmultiple", "class" => $randomClass, "default" => $ids), array("name" => __("Style", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][style]", "options" => array("centered" => "Big Text / Center Aligned", "" => "Small Text / Left Aligned"), "value" => $style, "type" => "select"), array("type" => "td_col"), array("name" => __("OrderBy Parameter", 'rt_theme_admin'), "desc" => __("Select and set the sorting order for the testimonial items within the carousel by this parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][list_orderby]", "options" => array('author' => 'Author', 'date' => 'Date', 'title' => 'Title', 'modified' => 'Modified', 'ID' => 'ID', 'rand' => 'Randomized'), "value" => $list_orderby, "default" => "date", "dont_save" => true, "type" => "select"), array("name" => __("Order", 'rt_theme_admin'), "desc" => __("Select and set the ascending or descending order for the ORDERBY parameter.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][list_order]", "options" => array('ASC' => 'Ascending', 'DESC' => 'Descending'), "value" => $list_order, "default" => "DESC", "dont_save" => true, "type" => "select"), array("name" => __("Content Layout", 'rt_theme_admin'), "desc" => __('Select and set the column layout for the carousel.', 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_testimonial_carousel[values][item_width]", "options" => array(5 => "1/5", 4 => "1/4", 3 => "1/3", 2 => "1/2", 1 => "1/1"), "value" => $isNewBox ? 4 : $item_width, "type" => "select"), array("type" => "table_end"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #11
0
    function form($instance)
    {
        $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
        $categories = isset($instance['categories']) ? $instance['categories'] : array();
        $newWidget = isset($instance['newWidget']) ? $instance['newWidget'] : '';
        $limit = empty($instance['limit']) ? 100 : $instance['limit'];
        $count = empty($instance['count']) ? 5 : $instance['count'];
        $show_thumbnails = isset($instance['show_thumbnails']) ? $instance['show_thumbnails'] : '';
        $show_excerpt = isset($instance['show_excerpt']) ? $instance['show_excerpt'] : '';
        $thumb_width = empty($instance['thumb_width']) ? 260 : $instance['thumb_width'];
        $thumb_height = empty($instance['thumb_height']) ? 260 : $instance['thumb_height'];
        // Categories
        $rt_getcat = RTTheme::rt_get_categories();
        ?>
		<p><label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
" /></p>
		
		
		<p><label for="<?php 
        echo $this->get_field_id('categories');
        ?>
"><?php 
        _e('Select Categories:', 'rt_theme_admin');
        ?>
</label>
		
		<select class="widefat <?php 
        echo empty($newWidget) ? '' : 'multiple';
        ?>
"   name="<?php 
        echo $this->get_field_name('categories');
        ?>
[]" id="<?php 
        echo $this->get_field_id('categories');
        ?>
" multiple="multiple" title="<?php 
        _e('Select', 'rt_theme_admin');
        ?>
">

			<?php 
        foreach ($rt_getcat as $op_val => $option) {
            if ($categories) {
                foreach ($categories as $a_key => $a_value) {
                    if ($a_value == $op_val) {
                        $selected = "selected";
                    }
                }
            }
            ?>
				<option value="<?php 
            echo $op_val;
            ?>
" <?php 
            echo empty($selected) ? "" : 'selected="selected"';
            ?>
 >
					<?php 
            echo $option;
            ?>
				</option>
			<?php 
            $selected = '';
        }
        ?>
		</select>

		<p><label for="<?php 
        echo $this->get_field_id('count');
        ?>
"><?php 
        _e('Number of posts to show:', 'rt_theme_admin');
        ?>
</label>
		<input id="<?php 
        echo $this->get_field_id('count');
        ?>
" name="<?php 
        echo $this->get_field_name('count');
        ?>
" type="text" value="<?php 
        echo $count;
        ?>
" size="4" /></p>

		<p><input type="checkbox" class="checkbox" id="<?php 
        echo $this->get_field_id('show_excerpt');
        ?>
" name="<?php 
        echo $this->get_field_name('show_excerpt');
        ?>
" <?php 
        checked($show_excerpt);
        ?>
 />
		<label for="<?php 
        echo $this->get_field_id('show_excerpt');
        ?>
"><?php 
        _e('Display Excerpt', 'rt_theme_admin');
        ?>
</label></p>

		<p><label for="<?php 
        echo $this->get_field_id('limit');
        ?>
"><?php 
        _e('Limit excerpt characters: ', 'rt_theme_admin');
        ?>
</label>
		<input id="<?php 
        echo $this->get_field_id('limit');
        ?>
" name="<?php 
        echo $this->get_field_name('limit');
        ?>
" type="text" value="<?php 
        echo $limit;
        ?>
" size="4" /></p>			

		<p><input type="checkbox" class="checkbox" id="<?php 
        echo $this->get_field_id('show_thumbnails');
        ?>
" name="<?php 
        echo $this->get_field_name('show_thumbnails');
        ?>
" <?php 
        checked($show_thumbnails);
        ?>
 />
		<label for="<?php 
        echo $this->get_field_id('show_thumbnails');
        ?>
"><?php 
        _e('Don\'t display post thumbnails', 'rt_theme_admin');
        ?>
</label></p>
	
		<p><label for="<?php 
        echo $this->get_field_id('thumb_width');
        ?>
"><?php 
        _e('Thumbnail Width (px):', 'rt_theme_admin');
        ?>
</label>
		<input id="<?php 
        echo $this->get_field_id('thumb_width');
        ?>
" name="<?php 
        echo $this->get_field_name('thumb_width');
        ?>
" type="text" value="<?php 
        echo $thumb_width;
        ?>
" size="4" /></p>
	
		<p><label for="<?php 
        echo $this->get_field_id('thumb_height');
        ?>
"><?php 
        _e('Thumbnail Height (px):', 'rt_theme_admin');
        ?>
</label>
		<input id="<?php 
        echo $this->get_field_id('thumb_height');
        ?>
" name="<?php 
        echo $this->get_field_name('thumb_height');
        ?>
" type="text" value="<?php 
        echo $thumb_height;
        ?>
" size="4" /></p>		 
				
		<input class="widefat" id="<?php 
        echo $this->get_field_id('newWidget');
        ?>
" name="<?php 
        echo $this->get_field_name('newWidget');
        ?>
" type="hidden" value="1" />
		
<?php 
    }
<?php

#-----------------------------------------
#	RT-Theme product_custom_fields.php
#	version: 1.0
#-----------------------------------------
#
# 	Portfolio Custom Fields
#
/**
* @var  array  $customFields  Defines the custom fields available
*/
$customFields = array(array("name" => "short_description", "title" => __("Short Description", 'rt_theme_admin'), "description" => __('Short description for product listing pages. If you want to show price info in the listing pages, you can use  this code in this field.', 'rt_theme_admin'), "type" => "textarea"), array("title" => __("Related Products", 'rt_theme_admin'), "type" => "heading"), array("title" => __("Select Related Products", 'rt_theme_admin'), "name" => "related_products[]", "options" => RTTheme::rt_get_products(), "select" => __("Select products", 'rt_theme_admin'), "type" => "selectmultiple"), array("title" => __("ATTACHED DOCUMENTS", 'rt_theme_admin'), "type" => "heading"), array("name" => "attached_documents", "title" => __("Attached Files", 'rt_theme_admin'), "description" => __("You can attach unlimited file to this product. Put all the file urls line by line. Use \"|\\ delimiter to add file names. Example: <pre style=\"font-style:normal;\">File Name | http://file_url<br />File Name | http://file_url</pre>", 'rt_theme_admin'), "type" => "textarea"), array("title" => __("FREE TABS", 'rt_theme_admin'), "type" => "heading"), array("name" => "free_tab_1_title", "title" => __("#1 - Free Tab Name ", 'rt_theme_admin'), "type" => "text"), array("name" => "free_tab_1_content", "title" => __("#1 - Free Tab Content", 'rt_theme_admin'), "type" => "textarea", "richeditor" => "true"), array("title" => "", "type" => "heading"), array("name" => "free_tab_2_title", "title" => __("#2 - Free Tab Name", 'rt_theme_admin'), "type" => "text"), array("name" => "free_tab_2_content", "title" => __("#2 - Free Tab Content", 'rt_theme_admin'), "type" => "textarea", "richeditor" => "true"), array("title" => "", "type" => "heading"), array("name" => "free_tab_3_title", "title" => __("#3 - Free Tab Name", 'rt_theme_admin'), "type" => "text", "richeditor" => "true"), array("name" => "free_tab_3_content", "title" => __("#3 - Free Tab Content", 'rt_theme_admin'), "type" => "textarea", "richeditor" => "true"));
$settings = array("name" => THEMENAME . " Product Options", "scope" => "products", "slug" => "product_custom_fields", "capability" => "edit_post", "context" => "normal", "priority" => "high");
Пример #13
0
    function form($instance)
    {
        $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
        $address = isset($instance['address']) ? esc_attr($instance['address']) : '';
        $phone_1 = isset($instance['phone_1']) ? esc_attr($instance['phone_1']) : '';
        $phone_2 = isset($instance['phone_2']) ? esc_attr($instance['phone_2']) : '';
        $fax_1 = isset($instance['fax_1']) ? esc_attr($instance['fax_1']) : '';
        $fax_2 = isset($instance['fax_2']) ? esc_attr($instance['fax_2']) : '';
        $mail_1 = isset($instance['mail_1']) ? esc_attr($instance['mail_1']) : '';
        $mail_2 = isset($instance['mail_2']) ? esc_attr($instance['mail_2']) : '';
        $support_mail_1 = isset($instance['support_mail_1']) ? esc_attr($instance['support_mail_1']) : '';
        $support_mail_2 = isset($instance['support_mail_2']) ? esc_attr($instance['support_mail_2']) : '';
        $map_link = isset($instance['map_link']) ? esc_attr($instance['map_link']) : '';
        $contact_form_link = isset($instance['contact_form_link']) ? esc_attr($instance['contact_form_link']) : '';
        $map_link_text = isset($instance['map_link_text']) ? esc_attr($instance['map_link_text']) : '';
        $contact_form_link_text = isset($instance['contact_form_link_text']) ? esc_attr($instance['contact_form_link_text']) : '';
        // Categories
        $rt_getcat = RTTheme::rt_get_categories();
        ?>
		<p><label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
" /></p>
 
		<p><label for="<?php 
        echo $this->get_field_id('address');
        ?>
"><?php 
        _e('Address:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('address');
        ?>
" name="<?php 
        echo $this->get_field_name('address');
        ?>
" type="text" value="<?php 
        echo $address;
        ?>
" /></p>

		<p><label for="<?php 
        echo $this->get_field_id('phone_1');
        ?>
"><?php 
        _e('Phone 1:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('phone_1');
        ?>
" name="<?php 
        echo $this->get_field_name('phone_1');
        ?>
" type="text" value="<?php 
        echo $phone_1;
        ?>
" /></p>

		<p><label for="<?php 
        echo $this->get_field_id('phone_2');
        ?>
"><?php 
        _e('Phone 2:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('phone_2');
        ?>
" name="<?php 
        echo $this->get_field_name('phone_2');
        ?>
" type="text" value="<?php 
        echo $phone_2;
        ?>
" /></p>

		<p><label for="<?php 
        echo $this->get_field_id('fax_1');
        ?>
"><?php 
        _e('Fax 1:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('fax_1');
        ?>
" name="<?php 
        echo $this->get_field_name('fax_1');
        ?>
" type="text" value="<?php 
        echo $fax_1;
        ?>
" /></p>

		<p><label for="<?php 
        echo $this->get_field_id('fax_2');
        ?>
"><?php 
        _e('Fax 2:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('fax_2');
        ?>
" name="<?php 
        echo $this->get_field_name('fax_2');
        ?>
" type="text" value="<?php 
        echo $fax_2;
        ?>
" /></p>

		<p><label for="<?php 
        echo $this->get_field_id('mail_1');
        ?>
"><?php 
        _e('Email 1:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('mail_1');
        ?>
" name="<?php 
        echo $this->get_field_name('mail_1');
        ?>
" type="text" value="<?php 
        echo $mail_1;
        ?>
" /></p>		

		<p><label for="<?php 
        echo $this->get_field_id('mail_2');
        ?>
"><?php 
        _e('Email 2:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('mail_2');
        ?>
" name="<?php 
        echo $this->get_field_name('mail_2');
        ?>
" type="text" value="<?php 
        echo $mail_2;
        ?>
" /></p>		

		<p><label for="<?php 
        echo $this->get_field_id('support_mail_1');
        ?>
"><?php 
        _e('Support Email 1:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('support_mail_1');
        ?>
" name="<?php 
        echo $this->get_field_name('support_mail_1');
        ?>
" type="text" value="<?php 
        echo $support_mail_1;
        ?>
" /></p>		
 	
		<p><label for="<?php 
        echo $this->get_field_id('support_mail_2');
        ?>
"><?php 
        _e('Support Email 2:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('support_mail_2');
        ?>
" name="<?php 
        echo $this->get_field_name('support_mail_2');
        ?>
" type="text" value="<?php 
        echo $support_mail_2;
        ?>
" /></p>
 	
		<p><label for="<?php 
        echo $this->get_field_id('contact_form_link');
        ?>
"><?php 
        _e('Contact Form Link:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('contact_form_link');
        ?>
" name="<?php 
        echo $this->get_field_name('contact_form_link');
        ?>
" type="text" value="<?php 
        echo $contact_form_link;
        ?>
" /></p>				

		<p><label for="<?php 
        echo $this->get_field_id('contact_form_link_text');
        ?>
"><?php 
        _e('Contact Form Link Text:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('contact_form_link_text');
        ?>
" name="<?php 
        echo $this->get_field_name('contact_form_link_text');
        ?>
" type="text" value="<?php 
        echo empty($contact_form_link_text) ? __('Contact Form', 'rt_theme_admin') : $contact_form_link_text;
        ?>
" /></p>				
 	 	
		<p><label for="<?php 
        echo $this->get_field_id('map_link');
        ?>
"><?php 
        _e('Map Link:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('map_link');
        ?>
" name="<?php 
        echo $this->get_field_name('map_link');
        ?>
" type="text" value="<?php 
        echo $map_link;
        ?>
" /></p>

		<p><label for="<?php 
        echo $this->get_field_id('map_link_text');
        ?>
"><?php 
        _e('Map Link Text:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('map_link_text');
        ?>
" name="<?php 
        echo $this->get_field_name('map_link_text');
        ?>
" type="text" value="<?php 
        echo empty($map_link_text) ? __('Find us on map', 'rt_theme_admin') : $map_link_text;
        ?>
" /></p>								
<?php 
    }
<?php

#-----------------------------------------
#	RT-Theme product_custom_fields.php
#	version: 1.0
#-----------------------------------------
#
# 	Portfolio Custom Fields
#
/**
* @var  array  $customFields  Defines the custom fields available
*/
$sample_attachment_code = '
<pre>
File Name or Title | file_url 
File Name or Title | file_url 
File Name or Title | file_url | new_window
File Name or Title | file_url			
</pre>
';
$customFields = array(array("type" => "group_start", "name" => "_product_tabs", "class" => "vertical_tabs rt_tabs"), array("type" => "group_start", "name" => "_product_tabs_titles"), array("type" => "tab_titles", "tab_names" => array(RT_COMMON_THEMESLUG . "-product-tab-1" => array("Product Info", "icon-info-circled"), RT_COMMON_THEMESLUG . "-product-tab-2" => array("Free Tab 1", "icon-pencil"), RT_COMMON_THEMESLUG . "-product-tab-3" => array("Free Tab 2", "icon-pencil"), RT_COMMON_THEMESLUG . "-product-tab-4" => array("Free Tab 3", "icon-pencil"), RT_COMMON_THEMESLUG . "-product-tab-5" => array("Free Tab 4", "icon-pencil"), RT_COMMON_THEMESLUG . "-product-tab-6" => array("Related Products", "icon-link"), RT_COMMON_THEMESLUG . "-product-tab-7" => array("Attached Documents", "icon-docs"))), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-1"), array("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'), "type" => "info_text_only", "hr" => "true"), array("name" => "sku", "title" => __('SKU', 'rt_theme_admin'), "type" => "inline_text", "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'), "hr" => true), array("name" => "price_regular", "description" => __('Regular Price : Enter the normal/regular price at which the product is sold. No discount offer.', 'rt_theme_admin'), "title" => __('Regular Price', 'rt_theme_admin'), "type" => "inline_text"), array("name" => "sale_price", "title" => __("Sale Price", 'rt_theme_admin'), "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'), "type" => "inline_text", "hr" => true), array("name" => "short_description", "title" => __("Short Description", 'rt_theme_admin'), "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'), "type" => "textarea"), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-6"), array("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'), "type" => "info_text_only", "hr" => "true"), array("title" => __("Select Related Products", 'rt_theme_admin'), "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'), "name" => "related_products[]", "options" => RTTheme::rt_get_products(), "select" => __("Select products", 'rt_theme_admin'), "type" => "selectmultiple"), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-7"), array("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, "type" => "info_text_only", "hr" => "true"), array("name" => "attached_documents", "title" => __("Attached Files", 'rt_theme_admin'), "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'), "type" => "textarea"), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-2"), array("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'), "type" => "info_text_only", "hr" => "true"), array("name" => "free_tab_1_title", "title" => __("#1 - Free Tab Name ", 'rt_theme_admin'), "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'), "type" => "inline_text"), array("name" => "free_tab_1_icon", "title" => __("#1 - Free Tab Icon ", 'rt_theme_admin'), "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'), "type" => "inline_text", "class" => "icon_selection", "hr" => "true"), array("name" => "free_tab_1_content", "title" => __("#1 - Free Tab Content", 'rt_theme_admin'), "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'), "type" => "textarea", "richeditor" => "true", "label_position" => "block"), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-3"), array("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'), "type" => "info_text_only", "hr" => "true"), array("name" => "free_tab_2_title", "title" => __("#2 - Free Tab Name ", 'rt_theme_admin'), "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'), "type" => "inline_text"), array("name" => "free_tab_2_icon", "title" => __("#2 - Free Tab Icon ", 'rt_theme_admin'), "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'), "type" => "inline_text", "class" => "icon_selection", "hr" => "true"), array("name" => "free_tab_2_content", "title" => __("#2 - Free Tab Content", 'rt_theme_admin'), "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'), "type" => "textarea", "richeditor" => "true", "label_position" => "block"), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-4"), array("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'), "type" => "info_text_only", "hr" => "true"), array("name" => "free_tab_3_title", "title" => __("#3 - Free Tab Name ", 'rt_theme_admin'), "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'), "type" => "inline_text"), array("name" => "free_tab_3_icon", "title" => __("#3 - Free Tab Icon ", 'rt_theme_admin'), "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'), "type" => "inline_text", "class" => "icon_selection", "hr" => "true"), array("name" => "free_tab_3_content", "title" => __("#3 - Free Tab Content", 'rt_theme_admin'), "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'), "type" => "textarea", "richeditor" => "true", "label_position" => "block"), array("type" => "group_end"), array("type" => "group_start", "name" => "-product-tab-5"), array("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'), "type" => "info_text_only", "hr" => "true"), array("name" => "free_tab_4_title", "title" => __("#4 - Free Tab Name ", 'rt_theme_admin'), "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'), "type" => "inline_text"), array("name" => "free_tab_4_icon", "title" => __("#4 - Free Tab Icon ", 'rt_theme_admin'), "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'), "type" => "inline_text", "class" => "icon_selection", "hr" => "true"), array("name" => "free_tab_4_content", "title" => __("#4 - Free Tab Content", 'rt_theme_admin'), "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'), "type" => "textarea", "richeditor" => "true", "label_position" => "block"), array("type" => "group_end"), array("type" => "group_end"));
$settings = array("name" => RT_THEMENAME . " Product Options", "scope" => "products", "slug" => "product_custom_fields", "capability" => "edit_post", "context" => "normal", "priority" => "high");
Пример #15
0
 function __construct()
 {
     // Pages
     $rt_getpages = RTTheme::rt_get_pages();
     // Posts
     $this->posts = query_posts('posts_per_page=-1&post_type=post&orderby=title&order=ASC');
     // Regular Posts
     $this->products = query_posts('posts_per_page=-1&post_type=products&orderby=title&order=ASC');
     // Products
     $this->portfolios = query_posts('posts_per_page=-1&post_type=portfolio&orderby=title&order=ASC');
     // Portfolios
     $rt_getposts = array();
     foreach ($this->posts as $post_list) {
         // add regular posts to the list
         $rt_getposts[$post_list->ID] = '[' . $post_list->post_type . '] ' . $post_list->post_title;
     }
     foreach ($this->products as $post_list) {
         // add product posts to the list
         $rt_getposts[$post_list->ID] = '[' . $post_list->post_type . '] ' . $post_list->post_title;
     }
     foreach ($this->portfolios as $post_list) {
         // add portfolio posts to the list
         $rt_getposts[$post_list->ID] = '[' . $post_list->post_type . '] ' . $post_list->post_title;
     }
     // Categories
     $rt_getcat = RTTheme::rt_get_categories();
     // Product Categories
     $rt_product_getcat = RTTheme::rt_get_product_categories();
     // Portfolio Categories
     $rt_portfolio_getcat = RTTheme::rt_get_portfolio_categories();
     // reset query
     wp_reset_query();
     // get saved values
     $savedSidebars = get_option('rt_sidebar_options');
     // create new sidebar array
     $savedSidebars_array = array();
     // Count Sidebars
     $savedSidebars_IDs = array();
     $sidebar_count = 0;
     if ($savedSidebars) {
         foreach ($savedSidebars as $key => $value) {
             if (!is_array($value)) {
                 if (stristr($key, '_sidebar_name') == TRUE) {
                     array_push($savedSidebars_IDs, $key);
                     $sidebar_count++;
                 }
             }
         }
     }
     // costruct saved array
     foreach ($savedSidebars_IDs as $id) {
         //sidebar
         $sidebar_name = $savedSidebars[$id];
         $sidebar_id = str_replace("_sidebar_name", "", $id);
         $sidebar_pages = isset($savedSidebars[$sidebar_id . '_pages']) ? $savedSidebars[$sidebar_id . '_pages'] : "";
         $sidebar_posts = isset($savedSidebars[$sidebar_id . '_posts']) ? $savedSidebars[$sidebar_id . '_posts'] : "";
         $sidebar_categories = isset($savedSidebars[$sidebar_id . '_categories']) ? $savedSidebars[$sidebar_id . '_categories'] : "";
         $sidebar_product_categories = isset($savedSidebars[$sidebar_id . '_productcategories']) ? $savedSidebars[$sidebar_id . '_productcategories'] : "";
         $sidebar_portfolio_categories = isset($savedSidebars[$sidebar_id . '_portfoliocategories']) ? $savedSidebars[$sidebar_id . '_portfoliocategories'] : "";
         //sidebar array
         array_push($savedSidebars_array, array("name" => $sidebar_name, "id" => $sidebar_id, "options" => array('pages' => $sidebar_pages, 'posts' => $sidebar_posts, 'categories' => $sidebar_categories, 'productcategories' => $sidebar_product_categories, 'portfoliocategories' => $sidebar_portfolio_categories)));
     }
     // costruct form arrays
     $options = array();
     //template builder info text
     array_push($options, array("name" => __("Info", 'rt_theme_admin'), "desc" => __('If you need a new sidebar widget area for specified contents, you can create one by using Sidebar Creator. When you create a sidebar go to Appearence → <a href="widgets.php">Widgets</a> to drag&drop widgets into it.', 'rt_theme_admin'), "hr" => "true", "type" => "info"));
     foreach ($savedSidebars_array as $sidebar_v) {
         $sidebarID = $sidebar_v["id"];
         //Sidebar Div
         array_push($options, array("id" => "div_" . $sidebarID, "name" => $sidebar_v["name"], "type" => "div"));
         //Sidebar Names
         array_push($options, array("name" => __("Sidebar Name", 'rt_theme_admin'), "value" => $sidebar_v["name"], "id" => $sidebarID . "_sidebar_name", "class" => "sidebar_name saved", "type" => "text"));
         //For Pages
         array_push($options, array("name" => __("Select Pages", 'rt_theme_admin'), "id" => $sidebar_v["id"] . "_pages[]", "options" => $rt_getpages, "default" => $sidebar_v["options"]["pages"], "purpose" => "sidebar", "type" => "selectmultiple"));
         //For Posts
         array_push($options, array("name" => __("Select Posts", 'rt_theme_admin'), "desc" => __("Regular Posts, Products, Portfolio", 'rt_theme_admin'), "id" => $sidebar_v["id"] . "_posts[]", "options" => $rt_getposts, "default" => $sidebar_v["options"]["posts"], "purpose" => "sidebar", "class" => "postlist", "type" => "selectmultiple"));
         //For Categories
         array_push($options, array("name" => __("Select Categories", 'rt_theme_admin'), "id" => $sidebar_v["id"] . "_categories[]", "options" => $rt_getcat, "default" => $sidebar_v["options"]["categories"], "purpose" => "sidebar", "type" => "selectmultiple"));
         //For Product Categories
         array_push($options, array("name" => __("Select Product Categories", 'rt_theme_admin'), "id" => $sidebar_v["id"] . "_productcategories[]", "options" => $rt_product_getcat, "default" => $sidebar_v["options"]["productcategories"], "purpose" => "sidebar", "type" => "selectmultiple"));
         //For Portfolio Categories
         array_push($options, array("name" => __("Select Portfolio Categories", 'rt_theme_admin'), "id" => $sidebar_v["id"] . "_portfoliocategories[]", "options" => $rt_portfolio_getcat, "default" => $sidebar_v["options"]["portfoliocategories"], "purpose" => "sidebar", "type" => "selectmultiple"));
         //Button
         array_push($options, array("name" => __("Delete Sidebar", 'rt_theme_admin'), "id" => $sidebar_v["id"] . "_delete", "class" => "deleteButton", "purpose" => "sidebar", "type" => "button"));
         //Sidebar Divend
         array_push($options, array("id" => "", "type" => "divend"));
     }
     // New Sidebar
     $sidebarID = 'sidebarid_' . rand(1, 100000);
     $sidebarName = $sidebarID . '_sidebar_name';
     //Sidebar Div
     array_push($options, array("name" => __("Create New Sidebar", 'rt_theme_admin'), "id" => "div_" . $sidebarID, "class" => "new_sidebar", "type" => "div"));
     //Sidebar Names
     array_push($options, array("name" => __("Sidebar Name", 'rt_theme_admin'), "value" => "", "class" => "sidebar_name", "id" => $sidebarName, "type" => "text"));
     //For Pages
     array_push($options, array("name" => __("Select Pages", 'rt_theme_admin'), "id" => $sidebarID . "_pages[]", "options" => $rt_getpages, "default" => "", "purpose" => "sidebar", "type" => "selectmultiple"));
     //For Posts
     array_push($options, array("name" => __("Select Posts", 'rt_theme_admin'), "id" => $sidebarID . "_posts[]", "options" => $rt_getposts, "desc" => __("Regular Posts, Products, Portfolio", 'rt_theme_admin'), "default" => "", "class" => "postlist", "purpose" => "sidebar", "type" => "selectmultiple"));
     //For Categories
     array_push($options, array("name" => __("Select Categories", 'rt_theme_admin'), "id" => $sidebarID . "_categories[]", "options" => $rt_getcat, "default" => "", "purpose" => "sidebar", "type" => "selectmultiple"));
     //For Product Categories
     array_push($options, array("name" => __("Select Product Categories", 'rt_theme_admin'), "id" => $sidebarID . "_productcategories[]", "options" => $rt_product_getcat, "default" => "", "purpose" => "sidebar", "type" => "selectmultiple"));
     //For Portfolio Categories
     array_push($options, array("name" => __("Select Portfolio Categories", 'rt_theme_admin'), "id" => $sidebarID . "_portfoliocategories[]", "options" => $rt_portfolio_getcat, "default" => "", "purpose" => "sidebar", "type" => "selectmultiple"));
     //Send button
     array_push($options, array("name" => __("Create Sidebar", 'rt_theme_admin'), "id" => $sidebarID . "_send_button", "class" => "create_button sidebarCreate", "purpose" => "page_layouts", "type" => "send_button"));
     //Sidebar Divend
     array_push($options, array("id" => "", "type" => "divend"));
     $this->rt_generate_form_page($options);
 }
Пример #16
0
    function form($instance)
    {
        $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
        $testimonial = isset($instance['testimonial']) ? esc_attr($instance['testimonial']) : '';
        $from = isset($instance['from']) ? esc_attr($instance['from']) : '';
        // Categories
        $rt_getcat = RTTheme::rt_get_categories();
        ?>
		<p><label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
" /></p>
 
		<p><label for="<?php 
        echo $this->get_field_id('testimonial');
        ?>
"><?php 
        _e('Testimonial:', 'rt_theme_admin');
        ?>
</label>
		
		<textarea class="widefat" id="<?php 
        echo $this->get_field_id('testimonial');
        ?>
" name="<?php 
        echo $this->get_field_name('testimonial');
        ?>
"><?php 
        echo $testimonial;
        ?>
</textarea>
		</p>

		<p><label for="<?php 
        echo $this->get_field_id('from');
        ?>
"><?php 
        _e('From:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('from');
        ?>
" name="<?php 
        echo $this->get_field_name('from');
        ?>
" type="text" value="<?php 
        echo $from;
        ?>
" /></p>

<?php 
    }
Пример #17
0
    return $load_msg;
}
# Define Content Width
if (!isset($content_width)) {
    $content_width = 606;
}
# Load the theme
if (rt_check_WP_version()) {
    if (is_admin()) {
        add_action('admin_notices', $c = create_function('', 'echo "' . addcslashes($load_msg, '"') . '";'));
    } else {
        exit($load_msg);
    }
} else {
    require_once get_template_directory() . '/rt-framework/classes/loading.php';
    $rttheme = new RTTheme();
    $rttheme->start(array('theme' => 'RT-THEME 17', 'slug' => 'rttheme', 'version' => '1.0'));
}
# Remove Google Fonts
class Disable_Google_Fonts
{
    public function __construct()
    {
        add_filter('gettext_with_context', array($this, 'disable_open_sans'), 888, 4);
    }
    public function disable_open_sans($translations, $text, $context, $domain)
    {
        if ('Open Sans font: on or off' == $context && 'on' == $text) {
            $translations = 'off';
        }
        return $translations;
Пример #18
0
 function __construct()
 {
     // Items
     $rt_items = array("slider_box" => "Slider", "revolution_box" => "Revolution Slider", "blog_box" => "Blog Posts", "contact_info_box" => "Contact Info", "contact_form" => "Contact Form", "google_map" => "Google Map", "all_content_boxes" => "Home Page Content", "portfolio_box" => "Portfolio", "product_box" => "Product", "woo_products_box" => "WooCommerce Products", "sidebar_box" => "Widget Area - Sidebar", "default_content" => "Default Content + Page Title", "banner_box" => "Banner Box", "heading_bar" => "Heading Bar", "code_box" => "Code Box");
     //remove module if woocommerce not installed
     if (!class_exists('Woocommerce')) {
         unset($rt_items["woo_products_box"]);
     }
     // Pages
     $rt_getpages = RTTheme::rt_get_pages();
     // Categories
     $rt_getcat = RTTheme::rt_get_categories();
     // Product Categories
     $rt_product_getcat = RTTheme::rt_get_product_categories();
     // Woo Product Categories
     if (class_exists('Woocommerce')) {
         $rt_woo_product_getcat = RTTheme::rt_get_woo_product_categories();
     }
     // reset query
     wp_reset_query();
     // get saved values
     $savedTemplates = get_option('rt_page_layouts');
     // costruct form arrays
     $options = array();
     //template builder info text
     array_push($options, array("name" => __("Info", 'rt_theme_admin'), "desc" => __('Template Builder is a built-in tool that lets you create custom page templates to use with your pages or posts. You are free to edit the default templates or create a new one as you wish. In order to use this templates edit a page or post and select the template name from the list under "RT-THEME TEMPLATE OPTIONS" box and save the page.  To learn more, go to <a href="admin.php?page=rt_setup_assistant">Setup Assistant</a> and read "How To Use Template Builder".', 'rt_theme_admin'), "hr" => "true", "type" => "info"));
     if ($savedTemplates) {
         foreach ($savedTemplates->templates as $template) {
             $TemplateID = $template->templateID;
             $template_name = $template->templateName;
             $lineUp = isset($template->lineup) ? $template->lineup : "";
             //Temlates Div
             array_push($options, array("id" => "div_" . $TemplateID, "name" => $template_name, "type" => "div"));
             //Template Name
             array_push($options, array("name" => __("Template Name", 'rt_theme_admin'), "value" => $template_name, "id" => $TemplateID . "_template_name", "class" => "sidebar_name saved", "hr" => "true", "type" => "text"));
             //Sidebar selection
             array_push($options, array("name" => __("Select a Page Layout", 'rt_theme_admin'), "id" => $TemplateID . "_sidebarSelection", "options" => array("full" => "Full Width", "left" => "Left Sidebar", "right" => "Right Sidebar"), "value" => $template->sidebar, "purpose" => "page_layouts", "hr" => "true", "class" => "layout_selector", "type" => "radio"));
             //Create Item Select List
             array_push($options, array("name" => __("Module List", 'rt_theme_admin'), "id" => $TemplateID . "_item_list", "options" => $rt_items, "default" => "", "purpose" => "sidebar", "sidebuttonName" => "Add", "sidebuttonClass" => "rt_template_item_add_button add_button", "type" => "select"));
             //Heading
             array_push($options, array("name" => __("Modules", 'rt_theme_admin'), "id" => $TemplateID . "_header", "default" => "", "purpose" => "page_layouts", "type" => "heading"));
             //Create Grid First Part
             array_push($options, array("id" => $TemplateID . "_grid", "purpose" => "page_layouts", "type" => "grid", "part" => "first"));
             if (isset($template->contents) && is_array($template->contents)) {
                 foreach ($template->contents as $templateContents) {
                     //possible empty values - fix php warnings
                     $templateContents->categories = isset($templateContents->categories) ? $templateContents->categories : "";
                     $templateContents->thumbs_width = isset($templateContents->thumbs_width) ? $templateContents->thumbs_width : "";
                     $templateContents->thumbs_height = isset($templateContents->thumbs_height) ? $templateContents->thumbs_height : "";
                     $templateContents->filterable = isset($templateContents->filterable) ? $templateContents->filterable : "";
                     $templateContents->list_order = isset($templateContents->list_order) ? $templateContents->list_order : "";
                     //Call Home Page Box
                     if ($templateContents->content_type == "home_page_box") {
                         array_push($options, array("id" => $TemplateID . "_home_page_contents", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'content_id' => $templateContents->content_id), "purpose" => "page_layouts", "content_type" => "home_page_box", "type" => "template_item"));
                     }
                     //Call Portfolio Posts
                     if ($templateContents->content_type == "portfolio_box") {
                         array_push($options, array("id" => $TemplateID . "_portfolio_posts", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'categories' => @$templateContents->categories, 'pagination' => $templateContents->pagination, 'item_width' => $templateContents->item_width, 'portf_list_orderby' => $templateContents->portf_list_orderby, 'portf_list_order' => $templateContents->portf_list_order, 'item_per_page' => $templateContents->item_per_page, 'filterable' => $templateContents->filterable), "purpose" => "page_layouts", "content_type" => "portfolio_box", "type" => "template_item"));
                     }
                     //Call Sidebar Box
                     if ($templateContents->content_type == "sidebar_box") {
                         array_push($options, array("id" => $TemplateID . "_sidebar_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'sidebar_id' => $templateContents->sidebar_id, 'widget_box_width' => $templateContents->widget_box_width), "purpose" => "page_layouts", "content_type" => "sidebar_box", "type" => "template_item"));
                     }
                     //Call Default Content Box
                     if ($templateContents->content_type == "default_content") {
                         array_push($options, array("id" => $TemplateID . "_default_content", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'heading' => $templateContents->heading), "purpose" => "page_layouts", "content_type" => "default_content", "type" => "template_item"));
                     }
                     //Call All content boxes
                     if ($templateContents->content_type == "all_content_boxes") {
                         array_push($options, array("id" => $TemplateID . "_all_content_boxes", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'content_id' => $templateContents->content_id, 'item_width' => $templateContents->item_width, 'list_orderby' => $templateContents->list_orderby, 'list_order' => $templateContents->list_order), "purpose" => "page_layouts", "content_type" => "all_content_boxes", "type" => "template_item"));
                     }
                     //Call banner boxes
                     if ($templateContents->content_type == "banner_box") {
                         array_push($options, array("id" => $TemplateID . "_banner_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'text' => stripslashes($templateContents->text), 'button_text' => $templateContents->button_text, 'button_link' => $templateContents->button_link), "purpose" => "page_layouts", "content_type" => "banner_box", "type" => "template_item"));
                     }
                     //Call slider boxes
                     if ($templateContents->content_type == "slider_box") {
                         array_push($options, array("id" => $TemplateID . "_slider_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'slider_script' => $templateContents->slider_script, 'content_id' => $templateContents->content_id, 'slider_timeout' => $templateContents->slider_timeout, 'slider_height' => $templateContents->slider_height, 'image_resize' => $templateContents->image_resize, 'image_crop' => $templateContents->image_crop, 'list_orderby' => $templateContents->list_orderby, 'list_order' => $templateContents->list_order, 'slider_buttons' => $templateContents->slider_buttons, 'slider_thumbs' => $templateContents->slider_thumbs, 'thumbs_width' => $templateContents->thumbs_width, 'thumbs_height' => $templateContents->thumbs_height, 'slider_effect' => $templateContents->slider_effect), "purpose" => "page_layouts", "content_type" => "slider_box", "type" => "template_item"));
                     }
                     //Call revolution slider boxes
                     if ($templateContents->content_type == "revolution_box") {
                         array_push($options, array("id" => $TemplateID . "_revolution_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'slider_id' => $templateContents->slider_id), "purpose" => "page_layouts", "content_type" => "revolution_box", "type" => "template_item"));
                     }
                     //Call product boxes
                     if ($templateContents->content_type == "product_box") {
                         array_push($options, array("id" => $TemplateID . "_product_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'item_width' => $templateContents->item_width, 'ajax_scroller' => @$templateContents->ajax_scroller, 'pagination' => $templateContents->pagination, 'list_orderby' => $templateContents->list_orderby, 'list_order' => $templateContents->list_order, 'categories' => @$templateContents->categories, 'item_per_page' => $templateContents->item_per_page), "purpose" => "page_layouts", "content_type" => "product_box", "type" => "template_item"));
                     }
                     if (class_exists('Woocommerce')) {
                         //Call woo product boxes
                         if ($templateContents->content_type == "woo_products_box") {
                             array_push($options, array("id" => $TemplateID . "_woo_products_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'item_width' => $templateContents->item_width, 'list_orderby' => $templateContents->list_orderby, 'list_order' => $templateContents->list_order, 'categories' => @$templateContents->categories, 'item_per_page' => $templateContents->item_per_page), "purpose" => "page_layouts", "content_type" => "woo_products_box", "type" => "template_item"));
                         }
                     }
                     //Call blog boxes
                     if ($templateContents->content_type == "blog_box") {
                         array_push($options, array("id" => $TemplateID . "_blog_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'pagination' => $templateContents->pagination, 'list_orderby' => $templateContents->list_orderby, 'list_order' => @$templateContents->list_order, 'categories' => @$templateContents->categories, 'item_per_page' => $templateContents->item_per_page), "purpose" => "page_layouts", "content_type" => "blog_box", "type" => "template_item"));
                     }
                     //Call google map
                     if ($templateContents->content_type == "google_map") {
                         array_push($options, array("id" => $TemplateID . "_google_map", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'map_url' => stripslashes($templateContents->map_url), 'height' => $templateContents->height), "purpose" => "page_layouts", "content_type" => "google_map", "type" => "template_item"));
                     }
                     //Call contact form
                     if ($templateContents->content_type == "contact_form") {
                         array_push($options, array("id" => $TemplateID . "_contact_form", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'title' => stripslashes($templateContents->title), 'email' => $templateContents->email, 'shortcode' => stripslashes($templateContents->shortcode), 'description' => stripslashes($templateContents->description)), "purpose" => "page_layouts", "content_type" => "contact_form", "type" => "template_item"));
                     }
                     //Call contact info box
                     if ($templateContents->content_type == "contact_info_box") {
                         array_push($options, array("id" => $TemplateID . "_contact_info_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'contact_title' => stripslashes($templateContents->contact_title), 'contact_text' => stripslashes($templateContents->contact_text), 'address' => stripslashes($templateContents->address), 'phone' => stripslashes($templateContents->phone), 'email' => stripslashes($templateContents->email), 'support_email' => stripslashes($templateContents->support_email), 'fax' => stripslashes($templateContents->fax)), "purpose" => "page_layouts", "content_type" => "contact_info_box", "type" => "template_item"));
                     }
                     //Call heading bar
                     if ($templateContents->content_type == "heading_bar") {
                         array_push($options, array("id" => $TemplateID . "_heading_bar", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'heading' => stripslashes($templateContents->heading)), "purpose" => "page_layouts", "content_type" => "heading_bar", "type" => "template_item"));
                     }
                     //Call code box
                     if ($templateContents->content_type == "code_box") {
                         array_push($options, array("id" => $TemplateID . "_code_box", "options" => array('group_id' => $templateContents->group_id, 'layout' => $templateContents->layout, 'heading' => stripslashes($templateContents->heading), 'code_space' => stripslashes($templateContents->code_space), 'transparent' => stripslashes($templateContents->transparent), 'no_padding' => stripslashes($templateContents->no_padding)), "purpose" => "page_layouts", "content_type" => "code_box", "type" => "template_item"));
                     }
                 }
             }
             //Create Grid Second Part
             array_push($options, array("id" => $TemplateID . "_grid", "purpose" => "page_layouts", "type" => "grid", "part" => "second"));
             //Delete Button
             if ($TemplateID != "templateid_001" && $TemplateID != "templateid_002" && $TemplateID != "templateid_003" && $TemplateID != "templateid_004" && $TemplateID != "templateid_005") {
                 array_push($options, array("name" => __("Delete Template", 'rt_theme_admin'), "id" => $TemplateID . "_delete", "class" => "deleteButton deteleTemplateButton", "purpose" => "sidebar", "type" => "button"));
             }
             //Sidebar Divend
             array_push($options, array("id" => "", "type" => "divend"));
         }
     }
     // New Sidebar
     $templateID = 'templateid_' . rand(1000, 1000000);
     $templateName = $templateID . '_template_name';
     //Sidebar Div
     array_push($options, array("name" => __("Create New Template", 'rt_theme_admin'), "id" => "div_" . $templateID, "class" => "new_sidebar", "type" => "div"));
     //Template Names
     array_push($options, array("name" => __("Template Name", 'rt_theme_admin'), "value" => "", "class" => "sidebar_name", "hr" => "true", "id" => $templateName, "type" => "text"));
     //Sidebar selection
     array_push($options, array("name" => __("Select a Page Layout", 'rt_theme_admin'), "id" => $templateID . "_sidebarSelection", "options" => array("full" => "Full Width", "left" => "Left Sidebar", "right" => "Right Sidebar"), "value" => "full", "purpose" => "page_layouts", "class" => "layout_selector", "hr" => "true", "type" => "radio"));
     //Create Item Select List
     array_push($options, array("name" => __("Module List", 'rt_theme_admin'), "id" => $templateID . "_item_list", "options" => $rt_items, "default" => "", "purpose" => "sidebar", "sidebuttonName" => "Add", "sidebuttonClass" => "rt_template_item_add_button add_button", "type" => "select"));
     //Heading
     array_push($options, array("name" => __("Modules", 'rt_theme_admin'), "id" => $templateID . "_header", "default" => "", "purpose" => "page_layouts", "type" => "heading"));
     //Create Grid
     array_push($options, array("id" => $templateID . "_grid", "purpose" => "page_layouts", "type" => "grid", "part" => "full"));
     //Send button
     array_push($options, array("name" => __("Create Template", 'rt_theme_admin'), "id" => $templateID . "_send_button", "class" => "create_button", "purpose" => "page_layouts", "type" => "send_button"));
     //Sidebar Divend
     array_push($options, array("id" => "", "type" => "divend"));
     $this->rt_generate_form_page($options);
 }
Пример #19
0
 function rt_generate_homepage_box($theGroupID, $theTemplateID, $options, $randomClass)
 {
     $boxName = __("Home Page Post", "rt_theme_admin");
     $contet_type = "home_page_content";
     $theTemplateID = str_replace('_' . $contet_type, '', $theTemplateID);
     $isNewBox = trim($randomClass) == "" ? false : true;
     $opacity = 1;
     $layout = $isNewBox ? 'full expanded"' : $options['layout'];
     $position = $isNewBox ? 'open minus' : 'plus';
     $data_position = $isNewBox ? '' : 'display: none;';
     $content_id = $isNewBox ? '' : $options['content_id'];
     echo '<li class="ui-state-default ' . $layout . '" style="opacity:' . $opacity . ';">';
     echo '<div class="box_shadow"><div class="Itemholder"> <div class="Itemheader"><h5>' . $boxName . '</h5>';
     echo '<div class="expand ' . $position . '"></div><div class="move"></div></div> <div class="ItemData" style="' . $data_position . '">';
     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 . '">';
     $options = array(array("name" => __("Select Box Size", 'rt_theme_admin'), "desc" => __("Please select a box size for the content.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_home_page_box[]", "options" => array("one" => "Full Width", "two" => "1:2 - One Second", "three" => "1:3 - One Third", "four" => "1:4 - One Fourth", "five" => "1:5 - One Fifth", "two-three" => "2:3 - Second Third", "three-four" => "3:4 - Third Fourth", "four-five" => "4:5 - Four Fifth"), "default" => "one", "value" => $layout, "class" => "layout_selector", "hr" => "true", "type" => "select"), array("name" => __("Select Box Content", 'rt_theme_admin'), "desc" => __("Please select a home page post for this box.", 'rt_theme_admin'), "id" => $theTemplateID . '_' . $theGroupID . "_home_page_box[]", "options" => RTTheme::rt_get_homecontents(), "class" => $randomClass, "value" => $content_id, "hr" => "true", "type" => "select"), array("name" => __("delete", 'rt_theme_admin'), "id" => "_delete", "class" => "deleteButton template_box_delete", "purpose" => "page_template", "type" => "button"), array("name" => __("close", 'rt_theme_admin'), "id" => "_close", "class" => "closeButton template_box_close", "purpose" => "page_template", "type" => "button"));
     echo $this->rt_generate_forms($options);
     echo '</div></div></div></li>';
 }
Пример #20
0
 function generate_template_forms()
 {
     //remove module if woocommerce not installed
     if (!class_exists('Woocommerce')) {
         unset($this->rt_modules["woo_products_box"]);
     }
     //remove module if layerslider not installed
     if (!rt_check_layer_slider()) {
         unset($this->rt_modules["layerslider_box"]);
     }
     //remove module if revslider not installed
     if (!class_exists('RevSlider')) {
         unset($this->rt_modules["revslider_box"]);
     }
     // Pages
     $rt_getpages = RTTheme::rt_get_pages();
     // Categories
     $rt_getcat = RTTheme::rt_get_categories();
     // Product Categories
     $rt_product_getcat = RTTheme::rt_get_product_categories();
     // Woo Product Categories
     if (class_exists('Woocommerce')) {
         $rt_woo_product_getcat = RTTheme::rt_get_woo_product_categories();
     }
     // reset query
     wp_reset_query();
     // get saved tempalates list
     $savedTemplatesList = get_option(RT_THEMESLUG . '_template_names_array');
     // costruct form arrays
     $options = array();
     //template builder info text
     array_push($options, array("name" => __("Info", 'rt_theme_admin'), "desc" => __('Template Builder is a build-in tool that lets you create custom page templates to use with your pages or posts. You are free to edit the default templates or create as many new templates as you wish. In order to use the templates edit a page or post and select the template name from the list under "RT-THEME TEMPLATE OPTIONS" box and save the page. To learn more, go to <a href="admin.php?page=rt_setup_assistant">Setup Assistant</a> and read "How To Use Template Builder".', 'rt_theme_admin'), "hr" => "true", "type" => "info"));
     if ($savedTemplatesList) {
         foreach ($savedTemplatesList as $TemplateID => $templateData) {
             // get saved templates list
             $savedTemplates = get_option(RT_THEMESLUG . '_template_names_array');
             // get this tempalate data
             $thisTemplate = $this->get_template_data($TemplateID);
             if (is_object($thisTemplate)) {
                 // init the form
                 foreach ($thisTemplate->templates as $template) {
                     //tempalte name
                     $template_name = $templateData["name"];
                     //Start Form
                     array_push($options, array("type" => "form_start", "template_id" => $TemplateID, "form_class" => "template_builder_form", "template_name" => $template_name));
                     //Hidden Value
                     array_push($options, array("type" => "hidden", "id" => "templateBuilder", "value" => "true"));
                     //End Form
                     array_push($options, array("type" => "form_end"));
                 }
             }
         }
     }
     // New Template
     $randomnumber = rand(1000, 1000000);
     $TemplateID = 'templateid_' . $randomnumber;
     $templateName = $TemplateID . '_template_name';
     //Start Form
     array_push($options, array("type" => "form_start", "template_id" => $TemplateID, "form_class" => "template_builder_form", "template_name" => __("New Template #" . $randomnumber, 'rt_theme_admin')));
     //Start header row
     array_push($options, array("id" => "templateid_" . $TemplateID . "_1_grid", "options" => array('group_id' => 1, 'part' => 'full', 'header_purpose' => true, 'footer_purpose' => false, 'newtemplate' => true), "purpose" => "page_layouts", "content_type" => "grid", "type" => "template_item"));
     //Start grid
     array_push($options, array("id" => "templateid_" . $TemplateID . "_2_grid", "options" => array('group_id' => 2, 'part' => 'full', 'header_purpose' => false, 'footer_purpose' => false), "purpose" => "page_layouts", "content_type" => "grid", "type" => "template_item"));
     //Start footer row
     array_push($options, array("id" => "templateid_" . $TemplateID . "_3_grid", "options" => array('group_id' => 3, 'part' => 'full', 'header_purpose' => false, 'footer_purpose' => true, 'newtemplate' => true), "purpose" => "page_layouts", "content_type" => "grid", "type" => "template_item"));
     //End Form
     array_push($options, array("type" => "form_end"));
     //template builder list templates
     array_push($options, array("type" => "list_templates", "templateID" => $TemplateID));
     $this->rt_generate_form_page($options, 'template_builder', $TemplateID);
 }
Пример #21
0
    function form($instance)
    {
        $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
        $columns = isset($instance['columns']) ? $instance['columns'] : "";
        $categories = isset($instance['categories']) ? $instance['categories'] : array();
        $newWidget = isset($instance['newWidget']) ? $instance['newWidget'] : "";
        $count = empty($instance['count']) ? 5 : $instance['count'];
        $show_decs = isset($instance['show_decs']) ? $instance['show_decs'] : "";
        // Categories
        $rt_getcat = RTTheme::rt_get_product_categories_with_slugs();
        // Columns
        $rt_columns = array(1 => "1/1", 2 => "1/2", 3 => "1/3", 4 => "1/4", 5 => "1/5");
        ?>
		<p><label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:', 'rt_theme_admin');
        ?>
</label>
		<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
" /></p>
		
		<p><label for="<?php 
        echo $this->get_field_id('columns');
        ?>
"><?php 
        _e('Columns:', 'rt_theme_admin');
        ?>
</label>
		
		<select class="widefat"   name="<?php 
        echo $this->get_field_name('columns');
        ?>
" id="<?php 
        echo $this->get_field_id('columns');
        ?>
" title="<?php 
        _e('Select', 'rt_theme_admin');
        ?>
">

			<?php 
        foreach ($rt_columns as $op_val => $option) {
            if ($op_val == $columns) {
                $selected = "selected";
            }
            ?>
				<option value="<?php 
            echo $op_val;
            ?>
" <?php 
            echo empty($selected) ? "" : 'selected="selected"';
            ?>
 >
					<?php 
            echo $option;
            ?>
				</option>
			 <?php 
            $selected = '';
        }
        ?>
		</select>

		<p><label for="<?php 
        echo $this->get_field_id('categories');
        ?>
"><?php 
        _e('Select Product Categories:', 'rt_theme_admin');
        ?>
</label>
		
		<select class="widefat <?php 
        echo empty($newWidget) ? '' : 'multiple';
        ?>
"   name="<?php 
        echo $this->get_field_name('categories');
        ?>
[]" id="<?php 
        echo $this->get_field_id('categories');
        ?>
" multiple="multiple" title="<?php 
        _e('Select', 'rt_theme_admin');
        ?>
">

			<?php 
        foreach ($rt_getcat as $op_val => $option) {
            if ($categories) {
                foreach ($categories as $a_key => $a_value) {
                    if ($a_value == $op_val) {
                        $selected = "selected";
                    }
                }
            }
            ?>
				<option value="<?php 
            echo $op_val;
            ?>
" <?php 
            echo empty($selected) ? "" : 'selected="selected"';
            ?>
 >
					<?php 
            echo $option;
            ?>
				</option>
			 <?php 
            $selected = '';
        }
        ?>
		</select>

		<p><label for="<?php 
        echo $this->get_field_id('count');
        ?>
"><?php 
        _e('Number of products to show:', 'rt_theme_admin');
        ?>
</label>
		<input id="<?php 
        echo $this->get_field_id('count');
        ?>
" name="<?php 
        echo $this->get_field_name('count');
        ?>
" type="text" value="<?php 
        echo $count;
        ?>
" size="4" /></p>
	
		<p><input type="checkbox" class="checkbox" id="<?php 
        echo $this->get_field_id('show_decs');
        ?>
" name="<?php 
        echo $this->get_field_name('show_decs');
        ?>
" <?php 
        checked($show_decs);
        ?>
 />
		<label for="<?php 
        echo $this->get_field_id('show_decs');
        ?>
"><?php 
        _e('Don\'t display product descriptions', 'rt_theme_admin');
        ?>
</label></p>
 
	

	 
		<input class="widefat" id="<?php 
        echo $this->get_field_id('newWidget');
        ?>
" name="<?php 
        echo $this->get_field_name('newWidget');
        ?>
" type="hidden" value="1" />
		
<?php 
    }