Ejemplo n.º 1
0
 /**
  * @param BannersBannerclient $obj
  */
 public function __construct(BannersBannerClient $obj)
 {
     $title = $obj->isNew() ? sprintf(_AM_BANNERS_CLIENTS_ADD) : sprintf(_AM_BANNERS_CLIENTS_EDIT);
     parent::__construct($title, 'form', 'clients.php', 'post', true);
     $this->addElement(new Xoops\Form\Text(_AM_BANNERS_CLIENTS_NAME, 'name', 5, 255, $obj->getVar('bannerclient_name')), true);
     // date
     if ($obj->isNew()) {
         $user = '******';
     } else {
         if ($obj->getVar('bannerclient_uid') == 0) {
             $user = '******';
         } else {
             $user = '******';
         }
     }
     $uname = new Xoops\Form\ElementTray(_AM_BANNERS_CLIENTS_UNAME, '');
     $type = new Xoops\Form\Radio('', 'user', $user);
     $options = array('N' => _AM_BANNERS_CLIENTS_UNAME_NO, 'Y' => _AM_BANNERS_CLIENTS_UNAME_YES);
     $type->addOptionArray($options);
     $uname->addElement($type);
     $uname->addElement(new Xoops\Form\SelectUser('', 'uid', false, $obj->getVar('bannerclient_uid'), 1, false));
     $this->addElement($uname);
     $this->addElement(new Xoops\Form\TextArea(_AM_BANNERS_CLIENTS_EXTRAINFO, 'extrainfo', $obj->getVar('bannerclient_extrainfo'), 5, 5), false);
     if (!$obj->isNew()) {
         $this->addElement(new Xoops\Form\Hidden('cid', $obj->getVar('bannerclient_cid')));
     }
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 2
0
 /**
  * @param array $param array of parameters with these keys:
  *                      'obj'     => ImagesCategory|XoopsObject $obj
  *                      'target'  => textarea id
  */
 public function __construct($param)
 {
     $xoops = Xoops::getInstance();
     $groups = $xoops->getUserGroups();
     extract($param);
     $helper = Xoops\Module\Helper::getHelper('images');
     $categories = $helper->getHandlerCategories()->getListByPermission($groups, 'imgcat_read');
     parent::__construct('', '', $xoops->getEnv('PHP_SELF'), 'post', false, 'inline');
     $select = new Xoops\Form\Select('', 'imgcat_id', $imgcat_id);
     $select->addOption(0, _AM_IMAGES_CAT_SELECT);
     $select->addOptionArray($categories);
     if (isset($target)) {
         $select->setExtra("onchange='javascript:window.location.href=\"" . $xoops->getEnv('PHP_SELF') . "?target=" . $target . "&imgcat_id=\" + this.value'");
     } else {
         $select->setExtra("onchange='javascript:window.location.href=\"" . $xoops->getEnv('PHP_SELF') . "?imgcat_id=\" + this.value'");
     }
     $this->addElement($select);
     if (isset($target)) {
         $this->addElement(new Xoops\Form\Hidden('target', $target));
     }
     $write = $helper->getHandlerCategories()->getListByPermission($groups, 'imgcat_write');
     if ($imgcat_id > 0 && array_key_exists($imgcat_id, $write)) {
         $this->addElement(new Xoops\Form\Hidden('op', 'upload'));
         $button = new Xoops\Form\Button('', 'submit', _IMAGES_ADD, 'submit');
         $button->setClass('btn btn-success floatright');
         $this->addElement($button);
     }
 }
Ejemplo n.º 3
0
 /**
  * @param null $obj
  */
 public function __construct($object = null)
 {
     $this->object = $object;
     $this->config = $object->config;
     $xoops = Xoops::getInstance();
     parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
     $activate = new Xoops\Form\Radio(_AM_XCAPTCHA_ACTIVATE, 'disabled', $this->config['disabled']);
     $activate->addOption(1, _AM_XCAPTCHA_ENABLE);
     $activate->addOption(0, _AM_XCAPTCHA_DISABLE);
     $this->addElement($activate, false);
     $plugin_List = new Xoops\Form\Select(_AM_XCAPTCHA_PLUGINS, 'mode', $this->config['mode']);
     $plugin_List->addOptionArray($this->object->plugin_List);
     $this->addElement($plugin_List, false);
     $this->addElement(new Xoops\Form\Text(_AM_XCAPTCHA_NAME, 'name', 50, 50, $this->config['name']), true);
     $skipmember = new Xoops\Form\Radio(_AM_XCAPTCHA_SKIPMEMBER, 'skipmember', $this->config['skipmember']);
     $skipmember->addOption(1, _AM_XCAPTCHA_ENABLE);
     $skipmember->addOption(0, _AM_XCAPTCHA_DISABLE);
     $this->addElement($skipmember, false);
     $this->addElement(new Xoops\Form\Text(_AM_XCAPTCHA_MAXATTEMPTS, 'maxattempts', 2, 2, $this->config['maxattempts']), true);
     $this->addElement(new Xoops\Form\Hidden('type', 'config'));
     $buttonTray = new Xoops\Form\ElementTray('', '');
     $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
     $buttonCancelSend = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $buttonCancelSend->setExtra("onclick='javascript:history.go(-1);'");
     $buttonTray->addElement($buttonCancelSend);
     $this->addElement($buttonTray);
 }
Ejemplo n.º 4
0
 /**
  * @return void
  */
 public function getDump()
 {
     $xoops = Xoops::getInstance();
     $maintenance = new Maintenance();
     parent::__construct('', "form_dump", "dump.php", 'post', true);
     $dump_tray = new Xoops\Form\ElementTray(_AM_MAINTENANCE_DUMP_TABLES_OR_MODULES, '');
     $select_tables1 = new Xoops\Form\Select('', "dump_tables", '', 7, true);
     $select_tables1->addOptionArray($maintenance->displayTables(true));
     $dump_tray->addElement($select_tables1, false);
     $ele = new Xoops\Form\Select('     ' . _AM_MAINTENANCE_OR . '     ', 'dump_modules', '', 7, true);
     $module_list = XoopsLists::getModulesList();
     $module_handler = $xoops->getHandlerModule();
     foreach ($module_list as $file) {
         if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
             clearstatcache();
             $file = trim($file);
             $module = $module_handler->create();
             $module->loadInfo($file);
             if ($module->getInfo('tables') && $xoops->isActiveModule($file)) {
                 $ele->addOption($module->getInfo('dirname'), $module->getInfo('name'));
             }
             unset($module);
         }
     }
     $dump_tray->addElement($ele);
     $this->addElement($dump_tray);
     $this->addElement(new Xoops\Form\RadioYesNo(_AM_MAINTENANCE_DUMP_DROP, 'drop', 1));
     $this->addElement(new Xoops\Form\Hidden("op", "dump_save"));
     $this->addElement(new Xoops\Form\Button("", "dump_save", XoopsLocale::A_SUBMIT, "submit"));
 }
Ejemplo n.º 5
0
 /**
  * @param null $obj
  */
 public function __construct($obj = null)
 {
     $xoops = Xoops::getInstance();
     parent::__construct('', 'xlanguage_form', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
     // language name
     $xlanguage_select = new Xoops\Form\Select(_AM_XLANGUAGE_NAME, 'xlanguage_name', $obj->getVar('xlanguage_name'));
     $xlanguage_select->addOptionArray(XoopsLists::getLocaleList());
     $this->addElement($xlanguage_select, true);
     // language description
     $this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_DESCRIPTION, 'xlanguage_description', 5, 30, $obj->getVar('xlanguage_description')), true);
     // language charset
     $autoload = XoopsLoad::loadConfig('xlanguage');
     $charset_select = new Xoops\Form\Select(_AM_XLANGUAGE_CHARSET, 'xlanguage_charset', $obj->getVar('xlanguage_charset'));
     $charset_select->addOptionArray($autoload['charset']);
     $this->addElement($charset_select);
     // language code
     $this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_CODE, 'xlanguage_code', 5, 10, $obj->getVar('xlanguage_code')), true);
     // language weight
     $this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_WEIGHT, 'xlanguage_weight', 1, 4, $obj->getVar('xlanguage_weight')));
     // language image
     $image_option_tray = new Xoops\Form\ElementTray(_AM_XLANGUAGE_IMAGE, '');
     $image_array = XoopsLists::getImgListAsArray(\XoopsBaseConfig::get('root-path') . '/media/xoops/images/flags/' . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . '/');
     $image_select = new Xoops\Form\Select('', 'xlanguage_image', $obj->getVar('xlanguage_image'));
     $image_select->addOptionArray($image_array);
     $image_select->setExtra("onchange='showImgSelected(\"image\", \"xlanguage_image\", \"/media/xoops/images/flags/" . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . "/\", \"\", \"" . \XoopsBaseConfig::get('url') . "\")'");
     $image_tray = new Xoops\Form\ElementTray('', ' ');
     $image_tray->addElement($image_select);
     $image_tray->addElement(new Xoops\Form\Label('', "<div style='padding: 8px;'><img style='width:24px; height:24px; ' src='" . \XoopsBaseConfig::get('url') . "/media/xoops/images/flags/" . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . "/" . $obj->getVar("xlanguage_image") . "' name='image' id='image' alt='' /></div>"));
     $image_option_tray->addElement($image_tray);
     $this->addElement($image_option_tray);
     $this->addElement(new Xoops\Form\Hidden('xlanguage_id', $obj->getVar('xlanguage_id')));
     /**
      * Buttons
      */
     $button_tray = new Xoops\Form\ElementTray('', '');
     $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
     $button->setClass('btn btn-success');
     $button_tray->addElement($button);
     $button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
     $button_2->setClass('btn btn-warning');
     $button_tray->addElement($button_2);
     switch (basename($xoops->getEnv('PHP_SELF'), '.php')) {
         case 'xoops_xlanguage':
             $button_3 = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
             $button_3->setExtra('onclick="tinyMCEPopup.close();"');
             $button_3->setClass('btn btn-danger');
             $button_tray->addElement($button_3);
             break;
         case 'index':
         default:
             $button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
             $button_3->setExtra("onclick='javascript:history.go(-1);'");
             $button_3->setClass('btn btn-danger');
             $button_tray->addElement($button_3);
             break;
     }
     $this->addElement($button_tray);
 }
Ejemplo n.º 6
0
 /**
  * @param BannersBanner|XoopsObject $obj
  */
 public function __construct(BannersBanner &$obj)
 {
     $xoops = Xoops::getInstance();
     $helper = Banners::getInstance();
     if ($obj->isNew()) {
         $blank_img = 'blank.gif';
         $html_banner = 0;
     } else {
         if (substr_count($obj->getVar('banner_imageurl'), $xoops_upload_url . '/banners/') == 0) {
             $blank_img = 'blank.gif';
         } else {
             $namefile = substr_replace($obj->getVar('banner_imageurl'), '', 0, strlen($xoops_upload_url . '/banners/'));
             $pathfile = $xoops_root_path . '/uploads/banners/' . $namefile;
             if (is_file($pathfile)) {
                 $blank_img = str_replace($xoops_upload_url . '/banners/', '', $obj->getVar('banner_imageurl', 'e'));
             } else {
                 $blank_img = 'blank.gif';
             }
         }
         $html_banner = $obj->getVar('banner_htmlbanner');
     }
     $title = $obj->isNew() ? sprintf(_AM_BANNERS_BANNERS_ADD) : sprintf(_AM_BANNERS_BANNERS_EDIT);
     parent::__construct($title, 'form', 'banners.php', 'post', true);
     $this->setExtra('enctype="multipart/form-data"');
     $client_Handler = $helper->getHandlerBannerclient();
     $client_select = new Xoops\Form\Select(_AM_BANNERS_CLIENTS_NAME, 'cid', $obj->getVar('banner_cid'));
     $client_select->addOptionArray($client_Handler->getList());
     $this->addElement($client_select, true);
     $imptotal = new Xoops\Form\Text(_AM_BANNERS_BANNERS_IMPRESSIONSP, 'imptotal', 1, 255, $obj->getVar('banner_imptotal'));
     //$imptotal->setPattern('^[0-9]*[0-9]+$|^[0-9]+[0-9]*$', _AM_BANNERS_BANNERS_IMPRESSIONSP_PATTERN);
     $this->addElement($imptotal, true);
     $imgtray_img = new Xoops\Form\ElementTray(_AM_BANNERS_BANNERS_IMAGE, '<br /><br />');
     $imgtray_img->addElement(new Xoops\Form\Text(_AM_BANNERS_BANNERS_IMGURL, 'imageurl', 8, 255, $obj->getVar('banner_imageurl')));
     $imgpath_img = sprintf(_AM_BANNERS_BANNERS_IMAGE_PATH, $xoops_upload_path . '/banners/');
     $imageselect_img = new Xoops\Form\Select($imgpath_img, 'banners_imageurl', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray($xoops_upload_path . '/banners');
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $imageselect_img->setExtra('onchange="showImgSelected(\'xo-banners-img\', \'banners_imageurl\', \'banners\', \'\', \'' . $xoops_upload_url . '\' )"');
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new Xoops\Form\Label('', "<br /><img src='" . $xoops_upload_url . "/banners/" . $blank_img . "' name='image_img' id='xo-banners-img' alt='' />"));
     $fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new Xoops\Form\File(_AM_BANNERS_BANNERS_UPLOADS, 'banners_imageurl'), false);
     $fileseltray_img->addElement(new Xoops\Form\Label(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $this->addElement($imgtray_img);
     $this->addElement(new Xoops\Form\Text(_AM_BANNERS_BANNERS_CLICKURL, 'clickurl', 5, 255, $obj->getVar('banner_clickurl')), false);
     $this->addElement(new Xoops\Form\RadioYesNo(_AM_BANNERS_BANNERS_USEHTML, 'htmlbanner', $html_banner));
     $this->addElement(new Xoops\Form\TextArea(_AM_BANNERS_BANNERS_CODEHTML, 'htmlcode', $obj->getVar('banner_htmlcode'), 5, 5), false);
     if (!$obj->isNew()) {
         $this->addElement(new Xoops\Form\Hidden('bid', $obj->getVar('banner_bid')));
     }
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 7
0
 /**
  * @param SmiliesSmiley|XoopsObject $obj
  */
 public function __construct(SmiliesSmiley $obj)
 {
     $xoops = Xoops::getInstance();
     if ($obj->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('smilies/', '', $obj->getVar('smiley_url', 'e'));
     }
     $title = $obj->isNew() ? sprintf(_AM_SMILIES_ADD) : sprintf(_AM_SMILIES_EDIT);
     parent::__construct($title, 'form', $xoops->getEnv('PHP_SELF'), 'post', true);
     $this->setExtra('enctype="multipart/form-data"');
     $this->addElement(new Xoops\Form\Text(_AM_SMILIES_CODE, 'smiley_code', 2, 25, $obj->getVar('smiley_code')), true);
     $this->addElement(new Xoops\Form\Text(_AM_SMILIES_DESCRIPTION, 'smiley_emotion', 4, 50, $obj->getVar('smiley_emotion')), true);
     $imgtray_img = new Xoops\Form\ElementTray(_AM_SMILIES_FILE, '<br />');
     $imgpath_img = sprintf(_AM_SMILIES_IMAGE_PATH, \XoopsBaseConfig::get('uploads-url') . '/smilies/');
     $imageselect_img = new Xoops\Form\Select($imgpath_img, 'smiley_url', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(\XoopsBaseConfig::get('uploads-url') . '/smilies');
     $imageselect_img->addOptionArray($image_array_img);
     $imageselect_img->setExtra('onchange="showImgSelected(\'xo-smilies-img\', \'smiley_url\', \'smilies\', \'\', \'' . \XoopsBaseConfig::get('uploads-url') . '\' )"');
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new Xoops\Form\Label('', "<br /><img src='" . \XoopsBaseConfig::get('uploads-url') . "/smilies/" . $blank_img . "' name='image_img' id='xo-smilies-img' alt=''>"));
     $fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new Xoops\Form\File(_AM_SMILIES_UPLOADS, 'smiley_url'), false);
     $fileseltray_img->addElement(new Xoops\Form\Label(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $this->addElement($imgtray_img);
     $this->addElement(new Xoops\Form\RadioYesNo(_AM_SMILIES_OFF, 'smiley_display', $obj->getVar('smiley_display')));
     $this->addElement(new Xoops\Form\Hidden('smiley_id', $obj->getVar('smiley_id')));
     /**
      * Buttons
      */
     $button_tray = new Xoops\Form\ElementTray('', '');
     $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
     $button->setClass('btn btn-success');
     $button_tray->addElement($button);
     $button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
     $button_2->setClass('btn btn-warning');
     $button_tray->addElement($button_2);
     switch (basename($xoops->getEnv('PHP_SELF'), '.php')) {
         case 'xoops_smilies':
             $button_3 = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
             $button_3->setExtra('onclick="tinyMCEPopup.close();"');
             $button_3->setClass('btn btn-danger');
             $button_tray->addElement($button_3);
             break;
         case 'smilies':
         default:
             $button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
             $button_3->setExtra("onclick='javascript:history.go(-1);'");
             $button_3->setClass('btn btn-danger');
             $button_tray->addElement($button_3);
             break;
     }
     $this->addElement($button_tray);
 }
Ejemplo n.º 8
0
 /**
  * @param ImagesImage|XoopsObject $obj
  */
 public function __construct(ImagesImage $obj)
 {
     $xoops = Xoops::getInstance();
     $helper = Xoops\Module\Helper::getHelper('images');
     $groups = $xoops->getUserGroups();
     if ($obj->isNew()) {
         $title = _AM_IMAGES_IMG_ADD;
     } else {
         $title = _AM_IMAGES_IMG_EDIT;
     }
     parent::__construct('', 'image', $xoops->getEnv('PHP_SELF'), 'post', true);
     $this->setExtra('enctype="multipart/form-data"');
     $tabtray = new Xoops\Form\TabTray('', 'uniqueid', $xoops->getModuleConfig('jquery_theme', 'system'));
     $tab1 = new Xoops\Form\Tab($title, 'tabid-1');
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_NAME, 'image_nicename', 50, 255, $obj->getVar('image_nicename')), true);
     if ($obj->isNew()) {
         $categories = $helper->getHandlerCategories()->getListByPermission($groups, 'imgcat_write');
         $select = new Xoops\Form\Select(_AM_IMAGES_CAT_SELECT, 'imgcat_id', $obj->getVar('imgcat_id'));
         $select->addOption('', _AM_IMAGES_CAT_SELECT);
         $select->addOptionArray($categories);
         $tab1->addElement($select, true);
     } else {
         $tab1->addElement(new Xoops\Form\Label(_AM_IMAGES_CAT_SELECT, '<span class="red bold">' . $helper->getHandlerCategories()->get($obj->getVar('imgcat_id'))->getVar('imgcat_name') . '</span>'));
         $this->addElement(new Xoops\Form\Hidden('imgcat_id', $obj->getVar('imgcat_id')));
     }
     // warning
     $category = $helper->getHandlerCategories()->get($obj->getVar('imgcat_id'));
     $upload_msg[] = _AM_IMAGES_CAT_SIZE . ' : ' . $category->getVar('imgcat_maxsize');
     $upload_msg[] = _AM_IMAGES_CAT_WIDTH . ' : ' . $category->getVar('imgcat_maxwidth');
     $upload_msg[] = _AM_IMAGES_CAT_HEIGHT . ' : ' . $category->getVar('imgcat_maxheight');
     $image_tray = new Xoops\Form\File(_AM_IMAGES_IMG_FILE, 'image_file');
     $image_tray->setDescription(self::message($upload_msg, ''));
     $tab1->addElement($image_tray);
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_WEIGHT, 'image_weight', 1, 4, $obj->getVar('image_weight')));
     $tab1->addElement(new Xoops\Form\RadioYesNo(_AM_IMAGES_DISPLAY, 'image_display', $obj->getVar('image_display')));
     $tabtray->addElement($tab1);
     $this->addElement($tabtray);
     $this->addElement(new Xoops\Form\Hidden('image_name', $obj->getVar('image_name')));
     $this->addElement(new Xoops\Form\Hidden('image_id', $obj->getVar('image_id')));
     /**
      * Buttons
      */
     $button_tray = new Xoops\Form\ElementTray('', '');
     $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
     $button->setClass('btn btn-success');
     $button_tray->addElement($button);
     $button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
     $button_2->setClass('btn btn-warning');
     $button_tray->addElement($button_2);
     $button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $button_3->setExtra("onclick='javascript:history.go(-1);'");
     $button_3->setClass('btn btn-danger');
     $button_tray->addElement($button_3);
     $this->addElement($button_tray);
 }
Ejemplo n.º 9
0
 /**
  * @param ImagesCategory|XoopsObject $obj
  */
 public function __construct(ImagesCategory $obj)
 {
     $xoops = Xoops::getInstance();
     $perm_handler = $xoops->getHandlerGroupperm();
     if ($obj->isNew()) {
         $title = _AM_IMAGES_CAT_ADD;
         $read = FixedGroups::ADMIN;
         $write = FixedGroups::ADMIN;
     } else {
         $title = _AM_IMAGES_CAT_EDIT;
         $read = $perm_handler->getGroupIds('imgcat_read', $obj->getVar('imgcat_id'), $xoops->module->getVar('mid'));
         $write = $perm_handler->getGroupIds('imgcat_write', $obj->getVar('imgcat_id'), $xoops->module->getVar('mid'));
     }
     parent::__construct($title, 'imagecat_form', $xoops->getEnv('PHP_SELF'), 'post', true);
     $tabtray = new Xoops\Form\TabTray('', 'uniqueid', $xoops->getModuleConfig('jquery_theme', 'system'));
     $tab1 = new Xoops\Form\Tab(_MI_IMAGES_CATEGORIES, 'tabid-1');
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_CAT_NAME, 'imgcat_name', 50, 255, $obj->getVar('imgcat_name')), true);
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_CAT_SIZE, 'imgcat_maxsize', 2, 8, $obj->getVar('imgcat_maxsize')));
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_CAT_WIDTH, 'imgcat_maxwidth', 1, 4, $obj->getVar('imgcat_maxwidth')));
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_CAT_HEIGHT, 'imgcat_maxheight', 1, 4, $obj->getVar('imgcat_maxheight')));
     $tab1->addElement(new Xoops\Form\Text(_AM_IMAGES_WEIGHT, 'imgcat_weight', 1, 5, $obj->getVar('imgcat_weight')));
     $tab1->addElement(new Xoops\Form\RadioYesNo(_AM_IMAGES_CAT_DISPLAY, 'imgcat_display', $obj->getVar('imgcat_display')));
     if ($obj->isNew()) {
         $store = new Xoops\Form\Radio(_AM_IMAGES_CAT_STR_TYPE . '<div class="red">' . _AM_IMAGES_CAT_STR_TYOPENG . '</div>', 'imgcat_storetype', 'file');
         $store->addOptionArray(array('file' => _AM_IMAGES_CAT_ASFILE, 'db' => _AM_IMAGES_CAT_INDB));
         $tab1->addElement($store);
     } else {
         $store = array('db' => _AM_IMAGES_CAT_INDB, 'file' => _AM_IMAGES_CAT_ASFILE);
         $tab1->addElement(new Xoops\Form\Label(_AM_IMAGES_CAT_STR_TYPE, $store[$obj->getVar('imgcat_storetype')]));
         $this->addElement(new Xoops\Form\Hidden('imgcat_storetype', $obj->getVar('imgcat_storetype')));
     }
     $tab2 = new Xoops\Form\Tab(_MI_IMAGES_PERMISSIONS, 'tabid-2');
     $tab2->addElement(new Xoops\Form\SelectGroup(_AM_IMAGES_CAT_READ_GRP, 'readgroup', true, $read, 5, true));
     $tab2->addElement(new Xoops\Form\SelectGroup(_AM_IMAGES_CAT_WRITE_GRP, 'writegroup', true, $write, 5, true));
     $tabtray->addElement($tab1);
     $tabtray->addElement($tab2);
     $this->addElement($tabtray);
     $this->addElement(new Xoops\Form\Hidden('imgcat_id', $obj->getVar('imgcat_id')));
     /**
      * Buttons
      */
     $button_tray = new Xoops\Form\ElementTray('', '');
     $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
     $button->setClass('btn btn-success');
     $button_tray->addElement($button);
     $button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
     $button_2->setClass('btn btn-warning');
     $button_tray->addElement($button_2);
     $button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $button_3->setExtra("onclick='javascript:history.go(-1);'");
     $button_3->setClass('btn btn-danger');
     $button_tray->addElement($button_3);
     $this->addElement($button_tray);
 }
Ejemplo n.º 10
0
 /**
  * @param PagePage_related|XoopsObject $obj
  */
 public function __construct(PagePage_related $obj)
 {
     $helper = Page::getInstance();
     $xoops = $helper->xoops();
     $xoops->theme()->addScript('modules/page/media/jquery/multi-select.0.3-7/js/jquery.multi-select.js');
     $xoops->theme()->addScript('modules/page/media/jquery/multi-select-init.js');
     $xoops->theme()->addStylesheet('modules/page/media/jquery/multi-select.0.3-7/css/multi-select.css');
     // Get handler
     $content_Handler = $helper->getContentHandler();
     $link_Handler = $helper->getLinkHandler();
     $title = $obj->isNew() ? PageLocale::A_ADD_RELATED : PageLocale::A_EDIT_RELATED;
     parent::__construct($title, 'form', 'related.php', 'post', true);
     //name
     $this->addElement(new Xoops\Form\Text(PageLocale::RELATED_NAME, 'related_name', 4, 255, $obj->getVar('related_name'), ''), true);
     //menu
     $menu = new Xoops\Form\RadioYesNo(PageLocale::RELATED_MENU, 'related_domenu', $obj->getVar('related_domenu'));
     $menu->setDescription(PageLocale::RELATED_MENU_DSC);
     $this->addElement($menu, false);
     //navigation
     $navigation = new Xoops\Form\Select(PageLocale::RELATED_NAVIGATION, 'related_navigation', $obj->getVar('related_navigation'), 1, false);
     $navigation->addOption(1, PageLocale::L_RELATED_NAVIGATION_OPTION1);
     $navigation->addOption(2, PageLocale::L_RELATED_NAVIGATION_OPTION2);
     $navigation->addOption(3, PageLocale::L_RELATED_NAVIGATION_OPTION3);
     $navigation->addOption(4, PageLocale::L_RELATED_NAVIGATION_OPTION4);
     $navigation->addOption(5, PageLocale::L_RELATED_NAVIGATION_OPTION5);
     $navigation->setClass('span3');
     $this->addElement($navigation);
     $related_links = $link_Handler->getContentByRelated($obj->getVar('related_id'));
     $contents_used = $link_Handler->getContentUsed();
     $contents = $content_Handler->getPageTitle(1);
     $related_links_form = new Xoops\Form\Select(PageLocale::RELATED_MAIN, 'datas', $related_links, $size = 20, $multiple = true);
     foreach ($contents as $k => $content) {
         if (!in_array($content['content_id'], $contents_used) || in_array($content['content_id'], $related_links)) {
             $related_links_form->addOption($content['content_id'], $content['content_title']);
         }
     }
     $this->addElement($related_links_form, true);
     $this->addElement(new Xoops\Form\Hidden('related_id', $obj->getVar('related_id')));
     /**
      * Buttons
      */
     $buttonTray = new Xoops\Form\ElementTray('', '');
     $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $buttonSubmit = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
     $buttonSubmit->setClass('btn btn-success');
     $buttonTray->addElement($buttonSubmit);
     $buttonReset = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
     $buttonReset->setClass('btn btn-warning');
     $buttonTray->addElement($buttonReset);
     $buttonCancel = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $buttonCancel->setExtra("onclick='javascript:history.go(-1);'");
     $buttonCancel->setClass('btn btn-danger');
     $buttonTray->addElement($buttonCancel);
     $this->addElement($buttonTray);
 }
Ejemplo n.º 11
0
 /**
  * @param MenusMenus $obj
  */
 public function __construct(MenusMenus &$obj)
 {
     $xoops = Xoops::getInstance();
     $title = $obj->isNew() ? sprintf(_AM_MENUS_ADD_MENUS) : sprintf(_AM_MENUS_EDIT_MENUS);
     parent::__construct($title, 'form', 'admin_menus.php', 'post', true);
     //title
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_TITLE, 'title', 50, 255, $obj->getVar('title'), ''), true);
     $this->addElement(new Xoops\Form\Hidden('id', $obj->getVar('id')));
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 12
0
 /**
  * @param Array
  *
  *        'obj'     => ImagesImage|XoopsObject $obj
  *        'target'  => textarea id
  */
 public function __construct($param)
 {
     $xoops = Xoops::getInstance();
     $helper = Xoops\Module\Helper::getHelper('images');
     //todo, remove extract
     extract($param);
     $groups = $xoops->getUserGroups();
     if ($obj->isNew()) {
         $title = _AM_IMAGES_IMG_ADD;
     } else {
         $title = _AM_IMAGES_IMG_EDIT;
     }
     parent::__construct($title, 'image', $xoops->getEnv('PHP_SELF'), 'post', true);
     $this->setExtra('enctype="multipart/form-data"');
     $this->addElement(new Xoops\Form\Text(_AM_IMAGES_NAME, 'image_nicename', 50, 255, $obj->getVar('image_nicename')), true);
     $categories = $helper->getHandlerCategories()->getListByPermission($groups, 'imgcat_write');
     $select = new Xoops\Form\Select(_AM_IMAGES_CAT_SELECT, 'imgcat_id', $obj->getVar('imgcat_id'));
     $select->addOption('', _AM_IMAGES_CAT_SELECT);
     $select->addOptionArray($categories);
     $this->addElement($select, true);
     $this->addElement(new Xoops\Form\File(_AM_IMAGES_IMG_FILE, 'image_file'));
     $this->addElement(new Xoops\Form\Hidden('image_weight', $obj->getVar('image_weight')));
     $this->addElement(new Xoops\Form\Hidden('image_display', $obj->getVar('image_display')));
     $this->addElement(new Xoops\Form\Hidden('image_name', $obj->getVar('image_name')));
     $this->addElement(new Xoops\Form\Hidden('image_id', $obj->getVar('image_id')));
     $this->addElement(new Xoops\Form\Hidden('target', $target));
     /**
      * Buttons
      */
     $buttonTray = new Xoops\Form\ElementTray('', '');
     $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $buttonSubmit = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
     $buttonSubmit->setClass('btn btn-success');
     $buttonTray->addElement($buttonSubmit);
     $buttonReset = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
     $buttonReset->setClass('btn btn-warning');
     $buttonTray->addElement($buttonReset);
     switch (basename($xoops->getEnv('PHP_SELF'), '.php')) {
         case 'xoops_images':
             $buttonClose = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
             $buttonClose->setExtra('onclick="tinyMCEPopup.close();"');
             $buttonClose->setClass('btn btn-danger');
             $buttonTray->addElement($buttonClose);
             break;
         case 'images':
         default:
             $buttonCancel = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
             $buttonCancel->setExtra("onclick='javascript:history.go(-1);'");
             $buttonCancel->setClass('btn btn-danger');
             $buttonTray->addElement($buttonCancel);
             break;
     }
     $this->addElement($buttonTray);
 }
Ejemplo n.º 13
0
 /**
  * @param category id $imgcat_id
  */
 public function __construct($imgcat_id)
 {
     $xoops = Xoops::getInstance();
     $groups = $xoops->getUserGroups();
     $helper = Xoops\Module\Helper::getHelper('images');
     $categories = $helper->getHandlerCategories()->getListByPermission($groups, 'imgcat_read');
     parent::__construct('', 'category_select', $xoops->getEnv('PHP_SELF'), 'post');
     $select = new Xoops\Form\Select('', 'imgcat_id', $imgcat_id);
     $select->addOption(0, _AM_IMAGES_CAT_SELECT);
     $select->addOptionArray($categories);
     $select->setExtra("onchange='javascript:window.location.href=\"images.php?imgcat_id=\" + this.value'");
     $this->addElement($select);
 }
Ejemplo n.º 14
0
 /**
  * @param MenusMenu $obj
  */
 public function __construct(MenusMenu $obj)
 {
     global $menu_id;
     $xoops = Xoops::getInstance();
     $helper = Menus::getInstance();
     $this_handler = $helper->getHandlerMenu();
     $decorators = MenusDecorator::getAvailableDecorators();
     $title = $obj->isNew() ? sprintf(_AM_MENUS_ADD_MENUS) : sprintf(_AM_MENUS_EDIT_MENUS);
     parent::__construct($title, 'form', 'admin_menu.php', 'post', true);
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_TITLE, 'title', 50, 255, $obj->getVar('title'), ''), true);
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_ALTTITLE, 'alt_title', 50, 255, $obj->getVar('alt_title'), ''));
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_LINK, 'link', 50, 255, $obj->getVar('link'), ''));
     $this->addElement(new Xoops\Form\Text(_AM_MENUS_MENU_IMAGE, 'image', 50, 255, $obj->getVar('image'), ''));
     $criteria = new CriteriaCompo(new Criteria('mid', $menu_id));
     $criteria->add(new Criteria('id', $obj->getVar('id'), '<>'));
     $criteria->setSort('weight');
     $criteria->setOrder('ASC');
     $results = $this_handler->getAll($criteria, array('title', 'id', 'pid'));
     $parent_tree = new XoopsObjectTree($results, 'id', 'pid');
     $parent_select = $parent_tree->makeSelBox('pid', 'title', '-- ', $obj->getVar('pid'), true);
     $this->addElement(new Xoops\Form\Label(_AM_MENUS_MENU_PARENT, $parent_select));
     $formvis = new Xoops\Form\Select(_AM_MENUS_MENU_VISIBLE, "visible", $obj->getVar('visible'));
     $formvis->addOption("0", XoopsLocale::NO);
     $formvis->addOption("1", XoopsLocale::YES);
     $this->addElement($formvis);
     $formtarget = new Xoops\Form\Select(_AM_MENUS_MENU_TARGET, "target", $obj->getVar('target'));
     $formtarget->addOption("_self", _AM_MENUS_MENU_TARG_SELF);
     $formtarget->addOption("_blank", _AM_MENUS_MENU_TARG_BLANK);
     $formtarget->addOption("_parent", _AM_MENUS_MENU_TARG_PARENT);
     $formtarget->addOption("_top", _AM_MENUS_MENU_TARG_TOP);
     $this->addElement($formtarget);
     $formgroups = new Xoops\Form\SelectGroup(_AM_MENUS_MENU_GROUPS, "groups", true, $obj->getVar('groups'), 5, true);
     $formgroups->setDescription(_AM_MENUS_MENU_GROUPS_HELP);
     $this->addElement($formgroups);
     $formhooks = new Xoops\Form\Select(_AM_MENUS_MENU_ACCESS_FILTER, "hooks", $obj->getVar('hooks'), 5, true);
     $accessFilter = array();
     foreach ($decorators as $decorator) {
         $decorator->accessFilter($accessFilter);
     }
     foreach ($accessFilter as $result) {
         $formhooks->addOption($result['method'], $result['name']);
     }
     $this->addElement($formhooks);
     $formcss = new Xoops\Form\Text(_AM_MENUS_MENU_CSS, 'css', 50, 255, $obj->getVar('css'));
     $this->addElement($formcss);
     $this->addElement(new Xoops\Form\Hidden('id', $obj->getVar('id')));
     $this->addElement(new Xoops\Form\Hidden('mid', $obj->getVar('mid')));
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 15
0
 /**
  * @param null $obj
  */
 public function __construct($object = null)
 {
     $this->object = $object;
     $this->config = $object->config;
     $xoops = Xoops::getInstance();
     parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
     $this->addElement(new Xoops\Form\Text(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars']), true);
     $this->addElement(new Xoops\Form\RadioYesNo(_XCAPTCHA_CASESENSITIVE, 'casesensitive', $this->config['casesensitive']));
     $fontmin_form = new Xoops\Form\Select(_XCAPTCHA_FONTSIZE_MIN, 'fontsize_min', $this->config['fontsize_min']);
     for ($i = 10; $i <= 30; ++$i) {
         $fontmin_form->addOption($i, $i);
     }
     $this->addElement($fontmin_form, false);
     $fontmax_form = new Xoops\Form\Select(_XCAPTCHA_FONTSIZE_MAX, 'fontsize_max', $this->config['fontsize_max']);
     for ($i = 10; $i <= 30; ++$i) {
         $fontmax_form->addOption($i, $i);
     }
     $this->addElement($fontmax_form, false);
     $backtype_form = new Xoops\Form\Select(_XCAPTCHA_BACKGROUND_TYPE, 'background_type', $this->config['background_type'], $size = 7);
     $backtype_form->addOption(0, _XCAPTCHA_BACKGROUND_BAR);
     $backtype_form->addOption(1, _XCAPTCHA_BACKGROUND_CIRCLE);
     $backtype_form->addOption(2, _XCAPTCHA_BACKGROUND_LINE);
     $backtype_form->addOption(3, _XCAPTCHA_BACKGROUND_RECTANGLE);
     $backtype_form->addOption(4, _XCAPTCHA_BACKGROUND_ELLIPSE);
     $backtype_form->addOption(5, _XCAPTCHA_BACKGROUND_POLYGONE);
     $backtype_form->addOption(100, _XCAPTCHA_BACKGROUND_IMAGE);
     $this->addElement($backtype_form, false);
     $backnum_form = new Xoops\Form\Select(_XCAPTCHA_BACKGROUND_NUM, 'background_num', $this->config['background_num']);
     for ($i = 10; $i <= 100; $i = $i + 10) {
         $backnum_form->addOption($i, $i);
     }
     $this->addElement($backnum_form, false);
     $polygon_point = new Xoops\Form\Select(_XCAPTCHA_POLYGON_POINT, 'polygon_point', $this->config['polygon_point']);
     for ($i = 3; $i <= 20; ++$i) {
         $polygon_point->addOption($i, $i);
     }
     $this->addElement($polygon_point, false);
     $value = implode('|', $this->config['skip_characters']);
     $this->addElement(new Xoops\Form\TextArea(_XCAPTCHA_SKIP_CHARACTERS, 'skip_characters', $value, 5, 50), true);
     $this->addElement(new Xoops\Form\Hidden('type', 'image'));
     $buttonTray = new Xoops\Form\ElementTray('', '');
     $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
     $buttonCancelSend = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $buttonCancelSend->setExtra("onclick='javascript:history.go(-1);'");
     $buttonTray->addElement($buttonCancelSend);
     $this->addElement($buttonTray);
 }
Ejemplo n.º 16
0
 /**
  * @param ProfileRegstep|XoopsObject $obj
  */
 public function __construct(ProfileRegstep &$obj)
 {
     parent::__construct(_PROFILE_AM_STEP, 'stepform', 'step.php', 'post', true);
     if (!$obj->isNew()) {
         $this->addElement(new Xoops\Form\Hidden('id', $obj->getVar('step_id')));
     }
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Text(_PROFILE_AM_STEPNAME, 'step_name', 5, 255, $obj->getVar('step_name', 'e')), true);
     $this->addElement(new Xoops\Form\Text(_PROFILE_AM_STEPINTRO, 'step_desc', 5, 255, $obj->getVar('step_desc', 'e')));
     $order = new Xoops\Form\Text(_PROFILE_AM_STEPORDER, 'step_order', 1, 10, $obj->getVar('step_order', 'e'), '');
     $order->setPattern('^\\d+$', _PROFILE_AM_ERROR_WEIGHT);
     $this->addElement($order, true);
     $this->addElement(new Xoops\Form\RadioYesNo(_PROFILE_AM_STEPSAVE, 'step_save', $obj->getVar('step_save', 'e')));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 17
0
 public function __construct(AvatarsAvatar $obj)
 {
     if ($obj->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('avatars/', '', $obj->getVar('avatar_file', 'e'));
     }
     //$xoops = Xoops::getInstance();
     // New and edit form
     $title = $obj->isNew() ? XoopsLocale::A_ADD : XoopsLocale::A_EDIT;
     $action = $_SERVER['REQUEST_URI'];
     parent::__construct($title, 'avatar_form', $action, "post", true);
     $this->setExtra('enctype="multipart/form-data"');
     // Name
     $this->addElement(new Xoops\Form\Text(XoopsLocale::NAME, 'avatar_name', 5, 255, $obj->getVar('avatar_name', 'e')), true);
     // Upload part
     $imgtray_img = new Xoops\Form\ElementTray(XoopsLocale::FILE, '<br />');
     $avatars_path = \XoopsBaseConfig::get('uploads-path') . '/avatars';
     $imageselect_img = new Xoops\Form\Select(sprintf(XoopsLocale::F_FILE_EXISTS_IN, $avatars_path . '/'), 'avatar_file', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray($avatars_path);
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $xoops_upload_url = \XoopsBaseConfig::get('uploads-url');
     $imageselect_img->setExtra("onchange='showImgSelected(\"xo-avatar-img\", \"avatar_file\", \"avatars\", \"\", \"" . $xoops_upload_url . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new Xoops\Form\Label('', "<br /><img src='" . $xoops_upload_url . "/avatars/" . $blank_img . "' name='image_img' id='xo-avatar-img' alt='' />"));
     $fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new Xoops\Form\File(XoopsLocale::A_UPLOAD, 'avatar_file'), false);
     // , $xoops->getModuleConfig('avatars_imagefilesize')
     $imgtray_img->addElement($fileseltray_img);
     $this->addElement($imgtray_img);
     // Weight
     $weight = new Xoops\Form\Text(XoopsLocale::DISPLAY_ORDER, 'avatar_weight', 1, 4, $obj->getVar('avatar_weight', 'e'), '');
     $weight->setPattern('^\\d+$', XoopsLocale::E_YOU_NEED_A_POSITIVE_INTEGER);
     $this->addElement($weight, true);
     // Display
     $this->addElement(new Xoops\Form\RadioYesNo(XoopsLocale::DISPLAY_THIS_ITEM, 'avatar_display', $obj->getVar('avatar_display', 'e'), XoopsLocale::YES, XoopsLocale::NO));
     // Hidden
     if ($obj->isNew()) {
         $this->addElement(new Xoops\Form\Hidden('avatar_type', 's'));
     }
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Hidden('avatar_id', $obj->getVar('avatar_id', 'e')));
     // Button
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 18
0
 /**
  * @param PublisherFile $obj
  */
 public function __construct(PublisherFile $obj)
 {
     $xoops = Xoops::getInstance();
     $publisher = Publisher::getInstance();
     $publisher->loadLanguage('main');
     parent::__construct(_AM_PUBLISHER_UPLOAD_FILE, "form", $xoops->getEnv('PHP_SELF'));
     $this->setExtra('enctype="multipart/form-data"');
     // NAME
     $name_text = new Xoops\Form\Text(_CO_PUBLISHER_FILENAME, 'name', 50, 255, $obj->getVar('name'));
     $name_text->setDescription(_CO_PUBLISHER_FILE_NAME_DSC);
     $this->addElement($name_text, true);
     // DESCRIPTION
     $description_text = new Xoops\Form\TextArea(_CO_PUBLISHER_FILE_DESCRIPTION, 'description', $obj->getVar('description'));
     $description_text->setDescription(_CO_PUBLISHER_FILE_DESCRIPTION_DSC);
     $this->addElement($description_text);
     // FILE TO UPLOAD
     $file_box = new Xoops\Form\File(_CO_PUBLISHER_FILE_TO_UPLOAD, "item_upload_file");
     $file_box->set('size', 50);
     $this->addElement($file_box);
     $status_select = new Xoops\Form\RadioYesNo(_CO_PUBLISHER_FILE_STATUS, 'file_status', _PUBLISHER_STATUS_FILE_ACTIVE);
     $status_select->setDescription(_CO_PUBLISHER_FILE_STATUS_DSC);
     $this->addElement($status_select);
     // fileid
     $this->addElement(new Xoops\Form\Hidden('fileid', $obj->getVar('fileid')));
     // itemid
     $this->addElement(new Xoops\Form\Hidden('itemid', $obj->getVar('itemid')));
     $files_button_tray = new Xoops\Form\ElementTray('', '');
     $files_hidden = new Xoops\Form\Hidden('op', 'uploadfile');
     $files_button_tray->addElement($files_hidden);
     if (!$obj->getVar('fileid')) {
         $files_butt_create = new Xoops\Form\Button('', '', _MD_PUBLISHER_UPLOAD, 'submit');
         $files_butt_create->setExtra('onclick="this.form.elements.op.value=\'uploadfile\'"');
         $files_button_tray->addElement($files_butt_create);
         $files_butt_another = new Xoops\Form\Button('', '', _CO_PUBLISHER_FILE_UPLOAD_ANOTHER, 'submit');
         $files_butt_another->setExtra('onclick="this.form.elements.op.value=\'uploadanother\'"');
         $files_button_tray->addElement($files_butt_another);
     } else {
         $files_butt_create = new Xoops\Form\Button('', '', _MD_PUBLISHER_MODIFY, 'submit');
         $files_butt_create->setExtra('onclick="this.form.elements.op.value=\'modify\'"');
         $files_button_tray->addElement($files_butt_create);
     }
     $files_butt_clear = new Xoops\Form\Button('', '', _MD_PUBLISHER_CLEAR, 'reset');
     $files_button_tray->addElement($files_butt_clear);
     $buttonCancel = new Xoops\Form\Button('', '', _MD_PUBLISHER_CANCEL, 'button');
     $buttonCancel->setExtra('onclick="history.go(-1)"');
     $files_button_tray->addElement($buttonCancel);
     $this->addElement($files_button_tray);
 }
Ejemplo n.º 19
0
 /**
  * @param UserrankRank|XoopsObject $obj
  */
 public function __construct(XoopsObject $obj)
 {
     if ($obj->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('ranks/', '', $obj->getVar('rank_image', 'e'));
     }
     $title = $obj->isNew() ? sprintf(_AM_USERRANK_ADD) : sprintf(_AM_USERRANK_EDIT);
     parent::__construct($title, 'form', 'userrank.php', 'post', true);
     $this->setExtra('enctype="multipart/form-data"');
     $this->addElement(new Xoops\Form\Text(_AM_USERRANK_TITLE, 'rank_title', 4, 50, $obj->getVar('rank_title')), true);
     $min = new Xoops\Form\Text(_AM_USERRANK_MINPOST, 'rank_min', 1, 10, $obj->getVar('rank_min'));
     $min->setPattern('^\\d+$', _AM_USERRANK_ERROR_POST);
     $this->addElement($min);
     $max = new Xoops\Form\Text(_AM_USERRANK_MAXPOST, 'rank_max', 1, 10, $obj->getVar('rank_max'));
     $max->setPattern('^\\d+$', _AM_USERRANK_ERROR_POST);
     $this->addElement($max);
     $imgtray_img = new Xoops\Form\ElementTray(_AM_USERRANK_IMAGE, '<br />');
     $imgpath_img = sprintf(_AM_USERRANK_IMAGE_PATH, \XoopsBaseConfig::get('uploads-path') . '/ranks/');
     $imageselect_img = new Xoops\Form\Select($imgpath_img, 'rank_image', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(\XoopsBaseConfig::get('uploads-path') . '/ranks');
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $imageselect_img->setExtra("onchange='showImgSelected(\"xo-ranks-img\", \"rank_image\", \"ranks\", \"\", \"" . \XoopsBaseConfig::get('uploads-url') . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new Xoops\Form\Label('', "<br /><img src='" . \XoopsBaseConfig::get('uploads-url') . "/ranks/" . $blank_img . "' name='image_img' id='xo-ranks-img' alt='' />"));
     $fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new Xoops\Form\File(_AM_USERRANK_UPLOAD, 'rank_image'), false);
     $fileseltray_img->addElement(new Xoops\Form\Label(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $this->addElement($imgtray_img);
     if (!$obj->isNew()) {
         $rank_special = $obj->getVar('rank_special');
     } else {
         $rank_special = 0;
     }
     $special_tray = new Xoops\Form\ElementTray(_AM_USERRANK_SPECIAL, '<br />');
     $special_tray->setDescription(_AM_USERRANK_SPECIAL_CAN);
     $special_tray->addElement(new Xoops\Form\RadioYesNo('', 'rank_special', $rank_special));
     $this->addElement($special_tray);
     if (!$obj->isNew()) {
         $this->addElement(new Xoops\Form\Hidden('rank_id', $obj->getVar('rank_id')));
     }
     $this->addElement(new Xoops\Form\Hidden('op', 'userrank_save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 20
0
 /**
  * @param ProfileCategory|XoopsObject $obj
  */
 public function __construct(ProfileCategory &$obj)
 {
     $title = $obj->isNew() ? sprintf(_PROFILE_AM_ADD, _PROFILE_AM_CATEGORY) : sprintf(_PROFILE_AM_EDIT, _PROFILE_AM_CATEGORY);
     parent::__construct($title, 'form', false, 'post', true);
     $this->addElement(new Xoops\Form\Text(_PROFILE_AM_TITLE, 'cat_title', 5, 255, $obj->getVar('cat_title')), true);
     if (!$obj->isNew()) {
         //Load groups
         $this->addElement(new Xoops\Form\Hidden('id', $obj->getVar('cat_id')));
     }
     $this->addElement(new Xoops\Form\TextArea(_PROFILE_AM_DESCRIPTION, 'cat_description', $obj->getVar('cat_description', 'e'), 5, 5));
     $weight = new Xoops\Form\Text(_PROFILE_AM_WEIGHT, 'cat_weight', 1, 5, $obj->getVar('cat_weight', 'e'), '');
     $weight->setPattern('^\\d+$', _PROFILE_AM_ERROR_WEIGHT);
     $this->addElement($weight, true);
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 21
0
 /**
  * @param null $obj
  */
 public function __construct($object = null)
 {
     $this->object = $object;
     $this->config = $object->config;
     $xoops = Xoops::getInstance();
     parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
     $this->addElement(new Xoops\Form\Text(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars']), true);
     $this->addElement(new Xoops\Form\Hidden('type', 'text'));
     $buttonTray = new Xoops\Form\ElementTray('', '');
     $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
     $buttonCancelSend = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $buttonCancelSend->setExtra("onclick='javascript:history.go(-1);'");
     $buttonTray->addElement($buttonCancelSend);
     $this->addElement($buttonTray);
 }
Ejemplo n.º 22
0
 public function getSearchFrom($andor, $queries, $mids, $mid)
 {
     $xoops = Xoops::getInstance();
     $search = Search::getInstance();
     // create form
     parent::__construct(_MD_SEARCH, 'search', 'index.php', 'get');
     // create form elements
     $this->addElement(new Xoops\Form\Text(_MD_SEARCH_KEYWORDS, 'query', 30, 255, htmlspecialchars(stripslashes($this->queryArrayToString($queries)), ENT_QUOTES)), true);
     $type_select = new Xoops\Form\Select(_MD_SEARCH_TYPE, 'andor', $andor);
     $type_select->addOptionArray(array('AND' => _MD_SEARCH_ALL, 'OR' => _MD_SEARCH_ANY));
     $this->addElement($type_select);
     if (!empty($mids)) {
         $mods_checkbox = new Xoops\Form\Checkbox(_MD_SEARCH_SEARCHIN, 'mids[]', $mids);
     } else {
         $mods_checkbox = new Xoops\Form\Checkbox(_MD_SEARCH_SEARCHIN, 'mids[]', $mid);
     }
     if (empty($modules)) {
         $gperm_handler = $xoops->getHandlerGroupperm();
         $available_modules = $gperm_handler->getItemIds('module_read', $xoops->getUserGroups());
         $available_plugins = \Xoops\Module\Plugin::getPlugins('search');
         //todo, would be nice to have the module ids availabe also
         $criteria = new CriteriaCompo();
         $criteria->add(new Criteria('dirname', "('" . implode("','", array_keys($available_plugins)) . "')", 'IN'));
         if (isset($available_modules) && !empty($available_modules)) {
             $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN'));
         }
         $module_handler = $xoops->getHandlerModule();
         $mods_checkbox->addOptionArray($module_handler->getNameList($criteria));
     } else {
         /* @var $module XoopsModule */
         $module_array = array();
         foreach ($modules as $mid => $module) {
             $module_array[$mid] = $module->getVar('name');
         }
         $mods_checkbox->addOptionArray($module_array);
     }
     $this->addElement($mods_checkbox);
     if ($search->getConfig('keyword_min') > 0) {
         $this->addElement(new Xoops\Form\Label(_MD_SEARCH_SEARCHRULE, sprintf(_MD_SEARCH_KEYIGNORE, $search->getConfig('keyword_min'))));
     }
     $this->addElement(new Xoops\Form\Hidden('action', 'results'));
     $this->addElement(new Xoops\Form\Token('id'));
     $this->addElement(new Xoops\Form\Button('', 'submit', _MD_SEARCH, 'submit'));
     return $this;
 }
Ejemplo n.º 23
0
 /**
  * @param XoopsModule|null $mod
  */
 public function getModulesForm($mod = null)
 {
     $xoops = Xoops::getInstance();
     $mid = 0;
     if ($mod instanceof XoopsModule) {
         $mid = $mod->getVar('mid');
     }
     /* @var $plugin UserconfigsPluginInterface */
     if ($plugins = \Xoops\Module\Plugin::getPlugins('userconfigs')) {
         parent::__construct('', 'pref_form', 'index.php', 'post', true, 'inline');
         $ele = new Xoops\Form\Select(_MD_USERCONFIGS_CHOOSE_MODULE, 'mid', $mid);
         foreach (array_keys($plugins) as $dirname) {
             $mHelper = $xoops->getModuleHelper($dirname);
             $ele->addOption($mHelper->getModule()->getVar('mid'), $mHelper->getModule()->getVar('name'));
         }
         $this->addElement($ele);
         $this->addElement(new Xoops\Form\Hidden('op', 'showmod'));
         $this->addElement(new Xoops\Form\Button('', 'button', XoopsLocale::A_SUBMIT, 'submit'));
     }
 }
Ejemplo n.º 24
0
 /**
  * Maintenance Form
  * @return void
  */
 public function getPrefIp($bad_ips4disp, $group1_ips4disp)
 {
     global $xoopsDB;
     $db = $xoopsDB;
     $protector = Protector::getInstance($db->conn);
     require_once dirname(__DIR__) . '/gtickets.php';
     parent::__construct('', "form_prefip", "center.php", 'post', true);
     $bad_ips = new Xoops\Form\TextArea(_AM_TH_BADIPS, 'bad_ips', $bad_ips4disp, 3, 90);
     $bad_ips->setDescription('<br />' . htmlspecialchars($protector->get_filepath4badips()));
     $bad_ips->setClass('span3');
     $this->addElement($bad_ips);
     $group1_ips = new Xoops\Form\TextArea(_AM_TH_GROUP1IPS, 'group1_ips', $group1_ips4disp, 3, 90);
     $group1_ips->setDescription('<br />' . htmlspecialchars($protector->get_filepath4group1ips()));
     $group1_ips->setClass('span3');
     $this->addElement($group1_ips);
     $formTicket = new xoopsGTicket();
     $this->addElement(new Xoops\Form\Hidden("action", "update_ips"));
     $ticket = $formTicket->getTicketXoopsForm(__LINE__, 1800, 'protector_admin');
     $this->addElement($ticket);
     $this->addElement(new Xoops\Form\Button('', "submit_prefip", XoopsLocale::A_SUBMIT, "submit"));
 }
Ejemplo n.º 25
0
 public function __construct(AvatarsAvatar $obj)
 {
     $xoops = Xoops::getInstance();
     $helper = Avatars::getInstance();
     // Get avatar handler
     $avatar_handler = $helper->getHandlerAvatar();
     $action = $_SERVER['REQUEST_URI'];
     parent::__construct(AvatarsLocale::USERFORM, 'avatar_user_form', $action, "post", true);
     $this->setExtra('enctype="multipart/form-data"');
     // select and uploads
     $avatar_select = new Xoops\Form\Select('', 'user_avatar', $xoops->user->getVar('user_avatar'));
     $avatar_list = $avatar_handler->getListByType('S', true);
     $avatar_selected = $xoops->user->getVar("user_avatar", "E");
     $avatar_selected = in_array($avatar_selected, array_keys($avatar_list)) ? $avatar_selected : "blank.gif";
     $avatar_select->addOptionArray($avatar_list);
     $xoops_url = \XoopsBaseConfig::get('url');
     $xoops_upload_url = \XoopsBaseConfig::get('uploads-url');
     $avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"uploads\", \"\", \"" . $xoops_url . "\")'");
     $avatar_tray = new Xoops\Form\ElementTray(XoopsLocale::FILE, '&nbsp;');
     $avatar_tray->addElement($avatar_select);
     $avatar_tray->addElement(new Xoops\Form\Label('', "<a href=\"javascript:openWithSelfMain('" . $xoops_url . "/modules/avatars/popup.php','avatars',600,400);\">" . XoopsLocale::LIST_ . "</a><br />"));
     $avatar_tray->addElement(new Xoops\Form\Label('', "<br /><img src='" . $xoops_upload_url . "/" . $avatar_selected . "' name='avatar' id='avatar' alt='' />"));
     if ($helper->getConfig('avatars_allowupload') == 1 && $xoops->user->getVar('posts') >= $helper->getConfig('avatars_postsrequired')) {
         $fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
         $fileseltray_img->addElement(new Xoops\Form\File(XoopsLocale::A_UPLOAD, 'user_avatar'), false);
         $avatar_tray->addElement($fileseltray_img);
     }
     $this->addElement($avatar_tray);
     // Hidden
     $this->addElement(new Xoops\Form\Hidden('avatar_type', 'c'));
     $this->addElement(new Xoops\Form\Hidden('uid', $xoops->user->getVar('uid')));
     $this->addElement(new Xoops\Form\Hidden('op', 'save'));
     $this->addElement(new Xoops\Form\Hidden('avatar_id', $obj->getVar('avatar_id', 'e')));
     // Button
     $this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
 }
Ejemplo n.º 26
0
 /**
  * @param null $obj
  */
 public function __construct($object = null)
 {
     $this->object = $object;
     $this->config = $object->config;
     $xoops = Xoops::getInstance();
     parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
     $this->addElement(new Xoops\Form\TextArea(_XCAPTCHA_PRIVATE_KEY, 'private_key', $this->config['private_key'], 5, 50), true);
     $this->addElement(new Xoops\Form\Textarea(_XCAPTCHA_PUBLIC_KEY, 'public_key', $this->config['public_key'], 5, 50), true);
     $theme_form = new Xoops\Form\Select(_XCAPTCHA_THEME, 'theme', $this->config['theme'], $size = 4);
     $theme_form->addOptionArray($this->object->getThemes());
     $this->addElement($theme_form, false);
     $lang_form = new Xoops\Form\Select(_XCAPTCHA_LANG, 'lang', $this->config['lang'], $size = 4);
     $lang_form->addOptionArray($this->object->getLanguages());
     $this->addElement($lang_form, false);
     $this->addElement(new Xoops\Form\Hidden('type', 'recaptcha'));
     $buttonTray = new Xoops\Form\ElementTray('', '');
     $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
     $buttonTray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
     $buttonCancelSend = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
     $buttonCancelSend->setExtra("onclick='javascript:history.go(-1);'");
     $buttonTray->addElement($buttonCancelSend);
     $this->addElement($buttonTray);
 }
Ejemplo n.º 27
0
echo '<h2>Permission demo</h2>';
$permissionHelper = new Permission();
if ($permissionHelper) {
    // this is the name and item we are going to work with
    $permissionName = 'fred';
    $permissionItemId = 1;
    // if this is a post operation get the input and save it
    if ('POST' === Request::getMethod()) {
        echo $xoops->alert('success', 'Permission updated');
        // save the data
        $name = $permissionHelper->defaultFieldName($permissionName, $permissionItemId);
        $groups = Request::getVar($name, array(), 'POST');
        $permissionHelper->savePermissionForItem($permissionName, $permissionItemId, $groups);
    }
    // build a form for our permission
    $form = new Xoops\Form\ThemeForm("Permission Form (for the permission named '{$permissionName}')", 'form', '', 'POST');
    $groupElement = $permissionHelper->getGroupSelectFormForItem($permissionName, $permissionItemId, "Groups with '{$permissionName}' permission", null, true);
    $form->addElement($groupElement);
    $form->addElement(new Xoops\Form\Button('', 'submit', 'Save', 'submit'));
    echo $form->render();
    // check it the current user has the permission
    if ($permissionHelper->checkPermission($permissionName, $permissionItemId)) {
        echo "<p>You have the <strong>'{$permissionName}'</strong> permission for the 'codex' module.</p>";
    } else {
        echo "<p>You <em>DO NOT</em> have the <strong>'{$permissionName}'</strong> " . "permission for the 'codex' module.</p>";
    }
}
echo '<h2>Metagen</h2>';
//define a title and article to work with
$keywords = '';
$title = "xmf - the XOOPS Module Framework";
Ejemplo n.º 28
0
            \$('#crack_time').addClass('label-info');
            \$('#submit').removeAttr('disabled');
        }
        if (result.crack_time >= great) {
            \$('#crack_time').removeClass('label-danger label-important label-warning label-info');
            \$('#crack_time').addClass('label-success');
            \$('#submit').removeAttr('disabled');
        }
    });
});
EOT;
$xoops->header('module:profile/profile_changepass.tpl');
if (!isset($_POST['submit'])) {
    $xoops->theme()->addScript(null, array('type' => 'application/x-javascript'), $zxcvbn);
    //show change password form
    $form = new Xoops\Form\ThemeForm(_PROFILE_MA_CHANGEPASSWORD, 'form', $_SERVER['REQUEST_URI'], 'post', true);
    $form->addElement(new Xoops\Form\Password(_PROFILE_MA_OLDPASSWORD, 'oldpass'), true);
    $password = new Xoops\Form\Password(_PROFILE_MA_NEWPASSWORD, 'newpass', null, null, '', 'off', 'New Password');
    $password->setPattern('^.{8,}$', 'You need at least 8 characters');
    $form->addElement($password, true);
    $form->addElement(new Xoops\Form\Label(XoopsLocale::PASSWORD_STRENGTH, '', 'crack_time'));
    $form->addElement(new Xoops\Form\Password(XoopsLocale::VERIFY_PASSWORD, 'vpass'), true);
    $form->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
    $form->assign($xoops->tpl());
    $xoops->appendConfig('profile_breadcrumbs', array('caption' => _PROFILE_MA_CHANGEPASSWORD));
} else {
    $xoops->getConfigs();
    $myts = \Xoops\Core\Text\Sanitizer::getInstance();
    $oldpass = trim($_POST['oldpass']);
    $password = trim($_POST['newpass']);
    $vpass = trim($_POST['vpass']);
Ejemplo n.º 29
0
 /**
  * Get form for setting prune criteria
  *
  * @return Xoops\Form\ThemeForm
  **/
 public function getPruneForm()
 {
     $form = new Xoops\Form\ThemeForm(_PM_AM_PRUNE, 'form', 'prune.php', 'post', true);
     $form->addElement(new Xoops\Form\DateTime(_PM_AM_PRUNEAFTER, 'after'));
     $form->addElement(new Xoops\Form\DateTime(_PM_AM_PRUNEBEFORE, 'before'));
     $form->addElement(new Xoops\Form\RadioYesNo(_PM_AM_ONLYREADMESSAGES, 'onlyread', 1));
     $form->addElement(new Xoops\Form\RadioYesNo(_PM_AM_INCLUDESAVE, 'includesave', 0));
     $form->addElement(new Xoops\Form\RadioYesNo(_PM_AM_NOTIFYUSERS, 'notifyusers', 0));
     $form->addElement(new Xoops\Form\Hidden('op', 'prune'));
     $form->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
     return $form;
 }
Ejemplo n.º 30
0
                         $text .= '</table>';
                     }
                     unset($module);
                 }
             }
         }
         $xoops->tpl()->assign('infos', $text);
         $xoops->tpl()->assign('verif', $verif_write);
     } else {
         $xoops->redirect("admin.php?fct=tplsets", 2, XoopsLocale::S_DONE);
     }
 } else {
     // Generate one module
     $xoops->tpl()->assign('index', true);
     $tplset = $system->cleanVars($POST, 'tplset', 'default', 'string');
     $form = new Xoops\Form\ThemeForm(XoopsLocale::SELECT_TEMPLATES, "form", 'admin.php?fct=tplsets', "post", true);
     $tpltpl_handler = $xoops->getHandlerTplFile();
     $templates_arr = $tpltpl_handler->find($tplset, '', null, $_REQUEST['select_modules']);
     $modules = new Xoops\Form\Select(XoopsLocale::SELECT_TEMPLATES, 'select_templates_modules', null, 10, true);
     foreach (array_keys($templates_arr) as $i) {
         $modules->addOption($templates_arr[$i]->getVar('tpl_file'));
     }
     $form->addElement($modules);
     $form->addElement(new Xoops\Form\Hidden("active_templates", "1"));
     $form->addElement(new Xoops\Form\Hidden("force_generated", $_REQUEST['force_generated']));
     $form->addElement(new Xoops\Form\Hidden("select_modules", $_REQUEST['select_modules']));
     $form->addElement(new Xoops\Form\Hidden("active_modules", "1"));
     $form->addElement(new Xoops\Form\Hidden("select_theme", $_REQUEST['select_theme']));
     $form->addElement(new Xoops\Form\Hidden("op", "tpls_overload"));
     $form->addElement(new Xoops\Form\Button("", "submit", XoopsLocale::A_SUBMIT, "submit"));
     $xoops->tpl()->assign('form', $form->render());