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


PHP XoopsThemeForm::insertBreak方法代码示例

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


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

示例1: getForm

 function getForm($action = false)
 {
     global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULES_ADD) : sprintf(_AM_TDMCREATE_MODULES_EDIT);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $form = new XoopsThemeForm($title, 'form_modules', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->insertBreak('<div align="center"><b>' . _AM_TDMCREATE_MODULES_IMPORTANT . '</b></div>', 'head');
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'modules_name', 50, 255, $this->getVar('modules_name')), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'modules_version', 50, 255, $this->getVar('modules_version')), true);
     $form->addElement(new XoopsFormTextArea(_AM_TDMCREATE_MODULES_DESCRIPTION, 'modules_description', $this->getVar('modules_description'), 3, 47), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR, 'modules_author', 50, 255, $this->getVar('modules_author')), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_LICENSE, 'modules_license', 50, 255, $this->getVar('modules_license')), true);
     $modules_display_menu = $this->isNew() ? '1' : $this->getVar('modules_display_menu');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_MENU, 'modules_display_menu', $modules_display_menu, _YES, _NO));
     $modules_display_admin = $this->isNew() ? '1' : $this->getVar('modules_display_admin');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_ADMIN, 'modules_display_admin', $modules_display_admin, _YES, _NO));
     $modules_active_search = $this->isNew() ? '1' : $this->getVar('modules_active_search');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_SEARCH, 'modules_active_search', $modules_active_search, _YES, _NO));
     $modules_image = $this->getVar('modules_image') ? $this->getVar('modules_image') : 'blank.gif';
     $uploadirectory = "/modules/" . $xoopsModule->dirname() . "/images/uploads/modules";
     $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULES_IMAGE, '<br />');
     $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./modules/" . $xoopsModule->dirname() . "/images/uploads/modules");
     $imageselect = new XoopsFormSelect($imgpath, 'modules_image', $modules_image);
     $modules_image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadirectory);
     foreach ($modules_image_array as $image) {
         $imageselect->addOption("{$image}", $image);
     }
     $imageselect->setExtra("onchange='showImgSelected(\"image3\", \"modules_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'");
     $imgtray->addElement($imageselect, false);
     $imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $modules_image . "' name='image3' id='image3' alt='' />"));
     $fileseltray = new XoopsFormElementTray('', '<br />');
     $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', 104857600), false);
     $fileseltray->addElement(new XoopsFormLabel(''), false);
     $imgtray->addElement($fileseltray);
     $form->addElement($imgtray);
     $form->insertBreak('<div align="center"><b>' . _AM_TDMCREATE_MODULES_NOTIMPORTANT . '</b></div>', 'head');
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_URL, 'modules_author_website_url', 50, 255, $this->getVar('modules_author_website_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_NAME, 'modules_author_website_name', 50, 255, $this->getVar('modules_author_website_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_CREDITS, 'modules_credits', 50, 255, $this->getVar('modules_credits')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_INFO, 'modules_release_info', 50, 255, $this->getVar('modules_release_info')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_FILE, 'modules_release_file', 50, 255, $this->getVar('modules_release_file')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL, 'modules_manual', 50, 255, $this->getVar('modules_manual')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL_FILE, 'modules_manual_file', 50, 255, $this->getVar('modules_manual_file')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_URL, 'modules_demo_site_url', 50, 255, $this->getVar('modules_demo_site_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_NAME, 'modules_demo_site_name', 50, 255, $this->getVar('modules_demo_site_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MODULE_WEBSITE_URL, 'modules_module_website_url', 50, 255, $this->getVar('modules_module_website_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MODULE_WEBSITE_NAME, 'modules_module_website_name', 50, 255, $this->getVar('modules_module_website_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE, 'modules_release', 50, 255, $this->getVar('modules_release')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_STATUS, 'modules_module_status', 50, 255, $this->getVar('modules_module_status')), false);
     $form->addElement(new XoopsFormHidden('op', 'modules_save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     $form->display();
     return $form;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:58,代码来源:tdmcreate_modules.php

示例2: XoopsFormPassword

         break;
     case 'password':
         $myts =& MyTextSanitizer::getInstance();
         $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
         break;
     case 'color':
         $myts =& MyTextSanitizer::getInstance();
         $ele = new XoopsFormColorPicker($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
         break;
     case 'hidden':
         $myts =& MyTextSanitizer::getInstance();
         $ele = new XoopsFormHidden($config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
         break;
     case 'line_break':
         $myts =& MyTextSanitizer::getInstance();
         $form->insertBreak('<center>' . $title . '</center>', $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
         break;
     case 'textbox':
     default:
         $myts =& MyTextSanitizer::getInstance();
         $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
         break;
 }
 if (isset($ele)) {
     $ele->setDescription($description);
     $form->addElement($ele);
 }
 $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
 $form->addElement($hidden);
 unset($ele);
 unset($hidden);
开发者ID:RanLee,项目名称:Xoops_demo,代码行数:31,代码来源:main.php

示例3: sprintf

 }
 $sql = sprintf("SELECT id, weight, description FROM quality_dimension_weight ORDER BY weight");
 $db->query($sql);
 $qdws = array();
 while ($tmp = $db->fetch_assoc()) {
     $qdws[] = $tmp;
 }
 $formulario = new XoopsThemeForm("New DataSet", "inclusao_assunto", "?acao=salvar");
 $formulario->addElement(new XoopsFormText("Name:", "dataset[Nome]", 50, 50));
 $formulario->addElement(new XoopsFormTextArea("Description:", "dataset[Descricao]", "", 5, 80));
 $idioma = new XoopsFormSelect("Language:", "dataset[IdIdioma]", null, 1, false);
 //,"Idioma das páginas inseridas no DataSet");
 $idioma->addOptionArray(pegaIdiomas());
 $formulario->addElement($idioma);
 $formulario->addElement(new XoopsFormText("Min. pages in dataset:", "dataset[MinPagina]", 5, 5, 10));
 $formulario->insertBreak();
 $formulario->insertBreak();
 $method = new XoopsFormSelect("Dataset feeding method:", "dataset[method]", null, 1, false);
 $method->addOptionArray(array('M' => 'Manual', 'C' => 'Crawler + Quality Evaluation', 'Q' => 'Search engines + Quality Evaluation', 'P' => 'Search engines + P of N'));
 $formulario->addElement($method);
 $formulario->addElement(new XoopsFormLabel('If you are using a quality evaluation method, select which quality dimensions you would like FoxSet to evaluate and assign them a weight (click <a href="#" onclick="document.getElementById(\'table_qwds\').style.display = \'block\'; return false;">here</a> to see how the weight scale works):'));
 $tabela = '<div id="table_qwds" style="display: none;"><table cellspacing="10" style="border: 1px solid #000000;"><tr><td><strong>Weight</strong></td><td><strong>Description</strong></td></tr>';
 foreach ($qdws as $qwd) {
     $tabela .= '<tr><td align="center">' . $qwd['weight'] . '</td><td>' . $qwd['description'] . '</td></tr>';
 }
 $tabela .= '</table></div>';
 $formulario->addElement(new XoopsFormLabel($tabela));
 foreach ($qds as $qd) {
     $nametray = 'tray_qd' . $qd['id'];
     ${$nametray} = new XoopsFormElementTray("");
     $namecheck = 'check_qd' . $qd['id'];
开发者ID:mohamedbiniz,项目名称:qualityranking,代码行数:31,代码来源:datasets.php

示例4: XoopsFormPassword

             break;
         case 'password':
             $myts = MyTextSanitizer::getInstance();
             $ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
             break;
         case 'color':
             $myts = MyTextSanitizer::getInstance();
             $ele = new XoopsFormColorPicker($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
             break;
         case 'hidden':
             $myts = MyTextSanitizer::getInstance();
             $ele = new XoopsFormHidden($config[$i]->getVar('conf_name'), $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
             break;
         case 'line_break':
             $myts = MyTextSanitizer::getInstance();
             $form->insertBreak('<div style="text-align:center">' . $title . '</div>', $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
             break;
         case 'textbox':
         default:
             $myts = MyTextSanitizer::getInstance();
             $ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
             break;
     }
     if (isset($ele)) {
         $ele->setDescription($description);
         $form->addElement($ele);
     }
     $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
     $form->addElement($hidden);
     unset($ele, $hidden);
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:main.php

示例5: XoopsThemeForm

     xoops_cp_footer();
     exit;
 }
 include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
 $form = new XoopsThemeForm(_AM_EDITHEADL, 'xoopsheadline_form', 'index.php');
 $form->addElement(new XoopsFormText(_AM_SITENAME, 'headline_name', 50, 255, $hl->getVar('headline_name')), true);
 $form->addElement(new XoopsFormText(_AM_URL, 'headline_url', 50, 255, $hl->getVar('headline_url')), true);
 $form->addElement(new XoopsFormText(_AM_URLEDFXML, 'headline_rssurl', 50, 255, $hl->getVar('headline_rssurl')), true);
 $form->addElement(new XoopsFormText(_AM_ORDER, 'headline_weight', 4, 3, $hl->getVar('headline_weight')));
 $enc_sel = new XoopsFormSelect(_AM_ENCODING, 'headline_encoding', $hl->getVar('headline_encoding'));
 $enc_sel->addOptionArray(array('utf-8' => 'UTF-8', 'iso-8859-1' => 'ISO-8859-1', 'us-ascii' => 'US-ASCII'));
 $form->addElement($enc_sel);
 $cache_sel = new XoopsFormSelect(_AM_CACHETIME, 'headline_cachetime', $hl->getVar('headline_cachetime'));
 $cache_sel->addOptionArray(array('3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
 $form->addElement($cache_sel);
 $form->insertBreak(_AM_MAINSETT);
 $form->addElement(new XoopsFormRadioYN(_AM_DISPLAY, 'headline_display', $hl->getVar('headline_display'), _YES, _NO));
 $form->addElement(new XoopsFormRadioYN(_AM_DISPIMG, 'headline_mainimg', $hl->getVar('headline_mainimg'), _YES, _NO));
 $form->addElement(new XoopsFormRadioYN(_AM_DISPFULL, 'headline_mainfull', $hl->getVar('headline_mainfull'), _YES, _NO));
 $mmax_sel = new XoopsFormSelect(_AM_DISPMAX, 'headline_mainmax', $hl->getVar('headline_mainmax'));
 $mmax_sel->addOptionArray(array('1' => 1, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
 $form->addElement($mmax_sel);
 $form->insertBreak(_AM_BLOCKSETT);
 $form->addElement(new XoopsFormRadioYN(_AM_ASBLOCK, 'headline_asblock', $hl->getVar('headline_asblock'), _YES, _NO));
 $form->addElement(new XoopsFormRadioYN(_AM_DISPIMG, 'headline_blockimg', $hl->getVar('headline_blockimg'), _YES, _NO));
 $bmax_sel = new XoopsFormSelect(_AM_DISPMAX, 'headline_blockmax', $hl->getVar('headline_blockmax'));
 $bmax_sel->addOptionArray(array('1' => 1, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
 $form->addElement($bmax_sel);
 $form->insertBreak();
 $form->addElement(new XoopsFormHidden('headline_id', $hl->getVar('headline_id')));
 $form->addElement(new XoopsFormHidden('op', 'editgo'));
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:index.php

示例6:

 $etrep .= "<td align=left>" . $marque . "</td>";
 $etrep .= "<td align=left>" . _AM_INTER_DELAI . "</td>";
 $etrep .= "<td><input type='text' name='delai' size='10' maxlength='15' value='" . $delai . "'></td>";
 $etrep .= "<tr><td align=left>" . _AM_VEHICULE_MODELE . "</td>";
 $etrep .= "<td align=left>" . $modele_version . "</td>";
 $etrep .= "<td align=left>" . _AM_INTER_KM . "</td>";
 $etrep .= "<td>" . $kilometrage . " Kms</td></tr>";
 $etrep .= "<tr><td colspan=4>&nbsp;</td></tr>";
 $etrep .= "<tr><td align=left>" . _AM_VEHICULE_PROPRIETAIRE . "</td>";
 $etrep .= "<td align=left>" . $civilite . " " . $nom . " " . $prenom . "</td>";
 $etrep .= "<td align=left>" . _AM_CLIENT_TEL . "</td>";
 $etrep .= "<td>" . $teldom . " / " . $telport . "</td></tr>";
 $etrep .= "<tr><td align=left>" . _AM_INTER_TAF . "</td>";
 $etrep .= "<td align=left colspan=3><TEXTAREA style='border: 1px solid #0078F0 ' rows='2' cols='70' name='taf'>" . $description . "</TEXTAREA><br><input type='submit' class='formButton' name='submit' id='submit' value='Mettre &agrave jour' title='MAJ'  /></td></tr>";
 $etrep .= "</table>";
 $form->insertBreak(_AM_VEHICULE_INTERVENTION . '<center><br>' . $etrep . '</center>', 'head');
 $mod_dec = "<table border=1>";
 $mod_dec .= "<tr><td></td>";
 $mod_dec .= "<th colspan=3>" . _AM_INTER_MOD_MECA . "</th>";
 $mod_dec .= "<th colspan=3>" . _AM_INTER_MOD_CARRO . "</th>";
 $mod_dec .= "<td></td></tr>";
 $mod_dec .= "<tr><th align=left width=200px>" . _AM_INTER_EMPL . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_INTER_MOD_T1 . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_INTER_MOD_T2 . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_INTER_MOD_T3 . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_INTER_MOD_T1 . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_INTER_MOD_T2 . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_INTER_MOD_T3 . "</th>";
 $mod_dec .= "<th width=100px>" . _AM_ACTION . "</th></tr>";
 //heures deja declarées
 // init des variables de cumul de la MOD
开发者ID:XoopsModules25x,项目名称:repairshop,代码行数:31,代码来源:inter_pces.php

示例7: XoopsThemeForm

    global $xoopsConfig, $xoopsDB, $myts, $wfsConfig;
  	
  	echo "<div><h4>" . _AM_GENERALCONF . "</h4></div>";
  	//echo "<table width='100%' border='0' cellpadding = '2' cellspacing='1' class='outer'>";

// add adminmenu flag
//	adminmenu();
	if ($wfsAdminMenu) adminmenu();
 
	include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
	
	$sform = new XoopsThemeForm(_AM_MENUS, "op", xoops_getenv('PHP_SELF'));

// easy to rename module and table
//	$sform->insertBreak("<div class = even>WF-Section admin</div>");
	$sform->insertBreak("<div class = even>$wfsTitle admin</div>");

	$sform->insertBreak("<tr class = bg3><td >"._AM_CATEGORYMENU."</td><td></td></tr>");
	
	$showcatpic_radio = new XoopsFormRadioYN(_AM_SHOWCATPIC, 'showcatpic', $wfsConfig['showcatpic'], ' Yes', ' No');
	$sform->addElement($showcatpic_radio);
	
	$submenus_radio = new XoopsFormRadioYN(_AM_SHOWSUBMENU, 'submenus', $wfsConfig['submenus'], ' Yes', ' No');
	$sform->addElement($submenus_radio);
	
	$showMarticles_radio = new XoopsFormRadioYN(_AM_SHOWMARTICLES, 'showMarticles', $wfsConfig['showMarticles'], ' Yes', ' No');
	$sform->addElement($showMarticles_radio);
	
	$showMupdated_radio = new XoopsFormRadioYN(_AM_SHOWMUPDATED, 'showMupdated', $wfsConfig['showMupdated'], ' Yes', ' No');
	$sform->addElement($showMupdated_radio);
	
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:30,代码来源:config.php

示例8: getForm

 function getForm($action = false)
 {
     global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
     $start2 = empty($_REQUEST['start2']) ? 0 : intval($_REQUEST['start2']);
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_MP_TRIE) : sprintf(_MP_TRIE);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $form = new XoopsThemeForm($title, 'form', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->addElement(new XoopsFormTextDateSelect(_PM_AM_PRUNEAFTER, 'after', '15', $after = isset($_REQUEST['after']) ? strtotime($_REQUEST['after']) : time()));
     $form->addElement(new XoopsFormTextDateSelect(_PM_AM_PRUNEBEFORE, 'before', '15', $before = isset($_REQUEST['before']) ? strtotime($_REQUEST['before']) : time()));
     if (!$this->isNew()) {
         //Load groups
         $form->addElement(new XoopsFormHidden('id', $this->getVar('art_id')));
     }
     //editor
     //  $editor_configs=array();
     //	$editor_configs["name"] ="art_text'";
     //$editor_configs["value"] = $this->getVar('art_text', 'e');
     //$editor_configs["rows"] = 20;
     //$editor_configs["cols"] = 140;
     //$editor_configs["width"] = "100%";
     //$editor_configs["height"] = "400px";
     //$editor_configs["editor"] = $xoopsModuleConfig["editor"];
     //$form->addElement( new XoopsFormEditor(_AM_TDMSOUND_TEXT, "art_text", $editor_configs), false );
     //upload
     //affiche membre
     $member_handler =& xoops_gethandler('member');
     $usercount = $member_handler->getUserCount();
     $nav = new XoopsPageNav($usercount, 200, $start2, "start2", "op=purge");
     $user_select = new XoopsFormSelect('', "del_userid", @$_REQUEST['del_userid'], 5, true);
     $user_select->setExtra("style=\"width:170px;\" ");
     $criteria = new CriteriaCompo();
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $criteria->setLimit(200);
     $criteria->setStart($start2);
     $user_select->addOptionArray($member_handler->getUserList($criteria));
     $user_select_tray = new XoopsFormElementTray(_MP_NICKNAME, "<br />");
     $user_select_tray->addElement($user_select);
     $user_select_nav = new XoopsFormLabel('', $nav->renderNav(4));
     $user_select_tray->addElement($user_select_nav);
     $form->addElement($user_select_tray);
     //
     //groupe
     $groupe_select = new XoopsFormSelectGroup(_MP_GROUPE, "del_groupe", false, @$_REQUEST['del_groupe'], 5, true);
     $groupe_select->setExtra("style=\"width:170px;\" ");
     $form->addElement($groupe_select);
     //
     $form->addElement(new XoopsFormRadioYN(_PM_AM_ONLYREADMESSAGES, 'onlyread', $onlyread = isset($_REQUEST['onlyread']) ? $_REQUEST['onlyread'] : 0));
     $form->addElement(new XoopsFormRadioYN(_PM_AM_INCLUDEBOX, 'includebox', $includebox = isset($_REQUEST['includebox']) ? $_REQUEST['includebox'] : 0));
     $form->addElement(new XoopsFormRadioYN(_PM_AM_INCLUDESEND, 'includesend', $includesend = isset($_REQUEST['includesend']) ? $_REQUEST['includesend'] : 0));
     $form->addElement(new XoopsFormRadioYN(_PM_AM_INCLUDESAVE, 'includesave', $includesave = isset($_REQUEST['includesave']) ? $_REQUEST['includesave'] : 0));
     $form->addElement(new XoopsFormRadioYN(_PM_AM_INCLUDEFILE, 'includefile', $includefile = isset($_REQUEST['includefile']) ? $_REQUEST['includefile'] : 0));
     $form->addElement($texte_hidden);
     $form->addElement($promotray);
     $form->addElement($liste_read);
     $button_tray = new XoopsFormElementTray(_MP_ACTION, '');
     $button_tray->addElement(new XoopsFormButton('', 'op', _MP_VISU, 'submit'));
     $form->addElement($button_tray);
     //option purge
     $form->insertBreak(_MP_WARNING, 'odd');
     $form->addElement(new XoopsFormRadioYN(_PM_AM_NOTIFYUSERS, 'notifyusers', $notifyusers = isset($_REQUEST['notifyusers']) ? $_REQUEST['notifyusers'] : 0));
     $form->addElement(new XoopsFormRadioYN(_MP_NOTIFYFILE, 'notifyfile', $notifyfile = isset($_REQUEST['notifyfile']) ? $_REQUEST['notifyfile'] : 0));
     $purge_tray = new XoopsFormElementTray(_MP_ACTION, '');
     $purge_tray->addElement(new XoopsFormButton('', 'op', _MP_PURGE_OK, 'submit'));
     $form->addElement($purge_tray);
     return $form;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:71,代码来源:priv_msgs.php

示例9:

    }
}
//----------form-Start--------------------------
$form->addElement($title_text);
$form->setRequired($title_text);
$form->addElement($cat_select);
if ($mode == G_INSERT) {
    $form->setRequired($cat_select);
}
$form->addElement($cat_select1);
$form->addElement($cat_select2);
$form->addElement($cat_select3);
$form->addElement($cat_select4);
$form->addElement($desc_tarea);
$form->addElement($hidden_body_html);
$form->insertBreak(_MD_GNAV_SMT_TITLE_FILE);
if ($photo['ext']) {
    $form->addElement($photoview);
    if ($gnavi_allownoimage) {
        $form->addElement($del_box);
    }
} else {
    $form->addElement($del_hidden);
}
$form->addElement($file_form);
$form->addElement($caption_text);
if ($photo['ext1']) {
    $form->addElement($photoview1);
    $form->addElement($del_box1);
} else {
    $form->addElement($del_hidden1);
开发者ID:nouphet,项目名称:rata,代码行数:31,代码来源:submit.php

示例10: edittopic

function edittopic($CID = '')
{
    $html = '';
    $smiley = '';
    $xcodes = '';
    $pagetitle = '';
    $pageheadline = '';
    $page = '';
    $breaks = 1;
    $defaultpage = 0;
    $indeximage = '';
    $weight = 1;
    $htmlfile = '';
    $mainpage = 0;
    $submenu = 0;
    $allowcomments = 0;
    global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $XOOPS_URL, $xoopsModuleConfig;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    if ($CID) {
        $result = $xoopsDB->query("SELECT CID,pagetitle, pageheadline, page, weight, html, smiley, xcodes, breaks, defaultpage, indeximage, htmlfile, mainpage, submenu, created, comments, allowcomments  FROM " . $xoopsDB->prefix("wfschannel") . " WHERE CID = {$CID} ");
        list($CID, $pagetitle, $pageheadline, $page, $weight, $html, $smiley, $xcodes, $breaks, $defaultpage, $indeximage, $htmlfile, $mainpage, $submenu, $created, $comments, $allowcomments) = $xoopsDB->fetchrow($result);
        if ($xoopsDB->getRowsNum($result) == 0) {
            redirect_header("index.php", 1, _AM_NOTOPICTOEDIT);
            exit;
        }
        $sform = new XoopsThemeForm(_AM_MODIFYEXSITCHAN, "op", xoops_getenv('PHP_SELF'));
    } else {
        $sform = new XoopsThemeForm(_AM_ADDCHAN, "op", xoops_getenv('PHP_SELF'));
    }
    if (!$indeximage) {
        $indeximage = "blank.png";
    }
    $graph_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['uploaddir']);
    $indeximage_select = new XoopsFormSelect('', 'indeximage', $indeximage);
    $indeximage_select->addOptionArray($graph_array);
    $indeximage_select->setExtra("onchange='showImgSelected(\"image1\", \"indeximage\", \"" . $xoopsModuleConfig['uploaddir'] . "\", \"\", \"" . XOOPS_URL . "\")'");
    $indeximage_tray = new XoopsFormElementTray(_AM_CHAIMAGE, '&nbsp;');
    $indeximage_tray->addElement($indeximage_select);
    $indeximage_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['uploaddir'] . "/" . $indeximage . "' name='image1' id='image1' alt='' />"));
    $sform->addElement($indeximage_tray);
    $sform->addElement(new XoopsFormText(_AM_CHANW, 'weight', 4, 4, $weight));
    $sform->addElement(new XoopsFormText(_AM_CHANQ, 'pagetitle', 50, 255, $pagetitle), true);
    $sform->addElement(new XoopsFormText(_AM_CHANHDL, 'pageheadline', 50, 255, $pageheadline), false);
    ob_start();
    htmlarray($htmlfile, XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['htmluploaddir']);
    $sform->addElement(new XoopsFormLabel(_AM_CHANHTML, ob_get_contents()));
    ob_end_clean();
    $sform->addElement(new XoopsFormDhtmlTextArea(_AM_CHANA, 'page', $page, 15, 60), false);
    $html_checkbox = new XoopsFormCheckBox('', 'html', $html);
    $html_checkbox->addOption(1, _AM_DOHTML);
    $sform->addElement($html_checkbox);
    $smiley_checkbox = new XoopsFormCheckBox('', 'smiley', $smiley);
    $smiley_checkbox->addOption(1, _AM_DOSMILEY);
    $sform->addElement($smiley_checkbox);
    $xcodes_checkbox = new XoopsFormCheckBox('', 'xcodes', $xcodes);
    $xcodes_checkbox->addOption(1, _AM_DOXCODE);
    $sform->addElement($xcodes_checkbox);
    $breaks_checkbox = new XoopsFormCheckBox('', 'breaks', $breaks);
    $breaks_checkbox->addOption(1, _AM_BREAKS);
    $sform->addElement($breaks_checkbox);
    $sform->insertBreak("<b>" . _AM_MENU . "</b>", 'bg3');
    $defaultpage_radio = new XoopsFormRadioYN(_AM_DEFAULT, 'defaultpage', $defaultpage, ' ' . _AM_YES . '', ' ' . _AM_NO . '');
    $sform->addElement($defaultpage_radio);
    if ($defaultpage == 0) {
        $submenuitem_radio = new XoopsFormRadioYN(_AM_SUBMENUITEM, 'submenu', $submenu, ' ' . _AM_YES . '', ' ' . _AM_NO . '');
        $sform->addElement($submenuitem_radio);
        $mainpage_radio = new XoopsFormRadioYN(_AM_MAINPAGEITEM, 'mainpage', $mainpage, ' ' . _AM_YES . '', ' ' . _AM_NO . '');
        $sform->addElement($mainpage_radio);
    }
    if (!isset($allowcomments)) {
        $allowcomments = 0;
    }
    $allowcomments_radio = new XoopsFormRadioYN(_AM_ALLOWCOMMENTSCHANHTML, 'allowcomments', $allowcomments, ' ' . _AM_YES . '', ' ' . _AM_NO . '');
    $sform->addElement($allowcomments_radio);
    $sform->addElement(new XoopsFormHidden('CID', $CID));
    $create_tray = new XoopsFormElementTray('', '');
    $create_tray->addElement(new XoopsFormHidden('op', 'save'));
    if (!$CID) {
        $butt_save = new XoopsFormButton('', '', _AM_CREATE, 'submit');
        $butt_save->setExtra('onclick="this.form.elements.op.value=\'save\'"');
    } else {
        $butt_save = new XoopsFormButton('', '', _AM_MODIFY, 'submit');
        $butt_save->setExtra('onclick="this.form.elements.op.value=\'save\'"');
    }
    $create_tray->addElement($butt_save);
    $butt_cancel = new XoopsFormButton('', '', _AM_CANCEL, 'submit');
    $butt_cancel->setExtra('onclick="this.form.elements.op.value=\'cancel\'"');
    $create_tray->addElement($butt_cancel);
    $sform->addElement($create_tray);
    $sform->display();
    unset($hidden);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:92,代码来源:index.php

示例11: hypconfShowForm


//.........这里部分代码省略.........
        }
        $form = new XoopsThemeForm(hypconf_constant($constpref . '_ADMENU_' . strtoupper($page)), 'pref_form', 'index.php');
        $button_tray = new XoopsFormElementTray("");
        for ($i = 0; $i < $count; $i++) {
            $description = defined($config[$i]['description']) ? constant($config[$i]['description']) : '';
            //$title4tray = (!$description) ? hypconf_constant($config[$i]['title']) : hypconf_constant($config[$i]['title']).'<br /><br /><span style="font-weight:normal;">'.hypconf_constant($config[$i]['description']).'</span>'; // GIJ
            $title4tray = hypconf_constant($config[$i]['title']);
            $title = '';
            // GIJ
            switch ($config[$i]['formtype']) {
                case 'textarea':
                    $myts =& MyTextSanitizer::getInstance();
                    if ($config[$i]['valuetype'] == 'array') {
                        // this is exceptional.. only when value type is arrayneed a smarter way for this
                        $ele = $config[$i]['value'] != '' ? new XoopsFormTextArea($title, $config[$i]['name'], $myts->htmlspecialchars(implode('|', $config[$i]['value'])), 5, 50) : new XoopsFormTextArea($title, $config[$i]['name'], '', 5, 50);
                    } else {
                        $ele = new XoopsFormTextArea($title, $config[$i]['name'], $myts->htmlspecialchars($config[$i]['value']), 5, 50);
                        $ele->setExtra('class="norich"');
                    }
                    break;
                case 'select':
                    $size = 1;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], $size);
                    $options = $config[$i]['options'];
                    $opcount = count($options);
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'select_multi':
                    $size = 5;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], $size, true);
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'check':
                    $ele = new HypconfFormCheckBox($title, $config[$i]['name'], $config[$i]['value']);
                    if (!empty($config[$i]['width'])) {
                        //$ele->setWidth($config[$i]['width']);
                    }
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? hypconf_constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? hypconf_constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'yesno':
                    $ele = new XoopsFormRadioYN($title, $config[$i]['name'], $config[$i]['value'], _YES, _NO);
                    break;
                case 'password':
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $myts =& MyTextSanitizer::getInstance();
                    $ele = new XoopsFormPassword($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value']));
                    break;
                case 'textbox':
                default:
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    $myts =& MyTextSanitizer::getInstance();
                    $ele = new XoopsFormText($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value']));
                    if ($config[$i]['valuetype'] === 'int') {
                        $ele->setExtra(' style="text-align:right;"');
                    }
                    break;
            }
            $ele_tray = new XoopsFormElementTray($title4tray, '');
            $ele_tray->addElement($ele);
            $form->addElement($ele_tray);
            if ($description) {
                $form->insertBreak('<span style="font-weight:normal;">' . $description . '</span>', 'odd');
            }
            unset($ele_tray);
            unset($ele);
        }
        $button_tray->addElement(new XoopsFormHidden('op', 'save'));
        $button_tray->addElement(new XoopsFormHidden('page', $page));
        $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'hypconf');
        $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
        $form->addElement($button_tray);
        $form->display();
    }
}
开发者ID:nouphet,项目名称:rata,代码行数:101,代码来源:admin_func.php

示例12: hypconfShowForm


//.........这里部分代码省略.........
                    break;
                case 'check':
                    $ele = new HypconfFormCheckBox($title, $config[$i]['name'], $config[$i]['value']);
                    if (!empty($config[$i]['width'])) {
                        //$ele->setWidth($config[$i]['width']);
                    }
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? hypconf_constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? hypconf_constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'radio':
                    $ele = new XoopsFormRadio($title, $config[$i]['name'], $config[$i]['value']);
                    if (!empty($config[$i]['width'])) {
                        //$ele->setWidth($config[$i]['width']);
                    }
                    $options = $config[$i]['options'];
                    foreach ($options as $option) {
                        $optval = defined($option['confop_value']) ? hypconf_constant($option['confop_value']) : $option['confop_value'];
                        $optkey = defined($option['confop_name']) ? hypconf_constant($option['confop_name']) : $option['confop_name'];
                        $ele->addOption($optval, $optkey);
                    }
                    break;
                case 'yesno':
                    $ele = new XoopsFormRadioYN($title, $config[$i]['name'], $config[$i]['value'], _YES, _NO);
                    break;
                case 'password':
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || ($myts =& MyTextSanitizer::getInstance());
                    $ele = new XoopsFormPassword($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value'], ENT_COMPAT, _CHARSET));
                    break;
                case 'label':
                    $ele = new XoopsFormLabel($title, $description);
                    $description = '';
                    break;
                case 'theme':
                case 'theme_multi':
                    $ele = $config[$i]['formtype'] !== 'theme_multi' ? new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value']) : new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value'], 5, true);
                    $handle = opendir(XOOPS_THEME_PATH . '/');
                    $dirlist = array();
                    while (false !== ($file = readdir($handle))) {
                        if (is_dir(XOOPS_THEME_PATH . '/' . $file) && !preg_match("/^\\..*\$/", $file) && strtolower($file) != 'cvs') {
                            $dirlist[$file] = $file;
                        }
                    }
                    closedir($handle);
                    $ele->addOption('', hypconf_constant($constpref . '_NOT_SPECIFY'));
                    if (!empty($dirlist)) {
                        asort($dirlist);
                        $ele->addOptionArray($dirlist);
                    }
                    break;
                case 'tplset':
                    $ele = new XoopsFormSelect($title, $config[$i]['name'], $config[$i]['value']);
                    $tplset_handler =& xoops_gethandler('tplset');
                    $tplsetlist =& $tplset_handler->getList();
                    asort($tplsetlist);
                    $ele->addOption('', hypconf_constant($constpref . '_NOT_SPECIFY'));
                    foreach ($tplsetlist as $key => $name) {
                        $ele->addOption($key, htmlspecialchars($name, ENT_QUOTES, _CHARSET));
                    }
                    break;
                case 'textbox':
                default:
                    $size = 50;
                    if (!empty($config[$i]['size'])) {
                        $size = $config[$i]['size'];
                    }
                    (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || ($myts =& MyTextSanitizer::getInstance());
                    $ele = new XoopsFormText($title, $config[$i]['name'], $size, 255, $myts->htmlspecialchars($config[$i]['value'], ENT_COMPAT, _CHARSET));
                    if ($config[$i]['valuetype'] === 'int') {
                        $ele->setExtra(' style="text-align:right;"');
                    }
                    break;
            }
            $ele_tray = new XoopsFormElementTray($title4tray, '');
            $ele_tray->addElement($ele);
            $form->addElement($ele_tray);
            if ($description) {
                $form->insertBreak('<span style="font-weight:normal;">' . $description . '</span>', 'odd');
            }
            unset($ele_tray);
            unset($ele);
        }
        $button_tray->addElement(new XoopsFormHidden('op', 'save'));
        $button_tray->addElement(new XoopsFormHidden('page', $page));
        $xoopsGTicket->addTicketXoopsFormElement($button_tray, __LINE__, 1800, 'hypconf');
        $button_tray->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
        $form->addElement($button_tray);
        $form->display();
    }
    if ($underContents) {
        echo '<div>' . $underContents . '</div>';
    }
}
开发者ID:nao-pon,项目名称:HypCommon,代码行数:101,代码来源:admin_func.php

示例13: while

 if ($res) {
     while (($row = $xoopsDB->fetchArray($res)) != false) {
         $id = $row['id'];
         $nom = $row['nom'];
         $description = $row['description'];
         $tarif = $row['tarif'];
     }
 }
 Xoops_Cp_Header();
 garage_tabsAdminMenu("forfait.php");
 doc_info('forfait');
 $form = new XoopsThemeForm(_AM_FORFAIT_MODIFICATION, 'mforfait', "forfait.php?op=create&id=" . $id, 'post');
 $form->addElement(new XoopsFormText(_AM_FORFAIT_NOM, 'nom_forfait', 50, 255, $nom));
 $form->addElement(new XoopsFormTextArea(_AM_FORFAIT_DESCRIPTION, 'description_forfait', $description, 5, 60));
 $form->addElement(new XoopsFormText(_AM_FORFAIT_TARIF, 'tarif_forfait', 10, 10, $tarif));
 $form->insertBreak('<h3><center>' . _AM_FORFAIT_PIECES . '</center></h3><br>', 'head');
 //pieces
 // ajout de pieces
 $req1 = $xoopsDB->query("SELECT p.id, p.ref, p.designation, f.nom FROM " . $xoopsDB->prefix("garage_pieces") . " p INNER JOIN " . $xoopsDB->prefix("garage_fournisseur") . " f ON f.id = p.id_fournisseur ORDER BY designation ASC");
 $list_id_pieces = array();
 $list_id_pieces[0] = _AM_PCE_MAG;
 while ((list($id_piece, $ref, $designation, $nom_fournisseur) = $xoopsDB->fetchRow($req1)) != false) {
     $list_id_pieces[$id_piece] = $designation . ' - ' . $nom_fournisseur;
 }
 //liste des pieces deja renseignées
 $reqp = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("garage_nomenc_forfait") . " WHERE id_forfait=" . $id);
 $pieces_det = "<table border=1>";
 $pieces_det .= "<tr><th align=left>" . _AM_PCE_DESIG . "</th>";
 $pieces_det .= "<th align=center width=100px>" . _AM_PCE_QTE . "</th>";
 $pieces_det .= "<th align=center width=100px>" . _AM_PCE_PX . "</th>";
 $pieces_det .= "<th align=center width=100px>" . _AM_ACTION . "</th></tr>";
