当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsFormSelect::addOptionArray方法代码示例

本文整理汇总了PHP中XoopsFormSelect::addOptionArray方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormSelect::addOptionArray方法的具体用法?PHP XoopsFormSelect::addOptionArray怎么用?PHP XoopsFormSelect::addOptionArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsFormSelect的用法示例。


在下文中一共展示了XoopsFormSelect::addOptionArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: brandForm

 function brandForm($action = false)
 {
     global $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $country_handler = xoops_getmodulehandler('country', 'catalog');
     $title = $this->isNew() ? _AM_CATALOG_ADDBRAND : _AM_CATALOG_UPDATEBRAND;
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_CATALOG_BRANDNAME, 'brand_name', 60, 255, $this->getVar('brand_name')), true);
     $countys =& $country_handler->getList();
     $county_select = new XoopsFormSelect(_AM_CATALOG_CHOICECOUNTRY, "country_id", $this->getVar("country_id"));
     $county_select->addOption('', _AM_CATALOG_CHOICE);
     $county_select->addOptionArray($countys);
     $form->addElement($county_select);
     $configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '150px', 'value' => $this->getVar('brand_description'));
     $form->addElement(new XoopsFormEditor(_AM_CATALOG_BRANDDESC, 'brand_description', $configs, $nohtml = false, $OnFailure = ""));
     if ($this->isNew()) {
         $form->addElement(new XoopsFormHidden('brand_published', time()));
     }
     $form->addElement(new XoopsFormHidden('brand_id', $this->getVar('brand_id')));
     $form->addElement(new XoopsFormHidden('ac', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:27,代码来源:brand.php

示例2: XoopsFormSelectUser

 /**
  * 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, $value = array(), $include_anon = false, $size = 1, $multiple = false)
 {
     $this->XoopsFormElementTray($caption, "<br /><br />", $name);
     $select_form = new XoopsFormSelect("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_form->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $criteria = new CriteriaCompo();
     if (!is_array($value)) {
         $value = array($value);
     }
     if (is_array($value) && count($value) > 0) {
         $id_in = "(" . implode(",", $value) . ")";
         $criteria->add(new Criteria("uid", $id_in, "IN"));
         $criteria->setSort('name');
         $criteria->setOrder('ASC');
         $users = $member_handler->getUserList($criteria);
         $select_form->addOptionArray($member_handler->getUserList($criteria));
     }
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/system/include/userselect.php?action=1&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _LIST . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/system/include/userselect.php?action=0&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 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;}}'>" . _REMOVE . "</a>" . "<script type=\"text/javascript\">\n\t\t    function addusers(opts){\n\t\t\t    var num = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n        \t\tvar sel = xoopsGetElementById(\"" . $name . "\");\n\t\t\t    var arr = new Array(num);\n\t\t\t    for(var n=0; n<num; n++){\n\t\t\t    \tvar nm = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    \topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n\t\t\t    \tvar val = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    \topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n\t\t\t    \tvar txt = opts.substring(0, nm - val.length);\n\t\t\t    \topts = opts.substring(nm - val.length, opts.length);\n\t\t\t\t\tvar added = false;\n\t\t\t\t\tfor (var k = 0; k < sel.options.length; k++) {\n\t\t\t\t\t\tif(sel.options[k].value == val){\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added==false){\n\t\t\t\t\t\tappendSelectOption(\"" . $name . "\",txt, val);\n\t        \t\t}\n\t\t\t    }\n\t\t\t\treturn true;\n\t\t    }\n\t\t\t</script>"));
     $this->addElement($select_form);
     $this->addElement($action_tray);
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:38,代码来源:formselectuser.php

示例3: salat_block_show

function salat_block_show($options)
{
    $block = array();
    $infos = salat_getInfos();
    $sform = new XoopsThemeForm(_MA_SALAT_GETPRAYERS, "form", XOOPS_URL . '/modules/salat/index.php');
    foreach ($infos as $info) {
        $options[$info['city']] = $info['city'] . ' - ' . $info['country'];
        if (isset($info['default'])) {
            $default = $info['city'];
        }
    }
    $city = isset($default) ? $default : '';
    $date = time();
    $timezone = 0;
    // City
    $element = new XoopsFormSelect(_MA_SALAT_SELECT_CITY, 'city', $city);
    $element->addOptionArray($options);
    $element->setExtra('width="100" style="width:100px;"');
    $sform->addElement($element);
    unset($element);
    $element = new XoopsFormTextDateSelect(_MA_SALAT_SELECT_DATE, 'date', 12, $date);
    //$element->setExtra('width="100" style="width:100px;"');
    $sform->addElement($element);
    unset($element);
    // Timezone
    $element = new XoopsFormSelectTimezone(_MA_SALAT_SELECT_TIMEZONE, 'timezone', $timezone);
    $element->setExtra('width="100" style="width:100px;"');
    $sform->addElement($element);
    unset($element);
    $sform->addElement(new XoopsFormButton('', 'get_prayers', _SUBMIT, 'submit'));
    $block['content'] = $sform->render();
    return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:33,代码来源:salat_block.php

示例4: getForm

 /**
  * @param bool $action
  *
  * @return XoopsThemeForm
  */
 function getForm($action = false)
 {
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_SYSTEM_BANNERS_ADDNWBNR) : sprintf(_AM_SYSTEM_BANNERS_EDITBNR);
     xoops_load('XoopsFormLoader');
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $banner_client_Handler =& xoops_getModuleHandler('bannerclient', 'system');
     $client_select = new XoopsFormSelect(_AM_SYSTEM_BANNERS_CLINAMET, 'cid', $this->getVar('cid'));
     $client_select->addOptionArray($banner_client_Handler->getList());
     $form->addElement($client_select, true);
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_IMPPURCHT, 'imptotal', 20, 255, $this->getVar('imptotal')), true);
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_IMGURLT, 'imageurl', 80, 255, $this->getVar('imageurl')), false);
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BANNERS_CLICKURLT, 'clickurl', 80, 255, $this->getVar('clickurl')), false);
     $htmlbanner = $this->isNew() ? 0 : $this->getVar('htmlbanner');
     $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BANNERS_USEHTML, 'htmlbanner', $htmlbanner, _YES, _NO));
     $form->addElement(new xoopsFormTextArea(_AM_SYSTEM_BANNERS_CODEHTML, 'htmlcode', $this->getVar('htmlcode'), 5, 50), false);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('bid', $this->getVar('bid')));
     }
     $form->addElement(new XoopsFormHidden('op', 'banner_save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     //$form->display();
     return $form;
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:31,代码来源:banner.php

示例5: XoopsFormSelectUser

 /**
  * 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);
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:46,代码来源:formselectuser.php

示例6: getParametersForm

 /**
  * 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;
 }
开发者ID:osw17,项目名称:oledrion,代码行数:30,代码来源:gateway.php

示例7: getForm

 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;
 }
开发者ID:yunsite,项目名称:xoopsdc,代码行数:59,代码来源:category.php

示例8: listAction

 function listAction()
 {
     global $xoopsConfig;
     echo '<h3>' . _AD_OPENID_LANG_BUTTONS . '</h3>';
     echo '<p>' . _AD_OPENID_LANG_BUTTONS_DESC . '</p>';
     echo '<p>[<a href="' . $this->_url . '&op=new">' . _AD_OPENID_LANG_NEW . '</a>]</p>';
     if ($records =& $this->_handler->getObjects()) {
         echo '<table border=1><tr>';
         echo '<th></th>';
         echo '<th>Title</th>';
         echo '<th>OpenID Identifier</th>';
         echo '<th>Type</th>';
         echo '<th colspan="2"></th></tr>';
         foreach ($records as $r) {
             $type = $r->get('type');
             $image = $r->get4show('image');
             $description = $r->get4Show('description');
             echo '<tr><td>';
             echo '<img src="';
             echo strpos($image, 'http') !== 0 ? XOOPS_URL . '/modules/openid/images/' : '';
             echo $image . '" alt="' . $description . '">';
             echo '</td><td>';
             echo $description;
             echo '</td><td>';
             echo $r->get4Show('identifier');
             echo '</td><td>';
             echo $type ? 'signon' : 'server';
             echo '</td><td>';
             echo '<a href="' . $this->_url . '&op=edit&id=' . $r->get4Show('id') . '">' . _EDIT . '</a>';
             echo '</td><td>';
             echo '<a href="' . $this->_url . '&op=delete&id=' . $r->get4Show('id') . '">' . _DELETE . '</a>';
             echo '</td></tr>';
         }
         echo '</table>';
     } else {
         echo '<p>' . $this->_handler->getError() . '</p>';
     }
     echo '<br />';
     $filterItems = array();
     @(include XOOPS_ROOT_PATH . '/modules/openid/language/' . $xoopsConfig['language'] . '/filterItems.php');
     $options = array();
     foreach ($filterItems as $item) {
         if (isset($item['op_identifier']) || isset($item['user_identifier'])) {
             $options[] = $item['description'];
         }
     }
     require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $form = new XoopsSimpleForm('', 'openid_generator', $this->_url, 'post', true);
     $form->addElement(new XoopsFormHidden('controller', $this->_control));
     $form->addElement(new XoopsFormHidden('op', 'generate'));
     $element = new XoopsFormSelect(_ADD, 'offset');
     $element->addOptionArray($options);
     $form->addElement($element);
     $form->addElement(new XoopsFormButton('', 'submit', 'OK', 'submit'));
     echo $form->render();
 }
开发者ID:nouphet,项目名称:rata,代码行数:56,代码来源:buttons.php

示例9: getForm

 /**
  * 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;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:61,代码来源:spotlight.php

示例10: display_action_form

function display_action_form($action = "")
{
    $action_options = array("no" => _SELECT, "template" => art_constant("AM_PERMISSION_TEMPLATE"), "apply" => art_constant("AM_PERMISSION_TEMPLATE_APPLY"), "default" => art_constant("AM_PERMISSION_SETBYGROUP"));
    $actionform = new XoopsSimpleForm(art_constant("AM_PERMISSION_ACTION"), 'actionform', 'admin.permission.php', "GET");
    $action_select = new XoopsFormSelect("", 'action', $action);
    $action_select->setExtra('onchange="document.forms.actionform.submit()"');
    $action_select->addOptionArray($action_options);
    $actionform->addElement($action_select);
    $actionform->display();
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:10,代码来源:admin.permission.php

示例11: createElements

 /**
  * created elements
  * @license http://www.blags.org/
  * @created:2010年05月21日 20时40分
  * @copyright 1997-2010 The Martin Group
  * @author Martin <china.codehome@gmail.com> 
  * */
 function createElements()
 {
     global $xoopsDB;
     $TypeElement = new XoopsFormSelect('服务类别', 'service_type_id', $this->Obj->service_type_id(), 1);
     $TypeElement->addOptionArray($this->TypeList);
     $this->addElement($TypeElement, true);
     $this->addElement(new XoopsFormText('服务单位<br>example:(小时,张,位)', 'service_unit', 45, 45, $this->Obj->service_unit()), true);
     $this->addElement(new XoopsFormText('服务名称', 'service_name', 50, 255, $this->Obj->service_name()), true);
     $this->addElement(new XoopsFormTextArea('服务描述', 'service_instruction', $this->Obj->service_instruction()), true);
     $this->addElement(new XoopsFormHidden('id', $this->Obj->service_id()));
 }
开发者ID:ponvino,项目名称:xoops-martin,代码行数:18,代码来源:form.hotel.service.php

示例12: createElements

 /**
  * created elements
  * @license   http://www.blags.org/
  * @created   :2010年05月21日 20时40分
  * @copyright 1997-2010 The Martin Group
  * @author    Martin <china.codehome@gmail.com>
  * */
 public function createElements()
 {
     global $xoopsDB;
     $TypeElement = new XoopsFormSelect(_AM_MARTIN_SERVICE_TYPE, 'service_type_id', $this->Obj->service_type_id(), 1);
     $TypeElement->addOptionArray($this->TypeList);
     $this->addElement($TypeElement, true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_SERVICE_UNITS . '<br>' . _AM_MARTIN_SERVICE_UNITS_DESC, 'service_unit', 45, 45, $this->Obj->service_unit()), true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_SERVICE_NAME, 'service_name', 50, 255, $this->Obj->service_name()), true);
     $this->addElement(new XoopsFormTextArea(_AM_MARTIN_SERVICE_DESCRIPTION, 'service_instruction', $this->Obj->service_instruction()), true);
     $this->addElement(new XoopsFormHidden('id', $this->Obj->service_id()));
 }
开发者ID:mambax7,项目名称:xoops-martin,代码行数:18,代码来源:form.hotel.service.php

示例13: linksForm

 function linksForm($action = false)
 {
     global $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $title = $this->isNew() ? _AM_LINKS_ADDLIK : _AM_LINKS_UPDATELIK;
     $link_status = $this->isNew() ? 1 : $this->getVar('link_status');
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $cat_id = isset($_REQUEST['cid']) ? $_REQUEST['cid'] : '';
     if (empty($cat_id)) {
         $cat_id = $this->getVar("cat_id");
     }
     $categories = new XoopsFormSelect(_AM_LINKS_CATNAME, 'cat_id', $cat_id);
     $cat_handler = xoops_getmodulehandler('category', 'links');
     $criteria = new CriteriaCompo();
     $criteria->setSort('cat_order');
     $criteria->setOrder('ASC');
     $categories->addOptionArray($cat_handler->getList($criteria));
     $form->addElement($categories, true);
     $form->addElement(new XoopsFormText(_AM_LINKS_TITLE, 'link_title', 40, 50, $this->getVar('link_title')), true);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormText(_AM_LINKS_LIKADD, 'link_url', 80, 5000, $this->getVar('link_url'), true));
         $form->addElement(new XoopsFormHidden('datetime', time()));
     } else {
         $form->addElement(new XoopsFormText(_AM_LINKS_LIKADD, 'link_url', 80, 5000, 'http://'), true);
         $form->addElement(new XoopsFormHidden('published', time()));
         $form->addElement(new XoopsFormHidden('datetime', time()));
     }
     $logo_image = new XoopsFormElementTray(_AM_LINKS_LIKLOGO);
     if (!empty($xoopsModuleConfig['logo'])) {
         if ($this->getVar('link_title')) {
             $logo_image->addElement(new XoopsFormLabel('', '<img src="' . XOOPS_URL . $xoopsModuleConfig['logo_dir'] . $this->getVar('link_image') . '"><br><br>'));
             $display = _AM_LINKS_LOGOWARN;
         } else {
             $display = '';
         }
         $logo_image->addElement(new XoopsFormFile('', 'link_image', 1024 * 1024 * 2));
     } else {
         $logo_image->addElement(new XoopsFormText('', 'link_dir', 70, 255, $this->getVar('link_dir')));
         $display = _AM_LINKS_LOGOTIPS . XOOPS_URL . '/uploads/logo/logo.jpg';
     }
     $logo_image->addElement(new XoopsFormLabel('', $display));
     $form->addElement($logo_image);
     $form->addElement(new XoopsFormText(_AM_LINKS_SORT, 'link_order', 4, 2, $this->getVar('link_order')));
     $form->addElement(new XoopsFormText(_AM_LINKS_CONTACT, 'link_contact', 60, 255, $this->getVar('link_contact')));
     $form->addElement(new XoopsFormRadioYN(_AM_LINKS_SHOW, 'link_status', $link_status));
     $form->addElement(new XoopsFormHidden('link_id', $this->getVar('link_id')));
     $form->addElement(new XoopsFormHidden('ac', 'insert'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
开发者ID:yunsite,项目名称:xoopsdc,代码行数:54,代码来源:links.php

示例14: createElements

 /**
  * created elements
  * @license http://www.blags.org/
  * @created:2010年05月21日 20时40分
  * @copyright 1997-2010 The Martin Group
  * @author Martin <china.codehome@gmail.com> 
  * */
 function createElements()
 {
     global $xoopsDB;
     $Relation =& $this->Obj;
     $HotelElement = new XoopsFormSelect('酒店名称', 'hotel_id', $Relation['hotel_id'], 1);
     $HotelElement->addOptionArray($this->hotelList);
     $this->addElement($HotelElement, true);
     $ServiceElement = new XoopsFormSelect('服务名称', 'service_id', $Relation['service_id'], 1);
     $ServiceElement->addOptionArray($this->serviceList);
     $this->addElement($ServiceElement, true);
     $this->addElement(new XoopsFormText('服务价格', 'service_extra_price', 11, 11, $Relation['service_extra_price']), true);
 }
开发者ID:ponvino,项目名称:xoops-martin,代码行数:19,代码来源:form.hotel.service.relation.php

示例15: createElements

 /**
  * created elements
  * @license   http://www.blags.org/
  * @created   :2010年05月21日 20时40分
  * @copyright 1997-2010 The Martin Group
  * @author    Martin <china.codehome@gmail.com>
  * */
 public function createElements()
 {
     global $xoopsDB;
     $Relation =& $this->Obj;
     $HotelElement = new XoopsFormSelect(_AM_MARTIN_HOTEL_NAME, 'hotel_id', $Relation['hotel_id'], 1);
     $HotelElement->addOptionArray($this->hotelList);
     $this->addElement($HotelElement, true);
     $ServiceElement = new XoopsFormSelect(_AM_MARTIN_SERVICE_NAME, 'service_id', $Relation['service_id'], 1);
     $ServiceElement->addOptionArray($this->serviceList);
     $this->addElement($ServiceElement, true);
     $this->addElement(new XoopsFormText(_AM_MARTIN_SERVICE_PRICES, 'service_extra_price', 11, 11, $Relation['service_extra_price']), true);
 }
开发者ID:mambax7,项目名称:xoops-martin,代码行数:19,代码来源:form.hotel.service.relation.php


注:本文中的XoopsFormSelect::addOptionArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。