'',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
$themename = 'Bito';
$shortname = 'bito';
$options = array (
array(
'type' => 'open'
),
array(
'name' => 'Page Navigation',
'desc' => 'Navigation menu location of additional pages other than the \'about\', \'archives\', and \'contact\' pages.',
'id' => $shortname.'_navigation_location',
'type' => 'select',
'options' => array('Sidebar', 'Horizontal Menu'),
'std' => 'Sidebar'
),
array(
'name' => 'Sub-Pages',
'desc' => 'Show sub-pages in navigation menu.',
'id' => $shortname.'_navigation_show_subpages',
'type' => 'checkbox',
'std' => false
),
array(
'type' => 'close'
)
);
function bito_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__), 'bito_admin');
}
function bito_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo ''.$themename.' settings saved.
';
if ( $_REQUEST['reset'] ) echo ''.$themename.' settings reset.
';
?>