예제 #1
0
 function createElements($target)
 {
     $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'tabtitle', 35, 255, $target->getVar('tabtitle', 'e')));
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_PUBLISHDATE, 'tabfromdate', 15, $target->getVar('tabfromdate', 'e')));
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_ENDDATE, 'tabtodate', 15, $target->getVar('tabtodate', 'e')));
     $always_select = new XoopsFormSelect(_AM_MYTABS_ALWAYSSHOW . ":", "tabalwayson", $target->getVar('tabshowalways', 'e'));
     $always_select->addOption("yes", _AM_MYTABS_ALWAYS);
     $always_select->addOption("time", _AM_MYTABS_TIMEBASED);
     $always_select->addOption("no", _AM_MYTABS_OFF);
     $this->addElement($always_select);
     $this->addElement(new XoopsFormText(_AM_MYTABS_PRIORITY . ":", "tabpriority", 4, 5, $target->getVar('tabpriority', 'e')));
     $note = new XoopsFormText(_AM_MYTABS_NOTE . ":", "tabnote", 50, 255, $target->getVar('tabnote', 'e'));
     $this->addElement($note);
     $this->addElement(new XoopsFormSelectGroup(_AM_MYTABS_GROUPS, 'tabgroups', true, $target->getVar('tabgroups'), 8, true));
     $link = new XoopsFormText(_AM_MYTABS_LINK . ":", "tablink", 50, 255, $target->getVar('tablink', 'e'));
     $this->addElement($link);
     $rev = new XoopsFormText(_AM_MYTABS_REV . ":", "tabrev", 50, 255, $target->getVar('tabrev', 'e'));
     $this->addElement($rev);
     if (!$target->isNew()) {
         $this->addElement(new XoopsFormHidden("tabid", $target->getVar('tabid')));
     }
     $this->addElement(new XoopsFormHidden("tabpageid", $target->getVar('tabpageid')));
     $this->addElement(new XoopsFormHidden("op", "save"));
     $tray = new XoopsFormElementTray("");
     $tray->addElement(new XoopsFormButton("", "submit", _AM_MYTABS_OK, "submit"));
     $cancel = new XoopsFormButton("", "cancel", _AM_MYTABS_CANCEL, "button");
     $cancel->setExtra("onclick=\"self.location='index.php?pageid=" . $target->getVar('tabpageid') . "';\"");
     $tray->addElement($cancel);
     $this->addElement($tray);
 }
 function &execute(&$controller, &$request, &$user)
 {
     $editform =& $request->getAttribute('editform');
     $form = new XoopsThemeForm(_MD_A_PLZXOO_LANG_EDIT_CATEGORY, 'Category', '', 'POST');
     $form->addElement(new XoopsFormHidden('cid', $editform->cid_));
     $form->addElement(new XoopsFormText(_MD_A_PLZXOO_LANG_NAME, 'name', 64, 255, $editform->name_));
     //-------------------------
     // ¿Æ¥«¥Æ¥´¥ê
     //-------------------------
     $select = new XoopsFormSelect(_MD_A_PLZXOO_LANG_PARENT_CATEGORY, 'pid', $editform->pid_);
     $select->addOption(0, _MD_A_PLZXOO_LANG_TOP);
     $categories =& $request->getAttribute('categories');
     foreach ($categories as $category) {
         $select->addOption($category->getVar('cid'), $category->getVar('name'));
     }
     $form->addElement($select);
     unset($select);
     $form->addElement(new XoopsFormDhtmlTextArea(_MD_A_PLZXOO_LANG_DESCRIPTION, 'description', $editform->description_, 6, 50));
     $form->addElement(new XoopsFormText(_MD_A_PLZXOO_LANG_WEIGHT, 'weight', 10, 10, intval($editform->weight_)));
     $tray = new XoopsFormElementTray(_MD_A_PLZXOO_LANG_CONTROL);
     $tray->addElement(new XoopsFormButton('', 'submit', _MD_A_PLZXOO_LANG_SUBMIT, 'submit'));
     $tray->addElement(new XoopsFormButton('', 'reset', _MD_A_PLZXOO_LANG_RESET, 'reset'));
     $form->addElement($tray);
     $renderer = new mojaLE_Renderer($controller, $request, $user);
     $renderer->setTemplate('category_edit.tpl');
     $renderer->setAttribute('xoopsform', $form);
     return $renderer;
 }
