1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: 13: 14: 15: 16: 17: 18: 19:
20:
21: class ImagesCategoryselectForm extends Xoops\Form\ThemeForm
22: {
23: 24: 25:
26: public function __construct($imgcat_id)
27: {
28: $xoops = Xoops::getInstance();
29: $groups = $xoops->getUserGroups();
30:
31: $helper = Xoops\Module\Helper::getHelper('images');
32: $categories = $helper->getHandlerCategories()->getListByPermission($groups, 'imgcat_read');
33:
34: parent::__construct('', 'category_select', $xoops->getEnv('PHP_SELF'), 'post');
35: $select = new Xoops\Form\Select('', 'imgcat_id', $imgcat_id);
36: $select->addOption(0, _AM_IMAGES_CAT_SELECT);
37: $select->addOptionArray($categories);
38: $select->setExtra("onchange='javascript:window.location.href=\"images.php?imgcat_id=\" + this.value'");
39: $this->addElement($select);
40: }
41: }
42: