diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/thematic/library/extensions/theme-options.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/themes/thematic/library/extensions/theme-options.php Fri Mar 12 13:29:04 2010 +0000 @@ -0,0 +1,215 @@ + __('Index Insert Position','thematic'), + "desc" => __('The widgetized Index Insert will follow after this post number.','thematic'), + "id" => $shortname."_insert_position", + "std" => "2", + "type" => "text"), + + array( "name" => __('Info on Author Page','thematic'), + "desc" => __("Display a microformatted vCard—with the author's avatar, bio and email—on the author page.",'thematic'), + "id" => $shortname."_authorinfo", + "std" => "false", + "type" => "checkbox"), + + array( "name" => __('Text in Footer','thematic'), + "desc" => __("You can use the following shortcodes in your footer text: [wp-link] [theme-link] [loginout-link] [blog-title] [blog-link] [the-year]",'thematic'), + "id" => $shortname."_footertext", + "std" => __("Powered by [wp-link]. Built on the [theme-link].", 'thematic'), + "type" => "textarea", + "options" => array( "rows" => "5", + "cols" => "94") ), + + ); + +function mytheme_add_admin() { + + global $themename, $shortname, $options, $blog_id; + + 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=theme-options.php&saved=true"); + die; + + } else if( 'reset' == $_REQUEST['action'] ) { + + foreach ($options as $value) { + delete_option( $value['id'] ); } + + header("Location: themes.php?page=theme-options.php&reset=true"); + die; + + } else if ( 'resetwidgets' == $_REQUEST['action'] ) { + update_option('sidebars_widgets',NULL); + header("Location: themes.php?page=theme-options.php&resetwidgets=true"); + die; + } + } + + add_theme_page($themename." Options", "Thematic Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); + +} + +function mytheme_admin() { + + global $themename, $shortname, $options; + + if ( $_REQUEST['saved'] ) echo '
'.$themename.' '.__('settings saved.','thematic').'
'.$themename.' '.__('settings reset.','thematic').'
'.$themename.' '.__('widgets reset.','thematic').'
visit ThemeShaper. Please visit the ThemeShaper Forums if you have any questions about Thematic.', 'thematic'); ?>
+