예제 #3
0
파일: article.php 프로젝트: yunsite/xoopsdc
 /**
  * Get {@link XoopsForm} for setting prune criteria
  *
  * @return object
  **/
 function getForm($action = false)
 {
     if ($action === false) {
         $action = $_SERVER['SCRIPT_NAME'];
     }
     $title = $this->isNew() ? sprintf(_MD_ILOG_INSERT, _MD_ILOG_INSERT) : sprintf(_MD_ILOG_EDIT, _MD_ILOG_EDIT);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->addElement(new XoopsFormText(_MD_ILOG_TITLE, 'title', 60, 255, $this->getVar('title')));
     //tag
     $itemid = $this->isNew() ? 0 : $this->getVar("id");
     include_once XOOPS_ROOT_PATH . "/modules/tag/include/formtag.php";
     $form->addElement(new XoopsFormTag("keywords", 60, 255, $itemid, $catid = 0));
     $configs = array('editor' => 'fckeditor', 'toolbarset' => 'ilog', 'width' => '100%', 'height' => '500px', 'value' => $this->getVar('text_body', 'e'));
     $form->addElement(new XoopsFormEditor(_MD_ILOG_TEXT, 'text_body', $configs), true);
     $configs = array('editor' => 'fckeditor', 'toolbarset' => 'Basic', 'width' => '100%', 'height' => '200px', 'value' => $this->getVar('summary', 'e'));
     $form->addElement(new XoopsFormEditor(_MD_ILOG_SUMMARY, 'summary', $configs), true);
     $form_select = new XoopsFormSelect(_MD_ILOG_STATUS, 'status', $this->getVar('status'));
     $form_select->addOption('1', _MD_ILOG_ACCESSALL);
     $form_select->addOption('2', _MD_ILOG_ACCESSME);
     $form->addElement($form_select);
     if (!$this->isNew()) {
         //Load groups
         $form->addElement(new XoopsFormHidden('id', $this->getVar('id')));
     }
     if ($this->isNew()) {
         global $xoopsUser;
         $form->addElement(new XoopsFormHidden('uid', $xoopsUser->uid()));
         $form->addElement(new XoopsFormHidden('uname', $xoopsUser->getVar('uname')));
     }
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
예제 #4
0
function b_smartmail_custom_edit($options)
{
    $ts =& MyTextSanitizer::getInstance();
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsFormElementTray('', '<br />', 'options');
    $form->addElement(new XoopsFormDhtmlTextArea(_NL_MB_CONTENT, 'options[0]', htmlspecialchars($ts->stripSlashesGPC($options[0]), ENT_QUOTES), 15, 60));
    $type_select = new XoopsFormSelect(_NL_MB_CONTENTTYPE, 'options[1]', $options[1]);
    $type_select->addOption('H', _NL_MB_HTMLBLOCK);
    $type_select->addOption('S', _NL_MB_NOHTMLBLOCK);
    $form->addElement($type_select);
    return $form->render();
}
예제 #5
0
function smartobject_addto_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = '';
    $layout_select = new XoopsFormSelect(_MB_SOBJECT_BLOCKS_ADDTO_LAYOUT, 'options[]', $options[0]);
    $layout_select->addOption(0, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION0);
    $layout_select->addOption(1, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION1);
    $layout_select->addOption(2, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION2);
    $layout_select->addOption(3, _MB_SOBJECT_BLOCKS_ADDTO_LAYOUT_OPTION3);
    $form .= $layout_select->getCaption() . ' ' . $layout_select->render() . '<br />';
    return $form;
}
예제 #6
0
 function createElements($target)
 {
     if ($target->isNew()) {
         $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'title', 35, 255, $target->block->getVar('title', 'e')));
     } else {
         $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'title', 35, 255, $target->getVar('title', 'e')));
     }
     $options = $target->block->getOptions();
     if ($options) {
         $this->addElement(new XoopsFormLabel(_AM_MYTABS_OPTIONS, $options));
     }
     // DATE
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_PUBLISHDATE, 'fromdate', 15, $target->getVar('fromdate', 'e')));
     $this->addElement(new XoopsFormDateTime(_AM_MYTABS_ENDDATE, 'todate', 15, $target->getVar('todate', 'e')));
     $always_select = new XoopsFormSelect(_AM_MYTABS_ALWAYSSHOW . ":", "alwayson", $target->getVar('showalways', 'e'));
     $always_select->addOption("yes", _AM_MYTABS_ALWAYS);
     $always_select->addOption("time", _AM_MYTABS_TIMEBASED);
     $always_select->addOption("no", _AM_MYTABS_OFF);
     $this->addElement($always_select);
     $placement = new XoopsFormSelect(_AM_MYTABS_PLACEMENT . ":", "tabid", $target->getVar('tabid', 'e'));
     $tab_handler = xoops_getmodulehandler('tab');
     $tabs = $tab_handler->getObjects(new Criteria('tabpageid', $target->getVar('pageid')));
     foreach ($tabs as $tab) {
         $placement->addOption($tab->getVar('tabid'), $tab->getVar('tabtitle'));
     }
     $this->addElement($placement);
     $block_placement = new XoopsFormSelect(_AM_MYTABS_BLOCK_PLACEMENT . ":", "placement", $target->getVar('placement', 'e'));
     $block_placement->addOption("left", _AM_MYTABS_LEFT);
     $block_placement->addOption("center", _AM_MYTABS_CENTER);
     $block_placement->addOption("right", _AM_MYTABS_RIGHT);
     $this->addElement($block_placement);
     $this->addElement(new XoopsFormText(_AM_MYTABS_PRIORITY . ":", "priority", 4, 5, $target->getVar('priority', 'e')));
     $cachetime = new XoopsFormSelect(_AM_MYTABS_CACHETIME, 'pbcachetime', $target->getVar('pbcachetime', 'e'));
     $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
     $cachetime->addOptionArray($cache_options);
     $this->addElement($cachetime);
     $this->addElement(new XoopsFormRadioYN(_AM_MYTABS_CACHEBYURL, 'cachebyurl', $target->getVar('cachebyurl', 'e')));
     $note = new XoopsFormText(_AM_MYTABS_NOTE . ":", "note", 50, 255, $target->getVar('note', 'e'));
     $this->addElement($note);
     $this->addElement(new XoopsFormSelectGroup(_AM_MYTABS_GROUPS, 'groups', true, $target->getVar('groups'), 8, true));
     if (!$target->isNew()) {
         $this->addElement(new XoopsFormHidden("pageblockid", $target->getVar('pageblockid')));
     }
     $this->addElement(new XoopsFormHidden("blockid", $target->getVar('blockid')));
     $this->addElement(new XoopsFormHidden("pageid", $target->getVar('pageid')));
     $this->addElement(new XoopsFormHidden("op", "save"));
     $tray = new XoopsFormElementTray("");
     $tray->addElement(new XoopsFormButton("", "submit", _AM_MYTABS_OK, "submit"));
     $cancel = new XoopsFormButton("", "cancel", _AM_MYTABS_CANCEL, "button");
     $cancel->setExtra("onclick=\"self.location='index.php?pageid=" . $target->getVar('pageid') . "';\"");
     $tray->addElement($cancel);
     $this->addElement($tray);
 }
예제 #7
0
 /**
  * @return XoopsThemeForm
  */
 function getForm()
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('avatars/', '', $this->getVar('avatar_file', 'e'));
     }
     // Get User Config
     $config_handler =& xoops_gethandler('config');
     $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
     // New and edit form
     $form = new XoopsThemeForm(_AM_SYSTEM_AVATAR_ADD, 'avatar_form', 'admin.php', "post", true);
     $form->setExtra('enctype="multipart/form-data"');
     // Name
     $form->addElement(new XoopsFormText(_IMAGENAME, 'avatar_name', 50, 255, $this->getVar('avatar_name', 'e')), true);
     // Name description
     $maxpixel = '<div>' . _US_MAXPIXEL . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_width'] . ' x ' . $xoopsConfigUser['avatar_height'] . '</div>';
     $maxsize = '<div>' . _US_MAXIMGSZ . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_maxsize'] . '</div>';
     // Upload part
     $imgtray_img = new XoopsFormElementTray(_IMAGEFILE, '<br />');
     $imgtray_img->setDescription($maxpixel . $maxsize);
     $imageselect_img = new XoopsFormSelect(sprintf(_AM_SYSTEM_AVATAR_USE_FILE, XOOPS_UPLOAD_PATH . '/avatars/'), 'avatar_file', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH . '/avatars');
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $imageselect_img->setExtra("onchange='showImgSelected(\"xo-avatar-img\", \"avatar_file\", \"avatars\", \"\", \"" . XOOPS_UPLOAD_URL . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_UPLOAD_URL . "/avatars/" . $blank_img . "' name='image_img' id='xo-avatar-img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_AVATAR_UPLOAD, 'avatar_file', 500000), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     // Weight
     $form->addElement(new XoopsFormText(_IMGWEIGHT, 'avatar_weight', 3, 4, $this->getVar('avatar_weight', 'e')));
     // Display
     $form->addElement(new XoopsFormRadioYN(_IMGDISPLAY, 'avatar_display', $this->getVar('avatar_display', 'e'), _YES, _NO));
     // Hidden
     if ($this->isNew()) {
         $form->addElement(new XoopsFormHidden('avatar_type', 's'));
     }
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormHidden('fct', 'avatars'));
     $form->addElement(new XoopsFormHidden('avatar_id', $this->getVar('avatar_id', 'e')));
     // Button
     $form->addElement(new XoopsFormButton('', 'avt_button', _SUBMIT, 'submit'));
     return $form;
 }
