intval, ereg, and gettype updates

This commit is contained in:
Miles Lott 2003-12-20 18:54:18 +00:00
parent 5a1f288b96
commit c4c6251e9d
2 changed files with 9 additions and 9 deletions

View File

@ -90,7 +90,7 @@
$owner_name = lang('Group').' ('.$owner_name.')'; $owner_name = lang('Group').' ('.$owner_name.')';
} }
unset($acct); unset($acct);
$this->acl = CreateObject('phpgwapi.acl',intval($owner)); $this->acl = CreateObject('phpgwapi.acl',(int)$owner);
$this->acl->read_repository(); $this->acl->read_repository();
if ($_POST['submit']) if ($_POST['submit'])
@ -250,16 +250,16 @@
$vars = $this->template->get_undefined('row_colspan'); $vars = $this->template->get_undefined('row_colspan');
while (list(,$var) = each($vars)) while (list(,$var) = each($vars))
{ {
if (ereg('lang_',$var)) if(strstr($var,'lang_'))
{ {
$value = ereg_replace('lang_','',$var); $value = str_replace('lang_','',$var);
$value = ereg_replace('_',' ',$value); $value = str_replace('_',' ',$value);
$this->template->set_var($var,lang($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->set_var('string',lang('Groups'));
$this->template->parse('row','row_colspan',True); $this->template->parse('row','row_colspan',True);

View File

@ -156,7 +156,7 @@
} }
if (isset($prefs[$name])) 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( return create_select_box($label,$name,array(
@ -424,11 +424,11 @@
$GLOBALS['type'] = 'user'; $GLOBALS['type'] = 'user';
} }
$show_help = "$session_data[show_help]" != '' && $session_data['appname'] == $_GET['appname'] ? $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')) if ($toggle_help = get_var('toggle_help','POST'))
{ {
$show_help = intval(!$show_help); $show_help = (int)(!$show_help);
} }
$has_help = 0; $has_help = 0;
@ -557,7 +557,7 @@
} }
$t->set_var('lang_submit', lang('save')); $t->set_var('lang_submit', lang('save'));
$t->set_var('lang_cancel', lang('cancel')); $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 ? '<input type="submit" name="toggle_help" value="'. $t->set_var('help_button',$has_help ? '<input type="submit" name="toggle_help" value="'.
($show_help ? lang('help off') : lang('help')).'">' : ''); ($show_help ? lang('help off') : lang('help')).'">' : '');