Revision 57fc02b1
Added by Stephen Beaver over 9 years ago
src/usr/local/www/pkg_edit.php | ||
---|---|---|
299 | 299 |
* ROW helper function. Creates one element in the row from a PHP table by adding |
300 | 300 |
* the specified element to $group |
301 | 301 |
*/ |
302 |
function display_row($trc, $value, $fieldname, $type, $rowhelper, $description) { |
|
302 |
function display_row($trc, $value, $fieldname, $type, $rowhelper, $description, $width = null) {
|
|
303 | 303 |
global $text, $group; |
304 | 304 |
|
305 | 305 |
switch ($type) { |
... | ... | |
344 | 344 |
$options[$rowopt['value']] = $rowopt['name']; |
345 | 345 |
} |
346 | 346 |
|
347 |
$group->add(new Form_Select(
|
|
347 |
$grp = new Form_Select(
|
|
348 | 348 |
$fieldname . $trc, |
349 | 349 |
null, |
350 | 350 |
$value, |
351 | 351 |
$options |
352 |
))->setHelp($description); |
|
352 |
); |
|
353 |
|
|
354 |
$grp->setHelp($description); |
|
355 |
|
|
356 |
if ($width) { |
|
357 |
$grp->setWidth($width); |
|
358 |
} |
|
359 |
|
|
360 |
$group->add($grp); |
|
353 | 361 |
|
354 | 362 |
break; |
355 | 363 |
case "interfaces_selection": |
... | ... | |
831 | 839 |
$function = ($grouping) ? $section->add:$section->addInput; |
832 | 840 |
} |
833 | 841 |
|
834 |
if ($grouping) { |
|
835 |
$group->add(new Form_Select( |
|
836 |
$pkga['fieldname'], |
|
837 |
strip_tags($pkga['fielddescr']), |
|
838 |
isset($pkga['multiple']) ? $selectedlist:$selectedlist[0], |
|
839 |
$optionlist, |
|
840 |
isset($pkga['multiple']) |
|
841 |
))->setHelp($pkga['description'])->setOnchange($onchange)->setAttribute('size', $pkga['size']); |
|
842 |
} else { |
|
843 |
if (isset($pkga['advancedfield']) && isset($advfield_count)) { |
|
844 |
$advanced->addInput(new Form_Select( |
|
845 |
$pkga['fieldname'], |
|
846 |
$pkga['fielddescr'], |
|
847 |
isset($pkga['multiple']) ? $selectedlist:$selectedlist[0], |
|
848 |
$optionlist, |
|
849 |
isset($pkga['multiple']) |
|
850 |
))->setHelp($pkga['description'])->setOnchange($onchange)->setAttribute('size', $pkga['size']); |
|
851 |
} else { |
|
852 |
|
|
853 |
$selector = new Form_Select( |
|
842 |
$grp = new Form_Select( |
|
854 | 843 |
$pkga['fieldname'], |
855 | 844 |
strip_tags($pkga['fielddescr']), |
856 | 845 |
isset($pkga['multiple']) ? $selectedlist:$selectedlist[0], |
... | ... | |
858 | 847 |
isset($pkga['multiple']) |
859 | 848 |
); |
860 | 849 |
|
861 |
$selector->setHelp($pkga['description'])->setOnchange($onchange)->setAttribute('size', $pkga['size']);
|
|
850 |
$grp ->setHelp($pkga['description'])->setOnchange($onchange)->setAttribute('size', $pkga['size']);
|
|
862 | 851 |
|
863 |
if ($pkga['width']) {
|
|
864 |
$selector->setWidth($pkga['width']);
|
|
865 |
}
|
|
852 |
if ($pkga['width']) { |
|
853 |
$grp->setWidth($pkga['width']);
|
|
854 |
} |
|
866 | 855 |
|
867 |
$section->addInput($selector); |
|
856 |
if ($grouping) { |
|
857 |
$group->add($grp); |
|
858 |
} else { |
|
859 |
if (isset($pkga['advancedfield']) && isset($advfield_count)) { |
|
860 |
$advanced->addInput($grp); |
|
861 |
} else { |
|
862 |
$section->addInput($grp); |
|
868 | 863 |
} |
869 | 864 |
} |
870 | 865 |
|
... | ... | |
1370 | 1365 |
|
1371 | 1366 |
foreach ($pkga['rowhelper']['rowhelperfield'] as $rowhelper) { |
1372 | 1367 |
unset($value); |
1368 |
$width = null; |
|
1369 |
|
|
1373 | 1370 |
if ($rowhelper['value'] != "") { |
1374 | 1371 |
$value = $rowhelper['value']; |
1375 | 1372 |
} |
... | ... | |
1397 | 1394 |
$size = "8"; |
1398 | 1395 |
} |
1399 | 1396 |
|
1400 |
display_row($rowcounter, $value, $fieldname, $type, $rowhelper, ($numrows == $rowcounter) ? $fielddescr:null); |
|
1397 |
if ($rowhelper['width']) { |
|
1398 |
$width = $rowhelper['width']; |
|
1399 |
} |
|
1400 |
|
|
1401 |
display_row($rowcounter, $value, $fieldname, $type, $rowhelper, ($numrows == $rowcounter) ? $fielddescr:null, $width); |
|
1401 | 1402 |
|
1402 | 1403 |
$text = ""; |
1403 | 1404 |
$trc++; |
Also available in: Unified diff
Adds support for <width> XML tag in rowhelper selects