$sepstr = '';
$where_clause = '';
$where_clause_args = array();
- while (list($undef, $nickname) = each($alias)) {
+ foreach ($alias as $nickname) {
$where_clause .= $sepstr . $this->identifier_quote_char . 'nickname' . $this->identifier_quote_char . ' = ?';
$where_clause_args[] = $nickname;
$sepstr = ' OR ';
$this->table, $this->owner);
$sepstr = '';
- while (list($undef, $nickname) = each($alias)) {
+ foreach ($alias as $nickname) {
$query .= sprintf("%s nickname='%s' ", $sepstr,
$this->dbh->quoteString($nickname));
$sepstr = 'OR';
/* Load configured LDAP servers (if PHP has LDAP support) */
if (isset($ldap_server) && is_array($ldap_server)) {
reset($ldap_server);
- while (list($undef,$param) = each($ldap_server)) {
+ foreach ($ldap_server as $param) {
if (!is_array($param))
continue;
$write = array();
$backends = $abook->get_backend_list();
- while (list($undef,$v) = each($backends)) {
+ foreach ($backends as $v) {
if ($v->writeable) {
$write[$v->bnum]=$v->sname;
}
$pn = $data2[1];
$pna = explode(')(', $pn);
$delnew = array();
- while (list($k, $v) = each($pna)) {
+ foreach ($pna as $v) {
$lst = explode('"', $v);
if (isset($lst[3])) {
$delnew[$lst[1]] = $lst[3];
$lowerbox = strtolower(sm_encode_html_special_chars($value));
$sel = false;
if ($show_selected != 0) {
- reset($show_selected);
- while (!$sel && (list($x, $val) = each($show_selected))) {
+ foreach ($show_selected as $val)) {
if (strtolower($value) == strtolower(sm_encode_html_special_chars($val))) {
$sel = true;
+ break;
}
}
}
$fulltag = '<' . $tagname;
if (is_array($attary) && sizeof($attary)){
$atts = Array();
- while (list($attname, $attvalue) = each($attary)){
+ foreach ($attary as $attname => $attvalue){
array_push($atts, "$attname=$attvalue");
}
$fulltag .= ' ' . join(" ", $atts);
$mailbox
){
$me = 'sq_fixatts';
- while (list($attname, $attvalue) = each($attary)){
+ foreach ($attary as $attname => $attvalue){
/**
* See if this attribute should be removed.
*/
// need to adjust $chosen_theme path with SM_PATH
$chosen_theme_path = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme_path);
$found_theme = false;
-while (!$found_theme && (list($index, $data) = each($user_themes))) {
- if ($data['PATH'] == $chosen_theme_path)
+foreach ($user_themes as $data) {
+ if ($data['PATH'] == $chosen_theme_path) {
$found_theme = true;
+ break;
+ }
}
if (!$found_theme) {
$template_themes = $oTemplate->get_alternative_stylesheets(true);
- while (!$found_theme && (list($path, $name) = each($template_themes))) {
- if ($path == $chosen_theme_path)
+ foreach ($template_themes as $path => $name) {
+ if ($path == $chosen_theme_path) {
$found_theme = true;
+ break;
+ }
}
}
// Don't assume the new value is there, double check
// and only save if found
$found = false;
- while (!$found && (list($index, $data) = each($icon_themes))) {
- if ($data['PATH'] == $option->new_value)
+ foreach ($icon_themes as $data) {
+ if ($data['PATH'] == $option->new_value) {
$found = true;
+ break;
+ }
}
if (!$found)
// Don't assume the new value is there, double check
// and only save if found
$found = false;
- reset($user_themes);
- while (!$found && (list($index, $data) = each($user_themes))) {
- if ($data['PATH'] == $option->new_value)
+ foreach ($user_themes as $data) {
+ if ($data['PATH'] == $option->new_value) {
$found = true;
+ break;
+ }
}
if (!$found) {
$template_themes = $oTemplate->get_alternative_stylesheets(true);
- while (!$found && (list($path, $name) = each($template_themes))) {
- if ($path == $option->new_value)
+ foreach ($template_themes as $path => $name) {
+ if ($path == $option->new_value) {
$found = true;
+ break;
+ }
}
}
}
if (isset($calendardata[$cdate])){
$i=0;
- while ($calfoo = each($calendardata[$cdate])) {
- $calbar = $calendardata[$cdate][$calfoo['key']];
+ foreach ($calendardata[$cdate] as $key => $value) {
+ $calbar = $calendardata[$cdate][$key];
// FIXME: how to display multiline task
- $title = '['. $calfoo['key']. '] ' .
+ $title = '['. $key. '] ' .
str_replace(array("\r","\n"),array(' ',' '),sm_encode_html_special_chars($calbar['message']));
// FIXME: link to nowhere
echo "<a href=\"#\" style=\"text-decoration:none; color: "
$cdate = $month . $day . $year;
if (isset($calendardata[$cdate])){
- while ( $calfoo = each($calendardata[$cdate])){
- $daily_events["$calfoo[key]"] = $calendardata[$cdate][$calfoo['key']];
+ foreach ($calendardata[$cdate] as $key => $value){
+ $daily_events[$key] = $calendardata[$cdate][$key];
}
}
}
ksort($daily_events,SORT_STRING);
$eo=0;
- while ($calfoo = each($daily_events)){
+ foreach ($daily_events as $key => $value) {
if ($eo==0){
$eo=4;
} else {
$eo=0;
}
- $ehour = substr($calfoo['key'],0,2);
- $eminute = substr($calfoo['key'],2,2);
- if (!is_array($calfoo['value'])){
+ $ehour = substr($key,0,2);
+ $eminute = substr($key,2,2);
+ if (!is_array($value)){
echo html_tag( 'tr',
html_tag( 'td', $ehour . ':' . $eminute, 'left' ) .
html_tag( 'td', ' ', 'left' ) .
html_tag( 'td',
"<font size=\"-1\"><a href=\"event_create.php?year=$year&month=$month&day=$day&hour="
- .substr($calfoo['key'],0,2)."\">".
+ .substr($key,0,2)."\">".
_("ADD") . "</a></font>" ,
'center' ) ,
'', $color[$eo]);
} else {
- $calbar=$calfoo['value'];
+ $calbar=$value;
if ($calbar['length']!=0){
$elength = '-'.date_intl(_("H:i"),mktime($ehour,$eminute+$calbar['length'],0,1,1,0));
} else {
html_tag( 'td',
"<font size=\"-1\"><nobr>\n" .
"<a href=\"event_edit.php?year=$year&month=$month&day=$day&hour=".
- substr($calfoo['key'],0,2)."&minute=".substr($calfoo['key'],2,2)."\">".
+ substr($key,0,2)."&minute=".substr($key,2,2)."\">".
_("EDIT") . "</a> | \n" .
"<a href=\"event_delete.php?dyear=$year&dmonth=$month&dday=$day&dhour=".
- substr($calfoo['key'],0,2)."&dminute=".substr($calfoo['key'],2,2).
+ substr($key,0,2)."&dminute=".substr($key,2,2).
"&year=$year&month=$month&day=$day\">" .
_("DEL") . '</a>' .
"</nobr></font>\n" ,
'360' => _("6 hr.")
);
- while( $bar = each($eventlength)) {
- if($bar['key']==$selected){
- echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
+ foreach($eventlength as $key => $value) {
+ if($key==$selected){
+ echo ' <option value="'.$key.'" selected="selected">'.$value."</option>\n";
} else {
- echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
+ echo ' <option value="'.$key.'">'.$value."</option>\n";
}
}
}
'55'=>'55'
);
- while ( $bar = each($eventminute)) {
- if ($bar['key']==$selected){
- echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
+ foreach ($eventminute as $key => $value) {
+ if ($key==$selected){
+ echo ' <option value="'.$key.'" selected="selected">'.$value."</option>\n";
} else {
- echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
+ echo ' <option value="'.$key.'">'.$value."</option>\n";
}
}
}
'1' => _("High"),
);
- while( $bar = each($eventpriority)) {
- if($bar['key']==$selected){
- echo ' <option value="'.$bar['key'].'" selected="selected">'.$bar['value']."</option>\n";
+ foreach($eventpriority as $key => $value) {
+ if($key==$selected){
+ echo ' <option value="'.$key.'" selected="selected">'.$value."</option>\n";
} else {
- echo ' <option value="'.$bar['key'].'">'.$bar['value']."</option>\n";
+ echo ' <option value="'.$key.'">'.$value."</option>\n";
}
}
}
*/
$extrajs.= "var suggestions = new Array();\n";
$i=0;
- while (list($word, $value) = each($misses)){
+ foreach ($misses as $value){
if ($value=='_NONE') $value='';
$extrajs.= "suggestions[$i] = \"$value\";\n";
$i++;
*/
$extrajs.= "var locations= new Array();\n";
$i=0;
- while (list($word, $value) = each($locations)){
+ foreach ($locations as $value){
$extrajs.= "locations[$i] = \"$value\";\n";
$i++;
}
$add = '<p><label for="lang_default">'
. _("Make this dictionary my default selection:")
. "</label> <select name=\"lang_default\" id=\"lang_default\">\n";
-while (list($avail_lang, $junk) = each($SQSPELL_APP)){
+foreach ($SQSPELL_APP as $avail_lang => $ignore){
$msg .= "<input type=\"checkbox\" name=\"use_langs[]\" "
. "value=\"$avail_lang\" id=\"use_langs_$avail_lang\"";
if (in_array($avail_lang, $langs)) {
return array();
$contacts = array();
- while(list($undef,$row) = each($addresses)) {
+ foreach($addresses as $row) {
$contact = array (
'FirstName' => sm_encode_html_special_chars($row['firstname']),
'LastName' => sm_encode_html_special_chars($row['lastname']),
$backends = array();
$backends['-1'] = _("All address books");
$ret = $abook->get_backend_list();
- while (list($undef,$v) = each($ret)) {
+ foreach ($ret as $v) {
if ($v->btype == 'local' && !$v->listing) {
continue;
}