forked from extern/egroupware
Finish up reformatting
This commit is contained in:
parent
9a7c490aed
commit
41869acba8
@ -42,7 +42,7 @@
|
||||
);
|
||||
|
||||
var $country_array = array(
|
||||
' '=>'Select One',
|
||||
' '=>'Select One',
|
||||
'AF'=>'AFGHANISTAN',
|
||||
'AL'=>'ALBANIA',
|
||||
'DZ'=>'ALGERIA',
|
||||
@ -283,11 +283,11 @@
|
||||
'ZM'=>'ZAMBIA',
|
||||
'ZW'=>'ZIMBABWE',
|
||||
);
|
||||
|
||||
|
||||
function hour_formated_text($name, $selected = 0)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
|
||||
$s = '<select name="' . $name . '">';
|
||||
$t_s[$selected] = ' selected';
|
||||
|
||||
@ -300,11 +300,11 @@
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
function hour_text($name, $selected = 0)
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
|
||||
$s = '<select name="' . $name . '">';
|
||||
$t_s[$selected] = " selected";
|
||||
for ($i=1; $i<13; $i++)
|
||||
@ -317,7 +317,7 @@
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
// I would like to add a increment feature
|
||||
function sec_minute_text($name, $selected = 0)
|
||||
{
|
||||
@ -343,54 +343,70 @@
|
||||
$s .= '</select>';
|
||||
return $s;
|
||||
}
|
||||
|
||||
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
|
||||
$s = $this->hour_text($hour_name,$hour_selected)
|
||||
. $this->sec_minute_text($min_name,$min_selected)
|
||||
. $this->sec_minute_text($sec_name,$sec_selected)
|
||||
. $this->ap_text($ap_name,$ap_selected);
|
||||
return $s;
|
||||
}
|
||||
|
||||
function getMonthText($name, $selected=0)
|
||||
{
|
||||
$out = '<select name="'.$name.'">'."\n";
|
||||
$c_monthnames = count($this->monthnames);
|
||||
for($i=0;$i<$c_monthnames;$i++)
|
||||
{
|
||||
$out .= '<option value="'.$i.'"';
|
||||
if($selected==$i) $out .= ' SELECTED';
|
||||
$out .= '>';
|
||||
if($this->monthnames[$i]!='')
|
||||
$out .= lang($this->monthnames[$i]);
|
||||
else
|
||||
$out .= '';
|
||||
$out .= '</option>'."\n";
|
||||
}
|
||||
$out .= '</select>'."\n";
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getDays($name, $selected=0)
|
||||
{
|
||||
$out = '<select name="'.$name.'">'."\n";
|
||||
|
||||
for($i=0;$i<32;$i++)
|
||||
{
|
||||
if($i==0) $val = ''; else $val = $i;
|
||||
$out .= '<option value="'.$val.'"';
|
||||
if($selected==$i) $out .= ' SELECTED';
|
||||
$out .= '>'.$val.'</option>'."\n";
|
||||
}
|
||||
$out .= '</select>'."\n";
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
$s = $this->hour_text($hour_name,$hour_selected)
|
||||
. $this->sec_minute_text($min_name,$min_selected)
|
||||
. $this->sec_minute_text($sec_name,$sec_selected)
|
||||
. $this->ap_text($ap_name,$ap_selected);
|
||||
return $s;
|
||||
}
|
||||
|
||||
function getMonthText($name, $selected=0)
|
||||
{
|
||||
$out = '<select name="'.$name.'">'."\n";
|
||||
$c_monthnames = count($this->monthnames);
|
||||
for($i=0;$i<$c_monthnames;$i++)
|
||||
{
|
||||
$out .= '<option value="'.$i.'"';
|
||||
if($selected==$i)
|
||||
{
|
||||
$out .= ' SELECTED';
|
||||
}
|
||||
$out .= '>';
|
||||
if($this->monthnames[$i]!='')
|
||||
{
|
||||
$out .= lang($this->monthnames[$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$out .= '';
|
||||
}
|
||||
$out .= '</option>'."\n";
|
||||
}
|
||||
$out .= '</select>'."\n";
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getDays($name, $selected=0)
|
||||
{
|
||||
$out = '<select name="'.$name.'">'."\n";
|
||||
|
||||
for($i=0;$i<32;$i++)
|
||||
{
|
||||
if($i==0)
|
||||
{
|
||||
$val = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$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)
|
||||
{
|
||||
|
||||
if (!$startYear)
|
||||
{
|
||||
$startYear = date('Y') - 2;
|
||||
@ -426,29 +442,32 @@
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getPercentage($name, $selected=0)
|
||||
{
|
||||
$out = "<select name=\"$name\">\n";
|
||||
|
||||
for($i=0;$i<101;$i=$i+10)
|
||||
{
|
||||
$out .= "<option value=\"$i\"";
|
||||
if($selected==$i) $out .= " SELECTED";
|
||||
$out .= ">$i%</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
// echo $out;
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
function getPercentage($name, $selected=0)
|
||||
{
|
||||
$out = "<select name=\"$name\">\n";
|
||||
|
||||
for($i=0;$i<101;$i=$i+10)
|
||||
{
|
||||
$out .= "<option value=\"$i\"";
|
||||
if($selected==$i)
|
||||
{
|
||||
$out .= " SELECTED";
|
||||
}
|
||||
$out .= ">$i%</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
// echo $out;
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getPriority($name, $selected=2)
|
||||
{
|
||||
$arr = array('','low','normal','high');
|
||||
$out = '<select name="' . $name . '">';
|
||||
|
||||
|
||||
for($i=1;$i<count($arr);$i++)
|
||||
{
|
||||
{
|
||||
$out .= "<option value=\"";
|
||||
$out .= $i;
|
||||
$out .= "\"";
|
||||
@ -463,58 +482,69 @@
|
||||
$out .= "</select>\n";
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getAccessList($name, $selected="private")
|
||||
{
|
||||
$arr = array("private" => "Private",
|
||||
"public" => "Global public",
|
||||
"group" => "Group public");
|
||||
|
||||
if (ereg(",", $selected))
|
||||
{
|
||||
$selected = "group";
|
||||
}
|
||||
|
||||
$out = "<select name=\"$name\">\n";
|
||||
|
||||
for(reset($arr);current($arr);next($arr))
|
||||
{
|
||||
$out .= '<option value="' . key($arr) . '"';
|
||||
if($selected==key($arr)) $out .= " SELECTED";
|
||||
$out .= ">" . pos($arr) . "</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getGroups($groups, $selected="", $name="n_groups[]")
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$out = '<select name="' . $name . '" multiple>';
|
||||
while (list($null,$group) = each($groups)) {
|
||||
$out .= '<option value="' . $group['account_id'] . '"';
|
||||
if (strtolower(gettype($selected)) == strtolower("array")) {
|
||||
for($i=0;$i<count($selected);$i++) {
|
||||
if ($group['account_id'] == $selected[$i]) {
|
||||
$out .= " SELECTED";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} elseif (ereg("," . $group['account_id'] . ",", $selected)) {
|
||||
$out .= " SELECTED";
|
||||
}
|
||||
$out .= ">" . $group['account_name'] . "</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
|
||||
return $out;
|
||||
}
|
||||
function getAccessList($name, $selected="private")
|
||||
{
|
||||
$arr = array(
|
||||
"private" => "Private",
|
||||
"public" => "Global public",
|
||||
"group" => "Group public"
|
||||
);
|
||||
|
||||
if (ereg(",", $selected))
|
||||
{
|
||||
$selected = "group";
|
||||
}
|
||||
|
||||
$out = "<select name=\"$name\">\n";
|
||||
|
||||
for(reset($arr);current($arr);next($arr))
|
||||
{
|
||||
$out .= '<option value="' . key($arr) . '"';
|
||||
if($selected==key($arr))
|
||||
{
|
||||
$out .= " SELECTED";
|
||||
}
|
||||
$out .= ">" . pos($arr) . "</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getGroups($groups, $selected="", $name="n_groups[]")
|
||||
{
|
||||
global $phpgw;
|
||||
|
||||
$out = '<select name="' . $name . '" multiple>';
|
||||
while (list($null,$group) = each($groups))
|
||||
{
|
||||
$out .= '<option value="' . $group['account_id'] . '"';
|
||||
if (strtolower(gettype($selected)) == strtolower("array"))
|
||||
{
|
||||
for($i=0;$i<count($selected);$i++)
|
||||
{
|
||||
if ($group['account_id'] == $selected[$i])
|
||||
{
|
||||
$out .= " SELECTED";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (ereg("," . $group['account_id'] . ",", $selected))
|
||||
{
|
||||
$out .= " SELECTED";
|
||||
}
|
||||
$out .= ">" . $group['account_name'] . "</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
function list_states($name, $selected = '')
|
||||
{
|
||||
$states = array(
|
||||
'' => 'non US',
|
||||
'' => 'non US',
|
||||
'AL' => 'Alabama',
|
||||
'AK' => 'Alaska',
|
||||
'AZ' => 'Arizona',
|
||||
@ -594,5 +624,4 @@
|
||||
{
|
||||
return($this->country_array[$selected]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user