开发者ID:XoopsModules25x,项目名称:repairshop,代码行数:31,代码来源:forfait.php

示例14: getUserForm


//.........这里部分代码省略.........
    $elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_REALNAME, 'name', 25, 75, $user->getVar('name', 'e')), 'required' => 0);
    $weights[0][] = 0;
    $email_tray = new XoopsFormElementTray(_PROFILE_MA_EMAIL, '<br />');
    if ($user->isNew() || $xoopsModuleConfig['allow_chgmail'] == 1 || $xoopsUser->isAdmin()) {
        $email_text = new XoopsFormText('', 'email', 30, 60, $user->getVar('email'));
    } else {
        $email_text = new XoopsFormLabel('', $user->getVar('email'));
    }
    $email_tray->addElement($email_text, $user->isNew() || $xoopsModuleConfig['allow_chgmail'] == 1);
    $elements[0][] = array('element' => $email_tray, 'required' => 0);
    $weights[0][] = 0;
    if ($xoopsUser->isAdmin() && $user->getVar('uid') != $xoopsUser->getVar('uid')) {
        //If the user is an admin and is editing someone else
        $pwd_text = new XoopsFormPassword('', 'password', 10, 32);
        $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
        $pwd_tray = new XoopsFormElementTray(_PROFILE_MA_PASSWORD . '<br />' . _PROFILE_MA_TYPEPASSTWICE);
        $pwd_tray->addElement($pwd_text);
        $pwd_tray->addElement($pwd_text2);
        $elements[0][] = array('element' => $pwd_tray, 'required' => 0);
        //cannot set an element tray required
        $weights[0][] = 0;
        $level_radio = new XoopsFormRadio(_PROFILE_MA_ACTIVEUSER, 'level', $user->getVar('level'));
        $level_radio->addOption(1, _PROFILE_MA_ACTIVE);
        $level_radio->addOption(0, _PROFILE_MA_INACTIVE);
        $level_radio->addOption(-1, _PROFILE_MA_DISABLED);
        $elements[0][] = array('element' => $level_radio, 'required' => 0);
        $weights[0][] = 0;
    }
    $elements[0][] = array('element' => new XoopsFormHidden('uid', $user->getVar('uid')), 'required' => 0);
    $weights[0][] = 0;
    $elements[0][] = array('element' => new XoopsFormHidden('op', 'save'), 'required' => 0);
    $weights[0][] = 0;
    if ($xoopsUser && $xoopsUser->isAdmin()) {
        $xoopsModule->loadLanguage("admin");
        $rank_select = new XoopsFormSelect(_PROFILE_AM_RANK, "rank", $user->getVar('rank'));
        $ranklist = XoopsLists::getUserRankList();
        if (count($ranklist) > 0) {
            $rank_select->addOption(0, _PROFILE_AM_NSRA);
            $rank_select->addOption(0, "--------------");
            $rank_select->addOptionArray($ranklist);
        } else {
            $rank_select->addOption(0, _PROFILE_AM_NSRID);
        }
        $elements[0][] = array('element' => $rank_select, 'required' => 0);
        $weights[0][] = 0;
        $gperm_handler =& xoops_gethandler('groupperm');
        //If user has admin rights on groups
        include_once XOOPS_ROOT_PATH . "/modules/system/constants.php";
        if ($gperm_handler->checkRight("system_admin", XOOPS_SYSTEM_GROUP, $xoopsUser->getGroups(), 1)) {
            //add group selection
            $group_select = new XoopsFormSelectGroup(_PROFILE_AM_GROUP, 'groups', false, $user->getGroups(), 5, true);
            $elements[0][] = array('element' => $group_select, 'required' => 0);
            $weights[0][] = 0;
        }
    }
    // Dynamic fields
    $profile_handler =& xoops_gethandler('profile');
    // Get fields
    $fields =& $profile_handler->loadFields();
    // Get ids of fields that can be edited
    $gperm_handler =& xoops_gethandler('groupperm');
    $editable_fields = $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
    $profile_fieldcat_handler =& xoops_getmodulehandler('fieldcategory');
    /* @var $profile_fieldcat_handler ProfileFieldCategoryHandler */
    $profile_cat_handler =& xoops_getmodulehandler('category');
    /* @var $profile_cat_handler ProfileCategoryHandler */
    $fieldcats =& $profile_fieldcat_handler->getObjects(null, true);
    if (count($fieldcats) > 0) {
        foreach (array_keys($fieldcats) as $i) {
            $catids[] = $fieldcats[$i]->getVar('catid');
        }
        $categories =& $profile_cat_handler->getObjects(new Criteria('catid', "(" . implode(',', array_unique($catids)) . ")", "IN"), true, false);
    }
    $fieldcat_handler =& xoops_getmodulehandler('fieldcategory');
    $fieldcats =& $fieldcat_handler->getObjects(null, true);
    foreach (array_keys($fields) as $i) {
        if (in_array($fields[$i]->getVar('fieldid'), $editable_fields)) {
            $fieldinfo['element'] = $fields[$i]->getEditElement($user);
            $fieldinfo['required'] = $fields[$i]->getVar('field_required');
            if (isset($fieldcats[$fields[$i]->getVar('fieldid')])) {
                $key = $fieldcats[$fields[$i]->getVar('fieldid')]->getVar('catid');
            } else {
                $key = 0;
            }
            $elements[$key][] = $fieldinfo;
            $weights[$key][] = isset($fieldcats[$fields[$i]->getVar('fieldid')]) ? intval($fieldcats[$fields[$i]->getVar('fieldid')]->getVar('field_weight')) : 1;
        }
    }
    ksort($elements);
    foreach (array_keys($elements) as $k) {
        array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
        $title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _PROFILE_MA_DEFAULT;
        $form->insertBreak($title, 'head');
        foreach (array_keys($elements[$k]) as $i) {
            $form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
        }
    }
    $form->addElement(new XoopsFormButton('', 'submit', _PROFILE_MA_SAVECHANGES, 'submit'));
    return $form;
}
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:101,代码来源:forms.php

