Example #1
0
function ultimatum_themes()
{
    screen_icon();
    echo '<div class="wrap">';
    if (isset($_REQUEST['task'])) {
        $task = $_REQUEST['task'];
    } else {
        $task = false;
    }
    switch ($task) {
        default:
            themesMainScreen();
            break;
        case 'delete':
            deleteTheme();
            break;
        case 'export':
            exportTheme();
            break;
        case 'import':
            importTheme();
            break;
        case 'edit':
            editTheme();
            break;
        case 'default':
            makeDefault();
            break;
        case 'mobileass':
            mobileAssign();
            break;
    }
    echo '</div>';
}
Example #2
0
function ultimatum_themes(){
	
	echo '<div class="wrap">';

	$task=false;
	if(isset($_GET['task'])) $task = $_GET['task'];
	switch ($task){ //
		default:
		    if($_POST){
		        global $wpdb;
		        if(isset($_POST['id'])){
		            if($_POST['gridwork']!="tbs3"){
		                $query = "REPLACE INTO `".ULTIMATUM_TABLE_TEMPLATES."` VALUES ('".$_POST['id']."','".$_POST['name']."','".$_POST['width']."','".$_POST['margin']."','".$_POST['mwidth']."','".$_POST['mmargin']."','".$_POST['swidth']."','".$_POST['smargin']."','".$_POST['gridwork']."','".$_POST['swatch']."','".$_POST['type']."','".$_POST['dcss']."','".$_POST['default']."','".$_POST['theme']."','".$_POST['cdn']."')";
		            } else {
		               $query = "REPLACE INTO `".ULTIMATUM_TABLE_TEMPLATES."` VALUES ('".$_POST['id']."','".$_POST['name']."','".$_POST['width']."','".$_POST['margin']."','".$_POST['mwidth']."','".$_POST['mmargin']."','".$_POST['swidth']."','".$_POST['smargin']."','".$_POST['gridwork']."','".$_POST['swatch3']."','".$_POST['type']."','".$_POST['dcss']."','".$_POST['default']."','".$_POST['theme']."','".$_POST['cdn']."')";
		            }
		        } else {
		            if($_POST['gridwork']!="tbs3"){
		                $query = "INSERT INTO `".ULTIMATUM_TABLE_TEMPLATES."` (`name`,`width`,`margin`,`mwidth`,`mmargin`,`swidth`,`smargin`,`gridwork`,`swatch`,`type`,`dcss`,`default`,`theme`) VALUES ('".$_POST['name']."','".$_POST['width']."','".$_POST['margin']."','".$_POST['mwidth']."','".$_POST['mmargin']."','".$_POST['swidth']."','".$_POST['smargin']."','".$_POST['gridwork']."','".$_POST['swatch']."','".$_POST['type']."','".$_POST['dcss']."','".$_POST['default']."','".$_POST['theme']."','".$_POST['cdn']."')";
		            } else {
		                $query = "INSERT INTO `".ULTIMATUM_TABLE_TEMPLATES."` (`name`,`width`,`margin`,`mwidth`,`mmargin`,`swidth`,`smargin`,`gridwork`,`swatch`,`type`,`dcss`,`default`,`theme`) VALUES ('".$_POST['name']."','".$_POST['width']."','".$_POST['margin']."','".$_POST['mwidth']."','".$_POST['mmargin']."','".$_POST['swidth']."','".$_POST['smargin']."','".$_POST['gridwork']."','".$_POST['swatch3']."','".$_POST['type']."','".$_POST['dcss']."','".$_POST['default']."','".$_POST['theme']."','".$_POST['cdn']."')";
		            }
		        }
		    
		        $wpdb->query($query);
		        $template_id =  $wpdb->insert_id;
		        WonderWorksCSS::saveCSS($template_id,'template');
		        ?>
		        <script type="text/javascript">
		        parent.location.href='./admin.php?page=wonder-templates';
		        </script>
		        <?php 
		    }
			themesMainScreen();
		break;
		case 'createChild':
			createChild();
		break;
		case 'deletetemplate':
			deleteTheme();
		break;
		case 'export':
			Ultimatum_Exporter();
		break;
		case 'import':
			importThemeForm();
		break;
		case 'row-edit':
			RowEditor();
			break;
		case 'row-styles':
			RowStyles();
		break;
		case 'edit':
			$template=null;
			if(isset($_REQUEST["template_id"])) $template = getTemplateInfo($_REQUEST["template_id"]);
			ultimatum_editTemplate($template);
		break;
		case 'default':
			makeDefault();
		break;
		case 'mobileass':
			mobileAssign();
		break;
	}
	echo '</div>'; 
	}