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


PHP XoopsFormButton::setExtra方法代码示例

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


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

示例1: createButtons

 /**
  * @创建按钮
  * @license   http://www.blags.org/
  * @created   :2010年05月20日 23时52分
  * @copyright 1997-2010 The Martin Group
  * @author    Martin <china.codehome@gmail.com>
  * */
 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 <china.codehome@gmail.com> 
  * */
 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_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>";
 $box_actions[] = "<input type='hidden' name='catbox' value='" . $catbox . "'>";
开发者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: XoopsThemeForm

} else {
    include XOOPS_ROOT_PATH . '/header.php';
    include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $report_form = new XoopsThemeForm('', 'reportform', 'report.php');
    $report_form->addElement(new XoopsFormText(_MD_REPORT_TEXT, 'report_text', 80, 255), true);
    $report_form->addElement(new XoopsFormHidden('pid', $pid));
    $report_form->addElement(new XoopsFormHidden('post_id', $post_id));
    $report_form->addElement(new XoopsFormHidden('topic_id', $topic_id));
    $report_form->addElement(new XoopsFormHidden('forum', $forum));
    $report_form->addElement(new XoopsFormHidden('viewmode', $viewmode));
    $report_form->addElement(new XoopsFormHidden('order', $order));
    $button_tray = new XoopsFormElementTray('');
    $submit_button = new XoopsFormButton('', 'submit', _SUBMIT, "submit");
    $cancel_button = new XoopsFormButton('', 'cancel', _MD_CANCELPOST, 'button');
    $extra = "viewtopic.php?forum={$forum}&amp;topic_id={$topic_id}&amp;post_id={$post_id}&amp;order={$order}&amp;viewmode={$viewmode}";
    $cancel_button->setExtra("onclick='location=\"" . $extra . "\"'");
    $button_tray->addElement($submit_button);
    $button_tray->addElement($cancel_button);
    $report_form->addElement($button_tray);
    $report_form->display();
    $post_handler =& xoops_getmodulehandler('post', 'newbb');
    $forumpost =& $post_handler->get($post_id);
    $r_subject = $forumpost->getVar('subject', "E");
    if ($xoopsModuleConfig['enable_karma'] && $forumpost->getVar('post_karma') > 0) {
        $r_message = sprintf(_MD_KARMA_REQUIREMENT, "***", $forumpost->getVar('post_karma')) . "</div>";
    } elseif ($xoopsModuleConfig['allow_require_reply'] && $forumpost->getVar('require_reply')) {
        $r_message = _MD_REPLY_REQUIREMENT;
    } else {
        $r_message = $forumpost->getVar('post_text');
    }
    $r_date = formatTimestamp($forumpost->getVar('post_time'));
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:report.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: getForm


//.........这里部分代码省略.........
                 $title = _AM_SYSTEM_BLOCKS_CLONEBLOCK;
                 $this->setVar('bid', 0);
                 if ($this->isCustom()) {
                     $this->setVar('block_type', 'C');
                 } else {
                     $this->setVar('block_type', 'D');
                 }
                 break;
         }
         $op = 'save';
     }
     $form = new XoopsThemeForm($title, 'blockform', 'admin.php', 'post', true);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $this->getVar('name')));
     }
     // Side position
     $side_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'side', $this->getVar('side'));
     $side_select->addOptionArray(array(0 => _AM_SYSTEM_BLOCKS_SBLEFT, 1 => _AM_SYSTEM_BLOCKS_SBRIGHT, 3 => _AM_SYSTEM_BLOCKS_CBLEFT, 4 => _AM_SYSTEM_BLOCKS_CBRIGHT, 5 => _AM_SYSTEM_BLOCKS_CBCENTER, 7 => _AM_SYSTEM_BLOCKS_CBBOTTOMLEFT, 8 => _AM_SYSTEM_BLOCKS_CBBOTTOMRIGHT, 9 => _AM_SYSTEM_BLOCKS_CBBOTTOM));
     $form->addElement($side_select);
     // Order
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BLOCKS_WEIGHT, 'weight', 2, 5, $this->getVar('weight')));
     // Display
     $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BLOCKS_VISIBLE, 'visible', $this->getVar('visible')));
     // Visible In
     $mod_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_VISIBLEIN, 'modules', $modules, 5, true);
     $module_handler =& xoops_gethandler('module');
     $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
     $criteria->add(new Criteria('isactive', 1));
     $module_list = $module_handler->getList($criteria);
     $module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE;
     $module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES;
     ksort($module_list);
     $mod_select->addOptionArray($module_list);
     $form->addElement($mod_select);
     // Title
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BLOCKS_TITLE, 'title', 50, 255, $this->getVar('title')), false);
     if ($this->isNew() || $this->isCustom()) {
         $editor_configs = array();
         $editor_configs["name"] = "content_block";
         $editor_configs["value"] = $this->getVar('content', 'e');
         $editor_configs["rows"] = 20;
         $editor_configs["cols"] = 100;
         $editor_configs["width"] = "100%";
         $editor_configs["height"] = "400px";
         $editor_configs["editor"] = xoops_getModuleOption('blocks_editor', 'system');
         $form->addElement(new XoopsFormEditor(_AM_SYSTEM_BLOCKS_CONTENT, "content_block", $editor_configs), true);
         if (in_array($editor_configs["editor"], array('dhtmltextarea', 'textarea'))) {
             $ctype_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'c_type', $this->getVar('c_type'));
             $ctype_select->addOptionArray(array('H' => _AM_SYSTEM_BLOCKS_HTML, 'P' => _AM_SYSTEM_BLOCKS_PHP, 'S' => _AM_SYSTEM_BLOCKS_AFWSMILE, 'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE));
             $form->addElement($ctype_select);
         } else {
             $form->addElement(new XoopsFormHidden('c_type', 'H'));
         }
     } else {
         if ($this->getVar('template') != '') {
             $tplfile_handler =& xoops_gethandler('tplfile');
             $btemplate = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $this->getVar('bid'));
             if (count($btemplate) > 0) {
                 $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&amp;op=edittpl&amp;id=' . $btemplate[0]->getVar('tpl_id') . '">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>'));
             } else {
                 $btemplate2 = $tplfile_handler->find('default', 'block', $this->getVar('bid'));
                 if (count($btemplate2) > 0) {
                     $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&amp;op=edittpl&amp;id=' . $btemplate2[0]->getVar('tpl_id') . '" rel="external">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>'));
                 }
             }
         }
         if ($this->getOptions() != false) {
             $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $this->getOptions()));
         } else {
             $form->addElement(new XoopsFormHidden('options', $this->getVar('options')));
         }
         $form->addElement(new XoopsFormHidden('c_type', 'H'));
     }
     $cache_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $this->getVar('bcachetime'));
     $cache_select->addOptionArray(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, '2592000' => _MONTH));
     $form->addElement($cache_select);
     // Groups
     $form->addElement(new XoopsFormSelectGroup(_AM_SYSTEM_BLOCKS_GROUP, 'groups', true, $groups, 5, true));
     $form->addElement(new XoopsFormHidden('block_type', $this->getVar('block_type')));
     $form->addElement(new XoopsFormHidden('mid', $this->getVar('mid')));
     $form->addElement(new XoopsFormHidden('func_num', $this->getVar('func_num')));
     $form->addElement(new XoopsFormHidden('func_file', $this->getVar('func_file')));
     $form->addElement(new XoopsFormHidden('show_func', $this->getVar('show_func')));
     $form->addElement(new XoopsFormHidden('edit_func', $this->getVar('edit_func')));
     $form->addElement(new XoopsFormHidden('template', $this->getVar('template')));
     $form->addElement(new XoopsFormHidden('dirname', $this->getVar('dirname')));
     $form->addElement(new XoopsFormHidden('name', $this->getVar('name')));
     $form->addElement(new XoopsFormHidden('bid', $this->getVar('bid')));
     $form->addElement(new XoopsFormHidden('op', $op));
     $form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
     $button_tray = new XoopsFormElementTray('', '&nbsp;');
     if ($this->isNew() || $this->isCustom()) {
         $preview = new XoopsFormButton('', 'previewblock', _PREVIEW, 'preview');
         $preview->setExtra("onclick=\"blocks_preview();\"");
         $button_tray->addElement($preview);
     }
     $button_tray->addElement(new XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'));
     $form->addElement($button_tray);
     return $form;
 }
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:101,代码来源:block.php


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