本文整理汇总了PHP中XoopsFormCheckBox::addOption方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormCheckBox::addOption方法的具体用法?PHP XoopsFormCheckBox::addOption怎么用?PHP XoopsFormCheckBox::addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsFormCheckBox
的用法示例。
在下文中一共展示了XoopsFormCheckBox::addOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: getForm
function getForm($action = false)
{
global $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$linkusers_handler =& xoops_getmodulehandler('linkusers', 'support');
$member_handler =& xoops_gethandler('member');
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? _MA_SUPPORT_ADDCAT : _MA_SUPPORT_UPDATECAT;
$format = empty($format) ? "e" : $format;
$status = $this->isNew() ? 1 : $this->getVar('cat_status');
$form = new XoopsThemeForm($title, 'form', $action, 'post', true);
$form->setExtra("enctype=\"multipart/form-data\"");
//名稱
$form->addElement(new XoopsFormText(_MA_SUPPORT_CATNAME, 'cat_name', 60, 255, $this->getVar('cat_name', $format)), true);
//題頭圖片
$cat_image = new XoopsFormElementTray(_MA_SUPPORT_CATLOGO, '', 'image');
if ($this->getVar('cat_image')) {
$cat_image->addElement(new XoopsFormLabel('', '<img width="100" src="' . XOOPS_URL . '/uploads/support/' . $this->getVar('cat_image') . '"><br><br>'));
$delete_check = new XoopsFormCheckBox('', 'delete_image');
$delete_check->addOption(1, _DELETE);
$cat_image->addElement($delete_check);
$display = _MA_SUPPORT_REUPLOADLOGOTIP;
} else {
$display = '';
}
$cat_image->addElement(new XoopsFormFile('', 'cat_image', 1024 * 1024 * 2));
$cat_image->addElement(new XoopsFormLabel('', _MA_SUPPORT_UPLOADSTYLE));
$cat_image->addElement(new XoopsFormLabel('', $display));
$form->addElement($cat_image);
//服務介紹
$configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '500px', 'value' => $this->getVar('cat_desc'));
$form->addElement(new XoopsFormEditor(_MA_SUPPORT_CATDESC, 'cat_desc', $configs));
//狀態
$form->addElement(new XoopsFormRadioYN(_MA_SUPPORT_VISIBLE, 'cat_status', $status));
//管理員
$uids = $member_handler->getUsersByGroup($xoopsModuleConfig['support']);
$criteria = new CriteriaCompo(new Criteria("uid", "(" . implode(", ", $uids) . ")", "in"));
$members = $member_handler->getUserList($criteria);
$support_ids = array();
if (!$this->isNew()) {
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('cat_id', $this->getVar('cat_id')));
$linkusers = $linkusers_handler->getAll($criteria, array('uid'), false);
if (!empty($linkusers)) {
foreach ($linkusers as $k => $v) {
$support_ids[] = $v['uid'];
}
}
}
$support = new XoopsFormSelect(_MA_SUPPORT_MANGER, 'support_ids', $support_ids, 5, true);
$support->addOptionArray($members);
$form->addElement($support, true);
$form->addElement(new XoopsFormHidden('cat_id', $this->getVar('cat_id')));
$form->addElement(new XoopsFormHidden('ac', 'insert'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
}
示例3: XoopsFormDhtmlTextArea
function SmartFormUser_sigElement($object, $key)
{
$var = $object->vars[$key];
$control = $object->controls[$key];
$this->XoopsFormElementTray($var['form_caption'], '<br /><br />', $key . '_signature_tray');
$signature_textarea = new XoopsFormDhtmlTextArea('', $key, $object->getVar($key, 'e'));
$this->addElement($signature_textarea);
$attach_checkbox = new XoopsFormCheckBox('', 'attachsig', $object->getVar('attachsig', 'e'));
$attach_checkbox->addOption(1, _US_SHOWSIG);
$this->addElement($attach_checkbox);
}
示例4: getForm
function getForm($action = false)
{
global $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . "/modules/portfolio/include/functions.render.php";
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? '添加服务' : '更新服务';
$format = empty($format) ? "e" : $format;
$status = $this->isNew() ? 1 : $this->getVar('service_status');
$form = new XoopsThemeForm($title, 'form', $action, 'post', true);
$form->setExtra("enctype=\"multipart/form-data\"");
//名称
$form->addElement(new XoopsFormText('案例名称', 'service_name', 60, 255, $this->getVar('service_name', $format)), true);
$form->addElement(new XoopsFormText('页面标题', 'service_menu_name', 60, 255, $this->getVar('service_menu_name', $format)));
//题头图片
$service_image = new XoopsFormElementTray('题头图片', '', 'image');
if ($this->getVar('service_image')) {
$service_image->addElement(new XoopsFormLabel('', '<img src="' . XOOPS_URL . '/uploads/portfolio/' . $this->getVar('service_image') . '"><br><br>'));
$delete_check = new XoopsFormCheckBox('', 'delete_image');
$delete_check->addOption(1, _DELETE);
$service_image->addElement($delete_check);
$display = '从新上传将会覆盖现有文件';
} else {
$display = '';
}
$service_image->addElement(new XoopsFormFile('', 'service_image', 1024 * 1024 * 2));
$service_image->addElement(new XoopsFormLabel('', '允许上传的类型为jpeg,pjpeg,gif,png文件'));
$service_image->addElement(new XoopsFormLabel('', $display));
$form->addElement($service_image);
//服务介绍
$configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '500px', 'value' => $this->getVar('service_desc'));
$form->addElement(new XoopsFormEditor('服务介绍', 'service_desc', $configs), false);
//模板选择
$templates = portfolio_getTemplateList("service");
if (count($templates) > 0) {
$template_select = new XoopsFormSelect('服务模板', "service_tpl", $this->getVar("service_tpl"));
$template_select->addOptionArray($templates);
$form->addElement($template_select);
}
//状态
$form->addElement(new XoopsFormRadioYN('是否显示', 'service_status', $status));
//创建时间
if ($this->isNew()) {
$form->addElement(new XoopsFormHidden('service_pushtime', time()));
}
$form->addElement(new XoopsFormHidden('service_id', $this->getVar('service_id')));
$form->addElement(new XoopsFormHidden('ac', 'insert'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
}
示例5: getForm
function getForm($action = false)
{
global $xoopsModuleConfig;
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? '添加分类' : '更新分类';
$format = empty($format) ? "e" : $format;
$status = $this->isNew() ? 1 : $this->getVar('cat_status');
$form = new XoopsThemeForm($title, 'form', $action, 'post', true);
$form->setExtra("enctype=\"multipart/form-data\"");
//名称
$form->addElement(new XoopsFormText('分类名称', 'cat_name', 60, 255, $this->getVar('cat_name', $format)), true);
//题头图片
$cat_image = new XoopsFormElementTray('题头图片', '', 'image');
if ($this->getVar('cat_image')) {
$cat_image->addElement(new XoopsFormLabel('', '<img src="' . XOOPS_URL . '/uploads/resources/' . $this->getVar('cat_image') . '"><br><br>'));
$delete_check = new XoopsFormCheckBox('', 'delete_image');
$delete_check->addOption(1, _DELETE);
$cat_image->addElement($delete_check);
$display = '从新上传将会覆盖现有文件';
} else {
$display = '';
}
$cat_image->addElement(new XoopsFormFile('', 'cat_image', 1024 * 1024 * 2));
$cat_image->addElement(new XoopsFormLabel('', '允许上传的类型为jpeg,pjpeg,gif,png文件'));
$cat_image->addElement(new XoopsFormLabel('', $display));
$form->addElement($cat_image);
//服务介绍
$configs = array('editor' => 'fckeditor', 'width' => '100%', 'height' => '500px', 'value' => $this->getVar('cat_desc'));
$form->addElement(new XoopsFormEditor('分类描述', 'cat_desc', $configs));
//状态
$form->addElement(new XoopsFormRadioYN('是否显示', 'cat_status', $status));
// gratetime
if ($this->isNew()) {
$form->addElement(new XoopsFormHidden('grate_time', time()));
}
$form->addElement(new XoopsFormHidden('cat_id', $this->getVar('cat_id')));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
}
示例6: display_edit_form
function display_edit_form($cat, $form_title, $action)
{
global $cattree;
// Beggining of XoopsForm
$form = new XoopsThemeForm($form_title, 'MainForm', '');
// Hidden
$form->addElement(new XoopsFormHidden('action', htmlspecialchars($action, ENT_QUOTES)));
$form->addElement(new XoopsFormHidden('cid', intval($cat->cid)));
// Subject
$form->addElement(new XoopsFormText(_AM_CAT_TH_TITLE, 'cat_title', 60, 128, htmlspecialchars($cat->cat_title, ENT_QUOTES)), true);
// Description
$tarea_tray = new XoopsFormElementTray(_AM_CAT_TH_DESC, '<br />');
$tarea_tray->addElement(new XoopsFormDhtmlTextArea('', 'cat_desc', htmlspecialchars($cat->cat_desc, ENT_QUOTES), 15, 60));
$form->addElement($tarea_tray);
// Parent Category
ob_start();
$cattree->makeMySelBox("cat_title", "weight", $cat->pid, 1, 'pid');
$cat_selbox = ob_get_contents();
ob_end_clean();
$form->addElement(new XoopsFormLabel(_AM_CAT_TH_PARENT, $cat_selbox));
// Weight
$form->addElement(new XoopsFormText(_AM_CAT_TH_WEIGHT, 'weight', 6, 6, intval($cat->weight)), true);
// Options
$checkbox_tray = new XoopsFormElementTray(_AM_CAT_TH_OPTIONS, '<br />');
$ismenuitem_checkbox = new XoopsFormCheckBox('', 'ismenuitem', intval($cat->ismenuitem));
$ismenuitem_checkbox->addOption(1, _AM_CAT_TH_SUBMENU);
$checkbox_tray->addElement($ismenuitem_checkbox);
$form->addElement($checkbox_tray);
// Last Modified
$form->addElement(new XoopsFormLabel(_AM_CAT_TH_LASTMODIFY, formatTimestamp($cat->udtstamp)));
// Buttons
$button_tray = new XoopsFormElementTray('', ' ');
$button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
$button_tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
$form->addElement($button_tray);
// Ticket
$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement($form, __LINE__);
// End of XoopsForm
$form->display();
}
示例7: XoopsFormText
// Project: The XOOPS Project //
// ------------------------------------------------------------------------- //
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$name_text = new XoopsFormText(_AM_NAME, "name", 30, 50, $name_value);
$desc_text = new XoopsFormTextArea(_AM_DESCRIPTION, "desc", $desc_value);
$s_cat_checkbox = new XoopsFormCheckBox(_AM_SYSTEMRIGHTS, "system_catids[]", $s_cat_value);
//if (isset($s_cat_disable) && $s_cat_disable) {
// $s_cat_checkbox->setExtra('checked="checked" disabled="disabled"');
//}
include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
$handle = opendir(XOOPS_ROOT_PATH . '/modules/system/admin');
while (false != ($file = readdir($handle))) {
if (strtolower($file) != 'cvs' && !preg_match("/[.]/", $file) && is_dir(XOOPS_ROOT_PATH . '/modules/system/admin/' . $file)) {
include XOOPS_ROOT_PATH . '/modules/system/admin/' . $file . '/xoops_version.php';
if (!empty($modversion['category'])) {
$s_cat_checkbox->addOption($modversion['category'], $modversion['name']);
}
unset($modversion);
}
}
$a_mod_checkbox = new XoopsFormCheckBox(_AM_ACTIVERIGHTS, "admin_mids[]", $a_mod_value);
$module_handler =& xoops_gethandler('module');
$criteria = new CriteriaCompo(new Criteria('hasadmin', 1));
$criteria->add(new Criteria('isactive', 1));
$criteria->add(new Criteria('dirname', 'system', '<>'));
$a_mod_checkbox->addOptionArray($module_handler->getList($criteria));
$r_mod_checkbox = new XoopsFormCheckBox(_AM_ACCESSRIGHTS, "read_mids[]", $r_mod_value);
$criteria = new CriteriaCompo(new Criteria('hasmain', 1));
$criteria->add(new Criteria('isactive', 1));
$r_mod_checkbox->addOptionArray($module_handler->getList($criteria));
$r_lblock_checkbox = new XoopsFormCheckBox('<b>' . _LEFT . '</b><br />', "read_bids[]", $r_block_value);
示例8: topicsmanager
function topicsmanager()
{
global $xoopsModule, $xoopsModuleConfig, $xoopsDB;
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
//$uploadfolder=sprintf(_AMS_AM_UPLOAD_WARNING,XOOPS_URL . "/modules/" . $xoopsModule -> dirname().'/images/topics');
$uploadirectory = "/modules/" . $xoopsModule->dirname() . '/images/topics';
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
include_once XOOPS_ROOT_PATH . "/class/tree.php";
$xt = new AmsTopic($xoopsDB->prefix("ams_topics"));
$allTopics = $xt->getAllTopics();
$totaltopics = count($allTopics);
if ($totaltopics > 0) {
$topic_obj_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
$topics_arr = $topic_obj_tree->getAllChild(0);
}
echo "<form action='index.php' method='POST'>";
echo "<div class=\"odd\">";
echo "<div style='text-align: center;'><b>" . _AMS_AM_TOPICSMNGR . ' (' . ($start + 1) . '-' . ($start + $xoopsModuleConfig['storycountadmin'] > $totaltopics ? $totaltopics : $start + $xoopsModuleConfig['storycountadmin']) . ' ' . _AMS_AM_OF . ' ' . $totaltopics . ')' . "</b><br /><br />";
echo "<table border='1' width='100%'><tr class='bg3'><td align='center'>" . _AMS_AM_TOPIC . "</td><td align='left'>" . _AMS_AM_TOPICNAME . "</td><td align='center'>" . _AMS_AM_PARENTTOPIC . "</td><td> " . _AMS_AM_WEIGHT . " </td><td align='center'>" . _AMS_AM_ACTION . "</td></tr>";
//If topic not empty
if ($totaltopics > 0) {
$i = 0;
foreach ($topics_arr as $thisTopic) {
$i++;
if ($i > $start && $i - $start <= $xoopsModuleConfig['storycountadmin']) {
$linkedit = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/index.php?op=topicsmanager&topic_id=' . $thisTopic->topic_id();
$linkdelete = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/index.php?op=delTopic&topic_id=' . $thisTopic->topic_id();
$action = sprintf("<a href='%s'>%s</a> - <a href='%s'>%s</a>", $linkedit, _AMS_AM_EDIT, $linkdelete, _AMS_AM_DELETE);
$parent = ' ';
$pid = $thisTopic->topic_pid();
if ($pid > 0) {
$parent = $topics_arr[$pid]->topic_title();
$thisTopic->prefix = str_replace(".", "-", $thisTopic->prefix) . ' ';
} else {
$thisTopic->prefix = str_replace(".", "", $thisTopic->prefix);
}
echo "<tr><td>" . $thisTopic->topic_id() . "</td><td align='left'>" . $thisTopic->prefix() . $thisTopic->topic_title() . "</td><td align='left'>" . $parent . "</td><td align='center'><input type='text' name='weight[" . $thisTopic->topic_id() . "]' value='" . $thisTopic->weight . "' size='10' maxlength='10' /> </td><td>" . $action . "</td></tr>";
}
}
echo "<tr><td colspan='3'></td><td><input type='hidden' name='op' value='reorder' />\r\n <input type='submit' name='submit' value='" . _AMS_AM_SUBMIT . "' /></td><td></td></tr>";
}
echo "</table></div></div></form>";
if ($totaltopics > $xoopsModuleConfig['storycountadmin']) {
$pagenav = new XoopsPageNav($totaltopics, $xoopsModuleConfig['storycountadmin'], $start, 'start', 'op=topicsmanager');
echo "<div align='right'>";
echo $pagenav->renderNav() . '</div><br />';
}
$topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : 0;
if ($topic_id > 0) {
$xtmod = $topics_arr[$topic_id];
$topic_title = $xtmod->topic_title('E');
$op = 'modTopicS';
if (trim($xtmod->topic_imgurl()) != '') {
$topicimage = $xtmod->topic_imgurl();
} else {
$topicimage = "blank.png";
}
$btnlabel = _AMS_AM_MODIFY;
$parent = $xtmod->topic_pid();
$formlabel = _AMS_AM_MODIFYTOPIC;
$banner = $xtmod->banner;
$banner_inherit = $xtmod->banner_inherit;
$forum = $xtmod->forum_id;
unset($xtmod);
} else {
$topic_title = '';
$op = 'addTopic';
$topicimage = 'xoops.gif';
$btnlabel = _AMS_AM_ADD;
$parent = 0;
$formlabel = _AMS_AM_ADD_TOPIC;
$banner = '';
$banner_inherit = 0;
$forum = 0;
}
$sform = new XoopsThemeForm($formlabel, "topicform", XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php', 'post');
$sform->setExtra('enctype="multipart/form-data"');
$sform->addElement(new XoopsFormText(_AMS_AM_TOPICNAME . ' ' . _AMS_AM_MAX40CHAR, 'topic_title', 40, 50, $topic_title), true);
$sform->addElement(new XoopsFormHidden('op', $op), false);
$sform->addElement(new XoopsFormHidden('topic_id', $topic_id), false);
if ($totaltopics > 0) {
$sform->addElement(new XoopsFormLabel(_AMS_AM_PARENTTOPIC, $topic_obj_tree->makeSelBox('topic_pid', 'topic_title', '--', $parent, true)));
} else {
$sform->addElement(new XoopsFormHidden('topic_pid', 0));
}
// ********** Picture
$imgtray = new XoopsFormElementTray(_AMS_AM_TOPICIMG, '<br />');
$imgpath = sprintf(_AMS_AM_IMGNAEXLOC, "modules/" . $xoopsModule->dirname() . "/images/topics/");
$imageselect = new XoopsFormSelect($imgpath, 'topic_imgurl', $topicimage);
$topics_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/AMS/images/topics/");
foreach ($topics_array as $image) {
$imageselect->addOption("{$image}", $image);
}
$imageselect->setExtra("onchange='showImgSelected(\"image3\", \"topic_imgurl\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'");
$imgtray->addElement($imageselect, false);
$imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $topicimage . "' name='image3' id='image3' alt='' />"));
$uploadfolder = sprintf(_AMS_AM_UPLOAD_WARNING, XOOPS_URL . "/modules/" . $xoopsModule->dirname() . '/images/topics');
$fileseltray = new XoopsFormElementTray('', '<br />');
$fileseltray->addElement(new XoopsFormFile(_AMS_AM_TOPIC_PICTURE, 'attachedfile', $xoopsModuleConfig['maxuploadsize']), false);
$fileseltray->addElement(new XoopsFormLabel($uploadfolder), false);
//.........这里部分代码省略.........
示例9: XoopsFormCheckBox
$form_show_updated = new XoopsFormCheckBox("", "show_updated", $show_updated);
$form_show_updated->addOption("Y", _LANG_WLC_SUBEDIT_UPDATE);
$form_style->addElement($form_show_updated);
$form_sort = new XoopsFormElementTray(_LANG_WLC_SUBEDIT_SORT);
$form->addElement($form_sort);
$form_sort_order = new XoopsFormSelect("", "sort_order", $sort_order);
$form_sort_order->addOption("name", 'Name');
$form_sort_order->addOption("id", 'Id');
$form_sort_order->addOption("url", 'URL');
$form_sort_order->addOption("rating", 'Rating');
$form_sort_order->addOption("updated", 'Updated');
$form_sort_order->addOption("rand", 'Random');
$form_sort_order->addOption("length", 'Name Length');
$form_sort->addElement($form_sort_order);
$form_sort_desc = new XoopsFormCheckBox("", "sort_desc", $sort_desc);
$form_sort_desc->addOption("Y", _LANG_WLC_SUBEDIT_DESCEND);
$form_sort->addElement($form_sort_desc);
$form->addElement(new XoopsFormText(_LANG_WLC_SUBEDIT_BEFORE, "text_before_link", 45, 150, $text_before_link));
$form->addElement(new XoopsFormText(_LANG_WLC_SUBEDIT_BETWEEN, "text_after_link", 45, 150, $text_after_link));
$form->addElement(new XoopsFormText(_LANG_WLC_SUBEDIT_AFTER, "text_after_all", 45, 150, $text_after_all));
$form_list_limit = new XoopsFormText(_LANG_WLC_SUBEDIT_LIMIT, "list_limit", 5, 5, $list_limit);
$form_list_limit->setDescription("(" . _LANG_WLC_EPAGE_EMPTY . ")");
$form->addElement($form_list_limit);
if ($form_id == 'addcat') {
$form->addElement(new XoopsFormButton("", "submit", _LANG_WLC_ADDBUTTON_TEXT, "submit"));
$form->addElement(new XoopsFormHidden("action", 'addcat'));
} elseif ($form_id == 'editcat') {
$form_button = new XoopsFormElementTray("");
$form->addElement($form_button);
$form_button->addElement(new XoopsFormButton("", "submit", _LANG_WLC_SAVEBUTTON_TEXT, "submit"));
$form_button->addElement(new XoopsFormButton("", "submit", _LANG_WLC_CANCELBUTTON_TEXT, "submit"));
示例10: sprintf
break;
case "editar":
$sql = sprintf("select * from collaborator where id = %s", $_GET["idusuario"]);
$db->query($sql);
$tmp = $db->fetch_assoc();
$formulario = new XoopsThemeForm("Edit collaborator", "Edicao_usuario", "?acao=editarsalvar&idusuario=" . $_GET["idusuario"]);
$formulario->addElement(new XoopsFormText("Name:", "usuario[Nome]", 50, 100, $tmp['name']));
$formulario->addElement(new XoopsFormText("E-mail:", "usuario[Email]", 50, 100, $tmp['email']));
$formulario->addElement(new XoopsFormText("Username:", "usuario[Login]", 20, 20, $tmp['username']));
$formulario->addElement(new XoopsFormPassword("Password:", "usuario[Senha]", 20, 32, $tmp['password']));
$formulario->addElement(new XoopsFormHidden("usuario[SenhaTmp]", $tmp['password']));
$administrador = new XoopsFormCheckBox("Administrator:", "usuario[Administrador]", $tmp['administrator'] ? "true" : "");
$administrador->addOption("true", " ");
$formulario->addElement($administrador);
$coordenador = new XoopsFormCheckBox("Coordinator:", "usuario[Coordenador]", $tmp['coordinator'] ? "true" : "");
$coordenador->addOption("true", " ");
$formulario->addElement($coordenador);
$tray2 = new XoopsFormElementTray("", "table", "", "right");
$tray2->addElement(new XoopsFormButton("", "excluirusuario", "Disable", "submit", true));
$tray2->addElement(new XoopsFormButton("", "salvarusuario", "Save", "submit", true));
$formulario->addElement($tray2);
$smarty->assign("formulario", $formulario->render());
$smarty->assign("display_conteudo", "formulariopadrao");
finaliza_request();
break;
default:
}
}
$sql = "select * from collaborator where active = 1 order by name";
$db->query($sql);
$usuarios = array();
示例11: constructElement
//.........这里部分代码省略.........
$linked_columns = array($boxproperties[1]);
} else {
$linked_columns = convertElementIdsToElementHandles($ele_value[EV_MULTIPLE_FORM_COLUMNS], $sourceFormObject->getVar('id_form'));
// remove empty entries, which can happen if the "use the linked field selected above" option is selected
$linked_columns = array_filter($linked_columns);
}
if (is_array($linked_columns)) {
$select_column = "t1.`" . implode("`, t1.`", $linked_columns) . "`";
} else {
$select_column = "t1.`{$linked_columns}`";
// in this case, it's just one linked column
}
// if there is a groups filter, then join to the group ownership table
$extra_clause = "";
if ($pgroupsfilter) {
$extra_clause = ", " . $xoopsDB->prefix("formulize_entry_owner_groups") . " AS t2 {$parentFormFrom} WHERE {$pgroupsfilter}";
} else {
$extra_clause = " {$parentFormFrom} WHERE t1.entry_id>0";
}
$sourceValuesQ = "SELECT t1.entry_id, " . $select_column . " FROM " . $xoopsDB->prefix("formulize_" . $sourceFormObject->getVar('form_handle')) . " AS t1" . $extra_clause . "{$conditionsfilter} {$conditionsfilter_oom} {$restrictSQL}" . "GROUP BY t1.entry_id {$sortOrderClause}";
if (!$isDisabled) {
// set the default selections, based on the entry_ids that have been selected as the defaults, if applicable
$hasNoValues = trim($boxproperties[2]) == "" ? true : false;
$useDefaultsWhenEntryHasNoValue = $ele_value[14];
if (($entry == "new" or $useDefaultsWhenEntryHasNoValue and $hasNoValues) and (is_array($ele_value[13]) and count($ele_value[13]) > 0 or $ele_value[13])) {
$defaultSelected = $ele_value[13];
} else {
$defaultSelected = "";
}
$form_ele = new XoopsFormSelect($ele_caption, $form_ele_id, $defaultSelected, $ele_value[0], $ele_value[1]);
$form_ele->setExtra("onchange=\"javascript:formulizechanged=1;\" jquerytag='{$form_ele_id}'");
if ($ele_value[0] == 1) {
// add the initial default entry, singular or plural based on whether the box is one line or not.
$form_ele->addOption("none", _AM_FORMLINK_PICK);
}
} else {
$disabledHiddenValue = array();
$disabledOutputText = array();
}
if (!isset($cachedSourceValuesQ[$sourceValuesQ])) {
$element_handler = xoops_getmodulehandler('elements', 'formulize');
$sourceElementObject = $element_handler->get($boxproperties[1]);
if ($sourceElementObject->isLinked) {
// need to jump one more level back to get value that this value is pointing at
$sourceEleValue = $sourceElementObject->getVar('ele_value');
$originalSource = explode("#*=:*", $sourceEleValue[2]);
include_once XOOPS_ROOT_PATH . "/modules/formulize/class/data.php";
$data_handler = new formulizeDataHandler($originalSource[0]);
}
$reslinkedvaluesq = $xoopsDB->query($sourceValuesQ);
if ($reslinkedvaluesq) {
$linked_column_count = count($linked_columns);
while ($rowlinkedvaluesq = $xoopsDB->fetchRow($reslinkedvaluesq)) {
$linked_column_values = array();
foreach (range(1, $linked_column_count) as $linked_column_index) {
if ($rowlinkedvaluesq[$linked_column_index] === "") {
$linked_column_values[] = "";
} else {
if ($sourceElementObject->isLinked) {
$linked_value = prepvalues($rowlinkedvaluesq[$linked_column_index], $boxproperties[1], $rowlinkedvaluesq[0]);
$linked_column_values[] = $linked_value[0];
} else {
$linked_column_values[] = strip_tags(trim($rowlinkedvaluesq[$linked_column_index]));
}
}
}
示例12: XoopsFormText
$form->addElement($timezone_select);
// user_intrest
$interest_text = new XoopsFormText(_US_INTEREST, 'user_intrest', 30, 150, $u_obj->getVar('user_intrest', 'e'));
$form->addElement($interest_text);
// appeal
$app_tray = new XoopsFormElementTray(_MD_XOONIPS_ACCOUNT_APPEAL, '<br />');
$app_tarea = new XoopsFormTextArea('', 'appeal', $xu_obj->getVar('appeal', 'e'), 5, 50, 'u_appeal');
$app_tray->addElement($app_tarea);
$form->addElement($app_tray);
// user_sig
$sig_tray = new XoopsFormElementTray(_US_SIGNATURE, '<br />');
$sig_tarea = new XoopsFormTextArea('', 'user_sig', $u_obj->getVar('user_sig', 'e'));
$sig_tray->addElement($sig_tarea);
$sig_cbox_value = $u_obj->getVar('attachsig', 's') ? 1 : 0;
$sig_cbox = new XoopsFormCheckBox('', 'attachsig', $sig_cbox_value);
$sig_cbox->addOption(1, _US_SHOWSIG);
$sig_tray->addElement($sig_cbox);
$form->addElement($sig_tray);
// password & vpass
$pwd_text = new XoopsFormPassword('', 'password', 10, 32);
$pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
$pwd_tray = new XoopsFormElementTray(_US_PASSWORD . '<br />' . _US_TYPEPASSTWICE);
$pwd_tray->addElement($pwd_text);
$pwd_tray->addElement($pwd_text2);
$form->addElement($pwd_tray);
// notice mail
$notice_mail_text = new XoopsFormText(_MD_XOONIPS_ACCOUNT_NOTICE_MAIL, 'notice_mail', 5, 10, $xu_obj->getVar('notice_mail', 'e'));
$form->addElement($notice_mail_text);
// usercookie
if ($uid == $myuid) {
$cookie_radio_value = empty($_COOKIE[$myxoopsConfig['usercookie']]) ? 0 : 1;
示例13: XoopsFormLabel
$pds->addElement(new XoopsFormLabel('', ' Ko'));
$form->addElement($pds);
$tab = array();
//$value[2] = array();
foreach ($value[2] as $t => $k) {
foreach ($k as $c => $f) {
$tab[] = $value[2][$t]['value'];
}
}
// here we can add more mime type.
$mime = new XoopsFormCheckBox(_AM_ELE_TYPEMIME, 'ele_value[2]', $tab);
/*
$mime->addOption('pdf',' pdf ');
$mime->addOption('doc',' doc ');
$mime->addOption('txt',' txt ');
$mime->addOption('gif',' gif ');
$mime->addOption('mpeg',' mpeg ');
$mime->addOption('jpg',' jpg ');
$mime->addOption('zip',' zip ');
$mime->addOption('rar',' rar ');
*/
$mime->addOption('application/pdf', ' pdf ');
$mime->addOption('application/msword', ' doc ');
$mime->addOption('text/plain', ' txt ');
$mime->addOption('image/gif', ' gif ');
$mime->addOption('video/mpeg', ' mpeg ');
$mime->addOption('image/jpeg', ' jpg ');
$mime->addOption('application/zip', ' zip ');
$form->addElement($mime);
$fichier = new XoopsFormFile(_AM_ELE_FICH, $ele_value[0], $ele_value[1]);
$form->addElement($fichier);
示例14: XoopsFormText
//$criteria_tray->addElement($idle_less);
$criteria_tray->addElement($regdate);
$criteria_tray->addElement($mailok_cbox);
$criteria_tray->addElement($inactive_cbox);
//$criteria_tray->addElement($regd_max);
$form->addElement($criteria_tray);
}
$fname_text = new XoopsFormText(_AM_SYSTEM_MAILUSERS_MAILFNAME, 'mail_fromname', 30, 255, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES));
$fromemail = !empty($xoopsConfig['adminmail']) ? $xoopsConfig['adminmail'] : $xoopsUser->getVar('email', 'E');
$femail_text = new XoopsFormText(_AM_SYSTEM_MAILUSERS_MAILFMAIL, 'mail_fromemail', 30, 255, $fromemail);
$subject_caption = _AM_SYSTEM_MAILUSERS_MAILSUBJECT . "<br><br><span style='font-size:x-small;font-weight:bold;'>" . _AM_SYSTEM_MAILUSERS_MAILTAGS . "</span><br><span style='font-size:x-small;font-weight:normal;'>" . _AM_SYSTEM_MAILUSERS_MAILTAGS2 . '</span>';
$subject_text = new XoopsFormText($subject_caption, 'mail_subject', 50, 255);
$body_caption = _AM_SYSTEM_MAILUSERS_MAILBODY . "<br><br><span style='font-size:x-small;font-weight:bold;'>" . _AM_SYSTEM_MAILUSERS_MAILTAGS . "</span><br><span style='font-size:x-small;font-weight:normal;'>" . _AM_SYSTEM_MAILUSERS_MAILTAGS1 . '<br>' . _AM_SYSTEM_MAILUSERS_MAILTAGS2 . '<br>' . _AM_SYSTEM_MAILUSERS_MAILTAGS3 . '<br>' . _AM_SYSTEM_MAILUSERS_MAILTAGS4 . '</span>';
$body_text = new XoopsFormTextArea($body_caption, 'mail_body', '', 10);
$to_checkbox = new XoopsFormCheckBox(_AM_SYSTEM_MAILUSERS_SENDTO, 'mail_send_to', 'mail');
$to_checkbox->addOption('mail', _AM_SYSTEM_MAILUSERS_EMAIL);
$to_checkbox->addOption('pm', _AM_SYSTEM_MAILUSERS_PM);
$start_hidden = new XoopsFormHidden('mail_start', 0);
$op_hidden = new XoopsFormHidden('op', 'send');
$submit_button = new XoopsFormButton('', 'mail_submit', _SEND, 'submit');
$form->addElement($fname_text);
$form->addElement($femail_text);
$form->addElement($subject_text);
$form->addElement($body_text);
$form->addElement($to_checkbox);
$form->addElement($op_hidden);
$form->addElement($start_hidden);
$form->addElement($submit_button);
$form->setRequired($subject_text);
$form->setRequired($body_text);
// Assign form
示例15: addOption
function addOption($id1, $id2, $text, $type = 'check', $checked = null)
{
if (!isset($text)) {
$text = "";
}
$d = new XoopsFormText('', $id1, 40, 255, $text);
if ($type == 'check') {
$c = new XoopsFormCheckBox('', $id2, $checked);
$c->addOption(1, ' ');
} else {
$c = new XoopsFormRadio('', 'checked', $checked);
$c->addOption($id2, ' ');
}
$t = new XoopsFormElementTray('');
$t->addElement($c);
$t->addElement($d);
return $t;
}