function importThemeForm(){ if($_FILES){ WP_Filesystem(); move_uploaded_file($_FILES["template"]["tmp_name"], THEME_CACHE_DIR."/" . $_FILES["template"]["name"]); $nfile = THEME_CACHE_DIR."/" . $_FILES["template"]["name"]; $folder = THEME_CACHE_DIR.'/'.str_replace('.zip', '', $_FILES["template"]["name"]); $unzipit = unzip_file($nfile, $folder); $files = WonderWorksHelper::getUTX($folder); if($files){ foreach($files as $file){ importTemplate($folder.DS.$file,$folder); } } } else { ?> <h2><?php _e('Import a Template','ultimatum');?></h2> <p></p> <form action="" method="post" enctype="multipart/form-data"> <table class="widefat ult-tables"> <tbody> <tr> <th><?php _e('File','ultimatum');?> :</th> <td><input type="file" name="template" /></td> </tr> <tr class="alternate"> <th colspan="2"><?php _e('Options','ultimatum');?></th></tr> <tr> <th><?php _e('Template Name','ultimatum');?> :</th> <td><input type="text" name="template_name" /><br /> <?php _e('If you wish to have the imported template with a different name than its original type the name you desire','ultimatum');?></td> </tr> <tr> <th><?php _e('Import Assignments','ultimatum');?> :</th> <td> <select name="assigners"> <option value="donot"><?php _e('Do not import layout assignments','ultimatum');?></option> <option value="assign"><?php _e('Import layout assignments','ultimatum');?></option> </select> <br /> <?php _e('The imported template may have assignmets to post types categories etc. If you want those assignments to be imported set this option so.','ultimatum');?></td> </tr> </tbody> </table> <p><input type="submit" value="<?php _e('Import','ultimatum');?>" class="button button-primary"/></p> </form> <?php } }
/** * * This file is a core Ultimatum file and should not be edited. * * @package Ultimatum * @author Wonder Foundry http://www.wonderfoundry.com * @link http://ultimatumtheme.com * @version 2.8 */ $check = getAllTemplates(); if(!$check) { $option = THEME_SLUG . '_layouts_installed'; if (!get_option($option)) { require_once(ULTIMATUM_ADMIN_FUNCTIONS . '/template_import.php'); $folder = THEME_DIR . DS . 'ultinstall'; if (is_dir($folder)) { $files = WonderWorksHelper::getUTX($folder); if ($files) { foreach ($files as $file) { importTemplate($folder . DS . $file, $folder, false, true); } } if (file_exists($folder . '/' . THEME_SLUG . '.fonts')) { $raw_content = file_get_contents($folder . '/' . THEME_SLUG . '.fonts'); add_option(THEME_SLUG . '_fonts', $raw_content, false); } add_option($option, 'DONE', false); } } }
* Include Front End CSS Editor */ $ultimatum_css_editor = ULTIMATUM_PLUGINS .DS. 'frontend-css'.DS.'ult-css.php'; require_once $ultimatum_css_editor; /* * Include Widget Extender */ $ultimatum_widget_extender = ULTIMATUM_PLUGINS .DS. 'widget-extender'.DS.'widget-extender.php'; require_once $ultimatum_widget_extender; if(is_admin()){ $ultimatum_menu = ULTIMATUM_PLUGINS .DS. 'ult-mega-menu'.DS.'admin.php'; require_once $ultimatum_menu; } if(get_ultimatum_option('extras', 'ultimatum_shortcodes')){ WonderWorksHelper::requireFromFolder(UTIMATUM_SHORTCODES,"shortcodes"); // insert Tiny Mce button $tinymce_button = ULTIMATUM_PLUGINS.DS.'tinymce'.DS.'tinymce.php'; include $tinymce_button; } /* * Enable Posts Type Order */ if(get_ultimatum_option('extras', 'ultimatum_pto')){ add_action('admin_notices', 'ult_pto_notice'); } if(get_ultimatum_option('extras', 'ultimatum_slideshows')){ $sliders= ULTIMATUM_PLUGINS.DS.'ult-sliders'.DS.'usliders.php'; include $sliders; }