Пример #1
0
function themesMainScreen(){
    $task=false;
    if(isset($_GET['task'])) $task = $_GET['task'];
	$templates = getAllTemplates();
	$defpage = './admin.php?page=wonder-templates';
	?>
	<h2>
		<?php _e('Templates','ultimatum'); ?>
		<a href="<?php echo $defpage.'&task=edit'; ?>" class="add-new-h2"><?php _e('Add New', 'ultimatum');?></a>
		<a href="<?php echo $defpage.'&task=import'; ?>" class="add-new-h2"><?php _e('Import a Template','ultimatum');?></a>
		<?php 
				if(!CHILD_THEME && (is_multisite() && is_super_admin()) || (!is_multisite())){
			 	?>
			 	<a class="add-new-h2" href="<?php echo $defpage.'&task=createChild'; ?>"><?php _e('Create Child Theme', 'ultimatum');?></a>
			 	<?php } ?>
		<?php do_action('ultimatum_template_menu_extras',$defpage,$task); ?>
		
	</h2>
	<table class="widefat ult-tables">
    <thead>
        <tr>
            <th scope="col" class="manage-column column-name" style=""><?php _e('Template', 'ultimatum'); ?></th>
            <th></th>
            <th></th>
        </tr>
    </thead>
 		<tbody>
		<?php 
		$count = 1;
		$class = '';
		foreach($templates as $template){
			$class = ( $count % 2 == 0 ) ? '' : ' class="alternate"';
			if($template->default==1){ $class =' class="active"';}
			echo '<tr'.$class.'>';	
				echo '<th>';
					echo '<a href="./admin.php?page=wonder-layout&theme='.$template->id.'">'.$template->name.'</a>';
					if($template->type == 1){
						echo ' <small>responsive</small>';
					}
					if($template->type == 2){
						echo ' <small>mobile</small>';
					}
						
					
				echo '<div class="row-actions templateactions">';
				echo '<a href="./admin.php?page=wonder-templates&task=edit&template_id='.$template->id.'" class=""><i class="fa fa-edit"></i> '.__('Edit','ultimatum').'</a>  |  ';
						if($template->default!=1){
							echo '<a href="#" class="defaulttemplate" data-id="'.$template->id.'"><i class="fa fa-cogs"></i> '.__('Set Default','ultimatum').'</a>  |  ';
						}
						if(function_exists('Ultimatum_Exporter')){
							echo '<a href="./index.php?page=ultimatum-export&task=template&template_id='.$template->id.'&TB_iframe=1&width=770&height=480" class="thickbox"><i class="fa fa-cloud-download"></i> '.__('Export','ultimatum').'</a>  |  ';
						}
						echo '<a href="#" class="deletetemplate" data-id="'.$template->id.'" ><i class="fa fa-trash"></i> Delete</a>  |  ';
						
						echo '<a href="./admin.php?page=wonder-templates&task=row-styles&template_id='.$template->id.'" class=""><i class="fa fa-th-large"></i> '.__('Extra Row Styles','ultimatum').'</a>  |  ';
						echo '<a class="thickbox" href="./index.php?page=ultimatum-css-regen&theme='.$template->id.'&TB_iframe=1&width=640&height=380" title="'.__('Regenerate CSS','ultimatum').'">'.__('Regenerate CSS','ultimatum').'</a>';
					echo '</div>';
				echo'</th>';echo '<td>';
				echo '<a href="./admin.php?page=wonder-css&template_id='.$template->id.'" class=""><i class="fa fa-cogs"></i> '.__('CSS','ultimatum').'</a>';
				echo'</td>';echo '<td>';
				echo '<a href="./admin.php?page=wonder-layout&theme='.$template->id.'" class=""><i class="fa fa-desktop"></i> '.__('Layouts','ultimatum').'</a>';
				echo'</td>';
			echo '</tr>';
			$count++;
		}
		?>
		</tbody>
    
	</table>
<?php  
}
Пример #2
0
/*
 WARNING: This file is part of the core Ultimatum framework. DO NOT edit
 this file under any circumstances.
 */

/**
 *
 * 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);