From ed0971e01542c47f6b644df6bd49d867f0b9a3a1 Mon Sep 17 00:00:00 2001 From: secretr Date: Mon, 14 Sep 2009 21:54:16 +0000 Subject: [PATCH] infopanel improvements --- e107_admin/includes/infopanel.php | 17 ++++++++--------- e107_handlers/form_handler.php | 9 +++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index 86fc628c0..b86130f6e 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -3,7 +3,7 @@ + ----------------------------------------------------------------------------+ | e107 website system | - | �Steve Dunstan 2001-2002 + | Steve Dunstan 2001-2002 | http://e107.org | jalist@e107.org | @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $ - | $Revision: 1.10 $ - | $Date: 2009-09-05 23:02:23 $ - | $Author: e107coders $ + | $Revision: 1.11 $ + | $Date: 2009-09-14 21:54:16 $ + | $Author: secretr $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) @@ -217,7 +217,7 @@ function render_infopanel_options() function render_infopanel_icons() { $frm = e107::getSingleton('e_form'); - global $iconlist,$pluglist; + global $iconlist,$pluglist, $user_pref; $text = ""; foreach ($iconlist as $key=>$icon) { @@ -225,7 +225,7 @@ function render_infopanel_icons() { $checked = (varset($user_pref['core-infopanel-mye107']) && in_array($key, $user_pref['core-infopanel-mye107'])) ? true : false; $text .= "
- ".$icon['icon'].$frm->checkbox('e-mye107[]', $key, $checked).$icon['title']."
"; + ".$icon['icon'].' '.$frm->checkbox_label($icon['title'], 'e-mye107[]', $key, $checked).""; } } if (is_array($pluglist)) @@ -236,7 +236,7 @@ function render_infopanel_icons() { $checked = (in_array('p-'.$key, $user_pref['core-infopanel-mye107'])) ? true : false; $text .= "
- ".$icon['icon'].$frm->checkbox('e-mye107[]', $key, $checked).$icon['title']."
"; + ".$icon['icon'].$frm->checkbox_label($icon['title'], 'e-mye107[]', $key, $checked).""; } } } @@ -258,8 +258,7 @@ function render_infopanel_menu_options() { $checked = (in_array($row['menu_name'], $settings)) ? true : false; $text .= "
"; - $text .= $frm->checkbox("e-mymenus[]", $row['menu_name'], $checked); - $text .= $row['menu_name']; + $text .= $frm->checkbox_label($row['menu_name'], "e-mymenus[]", $row['menu_name'], $checked); $text .= "
"; } } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 12d898324..05b69f97a 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -9,8 +9,8 @@ * Form Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ - * $Revision: 1.41 $ - * $Date: 2009-09-13 16:37:18 $ + * $Revision: 1.42 $ + * $Date: 2009-09-14 21:54:16 $ * $Author: secretr $ * */ @@ -188,6 +188,11 @@ class e_form return "get_attributes($options, $name, $value)." />"; } + + function checkbox_label($label_title, $name, $value, $checked = false, $options = array()) + { + return $this->checkbox($name, $value, $checked, $options).$this->label($label_title, $name, $value); + } function checkbox_switch($name, $value, $checked = false, $label = '') {