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


PHP XoopsFormCheckBox::setDescription方法代码示例

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


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

示例1: getForm

 /**
  * Get a {@link XoopsForm} object for creating/editing objects
  * @param mixed $action receiving page - defaults to $_SERVER['REQUEST_URI']
  * @param mixed $title title of the form
  *
  * @return object
  */
 function getForm($action = false, $title = false)
 {
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     if ($action == false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     if ($title == false) {
         $title = $this->isNew() ? _ADD : _EDIT;
         $title .= " " . _NL_AM_NEWSLETTER;
     }
     $form = new XoopsThemeForm($title, 'form', $action);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('id', $this->getVar('newsletter_id')));
     }
     $form->addElement(new XoopsFormText(_NL_AM_NAME, 'newsletter_name', 35, 255, $this->getVar('newsletter_name', 'e')), true);
     $form->addElement(new XoopsFormTextArea(_NL_AM_DESCRIPTION, 'newsletter_description', $this->getVar('newsletter_description', 'e')));
     $form->addElement(new XoopsFormText(_NL_AM_FROMNAME, 'newsletter_from_name', 35, 255, $this->getVar('newsletter_from_name', 'e')), true);
     $form->addElement(new XoopsFormText(_NL_AM_FROMEMAIL, 'newsletter_from_email', 35, 255, $this->getVar('newsletter_from_email', 'e')), true);
     $form->addElement(new XoopsFormText(_NL_AM_EMAIL, 'newsletter_email', 35, 255, $this->getVar('newsletter_email', 'e')), true);
     $form->addElement(new XoopsFormTextArea(_NL_AM_CONFIRM_TEXT, "newsletter_confirm_text", $this->getVar('newsletter_confirm_text', 'e'), 10, 50, "newsletter_confirm_text"));
     $member_handler =& xoops_gethandler('member');
     $group_list =& $member_handler->getGroupList();
     $groups_checkbox = new XoopsFormCheckBox(_NL_AM_PERMISSIONS_SELECT, 'newsletter_permissions[]', $this->getPermissions());
     $groups_checkbox->setDescription(_NL_AM_PERMISSIONS_SELECT_DSC);
     foreach ($group_list as $group_id => $group_name) {
         $groups_checkbox->addOption($group_id, $group_name);
     }
     $form->addElement($groups_checkbox);
     $template_select = new XoopsFormSelect(_NL_AM_TEMPLATE, 'newsletter_template', $this->getVar('newsletter_template', 'e'));
     $template_select->addOption('smartmail_newsletter_pcworld.html');
     $form->addElement($template_select);
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:42,代码来源:newsletter.php

示例2: createElements

 function createElements()
 {
     global $xoopsDB;
     $mytree = new XoopsTree($xoopsDB->prefix("smartsection_categories"), "categoryid", "parentid");
     // Parent Category
     ob_start();
     $mytree->makeMySelBox("name", "weight", $this->targetObject->parentid(), 1, 'parentid');
     //makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="")
     $this->addElement(new XoopsFormLabel(_AM_SSECTION_PARENT_CATEGORY_EXP, ob_get_contents()));
     ob_end_clean();
     // Name
     $this->addElement(new XoopsFormText(_AM_SSECTION_CATEGORY, 'name', 50, 255, $this->targetObject->name('e')), true);
     // Description
     $this->addElement(new XoopsFormTextArea(_AM_SSECTION_COLDESCRIPT, 'description', $this->targetObject->description('e'), 7, 60));
     if (SMARTSECTION_LEVEL > 0) {
         // Header
         $text_header = smartsection_getEditor(_AM_SSECTION_CATEGORY_HEADER, 'header', $this->targetObject->header('e'));
         $text_header->setDescription(_AM_SSECTION_CATEGORY_HEADER_DSC);
         $this->addElement($text_header);
     }
     // IMAGE
     $image_array = XoopsLists::getImgListAsArray(smartsection_getImageDir('category'));
     $image_select = new XoopsFormSelect('', 'image', $this->targetObject->image());
     //$image_select -> addOption ('-1', '---------------');
     $image_select->addOptionArray($image_array);
     $image_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/smartsection/images/category/' . "\", \"\", \"" . XOOPS_URL . "\")'");
     $image_tray = new XoopsFormElementTray(_AM_SSECTION_IMAGE, ' ');
     $image_tray->addElement($image_select);
     $image_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . smartsection_getImageDir('category', false) . $this->targetObject->image() . "' name='image3' id='image3' alt='' />"));
     $image_tray->setDescription(_AM_SSECTION_IMAGE_DSC);
     $this->addElement($image_tray);
     // IMAGE UPLOAD
     $max_size = 5000000;
     $file_box = new XoopsFormFile(_AM_SSECTION_IMAGE_UPLOAD, "image_file", $max_size);
     $file_box->setExtra("size ='45'");
     $file_box->setDescription(_AM_SSECTION_IMAGE_UPLOAD_DSC);
     $this->addElement($file_box);
     if (SMARTSECTION_LEVEL > 0) {
         // Short url
         $text_short_url = new XoopsFormText(_AM_SSECTION_CATEGORY_SHORT_URL, 'short_url', 50, 255, $this->targetObject->short_url('e'));
         $text_short_url->setDescription(_AM_SSECTION_CATEGORY_SHORT_URL_DSC);
         $this->addElement($text_short_url);
         // Meta Keywords
         $text_meta_keywords = new XoopsFormTextArea(_AM_SSECTION_CATEGORY_META_KEYWORDS, 'meta_keywords', $this->targetObject->meta_keywords('e'), 7, 60);
         $text_meta_keywords->setDescription(_AM_SSECTION_CATEGORY_META_KEYWORDS_DSC);
         $this->addElement($text_meta_keywords);
         // Meta Description
         $text_meta_description = new XoopsFormTextArea(_AM_SSECTION_CATEGORY_META_DESCRIPTION, 'meta_description', $this->targetObject->meta_description('e'), 7, 60);
         $text_meta_description->setDescription(_AM_SSECTION_CATEGORY_META_DESCRIPTION_DSC);
         $this->addElement($text_meta_description);
     }
     // Weight
     $this->addElement(new XoopsFormText(_AM_SSECTION_COLPOSIT, 'weight', 4, 4, $this->targetObject->weight()));
     if (SMARTSECTION_LEVEL > 0) {
         // Added by skalpa: custom template support
         $this->addElement(new XoopsFormText("Custom template", 'template', 50, 255, $this->targetObject->template('e')), false);
     }
     // READ PERMISSIONS
     $groups_read_checkbox = new XoopsFormCheckBox(_AM_SSECTION_PERMISSIONS_CAT_READ, 'groups_read[]', $this->targetObject->getGroups_read());
     foreach ($this->userGroups as $group_id => $group_name) {
         if ($group_id != XOOPS_GROUP_ADMIN) {
             $groups_read_checkbox->addOption($group_id, $group_name);
         }
     }
     $this->addElement($groups_read_checkbox);
     // Apply permissions on all items
     $apply = isset($_POST['applyall']) ? intval($_POST['applyall']) : 0;
     $addapplyall_radio = new XoopsFormRadioYN(_AM_SSECTION_PERMISSIONS_APPLY_ON_ITEMS, 'applyall', $apply, ' ' . _AM_SSECTION_YES . '', ' ' . _AM_SSECTION_NO . '');
     $this->addElement($addapplyall_radio);
     // SUBMIT PERMISSIONS
     $groups_submit_checkbox = new XoopsFormCheckBox(_AM_SSECTION_PERMISSIONS_CAT_SUBMIT, 'groups_submit[]', $this->targetObject->getGroups_submit());
     $groups_submit_checkbox->setDescription(_AM_SSECTION_PERMISSIONS_CAT_SUBMIT_DSC);
     foreach ($this->userGroups as $group_id => $group_name) {
         if ($group_id != XOOPS_GROUP_ADMIN) {
             $groups_submit_checkbox->addOption($group_id, $group_name);
         }
     }
     $this->addElement($groups_submit_checkbox);
     if (SMARTSECTION_LEVEL > 0) {
         // Added by fx2024
         // sub Categories
         $cat_tray = new XoopsFormElementTray(_AM_SSECTION_SCATEGORYNAME, '<br /><br />');
         for ($i = 0; $i < $this->subCatsCount; $i++) {
             if ($i < (isset($_POST['scname']) ? sizeof($_POST['scname']) : 0)) {
                 $subname = isset($_POST['scname']) ? $_POST['scname'][$i] : '';
             } else {
                 $subname = '';
             }
             $cat_tray->addElement(new XoopsFormText('', 'scname[' . $i . ']', 50, 255, $subname), true);
         }
         $t = new XoopsFormText('', 'nb_subcats', 3, 2);
         $l = new XoopsFormLabel('', sprintf(_AM_SSECTION_ADD_OPT, $t->render()));
         $b = new XoopsFormButton('', 'submit', _AM_SSECTION_ADD_OPT_SUBMIT, 'submit');
         if (!$this->targetObject->categoryid()) {
             $b->setExtra('onclick="this.form.elements.op.value=\'addsubcats\'"');
         } else {
             $b->setExtra('onclick="this.form.elements.op.value=\'mod\'"');
         }
         $r = new XoopsFormElementTray('');
         $r->addElement($l);
//.........这里部分代码省略.........
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:101,代码来源:form-editcategory.php

示例3: edititem

function edititem($showmenu = false, $itemid = 0)
{
    global $smartsection_file_handler, $smartsection_item_handler, $smartsection_category_handler, $xoopsUser, $xoopsModule, $xoopsConfig, $xoopsDB;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    // If there is a parameter, and the id exists, retrieve data: we're editing a item
    if ($itemid != 0) {
        // Creating the ITEM object
        $itemObj = new ssItem($itemid);
        if ($itemObj->notLoaded()) {
            redirect_header("item.php", 1, _AM_SS_NOITEMSELECTED);
            exit;
        }
        switch ($itemObj->status()) {
            case _SS_STATUS_SUBMITTED:
                $breadcrumb_action1 = _AM_SS_SUBMITTED;
                $breadcrumb_action2 = _AM_SS_APPROVING;
                $page_title = _AM_SS_SUBMITTED_TITLE;
                $page_info = _AM_SS_SUBMITTED_INFO;
                $button_caption = _AM_SS_APPROVE;
                $new_status = _SS_STATUS_PUBLISHED;
                break;
            case _SS_STATUS_PUBLISHED:
                $breadcrumb_action1 = _AM_SS_PUBLISHED;
                $breadcrumb_action2 = _AM_SS_EDITING;
                $page_title = _AM_SS_PUBLISHEDEDITING;
                $page_info = _AM_SS_PUBLISHEDEDITING_INFO;
                $button_caption = _AM_SS_MODIFY;
                $new_status = _SS_STATUS_PUBLISHED;
                break;
            case _SS_STATUS_OFFLINE:
                $breadcrumb_action1 = _AM_SS_OFFLINE;
                $breadcrumb_action2 = _AM_SS_EDITING;
                $page_title = _AM_SS_OFFLINEEDITING;
                $page_info = _AM_SS_OFFLINEEDITING_INFO;
                $button_caption = _AM_SS_MODIFY;
                $new_status = _SS_STATUS_OFFLINE;
                break;
            case "default":
            default:
                break;
        }
        $categoryObj =& $itemObj->category();
        if ($showmenu) {
            ss_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        echo "<br />\n";
        ss_collapsableBar('edititemtable', 'edititemicon', $page_title, $page_info);
    } else {
        // there's no parameter, so we're adding an item
        $itemObj =& $smartsection_item_handler->create();
        $categoryObj =& $smartsection_category_handler->create();
        $breadcrumb_action1 = _AM_SS_ITEMS;
        $breadcrumb_action2 = _AM_SS_CREATINGNEW;
        $button_caption = _AM_SS_CREATE;
        $new_status = _SS_STATUS_PUBLISHED;
        if ($showmenu) {
            ss_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        $sel_categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : 0;
        $categoryObj->setVar('categoryid', $sel_categoryid);
        ss_collapsableBar('createitemtable', 'createitemicon', _AM_SS_ITEM_CREATING, _AM_SS_ITEM_CREATING_DSC);
    }
    // ITEM FORM
    $sform = new XoopsThemeForm(_AM_SS_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_SS_CATEGORY, ob_get_contents());
    $category_label->setDescription(_AM_SS_CATEGORY_DSC);
    $sform->addElement($category_label);
    ob_end_clean();
    // TITLE
    $title_text = new XoopsFormText(_AM_SS_TITLE, 'title', 50, 255, $itemObj->title(0, 'e'));
    $sform->addElement($title_text, true);
    // SUMMARY
    $summary_text = ss_getEditor(_AM_SS_SUMMARY, 'summary', $itemObj->summary(0, 'e'));
    $summary_text->setDescription(_AM_SS_SUMMARY_DSC);
    $sform->addElement($summary_text, false);
    // DISPLAY_SUMMARY
    $display_summary_radio = new XoopsFormRadioYN(_AM_SS_DISPLAY_SUMMARY, 'display_summary', $itemObj->display_summary(), ' ' . _AM_SS_YES . '', ' ' . _AM_SS_NO . '');
    $sform->addElement($display_summary_radio);
    // BODY
    $body_text = ss_getEditor(_AM_SS_BODY, 'body', $itemObj->body(0, 'e'));
    //$body_text = new XoopsFormDhtmlTextArea(_AM_SS_BODY, 'body', $itemObj->body(0, 'e'), 20, 60);
    $body_text->setDescription(_AM_SS_BODY_DSC);
    $sform->addElement($body_text, true);
    // IMAGE
    $image_array =& XoopsLists::getImgListAsArray(ss_getImageDir('item'));
    $image_select = new XoopsFormSelect('', 'image', $itemObj->image());
    //$image_select -> addOption ('-1', '---------------');
    $image_select->addOptionArray($image_array);
    $image_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/smartsection/images/item/' . "\", \"\", \"" . XOOPS_URL . "\")'");
    $image_tray = new XoopsFormElementTray(_AM_SS_IMAGE_ITEM, '&nbsp;');
    $image_tray->addElement($image_select);
    $image_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . ss_getImageDir('item', false) . $itemObj->image() . "' name='image3' id='image3' alt='' />"));
    $image_tray->setDescription(_AM_SS_IMAGE_ITEM_DSC);
    $sform->addElement($image_tray);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:101,代码来源:item.php

示例4: createElements

 function createElements()
 {
     global $xoopsUser;
     // Category
     $criteria = new Criteria(null);
     $criteria->setSort('weight');
     $criteria->setOrder('ASC');
     $mytree = new XoopsObjectTree($this->publisher->getHandler('category')->getObjects($criteria), "categoryid", "parentid");
     $cat_select = $mytree->makeSelBox('parentid', 'name', '--', $this->targetObject->parentid(), true);
     $this->addElement(new XoopsFormLabel(_AM_PUBLISHER_PARENT_CATEGORY_EXP, $cat_select));
     // Name
     $this->addElement(new XoopsFormText(_AM_PUBLISHER_CATEGORY, 'name', 50, 255, $this->targetObject->name('e')), true);
     // Description
     $this->addElement(new XoopsFormTextArea(_AM_PUBLISHER_COLDESCRIPT, 'description', $this->targetObject->description('e'), 7, 60));
     // EDITOR
     $groups = $xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
     $gperm_handler = $this->publisher->getHandler('groupperm');
     $module_id = $this->publisher->getModule()->mid();
     $allowed_editors = publisher_getEditors($gperm_handler->getItemIds('editors', $groups, $module_id));
     $nohtml = false;
     if (count($allowed_editors) > 0) {
         $editor = @$_POST['editor'];
         if (!empty($editor)) {
             publisher_setCookieVar('publisher_editor', $editor);
         } else {
             $editor = publisher_getCookieVar('publisher_editor');
             if (empty($editor) && is_object($xoopsUser)) {
                 $editor = @$xoopsUser->getVar('publisher_editor');
                 // Need set through user profile
             }
         }
         $editor = empty($editor) || !in_array($editor, $allowed_editors) ? $this->publisher->getConfig('submit_editor') : $editor;
         $form_editor = new XoopsFormSelectEditor($this, 'editor', $editor, $nohtml, $allowed_editors);
         $this->addElement($form_editor);
     } else {
         $editor = $this->publisher->getConfig('submit_editor');
     }
     $editor_configs = array();
     $editor_configs['rows'] = $this->publisher->getConfig('submit_editor_rows') == '' ? 35 : $this->publisher->getConfig('submit_editor_rows');
     $editor_configs['cols'] = $this->publisher->getConfig('submit_editor_cols') == '' ? 60 : $this->publisher->getConfig('submit_editor_cols');
     $editor_configs['width'] = $this->publisher->getConfig('submit_editor_width') == '' ? "100%" : $this->publisher->getConfig('submit_editor_width');
     $editor_configs['height'] = $this->publisher->getConfig('submit_editor_height') == '' ? "400px" : $this->publisher->getConfig('submit_editor_height');
     $editor_configs['name'] = 'header';
     $editor_configs['value'] = $this->targetObject->header('e');
     $text_header = new XoopsFormEditor(_AM_PUBLISHER_CATEGORY_HEADER, $editor, $editor_configs, $nohtml, $onfailure = null);
     $text_header->setDescription(_AM_PUBLISHER_CATEGORY_HEADER_DSC);
     $this->addElement($text_header);
     // IMAGE
     $image_array = XoopsLists::getImgListAsArray(publisher_getImageDir('category'));
     $image_select = new XoopsFormSelect('', 'image', $this->targetObject->image());
     //$image_select -> addOption ('-1', '---------------');
     $image_select->addOptionArray($image_array);
     $image_select->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/' . PUBLISHER_DIRNAME . '/images/category/' . "\", \"\", \"" . XOOPS_URL . "\")'");
     $image_tray = new XoopsFormElementTray(_AM_PUBLISHER_IMAGE, '&nbsp;');
     $image_tray->addElement($image_select);
     $image_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . publisher_getImageDir('category', false) . $this->targetObject->image() . "' name='image3' id='image3' alt='' />"));
     $image_tray->setDescription(_AM_PUBLISHER_IMAGE_DSC);
     $this->addElement($image_tray);
     // IMAGE UPLOAD
     $max_size = 5000000;
     $file_box = new XoopsFormFile(_AM_PUBLISHER_IMAGE_UPLOAD, "image_file", $max_size);
     $file_box->setExtra("size ='45'");
     $file_box->setDescription(_AM_PUBLISHER_IMAGE_UPLOAD_DSC);
     $this->addElement($file_box);
     // Short url
     $text_short_url = new XoopsFormText(_AM_PUBLISHER_CATEGORY_SHORT_URL, 'short_url', 50, 255, $this->targetObject->short_url('e'));
     $text_short_url->setDescription(_AM_PUBLISHER_CATEGORY_SHORT_URL_DSC);
     $this->addElement($text_short_url);
     // Meta Keywords
     $text_meta_keywords = new XoopsFormTextArea(_AM_PUBLISHER_CATEGORY_META_KEYWORDS, 'meta_keywords', $this->targetObject->meta_keywords('e'), 7, 60);
     $text_meta_keywords->setDescription(_AM_PUBLISHER_CATEGORY_META_KEYWORDS_DSC);
     $this->addElement($text_meta_keywords);
     // Meta Description
     $text_meta_description = new XoopsFormTextArea(_AM_PUBLISHER_CATEGORY_META_DESCRIPTION, 'meta_description', $this->targetObject->meta_description('e'), 7, 60);
     $text_meta_description->setDescription(_AM_PUBLISHER_CATEGORY_META_DESCRIPTION_DSC);
     $this->addElement($text_meta_description);
     // Weight
     $this->addElement(new XoopsFormText(_AM_PUBLISHER_COLPOSIT, 'weight', 4, 4, $this->targetObject->weight()));
     // Added by skalpa: custom template support
     //todo, check this
     $this->addElement(new XoopsFormText("Custom template", 'template', 50, 255, $this->targetObject->template('e')), false);
     // READ PERMISSIONS
     $groups_read_checkbox = new XoopsFormCheckBox(_AM_PUBLISHER_PERMISSIONS_CAT_READ, 'groups_read[]', $this->targetObject->getGroups_read());
     foreach ($this->userGroups as $group_id => $group_name) {
         $groups_read_checkbox->addOption($group_id, $group_name);
     }
     $this->addElement($groups_read_checkbox);
     // SUBMIT PERMISSIONS
     $groups_submit_checkbox = new XoopsFormCheckBox(_AM_PUBLISHER_PERMISSIONS_CAT_SUBMIT, 'groups_submit[]', $this->targetObject->getGroups_submit());
     $groups_submit_checkbox->setDescription(_AM_PUBLISHER_PERMISSIONS_CAT_SUBMIT_DSC);
     foreach ($this->userGroups as $group_id => $group_name) {
         $groups_submit_checkbox->addOption($group_id, $group_name);
     }
     $this->addElement($groups_submit_checkbox);
     // MODERATION PERMISSIONS
     $groups_moderation_checkbox = new XoopsFormCheckBox(_AM_PUBLISHER_PERMISSIONS_CAT_MODERATOR, 'groups_moderation[]', $this->targetObject->getGroups_moderation());
     $groups_moderation_checkbox->setDescription(_AM_PUBLISHER_PERMISSIONS_CAT_MODERATOR_DSC);
     foreach ($this->userGroups as $group_id => $group_name) {
         $groups_moderation_checkbox->addOption($group_id, $group_name);
     }
//.........这里部分代码省略.........
开发者ID:trabisdementia,项目名称:xuups,代码行数:101,代码来源:category.php

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


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