'title' => 'Newseeeeeeeexxxx',
    'file' => td_global::$get_template_directory . '/includes/demos/fashion/pages/homepage.txt',
    'template' => 'page-pagebuilder-latest.php',   // the page template full file name with .php
    'homepage' => true,
    'td_layout' => 5
));

die;
*/
if (isset($_GET['puiu_test']) and TD_DEPLOY_MODE == 'dev') {
    // clean the user settings
    //td_demo_media::remove();
    td_demo_content::remove();
    td_demo_category::remove();
    td_demo_menus::remove();
    td_demo_widgets::remove();
    $td_demo_installer = new td_demo_installer();
    // remove panel settings and recompile the css as empty
    foreach (td_global::$td_options as $option_id => $option_value) {
        td_global::$td_options[$option_id] = '';
    }
    //typography settings
    td_global::$td_options['td_fonts'] = '';
    //css font files (google) buffer
    td_global::$td_options['td_fonts_css_files'] = '';
    //compile user css if any
    td_global::$td_options['tds_user_compile_css'] = td_css_generator();
    update_option(TD_THEME_OPTIONS_NAME, td_global::$td_options);
    td_demo_state::update_state($_GET['puiu_test'], 'full');
    // load panel settings
    $td_demo_installer->import_panel_settings(td_global::$demo_list[$_GET['puiu_test']]['folder'] . 'td_panel_settings.txt');
Beispiel #2
0
 function ajax_stacks_controller()
 {
     if (!current_user_can('switch_themes')) {
         echo 'Permission denied!';
     }
     // try to extend the time limit
     @set_time_limit(240);
     $td_demo_action = td_util::get_http_post_val('td_demo_action');
     $td_demo_id = td_util::get_http_post_val('td_demo_id');
     /*  ----------------------------------------------------------------------------
            Uninstall button - do uninstall with content
         */
     if ($td_demo_action == 'uninstall_demo') {
         // remove our content
         td_demo_media::remove();
         td_demo_content::remove();
         td_demo_category::remove();
         td_demo_menus::remove();
         td_demo_widgets::remove();
         // restore all settings to the state before a demo was loaded
         $td_demo_history = new td_demo_history();
         $td_demo_history->restore_all();
         // update our state - no stack installed
         td_demo_state::update_state('', '');
     } else {
         if ($td_demo_action == 'remove_content_before_install_no_content') {
             // save the history - this class will save the history only when going from user settings -> stack
             $td_demo_history = new td_demo_history();
             $td_demo_history->save_all();
             // clean the user settings
             td_demo_media::remove();
             td_demo_content::remove();
             td_demo_category::remove();
             td_demo_menus::remove();
             td_demo_widgets::remove();
             // remove panel settings and recompile the css as empty
             foreach (td_global::$td_options as $option_id => $option_value) {
                 td_global::$td_options[$option_id] = '';
             }
             //typography settings
             td_global::$td_options['td_fonts'] = '';
             //css font files (google) buffer
             td_global::$td_options['td_fonts_css_files'] = '';
             //compile user css if any
             td_global::$td_options['tds_user_compile_css'] = td_css_generator();
             update_option(TD_THEME_OPTIONS_NAME, td_global::$td_options);
         } else {
             if ($td_demo_action == 'install_no_content_demo') {
                 td_demo_state::update_state($td_demo_id, 'no_content');
                 // load panel settings - this will also recompile the css
                 $this->import_panel_settings(td_global::$demo_list[$td_demo_id]['folder'] . 'td_panel_settings.txt', false);
             } else {
                 if ($td_demo_action == 'remove_content_before_install') {
                     // save the history - this class will save the history only when going from user settings -> stack
                     $td_demo_history = new td_demo_history();
                     $td_demo_history->save_all();
                     // clean the user settings
                     td_demo_media::remove();
                     td_demo_content::remove();
                     td_demo_category::remove();
                     td_demo_menus::remove();
                     td_demo_widgets::remove();
                 } else {
                     if ($td_demo_action == 'td_media_1') {
                         // change our state
                         td_demo_state::update_state($td_demo_id, 'full');
                         // load panel settings
                         $this->import_panel_settings(td_global::$demo_list[$td_demo_id]['folder'] . 'td_panel_settings.txt', true);
                         // load the media import script
                         require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_media_1.php';
                     } else {
                         if ($td_demo_action == 'td_media_2') {
                             // load the media import script
                             require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_media_2.php';
                         } else {
                             if ($td_demo_action == 'td_media_3') {
                                 // load the media import script
                                 require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_media_3.php';
                             } else {
                                 if ($td_demo_action == 'td_media_4') {
                                     // load the media import script
                                     require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_media_4.php';
                                 } else {
                                     if ($td_demo_action == 'td_media_5') {
                                         // load the media import script
                                         require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_media_5.php';
                                     } else {
                                         if ($td_demo_action == 'td_media_6') {
                                             // load the media import script
                                             require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_media_6.php';
                                         } else {
                                             if ($td_demo_action == 'td_import') {
                                                 require_once td_global::$demo_list[$td_demo_id]['folder'] . 'td_import.php';
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }