Example #1
0
 function greenepForm($action = false)
 {
     global $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $title = $this->isNew() ? _AM_CATALOG_ADD_GREENEP : _AM_CATALOG_EDIT_GREENEP;
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_CATALOG_GREENEP_RANK, 'greenep_rank', 60, 255, $this->getVar('greenep_rank')), true);
     $logo_image = new XoopsFormElementTray(_AM_CATALOG_GREENLOGO);
     if ($this->getVar('greenep_id')) {
         $logo_image->addElement(new XoopsFormLabel('', '<img src="' . XOOPS_URL . "/uploads/" . $this->getVar('greenep_logo') . '" width="100"><br><br>'));
         $display = _AM_CATALOG_REUPLOAD;
     } else {
         $display = '';
     }
     $logo_image->addElement(new XoopsFormFile('', 'greenep_logo', 1024 * 1024 * 2));
     $logo_image->addElement(new XoopsFormLabel('', $display));
     $form->addElement($logo_image);
     $form->addElement(new XoopsFormText(_AM_CATALOG_SORT, 'greenep_weight', 40, 60, $this->getVar('greenep_weight')));
     $form->addElement(new XoopsFormHidden('greenep_id', $this->getVar('greenep_id')));
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
 /**
  * Constructor
  *
  * @param string $caption
  * @param string $name
  * @param mixed $value Pre-selected value (or array of them).
  *                                                 For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param bool $include_anon Include user "anonymous"?
  * @param int $size Number or rows. "1" makes a drop-down-list.
  * @param bool $multiple Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new XoopsFormSelect('', $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS['xoopsConfig']['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         $this->XoopsFormElementTray($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage('findusers');
     $js_addusers = "<script type='text/javascript'>\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(':'));\r\n                opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                var sel = xoopsGetElementById('" . $name . "');\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&amp;multiple=' . $multiple . '&amp;token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers));
     $this->XoopsFormElementTray($caption, '<br /><br />', $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
Example #3
0
 /**
  * @创建按钮
  * @license http://www.blags.org/
  * @created:2010年05月20日 23时52分
  * @copyright 1997-2010 The Martin Group
  * @author Martin <*****@*****.**> 
  * */
 function createButtons()
 {
     $button_tray = new XoopsFormElementTray('', '');
     // No ID for category -- then it's new category, button says 'Create'
     if (empty($this->Obj)) {
         $butt_create = new XoopsFormButton('', '', '提交', 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', '清空', 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', 'cancel', 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     } else {
         // button says 'Update'
         $butt_create = new XoopsFormButton('', '', '修改', 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', '清空', 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', 'cancel', 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     }
 }
Example #4
0
 /**
  * Retourne le formulaire utilisé pour paramétrer la passerelle de paiement
  *
  * @return object de type XoopsThemeForm
  */
 function getParametersForm($postUrl)
 {
     require $this->getGatewayLanguageFile();
     $sform = new XoopsThemeForm(_OLEDRION_PAYPAL_PARAMETERS . ' - ' . $this->gatewayInformation['name'], 'frmPaypal', $postUrl);
     // You must specify the gateway folder's name
     $sform->addElement(new XoopsFormHidden('gateway', $this->gatewayInformation['foldername']));
     // Adresse email Paypal du compte marchand
     $paypal_email = new XoopsFormText(_OLEDRION_PAYPAL_EMAIL, 'paypal_email', 50, 255, $this->handlers->h_oledrion_gateways_options->getGatewayOptionValue($this->gatewayInformation['foldername'], 'paypal_email'));
     $paypal_email->setDescription(_OLEDRION_PAYPAL_EMAILDSC);
     $sform->addElement($paypal_email, true);
     // Libellé de la monnaie pour Paypal
     $paypal_money = new XoopsFormSelect(_OLEDRION_PAYPAL_MONEY_P, 'paypal_money', $this->handlers->h_oledrion_gateways_options->getGatewayOptionValue($this->gatewayInformation['foldername'], 'paypal_money'));
     $paypal_money->addOptionArray(array('AUD' => 'Australian Dollar', 'CAD' => 'Canadian Dollar', 'CHF' => 'Swiss Franc', 'CZK' => 'Czech Koruna', 'DKK' => 'Danish Krone', 'EUR' => 'Euro', 'GBP' => 'Pound Sterling', 'HKD' => 'Hong Kong Dollar', 'HUF' => 'Hungarian Forint', 'JPY' => 'Japanese Yen', 'NOK' => 'Norwegian Krone', 'NZD' => 'New Zealand Dollar', 'PLN' => 'Polish Zloty', 'SEK' => 'Swedish Krona', 'SGD' => 'Singapore Dollar', 'USD' => 'U.S. Dollar'));
     $sform->addElement($paypal_money, true);
     // Paypal en mode test ?
     $paypal_test = new XoopsFormRadioYN(_OLEDRION_PAYPAL_TEST, 'paypal_test', $this->handlers->h_oledrion_gateways_options->getGatewayOptionValue($this->gatewayInformation['foldername'], 'paypal_test'));
     $sform->addElement($paypal_test, true);
     // Forcé à vrai ...
     $sform->addElement(new XoopsFormHidden('use_ipn', 1));
     $button_tray = new XoopsFormElementTray('', '');
     $submit_btn = new XoopsFormButton('', 'post', _AM_OLEDRION_GATEWAYS_UPDATE, 'submit');
     $button_tray->addElement($submit_btn);
     $sform->addElement($button_tray);
     return $sform;
 }
 function &execute(&$controller, &$request, &$user)
 {
     $editform =& $request->getAttribute('editform');
     $form = new XoopsThemeForm(_MD_A_PLZXOO_LANG_EDIT_CATEGORY, 'Category', '', 'POST');
     $form->addElement(new XoopsFormHidden('cid', $editform->cid_));
     $form->addElement(new XoopsFormText(_MD_A_PLZXOO_LANG_NAME, 'name', 64, 255, $editform->name_));
     //-------------------------
     // ¿Æ¥«¥Æ¥´¥ê
     //-------------------------
     $select = new XoopsFormSelect(_MD_A_PLZXOO_LANG_PARENT_CATEGORY, 'pid', $editform->pid_);
     $select->addOption(0, _MD_A_PLZXOO_LANG_TOP);
     $categories =& $request->getAttribute('categories');
     foreach ($categories as $category) {
         $select->addOption($category->getVar('cid'), $category->getVar('name'));
     }
     $form->addElement($select);
     unset($select);
     $form->addElement(new XoopsFormDhtmlTextArea(_MD_A_PLZXOO_LANG_DESCRIPTION, 'description', $editform->description_, 6, 50));
     $form->addElement(new XoopsFormText(_MD_A_PLZXOO_LANG_WEIGHT, 'weight', 10, 10, intval($editform->weight_)));
     $tray = new XoopsFormElementTray(_MD_A_PLZXOO_LANG_CONTROL);
     $tray->addElement(new XoopsFormButton('', 'submit', _MD_A_PLZXOO_LANG_SUBMIT, 'submit'));
     $tray->addElement(new XoopsFormButton('', 'reset', _MD_A_PLZXOO_LANG_RESET, 'reset'));
     $form->addElement($tray);
     $renderer = new mojaLE_Renderer($controller, $request, $user);
     $renderer->setTemplate('category_edit.tpl');
     $renderer->setAttribute('xoopsform', $form);
     return $renderer;
 }
Example #6
0
function display_edit_form($cat_array, $form_title, $action)
{
    global $cattree;
    $myts =& MyTextSanitizer::getInstance();
    extract($cat_array);
    // Beggining of XoopsForm
    $form = new XoopsThemeForm($form_title, 'MainForm', '');
    // Hidden
    $form->addElement(new XoopsFormHidden('action', $action));
    $form->addElement(new XoopsFormHidden('cid', $cid));
    // Title
    $form->addElement(new XoopsFormText(_AM_CAT_TH_TITLE, 'title', 30, 50, $myts->htmlSpecialChars($title)), true);
    // Image URL
    $form->addElement(new XoopsFormText(_AM_CAT_TH_IMGURL, 'imgurl', 50, 150, $myts->htmlSpecialChars($imgurl)));
    // Parent Category
    ob_start();
    $cattree->makeMySelBox("title", "title", $pid, 1, 'pid');
    $cat_selbox = ob_get_contents();
    ob_end_clean();
    $form->addElement(new XoopsFormLabel(_AM_CAT_TH_PARENT, $cat_selbox));
    // Buttons
    $button_tray = new XoopsFormElementTray('', '&nbsp;');
    $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
    $button_tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
    $form->addElement($button_tray);
    // End of XoopsForm
    $form->display();
}
Example #7
0
function editcat($catid = '')
{
    $name = '';
    $description = '';
    global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    if ($modify) {
        $result = $xoopsDB->query("SELECT name, description FROM " . $xoopsDB->prefix("faqcategories") . " WHERE catID = '{$catid}'");
        list($name, $description) = mysql_fetch_row($result);
        if (mysql_num_rows($result) == 0) {
            redirect_header("index.php", 1, _AM_NOCATTOEDIT);
            exit;
        }
        $sform = new XoopsThemeForm(_AM_MODIFYCAT, "op", xoops_getenv('PHP_SELF'));
    } else {
        $sform = new XoopsThemeForm(_AM_ADDCAT, "op", xoops_getenv('PHP_SELF'));
    }
    $sform->addElement(new XoopsFormText(_AM_CATNAME, 'name', 50, 80, $name), true);
    $sform->addElement(new XoopsFormDhtmlTextArea(_AM_CATDESCRIPT, 'description', $description, 15, 60));
    $sform->addElement(new XoopsFormHidden('catid', $catid));
    $sform->addElement(new XoopsFormHidden('modify', $modify));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addcat');
    $button_tray->addElement($hidden);
    if ($modify == '0') {
        $button_tray->addElement(new XoopsFormButton('', 'update', _AM_CREATE, 'submit'));
    } else {
        $button_tray->addElement(new XoopsFormButton('', 'update', _AM_MODIFY, 'submit'));
    }
    $sform->addElement($button_tray);
    $sform->display();
    unset($hidden);
}
 /**
  * @创建按钮
  * @license   http://www.blags.org/
  * @created   :2010年05月20日 23时52分
  * @copyright 1997-2010 The Martin Group
  * @author    Martin <*****@*****.**>
  * */
 public function createButtons()
 {
     $button_tray = new XoopsFormElementTray('', '');
     // No ID for category -- then it's new category, button says 'Create'
     if (!$this->Obj->promotion_id()) {
         $butt_create = new XoopsFormButton('', '', _SUBMIT, 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', _RESET, 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     } else {
         // button says 'Update'
         $butt_create = new XoopsFormButton('', '', _EDIT, 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', _RESET, 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     }
 }
Example #9
0
 function createElements($target)
 {
     $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'tabtitle', 35, 255, $target->getVar('tabtitle', 'e')));
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_PUBLISHDATE, 'tabfromdate', 15, $target->getVar('tabfromdate', 'e')));
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_ENDDATE, 'tabtodate', 15, $target->getVar('tabtodate', 'e')));
     $always_select = new XoopsFormSelect(_AM_MYTABS_ALWAYSSHOW . ":", "tabalwayson", $target->getVar('tabshowalways', 'e'));
     $always_select->addOption("yes", _AM_MYTABS_ALWAYS);
     $always_select->addOption("time", _AM_MYTABS_TIMEBASED);
     $always_select->addOption("no", _AM_MYTABS_OFF);
     $this->addElement($always_select);
     $this->addElement(new XoopsFormText(_AM_MYTABS_PRIORITY . ":", "tabpriority", 4, 5, $target->getVar('tabpriority', 'e')));
     $note = new XoopsFormText(_AM_MYTABS_NOTE . ":", "tabnote", 50, 255, $target->getVar('tabnote', 'e'));
     $this->addElement($note);
     $this->addElement(new XoopsFormSelectGroup(_AM_MYTABS_GROUPS, 'tabgroups', true, $target->getVar('tabgroups'), 8, true));
     $link = new XoopsFormText(_AM_MYTABS_LINK . ":", "tablink", 50, 255, $target->getVar('tablink', 'e'));
     $this->addElement($link);
     $rev = new XoopsFormText(_AM_MYTABS_REV . ":", "tabrev", 50, 255, $target->getVar('tabrev', 'e'));
     $this->addElement($rev);
     if (!$target->isNew()) {
         $this->addElement(new XoopsFormHidden("tabid", $target->getVar('tabid')));
     }
     $this->addElement(new XoopsFormHidden("tabpageid", $target->getVar('tabpageid')));
     $this->addElement(new XoopsFormHidden("op", "save"));
     $tray = new XoopsFormElementTray("");
     $tray->addElement(new XoopsFormButton("", "submit", _AM_MYTABS_OK, "submit"));
     $cancel = new XoopsFormButton("", "cancel", _AM_MYTABS_CANCEL, "button");
     $cancel->setExtra("onclick=\"self.location='index.php?pageid=" . $target->getVar('tabpageid') . "';\"");
     $tray->addElement($cancel);
     $this->addElement($tray);
 }
Example #10
0
 /**
  * XoopsfaqCategory::displayForm()
  *
  * @return
  */
 function displayForm()
 {
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $caption = $this->isNew() ? _AM_XOOPSFAQ_CREATENEW : sprintf(_AM_XOOPSFAQ_MODIFYITEM, $this->getVar('category_title'));
     $form = new XoopsThemeForm($caption, 'content', xoops_getenv('PHP_SELF'));
     $form->addElement(new XoopsFormHiddenToken());
     $form->addElement(new xoopsFormHidden('op', 'save'));
     $form->addElement(new xoopsFormHidden('category_id', $this->getVar('category_id', 'e')));
     // title
     $category_title = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_TITLE, 'category_title', 50, 150, $this->getVar('category_title', 'e'));
     $category_title->setDescription(_AM_XOOPSFAQ_E_CATEGORY_TITLE_DSC);
     $form->addElement($category_title, true);
     // order
     $category_order = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT, 'category_order', 5, 5, $this->getVar('category_order', 'e'));
     $category_order->setDescription(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT_DSC);
     $form->addElement($category_order, false);
     $btnTray = new XoopsFormElementTray('', '');
     $btnSubmit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
     $btnTray->addElement($btnSubmit);
     $btnCancel = new XoopsFormButton('', '', _CANCEL, 'button');
     $btnCancel->setExtra('onclick="history.go(-1)"');
     $btnTray->addElement($btnCancel);
     $form->addElement($btnTray);
     $form->display();
 }
Example #11
0
function b_ams_top_edit($options)
{
    global $xoopsDB;
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsFormElementTray('', '<br/><br />');
    $order_select = new XoopsFormSelect(_AMS_MB_NEWS_ORDER, 'options[0]', $options[0]);
    $order_select->addOption('published', _AMS_MB_NEWS_DATE);
    $order_select->addOption('counter', _AMS_MB_NEWS_HITS);
    $order_select->addOption('rating', _AMS_MB_NEWS_RATING);
    $form->addElement($order_select);
    $form->addElement(new XoopsFormText(_AMS_MB_NEWS_DISP . " x " . _AMS_MB_NEWS_ARTCLS, 'options[1]', 10, 10, $options[1]));
    $form->addElement(new XoopsFormText(_AMS_MB_NEWS_CHARS . " x " . _AMS_MB_NEWS_LENGTH, 'options[2]', 10, 10, $options[2]));
    $form->addElement(new XoopsFormText(_AMS_MB_NEWS_TEASER, 'options[3]', 10, 10, $options[3]));
    if (!isset($options[4])) {
        $topics = array(0);
    } elseif (is_array($options[4])) {
        $topics = $options[4];
    } else {
        $topics = array_slice($options, 4);
    }
    $topics_select = new XoopsFormSelect(_AMS_MB_TOPIC, 'options[4]', $topics, 7, true);
    include_once XOOPS_ROOT_PATH . "/modules/AMS/class/class.newstopic.php";
    $xt = new AmsTopic($xoopsDB->prefix("ams_topics"));
    $alltopics = $xt->getAllTopics();
    $topics_select->addOption(0, _AMS_MB_NEWS_ALLTOPICS);
    foreach ($alltopics as $topicid => $topic) {
        $topics_select->addOption($topicid, $topic->topic_title());
    }
    $form->addElement($topics_select);
    return $form->render();
}
Example #12
0
function b_ams_topicsnav_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsFormElementTray('', '<br/>');
    $restrict_select = new XoopsFormRadioYN(_AMS_MB_NEWS_RESTRICTTOPICS, 'options[0]', $options[0]);
    $form->addElement($restrict_select);
    return $form->render();
}
Example #13
0
 /**
  * Get a {@link XoopsForm} object for creating/editing Spotlight articles
  *
  * @return object
  */
 function getForm($action = false)
 {
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = _AMS_AM_SPOTLIGHT;
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     include_once XOOPS_ROOT_PATH . "/modules/AMS/class/formimageselect.php";
     $form = new XoopsThemeForm($title, 'spotlightform', $action);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('id', $this->getVar('spotlightid')));
     }
     $mode_select = new XoopsFormRadio('', 'mode', $this->getVar('mode'));
     $mode_select->addOption(1, _AMS_AM_SPOT_LATESTARTICLE);
     $mode_select->addOption(2, _AMS_AM_SPOT_LATESTINTOPIC);
     $mode_select->addOption(3, _AMS_AM_SPOT_SPECIFICARTICLE);
     $mode_select->addOption(4, _AMS_AM_SPOT_CUSTOM);
     include_once XOOPS_ROOT_PATH . "/class/tree.php";
     include_once XOOPS_ROOT_PATH . "/modules/AMS/class/class.newstopic.php";
     include_once XOOPS_ROOT_PATH . "/modules/AMS/class/class.newsstory.php";
     $xt = new AmsTopic($GLOBALS['xoopsDB']->prefix("ams_topics"));
     $allTopics = $xt->getAllTopics();
     $topic_obj_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
     $topic_select = new XoopsFormLabel(_AMS_AM_TOPIC, $topic_obj_tree->makeSelBox('topicid', 'topic_title', '--', $this->getVar('topicid'), false));
     $topic_select->setDescription(_AMS_AM_SPOT_TOPIC_DESC);
     $article_select = new XoopsFormSelect(_AMS_AM_ARTICLE, 'storyid', $this->getVar('storyid'));
     $article_select->addOptionArray(AmsStory::getAllPublished($GLOBALS['xoopsModuleConfig']['spotlight_art_num'], 0, false, 0, 1, false));
     $article_select->setDescription(_AMS_AM_SPOT_ARTICLE_DESC);
     $mode_tray = new XoopsFormElementTray(_AMS_AM_SPOT_MODE_SELECT);
     $mode_tray->addElement($mode_select);
     $showimage_select = new XoopsFormRadio(_AMS_AM_SPOT_SHOWIMAGE, 'showimage', $this->getVar('showimage'));
     $showimage_select->addOption(0, _AMS_AM_SPOT_SPECIFYIMAGE);
     $showimage_select->addOption(1, _AMS_AM_SPOT_TOPICIMAGE);
     $showimage_select->addOption(2, _AMS_AM_SPOT_AUTHORIMAGE);
     $showimage_select->addOption(3, _AMS_AM_SPOT_NOIMAGE);
     $showimage_select->setDescription(_AMS_AM_SPOT_SHOWIMAGE_DESC);
     $image_select = new XoopsFormImageSelect(_AMS_AM_SPOT_IMAGE, 'image', $this->getVar('image', 'e'), 70, 255);
     $autoteaser_select = new XoopsFormRadioYN(_AMS_AM_SPOT_AUTOTEASER, 'autoteaser', $this->getVar('autoteaser'));
     $teaser_text = new XoopsFormDhtmlTextArea(_AMS_AM_SPOT_TEASER, 'teaser', $this->getVar('teaser', 'e'));
     $maxlength_text = new XoopsFormText(_AMS_AM_SPOT_MAXLENGTH, 'maxlength', 10, 10, $this->getVar('maxlength'));
     $display_select = new XoopsFormRadioYN(_AMS_AM_SPOT_DISPLAY, 'display', $this->getVar('display'));
     $weight_text = new XoopsFormText(_AMS_AM_SPOT_WEIGHT, 'weight', 10, 10, $this->getVar('weight'));
     $form->addElement($mode_tray);
     $form->addElement($topic_select);
     $form->addElement($article_select);
     $form->addElement($showimage_select);
     $form->addElement($image_select);
     $form->addElement($autoteaser_select);
     $form->addElement($maxlength_text);
     $form->addElement($teaser_text);
     $form->addElement($display_select);
     $form->addElement($weight_text);
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'spotlightsubmit', _AMS_AM_SUBMIT, 'submit'));
     return $form;
 }
Example #14
0
function b_newsletter_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    if (!class_exists('XoopsFormSelectList')) {
        include_once XOOPS_ROOT_PATH . "/modules/smartmail/class/formselectlist.php";
    }
    $form = new XoopsFormElementTray('', '<br/><br />');
    $form->addElement(new XoopsFormSelectList(_NL_BK_NEWSLETTER_ID, 'options[0]', $options[0], 1, "newsletter", "smartmail"));
    return $form->render();
}
Example #15
0
 function createElements($target)
 {
     if ($target->isNew()) {
         $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'title', 35, 255, $target->block->getVar('title', 'e')));
     } else {
         $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'title', 35, 255, $target->getVar('title', 'e')));
     }
     $options = $target->block->getOptions();
     if ($options) {
         $this->addElement(new XoopsFormLabel(_AM_MYTABS_OPTIONS, $options));
     }
     // DATE
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_PUBLISHDATE, 'fromdate', 15, $target->getVar('fromdate', 'e')));
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_ENDDATE, 'todate', 15, $target->getVar('todate', 'e')));
     $always_select = new XoopsFormSelect(_AM_MYTABS_ALWAYSSHOW . ":", "alwayson", $target->getVar('showalways', 'e'));
     $always_select->addOption("yes", _AM_MYTABS_ALWAYS);
     $always_select->addOption("time", _AM_MYTABS_TIMEBASED);
     $always_select->addOption("no", _AM_MYTABS_OFF);
     $this->addElement($always_select);
     $placement = new XoopsFormSelect(_AM_MYTABS_PLACEMENT . ":", "tabid", $target->getVar('tabid', 'e'));
     $tab_handler = xoops_getmodulehandler('tab');
     $tabs = $tab_handler->getObjects(new Criteria('tabpageid', $target->getVar('pageid')));
     foreach ($tabs as $tab) {
         $placement->addOption($tab->getVar('tabid'), $tab->getVar('tabtitle'));
     }
     $this->addElement($placement);
     $block_placement = new XoopsFormSelect(_AM_MYTABS_BLOCK_PLACEMENT . ":", "placement", $target->getVar('placement', 'e'));
     $block_placement->addOption("left", _AM_MYTABS_LEFT);
     $block_placement->addOption("center", _AM_MYTABS_CENTER);
     $block_placement->addOption("right", _AM_MYTABS_RIGHT);
     $this->addElement($block_placement);
     $this->addElement(new XoopsFormText(_AM_MYTABS_PRIORITY . ":", "priority", 4, 5, $target->getVar('priority', 'e')));
     $cachetime = new XoopsFormSelect(_AM_MYTABS_CACHETIME, 'pbcachetime', $target->getVar('pbcachetime', 'e'));
     $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
     $cachetime->addOptionArray($cache_options);
     $this->addElement($cachetime);
     $this->addElement(new XoopsFormRadioYN(_AM_MYTABS_CACHEBYURL, 'cachebyurl', $target->getVar('cachebyurl', 'e')));
     $note = new XoopsFormText(_AM_MYTABS_NOTE . ":", "note", 50, 255, $target->getVar('note', 'e'));
     $this->addElement($note);
     $this->addElement(new XoopsFormSelectGroup(_AM_MYTABS_GROUPS, 'groups', true, $target->getVar('groups'), 8, true));
     if (!$target->isNew()) {
         $this->addElement(new XoopsFormHidden("pageblockid", $target->getVar('pageblockid')));
     }
     $this->addElement(new XoopsFormHidden("blockid", $target->getVar('blockid')));
     $this->addElement(new XoopsFormHidden("pageid", $target->getVar('pageid')));
     $this->addElement(new XoopsFormHidden("op", "save"));
     $tray = new XoopsFormElementTray("");
     $tray->addElement(new XoopsFormButton("", "submit", _AM_MYTABS_OK, "submit"));
     $cancel = new XoopsFormButton("", "cancel", _AM_MYTABS_CANCEL, "button");
     $cancel->setExtra("onclick=\"self.location='index.php?pageid=" . $target->getVar('pageid') . "';\"");
     $tray->addElement($cancel);
     $this->addElement($tray);
 }
Example #16
0
function b_smartmail_custom_edit($options)
{
    $ts =& MyTextSanitizer::getInstance();
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsFormElementTray('', '<br />', 'options');
    $form->addElement(new XoopsFormDhtmlTextArea(_NL_MB_CONTENT, 'options[0]', htmlspecialchars($ts->stripSlashesGPC($options[0]), ENT_QUOTES), 15, 60));
    $type_select = new XoopsFormSelect(_NL_MB_CONTENTTYPE, 'options[1]', $options[1]);
    $type_select->addOption('H', _NL_MB_HTMLBLOCK);
    $type_select->addOption('S', _NL_MB_NOHTMLBLOCK);
    $form->addElement($type_select);
    return $form->render();
}
Example #17
0
 function getParametersForm($postUrl)
 {
     $sform = new XoopsThemeForm(_OLEDRION_PARSIAN_PARAMETERS . ' - ' . $this->gatewayInformation['name'], 'frmParsian', $postUrl);
     $sform->addElement(new XoopsFormHidden('gateway', $this->gatewayInformation['foldername']));
     $pin = new XoopsFormText(_OLEDRION_PARSIAN_MID, 'parsian_mid', 50, 255, $this->handlers->h_oledrion_gateways_options->getGatewayOptionValue($this->gatewayInformation['foldername'], 'parsian_mid'));
     $pin->setDescription(_OLEDRION_PARSIAN_MIDDSC);
     $sform->addElement($pin, true);
     $button_tray = new XoopsFormElementTray('', '');
     $submit_btn = new XoopsFormButton('', 'post', _AM_OLEDRION_GATEWAYS_UPDATE, 'submit');
     $button_tray->addElement($submit_btn);
     $sform->addElement($button_tray);
     return $sform;
 }
