Skip to content
Permalink
Browse files

Added new options for text-shadow, text-decoration, text-transform, a…

…nd font-style.

Modified CSS output to be a single CSS file via admin-ajax.php.
A few CSS updates.
  • Loading branch information...
Chris Wallace
Chris Wallace committed May 2, 2011
1 parent 02ee4ea commit 570f3abf398c465cfce0300b223bc600084e5f94
Showing with 702 additions and 226 deletions.
  1. +109 −3 admin/admin.php
  2. +35 −26 admin/css/up_framework.css
  3. +0 −114 admin/home.php
  4. +36 −16 admin/library/engines/typography-engine.php
  5. +183 −67 admin/library/options/options.php
  6. +339 −0 license.txt
@@ -73,8 +73,8 @@ function upfw_generate_theme_data(){
}
add_action('upfw_admin_init','upfw_generate_theme_data');
add_action('upfw_theme_init','upfw_generate_theme_data');
add_action('upfw_admin_init','upfw_generate_theme_data',1);
add_action('upfw_theme_init','upfw_generate_theme_data',1);
/******
** Upload error msg
@@ -344,7 +344,7 @@ function upfw_set_defaults(){
}
add_action('upfw_theme_activation', 'upfw_set_defaults',1);
add_action('upfw_theme_activation', 'upfw_set_defaults',2);
/******
** Set up global theme options
@@ -521,6 +521,112 @@ function render_options($options){
}
}
if(is_admin()) add_action('upfw_admin_init','upfw_save_options',3);
function upfw_save_options(){
/* ----------------------- Form Security Check -------------------------- */
if(isset($_POST['_wpnonce'])):
//Check if submitted from this domain
check_admin_referer();
//Verify Form Nonce
if (!wp_verify_nonce($_POST['_wpnonce'], 'save_upthemes') )
wp_die('Security exception detected, please try again.');
exit;
endif;
/* ------------------Import/Export Functions ----------------------- */
//Restore Previous Options
global $export_message;
if(isset($_POST['up_restore'])):
$current = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
$backup = get_option('up_themes_'.UPTHEMES_SHORT_NAME.'_backup');
update_option('up_themes_'.UPTHEMES_SHORT_NAME.'_backup', $current);
update_option('up_themes_'.UPTHEMES_SHORT_NAME, $backup);
$export_message = "<p class='import'>" . __("Everything's back to normal now!","upfw") . "</p>";
endif;
//Restore Defaults
if(isset($_POST['up_defaults'])):
$current = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
update_option('up_themes_'.UPTHEMES_SHORT_NAME.'_backup', $current);
delete_option('up_themes_'.UPTHEMES_SHORT_NAME);
$export_message = "<p class='import'>" . __("Default options restored!","upfw") . "<span><form method='post' action=''><input class='up_restore' type='submit' name='up_restore' value='" . __("Click Here to Undo","upfw") . "'></form></span></p>";
endif;
/* ------------------------- Import Options Code ------------------------------- */
if(isset($_POST['up_import']) && isset($_POST['up_import_code'])):
$import = $_POST['up_import_code'];
$import = base64_decode($import);
$import = explode('~~', $import);
//Check if code is legitimate
if(count($import) == 2):
$option_name = $import[0];
$options = explode('||', $import[1]);
foreach ($options as $option):
$option = explode('|', $option);
global $new_options;
$new_options[$option[0]] = preg_replace('/"/', '\'', stripslashes($option[1]));
endforeach;
$current_option = get_option($option_name);
update_option($option_name.'_backup', $current_option);
update_option($option_name, $new_options);
$export_message = "<p class='import'>" . __("Options Code Import Successful!","upfw") . "<span><form method='post' action=''><input class='up_restore' type='submit' name='up_restore' value='" . __("Click Here to Undo","upfw") . "'></form></span></p>";
else:
$export_message = "<p class='import'>" . __("Oops! Something went wrong. <span>Try pasting your import code again.</span>","upfw") . "</p>";
endif;
endif;
/* ------------------------- Save Theme Options ------------------------------- */
if(isset($_POST['up_save'])):
$posts = $_POST;
foreach($posts as $k => $v):
//Check if option is array (mulitple selects)
if(is_array($v)):
//Check if array is empty
$check = 0;
foreach($v as $key => $value):
if($value != ''):
$check++;
endif;
endforeach;
//If array is not empty
if($check > 0 ):
//Remove empty array elements
$post[$k] = array_filter($v);
else:
$post[$k] = '';
endif;
$check = 0;
else:
//Remove slashes
$post[$k] = preg_replace('/"/', '\'', stripslashes($v));
endif;
endforeach;
//Add options array to wp_options table
print_r($post);
update_option('up_themes_'.UPTHEMES_SHORT_NAME, $post);
endif;
/* ---------------------- Default Options Functions ----------------- */
global $default_check;
global $default_options;
$option_check = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
if($option_check):
$default_check = true;
else:
$default_check = false;
endif;
}
/******
** Remove Ugly First Link in
** WP Sidebar Menu
@@ -642,7 +642,9 @@

#upthemes_framework fieldset a.clear{
display: inline-block;
margin-left: 10px;
margin-left: 0;
float: left;
margin-top: 4px;
}

#upthemes_framework .thumbs{
@@ -756,31 +758,6 @@
right:5px;
}

#upthemes_framework li.typography .type_fields{
width: auto;
width: 250px;
}

#upthemes_framework li.typography .type_fields label{
font-size: 0.9em;
}

#upthemes_framework li.typography .type_fields select{
width: 250px;
float: none;
margin-bottom: 5px;
}

#upthemes_framework li.typography .type_preview{
padding: 20px 0;
width: 540px;
overflow: hidden;
}

#upthemes_framework li.typography select{
width: 140px;
}

/* @end */

/* @group Layout Engine Styles */
@@ -901,6 +878,26 @@

/* @group Typography Engine Options */

#upthemes_framework li.typography .type_fields label{
font-size: 0.9em;
}

#upthemes_framework li.typography .type_fields select{
width: 250px;
float: none;
margin-bottom: 5px;
}

#upthemes_framework li.typography .type_preview{
padding: 20px 0;
width: 540px;
overflow: hidden;
}

#upthemes_framework li.typography select{
width: 140px;
}

#upthemes_framework #font-preview{
display: block;
width: auto;
@@ -941,4 +938,16 @@
margin:0 0 5px;
}

#upthemes_framework .typography fieldset.title,
#upthemes_framework .typography fieldset.data{
width: 100%;
max-width: 100%;
}

#upthemes_framework .typography fieldset fieldset{
width: 50%;
max-width: 50%;
float: left;
}

/* @end */
@@ -9,120 +9,6 @@
<div id="upthemes_framework" class="wrap">

<?php upfw_admin_header(); ?>

<?php
/* ----------------------- Form Security Check -------------------------- */
if(isset($_POST['_wpnonce'])):
//Check if submitted from this domain
check_admin_referer();
//Verify Form Nonce
if (!wp_verify_nonce($_POST['_wpnonce'], 'save_upthemes') )
wp_die('Security exception detected, please try again.');
endif;
/* ------------------Import/Export Functions ----------------------- */
//Restore Previous Options
global $export_message;
if(isset($_POST['up_restore'])):
$current = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
$backup = get_option('up_themes_'.UPTHEMES_SHORT_NAME.'_backup');
update_option('up_themes_'.UPTHEMES_SHORT_NAME.'_backup', $current);
update_option('up_themes_'.UPTHEMES_SHORT_NAME, $backup);
$export_message = "<p class='import'>" . __("Everything's back to normal now!","upfw") . "</p>";
endif;
//Restore Defaults
if(isset($_POST['up_defaults'])):
$current = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
update_option('up_themes_'.UPTHEMES_SHORT_NAME.'_backup', $current);
delete_option('up_themes_'.UPTHEMES_SHORT_NAME);
$export_message = "<p class='import'>" . __("Default options restored!","upfw") . "<span><form method='post' action=''><input class='up_restore' type='submit' name='up_restore' value='" . __("Click Here to Undo","upfw") . "'></form></span></p>";
endif;
/* ------------------------- Import Options Code ------------------------------- */
if(isset($_POST['up_import']) && isset($_POST['up_import_code'])):
$import = $_POST['up_import_code'];
$import = base64_decode($import);
$import = explode('~~', $import);
//Check if code is legitimate
if(count($import) == 2):
$option_name = $import[0];
$options = explode('||', $import[1]);
foreach ($options as $option):
$option = explode('|', $option);
global $new_options;
$new_options[$option[0]] = preg_replace('/"/', '\'', stripslashes($option[1]));
endforeach;
$current_option = get_option($option_name);
update_option($option_name.'_backup', $current_option);
update_option($option_name, $new_options);
$export_message = "<p class='import'>" . __("Options Code Import Successful!","upfw") . "<span><form method='post' action=''><input class='up_restore' type='submit' name='up_restore' value='" . __("Click Here to Undo","upfw") . "'></form></span></p>";
else:
$export_message = "<p class='import'>" . __("Oops! Something went wrong. <span>Try pasting your import code again.</span>","upfw") . "</p>";
endif;
endif;
/* ------------------------- Save Theme Options ------------------------------- */
if(isset($_POST['up_save'])):
$posts = $_POST;
foreach($posts as $k => $v):
//Check if option is array (mulitple selects)
if(is_array($v)):
//Check if array is empty
$check = 0;
foreach($v as $key => $value):
if($value != ''):
$check++;
endif;
endforeach;
//If array is not empty
if($check > 0 ):
//Remove empty array elements
$post[$k] = array_filter($v);
else:
$post[$k] = '';
endif;
$check = 0;
else:
//Remove slashes
$post[$k] = preg_replace('/"/', '\'', stripslashes($v));
endif;
endforeach;
//Add options array to wp_options table
update_option('up_themes_'.UPTHEMES_SHORT_NAME, $post);
endif;
/* ---------------------- Default Options Functions ----------------- */
global $default_check;
global $default_options;
$option_check = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
if($option_check):
$default_check = true;
else:
$default_check = false;
endif;
//Get all options from the database
$up_options_db = get_option('up_themes_'.UPTHEMES_SHORT_NAME);
global $up_options;
//Check if options are stored properly
if(is_array($up_options_db)):
//Check array to an object
foreach ($up_options_db as $k => $v) {
$up_options -> {$k} = $v;
}
endif;
?>

<form method="post" enctype="multipart/form-data" action="" id="theme-options" name="theme-options">

0 comments on commit 570f3ab

Please sign in to comment.
You can’t perform that action at this time.