Finish up reformatting

This commit is contained in:
Miles Lott 2001-06-17 22:30:18 +00:00
parent 9a7c490aed
commit 41869acba8

View File

@ -42,7 +42,7 @@
); );
var $country_array = array( var $country_array = array(
' '=>'Select One', ' '=>'Select One',
'AF'=>'AFGHANISTAN', 'AF'=>'AFGHANISTAN',
'AL'=>'ALBANIA', 'AL'=>'ALBANIA',
'DZ'=>'ALGERIA', 'DZ'=>'ALGERIA',
@ -344,53 +344,69 @@
return $s; return $s;
} }
function full_time($hour_name,$hour_selected,$min_name,$min_selected,$sec_name,$sec_selected,$ap_name,$ap_selected) function full_time($hour_name,$hour_selected,$min_name,$min_selected,$sec_name,$sec_selected,$ap_name,$ap_selected)
{ {
// This needs to be changed to support there time format preferences // This needs to be changed to support there time format preferences
$s = $this->hour_text($hour_name,$hour_selected) $s = $this->hour_text($hour_name,$hour_selected)
. $this->sec_minute_text($min_name,$min_selected) . $this->sec_minute_text($min_name,$min_selected)
. $this->sec_minute_text($sec_name,$sec_selected) . $this->sec_minute_text($sec_name,$sec_selected)
. $this->ap_text($ap_name,$ap_selected); . $this->ap_text($ap_name,$ap_selected);
return $s; return $s;
} }
function getMonthText($name, $selected=0) function getMonthText($name, $selected=0)
{ {
$out = '<select name="'.$name.'">'."\n"; $out = '<select name="'.$name.'">'."\n";
$c_monthnames = count($this->monthnames); $c_monthnames = count($this->monthnames);
for($i=0;$i<$c_monthnames;$i++) for($i=0;$i<$c_monthnames;$i++)
{ {
$out .= '<option value="'.$i.'"'; $out .= '<option value="'.$i.'"';
if($selected==$i) $out .= ' SELECTED'; if($selected==$i)
$out .= '>'; {
if($this->monthnames[$i]!='') $out .= ' SELECTED';
$out .= lang($this->monthnames[$i]); }
else $out .= '>';
$out .= ''; if($this->monthnames[$i]!='')
$out .= '</option>'."\n"; {
} $out .= lang($this->monthnames[$i]);
$out .= '</select>'."\n"; }
return $out; else
} {
$out .= '';
}
$out .= '</option>'."\n";
}
$out .= '</select>'."\n";
return $out;
}
function getDays($name, $selected=0) function getDays($name, $selected=0)
{ {
$out = '<select name="'.$name.'">'."\n"; $out = '<select name="'.$name.'">'."\n";
for($i=0;$i<32;$i++) for($i=0;$i<32;$i++)
{ {
if($i==0) $val = ''; else $val = $i; if($i==0)
$out .= '<option value="'.$val.'"'; {
if($selected==$i) $out .= ' SELECTED'; $val = '';
$out .= '>'.$val.'</option>'."\n"; }
} else
$out .= '</select>'."\n"; {
return $out; $val = $i;
} }
$out .= '<option value="'.$val.'"';
if($selected==$i)
{
$out .= ' SELECTED';
}
$out .= '>'.$val.'</option>'."\n";
}
$out .= '</select>'."\n";
return $out;
}
function getYears($name, $selected = 0, $startYear = 0, $endyear = 0) function getYears($name, $selected = 0, $startYear = 0, $endyear = 0)
{ {
if (!$startYear) if (!$startYear)
{ {
$startYear = date('Y') - 2; $startYear = date('Y') - 2;
@ -427,20 +443,23 @@
return $out; return $out;
} }
function getPercentage($name, $selected=0) function getPercentage($name, $selected=0)
{ {
$out = "<select name=\"$name\">\n"; $out = "<select name=\"$name\">\n";
for($i=0;$i<101;$i=$i+10) for($i=0;$i<101;$i=$i+10)
{ {
$out .= "<option value=\"$i\""; $out .= "<option value=\"$i\"";
if($selected==$i) $out .= " SELECTED"; if($selected==$i)
$out .= ">$i%</option>\n"; {
} $out .= " SELECTED";
$out .= "</select>\n"; }
// echo $out; $out .= ">$i%</option>\n";
return $out; }
} $out .= "</select>\n";
// echo $out;
return $out;
}
function getPriority($name, $selected=2) function getPriority($name, $selected=2)
{ {
@ -464,57 +483,68 @@
return $out; return $out;
} }
function getAccessList($name, $selected="private") function getAccessList($name, $selected="private")
{ {
$arr = array("private" => "Private", $arr = array(
"public" => "Global public", "private" => "Private",
"group" => "Group public"); "public" => "Global public",
"group" => "Group public"
);
if (ereg(",", $selected)) if (ereg(",", $selected))
{ {
$selected = "group"; $selected = "group";
} }
$out = "<select name=\"$name\">\n"; $out = "<select name=\"$name\">\n";
for(reset($arr);current($arr);next($arr)) for(reset($arr);current($arr);next($arr))
{ {
$out .= '<option value="' . key($arr) . '"'; $out .= '<option value="' . key($arr) . '"';
if($selected==key($arr)) $out .= " SELECTED"; if($selected==key($arr))
$out .= ">" . pos($arr) . "</option>\n"; {
} $out .= " SELECTED";
$out .= "</select>\n"; }
return $out; $out .= ">" . pos($arr) . "</option>\n";
} }
$out .= "</select>\n";
return $out;
}
function getGroups($groups, $selected="", $name="n_groups[]") function getGroups($groups, $selected="", $name="n_groups[]")
{ {
global $phpgw; global $phpgw;
$out = '<select name="' . $name . '" multiple>'; $out = '<select name="' . $name . '" multiple>';
while (list($null,$group) = each($groups)) { while (list($null,$group) = each($groups))
$out .= '<option value="' . $group['account_id'] . '"'; {
if (strtolower(gettype($selected)) == strtolower("array")) { $out .= '<option value="' . $group['account_id'] . '"';
for($i=0;$i<count($selected);$i++) { if (strtolower(gettype($selected)) == strtolower("array"))
if ($group['account_id'] == $selected[$i]) { {
$out .= " SELECTED"; for($i=0;$i<count($selected);$i++)
break; {
} if ($group['account_id'] == $selected[$i])
} {
} elseif (ereg("," . $group['account_id'] . ",", $selected)) { $out .= " SELECTED";
$out .= " SELECTED"; break;
} }
$out .= ">" . $group['account_name'] . "</option>\n"; }
} }
$out .= "</select>\n"; elseif (ereg("," . $group['account_id'] . ",", $selected))
{
$out .= " SELECTED";
}
$out .= ">" . $group['account_name'] . "</option>\n";
}
$out .= "</select>\n";
return $out; return $out;
} }
function list_states($name, $selected = '') function list_states($name, $selected = '')
{ {
$states = array( $states = array(
'' => 'non US', '' => 'non US',
'AL' => 'Alabama', 'AL' => 'Alabama',
'AK' => 'Alaska', 'AK' => 'Alaska',
'AZ' => 'Arizona', 'AZ' => 'Arizona',
@ -594,5 +624,4 @@
{ {
return($this->country_array[$selected]); return($this->country_array[$selected]);
} }
}
}