Example #18
0
 /**
  * @param bool $action
  * @return XoopsThemeForm
  */
 public function getForm($action = false)
 {
     global $xoopsDB, $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_PRESENTER_CAT_ADD) : sprintf(_AM_PRESENTER_CAT_EDIT);
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     // Cat_pid
     include_once XOOPS_ROOT_PATH . '/class/tree.php';
     $categoriesHandler =& xoops_getModuleHandler('categories', 'presenter');
     $criteria = new CriteriaCompo();
     $categories = $categoriesHandler->getObjects($criteria);
     if ($categories) {
         $categories_tree = new XoopsObjectTree($categories, 'cat_id', 'cat_pid');
         $cat_pid = $categories_tree->makeSelBox('cat_pid', 'cat_title', '--', $this->getVar('cat_pid', 'e'), false);
         $form->addElement(new XoopsFormLabel(_AM_PRESENTER_CAT_PID, $cat_pid));
     }
     // Cat_title
     $form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_TITLE, 'cat_title', 50, 255, $this->getVar('cat_title')), true);
     // Cat_desc
     $form->addElement(new XoopsFormTextArea(_AM_PRESENTER_CAT_DESC, 'cat_desc', $this->getVar('cat_desc'), 4, 47), true);
     // Cat_image
     $cat_image = $this->getVar('cat_image') ? $this->getVar('cat_image') : 'blank.gif';
     $uploadir = '/uploads/presenter/images/categories';
     $imgtray = new XoopsFormElementTray(_AM_PRESENTER_CAT_IMAGE, '<br />');
     $imgpath = sprintf(_AM_PRESENTER_FORMIMAGE_PATH, $uploadir);
     $imageselect = new XoopsFormSelect($imgpath, 'cat_image', $cat_image);
     $image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadir);
     foreach ($image_array as $image) {
         $imageselect->addOption("{$image}", $image);
     }
     $imageselect->setExtra("onchange='showImgSelected(\"image_cat_image\", \"cat_image\", \"" . $uploadir . "\", \"\", \"" . XOOPS_URL . "\")'");
     $imgtray->addElement($imageselect);
     $imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadir . "/" . $cat_image . "' name='image_cat_image' id='image_cat_image' alt='' />"));
     $fileseltray = new XoopsFormElementTray('', '<br />');
     $fileseltray->addElement(new XoopsFormFile(_AM_PRESENTER_FORMUPLOAD, 'cat_image', $xoopsModuleConfig['maxsize']));
     $fileseltray->addElement(new XoopsFormLabel(''));
     $imgtray->addElement($fileseltray);
     $form->addElement($imgtray);
     // Cat_weight
     $form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_WEIGHT, 'cat_weight', 50, 255, $this->getVar('cat_weight')), false);
     // Cat_color
     //      $form->addElement(new XoopsFormColorPicker(_AM_PRESENTER_CAT_COLOR, 'cat_color', $this->getVar('cat_color')), false);
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
Example #19
0
 function createElements($target)
 {
     $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'pagetitle', 35, 255, $target->getVar('pagetitle', 'e')));
     if (!$target->isNew()) {
         $this->addElement(new XoopsFormHidden("pageid", $target->getVar('pageid')));
     }
     $this->addElement(new XoopsFormHidden("op", "save"));
     $tray = new XoopsFormElementTray("");
     $tray->addElement(new XoopsFormButton("", "submit", _AM_MYTABS_OK, "submit"));
     $cancel = new XoopsFormButton("", "cancel", _AM_MYTABS_CANCEL, "button");
     $cancel->setExtra("onclick=\"self.location='index.php?pageid=" . $target->getVar('pageid') . "';\"");
     $tray->addElement($cancel);
     $this->addElement($tray);
 }
/**
 * editCategory()
 *
 * @param integer $catid
 * @return
 */
function editCategory($category_obj = null)
{
    global $xoopsModule;
    $category_handler =& xoops_getmodulehandler('category', 'newbb');
    if (empty($category_obj)) {
        $category_obj =& $category_handler->create();
    }
    $groups_cat_access = null;
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    if (!$category_obj->isNew()) {
        $sform = new XoopsThemeForm(_AM_NEWBB_EDITCATEGORY . " " . $category_obj->getVar('cat_title'), "op", xoops_getenv('PHP_SELF'));
    } else {
        $sform = new XoopsThemeForm(_AM_NEWBB_CREATENEWCATEGORY, "op", xoops_getenv('PHP_SELF'));
        $category_obj->setVar('cat_title', '');
        $category_obj->setVar('cat_image', '');
        $category_obj->setVar('cat_description', '');
        $category_obj->setVar('cat_order', 0);
        $category_obj->setVar('cat_url', 'http://www.xoops.org XOOPS');
    }
    $sform->addElement(new XoopsFormText(_AM_NEWBB_SETCATEGORYORDER, 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false);
    $sform->addElement(new XoopsFormText(_AM_NEWBB_CATEGORY, 'title', 50, 80, $category_obj->getVar('cat_title', 'E')), true);
    $sform->addElement(new XoopsFormDhtmlTextArea(_AM_NEWBB_CATEGORYDESC, 'cat_description', $category_obj->getVar('cat_description', 'E'), 10, 60), false);
    $imgdir = "/modules/" . $xoopsModule->getVar("dirname") . "/images/category";
    $cat_image = $category_obj->getVar("cat_image");
    $cat_image = empty($cat_image) ? 'blank.gif' : $cat_image;
    $graph_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $imgdir . "/");
    array_unshift($graph_array, _NONE);
    $cat_image_select = new XoopsFormSelect('', 'cat_image', $category_obj->getVar('cat_image'));
    $cat_image_select->addOptionArray($graph_array);
    $cat_image_select->setExtra("onchange=\"showImgSelected('img', 'cat_image', '/" . $imgdir . "/', '', '" . XOOPS_URL . "')\"");
    $cat_image_tray = new XoopsFormElementTray(_AM_NEWBB_IMAGE, '&nbsp;');
    $cat_image_tray->addElement($cat_image_select);
    $cat_image_tray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . $imgdir . "/" . $cat_image . " 'name='img' id='img' alt='' />"));
    $sform->addElement($cat_image_tray);
    $sform->addElement(new XoopsFormText(_AM_NEWBB_SPONSORLINK, 'cat_url', 50, 80, $category_obj->getVar('cat_url', 'E')), false);
    $sform->addElement(new XoopsFormHidden('cat_id', $category_obj->getVar("cat_id")));
    $button_tray = new XoopsFormElementTray('', '');
    $button_tray->addElement(new XoopsFormHidden('op', 'save'));
    $butt_save = new XoopsFormButton('', '', _SUBMIT, 'submit');
    $butt_save->setExtra('onclick="this.form.elements.op.value=\'save\'"');
    $button_tray->addElement($butt_save);
    if ($category_obj->getVar("cat_id")) {
        $butt_delete = new XoopsFormButton('', '', _CANCEL, 'submit');
        $butt_delete->setExtra('onclick="this.form.elements.op.value=\'default\'"');
        $button_tray->addElement($butt_delete);
    }
    $sform->addElement($button_tray);
    $sform->display();
}
Example #21
0
 function getForm($action = false)
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('ranks/', '', $this->getVar('rank_image', 'e'));
     }
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_SYSTEM_USERRANK_ADD) : sprintf(_AM_SYSTEM_USERRANK_EDIT);
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_SYSTEM_USERRANK_TITLE, 'rank_title', 50, 50, $this->getVar('rank_title'), true));
     $form->addElement(new XoopsFormText(_AM_SYSTEM_USERRANK_MINPOST, 'rank_min', 10, 10, $this->getVar('rank_min')));
     $form->addElement(new XoopsFormText(_AM_SYSTEM_USERRANK_MAXPOST, 'rank_max', 10, 10, $this->getVar('rank_max')));
     $imgtray_img = new XoopsFormElementTray(_AM_SYSTEM_USERRANK_IMAGE, '<br />');
     $imgpath_img = sprintf(_AM_SYSTEM_USERRANK_IMAGE_PATH, XOOPS_UPLOAD_PATH . '/ranks/');
     $imageselect_img = new XoopsFormSelect($imgpath_img, 'rank_image', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_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\", \"\", \"" . XOOPS_UPLOAD_URL . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_UPLOAD_URL . "/ranks/" . $blank_img . "' name='image_img' id='xo-ranks-img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_USERRANK_UPLOAD, 'rank_image', 500000), false);
     $fileseltray_img->addElement(new XoopsFormLabel(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     if (!$this->isNew()) {
         $rank_special = $this->getVar('rank_special');
     } else {
         $rank_special = 0;
     }
     $special_tray = new XoopsFormElementTray(_AM_SYSTEM_USERRANK_SPECIAL, '<br />');
     $special_tray->setDescription(_AM_SYSTEM_USERRANK_SPECIAL_CAN);
     $special_tray->addElement(new XoopsFormRadioYN('', 'rank_special', $rank_special));
     $form->addElement($special_tray);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('rank_id', $this->getVar('rank_id')));
     }
     $form->addElement(new XoopsFormHidden('op', 'userrank_save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
Example #22
0
function b_ams_spotlight_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    include_once XOOPS_ROOT_PATH . "/modules/AMS/include/functions.inc.php";
    global $xoopsModule;
    AMS_updateCache();
    if (!isset($xoopsModule) || $xoopsModule->getVar('dirname') != "AMS") {
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname("AMS");
    } else {
        $module =& $xoopsModule;
    }
    $config_handler =& xoops_gethandler('config');
    $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
    $templates_list = array_flip($moduleConfig['spotlight_template']);
    //fix template list value lost after module update
    foreach ($templates_list as $k => $v) {
        $templates_list[$k] = substr($k, 20, strlen($k) - 25);
    }
    $form = new XoopsFormElementTray('', '<br/><br />');
    $numarticles_select = new XoopsFormText(_AMS_MB_SPOT_NUMARTICLES, 'options[0]', 10, 10, $options[0]);
    $form->addElement($numarticles_select);
    $form->addElement(new XoopsFormRadioYN(_AMS_MB_SPOT_SHOWMINISTATS, 'options[1]', $options[1]));
    //spotlight template selection
    $template_select = new XoopsFormSelect(_AMS_MB_SPOTLIGHT_TEMPLATE, 'options[2]', $options[2]);
    $template_select->addOptionArray($templates_list);
    $template_select->setExtra("onchange='showImgSelected(\"template_preview\", \"options[2]\", \"" . '/modules/AMS/images/spotlight_preview' . "\", \".jpg\", \"" . XOOPS_URL . "\")'");
    $template_select->setDescription(_AMS_MB_SPOTLIGHT_TEMPLATE_DESC);
    $form->addElement($template_select);
    //spotlight preview image
    $imgpath = sprintf('', "modules/AMS/images/spotlight_preview/");
    $form->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/modules/AMS/images/spotlight_preview/" . $options[2] . ".jpg' name='template_preview' id='template_preview' alt='' />"));
    return $form->render();
}
Example #23
0
 function getForm($action = false)
 {
     global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULES_ADD) : sprintf(_AM_TDMCREATE_MODULES_EDIT);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $form = new XoopsThemeForm($title, 'form_modules', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->insertBreak('<div align="center"><b>' . _AM_TDMCREATE_MODULES_IMPORTANT . '</b></div>', 'head');
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'modules_name', 50, 255, $this->getVar('modules_name')), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'modules_version', 50, 255, $this->getVar('modules_version')), true);
     $form->addElement(new XoopsFormTextArea(_AM_TDMCREATE_MODULES_DESCRIPTION, 'modules_description', $this->getVar('modules_description'), 3, 47), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR, 'modules_author', 50, 255, $this->getVar('modules_author')), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_LICENSE, 'modules_license', 50, 255, $this->getVar('modules_license')), true);
     $modules_display_menu = $this->isNew() ? '1' : $this->getVar('modules_display_menu');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_MENU, 'modules_display_menu', $modules_display_menu, _YES, _NO));
     $modules_display_admin = $this->isNew() ? '1' : $this->getVar('modules_display_admin');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_ADMIN, 'modules_display_admin', $modules_display_admin, _YES, _NO));
     $modules_active_search = $this->isNew() ? '1' : $this->getVar('modules_active_search');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_SEARCH, 'modules_active_search', $modules_active_search, _YES, _NO));
     $modules_image = $this->getVar('modules_image') ? $this->getVar('modules_image') : 'blank.gif';
     $uploadirectory = "/modules/" . $xoopsModule->dirname() . "/images/uploads/modules";
     $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULES_IMAGE, '<br />');
     $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./modules/" . $xoopsModule->dirname() . "/images/uploads/modules");
     $imageselect = new XoopsFormSelect($imgpath, 'modules_image', $modules_image);
     $modules_image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadirectory);
     foreach ($modules_image_array as $image) {
         $imageselect->addOption("{$image}", $image);
     }
     $imageselect->setExtra("onchange='showImgSelected(\"image3\", \"modules_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'");
     $imgtray->addElement($imageselect, false);
     $imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $modules_image . "' name='image3' id='image3' alt='' />"));
     $fileseltray = new XoopsFormElementTray('', '<br />');
     $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', 104857600), false);
     $fileseltray->addElement(new XoopsFormLabel(''), false);
     $imgtray->addElement($fileseltray);
     $form->addElement($imgtray);
     $form->insertBreak('<div align="center"><b>' . _AM_TDMCREATE_MODULES_NOTIMPORTANT . '</b></div>', 'head');
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_URL, 'modules_author_website_url', 50, 255, $this->getVar('modules_author_website_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_NAME, 'modules_author_website_name', 50, 255, $this->getVar('modules_author_website_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_CREDITS, 'modules_credits', 50, 255, $this->getVar('modules_credits')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_INFO, 'modules_release_info', 50, 255, $this->getVar('modules_release_info')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_FILE, 'modules_release_file', 50, 255, $this->getVar('modules_release_file')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL, 'modules_manual', 50, 255, $this->getVar('modules_manual')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL_FILE, 'modules_manual_file', 50, 255, $this->getVar('modules_manual_file')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_URL, 'modules_demo_site_url', 50, 255, $this->getVar('modules_demo_site_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_NAME, 'modules_demo_site_name', 50, 255, $this->getVar('modules_demo_site_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MODULE_WEBSITE_URL, 'modules_module_website_url', 50, 255, $this->getVar('modules_module_website_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MODULE_WEBSITE_NAME, 'modules_module_website_name', 50, 255, $this->getVar('modules_module_website_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE, 'modules_release', 50, 255, $this->getVar('modules_release')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_STATUS, 'modules_module_status', 50, 255, $this->getVar('modules_module_status')), false);
     $form->addElement(new XoopsFormHidden('op', 'modules_save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     $form->display();
     return $form;
 }
 function adminUI($form, $value, $ele_id)
 {
     $myts =& MyTextSanitizer::getInstance();
     $options = array();
     $opt_count = 0;
     $addopt = $_POST['addopt'];
     if (!empty($ele_id)) {
         $keys = array_keys($value);
         for ($i = 0; $i < count($keys); $i++) {
             $r = $value[$keys[$i]] ? $opt_count : null;
             $v = $myts->makeTboxData4PreviewInForm($keys[$i]);
             $options[] = new xoopsFormText('', 'ele_value[' . $opt_count . ']', 40, 255, $v);
             // function in the admin/elements.php file
             $opt_count++;
         }
     }
     // added check below to add in blank rows that are unaccounted for above.
     // above code adds in all the options the user has typed in.  If there are blank rows on the form, this code will add in the appropriate amount, based on the 'rowcount' hidden element.
     // This code added by jwe 01/05/05
     if ($opt_count < $_POST['rowcount']) {
         for ($i = $opt_count; $i < $_POST['rowcount']; $i++) {
             $options[] = new xoopsFormText('', 'ele_value[' . $i . ']', 40, 255, '');
         }
         $opt_count = $_POST['rowcount'];
         // make the opt_count equal to the number of rows, since we've now brought the number back up to where it should be.
     }
     if (empty($addopt) and empty($ele_id)) {
         $addopt = 2;
     }
     for ($i = 0; $i < $addopt; $i++) {
         $options[] = new xoopsFormText('', 'ele_value[' . $opt_count . ']', 40, 255, '');
         $opt_count++;
     }
     // these two lines part of the jwe added code
     $rowcount = new XoopsFormHidden("rowcount", $opt_count);
     $form->addElement($rowcount);
     $opt_tray = new XoopsFormElementTray(_AM_ELE_OPT, '<br />');
     $opt_tray->setDescription(_AM_ELE_OPT_DESC_RANKORDERLISTS . '<br /><br />' . _AM_ELE_OPT_UITEXT);
     for ($i = 0; $i < count($options); $i++) {
         $opt_tray->addElement($options[$i]);
     }
     $opt_tray->addElement(addOptionsTray());
     $form->addElement($opt_tray);
     return $form;
 }
Example #25
0
 function getForm($action = false)
 {
     global $xoopsModuleConfig;
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $linkusers_handler =& xoops_getmodulehandler('linkusers', 'support');
     $member_handler =& xoops_gethandler('member');
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? _MA_SUPPORT_ADDCAT : _MA_SUPPORT_UPDATECAT;
     $format = empty($format) ? "e" : $format;
     $status = $this->isNew() ? 1 : $this->getVar('cat_status');
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra("enctype=\"multipart/form-data\"");
     //名稱
     $form->addElement(new XoopsFormText(_MA_SUPPORT_CATNAME, 'cat_name', 60, 255, $this->getVar('cat_name', $format)), true);
     //題頭圖片
     $cat_image = new XoopsFormElementTray(_MA_SUPPORT_CATLOGO, '', 'image');
     if ($this->getVar('cat_image')) {
         $cat_image->addElement(new XoopsFormLabel('', '<img width="100" src="' . XOOPS_URL . '/uploads/support/' . $this->getVar('cat_image') . '"><br><br>'));
         $delete_check = new XoopsFormCheckBox('', 'delete_image');
         $delete_check->addOption(1, _DELETE);
         $cat_image->addElement($delete_check);
         $display = _MA_SUPPORT_REUPLOADLOGOTIP;
     } else {
         $display = '';
     }
     $cat_image->addElement(new XoopsFormFile('', 'cat_image', 1024 * 1024 * 2));
     $cat_image->addElement(new XoopsFormLabel('', _MA_SUPPORT_UPLOADSTYLE));
     $cat_image->addElement(new XoopsFormLabel('', $display));
     $form->addElement($cat_image);
     //服務介紹
     $configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '500px', 'value' => $this->getVar('cat_desc'));
     $form->addElement(new XoopsFormEditor(_MA_SUPPORT_CATDESC, 'cat_desc', $configs));
     //狀態
     $form->addElement(new XoopsFormRadioYN(_MA_SUPPORT_VISIBLE, 'cat_status', $status));
     //管理員
     $uids = $member_handler->getUsersByGroup($xoopsModuleConfig['support']);
     $criteria = new CriteriaCompo(new Criteria("uid", "(" . implode(", ", $uids) . ")", "in"));
     $members = $member_handler->getUserList($criteria);
     $support_ids = array();
     if (!$this->isNew()) {
         $criteria = new CriteriaCompo();
         $criteria->add(new Criteria('cat_id', $this->getVar('cat_id')));
         $linkusers = $linkusers_handler->getAll($criteria, array('uid'), false);
         if (!empty($linkusers)) {
             foreach ($linkusers as $k => $v) {
                 $support_ids[] = $v['uid'];
             }
         }
     }
     $support = new XoopsFormSelect(_MA_SUPPORT_MANGER, 'support_ids', $support_ids, 5, true);
     $support->addOptionArray($members);
     $form->addElement($support, true);
     $form->addElement(new XoopsFormHidden('cat_id', $this->getVar('cat_id')));
     $form->addElement(new XoopsFormHidden('ac', 'insert'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
 function render()
 {
     // load all child ids for javascript codes
     foreach (array_keys($this->_itemTree) as $item_id) {
         $this->_itemTree[$item_id]['allchild'] = array();
         $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
     }
     $gperm_handler =& xoops_gethandler('groupperm');
     $member_handler =& xoops_gethandler('member');
     $glist =& $member_handler->getGroupList();
     foreach (array_keys($glist) as $i) {
         // get selected item id(s) for each group
         $selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid);
         $ele = new newbb_XoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
         $ele->setOptionTree($this->_itemTree);
         $this->addElement($ele);
         unset($ele);
     }
     $tray = new XoopsFormElementTray('');
     $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
     $this->addElement($tray);
     $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />';
     $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n";
     $elements = $this->getElements();
     $hidden = '';
     foreach (array_keys($elements) as $i) {
         if (!is_object($elements[$i])) {
             $ret .= $elements[$i];
         } elseif (!$elements[$i]->isHidden()) {
             $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
             if ($elements[$i]->getDescription() != '') {
                 $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
             }
             $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
         } else {
             $hidden .= $elements[$i]->render();
         }
     }
     $ret .= "</table>{$hidden}</form>";
     $ret .= $this->renderValidationJS(true);
     return $ret;
 }
Example #27
0
 /**
  * @param bool $action
  *
  * @return XoopsThemeForm
  */
 function getForm($action = false)
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('smilies/', '', $this->getVar('smile_url', 'e'));
     }
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_SYSTEM_SMILIES_ADD) : sprintf(_AM_SYSTEM_SMILIES_EDIT);
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_SYSTEM_SMILIES_CODE, 'code', 26, 25, $this->getVar('code')), true);
     $form->addElement(new XoopsFormText(_AM_SYSTEM_SMILIES_DESCRIPTION, 'emotion', 50, 50, $this->getVar('emotion')), true);
     $imgtray_img = new XoopsFormElementTray(_AM_SYSTEM_SMILIES_FILE, '<br />');
     $imgpath_img = sprintf(_AM_SYSTEM_SMILIES_IMAGE_PATH, XOOPS_UPLOAD_PATH . '/smilies/');
     $imageselect_img = new XoopsFormSelect($imgpath_img, 'smile_url', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH . '/smilies');
     $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-smilies-img\', \'smile_url\', \'smilies\', \'\', \'' . XOOPS_UPLOAD_URL . '\' )"');
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_UPLOAD_URL . "/smilies/" . $blank_img . "' name='image_img' id='xo-smilies-img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_SMILIES_UPLOADS, 'smile_url', 500000), false);
     $fileseltray_img->addElement(new XoopsFormLabel(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('smilies_id', $this->getVar('id')));
         $display = $this->getVar('display');
     } else {
         $display = 0;
     }
     $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_SMILIES_OFF, 'display', $display));
     $form->addElement(new XoopsFormHidden('op', 'save_smilie'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
Example #28
0
 /**
  * @return XoopsThemeForm
  */
 public function getForm()
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = $this->getVar('avatar_file', 'e');
     }
     // Get User Config
     $config_handler = xoops_getHandler('config');
     $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
     $form = new XoopsThemeForm(_AM_SYSTEM_AVATAR_ADD, 'avatar_form', 'admin.php', 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_IMAGENAME, 'avatar_name', 50, 255, $this->getVar('avatar_name', 'e')), true);
     $maxpixel = '<div class="small basic italic">' . _US_MAXPIXEL . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_width'] . ' x ' . $xoopsConfigUser['avatar_height'] . '</div>';
     $maxsize = '<div class="small basic italic">' . _US_MAXIMGSZ . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_maxsize'] . '</div>';
     $uploadirectory_img = '';
     $imgtray_img = new XoopsFormElementTray(_IMAGEFILE . '<br><br>' . $maxpixel . $maxsize, '<br>');
     $imageselect_img = new XoopsFormSelect(sprintf(_AM_SYSTEM_AVATAR_USE_FILE, XOOPS_UPLOAD_PATH), 'avatar_file', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH);
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         //            if (preg_match('#avt#', $image_img)) {
         if (false !== strpos(image_img, 'avt')) {
             $imageselect_img->addOption("{$image_img}", $image_img);
         }
     }
     $imageselect_img->setExtra("onchange='showImgSelected(\"image_img\", \"avatar_file\", \"" . $uploadirectory_img . "\", \"\", \"" . XOOPS_UPLOAD_URL . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br><img src='" . XOOPS_UPLOAD_URL . '/' . $blank_img . "' name='image_img' id='image_img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br>', '<br><br>');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_AVATAR_UPLOAD, 'avatar_file', 500000), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     $form->addElement(new XoopsFormText(_IMGWEIGHT, 'avatar_weight', 3, 4, $this->getVar('avatar_weight', 'e')));
     $form->addElement(new XoopsFormRadioYN(_IMGDISPLAY, 'avatar_display', $this->getVar('avatar_display', 'e'), _YES, _NO));
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormHidden('fct', 'avatars'));
     $form->addElement(new XoopsFormHidden('avatar_id', $this->getVar('avatar_id', 'e')));
     $form->addElement(new XoopsFormButton('', 'avt_button', _SUBMIT, 'submit'));
     return $form;
 }
