Skip to content

Commit

Permalink
Code formatting persnicketiness
Browse files Browse the repository at this point in the history
  • Loading branch information
splorp committed Nov 29, 2011
1 parent 8d47232 commit 135e209
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* @subpackage Tersus
*/


// Define Theme Constants

$theme_data = get_theme_data(TEMPLATEPATH.'/style.css');
Expand Down Expand Up @@ -40,52 +39,37 @@
);


// Tersus Options Admin
// Tersus Theme Options Admin

function tersus_add_admin() {

global $themename, $shortname, $options;

if ( $_GET['page'] == basename(__FILE__) ) {

if ( 'save' == $_REQUEST['action'] ) {

foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] );
}

foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] );
} else {
delete_option( $value['id'] );
}
}

header("Location: themes.php?page=functions.php&saved=true");

die;

} else if( 'reset' == $_REQUEST['action'] ) {

foreach ($options as $value) {
delete_option( $value['id'] );
}

header("Location: themes.php?page=functions.php&reset=true");
die;

}
}

add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'tersus_admin');

}

function tersus_admin() {

global $themename, $shortname, $options;

if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' options have been saved.</strong></p></div>';
if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' options have been reset to their default settings.</strong></p></div>';

Expand All @@ -94,15 +78,12 @@ function tersus_admin() {
<div class="wrap">
<div id="icon-themes" class="icon32"><br /></div>
<h2><?php echo $themename; ?> Options</h2>

<form method="post">

<table class="form-table">

<?php
foreach ($options as $value) {
switch ( $value['type'] ) {

case 'text':
?>

Expand Down Expand Up @@ -162,7 +143,6 @@ function tersus_admin() {
</form>

<?php

}

add_action('admin_menu', 'tersus_add_admin');
Expand Down

0 comments on commit 135e209

Please sign in to comment.