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


PHP XoopsFormSelect::setDescription方法代码示例

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


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

示例1: 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

示例2: import_spiders_form

function import_spiders_form()
{
    include XOOPS_ROOT_PATH . '/class/xoopslists.php';
    $xl = new XoopsLists();
    $files = $xl->getFileListAsArray(XOOPS_ROOT_PATH . '/modules/' . _MI_SPIDERS_DIRNAME . '/admin/resources/');
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsThemeForm(_AM_SPIDERS_IMPORTFILE, "import", "", "post");
    $fileelement = new XoopsFormSelect(_AM_SPIDERS_FILE, 'file', $file);
    $fileelement->setDescription(_AM_SPIDERS_FILEDESC);
    foreach ($files as $key => $file) {
        if (strpos($file, '.txt') > 0) {
            $options[$key] = $file;
        }
    }
    $fileelement->addOptionArray($options);
    $form->addElement($fileelement);
    $form->addElement(new XoopsFormHidden("op", 'import-file'));
    $form->addElement(new XoopsFormButton('', 'contents_submit', _SUBMIT, "submit"));
    $form->display();
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:20,代码来源:forms.php

示例3: createElements

    /**
     * @param $obj
     *
     * @return $this
     */
    public function createElements($obj)
    {
        $publisher =& PublisherPublisher::getInstance();
        $allowedEditors = publisherGetEditors($publisher->getHandler('permission')->getGrantedItems('editors'));
        if (!is_object($GLOBALS['xoopsUser'])) {
            $group = array(XOOPS_GROUP_ANONYMOUS);
        } else {
            $group = $GLOBALS['xoopsUser']->getGroups();
        }
        $this->setExtra('enctype="multipart/form-data"');
        $this->startTab(_CO_PUBLISHER_TAB_MAIN);
        // Category
        $categoryFormSelect = new XoopsFormSelect(_CO_PUBLISHER_CATEGORY, 'categoryid', $obj->getVar('categoryid', 'e'));
        $categoryFormSelect->setDescription(_CO_PUBLISHER_CATEGORY_DSC);
        $categoryFormSelect->addOptionArray($publisher->getHandler('category')->getCategoriesForSubmit());
        $this->addElement($categoryFormSelect);
        // ITEM TITLE
        $this->addElement(new XoopsFormText(_CO_PUBLISHER_TITLE, 'title', 50, 255, $obj->getVar('title', 'e')), true);
        // SUBTITLE
        if ($this->isGranted(PublisherConstants::PUBLISHER_SUBTITLE)) {
            $this->addElement(new XoopsFormText(_CO_PUBLISHER_SUBTITLE, 'subtitle', 50, 255, $obj->getVar('subtitle', 'e')));
        }
        // SHORT URL
        if ($this->isGranted(PublisherConstants::PUBLISHER_ITEM_SHORT_URL)) {
            $textShortUrl = new XoopsFormText(_CO_PUBLISHER_ITEM_SHORT_URL, 'item_short_url', 50, 255, $obj->short_url('e'));
            $textShortUrl->setDescription(_CO_PUBLISHER_ITEM_SHORT_URL_DSC);
            $this->addElement($textShortUrl);
        }
        // TAGS
        if (xoops_isActiveModule('tag') && $this->isGranted(PublisherConstants::PUBLISHER_ITEM_TAG)) {
            include_once $GLOBALS['xoops']->path('modules/tag/include/formtag.php');
            $textTags = new XoopsFormTag('item_tag', 60, 255, $obj->getVar('item_tag', 'e'), 0);
            $this->addElement($textTags);
        }
        // SELECT EDITOR
        $nohtml = !$obj->dohtml();
        if (count($allowedEditors) === 1) {
            $editor = $allowedEditors[0];
        } elseif (count($allowedEditors) > 0) {
            $editor = XoopsRequest::getString('editor', '', 'POST');
            if (!empty($editor)) {
                publisherSetCookieVar('publisher_editor', $editor);
            } else {
                $editor = publisherGetCookieVar('publisher_editor');
                if (empty($editor) && is_object($GLOBALS['xoopsUser'])) {
                    //                    $editor = @ $GLOBALS['xoopsUser']->getVar('publisher_editor'); // Need set through user profile
                    $editor = null !== $GLOBALS['xoopsUser']->getVar('publisher_editor') ? $GLOBALS['xoopsUser']->getVar('publisher_editor') : '';
                    // Need set through user profile
                }
            }
            $editor = empty($editor) || !in_array($editor, $allowedEditors) ? $publisher->getConfig('submit_editor') : $editor;
            $formEditor = new XoopsFormSelectEditor($this, 'editor', $editor, $nohtml, $allowedEditors);
            $this->addElement($formEditor);
        } else {
            $editor = $publisher->getConfig('submit_editor');
        }
        $editorConfigs = array();
        $editorConfigs['rows'] = !$publisher->getConfig('submit_editor_rows') ? 35 : $publisher->getConfig('submit_editor_rows');
        $editorConfigs['cols'] = !$publisher->getConfig('submit_editor_cols') ? 60 : $publisher->getConfig('submit_editor_cols');
        $editorConfigs['width'] = !$publisher->getConfig('submit_editor_width') ? '100%' : $publisher->getConfig('submit_editor_width');
        $editorConfigs['height'] = !$publisher->getConfig('submit_editor_height') ? '400px' : $publisher->getConfig('submit_editor_height');
        // SUMMARY
        if ($this->isGranted(PublisherConstants::PUBLISHER_SUMMARY)) {
            // Description
            //$summaryText = new XoopsFormTextArea(_CO_PUBLISHER_SUMMARY, 'summary', $obj->getVar('summary', 'e'), 7, 60);
            $editorConfigs['name'] = 'summary';
            $editorConfigs['value'] = $obj->getVar('summary', 'e');
            $summaryText = new XoopsFormEditor(_CO_PUBLISHER_SUMMARY, $editor, $editorConfigs, $nohtml, $onfailure = null);
            $summaryText->setDescription(_CO_PUBLISHER_SUMMARY_DSC);
            $this->addElement($summaryText);
        }
        // BODY
        $editorConfigs['name'] = 'body';
        $editorConfigs['value'] = $obj->getVar('body', 'e');
        $bodyText = new XoopsFormEditor(_CO_PUBLISHER_BODY, $editor, $editorConfigs, $nohtml, $onfailure = null);
        $bodyText->setDescription(_CO_PUBLISHER_BODY_DSC);
        $this->addElement($bodyText);
        // VARIOUS OPTIONS
        if ($this->isGranted(PublisherConstants::PUBLISHER_DOHTML) || $this->isGranted(PublisherConstants::PUBLISHER_DOSMILEY) || $this->isGranted(PublisherConstants::PUBLISHER_DOXCODE) || $this->isGranted(PublisherConstants::PUBLISHER_DOIMAGE) || $this->isGranted(PublisherConstants::PUBLISHER_DOLINEBREAK)) {
            if ($this->isGranted(PublisherConstants::PUBLISHER_DOHTML)) {
                $html_radio = new XoopsFormRadioYN(_CO_PUBLISHER_DOHTML, 'dohtml', $obj->dohtml(), _YES, _NO);
                $this->addElement($html_radio);
            }
            if ($this->isGranted(PublisherConstants::PUBLISHER_DOSMILEY)) {
                $smiley_radio = new XoopsFormRadioYN(_CO_PUBLISHER_DOSMILEY, 'dosmiley', $obj->dosmiley(), _YES, _NO);
                $this->addElement($smiley_radio);
            }
            if ($this->isGranted(PublisherConstants::PUBLISHER_DOXCODE)) {
                $xcode_radio = new XoopsFormRadioYN(_CO_PUBLISHER_DOXCODE, 'doxcode', $obj->doxcode(), _YES, _NO);
                $this->addElement($xcode_radio);
            }
            if ($this->isGranted(PublisherConstants::PUBLISHER_DOIMAGE)) {
                $image_radio = new XoopsFormRadioYN(_CO_PUBLISHER_DOIMAGE, 'doimage', $obj->doimage(), _YES, _NO);
                $this->addElement($image_radio);
            }
//.........这里部分代码省略.........
开发者ID:trabisdementia,项目名称:publisher,代码行数:101,代码来源:item.php

示例4: Criteria

 $criteria = new Criteria('product_id', $item->getVar('product_id'), '<>');
 $criteria->setSort('product_title');
 $relatedProducts = $h_myshop_products->getObjects($criteria);
 foreach ($relatedProducts as $oneitem) {
     $relatedProducts_d[$oneitem->getVar('product_id')] = xoops_trim($oneitem->getVar('product_title'));
 }
 if ($edit) {
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('related_product_id', $item->getVar('product_id'), '='));
     $productRelated = $h_myshop_related->getObjects($criteria);
     foreach ($productRelated as $oneproduct) {
         $productRelated_d[] = $oneproduct->getVar('related_product_related');
     }
 }
 $related_select = new XoopsFormSelect(_MYSHOP_RELATED_PRODUCTS, 'relatedproducts', $productRelated_d, 5, true);
 $related_select->setDescription(_AM_MYSHOP_RELATED_HELP . '<br />' . _AM_MYSHOP_SELECT_HLP);
 $related_select->addOptionArray($relatedProducts_d);
 $sform->addElement($related_select, false);
 if (myshop_utils::getModuleOption('use_price')) {
     // VAT
     $vatSelect = new XoopsFormSelect(_MYSHOP_VAT, 'product_vat_id', $item->getVar('product_vat_id'));
     $vatSelect->addOptionArray($vatsForDisplay);
     $sform->addElement($vatSelect, true);
     $sform->addElement(new XoopsFormText(_MYSHOP_PRICE, 'product_price', 20, 20, $item->getVar('product_price', 'e')), true);
     $sform->addElement(new XoopsFormText(_AM_MYSHOP_DISCOUNT_HLP, 'product_discount_price', 20, 20, $item->getVar('product_discount_price', 'e')), false);
     $sform->addElement(new XoopsFormText(_MYSHOP_SHIPPING_PRICE, 'product_shipping_price', 20, 20, $item->getVar('product_shipping_price', 'e')), false);
     $sform->addElement(new XoopsFormText(_MYSHOP_ECOTAXE, 'product_ecotaxe', 10, 10, $item->getVar('product_ecotaxe', 'e')), false);
 }
 $sform->addElement(new XoopsFormText(_MYSHOP_STOCK_QUANTITY, 'product_stock', 10, 10, $item->getVar('product_stock', 'e')), false);
 $alertStock = new XoopsFormText(_MYSHOP_STOCK_ALERT, 'product_alert_stock', 10, 10, $item->getVar('product_alert_stock', 'e'));
 $alertStock->setDescription(_AM_MYSHOP_STOCK_HLP);
开发者ID:naao,项目名称:myshop,代码行数:31,代码来源:products.php

示例5: editclient

function editclient($showmenu = false, $id = 0)
{
    global $client_handler, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    // If there is a parameter, and the id exists, retrieve data: we're editing a client
    if ($id != 0) {
        // Creating the client object
        $clientObj = new SmartclientClient($id);
        if ($clientObj->notLoaded()) {
            redirect_header("client.php", 1, _AM_SCLIENT_NOCLIENTSELECTED);
            exit;
        }
        switch ($clientObj->status()) {
            case _SCLIENT_STATUS_SUBMITTED:
                $breadcrumb_action1 = _AM_SCLIENT_SUBMITTED_CLIENTS;
                $breadcrumb_action2 = _AM_SCLIENT_APPROVING;
                $page_title = _AM_SCLIENT_SUBMITTED_TITLE;
                $page_info = _AM_SCLIENT_SUBMITTED_INFO;
                $button_caption = _AM_SCLIENT_APPROVE;
                $new_status = _SCLIENT_STATUS_ACTIVE;
                break;
            case _SCLIENT_STATUS_ACTIVE:
                $breadcrumb_action1 = _AM_SCLIENT_ACTIVE_CLIENTS;
                $breadcrumb_action2 = _AM_SCLIENT_EDITING;
                $page_title = _AM_SCLIENT_ACTIVE_EDITING;
                $page_info = _AM_SCLIENT_ACTIVE_EDITING_INFO;
                $button_caption = _AM_SCLIENT_MODIFY;
                $new_status = _SCLIENT_STATUS_ACTIVE;
                break;
            case _SCLIENT_STATUS_INACTIVE:
                $breadcrumb_action1 = _AM_SCLIENT_INACTIVE_CLIENTS;
                $breadcrumb_action2 = _AM_SCLIENT_EDITING;
                $page_title = _AM_SCLIENT_INACTIVE_EDITING;
                $page_info = _AM_SCLIENT_INACTIVE_EDITING_INFO;
                $button_caption = _AM_SCLIENT_MODIFY;
                $new_status = _SCLIENT_STATUS_INACTIVE;
                break;
            case _SCLIENT_STATUS_REJECTED:
                $breadcrumb_action1 = _AM_SCLIENT_REJECTED_CLIENTS;
                $breadcrumb_action2 = _AM_SCLIENT_EDITING;
                $page_title = _AM_SCLIENT_REJECTED_EDITING;
                $page_info = _AM_SCLIENT_REJECTED_EDITING_INFO;
                $button_caption = _AM_SCLIENT_MODIFY;
                $new_status = _SCLIENT_STATUS_REJECTED;
                break;
            case "default":
            default:
                break;
        }
        if ($showmenu) {
            smartclient_adminMenu(1, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        echo "<br />\n";
        smartclient_collapsableBar('bottomtable', 'bottomtableicon');
        echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . $page_title . "</h3>";
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $page_info . "</span>";
        echo "<div id='bottomtable'>";
    } else {
        // there's no parameter, so we're adding a client
        $clientObj =& $client_handler->create();
        $breadcrumb_action1 = _AM_SCLIENT_CLIENTS;
        $breadcrumb_action2 = _AM_SCLIENT_CREATE;
        $button_caption = _AM_SCLIENT_CREATE;
        $new_status = _SCLIENT_STATUS_ACTIVE;
        if ($showmenu) {
            smartclient_adminMenu(1, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        smartclient_collapsableBar('bottomtable', 'bottomtableicon');
        echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SCLIENT_CLIENT_CREATING . "</h3>";
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SCLIENT_CLIENT_CREATING_DSC . "</span>";
        echo "<div id='bottomtable'>";
    }
    // CLIENT FORM
    $sform = new XoopsThemeForm(_AM_SCLIENT_CLIENTS, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    // TITLE
    $title_text = new XoopsFormText(_CO_SCLIENT_TITLE_REQ, 'title', 50, 255, $clientObj->title('e'));
    $sform->addElement($title_text, true);
    // LOGO
    $logo_array =& XoopsLists::getImgListAsArray(smartclient_getImageDir());
    $logo_select = new XoopsFormSelect('', 'image', $clientObj->image());
    $logo_select->addOption('-1', '---------------');
    $logo_select->addOptionArray($logo_array);
    $logo_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/' . SMARTCLIENT_DIRNAME . '/images' . "\", \"\", \"" . XOOPS_URL . "\")'");
    $logo_tray = new XoopsFormElementTray(_AM_SCLIENT_LOGO, '&nbsp;');
    $logo_tray->addElement($logo_select);
    $logo_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . smartclient_getImageDir('', false) . $clientObj->image() . "' name='image3' id='image3' alt='' />"));
    $logo_tray->setDescription(_AM_SCLIENT_LOGO_DSC);
    $sform->addElement($logo_tray);
    // LOGO UPLOAD
    $max_size = 5000000;
    $file_box = new XoopsFormFile(_AM_SCLIENT_LOGO_UPLOAD, "logo_file", $max_size);
    $file_box->setExtra("size ='45'");
    $file_box->setDescription(sprintf(_AM_SCLIENT_LOGO_UPLOAD_DSC, $xoopsModuleConfig['img_max_width'], $xoopsModuleConfig['img_max_height']));
    $sform->addElement($file_box);
    // IMAGE_URL
    $image_url_text = new XoopsFormText(_CO_SCLIENT_IMAGE_URL, 'image_url', 50, 255, $clientObj->image_url());
    $image_url_text->setDescription(_CO_SCLIENT_IMAGE_URL_DSC);
    $sform->addElement($image_url_text, false);
    // URL
//.........这里部分代码省略.........
开发者ID:trabisdementia,项目名称:xuups,代码行数:101,代码来源:client.php

示例6: XoopsPageNav

    $nav = new XoopsPageNav($usercount, $limit, $start, "start", $nav_extra);
    $user_select_nav = new XoopsFormLabel(sprintf(_MA_SEARCH_COUNT, $usercount), $nav->renderNav(4));
    $user_select_tray->addElement($user_select_nav);
    $add_button = new XoopsFormButton('', '', _ADD, 'button');
    $add_button->setExtra('onclick="addusers();"');
    $close_button = new XoopsFormButton('', '', _CLOSE, 'button');
    $close_button->setExtra('onclick="window.close()"');
    $button_tray = new XoopsFormElementTray("");
    $button_tray->addElement($add_button);
    $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'reset'));
    $button_tray->addElement($close_button);
    $form_user->addElement($user_select_tray);
    if (!empty($_REQUEST["action"])) {
        $group_select = new XoopsFormSelect(_MA_SEARCH_GROUP, 'group', $_REQUEST['group']);
        $group_select->addOptionArray($groups);
        $rank_select = new XoopsFormSelect(_MA_SEARCH_RANK, 'rank', $_REQUEST['rank']);
        $rank_select->addOptionArray($ranks);
        $rank_select->setDescription(_MA_SEARCH_RANK_DESC);
        $form_user->addElement($group_select);
        $form_user->addElement($rank_select);
        $refresh_button = new XoopsFormButton('', '', _MA_SEARCH_REFRESH, 'submit');
        $button_tray->addElement($refresh_button);
    }
    $form_user->addElement(new XoopsFormHidden('action', $_REQUEST["action"]));
    $form_user->addElement(new XoopsFormHidden('target', $_REQUEST["target"]));
    $form_user->addElement(new XoopsFormHidden('multiple', $_REQUEST["multiple"]));
    $form_user->addElement($button_tray);
    $form_user->display();
}
$xoopsOption['output_type'] = "plain";
xoops_cp_footer();
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:userselect.php

示例7: SystemMaintenance

// Define scripts
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$xoTheme->addScript('modules/system/js/admin.js');
switch ($op) {
    case 'list':
    default:
        // Define Breadcrumb and tips
        $xoBreadCrumb->addLink(_AM_SYSTEM_MAINTENANCE_NAV_MANAGER, system_adminVersion('maintenance', 'adminpath'));
        $xoBreadCrumb->addHelp(system_adminVersion('maintenance', 'help'));
        $xoBreadCrumb->addTips(_AM_SYSTEM_MAINTENANCE_TIPS);
        $xoBreadCrumb->render();
        $maintenance = new SystemMaintenance();
        //Form Maintenance
        $form_maintenance = new XoopsThemeForm(_AM_SYSTEM_MAINTENANCE, 'maintenance_save', 'admin.php?fct=maintenance', 'post', true);
        $cache = new XoopsFormSelect(_AM_SYSTEM_MAINTENANCE_CACHE, 'cache', '', 3, true);
        $cache->setDescription(XOOPS_VAR_PATH . '/cache/smarty_cache/<br>' . XOOPS_VAR_PATH . '/cache/smarty_compile/<br>' . XOOPS_VAR_PATH . '/cache/xoops_cache/');
        $cache_arr = array(1 => 'smarty_cache', 2 => 'smarty_compile', 3 => 'xoops_cache');
        $cache->addOptionArray($cache_arr);
        $form_maintenance->addElement($cache);
        $form_maintenance->addElement(new XoopsFormRadioYN(_AM_SYSTEM_MAINTENANCE_SESSION, 'session', '', _YES, _NO));
        $tables_tray = new XoopsFormElementTray(_AM_SYSTEM_MAINTENANCE_TABLES, '');
        $tables_tray->setDescription(_AM_SYSTEM_MAINTENANCE_TABLES_DESC);
        $select_tables = new XoopsFormSelect('', 'tables', '', 7, true);
        $select_tables->addOptionArray($maintenance->displayTables(true));
        $tables_tray->addElement($select_tables, false);
        $tables_tray->addElement(new xoopsFormLabel('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . _AM_SYSTEM_MAINTENANCE_DUMP_AND . '&nbsp;'));
        $choice = new XoopsFormSelect('&nbsp;&nbsp;', 'maintenance', '', 4, true);
        $options = array('1' => _AM_SYSTEM_MAINTENANCE_CHOICE1, '2' => _AM_SYSTEM_MAINTENANCE_CHOICE2, '3' => _AM_SYSTEM_MAINTENANCE_CHOICE3, '4' => _AM_SYSTEM_MAINTENANCE_CHOICE4);
        $choice->addOptionArray($options);
        $tables_tray->addElement($choice, false);
        $form_maintenance->addElement($tables_tray);
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:main.php

示例8: CriteriaCompo

     $payments_d[$oneitem->getVar('payment_id')] = xoops_trim($oneitem->getVar('payment_title'));
 }
 if (empty($payments_d)) {
     oledrion_utils::redirect(_AM_OLEDRION_DELIVERY_PAYMENTADD, $baseurl, 5);
 }
 if ($edit) {
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('dp_delivery', $item->getVar('delivery_id'), '='));
     $deliveryPayments = $h_oledrion_delivery_payment->getObjects($criteria);
     foreach ($deliveryPayments as $oneproduct) {
         $deliveryPayments_d[] = $oneproduct->getVar('dp_payment');
     }
 }
 $paymentSelect = new XoopsFormSelect(_AM_OLEDRION_DELIVERY_PAYMENT, 'payments', $deliveryPayments_d, 5, true);
 $paymentSelect->addOptionArray($payments_d);
 $paymentSelect->setDescription(_AM_OLEDRION_SELECT_HLP);
 $sform->addElement($paymentSelect, true);
 if ($action == 'edit' && $item->pictureExists()) {
     $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_CURRENT_PICTURE, '<br />');
     $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl() . "' alt='' border='0' />"));
     $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture');
     $deleteCheckbox->addOption(1, _DELETE);
     $pictureTray->addElement($deleteCheckbox);
     $sform->addElement($pictureTray);
     unset($pictureTray, $deleteCheckbox);
 }
 $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE, 'attachedfile', oledrion_utils::getModuleOption('maxuploadsize')), false);
 $editor = oledrion_utils::getWysiwygForm(_AM_OLEDRION_DESCRIPTION, 'delivery_description', $item->getVar('delivery_description', 'e'), 15, 60, 'description_hidden');
 if ($editor) {
     $sform->addElement($editor, false);
 }
开发者ID:osw17,项目名称:oledrion,代码行数:31,代码来源:delivery.php

示例9: editfolder_text

function editfolder_text($showmenu = false, $folderid, $languageid)
{
    global $xoopsDB, $smartmedia_folder_handler, $xoopsUser, $myts, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    echo "<script type=\"text/javascript\" src=\"funcs.js\"></script>";
    echo "<style>";
    echo "<!-- ";
    echo "select { width: 130px; }";
    echo "-->";
    echo "</style>";
    $cat_sel = '';
    $folderObj = $smartmedia_folder_handler->get($folderid, $languageid);
    if ($languageid == 'new') {
        $bread_lang = _AM_SMEDIA_CREATE;
    } else {
        $bread_lang = ucfirst($languageid);
    }
    if ($showmenu) {
        smartmedia_adminMenu(2, _AM_SMEDIA_FOLDERS . " > " . _AM_SMEDIA_LANGUAGE_INFO . " > " . $bread_lang);
    }
    echo "<br />\n";
    smartmedia_collapsableBar('bottomtable', 'bottomtableicon');
    echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SMEDIA_FOLDER_LANGUAGE_INFO_EDITING . "</h3>";
    echo "<div id='bottomtable'>";
    echo "<span style=\"color: #567; margin: 3px 0 18px 0; font-size: small; display: block; \">" . _AM_SMEDIA_FOLDER_LANGUAGE_INFO_EDITING_INFO . "</span>";
    // Start folder form
    $sform = new XoopsThemeForm(_AM_SMEDIA_FOLDER, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    $sform->addElement(new XoopsFormHidden('folderid', $folderid));
    // Language
    $languageOptions = array();
    $languageList = XoopsLists::getLangList();
    $createdLanguages = $folderObj->getCreatedLanguages();
    foreach ($languageList as $language) {
        if ($languageid != 'new' || !in_array($language, $createdLanguages)) {
            $languageOptions[$language] = $language;
        }
    }
    $language_select = new XoopsFormSelect(_AM_SMEDIA_LANGUAGE_ITEM, 'languageid', $languageid);
    $language_select->addOptionArray($languageOptions);
    $language_select->setDescription(_AM_SMEDIA_LANGUAGE_ITEM_DSC);
    if ($languageid != 'new') {
        $language_select->setExtra(smartmedia_make_control_disabled());
        $sform->addElement(new XoopsFormHidden('languageid', $languageid));
    }
    $sform->addElement($language_select, true);
    // title
    $sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_TITLE, 'title', 50, 255, $folderObj->title()), true);
    // title
    $sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_TITLE_REQ, 'title', 50, 255, $folderObj->title()), true);
    // short_title
    //$sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_SHORT_TITLE, 'short_title', 50, 255, $folderObj->short_title()));
    // summary
    $summary = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_SUMMARY, 'summary', $folderObj->summary('e'), 3, 60);
    $summary->setDescription(_AM_SMEDIA_FOLDER_SUMMARYDSC);
    $sform->addElement($summary);
    // Description
    $description_text = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_DESCRIPTION, 'description', $folderObj->description('e'), 7, 60);
    $description_text->setDescription(_AM_SMEDIA_FOLDER_DESCRIPTIONDSC);
    $sform->addElement($description_text);
    // Meta-Description
    $meta = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_META_DESCRIPTION, 'meta_description', $folderObj->meta_description('e'), 7, 60);
    $meta->setDescription(_AM_SMEDIA_CLIP_META_DESCRIPTIONDSC);
    $sform->addElement($meta);
    $sform->addElement(new XoopsFormHidden('itemType', 'item_text'));
    // Action buttons tray
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addfolder_text');
    $button_tray->addElement($hidden);
    if ($languageid == 'new') {
        // We are creating a new folder language info
        $butt_create = new XoopsFormButton('', '', _AM_SMEDIA_CREATE, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'addfolder_text\'"');
        $button_tray->addElement($butt_create);
        $butt_clear = new XoopsFormButton('', '', _AM_SMEDIA_CLEAR, 'reset');
        $button_tray->addElement($butt_clear);
        $butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
    } else {
        // We are editing a folder language info
        $butt_create = new XoopsFormButton('', '', _AM_SMEDIA_MODIFY, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'addfolder_text\'"');
        $button_tray->addElement($butt_create);
        $butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
    }
    $sform->addElement($button_tray);
    $sform->display();
    echo "</div>";
    unset($hidden);
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:93,代码来源:folder.php

示例10: XoopsFormCheckBox

$form_family->addOption("parent", _LANG_WLA_CHECK_PARENT);
$form_family->addOption("sibling", _LANG_WLA_CHECK_SIBLING);
$form_family->addOption("spouse", _LANG_WLA_CHECK_SPOUSE);
$form_family->addOption("", _LANG_WLA_CHECK_NONE);
$form_xfn->addElement($form_family);
$form_romantic = new XoopsFormCheckBox(_LANG_WLA_SUB_ROMANTIC . "&nbsp;:&nbsp;", "romantic", $romantic);
$form_romantic->setExtra('class="valinp"');
$form_romantic->addOption("muse", _LANG_WLA_CHECK_MUSE);
$form_romantic->addOption("crush", _LANG_WLA_CHECK_CRUSH);
$form_romantic->addOption("date", _LANG_WLA_CHECK_DATE);
$form_romantic->addOption("sweetheart", _LANG_WLA_CHECK_HEART);
$form_xfn->addElement($form_romantic);
$form->addElement($form_xfn);
$form->addElement(new XoopsFormTextArea(_LANG_WLA_SUB_NOTE, "link_notes", $link_notes, 10, 60));
$form_rating = new XoopsFormSelect(_LANG_WLA_SUB_RATE, "link_rating", $link_rating);
$form_rating->setDescription(_LANG_WLA_CHECK_ZERO);
for ($r = 0; $r < 10; $r++) {
    $form_rating->addOption($r, $r);
}
$form->addElement($form_rating);
$form_target = new XoopsFormRadio(_LANG_WLA_SUB_TARGET, "link_target", $link_target);
$form_target->setDescription(_LANG_WLA_CHECK_STRICT);
$form_target->addOption('_blank', '_blank');
$form_target->addOption('_top', '_top');
$form_target->addOption('', "none");
$form->addElement($form_target);
$form_visible = new XoopsFormRadio(_LANG_WLA_SUB_VISIBLE, "link_visible", $link_visible);
$form_visible->addOption('Y', 'Yes');
$form_visible->addOption('N', 'No');
$form->addElement($form_visible);
$form_category = new XoopsFormSelect(_LANG_WLA_SUB_CAT, "link_category", $link_category);
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:link-manager-form.php

示例11: XoopsThemeForm

 echo '<h3>' . _AM_MYSEARCH_BLACKLIST . '</h3>';
 $sform = new XoopsThemeForm(_AM_MYSEARCH_BLACKLIST, 'MetagenBlackList', XOOPS_URL . '/modules/mysearch/admin/index.php', 'post');
 $sform->addElement(new XoopsFormHidden('op', 'MetagenBlackList'), false);
 // Remove words
 $remove_tray = new XoopsFormElementTray(_AM_MYSEARCH_BLACKLIST);
 $remove_tray->setDescription(_AM_MYSEARCH_BLACKLIST_DESC);
 $blacklist = new XoopsFormSelect('', 'blacklist', '', 5, true);
 $words = array();
 $metablack = new mysearch_blacklist();
 $words = $metablack->getAllKeywords();
 if (is_array($words) && count($words) > 0) {
     foreach ($words as $key => $value) {
         $blacklist->addOption($key, $value);
     }
 }
 $blacklist->setDescription(_AM_MYSEARCH_BLACKLIST_DESC);
 $remove_tray->addElement($blacklist, false);
 $remove_btn = new XoopsFormButton('', 'go', _AM_MYSEARCH_DELETE, 'submit');
 $remove_tray->addElement($remove_btn, false);
 $sform->addElement($remove_tray);
 // Add some words
 $add_tray = new XoopsFormElementTray(_AM_MYSEARCH_BLACKLIST_ADD);
 $add_tray->setDescription(_AM_MYSEARCH_BLACKLIST_ADD_DSC);
 $add_field = new XoopsFormTextArea('', 'keywords', '', 5, 70);
 $add_tray->addElement($add_field, false);
 $add_btn = new XoopsFormButton('', 'go', _AM_MYSEARCH_BLACKLIST_ADD, 'submit');
 $add_tray->addElement($add_btn, false);
 $sform->addElement($add_tray);
 $sform->display();
 echo "<br /><div align='center'><a href='http://xoops.instant-zero.com' target='_blank'><img src='../images/instantzero.gif'></a></div>";
 break;
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:index.php

示例12: edititem


//.........这里部分代码省略.........
        }
        echo "<br />\n";
        smartsection_collapsableBar('edititemtable', 'edititemicon', $page_title, $page_info);
        if (!$clone) {
            echo "<form><div style=\"margin-bottom: 10px;\">";
            echo "<input type='button' name='button' onclick=\"location='item.php?op=clone&itemid=" . $itemObj->itemid() . "'\" value='" . _AM_SSECTION_CLONE_ITEM . "'>&nbsp;&nbsp;";
            echo "</div></form>";
        }
    } else {
        // there's no parameter, so we're adding an item
        $itemObj =& $smartsection_item_handler->create();
        $itemObj->setVar('uid', $xoopsUser->uid());
        $categoryObj =& $smartsection_category_handler->create();
        $breadcrumb_action1 = _AM_SSECTION_ITEMS;
        $breadcrumb_action2 = _AM_SSECTION_CREATINGNEW;
        $button_caption = _AM_SSECTION_CREATE;
        $new_status = _SSECTION_STATUS_PUBLISHED;
        if ($showmenu) {
            smartsection_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        $sel_categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : 0;
        $categoryObj->setVar('categoryid', $sel_categoryid);
        smartsection_collapsableBar('createitemtable', 'createitemicon', _AM_SSECTION_ITEM_CREATING, _AM_SSECTION_ITEM_CREATING_DSC);
    }
    // ITEM FORM
    $sform = new XoopsThemeForm(_AM_SSECTION_ITEMS, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    // CATEGORY
    $mytree = new XoopsTree($xoopsDB->prefix("smartsection_categories"), "categoryid", "parentid");
    ob_start();
    //$sform->addElement(new XoopsFormHidden('categoryid', $categoryObj->categoryid()));
    $mytree->makeMySelBox("name", "weight", $categoryObj->categoryid());
    $category_label = new XoopsFormLabel(_AM_SSECTION_CATEGORY, ob_get_contents());
    $category_label->setDescription(_AM_SSECTION_CATEGORY_DSC);
    $sform->addElement($category_label);
    ob_end_clean();
    // TITLE
    $title_text = new XoopsFormText(_AM_SSECTION_TITLE, 'title', 50, 255, $itemObj->title(0, 'e'));
    $sform->addElement($title_text, true);
    if (SMARTSECTION_LEVEL >= 5) {
        // SUMMARY
        $summary_text = smartsection_getEditor(_AM_SSECTION_SUMMARY, 'summary', $itemObj->getVar('summary', 'e'));
        $summary_text->setDescription(_AM_SSECTION_SUMMARY_DSC);
        $sform->addElement($summary_text, false);
        // DISPLAY_SUMMARY
        $display_summary_radio = new XoopsFormRadioYN(_AM_SSECTION_DISPLAY_SUMMARY, 'display_summary', $itemObj->display_summary(), ' ' . _AM_SSECTION_YES . '', ' ' . _AM_SSECTION_NO . '');
        $sform->addElement($display_summary_radio);
    }
    // BODY
    /*if ($itemObj->address()) {
    		// Main body : pagewrap
    		$address_select = new XoopsFormSelect(_AM_SSECTION_BODY_SELECTFILE, "address", $itemObj->address());
    		$address_select->setDescription(_AM_SSECTION_BODY_SELECTFILE_DSC);
    	    $dir = smartsection_getUploadDir(true, 'content');
    		$folder = dir($dir);
    		while($file = $folder->read()) {
    	      if ($file != "." && $file != "..") {
    		     $address_select->addOption($file, "".$file."");
    		  }
    		}
    	    $folder->close();
    		$sform->addElement($address_select);
    
    		$sform->addElement(new XoopsFormHidden('body', ''));
    	} else {*/
    $body_text = smartsection_getEditor(_AM_SSECTION_BODY, 'body', $itemObj->getVar('body', 'e'));
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:67,代码来源:item.php

示例13: createFieldList

function createFieldList($val, $textbox = false, $limitToForm = false, $name = "", $firstValue = "", $multi_select = false)
{
    global $xoopsDB;
    array($formids);
    array($formnames);
    array($totalcaptionlist);
    array($totalvaluelist);
    $captionlistindex = 0;
    if ($limitToForm) {
        $limitToForm = " WHERE id_form = " . intval($limitToForm);
    } else {
        $limitToForm = "";
    }
    if (!$name) {
        $name = 'formlink';
    }
    $formlist = "SELECT id_form, desc_form FROM " . $xoopsDB->prefix("formulize_id") . " {$limitToForm} ORDER BY desc_form";
    $resformlist = $xoopsDB->query($formlist);
    if ($resformlist) {
        // loop through each form
        while ($rowformlist = $xoopsDB->fetchRow($resformlist)) {
            $fieldnames = "SELECT ele_caption, ele_id, ele_handle FROM " . $xoopsDB->prefix("formulize") . " WHERE id_form={$rowformlist['0']} ORDER BY ele_order";
            $resfieldnames = $xoopsDB->query($fieldnames);
            // loop through each caption in the current form
            while ($rowfieldnames = $xoopsDB->fetchRow($resfieldnames)) {
                // write formname: caption to the master array that will be passed to the select box.
                $totalcaptionlist[$captionlistindex] = printSmart(trans($rowformlist[1])) . ": " . printSmart(trans($rowfieldnames[0]), 50);
                $totalvaluelist[$captionlistindex] = $rowfieldnames[1];
                // if this is the selected entry
                if ($val == $totalvaluelist[$captionlistindex] or $val == $rowformlist[0] . "#*=:*" . $rowfieldnames[2]) {
                    $defaultlinkselection = $captionlistindex;
                }
                $captionlistindex++;
            }
        }
    }
    if ($textbox) {
        $am_ele_formlink = _AM_ELE_FORMLINK_TEXTBOX;
        $am_formlink_none = _AM_FORMLINK_NONE_TEXTBOX;
        $am_ele_formlink_desc = _AM_ELE_FORMLINK_DESC_TEXTBOX;
    } else {
        $am_ele_formlink = _AM_ELE_FORMLINK;
        $am_formlink_none = _AM_FORMLINK_NONE;
        $am_ele_formlink_desc = _AM_ELE_FORMLINK_DESC;
    }
    if ($firstValue) {
        // let a passed in value override the defaults
        $am_formlink_none = $firstValue;
    }
    // make the select box and add all the options
    $formlink = new XoopsFormSelect($am_ele_formlink, $name, '', $multi_select ? 8 : 1, $multi_select);
    $formlink->addOption("none", $am_formlink_none);
    for ($i = 0; $i < $captionlistindex; $i++) {
        $formlink->addOption($totalvaluelist[$i], htmlspecialchars(strip_tags($totalcaptionlist[$i])));
    }
    if (isset($defaultlinkselection)) {
        $formlink->setValue($totalvaluelist[$defaultlinkselection]);
    }
    $formlink->setDescription($am_ele_formlink_desc);
    if (!$textbox) {
        // return two pieces of info for selectboxes, since we need to know the element selected
        $to_return = array();
        $to_return[] = $formlink;
        $to_return[] = isset($defaultlinkselection) ? $totalvaluelist[$defaultlinkselection] : "";
        return $to_return;
    } else {
        return $formlink;
    }
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:69,代码来源:functions.php

示例14: XoopsThemeForm

include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
if (!$itemObj->categoryid() && isset($_GET['categoryid'])) {
    $categoryid = $_GET['categoryid'];
} else {
    $categoryid = $itemObj->categoryid();
}
if (isset($_GET['op']) && $_GET['op'] == 'clone') {
    $title = _MD_SSECTION_SUB_CLONE;
} else {
    $title = _MD_SSECTION_SUB_SMNAME;
}
$sform = new XoopsThemeForm($title, "form", xoops_getenv('PHP_SELF'));
$sform->setExtra('enctype="multipart/form-data"');
// Category
$category_select = new XoopsFormSelect(_MD_SSECTION_CATEGORY, 'categoryid', $categoryid);
$category_select->setDescription(_MD_SSECTION_CATEGORY_DSC);
$category_select->addOptionArray($categoriesArray);
$sform->addElement($category_select);
// ITEM TITLE
$sform->addElement(new XoopsFormText(_MD_SSECTION_TITLE, 'title', 50, 255, $itemObj->title('e')), true);
// SUMMARY
$summary_text = smartsection_getEditor(_MD_SSECTION_SUMMARY, 'summary', $itemObj->getVar('summary'));
$summary_text->setDescription(_MD_SSECTION_SUMMARY_DSC);
$sform->addElement($summary_text, false);
// BODY
//$body_text = new XoopsFormDhtmlTextArea(_MD_SSECTION_BODY, 'body', '', 15, 60);
$body_text = smartsection_getEditor(_MD_SSECTION_BODY_REQ, 'body', $itemObj->getVar('body'));
$body_text->setDescription(_MD_SSECTION_BODY_DSC);
$sform->addElement($body_text);
// IMAGE
$image_array =& XoopsLists::getImgListAsArray(smartsection_getImageDir('item'));
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:submit.inc.php

示例15: editField

function editField()
{
    global $oAdminButton;
    $eventsrv =& xhelpNewEventService();
    $session =& Session::singleton();
    $regex_array =& _getRegexArray();
    if (!isset($_REQUEST['id'])) {
        redirect_header(xhelpMakeURI(XHELP_ADMIN_URL . '/fields.php', array('op' => 'manageDepartments'), false), 3, _AM_XHELP_MESSAGE_NO_FIELD);
    }
    $fld_id = intval($_REQUEST['id']);
    $hField =& xhelpGetHandler('ticketField');
    if (!($field =& $hField->get($fld_id))) {
        redirect_header(xhelpMakeURI(XHELP_ADMIN_URL . '/fields.php', array('op' => 'manageDepartments'), false), 3, _AM_XHELP_MESSAGE_NO_FIELD);
    }
    if (!isset($_POST['editField'])) {
        //Get Custom Field From session (if exists)
        $field_info = $session->get('xhelp_editField_' . $fld_id);
        $field_errors = $session->get('xhelp_editFieldErrors_' . $fld_id);
        if (!$field_info === false) {
            $fld_controltype = $field_info['controltype'];
            $fld_datatype = $field_info['datatype'];
            $fld_departments = $field_info['departments'];
            $fld_name = $field_info['name'];
            $fld_fieldname = $field_info['fieldname'];
            $fld_description = $field_info['description'];
            $fld_required = $field_info['required'];
            $fld_length = $field_info['length'];
            $fld_weight = $field_info['weight'];
            $fld_defaultvalue = $field_info['defaultvalue'];
            $fld_values = $field_info['values'];
            $fld_validation = $field_info['validation'];
        } else {
            $hFDept =& xhelpGetHandler('ticketFieldDepartment');
            $depts =& $hFDept->departmentsByField($field->getVar('id'), true);
            $fld_controltype = $field->getVar('controltype');
            $fld_datatype = $field->getVar('datatype');
            $fld_departments = array_keys($depts);
            $fld_name = $field->getVar('name');
            $fld_fieldname = $field->getVar('fieldname');
            $fld_description = $field->getVar('description');
            $fld_required = $field->getVar('required');
            $fld_length = $field->getVar('fieldlength');
            $fld_weight = $field->getVar('weight');
            $fld_defaultvalue = $field->getVar('defaultvalue');
            $fld_values = _formatValues($field->getVar('fieldvalues'));
            $fld_validation = $field->getVar('validation');
        }
        //Display Field modification
        xoops_cp_header();
        echo $oAdminButton->renderButtons('manfields');
        //Edit Field Form
        $controls = xhelpGetControlArray();
        $control_select = new XoopsFormSelect(_AM_XHELP_TEXT_CONTROLTYPE, 'fld_controltype', $fld_controltype);
        $control_select->setDescription(_AM_XHELP_TEXT_CONTROLTYPE_DESC);
        foreach ($controls as $key => $control) {
            $control_select->addOption($key, $control['label']);
        }
        $datatypes = array(_XHELP_DATATYPE_TEXT => _XHELP_DATATYPE_TEXT, _XHELP_DATATYPE_NUMBER_INT => _XHELP_DATATYPE_NUMBER_INT, _XHELP_DATATYPE_NUMBER_DEC => _XHELP_DATATYPE_NUMBER_DEC);
        $datatype_select = new XoopsFormSelect(_AM_XHELP_TEXT_DATATYPE, 'fld_datatype', $fld_datatype);
        $datatype_select->setDescription(_AM_XHELP_TEXT_DATATYPE_DESC);
        $datatype_select->addOptionArray($datatypes);
        $hDepts =& xhelpGetHandler('department');
        $depts =& $hDepts->getObjects();
        $dept_select = new XoopsFormSelect(_AM_XHELP_TEXT_DEPARTMENTS, 'fld_departments', $fld_departments, 5, true);
        $dept_select->setDescription(_AM_XHELP_TEXT_DEPT_DESC);
        foreach ($depts as $obj) {
            $dept_select->addOption($obj->getVar('id'), $obj->getVar('department'));
        }
        unset($depts);
        if (!$field_errors === false) {
            xhelpRenderErrors($field_errors, xhelpMakeURI(XHELP_ADMIN_URL . '/fields.php', array('op' => 'clearEditSession', 'id' => $fld_id)));
        }
        $form = new xhelpForm(_AM_XHELP_EDIT_FIELD, 'edit_field', xhelpMakeURI(XHELP_ADMIN_URL . '/fields.php', array('op' => 'editfield', 'id' => $fld_id)));
        $nameEle = new XoopsFormText(_AM_XHELP_TEXT_NAME, 'fld_name', 30, 64, $fld_name);
        $nameEle->setDescription(_AM_XHELP_TEXT_NAME_DESC);
        $form->addElement($nameEle);
        $fieldnameEle = new XoopsFormText(_AM_XHELP_TEXT_FIELDNAME, 'fld_fieldname', 30, 64, $fld_fieldname);
        $fieldnameEle->setDescription(_AM_XHELP_TEXT_FIELDNAME_DESC);
        $form->addElement($fieldnameEle);
        $descriptionEle = new XoopsFormTextArea(_AM_XHELP_TEXT_DESCRIPTION, 'fld_description', $fld_description, 5, 60);
        $descriptionEle->setDescription(_AM_XHELP_TEXT_DESCRIPTION_DESC);
        $form->addElement($descriptionEle);
        $form->addElement($dept_select);
        $form->addElement($control_select);
        $form->addElement($datatype_select);
        $required = new XoopsFormRadioYN(_AM_XHELP_TEXT_REQUIRED, 'fld_required', $fld_required);
        $required->setDescription(_AM_XHELP_TEXT_REQUIRED_DESC);
        $form->addElement($required);
        $lengthEle = new XoopsFormText(_AM_XHELP_TEXT_LENGTH, 'fld_length', 5, 5, $fld_length);
        $lengthEle->setDescription(_AM_XHELP_TEXT_LENGTH_DESC);
        $form->addElement($lengthEle);
        $widthEle = new XoopsFormText(_AM_XHELP_TEXT_WEIGHT, 'fld_weight', 5, 5, $fld_weight);
        $widthEle->setDescription(_AM_XHELP_TEXT_WEIGHT_DESC);
        $form->addElement($widthEle);
        $regex_control = new xhelpFormRegex(_AM_XHELP_TEXT_VALIDATION, 'fld_valid', $fld_validation);
        $regex_control->setDescription(_AM_XHELP_TEXT_VALIDATION_DESC);
        $regex_control->addOptionArray($regex_array);
        $form->addElement($regex_control);
        $defaultValueEle = new XoopsFormText(_AM_XHELP_TEXT_DEFAULTVALUE, 'fld_defaultvalue', 30, 100, $fld_defaultvalue);
        $defaultValueEle->setDescription(_AM_XHELP_TEXT_DEFAULTVALUE_DESC);
//.........这里部分代码省略.........
开发者ID:trabisdementia,项目名称:xuups,代码行数:101,代码来源:fields.php


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