Example #29
0
 function getForm($action = false)
 {
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $category_handler =& xoops_getmodulehandler('category', 'resources');
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $format = empty($format) ? "e" : $format;
     $status = $this->isNew() ? 1 : $this->getVar('res_status');
     $form = new XoopsThemeForm('资源管理', 'form', $action, 'post', true);
     $form->setExtra("enctype=\"multipart/form-data\"");
     // category
     $criteria = new CriteriaCompo();
     $criteria->setSort('cat_weight');
     $criteria->setOrder('ASC');
     $categories = $category_handler->getList($criteria);
     $cat_select = new XoopsFormSelect('资源类别', 'cat_id', $this->getVar('cat_id'));
     $cat_select->addOptionArray($categories);
     $form->addElement($cat_select);
     // subject
     $form->addElement(new XoopsFormText('资源名称', 'res_subject', 60, 255, $this->getVar('res_subject', $format)), true);
     // content
     $configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '500px', 'value' => $this->getVar('res_content', $format));
     $form->addElement(new XoopsFormEditor('资源描述', 'res_content', $configs));
     // resources
     $annex = new XoopsFormElementTray('资源附件', '', 'annex');
     $annex_file = new XoopsFormFile('', 'annex', '');
     $annex_multiLabel = new XoopsFormLabel('', '<div><a id="addMore" href="javascript:void(0);">再添加一个附件</a></div>');
     $annex->addElement($annex_file);
     $annex->addElement($annex_multiLabel);
     $form->addElement($annex);
     //状态
     $form->addElement(new XoopsFormRadioYN('是否显示', 'res_status', $status));
     // gratetime
     if ($this->isNew()) {
         $form->addElement(new XoopsFormHidden('grate_time', time()));
     }
     $form->addElement(new XoopsFormHidden('res_id', $this->getVar('res_id')));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
