XOOPS  2.6.0
categoryselect.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
22 {
26  public function __construct($imgcat_id)
27  {
29  $groups = $xoops->getUserGroups();
30 
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 }
static getInstance()
Definition: Xoops.php:160
addElement(Element $formElement, $required=false)
Definition: Form.php:206
const _AM_IMAGES_CAT_SELECT
Definition: admin.php:38
$xoops
Definition: admin.php:25
static getHelper($dirname= 'system')
Definition: Helper.php:27
$groups
$imgcat_id
$helper