From 2dcd244cf8b43a5fddb02af4c0379da22e235787 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 10 Sep 2009 21:03:27 -0400 Subject: [PATCH] more admin cleanup --- classes/WhatDidTheySayAdmin.php | 26 +++++++++----------------- classes/admin.inc | 4 ++-- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/classes/WhatDidTheySayAdmin.php b/classes/WhatDidTheySayAdmin.php index 7c9c6e1..b16b497 100644 --- a/classes/WhatDidTheySayAdmin.php +++ b/classes/WhatDidTheySayAdmin.php @@ -292,17 +292,13 @@ class WhatDidTheySayAdmin { $updated = false; if (current_user_can('edit_users')) { $options = get_option('what-did-they-say-options'); - switch ($info['action']) { - case "capabilities": - if (isset($info['capabilities'])) { - foreach (array_keys($this->default_options['capabilities']) as $capability) { - if (isset($info['capabilities'][$capability])) { - $options['capabilities'][$capability] = $info['capabilities'][$capability]; - } - } - $updated = __('User capabilities updated.', 'what-did-they-say'); + if (isset($info['capabilities'])) { + foreach (array_keys($this->default_options['capabilities']) as $capability) { + if (isset($info['capabilities'][$capability])) { + $options['capabilities'][$capability] = $info['capabilities'][$capability]; } - break; + } + $updated = __('User capabilities updated.', 'what-did-they-say'); } if ($updated !== false) { update_option('what-did-they-say-options', $options); @@ -319,13 +315,9 @@ class WhatDidTheySayAdmin { function handle_update_reset_options($info) { $updated = false; if (current_user_can('manage_options')) { - switch ($info['action']) { - case "reset_options": - delete_option('what-did-they-say-options'); - $this->install(); - $updated = __('What Did They Say?!? options reset.', 'what-did-they-say'); - break; - } + delete_option('what-did-they-say-options'); + $this->install(); + $updated = __('What Did They Say?!? options reset.', 'what-did-they-say'); } return $updated; } diff --git a/classes/admin.inc b/classes/admin.inc index ea74d11..5c78487 100644 --- a/classes/admin.inc +++ b/classes/admin.inc @@ -4,7 +4,7 @@
- +

@@ -110,7 +110,7 @@

- +