예제 #8
0
 function getForm($action = false)
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('ranks/', '', $this->getVar('rank_image', 'e'));
     }
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_SYSTEM_USERRANK_ADD) : sprintf(_AM_SYSTEM_USERRANK_EDIT);
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_SYSTEM_USERRANK_TITLE, 'rank_title', 50, 50, $this->getVar('rank_title'), true));
     $form->addElement(new XoopsFormText(_AM_SYSTEM_USERRANK_MINPOST, 'rank_min', 10, 10, $this->getVar('rank_min')));
     $form->addElement(new XoopsFormText(_AM_SYSTEM_USERRANK_MAXPOST, 'rank_max', 10, 10, $this->getVar('rank_max')));
     $imgtray_img = new XoopsFormElementTray(_AM_SYSTEM_USERRANK_IMAGE, '<br />');
     $imgpath_img = sprintf(_AM_SYSTEM_USERRANK_IMAGE_PATH, XOOPS_UPLOAD_PATH . '/ranks/');
     $imageselect_img = new XoopsFormSelect($imgpath_img, 'rank_image', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH . '/ranks');
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $imageselect_img->setExtra("onchange='showImgSelected(\"xo-ranks-img\", \"rank_image\", \"ranks\", \"\", \"" . XOOPS_UPLOAD_URL . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_UPLOAD_URL . "/ranks/" . $blank_img . "' name='image_img' id='xo-ranks-img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_USERRANK_UPLOAD, 'rank_image', 500000), false);
     $fileseltray_img->addElement(new XoopsFormLabel(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     if (!$this->isNew()) {
         $rank_special = $this->getVar('rank_special');
     } else {
         $rank_special = 0;
     }
     $special_tray = new XoopsFormElementTray(_AM_SYSTEM_USERRANK_SPECIAL, '<br />');
     $special_tray->setDescription(_AM_SYSTEM_USERRANK_SPECIAL_CAN);
     $special_tray->addElement(new XoopsFormRadioYN('', 'rank_special', $rank_special));
     $form->addElement($special_tray);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('rank_id', $this->getVar('rank_id')));
     }
     $form->addElement(new XoopsFormHidden('op', 'userrank_save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
예제 #9
0
 /**
  * Constructor
  * 
  * @param	string	$caption	
  * @param	string	$name
  * @param	mixed	$value	    	Pre-selected value (or array of them).
  *									For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param	bool	$include_anon	Include user "anonymous"?
  * @param	int		$size	        Number or rows. "1" makes a drop-down-list.
  * @param	bool    $multiple       Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $value = array(), $include_anon = false, $size = 1, $multiple = false)
 {
     $this->XoopsFormElementTray($caption, "<br /><br />", $name);
     $select_form = new XoopsFormSelect("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_form->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $criteria = new CriteriaCompo();
     if (!is_array($value)) {
         $value = array($value);
     }
     if (is_array($value) && count($value) > 0) {
         $id_in = "(" . implode(",", $value) . ")";
         $criteria->add(new Criteria("uid", $id_in, "IN"));
         $criteria->setSort('name');
         $criteria->setOrder('ASC');
         $users = $member_handler->getUserList($criteria);
         $select_form->addOptionArray($member_handler->getUserList($criteria));
     }
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/system/include/userselect.php?action=1&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _LIST . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/system/include/userselect.php?action=0&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _SEARCH . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='var sel = xoopsGetElementById(\"" . $name . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (sel.options[i].selected) {sel.options[i] = null;}}'>" . _REMOVE . "</a>" . "<script type=\"text/javascript\">\n\t\t    function addusers(opts){\n\t\t\t    var num = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n        \t\tvar sel = xoopsGetElementById(\"" . $name . "\");\n\t\t\t    var arr = new Array(num);\n\t\t\t    for(var n=0; n<num; n++){\n\t\t\t    \tvar nm = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    \topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n\t\t\t    \tvar val = opts.substring(0, opts.indexOf(\":\"));\n\t\t\t    \topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\n\t\t\t    \tvar txt = opts.substring(0, nm - val.length);\n\t\t\t    \topts = opts.substring(nm - val.length, opts.length);\n\t\t\t\t\tvar added = false;\n\t\t\t\t\tfor (var k = 0; k < sel.options.length; k++) {\n\t\t\t\t\t\tif(sel.options[k].value == val){\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added==false){\n\t\t\t\t\t\tappendSelectOption(\"" . $name . "\",txt, val);\n\t        \t\t}\n\t\t\t    }\n\t\t\t\treturn true;\n\t\t    }\n\t\t\t</script>"));
     $this->addElement($select_form);
     $this->addElement($action_tray);
 }
예제 #10
0
 /**
  * Constructor
  *
  * @param string $caption
  * @param string $name
  * @param mixed $value Pre-selected value (or array of them).
  *                                                 For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param bool $include_anon Include user "anonymous"?
  * @param int $size Number or rows. "1" makes a drop-down-list.
  * @param bool $multiple Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new XoopsFormSelect('', $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS['xoopsConfig']['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         $this->XoopsFormElementTray($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage('findusers');
     $js_addusers = "<script type='text/javascript'>\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(':'));\r\n                opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                var sel = xoopsGetElementById('" . $name . "');\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&amp;multiple=' . $multiple . '&amp;token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers));
     $this->XoopsFormElementTray($caption, '<br /><br />', $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
예제 #11
0
파일: brand.php 프로젝트: RanLee/Xoops_demo
 function brandForm($action = false)
 {
     global $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $country_handler = xoops_getmodulehandler('country', 'catalog');
     $title = $this->isNew() ? _AM_CATALOG_ADDBRAND : _AM_CATALOG_UPDATEBRAND;
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_CATALOG_BRANDNAME, 'brand_name', 60, 255, $this->getVar('brand_name')), true);
     $countys =& $country_handler->getList();
     $county_select = new XoopsFormSelect(_AM_CATALOG_CHOICECOUNTRY, "country_id", $this->getVar("country_id"));
     $county_select->addOption('', _AM_CATALOG_CHOICE);
     $county_select->addOptionArray($countys);
     $form->addElement($county_select);
     $configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '150px', 'value' => $this->getVar('brand_description'));
     $form->addElement(new XoopsFormEditor(_AM_CATALOG_BRANDDESC, 'brand_description', $configs, $nohtml = false, $OnFailure = ""));
     if ($this->isNew()) {
         $form->addElement(new XoopsFormHidden('brand_published', time()));
     }
     $form->addElement(new XoopsFormHidden('brand_id', $this->getVar('brand_id')));
     $form->addElement(new XoopsFormHidden('ac', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
예제 #12
0
파일: blocks.php 프로젝트: yunsite/xoopsdc
function links_block_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/links/include/xoopsformloader.php";
    $form = new XoopsBlockForm("", "", "");
    $categories = new XoopsFormSelect(_MB_LINKS_SHOWCAT, 'options[0]', $options[0]);
    $categories->addOption(0, _MB_LINKS_ALL);
    $cat_handler = xoops_getmodulehandler('category', 'links');
    $criteria = new CriteriaCompo();
    $criteria->setSort('cat_order');
    $criteria->setOrder('ASC');
    $category = $cat_handler->getList($criteria);
    foreach ($cat_handler->getList($criteria) as $k => $v) {
        $categories->addOption($k, $v);
    }
    $form->addElement($categories, true);
    $sort = new XoopsFormSelect(_MB_LINKS_SORTWAY, 'options[1]', $options[1]);
    $sort->addOption('published', _MB_LINKS_PUBLISHTIME);
    $sort->addOption('datetime', _MB_LINKS_UPDATETIME);
    $sort->addOption('link_order', _MB_LINKS_DEFAULT);
    $form->addElement($sort, true);
    $form->addElement(new XoopsFormText(_MB_LINKS_SHOWHOWLIK, "options[2]", 5, 2, $options[2]), true);
    $form->addElement(new XoopsFormText(_MB_LINKS_LIKTITLEMAX, "options[3]", 5, 2, $options[3]), true);
    $form->addElement(new XoopsFormRadioYN(_MB_LINKS_SHOWCATTITLE, 'options[4]', $options[4]), true);
    $display = new XoopsFormSelect(_MB_LINKS_BYSHOW, 'options[5]', $options[5]);
    $display->addOption('1', _MB_LINKS_LOGOHOR);
    $display->addOption('2', _MB_LINKS_LOGOVER);
    $display->addOption('3', _MB_LINKS_TITLEHOR);
    $display->addOption('4', _MB_LINKS_TITLEVER);
    $form->addElement($display, true);
    return $form->render();
}
예제 #13
0
 /**
  * @param bool $action
  *
  * @return XoopsThemeForm
  */
 function getForm($action = false)
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('smilies/', '', $this->getVar('smile_url', 'e'));
     }
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_SYSTEM_SMILIES_ADD) : sprintf(_AM_SYSTEM_SMILIES_EDIT);
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_AM_SYSTEM_SMILIES_CODE, 'code', 26, 25, $this->getVar('code')), true);
     $form->addElement(new XoopsFormText(_AM_SYSTEM_SMILIES_DESCRIPTION, 'emotion', 50, 50, $this->getVar('emotion')), true);
     $imgtray_img = new XoopsFormElementTray(_AM_SYSTEM_SMILIES_FILE, '<br />');
     $imgpath_img = sprintf(_AM_SYSTEM_SMILIES_IMAGE_PATH, XOOPS_UPLOAD_PATH . '/smilies/');
     $imageselect_img = new XoopsFormSelect($imgpath_img, 'smile_url', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH . '/smilies');
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $imageselect_img->setExtra('onchange="showImgSelected(\'xo-smilies-img\', \'smile_url\', \'smilies\', \'\', \'' . XOOPS_UPLOAD_URL . '\' )"');
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_UPLOAD_URL . "/smilies/" . $blank_img . "' name='image_img' id='xo-smilies-img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br />', '<br /><br />');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_SMILIES_UPLOADS, 'smile_url', 500000), false);
     $fileseltray_img->addElement(new XoopsFormLabel(''), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('smilies_id', $this->getVar('id')));
         $display = $this->getVar('display');
     } else {
         $display = 0;
     }
     $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_SMILIES_OFF, 'display', $display));
     $form->addElement(new XoopsFormHidden('op', 'save_smilie'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
예제 #14
0
 function createElements($target)
 {
     //        $plugin->doConfig($form);
     $this->addElement(new XoopsFormText(_SMARTBLOCKS_TITLE, 'title', 35, 255, $target->getVar('title', 'e')));
     $options = $target->block->getOptions();
     if ($options) {
         $this->addElement(new XoopsFormLabel(_SMARTBLOCKS_OPTIONS, $options));
     }
     // DATE
     $this->addElement(new XoopsFormDateTime(_SMARTBLOCKS_PUBLISHDATE, 'fromdate', 15, $target->getVar('fromdate', 'e')));
     $this->addElement(new XoopsFormDateTime(_SMARTBLOCKS_ENDDATE, 'todate', 15, $target->getVar('todate', 'e')));
     $always_select = new XoopsFormSelect(_SMARTBLOCKS_ALWAYSSHOW . ":", "alwayson", $target->getVar('showalways', 'e'));
     $always_select->addOption("yes", _SMARTBLOCKS_ALWAYS);
     $always_select->addOption("time", _SMARTBLOCKS_TIMEBASED);
     $always_select->addOption("no", _SMARTBLOCKS_OFF);
     $this->addElement($always_select);
     $placement = new XoopsFormSelect(_SMARTBLOCKS_PLACEMENT . ":", "placement", $target->getVar('placement', 'e'));
     $placement->addOption(1, _SMARTBLOCKS_LEFT);
     $placement->addOption(2, _SMARTBLOCKS_RIGHT);
     $placement->addOption(3, _SMARTBLOCKS_CENTER);
     $placement->addOption(4, _SMARTBLOCKS_CENTER_LEFT);
     $placement->addOption(5, _SMARTBLOCKS_CENTER_RIGHT);
     $placement->addOption(6, _SMARTBLOCKS_BCENTER);
     $placement->addOption(7, _SMARTBLOCKS_BCENTER_LEFT);
     $placement->addOption(8, _SMARTBLOCKS_BCENTER_RIGHT);
     $this->addElement($placement);
     $this->addElement(new XoopsFormText(_SMARTBLOCKS_PRIORITY . ":", "priority", 4, 5, $target->getVar('priority', 'e')));
     $falldown =& new XoopsFormCheckBox(_SMARTBLOCKS_FALLDOWN . ":", "falldown", $target->getVar('falldown', 'e'));
     $falldown->addOption(1, _YES);
     $this->addElement($falldown);
     $cachetime = new XoopsFormSelect(_SMARTBLOCKS_CACHETIME, 'pbcachetime', $target->getVar('pbcachetime', 'e'));
     $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
     $cachetime->addOptionArray($cache_options);
     $this->addElement($cachetime);
     $this->addElement(new XoopsFormRadioYN(_SMARTBLOCKS_CACHEBYURL, 'cachebyurl', $target->getVar('cachebyurl', 'e')));
     $note =& new XoopsFormText(_SMARTBLOCKS_NOTE . ":", "note", 50, 255, $target->getVar('note', 'e'));
     $this->addElement($note);
     $this->addElement(new XoopsFormSelectGroup(_SMARTBLOCKS_GROUPS, 'groups', true, $target->getVar('groups'), 8, true));
     if ($target->isNew()) {
         $this->addElement(new XoopsFormHidden("blockid", $target->block->getVar('bid')));
         $this->addElement(new XoopsFormHidden("moduleid", $target->getVar('moduleid')));
         $this->addElement(new XoopsFormHidden("location", $target->getVar('location')));
     }
     $this->addElement(new XoopsFormHidden("pageblockid", $target->getVar('pageblockid')));
     $this->addElement(new XoopsFormHidden("op", "save"));
     $tray =& new XoopsFormElementTray("");
     $tray->addElement(new XoopsFormButton("", "submit", _SMARTBLOCKS_OK, "submit"));
     $cancel =& new XoopsFormButton("", "cancel", _SMARTBLOCKS_CANCEL, "button");
     $cancel->setExtra("onclick=\"self.location='page.php?location=" . $target->getVar('location') . "&moduleid=" . $target->getVar('moduleid') . "';\"");
     $tray->addElement($cancel);
     $this->addElement($tray);
 }
예제 #15
0
function b_ams_author_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $form = new XoopsFormElementTray('', '<br/>');
    $sort_select = new XoopsFormSelect(_AMS_MB_NEWS_ORDER, 'options[0]', $options[0]);
    $sort_select->addOption('count', _AMS_MB_NEWS_ARTCOUNT);
    $sort_select->addOption('read', _AMS_MB_NEWS_HITS);
    $sort_select->addOption('rating', _AMS_MB_NEWS_RATING);
    $form->addElement($sort_select);
    $form->addElement(new XoopsFormText(_AMS_MB_NEWS_DISP, 'options[1]', 20, 15, $options[1]));
    $name_select = new XoopsFormSelect(_AMS_MB_NEWS_DISPLAYNAME, 'options[2]', $options[2]);
    $name_select->addOption('uname', _AMS_MB_NEWS_USERNAME);
    $name_select->addOption('name', _AMS_MB_NEWS_REALNAME);
    $form->addElement($name_select);
    $average_select = new XoopsFormSelect(_AMS_MB_NEWS_COMPUTING, 'options[3]', $options[3]);
    $average_select->addOption('average', _AMS_MB_NEWS_AVERAGE);
    $average_select->addOption('total', _AMS_MB_NEWS_TOTAL);
    $form->addElement($average_select);
    return $form->render();
}
예제 #16
0
 /**
  * @return XoopsThemeForm
  */
 public function getForm()
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = $this->getVar('avatar_file', 'e');
     }
     // Get User Config
     $config_handler = xoops_getHandler('config');
     $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
     $form = new XoopsThemeForm(_AM_SYSTEM_AVATAR_ADD, 'avatar_form', 'admin.php', 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormText(_IMAGENAME, 'avatar_name', 50, 255, $this->getVar('avatar_name', 'e')), true);
     $maxpixel = '<div class="small basic italic">' . _US_MAXPIXEL . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_width'] . ' x ' . $xoopsConfigUser['avatar_height'] . '</div>';
     $maxsize = '<div class="small basic italic">' . _US_MAXIMGSZ . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_maxsize'] . '</div>';
     $uploadirectory_img = '';
     $imgtray_img = new XoopsFormElementTray(_IMAGEFILE . '<br><br>' . $maxpixel . $maxsize, '<br>');
     $imageselect_img = new XoopsFormSelect(sprintf(_AM_SYSTEM_AVATAR_USE_FILE, XOOPS_UPLOAD_PATH), 'avatar_file', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH);
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         //            if (preg_match('#avt#', $image_img)) {
         if (false !== strpos(image_img, 'avt')) {
             $imageselect_img->addOption("{$image_img}", $image_img);
         }
     }
     $imageselect_img->setExtra("onchange='showImgSelected(\"image_img\", \"avatar_file\", \"" . $uploadirectory_img . "\", \"\", \"" . XOOPS_UPLOAD_URL . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br><img src='" . XOOPS_UPLOAD_URL . '/' . $blank_img . "' name='image_img' id='image_img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br>', '<br><br>');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_AVATAR_UPLOAD, 'avatar_file', 500000), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     $form->addElement(new XoopsFormText(_IMGWEIGHT, 'avatar_weight', 3, 4, $this->getVar('avatar_weight', 'e')));
     $form->addElement(new XoopsFormRadioYN(_IMGDISPLAY, 'avatar_display', $this->getVar('avatar_display', 'e'), _YES, _NO));
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormHidden('fct', 'avatars'));
     $form->addElement(new XoopsFormHidden('avatar_id', $this->getVar('avatar_id', 'e')));
     $form->addElement(new XoopsFormButton('', 'avt_button', _SUBMIT, 'submit'));
     return $form;
 }
예제 #17
0
파일: blocks.php 프로젝트: yunsite/xoopsdc
function resources_resource_edit($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/resources/include/xoopsformloader.php";
    $form = new XoopsBlockForm("", "", "");
    $categories = new XoopsFormSelect('资源分类', 'options[0]', $options[0]);
    $categories->addOption(0, '全部');
    $category_handler =& xoops_getmodulehandler('category', 'resources');
    $criteria = new CriteriaCompo();
    $criteria->setSort('cat_weight');
    $criteria->setOrder('ASC');
    $category = $category_handler->getList($criteria);
    foreach ($category as $k => $v) {
        $categories->addOption($k, $v);
    }
    $form->addElement($categories, true);
    $sort = new XoopsFormSelect('显示顺序', 'options[1]', $options[1]);
    $sort->addOption('res_weight', '按照资源排序');
    $sort->addOption('update_time', '按照更新时间');
    $form->addElement($sort, true);
    $form->addElement(new XoopsFormText('显示前几条资源', "options[2]", 5, 2, $options[2]), true);
    return $form->render();
}
예제 #18
0
 /**
  * @param bool $action
  * @return XoopsThemeForm
  */
 public function getForm($action = false)
 {
     global $xoopsDB, $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_PRESENTER_CAT_ADD) : sprintf(_AM_PRESENTER_CAT_EDIT);
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     // Cat_pid
     include_once XOOPS_ROOT_PATH . '/class/tree.php';
     $categoriesHandler =& xoops_getModuleHandler('categories', 'presenter');
     $criteria = new CriteriaCompo();
     $categories = $categoriesHandler->getObjects($criteria);
     if ($categories) {
         $categories_tree = new XoopsObjectTree($categories, 'cat_id', 'cat_pid');
         $cat_pid = $categories_tree->makeSelBox('cat_pid', 'cat_title', '--', $this->getVar('cat_pid', 'e'), false);
         $form->addElement(new XoopsFormLabel(_AM_PRESENTER_CAT_PID, $cat_pid));
     }
     // Cat_title
     $form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_TITLE, 'cat_title', 50, 255, $this->getVar('cat_title')), true);
     // Cat_desc
     $form->addElement(new XoopsFormTextArea(_AM_PRESENTER_CAT_DESC, 'cat_desc', $this->getVar('cat_desc'), 4, 47), true);
     // Cat_image
     $cat_image = $this->getVar('cat_image') ? $this->getVar('cat_image') : 'blank.gif';
     $uploadir = '/uploads/presenter/images/categories';
     $imgtray = new XoopsFormElementTray(_AM_PRESENTER_CAT_IMAGE, '<br />');
     $imgpath = sprintf(_AM_PRESENTER_FORMIMAGE_PATH, $uploadir);
     $imageselect = new XoopsFormSelect($imgpath, 'cat_image', $cat_image);
     $image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadir);
     foreach ($image_array as $image) {
         $imageselect->addOption("{$image}", $image);
     }
     $imageselect->setExtra("onchange='showImgSelected(\"image_cat_image\", \"cat_image\", \"" . $uploadir . "\", \"\", \"" . XOOPS_URL . "\")'");
     $imgtray->addElement($imageselect);
     $imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadir . "/" . $cat_image . "' name='image_cat_image' id='image_cat_image' alt='' />"));
     $fileseltray = new XoopsFormElementTray('', '<br />');
     $fileseltray->addElement(new XoopsFormFile(_AM_PRESENTER_FORMUPLOAD, 'cat_image', $xoopsModuleConfig['maxsize']));
     $fileseltray->addElement(new XoopsFormLabel(''));
     $imgtray->addElement($fileseltray);
     $form->addElement($imgtray);
     // Cat_weight
     $form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_WEIGHT, 'cat_weight', 50, 255, $this->getVar('cat_weight')), false);
     // Cat_color
     //      $form->addElement(new XoopsFormColorPicker(_AM_PRESENTER_CAT_COLOR, 'cat_color', $this->getVar('cat_color')), false);
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
 function XoopsFormSelectTime($caption, $name, $value = 0, $format = "%y-%m-%d %h:%i")
 {
     $value = intval($value);
     if (empty($value)) {
         $time = time();
         $this->year = formatTimestamp($time, 'Y');
         $this->month = formatTimestamp($time, 'n');
         $this->day = formatTimestamp($time, 'd');
         $this->hour = formatTimestamp($time, 'H');
         $this->min = formatTimestamp($time, 'i');
         $this->sec = date('s', $time);
     } else {
         $this->year = formatTimestamp($value, 'Y');
         $this->month = formatTimestamp($value, 'n');
         $this->day = formatTimestamp($value, 'd');
         $this->hour = formatTimestamp($value, 'H');
         $this->min = formatTimestamp($value, 'i');
         $this->sec = date('s', $value);
     }
     $this->XoopsFormElementTray($caption, '');
     $thsy = date('Y');
     $year_select = new XoopsFormSelect('', $name . '[year]', $this->year);
     //		$year_select  ->addOptionArray(array($thsy-8=>$thsy-8, $thsy-7, $thsy-6, $thsy-5, $thsy-4, $thsy-3, $thsy-2, $thsy-1, $thsy, $thsy+1));
     for ($y = 1970; $y < 2038; $y++) {
         $year_select->addOption($y, $y);
     }
     // GIJ
     $month_select = new XoopsFormSelect('', $name . '[month]', $this->month);
     $month_select->addOptionArray(array(1 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
     $day_select = new XoopsFormSelect('', $name . '[day]', $this->day);
     $day_select->addOptionArray(array(1 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31));
     $hour_select = new XoopsFormSelect('', $name . '[hour]', $this->hour);
     $hour_select->addOptionArray(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
     $sixty_option = array();
     for ($i = 0; $i < 60; $i++) {
         $sixty_option[] = $i;
     }
     $min_select = new XoopsFormSelect('', $name . '[min]', $this->min);
     $min_select->addOptionArray($sixty_option);
     $sec_select = new XoopsFormSelect('', $name . '[sec]', $this->sec);
     $sec_select->addOptionArray($sixty_option);
     $format = preg_replace('/%y/i', $year_select->render(), $format);
     $format = preg_replace('/%m/i', $month_select->render(), $format);
     $format = preg_replace('/%d/i', $day_select->render(), $format);
     $format = preg_replace('/%h/i', $hour_select->render(), $format);
     $format = preg_replace('/%i/i', $min_select->render(), $format);
     $format = preg_replace('/%s/i', $sec_select->render(), $format);
     $base_label = new XoopsFormLabel('', $format);
     $this->addElement($base_label);
 }
예제 #20
0
파일: blocks.php 프로젝트: yunsite/xoopsdc
function press_block_news_edit($options)
{
    global $GLOBALS;
    include_once XOOPS_ROOT_PATH . "/modules/press/include/xoopsformloader.php";
    $category_handler =& xoops_getmodulehandler("category", "press");
    $form = new XoopsBlockForm("", "", "");
    $form_select = new XoopsFormSelect("catgory", "options[0]", $options[0]);
    $form_select->addOption(0, _ALL);
    $form_select->addOptionArray($category_handler->getList());
    $form->addElement($form_select);
    $form->addElement(new XoopsFormText("show", "options[1]", 5, 2, $options[1]));
    $form->render();
    return $form->render();
}
예제 #21
0
 /**
  * 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_NEWSLETTERRULE;
     }
     $form = new XoopsThemeForm($title, 'form', $action);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('id', $this->getVar('rule_id')));
     }
     $newsletter_select = new XoopsFormSelect(_NL_AM_NEWSLETTER, 'newsletterid', $this->getVar('newsletterid'));
     $smartmail_newsletter_handler = xoops_getmodulehandler('newsletter');
     $newsletter_select->addOptionArray($smartmail_newsletter_handler->getList());
     $form->addElement($newsletter_select);
     if (file_exists(XOOPS_ROOT_PATH . "/language/" . $GLOBALS['xoopsConfig']['language'] . "/calendar.php")) {
         include_once XOOPS_ROOT_PATH . "/language/" . $GLOBALS['xoopsConfig']['language'] . "/calendar.php";
     } else {
         include_once XOOPS_ROOT_PATH . "/language/english/calendar.php";
     }
     $weekday_select = new XoopsFormSelect(_NL_AM_WEEKDAY, 'rule_weekday', $this->getVar('rule_weekday', 'e'));
     $weekday_select->addOption(0, _NL_AM_EVERYDAY);
     $weekday_select->addOption(1, _CAL_MONDAY);
     $weekday_select->addOption(2, _CAL_TUESDAY);
     $weekday_select->addOption(3, _CAL_WEDNESDAY);
     $weekday_select->addOption(4, _CAL_THURSDAY);
     $weekday_select->addOption(5, _CAL_FRIDAY);
     $weekday_select->addOption(6, _CAL_SATURDAY);
     $weekday_select->addOption(7, _CAL_SUNDAY);
     $form->addElement($weekday_select);
     $form->addElement(new XoopsFormText(_NL_AM_TIMEOFDAY, 'rule_timeofday', 6, 6, $this->getVar('rule_timeofday', 'e')));
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'submit', _ADD . " " . _NL_AM_NEWSLETTERRULE, 'submit'));
     return $form;
 }
 function _b_wp_authors_edit($options)
 {
     require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $optForm = new XoopsSimpleForm('Block Option Dummy Form', 'optionform', '');
     $optForm->addElement(new XoopsFormRadioYN('Listing with count:', 'options[0]', $options[0]));
     $optFormNameType = new XoopsFormSelect('Name Option:', 'options[1]', $options[1]);
     $optFormNameType->addOption('nickname', 'Nick Name');
     $optFormNameType->addOption('login', 'Login Name');
     $optFormNameType->addOption('firstname', 'First Name');
     $optFormNameType->addOption('lastname', 'Last Name');
     $optFormNameType->addOption('namefl', 'Full Name (First Last)');
     $optFormNameType->addOption('namelf', 'Full Name (Last First)');
     $optForm->addElement($optFormNameType);
     $optForm->addElement(new XoopsFormRadioYN('Show RSS2 feed icon:', 'options[2]', $options[2]));
     $_wpTpl =& new WordPresTpl('theme');
     $optForm->assign($_wpTpl);
     return $_wpTpl->fetch('wp_block_edit.html');
 }
예제 #23
0
function setup_package($dirname)
{
    $pkgs = new PackageList();
    $pkgs->load();
    $pkg = $pkgs->getVar($dirname);
    if (empty($pkg)) {
        $pkg = $pkgs->selectPackage($dirname);
    }
    $pname = $pkg ? $pkg['pname'] : _AM_PKG_NOCURRENT;
    // current package-name
    if ($dirname) {
        $modversion = get_modversion($dirname);
        if (empty($modversion)) {
            return;
        }
        // illigal dirname?
        $title = $modversion['name'] . " ({$dirname})";
    } else {
        $title = XOOPS_VERSION;
    }
    echo "<h1>" . htmlspecialchars($title) . "</h1>\n";
    echo "<table class='outer' border='0' cellspacing='1'>\n";
    $n = 0;
    $form = new XoopsThemeForm(_AM_REG_DETAIL, "CustomForm", 'pkgadmin.php');
    $form->addElement(new XoopsFormHidden('dirname', $dirname));
    $form->addElement(new XoopsFormLabel(_AM_PKG_NAME, $pkg['name']));
    $form->addElement(new XoopsFormLabel(_AM_PKG_DIRNAME, $dirname));
    $form->addElement(new XoopsFormLabel(_AM_PKG_CURRENT_PNAME, $pname));
    $select = new XoopsFormSelect(_AM_PKG_PNAME, 'pname');
    foreach ($pkgs->getAllPackages() as $pn => $apkg) {
        $select->addOption($pn);
    }
    $select->setValue($pname);
    $form->addElement($select);
    $form->addElement(new XoopsFormButton("", "custom", _AM_REG_SUBMIT, "submit"));
    echo $form->render();
}
예제 #24
0
 function NewbbFormSelectUser($caption, $name, $value = array(), $include_anon = false, $size = 10, $multiple = true)
 {
     $this->XoopsFormElementTray($caption, "<br /><br />", $name);
     $select_form = new XoopsFormSelect("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_form->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $criteria = new CriteriaCompo();
     if (is_array($value) && count($value) > 0) {
         $id_in = "(" . implode(",", $value) . ")";
         $criteria->add(new Criteria("uid", $id_in, "IN"));
         $criteria->setSort('uname');
         $criteria->setOrder('ASC');
         $users = $member_handler->getUserList($criteria);
         $select_form->addOptionArray($member_handler->getUserList($criteria));
     }
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/newbb/include/userselect.php?action=1&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _LIST . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='return openWithSelfMain(\"" . XOOPS_URL . "/modules/newbb/include/userselect.php?action=0&amp;target=" . $name . "&amp;multiple=" . $multiple . "\", \"userselect\", 800, 500, null);' >" . _SEARCH . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='var sel = document.getElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\tsel.options.length = 0;' >" . _CLEAR . "</a>"));
     $this->addElement($select_form);
     $this->addElement($action_tray);
 }
예제 #25
0
function formVote($session)
{
    $cform = new XoopsThemeForm(_VSP_FRM_VOTE_FORM, 'vote');
    $cform->setExtra('enctype="multipart/form-data"');
    $votesel = new XoopsFormSelect(_VSP_FRM_VOTE_STARS, 'stars', 0, 10);
    $votesel->addOption('10', '10 Stars');
    $votesel->addOption('9', '9 Stars');
    $votesel->addOption('8', '8 Stars');
    $votesel->addOption('7', '7 Stars');
    $votesel->addOption('6', '6 Stars');
    $votesel->addOption('5', '5 Stars');
    $votesel->addOption('4', '4 Stars');
    $votesel->addOption('3', '3 Stars');
    $votesel->addOption('2', '2 Stars');
    $votesel->addOption('1', '1 Stars');
    $cform->addElement($votesel);
    $cform->addElement(new XoopsFormHidden('op', 'vote'));
    $cform->addElement(new XoopsFormHidden('id', $session['id']));
    $cform->addElement(new XoopsFormHidden('ip', $session['ip']));
    $cform->addElement(new XoopsFormHidden('addy', $session['addy']));
    $cform->addElement(new XoopsFormButton('', 'contents_submit', _SUBMIT, "submit"));
    return $cform->render();
}
예제 #26
0
    redirect_header("index.php", 4, _NW_POST_SORRY);
    exit;
}
include_once XOOPS_ROOT_PATH . "/class/tree.php";
$allTopics = $xt->getAllTopics($xoopsModuleConfig['restrictindex'], 'news_submit');
$topic_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
$topic_select = $topic_tree->makeSelBox('topic_id', 'topic_title', '-- ', $topicid, false);
$sform->addElement(new XoopsFormLabel(_NW_TOPIC, $topic_select));
//If admin - show admin form
//TODO: Change to "If submit privilege"
if ($approveprivilege) {
    //Show topic image?
    $sform->addElement(new XoopsFormRadioYN(_AM_TOPICDISPLAY, 'topicdisplay', $topicdisplay));
    //Select image position
    $posselect = new XoopsFormSelect(_AM_TOPICALIGN, 'topicalign', $topicalign);
    $posselect->addOption('R', _AM_RIGHT);
    $posselect->addOption('L', _AM_LEFT);
    $sform->addElement($posselect);
    //Publish in home?
    //TODO: Check that pubinhome is 0 = no and 1 = yes (currently vice versa)
    $sform->addElement(new XoopsFormRadioYN(_AM_PUBINHOME, 'ihome', $ihome, _NO, _YES));
}
// News author
if ($approveprivilege && is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
    if (!isset($newsauthor)) {
        $newsauthor = $xoopsUser->getVar('uid');
    }
    $member_handler =& xoops_gethandler('member');
    $usercount = $member_handler->getUserCount();
    if ($usercount < $cfg['config_max_users_list']) {
        $sform->addElement(new XoopsFormSelectUser(_NW_AUTHOR, 'author', true, $newsauthor), false);
예제 #27
0
/**
 * @param        $add_or_edit
 * @param string $user
 */
function form_user($add_or_edit, $user = '')
{
    global $xoopsConfig, $xoopsUser;
    $uid = system_CleanVars($_REQUEST, 'uid', 0);
    //RMV-NOTIFY
    include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/notification.php';
    include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
    if ($add_or_edit === true) {
        //Add user
        $uid_value = '';
        $uname_value = '';
        $name_value = '';
        $email_value = '';
        $email_cbox_value = 0;
        $url_value = '';
        $timezone_value = $xoopsConfig['default_TZ'];
        $icq_value = '';
        $aim_value = '';
        $yim_value = '';
        $msnm_value = '';
        $location_value = '';
        $occ_value = '';
        $interest_value = '';
        $sig_value = '';
        $sig_cbox_value = 0;
        $umode_value = $xoopsConfig['com_mode'];
        $uorder_value = $xoopsConfig['com_order'];
        // RMV-NOTIFY
        $notify_method_value = XOOPS_NOTIFICATION_METHOD_PM;
        $notify_mode_value = XOOPS_NOTIFICATION_MODE_SENDALWAYS;
        $bio_value = '';
        $rank_value = 0;
        $mailok_value = 0;
        $form_title = _AM_SYSTEM_USERS_ADDUSER;
        $form_isedit = false;
        $groups = array(XOOPS_GROUP_USERS);
    } else {
        //Edit user
        $member_handler = xoops_getHandler('member');
        $user = $member_handler->getUser($uid);
        if (is_object($user)) {
            $uid_value = $uid;
            $uname_value = $user->getVar('uname', 'E');
            $name_value = $user->getVar('name', 'E');
            $email_value = $user->getVar('email', 'E');
            $email_cbox_value = $user->getVar('user_viewemail') ? 1 : 0;
            $url_value = $user->getVar('url', 'E');
            $temp = $user->getVar('theme');
            $timezone_value = $user->getVar('timezone_offset');
            $icq_value = $user->getVar('user_icq', 'E');
            $aim_value = $user->getVar('user_aim', 'E');
            $yim_value = $user->getVar('user_yim', 'E');
            $msnm_value = $user->getVar('user_msnm', 'E');
            $location_value = $user->getVar('user_from', 'E');
            $occ_value = $user->getVar('user_occ', 'E');
            $interest_value = $user->getVar('user_intrest', 'E');
            $sig_value = $user->getVar('user_sig', 'E');
            $sig_cbox_value = $user->getVar('attachsig') == 1 ? 1 : 0;
            $umode_value = $user->getVar('umode');
            $uorder_value = $user->getVar('uorder');
            // RMV-NOTIFY
            $notify_method_value = $user->getVar('notify_method');
            $notify_mode_value = $user->getVar('notify_mode');
            $bio_value = $user->getVar('bio', 'E');
            $rank_value = $user->rank(false);
            $mailok_value = $user->getVar('user_mailok', 'E');
            $form_title = _AM_SYSTEM_USERS_UPDATEUSER . ': ' . $user->getVar('uname');
            $form_isedit = true;
            $groups = array_values($user->getGroups());
        }
    }
    //Affichage du formulaire
    $form = new XoopsThemeForm($form_title, 'form_user', 'admin.php', 'post', true);
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_NICKNAME, 'username', 25, 25, $uname_value), true);
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_NAME, 'name', 30, 60, $name_value));
    $email_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_EMAIL, '<br>');
    $email_text = new XoopsFormText('', 'email', 30, 60, $email_value);
    $email_tray->addElement($email_text, true);
    $email_cbox = new XoopsFormCheckBox('', 'user_viewemail', $email_cbox_value);
    $email_cbox->addOption(1, _AM_SYSTEM_USERS_AOUTVTEAD);
    $email_tray->addElement($email_cbox);
    $form->addElement($email_tray, true);
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_URL, 'url', 30, 100, $url_value));
    $form->addElement(new XoopsFormSelectTimezone(_AM_SYSTEM_USERS_TIMEZONE, 'timezone_offset', $timezone_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_ICQ, 'user_icq', 15, 15, $icq_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_AIM, 'user_aim', 18, 18, $aim_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_YIM, 'user_yim', 25, 25, $yim_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_MSNM, 'user_msnm', 30, 100, $msnm_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_LOCATION, 'user_from', 30, 100, $location_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_OCCUPATION, 'user_occ', 30, 100, $occ_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_INTEREST, 'user_intrest', 30, 150, $interest_value));
    $sig_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_SIGNATURE, '<br>');
    $sig_tarea = new XoopsFormTextArea('', 'user_sig', $sig_value);
    $sig_tray->addElement($sig_tarea);
    $sig_cbox = new XoopsFormCheckBox('', 'attachsig', $sig_cbox_value);
    $sig_cbox->addOption(1, _AM_SYSTEM_USERS_SHOWSIG);
    $sig_tray->addElement($sig_cbox);
    $form->addElement($sig_tray);
    $umode_select = new XoopsFormSelect(_AM_SYSTEM_USERS_CDISPLAYMODE, 'umode', $umode_value);
    $umode_select->addOptionArray(array('nest' => _NESTED, 'flat' => _FLAT, 'thread' => _THREADED));
    $form->addElement($umode_select);
    $uorder_select = new XoopsFormSelect(_AM_SYSTEM_USERS_CSORTORDER, 'uorder', $uorder_value);
    $uorder_select->addOptionArray(array('0' => _OLDESTFIRST, '1' => _NEWESTFIRST));
    $form->addElement($uorder_select);
    // RMV-NOTIFY
    $notify_method_select = new XoopsFormSelect(_NOT_NOTIFYMETHOD, 'notify_method', $notify_method_value);
    $notify_method_select->addOptionArray(array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL));
    $form->addElement($notify_method_select);
    $notify_mode_select = new XoopsFormSelect(_NOT_NOTIFYMODE, 'notify_mode', $notify_mode_value);
    $notify_mode_select->addOptionArray(array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN));
    $form->addElement($notify_mode_select);
    $form->addElement(new XoopsFormTextArea(_AM_SYSTEM_USERS_EXTRAINFO, 'bio', $bio_value));
    $rank_select = new XoopsFormSelect(_AM_SYSTEM_USERS_RANK, 'rank', $rank_value);
    $ranklist = XoopsLists::getUserRankList();
    if (count($ranklist) > 0) {
        $rank_select->addOption(0, '--------------');
        $rank_select->addOptionArray($ranklist);
    } else {
        $rank_select->addOption(0, _AM_SYSTEM_USERS_NSRID);
    }
    $form->addElement($rank_select);
    // adding a new user requires password fields
    if (!$form_isedit) {
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_PASSWORD, 'password', 10, 32), true);
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_RETYPEPD, 'pass2', 10, 32), true);
    } else {
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_PASSWORD, 'password', 10, 32));
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_RETYPEPD, 'pass2', 10, 32));
    }
    $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_USERS_ACCEPT_EMAIL, 'user_mailok', $mailok_value));
    //Groups administration addition XOOPS 2.0.9: Mith
    $gperm_handler = xoops_getHandler('groupperm');
    //If user has admin rights on groups
    if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_GROUP, $xoopsUser->getGroups(), 1)) {
        //add group selection
        $group_select[] = new XoopsFormSelectGroup(_AM_SYSTEM_USERS_GROUPS, 'groups', false, $groups, 5, true);
    } else {
        //add each user groups
        foreach ($groups as $key => $group) {
            $group_select[] = new XoopsFormHidden('groups[' . $key . ']', $group);
        }
    }
    foreach ($group_select as $group) {
        $form->addElement($group);
        unset($group);
    }
    $form->addElement(new XoopsFormHidden('fct', 'users'));
    $form->addElement(new XoopsFormHidden('op', 'users_save'));
    $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
    if (!empty($uid_value)) {
        $form->addElement(new XoopsFormHidden('uid', $uid_value));
    }
    $form->display();
}
예제 #28
0
 $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_USERID, $userObject->getVar('ID', 'e')));
 $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_LEVEL, $userObject->getVar('user_level', 'e')));
 $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_POSTS, $userObject->getNumPosts(wp_prefix())));
 $_form->addElement(new XoopsFormLabel(_LANG_WPF_SUBT_LOGIN, $userObject->getVar('user_login', 'e')));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_FIRST, 'newuser_firstname', 50, 150, $userObject->getVar('user_firstname', 'e')));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_LAST, 'newuser_lastname', 50, 150, $userObject->getVar('user_lastname', 'e')));
 $_form->addElement(new XoopsFormTextArea(_LANG_WPF_SUBT_DESC, 'user_description', $userObject->getVar('user_description', 'e'), 5, 60));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_NICK, 'newuser_nickname', 50, 150, $userObject->getVar('user_nickname', 'e')), true);
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_MAIL, 'newuser_email', 50, 150, $userObject->getVar('user_email', 'e')), true);
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_URL, 'newuser_url', 50, 150, $userObject->getVar('user_url', 'e')));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_ICQ, 'newuser_icq', 50, 150, $userObject->getVar('user_icq', 'e') ? $userObject->getVar('user_icq', 'e') : ''));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_AIM, 'newuser_aim', 50, 150, $userObject->getVar('user_aim', 'e')));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_MSN, 'newuser_msn', 50, 150, $userObject->getVar('user_msn', 'e')));
 $_form->addElement(new XoopsFormText(_LANG_WPF_SUBT_YAHOO, 'newuser_yim', 50, 150, $userObject->getVar('user_yim', 'e')));
 $_form_idmode = new XoopsFormSelect(_LANG_WPF_SUBT_IDENTITY, 'newuser_idmode', $userObject->getVar('user_idmode', 'e'));
 $_form_idmode->addOption('nickname', $userObject->getVar('user_nickname'));
 $_form_idmode->addOption('login', $userObject->getVar('user_login'));
 $_form_idmode->addOption('firstname', $userObject->getVar('user_firstname'));
 $_form_idmode->addOption('lastname', $userObject->getVar('user_lastname'));
 $_form_idmode->addOption('namefl', $userObject->getVar('user_firstname') . ' ' . $userObject->getVar('user_lastname'));
 $_form_idmode->addOption('namelf', $userObject->getVar('user_lastname') . ' ' . $userObject->getVar('user_firstname'));
 $_form->addElement($_form_idmode);
 $_form->addElement(new XoopsFormButton('', 'submit', _LANG_WPF_SUBT_UPDATE, 'submit'));
 $_form->addElement(new XoopsFormHidden('checkuser_id', $GLOBALS['user_ID']));
 $_form->addElement(new XoopsFormHidden('action', 'update'));
 $_form->addElement($GLOBALS['xoopsWPTicket']->getTicketXoopsForm(__LINE__, 600));
 $_formHTML = $_form->render();
 $_wpTpl =& new WordPresTpl('wp-admin');
 $_wpTpl->assign('updated', get_param('updated'));
 $_wpTpl->assign('formHTML', $_formHTML);
 $_wpTpl->assign('blogname', get_settings('blogname'));