示例15: array

 $form_home->addOption(1, '&nbsp;');
 $form->addElement($form_home);
 $options = array();
 $promotray = new XoopsFormElementTray('');
 $option_select = new XoopsFormSelect(_MP_FORMTYPE, 'formtype', $formtype);
 // $option_wins = array(
 // '1' => 'Compact' , '2' => 'DHTML','3' => 'htmlarea', '4' => 'Koivi', '5' => 'TinyEditor', '6' => 'Inbetween' , '7' => 'spaw', '8' => 'FCK');
 $option_wins = mp_selecteditor();
 foreach ($xoopsModuleConfig['wysiwyg'] as $option) {
     if (!empty($option_wins[$option])) {
         $options[$option] = $option_wins[$option];
     }
 }
 $option_select->addOptionArray($options);
 $form->addElement($option_select);
 $form->insertBreak(_MP_TRI_TRI, 'odd');
 $order_select = array('subject' => _MP_TRI_TITLE, 'msg_time' => _MP_TRI_DATE, 'read_msg' => _MP_TRI_READ);
 $thread_select = new XoopsFormSelect("", "sortname", $sortname);
 $thread_select->addOptionArray($order_select);
 $sortorder_select = array('asc' => _MP_TRI_OASC, 'desc' => _MP_TRI_ODESC);
 $sort_select = new XoopsFormSelect("", "sortorder", $sortorder);
 $sort_select->addOptionArray($sortorder_select);
 $flat_select = array('flat' => _MP_TRI_FLAT, 'thread' => _MP_TRI_THREAD);
 $threadn_select = new XoopsFormSelect("", "order", $vieworder);
 $threadn_select->addOptionArray($flat_select);
 $form->addElement($thread_select);
 $form->addElement($threadn_select);
 $form->addElement($sort_select);
 $msg_hidden = new XoopsFormHidden("op", "envoimp");
 $form->addElement($msg_hidden);
 $button_tray = new XoopsFormElementTray('', '');
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:optionbox.php


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