• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XoopsFormButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createButtons

 /**
  * @创建按钮
  * @license   http://www.blags.org/
  * @created   :2010年05月20日 23时52分
  * @copyright 1997-2010 The Martin Group
  * @author    Martin <[email protected]>
  * */
 public function createButtons()
 {
     $button_tray = new XoopsFormElementTray('', '');
     // No ID for category -- then it's new category, button says 'Create'
     if (!$this->Obj->service_id()) {
         $butt_create = new XoopsFormButton('', '', _SUBMIT, 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', _RESET, 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     } else {
         // button says 'Update'
         $butt_create = new XoopsFormButton('', '', _EDIT, 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', _RESET, 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     }
 }
开发者ID:mambax7,项目名称:xoops-martin,代码行数:34,代码来源:form.hotel.service.php


示例2: displayForm

 /**
  * XoopsfaqCategory::displayForm()
  *
  * @return
  */
 function displayForm()
 {
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $caption = $this->isNew() ? _AM_XOOPSFAQ_CREATENEW : sprintf(_AM_XOOPSFAQ_MODIFYITEM, $this->getVar('category_title'));
     $form = new XoopsThemeForm($caption, 'content', xoops_getenv('PHP_SELF'));
     $form->addElement(new XoopsFormHiddenToken());
     $form->addElement(new xoopsFormHidden('op', 'save'));
     $form->addElement(new xoopsFormHidden('category_id', $this->getVar('category_id', 'e')));
     // title
     $category_title = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_TITLE, 'category_title', 50, 150, $this->getVar('category_title', 'e'));
     $category_title->setDescription(_AM_XOOPSFAQ_E_CATEGORY_TITLE_DSC);
     $form->addElement($category_title, true);
     // order
     $category_order = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT, 'category_order', 5, 5, $this->getVar('category_order', 'e'));
     $category_order->setDescription(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT_DSC);
     $form->addElement($category_order, false);
     $btnTray = new XoopsFormElementTray('', '');
     $btnSubmit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
     $btnTray->addElement($btnSubmit);
     $btnCancel = new XoopsFormButton('', '', _CANCEL, 'button');
     $btnCancel->setExtra('onclick="history.go(-1)"');
     $btnTray->addElement($btnCancel);
     $form->addElement($btnTray);
     $form->display();
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:30,代码来源:category.php


示例3: createButtons

 /**
  * @创建按钮
  * @license http://www.blags.org/
  * @created:2010年05月20日 23时52分
  * @copyright 1997-2010 The Martin Group
  * @author Martin <[email protected]> 
  * */
 function createButtons()
 {
     $button_tray = new XoopsFormElementTray('', '');
     // No ID for category -- then it's new category, button says 'Create'
     if (empty($this->Obj)) {
         $butt_create = new XoopsFormButton('', '', '提交', 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', '清空', 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', 'cancel', 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     } else {
         // button says 'Update'
         $butt_create = new XoopsFormButton('', '', '修改', 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', '清空', 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', 'cancel', 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     }
 }
开发者ID:ponvino,项目名称:xoops-martin,代码行数:34,代码来源:form.room.type.php


示例4: createElements

 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);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:30,代码来源:tab.php


示例5: createElements

 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);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:53,代码来源:block.php


示例6: createElements

 function createElements($target)
 {
     $this->addElement(new XoopsFormText(_AM_MYTABS_TITLE, 'pagetitle', 35, 255, $target->getVar('pagetitle', 'e')));
     if (!$target->isNew()) {
         $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);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:14,代码来源:page.php


示例7: editCategory

/**
 * editCategory()
 *
 * @param integer $catid
 * @return
 */
function editCategory($category_obj = null)
{
    global $xoopsModule;
    $category_handler =& xoops_getmodulehandler('category', 'newbb');
    if (empty($category_obj)) {
        $category_obj =& $category_handler->create();
    }
    $groups_cat_access = null;
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    if (!$category_obj->isNew()) {
        $sform = new XoopsThemeForm(_AM_NEWBB_EDITCATEGORY . " " . $category_obj->getVar('cat_title'), "op", xoops_getenv('PHP_SELF'));
    } else {
        $sform = new XoopsThemeForm(_AM_NEWBB_CREATENEWCATEGORY, "op", xoops_getenv('PHP_SELF'));
        $category_obj->setVar('cat_title', '');
        $category_obj->setVar('cat_image', '');
        $category_obj->setVar('cat_description', '');
        $category_obj->setVar('cat_order', 0);
        $category_obj->setVar('cat_url', 'http://www.xoops.org XOOPS');
    }
    $sform->addElement(new XoopsFormText(_AM_NEWBB_SETCATEGORYORDER, 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false);
    $sform->addElement(new XoopsFormText(_AM_NEWBB_CATEGORY, 'title', 50, 80, $category_obj->getVar('cat_title', 'E')), true);
    $sform->addElement(new XoopsFormDhtmlTextArea(_AM_NEWBB_CATEGORYDESC, 'cat_description', $category_obj->getVar('cat_description', 'E'), 10, 60), false);
    $imgdir = "/modules/" . $xoopsModule->getVar("dirname") . "/images/category";
    $cat_image = $category_obj->getVar("cat_image");
    $cat_image = empty($cat_image) ? 'blank.gif' : $cat_image;
    $graph_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $imgdir . "/");
    array_unshift($graph_array, _NONE);
    $cat_image_select = new XoopsFormSelect('', 'cat_image', $category_obj->getVar('cat_image'));
    $cat_image_select->addOptionArray($graph_array);
    $cat_image_select->setExtra("onchange=\"showImgSelected('img', 'cat_image', '/" . $imgdir . "/', '', '" . XOOPS_URL . "')\"");
    $cat_image_tray = new XoopsFormElementTray(_AM_NEWBB_IMAGE, '&nbsp;');
    $cat_image_tray->addElement($cat_image_select);
    $cat_image_tray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . $imgdir . "/" . $cat_image . " 'name='img' id='img' alt='' />"));
    $sform->addElement($cat_image_tray);
    $sform->addElement(new XoopsFormText(_AM_NEWBB_SPONSORLINK, 'cat_url', 50, 80, $category_obj->getVar('cat_url', 'E')), false);
    $sform->addElement(new XoopsFormHidden('cat_id', $category_obj->getVar("cat_id")));
    $button_tray = new XoopsFormElementTray('', '');
    $button_tray->addElement(new XoopsFormHidden('op', 'save'));
    $butt_save = new XoopsFormButton('', '', _SUBMIT, 'submit');
    $butt_save->setExtra('onclick="this.form.elements.op.value=\'save\'"');
    $button_tray->addElement($butt_save);
    if ($category_obj->getVar("cat_id")) {
        $butt_delete = new XoopsFormButton('', '', _CANCEL, 'submit');
        $butt_delete->setExtra('onclick="this.form.elements.op.value=\'default\'"');
        $button_tray->addElement($butt_delete);
    }
    $sform->addElement($button_tray);
    $sform->display();
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:55,代码来源:admin_cat_manager.php


示例8: XoopsFormElementTray

 $tosee->setExtra("onkeyup='lookup(this.value);'");
 $tosee_tray = new XoopsFormElementTray(_MP_SEARCH, '&nbsp;');
 $tosee_tray->addElement($tosee);
 //$tosee_tray->addElement(new XoopsFormLabel('', "<a href='###' onclick='lookupC();' >"._MP_CONTACT."</a>"));
 $tosee_tray->addElement(new XoopsFormLabel('', "<div class='suggestionsBox' id='suggestions' style='display: none;'>\r\n\t\t\t\t<div class='suggestionList' id='autoSuggestionsList'>\r\n\t\t\t\t\t&nbsp;\r\n\t\t\t\t</div><div align='center'><a href='#' onclick='closefill();'>Close</a></div> \r\n\t\t</div> "));
 $form->addElement($tosee_tray);
 //boite d'envoie
 $to_username = new XoopsFormSelect('', 'to_userid', @$_REQUEST['to_userid'], 5, true);
 $to_username->setExtra("style=\"width:170px;\" ");
 $to_username2 = new XoopsFormElementTray(_MP_CTT, '&nbsp;');
 $to_username2->setDescription(sprintf(_MP_UNOTE, $xoopsModuleConfig['senduser']));
 $to_username2->addElement($to_username);
 $to_username2->addElement(new XoopsFormLabel('', "<small><br /><a href='###' onclick='delfill();' >" . _MP_MDEL . "</a> | <a href='###' onclick='delallfill();' >" . _MP_MDELALL . "</a></small>"));
 $form->addElement($to_username2);
 $button_tray = new XoopsFormElementTray('', '');
 $post_button = new XoopsFormButton('', 'post_messages', _MP_SUBMIT, "submit");
 $post_button->setExtra("onclick='document.read.action=\"contbox.php?op=envoimp\",selectfill(" . $xoopsModuleConfig['senduser'] . ")'");
 $button_tray->addElement($post_button);
 $button_tray->addElement(new XoopsFormButton('', 'reset', _MP_CLEAR, 'reset'));
 $form->addElement($button_tray);
 if ($view_perms & GPERM_MESS) {
     if (empty($mpstop)) {
         $box_actions[] = '<select name="add" class="xo-message-form"  OnChange="window.document.location=this.options[this.selectedIndex].value;"><option selected>' . _MP_MNEWS . '</option><option value="' . XOOPS_URL . '/modules/' . $mydirname . '/msgbox.php?op=sendbox&send=1">-> ' . _MP_MMES . '</option><option value="' . XOOPS_URL . '/modules/' . $mydirname . '/contbox.php?op=sendbox">-> ' . _MP_MCONT . '</option><option value="' . XOOPS_URL . '/modules/' . $mydirname . '/filebox.php?op=sendbox">-> ' . _MP_MFILE . '</option></select>';
         $box_actions[] = "<input type='submit' class='xo-message-form' onclick='document.prvmsg.action=\"contbox.php?op=envoimp\"' id='post_messages' value='" . _MP_SUBMIT . "'>";
     } else {
         $box_actions[] = '<select name="add" class="xo-message-form"  OnChange="window.document.location=this.options[this.selectedIndex].value;" disabled><option selected>' . _MP_MNEWS . '</option><option value="' . XOOPS_URL . '/modules/' . $mydirname . '/msgbox.php?op=sendbox&send=1">-> ' . _MP_MMES . '</option><option value="' . XOOPS_URL . '/modules/' . $mydirname . '/contbox.php?op=sendbox">-> ' . _MP_MCONT . '</option><option value="' . XOOPS_URL . '/modules/' . $mydirname . '/filebox.php?op=sendbox">-> ' . _MP_MFILE . '</option></select>';
         $box_actions[] = "<input type='submit' class='xo-message-form' onclick='document.prvmsg.action=\"contbox.php?op=envoimp\"' id='stop' disabled value='" . _MP_SUBMIT . "'>";
     }
 }
 $box_actions[] = "<input type='reset' class='xo-message-form' id='reset'  value='" . _MP_CLEAR . "'>";
 $box_actions[] = "<input type='button' class='xo-message-form' OnClick=\"msgpop('&nbsp;" . _MP_HELP_CONTSEND . "&nbsp;')\" value='?'><div id=\"tooltip\" style=\"visibility: hidden;\"></div>";
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:contbox.php


示例9: createButtons

 function createButtons()
 {
     // Action buttons tray
     $button_tray = new XoopsFormElementTray('', '');
     /*for ($i = 0; $i < sizeof($moderators); $i++) {
     		$allmods[] = $moderators[$i];
     		}	
     		$hiddenmods = new XoopsFormHidden('allmods', $allmods);
     		$button_tray->addElement($hiddenmods);
     		*/
     $hidden = new XoopsFormHidden('op', 'addcategory');
     $button_tray->addElement($hidden);
     // No ID for category -- then it's new category, button says 'Create'
     if (!$this->targetObject->categoryid()) {
         $butt_create = new XoopsFormButton('', '', _AM_SSECTION_CREATE, 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_clear = new XoopsFormButton('', '', _AM_SSECTION_CLEAR, 'reset');
         $button_tray->addElement($butt_clear);
         $butt_cancel = new XoopsFormButton('', '', _AM_SSECTION_CANCEL, 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     } else {
         // button says 'Update'
         $butt_create = new XoopsFormButton('', '', _AM_SSECTION_MODIFY, 'submit');
         $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"');
         $button_tray->addElement($butt_create);
         $butt_cancel = new XoopsFormButton('', '', _AM_SSECTION_CANCEL, 'button');
         $butt_cancel->setExtra('onclick="history.go(-1)"');
         $button_tray->addElement($butt_cancel);
         $this->addElement($button_tray);
     }
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:34,代码来源:form-editcategory.php


示例10: Criteria

            //$criteria_article->setLimit($limit_article);
            $criteria_article->setSort("art_id");
            $criteria_article->setOrder("DESC");
            $article_list = $article_list + $article_handler->getList(new Criteria("cat_id", $category_obj->getVar("cat_id")));
            $article_select = new XoopsFormSelect(art_constant("MD_ENTRY_SELECT"), "cat_entry", $category_obj->getVar("cat_entry"));
            $article_select->addOptionArray($article_list);
            $form_art->addElement($article_select);
        }
    }
}
// Sponsor links
$form_art->addElement(new XoopsFormTextArea(art_constant("MD_SPONSOR"), "cat_sponsor", $category_obj->getVar("cat_sponsor", "E")));
//$form_art->addElement(new XoopsFormLabel(art_constant("MD_SPONSOR_DESC"), art_constant("MD_SPONSOR_DESC_TEXT")));
$form_art->addElement(new XoopsFormHidden("cat_id", $category_obj->getVar("cat_id")));
$form_art->addElement(new XoopsFormHidden("from", $from));
$button_tray = new XoopsFormElementTray("", "");
$button_tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
$cancel_button = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
if (!empty($from)) {
    $extra = "admin/admin.category.php";
} elseif ($category_obj->getVar("cat_id")) {
    $extra = "view.category.php?category=" . $category_obj->getVar("cat_id");
} elseif ($category_obj->getVar("cat_pid")) {
    $extra = "view.category.php?category=" . $category_obj->getVar("cat_pid");
} else {
    $extra = "index.php";
}
$cancel_button->setExtra("onclick='window.document.location=\"" . $extra . "\"'");
$button_tray->addElement($cancel_button);
$form_art->addElement($button_tray);
$form_art->display();
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:form.category.php


示例11: editfaq

function editfaq($showmenu = false, $faqid = -1)
{
    global $faq_handler, $category_handler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    // If there is a parameter, and the id exists, retrieve data: we're editing a faq
    if ($faqid != -1) {
        // Creating the FAQ object
        $faqObj = new sfFaq($faqid);
        if ($faqObj->notLoaded()) {
            redirect_header("faq.php", 1, _AM_SF_NOARTTOEDIT);
            exit;
        }
        switch ($faqObj->status()) {
            case _SF_STATUS_ASKED:
                $breadcrumb_action = _AM_SF_APPROVING;
                $collapsableBar_title = _AM_SF_QUESTION_APPROVING;
                $collapsableBar_info = _AM_SF_QUESTION_APPROVING_INFO;
                $button_caption = _AM_SF_QUEUE;
                break;
            case "default":
            default:
                $breadcrumb_action = _AM_SF_EDITING;
                $collapsableBar_title = _AM_SF_EDITQUES;
                $collapsableBar_info = _AM_SF_EDITING_INFO;
                $button_caption = _AM_SF_MODIFY;
                break;
        }
        // Creating the category of this FAQ
        $categoryObj =& $category_handler->get($faqObj->categoryid());
        if ($showmenu) {
            sf_adminMenu(3, _AM_SF_OPEN_QUESTIONS . " > " . $breadcrumb_action);
        }
        echo "<br />\n";
        sf_collapsableBar('bottomtable', 'bottomtableicon');
        echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . $collapsableBar_title . "</h3>";
        echo "<div id='bottomtable'>";
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $collapsableBar_info . "</span>";
    } else {
        // there's no parameter, so we're adding a faq
        $faqObj =& $faq_handler->create();
        $faqObj->setVar('uid', $xoopsUser->getVar('uid'));
        $categoryObj =& $category_handler->create();
        $breadcrumb_action = _AM_SF_CREATINGNEW;
        $button_caption = _AM_SF_CREATE;
        if ($showmenu) {
            sf_adminMenu(3, _AM_SF_OPEN_QUESTIONS . " > " . $breadcrumb_action);
        }
        sf_collapsableBar('bottomtable', 'bottomtableicon');
        echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_CREATEQUESTION . "</h3>";
        echo "<div id='bottomtable'>";
    }
    $sform = new XoopsThemeForm(_AM_SF_OPEN_QUESTION, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    // faq requester
    $sform->addElement(new XoopsFormLabel(_AM_SF_REQUESTED_BY, sf_getLinkedUnameFromId($faqObj->uid(), $xoopsModuleConfig['userealname'])));
    // CATEGORY
    /*
     * Get information for pulldown menu using XoopsTree.
     * First var is the database table
     * Second var is the unique field ID for the categories
     * Last one is not set as we do not have sub menus in Smartfaq
     */
    $mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid");
    ob_start();
    $mytree->makeMySelBox("name", "weight", $categoryObj->categoryid());
    $sform->addElement(new XoopsFormLabel(_AM_SF_CATEGORY_QUESTION, ob_get_contents()));
    ob_end_clean();
    // faq QUESTION
    $sform->addElement(new XoopsFormTextArea(_AM_SF_QUESTION, 'question', $faqObj->question(), 7, 60));
    // PER ITEM PERMISSIONS
    $member_handler =& xoops_gethandler('member');
    $group_list =& $member_handler->getGroupList();
    $groups_checkbox = new XoopsFormCheckBox(_AM_SF_PERMISSIONS_QUESTION, 'groups[]', $faqObj->getGroups_read());
    foreach ($group_list as $group_id => $group_name) {
        if ($group_id != XOOPS_GROUP_ADMIN) {
            $groups_checkbox->addOption($group_id, $group_name);
        }
    }
    $sform->addElement($groups_checkbox);
    // faq ID
    $sform->addElement(new XoopsFormHidden('faqid', $faqObj->faqid()));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addfaq');
    $button_tray->addElement($hidden);
    $sform->addElement(new XoopsFormHidden('status', $faqObj->status()));
    // Setting the FAQ Status
    /*	$status_select = new XoopsFormSelect('', 'status', $status);
    	$status_select->addOptionArray(sf_getStatusArray());
    	$status_tray = new XoopsFormElementTray(_AM_SF_STATUS_EXP , '&nbsp;');
    	$status_tray->addElement($status_select);
    	$sform->addElement($status_tray);
    	*/
    if ($faqid == -1) {
        // there's no faqid? Then it's a new faq
        // $button_tray -> addElement( new XoopsFormButton( '', 'mod', _AM_SF_CREATE, 'submit' ) );
        $butt_create = new XoopsFormButton('', '', _AM_SF_CREATE, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'addfaq\'"');
        $button_tray->addElement($butt_create);
        $butt_clear = new XoopsFormButton('', '', _AM_SF_CLEAR, 'reset');
        $button_tray->addElement($butt_clear);
//.........这里部分代码省略.........
开发者ID:trabisdementia,项目名称:xuups,代码行数:101,代码来源:question.php


示例12: edititem


//.........这里部分代码省略.........
    $file_box->setExtra("size ='45'");
    $file_box->setDescription(_AM_SS_IMAGE_UPLOAD_ITEM_DSC);
    $sform->addElement($file_box);
    // Uid
    /*  We need to retreive the users manually because for some reason, on the frxoops.org server,
    	    the method users::getobjects encounters a memory error 
    	*/
    $uid = $itemObj->uid() == 0 ? $xoopsUser->uid() : $itemObj->uid();
    $uid_select = new XoopsFormSelect(_AM_SS_UID, 'uid', $uid, 1, false);
    $uid_select->setDescription(_AM_SS_UID_DSC);
    $sql = "SELECT uid, uname FROM " . $xoopsDB->prefix('users') . " ORDER BY uname ASC";
    $result = $xoopsDB->query($sql);
    $users_array = array();
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $users_array[$myrow['uid']] = $myrow['uname'];
    }
    $uid_select->addOptionArray($users_array);
    $sform->addElement($uid_select);
    // Datesub
    $datesub = $itemObj->getVar('datesub') == 0 ? time() : $itemObj->getVar('datesub');
    $datesub_datetime = new XoopsFormDateTime(_AM_SS_DATESUB, 'datesub', $size = 15, $datesub);
    $datesub_datetime->setDescription(_AM_SS_DATESUB_DSC);
    $sform->addElement($datesub_datetime);
    // STATUS
    $options = array(_SS_STATUS_PUBLISHED => _AM_SS_PUBLISHED, _SS_STATUS_OFFLINE => _AM_SS_OFFLINE);
    $status_select = new XoopsFormSelect(_AM_SS_STATUS, 'status', $new_status);
    $status_select->addOptionArray($options);
    $status_select->setDescription(_AM_SS_STATUS_DSC);
    $sform->addElement($status_select);
    // WEIGHT
    $sform->addElement(new XoopsFormText(_AM_SS_WEIGHT, 'weight', 5, 5, $itemObj->weight()), true);
    // COMMENTS
    $addcomments_radio = new XoopsFormRadioYN(_AM_SS_ALLOWCOMMENTS, 'cancomment', $itemObj->cancomment(), ' ' . _AM_SS_YES . '', ' ' . _AM_SS_NO . '');
    $sform->addElement($addcomments_radio);
    // PER ITEM PERMISSIONS
    $member_handler =& xoops_gethandler('member');
    $group_list =& $member_handler->getGroupList();
    $groups_checkbox = new XoopsFormCheckBox(_AM_SS_PERMISSIONS_ITEM, 'groups[]', $itemObj->getGroups_read());
    $groups_checkbox->setDescription(_AM_SS_PERMISSIONS_ITEM_DSC);
    foreach ($group_list as $group_id => $group_name) {
        if ($group_id != XOOPS_GROUP_ADMIN) {
            $groups_checkbox->addOption($group_id, $group_name);
        }
    }
    $sform->addElement($groups_checkbox);
    // VARIOUS OPTIONS
    $options_tray = new XoopsFormElementTray(_AM_SS_OPTIONS, '<br />');
    $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $itemObj->dohtml());
    $html_checkbox->addOption(1, _AM_SS_DOHTML);
    $options_tray->addElement($html_checkbox);
    $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $itemObj->dosmiley());
    $smiley_checkbox->addOption(1, _AM_SS_DOSMILEY);
    $options_tray->addElement($smiley_checkbox);
    $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', $itemObj->doxcode());
    $xcodes_checkbox->addOption(1, _AM_SS_DOXCODE);
    $options_tray->addElement($xcodes_checkbox);
    $images_checkbox = new XoopsFormCheckBox('', 'doimage', $itemObj->doimage());
    $images_checkbox->addOption(1, _AM_SS_DOIMAGE);
    $options_tray->addElement($images_checkbox);
    $linebreak_checkbox = new XoopsFormCheckBox('', 'dobr', $itemObj->dobr());
    $linebreak_checkbox->addOption(1, _AM_SS_DOLINEBREAK);
    $options_tray->addElement($linebreak_checkbox);
    $sform->addElement($options_tray);
    // item ID
    $sform->addElement(new XoopsFormHidden('itemid', $itemObj->itemid()));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'additem');
    $button_tray->addElement($hidden);
    if (!$itemid) {
        // there's no itemid? Then it's a new item
        // $button_tray -> addElement( new XoopsFormButton( '', 'mod', _AM_SS_CREATE, 'submit' ) );
        $butt_create = new XoopsFormButton('', '', _AM_SS_CREATE, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'additem\'"');
        $button_tray->addElement($butt_create);
        $butt_clear = new XoopsFormButton('', '', _AM_SS_CLEAR, 'reset');
        $button_tray->addElement($butt_clear);
        $butt_cancel = new XoopsFormButton('', '', _AM_SS_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
        $sform->addElement($button_tray);
        $sform->display();
        ss_close_collapsable('createitemtable', 'createitemicon');
    } else {
        // else, we're editing an existing item
        // $button_tray -> addElement( new XoopsFormButton( '', 'mod', _AM_SS_MODIFY, 'submit' ) );
        $butt_create = new XoopsFormButton('', '', $button_caption, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'additem\'"');
        $button_tray->addElement($butt_create);
        $butt_cancel = new XoopsFormButton('', '', _AM_SS_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
        $sform->addElement($button_tray);
        $sform->display();
        ss_close_collapsable('edititemtable', 'edititemicon');
    }
    unset($hidden);
    if ($itemid != 0) {
        showfiles($itemObj);
    }
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:101,代码来源:item.php


示例13: getcss

					</form>
				</body>
			</html>';
        break;
    case 'createLink':
        echo '<link rel="stylesheet" type="text/css" media="all" href="' . getcss($xoopsConfig['theme_set']) . '" />';
        echo '</head>
		<body  class="' . $skin . 'PropsBody" style="width:100%;" onLoad="XK_MakeAnchorSelect(\'' . $id . '\')">';
        include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        $sform = new XoopsThemeForm(_XK_EDITIMAGE, 'linkform', xoops_getenv('PHP_SELF'));
        $sform->addElement(new XoopsFormText('Url', 'url', 20, 100, ''), true);
        $select = new XoopsFormSelect('Anchor', 'anchor', '', 1, false);
        $select->setExtra('onchange="XK_disableUrlTextField(this.options[this.selectedIndex].value)"');
        $sform->addElement($select);
        $sform->addElement(new XoopsFormSelect('Open', 'open', '', 1, false), true);
        $button_tray = new XoopsFormElementTray('', '');
        $button_submit = new XoopsFormButton('', '', _SUBMIT, 'button');
        $button_submit->setExtra('onclick="sendLink(\'' . $id . '\')"');
        $button_cancel = new XoopsFormButton('', '', _CANCEL, 'button');
        $button_cancel->setExtra('onclick="window.close()"');
        $button_tray->addElement($button_submit);
        $button_tray->addElement($button_cancel);
        $sform->addElement($button_tray);
        $sform->display();
        break;
    default:
        echo '</head><body onload="window.close()">';
        echo 'ERROR';
        echo '</body></html>';
        break;
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:dialogs.php


示例14: addSubmitButton

function addSubmitButton($form, $subButtonText, $go_back = "", $currentURL, $button_text, $settings, $entry, $fids, $formframe, $mainform, $cur_entry, $profileForm, $elements_allowed = "", $allDoneOverride = false, $printall = 0, $screen = null)
{
    //nmc 2007.03.24 - added $printall
    if ($printall == 2) {
        // 2 is special setting in multipage screens that means do not include any printable buttons of any kind
        return $form;
    }
    if (strstr($currentURL, "printview.php")) {
        // don't do anything if we're on the print view
        return $form;
    } else {
        drawGoBackForm($go_back, $currentURL, $settings, $entry);
        if (!$button_text or $button_text == "{NOBUTTON}" and $go_back['form'] > 0) {
            // presence of a goback form (ie: parent form) overrides {NOBUTTON} -- assumption is the save button will not also be overridden at the same time
            $button_text = _formulize_DONE;
        } elseif (is_array($button_text)) {
            if (!$button_text[0]) {
                $done_text_temp = _formulize_DONE;
            } else {
                $done_text_temp = $button_text[0];
            }
            if (!$button_text[1]) {
                $save_text_temp = _formulize_SAVE;
            } else {
                $save_text_temp = $button_text[1];
            }
        }
        // override -- the "no-all-done-button" config option turns off the all done button and changes save into a save-and-leave button
        // need to grab the $nosubforms variable created by the multiple page function, so we know to put the printable view button (and nothing else) on the screen for multipage forms
        global $nosubforms;
        if (!$profileForm and ($save_text_temp != "{NOBUTTON}" or $nosubforms)) {
            // do not use printable button for profile forms, or forms where there is no Save button (ie: a non-standard saving process is in use and access to the normal printable option may be prohibited)
            $printbutton = new XoopsFormButton('', 'printbutton', _formulize_PRINTVIEW, 'button');
            if (is_array($elements_allowed)) {
                $ele_allowed = implode(",", $elements_allowed);
            }
            $printbutton->setExtra("onclick='javascript:PrintPop(\"{$ele_allowed}\");'");
            $rendered_buttons = $printbutton->render();
            // nmc 2007.03.24 - added
            if ($printall) {
                // nmc 2007.03.24 - added
                $printallbutton = new XoopsFormButton('', 'printallbutton', _formulize_PRINTALLVIEW, 'button');
                // nmc 2007.03.24 - added
                $printallbutton->setExtra("onclick='javascript:PrintAllPop();'");
                // nmc 2007.03.24 - added
                $rendered_buttons .= "&nbsp;&nbsp;&nbsp;" . $printallbutton->render();
                // nmc 2007.03.24 - added
            }
            $buttontray = new XoopsFormElementTray($rendered_buttons, "&nbsp;");
            // nmc 2007.03.24 - amended [nb: FormElementTray 'caption' is actually either 1 or 2 buttons]
        } else {
            $buttontray = new XoopsFormElementTray("", "&nbsp;");
        }
        $buttontray->setClass("no-print");
        if ($subButtonText == _formulize_SAVE) {
            // _formulize_SAVE is passed only when the save button is allowed to be drawn
            if ($save_text_temp) {
                $subButtonText = $save_text_temp;
            }
            if ($subButtonText != "{NOBUTTON}") {
                $saveButton = new XoopsFormButton('', 'submitx', trans($subButtonText), 'button');
                // doesn't use name submit since that conflicts with the submit javascript function
                $saveButton->setExtra("onclick=javascript:validateAndSubmit();");
                $buttontray->addElement($saveButton);
                // also add in the save and leave button
                $saveAndLeaveButton = new XoopsFormButton('', 'submit_save_and_leave', trans(_formulize_SAVE_AND_LEAVE), 'button');
                $saveAndLeaveButton->setExtra("onclick=javascript:validateAndSubmit('leave');");
                $buttontray->addElement($saveAndLeaveButton);
            }
        }
        if (($button_text != "{NOBUTTON}" and !$done_text_temp or isset($done_text_temp) and $done_text_temp != "{NOBUTTON}") and !$allDoneOverride) {
            if ($done_text_temp) {
                $button_text = $done_text_temp;
            }
            $donebutton = new XoopsFormButton('', 'donebutton', trans($button_text), 'button');
            $donebutton->setExtra("onclick=javascript:verifyDone();");
            $buttontray->addElement($donebutton);
        }
        if (!$profileForm) {
            // do not use printable button for profile forms
            $newcurrentURL = XOOPS_URL . "/modules/formulize/printview.php";
            print "<form name='printview' action='" . $newcurrentURL . "' method=post target=_blank>\n";
            // add security token
            if (isset($GLOBALS['xoopsSecurity'])) {
                print $GLOBALS['xoopsSecurity']->getTokenHTML();
            }
            $currentPage = "";
            $screenid = "";
            if ($screen) {
                $screenid = $screen->getVar('sid');
                // check for a current page setting
                if (isset($settings['formulize_currentPage'])) {
                    $currentPage = $settings['formulize_currentPage'];
                }
            }
            print "<input type=hidden name=screenid value='" . $screenid . "'>";
            print "<input type=hidden name=currentpage value='" . $currentPage . "'>";
            print "<input type=hidden name=lastentry value=" . $cur_entry . ">";
            if ($go_back['form']) {
                // we're on a sub, so display this form only
//.........这里部分代码省略.........
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:101,代码来源:formdisplay.php


示例15: isset

     $smarty->assign("datasetContext", $ds['context']);
     $smarty->assign("dataset`Method", $ds['method']);
     $smarty->assign("score", isset($_POST['score']) ? $_POST['score'] : 0.5);
     $docs = getDocuments($iddataset);
     $smarty->assign("documents", $docs);
     $urlsinativas = new XoopsFormSelect("", "iurls", null, 20);
     $urlsinativas->_class = "SelectList";
     $urlsinativas->addOptionArray(pegaUrlsInativas($iddataset));
     $smarty->assign("lstUrlsInativas", $url 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XoopsFormCheckBox类代码示例发布时间:2022-05-23
下一篇:
PHP XoopsDatabaseFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap