Esempio n. 1
0
     }
 }
 echo "<form action='pmlite.php' method='post' name='coolsus'>\n";
 echo "<table style=' text-align:left;' class='outer'><tr><td class='head txtright' style='width:25%'>" . _PM_TO . "</td>";
 if ($reply == 1) {
     echo "<td class='even'><input type='hidden' name='to_userid' value='" . $pm->getVar("from_userid") . "' />" . $pm_uname . "</td>";
 } else {
     if ($send2 == 1) {
         $to_username = XoopsUser::getUnameFromId($to_userid);
         echo "<td class='even'><input type='hidden' name='to_userid' value='" . $to_userid . "' />" . $to_username . "</td>";
     } else {
         require_once $GLOBALS['xoops']->path('class/xoopsform/formelement.php');
         require_once $GLOBALS['xoops']->path('class/xoopsform/formselect.php');
         require_once $GLOBALS['xoops']->path('class/xoopsform/formlabel.php');
         require_once $GLOBALS['xoops']->path('class/xoopsform/formselectuser.php');
         $user_sel = new XoopsFormSelectUser("", "to_userid");
         echo "<td class='even'>" . $user_sel->render();
         echo "</td>";
     }
 }
 echo "</tr>";
 echo "<tr><td class='head txtright' style='width:25%;'>" . _PM_SUBJECTC . "</td>";
 if ($reply == 1) {
     $subject = $pm->getVar('subject', 'E');
     //TODO Fix harcoded string
     if (!preg_match("/^" . _RE . "/i", $subject)) {
         $subject = _RE . ' ' . $subject;
     }
     echo "<td class='even'><input type='text' name='subject' value='" . $subject . "' size='30' maxlength='100' /></td>";
 } else {
     echo "<td class='even'><input type='text' name='subject' size='30' maxlength='100' /></td>";
Esempio n. 2
0
     if (!preg_match("/^Re:/i", $subject)) {
         $subject = 'Re: ' . $subject;
     }
     $xoopsTpl->assign('to_username', $pm_uname);
     $pmform->addElement(new XoopsFormHidden('to_userid', $pm->getVar("from_userid")));
 } elseif ($sendmod == 1) {
     $xoopsTpl->assign('to_username', XoopsUser::getUnameFromId($_POST["to_userid"]));
     $pmform->addElement(new XoopsFormHidden('to_userid', $_POST["to_userid"]));
     $subject = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['subject']));
     $message = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['message']));
 } else {
     if ($send2 == 1) {
         $xoopsTpl->assign('to_username', XoopsUser::getUnameFromId($to_userid, false));
         $pmform->addElement(new XoopsFormHidden('to_userid', $to_userid));
     } else {
         $to_username = new XoopsFormSelectUser('', 'to_userid');
         $xoopsTpl->assign('to_username', $to_username->render());
     }
     $subject = "";
     $message = "";
 }
 $pmform->addElement(new XoopsFormText('', 'subject', 30, 100, $subject), true);
 $pmform->addElement(new XoopsFormDhtmlTextArea('', 'message', $message, 8, 37), true);
 $pmform->addElement(new XoopsFormRadioYN('', 'savecopy', 0));
 $pmform->addElement(new XoopsFormHidden('op', 'submit'));
 $pmform->addElement(new XoopsFormButton('', 'submit', _PM_SUBMIT, 'submit'));
 $pmform->addElement(new XoopsFormButton('', 'reset', _PM_CLEAR, 'reset'));
 $cancel_send = new XoopsFormButton('', 'cancel', _PM_CANCELSEND, 'button');
 $cancel_send->setExtra("onclick='javascript:window.close();'");
 $pmform->addElement($cancel_send);
 $pmform->assign($xoopsTpl);
Esempio n. 3
0
 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);
     }
     $this->addElement($groups_moderation_checkbox);
     $moderator = new XoopsFormSelectUser(_AM_PUBLISHER_CATEGORY_MODERATOR, 'moderator', true, $this->targetObject->moderator('e'), 1, false);
     $moderator->setDescription(_AM_PUBLISHER_CATEGORY_MODERATOR_DSC);
     $this->addElement($moderator);
     $cat_tray = new XoopsFormElementTray(_AM_PUBLISHER_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));
     }
     $t = new XoopsFormText('', 'nb_subcats', 3, 2);
     $l = new XoopsFormLabel('', sprintf(_AM_PUBLISHER_ADD_OPT, $t->render()));
     $b = new XoopsFormButton('', 'submit_subcats', _AM_PUBLISHER_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);
     $r->addElement($b);
     $cat_tray->addElement($r);
     $this->addElement($cat_tray);
     $this->addElement(new XoopsFormHidden('categoryid', $this->targetObject->categoryid()));
     $this->addElement(new XoopsFormHidden('nb_sub_yet', $this->subCatsCount));
 }
Esempio n. 4
0
     if (!preg_match('/^' . _RE . '/i', $subject)) {
         $subject = _RE . ' ' . $subject;
     }
     $GLOBALS['xoopsTpl']->assign('to_username', $pm_uname);
     $pmform->addElement(new XoopsFormHidden('to_userid', $pm->getVar('from_userid')));
 } elseif ($sendmod == 1) {
     $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId(XoopsRequest::getInt('to_userid', 0, 'POST')));
     $pmform->addElement(new XoopsFormHidden('to_userid', XoopsRequest::getInt('to_userid', 0, 'POST')));
     $subject = $myts->htmlSpecialChars(XoopsRequest::getString('subject', '', 'POST'));
     $message = $myts->htmlSpecialChars(XoopsRequest::getString('message', '', 'POST'));
 } else {
     if ($send2 == 1) {
         $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId($to_userid, false));
         $pmform->addElement(new XoopsFormHidden('to_userid', $to_userid));
     } else {
         $to_username = new XoopsFormSelectUser('', 'to_userid');
         $GLOBALS['xoopsTpl']->assign('to_username', $to_username->render());
     }
     $subject = '';
     $message = '';
 }
 $pmform->addElement(new XoopsFormText('', 'subject', 30, 100, $subject), true);
 $msg_image = '';
 $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'msg_image', $msg_image);
 //$subject_icons = XoopsLists::getSubjectsList();
 $xoopsTpl->assign('radio_icons', $subject_icons);
 $pmform->addElement(new XoopsFormDhtmlTextArea('', 'message', $message, 8, 37), true);
 $pmform->addElement(new XoopsFormRadioYN('', 'savecopy', 0));
 $pmform->addElement(new XoopsFormHidden('op', 'submit'));
 $pmform->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
 $pmform->addElement(new XoopsFormButton('', 'reset', _PM_CLEAR, 'reset'));
Esempio n. 5
0
 public function createElements()
 {
     include_once dirname(dirname(__DIR__)) . '/include/common.php';
     // Category
     $criteria = new Criteria(null);
     $criteria->setSort('weight');
     $criteria->setOrder('ASC');
     $myTree = new XoopsObjectTree($this->publisher->getHandler('category')->getObjects($criteria), 'categoryid', 'parentid');
     $catSelect = $myTree->makeSelBox('parentid', 'name', '--', $this->targetObject->parentid(), true);
     $this->addElement(new XoopsFormLabel(_AM_PUBLISHER_PARENT_CATEGORY_EXP, $catSelect));
     // 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 = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
     $gpermHandler =& $this->publisher->getHandler('groupperm');
     $moduleId = $this->publisher->getModule()->mid();
     $allowedEditors = publisherGetEditors($gpermHandler->getItemIds('editors', $groups, $moduleId));
     $nohtml = false;
     if (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 = null !== $GLOBALS['xoopsUser']->getVar('publisher_editor') ? $GLOBALS['xoopsUser']->getVar('publisher_editor') : '';
                 // Need set through user profile
             }
         }
         $editor = empty($editor) || !in_array($editor, $allowedEditors) ? $this->publisher->getConfig('submit_editor') : $editor;
         $formEditor = new XoopsFormSelectEditor($this, 'editor', $editor, $nohtml, $allowedEditors);
         $this->addElement($formEditor);
     } else {
         $editor = $this->publisher->getConfig('submit_editor');
     }
     $editorConfigs = array();
     $editorConfigs['rows'] = $this->publisher->getConfig('submit_editor_rows') == '' ? 35 : $this->publisher->getConfig('submit_editor_rows');
     $editorConfigs['cols'] = $this->publisher->getConfig('submit_editor_cols') == '' ? 60 : $this->publisher->getConfig('submit_editor_cols');
     $editorConfigs['width'] = $this->publisher->getConfig('submit_editor_width') == '' ? '100%' : $this->publisher->getConfig('submit_editor_width');
     $editorConfigs['height'] = $this->publisher->getConfig('submit_editor_height') == '' ? '400px' : $this->publisher->getConfig('submit_editor_height');
     $editorConfigs['name'] = 'header';
     $editorConfigs['value'] = $this->targetObject->header('e');
     $textHeader = new XoopsFormEditor(_AM_PUBLISHER_CATEGORY_HEADER, $editor, $editorConfigs, $nohtml, $onfailure = null);
     $textHeader->setDescription(_AM_PUBLISHER_CATEGORY_HEADER_DSC);
     $this->addElement($textHeader);
     // IMAGE
     $imageArray = XoopsLists::getImgListAsArray(publisherGetImageDir('category'));
     $imageSelect = new XoopsFormSelect('', 'image', $this->targetObject->getImage());
     //$imageSelect -> addOption ('-1', '---------------');
     $imageSelect->addOptionArray($imageArray);
     $imageSelect->setExtra("onchange='showImgSelected(\"image3\", \"image\", \"" . 'uploads/' . PUBLISHER_DIRNAME . '/images/category/' . "\", \"\", \"" . XOOPS_URL . "\")'");
     $imageTray = new XoopsFormElementTray(_AM_PUBLISHER_IMAGE, '&nbsp;');
     $imageTray->addElement($imageSelect);
     $imageTray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . publisherGetImageDir('category', false) . $this->targetObject->getImage() . "' name='image3' id='image3' alt='' />"));
     $imageTray->setDescription(_AM_PUBLISHER_IMAGE_DSC);
     $this->addElement($imageTray);
     // IMAGE UPLOAD
     $max_size = 5000000;
     $fileBox = new XoopsFormFile(_AM_PUBLISHER_IMAGE_UPLOAD, 'image_file', $max_size);
     $fileBox->setExtra("size ='45'");
     $fileBox->setDescription(_AM_PUBLISHER_IMAGE_UPLOAD_DSC);
     $this->addElement($fileBox);
     // Short url
     $textShortUrl = new XoopsFormText(_AM_PUBLISHER_CATEGORY_SHORT_URL, 'short_url', 50, 255, $this->targetObject->short_url('e'));
     $textShortUrl->setDescription(_AM_PUBLISHER_CATEGORY_SHORT_URL_DSC);
     $this->addElement($textShortUrl);
     // Meta Keywords
     $textMetaKeywords = new XoopsFormTextArea(_AM_PUBLISHER_CATEGORY_META_KEYWORDS, 'meta_keywords', $this->targetObject->meta_keywords('e'), 7, 60);
     $textMetaKeywords->setDescription(_AM_PUBLISHER_CATEGORY_META_KEYWORDS_DSC);
     $this->addElement($textMetaKeywords);
     // Meta Description
     $textMetaDescription = new XoopsFormTextArea(_AM_PUBLISHER_CATEGORY_META_DESCRIPTION, 'meta_description', $this->targetObject->meta_description('e'), 7, 60);
     $textMetaDescription->setDescription(_AM_PUBLISHER_CATEGORY_META_DESCRIPTION_DSC);
     $this->addElement($textMetaDescription);
     // 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
     $readPermissionsTray = new XoopsFormElementTray(_AM_PUBLISHER_PERMISSIONS_CAT_READ, '');
     $selectAllReadCheckbox = new XoopsFormCheckBox('', "adminbox", 1);
     $selectAllReadCheckbox->addOption('allbox', _AM_SYSTEM_ALL);
     $selectAllReadCheckbox->setExtra(" onclick='xoopsCheckGroup(\"form\", \"adminbox\" , \"groupsRead[]\");' ");
     $selectAllReadCheckbox->setClass('xo-checkall');
     $readPermissionsTray->addElement($selectAllReadCheckbox);
     $groupsReadCheckbox = new XoopsFormCheckBox('', 'groupsRead[]', $this->targetObject->getGroupsRead());
     foreach ($this->userGroups as $group_id => $group_name) {
         $groupsReadCheckbox->addOption($group_id, $group_name);
     }
     $readPermissionsTray->addElement($groupsReadCheckbox);
     $this->addElement($readPermissionsTray);
     // SUBMIT PERMISSIONS
     $submitPermissionsTray = new XoopsFormElementTray(_AM_PUBLISHER_PERMISSIONS_CAT_SUBMIT, '');
     $submitPermissionsTray->setDescription(_AM_PUBLISHER_PERMISSIONS_CAT_SUBMIT_DSC);
     $selectAllSubmitCheckbox = new XoopsFormCheckBox('', "adminbox2", 1);
     $selectAllSubmitCheckbox->addOption('allbox', _AM_SYSTEM_ALL);
     $selectAllSubmitCheckbox->setExtra(" onclick='xoopsCheckGroup(\"form\", \"adminbox2\" , \"groupsSubmit[]\");' ");
     $selectAllSubmitCheckbox->setClass('xo-checkall');
     $submitPermissionsTray->addElement($selectAllSubmitCheckbox);
     $groupsSubmitCheckbox = new XoopsFormCheckBox('', 'groupsSubmit[]', $this->targetObject->getGroupsSubmit());
     foreach ($this->userGroups as $group_id => $group_name) {
         $groupsSubmitCheckbox->addOption($group_id, $group_name);
     }
     $submitPermissionsTray->addElement($groupsSubmitCheckbox);
     $this->addElement($submitPermissionsTray);
     // MODERATION PERMISSIONS
     $moderatePermissionsTray = new XoopsFormElementTray(_AM_PUBLISHER_PERMISSIONS_CAT_MODERATOR, '');
     $moderatePermissionsTray->setDescription(_AM_PUBLISHER_PERMISSIONS_CAT_MODERATOR_DSC);
     $selectAllModerateCheckbox = new XoopsFormCheckBox('', "adminbox3", 1);
     $selectAllModerateCheckbox->addOption('allbox', _AM_SYSTEM_ALL);
     $selectAllModerateCheckbox->setExtra(" onclick='xoopsCheckGroup(\"form\", \"adminbox3\" , \"groupsModeration[]\");' ");
     $selectAllModerateCheckbox->setClass('xo-checkall');
     $moderatePermissionsTray->addElement($selectAllModerateCheckbox);
     $groupsModerationCheckbox = new XoopsFormCheckBox('', 'groupsModeration[]', $this->targetObject->getGroupsModeration());
     foreach ($this->userGroups as $group_id => $group_name) {
         $groupsModerationCheckbox->addOption($group_id, $group_name);
     }
     $moderatePermissionsTray->addElement($groupsModerationCheckbox);
     $this->addElement($moderatePermissionsTray);
     $moderator = new XoopsFormSelectUser(_AM_PUBLISHER_CATEGORY_MODERATOR, 'moderator', true, $this->targetObject->moderator('e'), 1, false);
     $moderator->setDescription(_AM_PUBLISHER_CATEGORY_MODERATOR_DSC);
     $this->addElement($moderator);
     //SUBCATEGORY
     $catTray = new XoopsFormElementTray(_AM_PUBLISHER_SCATEGORYNAME, '<br /><br />');
     for ($i = 0; $i < $this->subCatsCount; ++$i) {
         $subname = '';
         if ($i < (($scname = XoopsRequest::getArray('scname', array(), 'POST')) ? count($scname) : 0)) {
             $temp = XoopsRequest::getArray('scname', array(), 'POST');
             $subname = ($scname = XoopsRequest::getArray('scname', '', 'POST')) ? $temp[$i] : '';
         }
         $catTray->addElement(new XoopsFormText('', 'scname[' . $i . ']', 50, 255, $subname));
     }
     $t = new XoopsFormText('', 'nb_subcats', 3, 2);
     $l = new XoopsFormLabel('', sprintf(_AM_PUBLISHER_ADD_OPT, $t->render()));
     $b = new XoopsFormButton('', 'submit_subcats', _AM_PUBLISHER_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);
     $r->addElement($b);
     $catTray->addElement($r);
     $this->addElement($catTray);
     $this->addElement(new XoopsFormHidden('categoryid', $this->targetObject->categoryid()));
     $this->addElement(new XoopsFormHidden('nb_sub_yet', $this->subCatsCount));
 }