Only foreach the special awards if there are special awards to foreach over

This commit is contained in:
james 2008-02-22 19:35:23 +00:00
parent 1d3ee3f83e
commit 145a5251c3

View File

@ -145,11 +145,13 @@ function tableEditorSetup($editor)
$editor->setFieldInputType("divpref_$did", 'select');
}
foreach($sa as $said=>$special_award) {
$editor->setFieldOptions("sa_$said", array(
array('key' => 'yes', 'val' => 'Would like to judge'),
array('key' => '', 'val' => '')));
$editor->setFieldInputType("sa_$said", 'select');
if(count($sa)) {
foreach($sa as $said=>$special_award) {
$editor->setFieldOptions("sa_$said", array(
array('key' => 'yes', 'val' => 'Would like to judge'),
array('key' => '', 'val' => '')));
$editor->setFieldInputType("sa_$said", 'select');
}
}
$editor->setFieldOptions('typepref', array(