Example #30
0
 /**
  * Constructor
  *
  * @param    string    $caption
  * @param    string    $name
  * @param    mixed    $value            Pre-selected value
  */
 function XoopsFormSelectWriter($caption, $name, $value = array())
 {
     $this->XoopsFormElementTray($caption, " | ", $name);
     $select_form = new XoopsFormSelect("", $name, $value, $size = 1, $multiple = false);
     if (!empty($value)) {
         if (!is_array($value)) {
             $value = array($value);
         }
         $criteria = new CriteriaCompo(new Criteria("writer_id", "(" . implode(", ", $value) . ")", "IN"));
         $criteria->setSort('writer_name');
         $criteria->setOrder('ASC');
         $writer_handler =& xoops_getmodulehandler("writer", $GLOBALS["artdirname"]);
         $select_form->addOptionArray($writer_handler->getList($criteria));
     }
     $action_tray = new XoopsFormElementTray("", " | ");
     //$action_tray->addElement(new XoopsFormLabel('', "<a href='".XOOPS_URL."/modules/".$GLOBALS["artdirname"]."/edit.writer.php?search=1&amp;target=".$name."' target='writereditor'>"._SEARCH."</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/" . $GLOBALS["artdirname"] . "/edit.writer.php?search=1\", \"writereditor\", 800, 500, null);' >" . _SEARCH . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='var sel = xoopsGetElementById(\"" . $name . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (sel.options[i].selected) {sel.options[i] = null;}}'>" . art_constant("MD_REMOVE") . "</a>" . "<script type=\"text/javascript\">\r\n            function addusers(opts) {\r\n                var num = opts.substring(0, opts.indexOf(\":\"));\r\n                opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                var sel = xoopsGetElementById(\"" . $name . "\");\r\n                var arr = new Array(num);\r\n                for (var n = 0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if (sel.options[k].value == val) {\r\n                            added = true;\r\n                            sel.options[k].selected = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>"));
     $this->addElement($select_form);
     $this->addElement($action_tray);
 }