From c4c6251e9d3fba9c49a3583d85e7b25d9eabac3f Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sat, 20 Dec 2003 18:54:18 +0000 Subject: [PATCH] intval, ereg, and gettype updates --- preferences/inc/class.uiaclprefs.inc.php | 10 +++++----- preferences/preferences.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/preferences/inc/class.uiaclprefs.inc.php b/preferences/inc/class.uiaclprefs.inc.php index aa0c74b076..19fae56816 100644 --- a/preferences/inc/class.uiaclprefs.inc.php +++ b/preferences/inc/class.uiaclprefs.inc.php @@ -90,7 +90,7 @@ $owner_name = lang('Group').' ('.$owner_name.')'; } unset($acct); - $this->acl = CreateObject('phpgwapi.acl',intval($owner)); + $this->acl = CreateObject('phpgwapi.acl',(int)$owner); $this->acl->read_repository(); if ($_POST['submit']) @@ -250,16 +250,16 @@ $vars = $this->template->get_undefined('row_colspan'); while (list(,$var) = each($vars)) { - if (ereg('lang_',$var)) + if(strstr($var,'lang_')) { - $value = ereg_replace('lang_','',$var); - $value = ereg_replace('_',' ',$value); + $value = str_replace('lang_','',$var); + $value = str_replace('_',' ',$value); $this->template->set_var($var,lang($value)); } } - if (intval($s_groups) <> count($groups)) + if ((int)$s_groups <> count($groups)) { $this->template->set_var('string',lang('Groups')); $this->template->parse('row','row_colspan',True); diff --git a/preferences/preferences.php b/preferences/preferences.php index 2c7365afd6..d649fd24cf 100755 --- a/preferences/preferences.php +++ b/preferences/preferences.php @@ -156,7 +156,7 @@ } if (isset($prefs[$name])) { - $prefs[$name] = intval(!!$prefs[$name]); // to care for '' and 'True' + $prefs[$name] = (int)(!!$prefs[$name]); // to care for '' and 'True' } return create_select_box($label,$name,array( @@ -424,11 +424,11 @@ $GLOBALS['type'] = 'user'; } $show_help = "$session_data[show_help]" != '' && $session_data['appname'] == $_GET['appname'] ? - $session_data['show_help'] : intval($GLOBALS['phpgw_info']['user']['preferences']['common']['show_help']); + $session_data['show_help'] : (int)$GLOBALS['phpgw_info']['user']['preferences']['common']['show_help']; if ($toggle_help = get_var('toggle_help','POST')) { - $show_help = intval(!$show_help); + $show_help = (int)(!$show_help); } $has_help = 0; @@ -557,7 +557,7 @@ } $t->set_var('lang_submit', lang('save')); $t->set_var('lang_cancel', lang('cancel')); - $t->set_var('show_help',intval($show_help)); + $t->set_var('show_help',(int)$show_help); $t->set_var('help_button',$has_help ? '' : '');