function rt_layer_slider_list()
{
    $get_layer_slider_list = array();
    if (function_exists("lsSliders")) {
        $sliders = lsSliders(200, false, true);
        if (rt_check_layer_slider()) {
            if (is_array($sliders)) {
                foreach ($sliders as $key => $value) {
                    $get_layer_slider_list[$value["id"]] = $value["name"];
                }
            }
        }
    } else {
        $get_layer_slider_list[0] = "Layer Slider has not been installed or activated!";
    }
    return $get_layer_slider_list;
}
Example #2
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);
 }