예제 #29
0
         unset($tray);
     }
     break;
 case "radio":
 case "select":
     $options = $fields[$i]->getVar('field_options');
     $size = MIN(count($options), 10);
     $element = new XoopsFormSelect($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'), null, $size, true);
     asort($options);
     $element->addOptionArray($options);
     $searchform->addElement($element);
     unset($element);
     break;
 case "yesno":
     $element = new XoopsFormSelect($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'), null, 2, true);
     $element->addOption(1, _YES);
     $element->addOption(0, _NO);
     $searchform->addElement($element);
     unset($element);
     break;
 case "date":
 case "datetime":
     $searchform->addElement(new XoopsFormTextDateSelect(sprintf(_PROFILE_MA_LATERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . "_larger", 15, 0));
     $searchform->addElement(new XoopsFormTextDateSelect(sprintf(_PROFILE_MA_EARLIERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . "_smaller", 15, time()));
     break;
 case "timezone":
     $element = new XoopsFormSelect($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'), null, 6, true);
     include_once $GLOBALS['xoops']->path('class/xoopslists.php');
     $element->addOptionArray(XoopsLists::getTimeZoneList());
     $searchform->addElement($element);
     unset($element);
예제 #30
0
 //$xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.tablesorter.js');
 $xoTheme->addScript('browse.php?modules/system/js/admin.js');
 //Recherche approfondie
 if (isset($_REQUEST['complet_search'])) {
     // Assign Breadcrumb menu
     $xoBreadCrumb->addLink(_AM_SYSTEM_USERS_NAV_ADVANCED_SEARCH);
     $xoBreadCrumb->addHelp(system_adminVersion('users', 'help'));
     $xoBreadCrumb->addTips(_AM_SYSTEM_USERS_NAV_TIPS);
     $xoBreadCrumb->render();
     $acttotal = $member_handler->getUserCount(new Criteria('level', 0, '>'));
     $inacttotal = $member_handler->getUserCount(new Criteria('level', 0));
     //$group_select = new XoopsFormSelectGroup(_AM_SYSTEM_USERS_GROUPS, "selgroups", null, false, 1, false);
     $group_select = new XoopsFormSelect(_AM_SYSTEM_USERS_GROUPS, "selgroups");
     $group_handler =& xoops_gethandler('group');
     $group_arr = $group_handler->getObjects();
     $group_select->addOption("", "--------------");
     foreach (array_keys($group_arr) as $i) {
         if ($group_arr[$i]->getVar("groupid") != 3) {
             $group_select->addOption("" . $group_arr[$i]->getVar("groupid") . "", "" . $group_arr[$i]->getVar("name") . "");
         }
     }
     $uname_text = new XoopsFormText("", "user_uname", 30, 60);
     $uname_match = new XoopsFormSelectMatchOption("", "user_uname_match");
     $uname_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_UNAME, "&nbsp;");
     $uname_tray->addElement($uname_match);
     $uname_tray->addElement($uname_text);
     $name_text = new XoopsFormText("", "user_name", 30, 60);
     $name_match = new XoopsFormSelectMatchOption("", "user_name_match");
     $name_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_REALNAME, "&nbsp;");
     $name_tray->addElement($name_match);
     $name_tray->addElement($name_text);