__('Layout Settings'), "desc" => __('You can choose different colored layouts'), "id" => $shortname."_layout_settings", "options" => array(__('blue'), __('brown'), __('cyan'), __('gold'), __('green'), __('sandy')), "std" => __('blue'), "type" => "layoutradio" ), /* array( "name" => __('Layout Settings'), "id" => $shortname."_layout_settings", "options" => array(__('blue')), "std" => __('blue'), "type" => "layoutradio" ), */ array( "name" => __('Avatar Settings'), "desc" => __('You can choose if using theme layout specified avatars or default wordpress avatars'), "id" => $shortname."_avatar_settings", "options" => array(__('use 1sr avatars as default'), __('use wordpress avatars as default')), "std" => __('use 1sr avatars as default'), "type" => "radio" ), ); function _1sr_add_admin() { global $themename, $shortname, $options; if(isset($_REQUEST['action'])) { 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; } else if ( 'reset_widgets' == $_REQUEST['action'] ) { $null = null; update_option('sidebars_widgets',$null); header("Location: themes.php?page=functions.php&reset=true"); die; } } add_theme_page($themename." Options", $themename." Options", 'edit_themes', basename(__FILE__), '_lsr_first_admin'); } function _lsr_first_admin() { global $themename, $shortname, $options; if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '
'.$themename.' '.__('Settings saved.').'
'.$themename.' '.__('Settings reset.').'
'.$themename.' '.__('widgets reset.').'