diff options
author | deva <deva> | 2009-04-28 19:00:45 +0000 |
---|---|---|
committer | deva <deva> | 2009-04-28 19:00:45 +0000 |
commit | 5543eddbd0d0b2e707c98ef2f96f1a731a7f4822 (patch) | |
tree | 1b48d71a3a90ca3a4fa782a2d81158f29f43b67c | |
parent | 8ad91c8b87f58fe7d3cac44ae317caf98e82aa63 (diff) |
Removed warning on foreach on empty array
-rw-r--r-- | utils/forms.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/forms.php b/utils/forms.php index a450463..2d34861 100644 --- a/utils/forms.php +++ b/utils/forms.php @@ -331,8 +331,10 @@ class ListEditor { $str .= $indent . "//-->\n"; $str .= $indent . "</script>\n"; $str .= $indent . "<select multiple size=\"8\" id=\"items\" name=\"".$this->name."[]\">\n"; - foreach($this->values as $key => $val) { - $str .= $indent . " <option value=\"".$key.":".$val."\">".$key.":".$val."</option>\n"; + if(sizeof($this->values)) { + foreach($this->values as $key => $val) { + $str .= $indent . " <option value=\"".$key.":".$val."\">".$key.":".$val."</option>\n"; + } } $str .= $indent . "</select><br/>\n"; $str .= $indent . "<img src=\"gfx/up.png\" button onclick=\"moveUp()\"/><br/>\n"; |