本文整理汇总了PHP中XoopsFormRadio类的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormRadio类的具体用法?PHP XoopsFormRadio怎么用?PHP XoopsFormRadio使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XoopsFormRadio类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: about_block_page_edit
function about_block_page_edit($options)
{
@(include dirname(dirname(__FILE__)) . "/xoops_version.php");
$page_handler =& xoops_getmodulehandler('page', 'about');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('page_status', 1), 'AND');
$criteria->add(new Criteria('page_type', 1));
$criteria->setSort('page_order');
$criteria->setOrder('ASC');
$fields = array("page_id", "page_title", "page_image");
$pages = $page_handler->getAll($criteria, $fields, false);
$page_title = '';
foreach ($pages as $k => $v) {
$page_title = '<a href="' . XOOPS_URL . '/modules/' . $modversion['dirname'] . '/index.php?page_id=' . $k . '" target="_blank">' . $v['page_title'] . '</a>';
$options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . '<img src="' . XOOPS_URL . '/modules/' . $modversion['dirname'] . '/images/picture.png' . '" />';
}
include_once dirname(dirname(__FILE__)) . '/include/xoopsformloader.php';
$form = new XoopsBlockForm();
$page_select = new XoopsFormRadio(_MI_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '<br />');
$page_select->addOptionArray($options_page);
$form->addElement($page_select);
$form->addElement(new XoopsFormText(_MI_ABOUT_TEXT_LENGTH, 'options[1]', 5, 5, $options[1]));
$form->addElement(new XoopsFormText(_MI_ABOUT_VIEW_MORELINKTEXT, 'options[2]', 30, 50, $options[2]));
$form->addElement(new XoopsFormRadioYN(_MI_ABOUT_DOTITLEIMAGE, 'options[3]', $options[3]));
return $form->render();
}
开发者ID:yunsite,项目名称:xoopsdc,代码行数:26,代码来源:blocks.php
示例2: getForm
/**
* Get a {@link XoopsForm} object for creating/editing objects
* @param mixed $action receiving page - defaults to $_SERVER['REQUEST_URI']
* @param mixed $title title of the form
*
* @return object
*/
function getForm($action = false, $title = false)
{
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
if ($action == false) {
$url_parts = parse_url($_SERVER['REQUEST_URI']);
$action = $url_parts['path'];
}
if ($title == false) {
$title = $this->isNew() ? _ADD : _EDIT;
$title .= " " . _NL_AM_DISPATCH;
}
$form = new XoopsThemeForm($title, 'form', $action);
if (!$this->isNew()) {
$form->addElement(new XoopsFormHidden('id', $this->getVar('dispatch_id')));
} else {
$this->assignVar('dispatch_time', $this->getNextDispatch());
}
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormHidden('nid', $this->getVar('newsletterid')));
$time = new XoopsFormDateTime(_NL_AM_TIME, 'dispatch_time', 15, $this->getVar('dispatch_time'));
$time->_name = "dispatch_time";
//XOOPS 2.0.13.2 < fix for missing name attribute
$form->addElement($time);
$form->addElement(new XoopsFormText(_NL_AM_SUBJECT, 'dispatch_subject', 75, 255, $this->getVar('dispatch_subject', 'e')));
$status_radio = new XoopsFormRadio(_NL_AM_STATUS, 'dispatch_status', $this->getVar('dispatch_status'));
$status_radio->addOption(0, _NL_AM_NOTREADY);
$status_radio->addOption(1, _NL_AM_READY);
$status_radio->addOption(2, _NL_AM_DISPATCHED);
$form->addElement($status_radio);
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:39,代码来源:dispatch.php
示例3: _b_wp_archives_monthly_edit
function _b_wp_archives_monthly_edit($options)
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$optForm = new XoopsSimpleForm('Block Option Dummy Form', 'optionform', '');
$optFormType = new XoopsFormRadio('Month List Style:', 'options[0]', $options[0]);
$optFormType->addOption(0, 'Simple List');
$optFormType->addOption(1, 'Dropdown List');
$optForm->addElement($optFormType);
$optForm->addElement(new XoopsFormRadioYN('Listing with count:', 'options[1]', $options[1]));
$optForm->addElement(new XoopsFormText('Custom Block Template File<br />(Default: wp_archives_monthly.html):', 'options[2]', 25, 50, $options[2]));
$_wpTpl =& new WordPresTpl('theme');
$optForm->assign($_wpTpl);
return $_wpTpl->fetch('wp_block_edit.html');
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:14,代码来源:wp_archives_monthly.php
示例4: SmartFormUrlLinkElement
function SmartFormUrlLinkElement($form_caption, $key, $object)
{
$this->XoopsFormElementTray($form_caption, ' ');
$this->addElement(new XoopsFormLabel('', '<br/>' . _CO_SOBJECT_URLLINK_URL));
$this->addElement(new SmartFormTextElement($object, 'url_' . $key));
$this->addElement(new XoopsFormLabel('', '<br/>' . _CO_SOBJECT_CAPTION));
$this->addElement(new SmartFormTextElement($object, 'caption_' . $key));
$this->addElement(new XoopsFormLabel('', '<br/>' . _CO_SOBJECT_DESC . '<br/>'));
$this->addElement(new XoopsFormTextArea('', 'desc_' . $key, $object->getVar('description')));
$this->addElement(new XoopsFormLabel('', '<br/>' . _CO_SOBJECT_URLLINK_TARGET));
$targ_val = $object->getVar('target');
$targetRadio = new XoopsFormRadio('', 'target_' . $key, $targ_val != '' ? $targ_val : '_blank');
$control = $object->getControl('target');
$targetRadio->addOptionArray($control['options']);
$this->addElement($targetRadio);
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:16,代码来源:smartformurllinkelement.php
示例5: _b_wp_recent_comments_edit
function _b_wp_recent_comments_edit($options)
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$optForm = new XoopsSimpleForm('Block Option Dummy Form', 'optionform', '');
$optFormType = new XoopsFormRadio('Comment List Style:', 'options[0]', $options[0]);
$optFormType->addOption(0, 'Standard');
$optFormType->addOption(1, 'Grouped by Article');
$optForm->addElement($optFormType);
$optForm->addElement(new XoopsFormText('Comment List Count:', 'options[1]', 5, 5, $options[1]));
$optForm->addElement(new XoopsFormRadioYN('Display RSS Icon:', 'options[2]', $options[2]));
$optForm->addElement(new XoopsFormRadioYN('Display Posted Date:', 'options[3]', $options[3]));
$optForm->addElement(new XoopsFormRadioYN('Show Comment Type:', 'options[4]', $options[4]));
$optForm->addElement(new XoopsFormText('Custom Block Template File<br />(Default: wp_recent_comments.html):', 'options[5]', 25, 50, $options[5]));
$_wpTpl =& new WordPresTpl('theme');
$optForm->assign($_wpTpl);
return $_wpTpl->fetch('wp_block_edit.html');
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:17,代码来源:wp_recent_comments.php
示例6: field_form
function field_form($fid = 0)
{
global $mediaschema, $field_types, $all_types;
if ($fid) {
$vals = $mediaschema->getField($fid);
} else {
$vals = array('fid' => 0, 'name' => '', 'label' => '', 'def' => '', 'type' => 'varchar(0)', 'weight' => 1);
}
if (preg_match('/^(\\w+)\\((\\d+)\\)/', $vals['type'], $d)) {
$type = $d[1];
$size = $d[2];
} else {
$type = $vals['type'];
$size = 0;
}
$form = new XoopsThemeForm($fid ? _AM_FIELDS_EDIT : _AM_FIELDS_NEW, 'FieldForm', 'fields.php');
$form->addElement(new XoopsFormHidden('fid', $vals['fid']));
$form->addElement(new XoopsFormText(_AM_FIELDS_LABEL, 'label', 40, 40, $vals['label']));
$fname = $vals['name'];
if (empty($fname) || preg_match('/^add/', $fname)) {
$types = $field_types;
if (empty($fname)) {
$types['keywords'] = _AM_TYPE_KEYWORD;
} else {
$form->addElement(new XoopsFormLabel(_AM_FIELDS_NAME, $fname));
}
$type_select = new XoopsFormRadio(_AM_FIELDS_TYPE, 'type', $type);
$type_select->addOptionArray($types);
$form->addElement($type_select);
$form->addElement(new XoopsFormText(_AM_FIELDS_SIZE, 'size', 4, 4, $size ? $size : 40));
} else {
$form->addElement(new XoopsFormLabel(_AM_FIELDS_NAME, $fname));
$form->addElement(new XoopsFormLabel(_AM_FIELDS_TYPE, $all_types[$type] . ($size ? " ({$size})" : '')));
}
if (!in_array($fname, array('ctime', 'mtime', 'hits', 'poster'))) {
if ($type == 'link') {
$form->addElement(new XoopsFormText(_AM_FIELDS_NUMBER, 'def', 4, 4, $vals['def']));
} else {
$form->addElement(new XoopsFormText(_AM_FIELDS_DEF, 'def', 40, 60, $vals['def']));
}
}
$form->addElement(new XoopsFormText(_AM_SORT_WEIGHT, 'weight', 4, 4, $vals['weight']));
$form->addElement(new XoopsFormButton('', 'field', _SUBMIT, 'submit'));
$form->display();
}
开发者ID:nbuy,项目名称:xoops-modules-medialinks,代码行数:45,代码来源:fields.php
示例7: _b_wp_categories_edit
function _b_wp_categories_edit($options)
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$optForm = new XoopsSimpleForm('Block Option Dummy Form', 'optionform', '');
$optFormType = new XoopsFormRadio('Category List Style:', 'options[0]', $options[0]);
$optFormType->addOption(0, 'Simple List');
$optFormType->addOption(1, 'Dropdown List');
$optForm->addElement($optFormType);
$optForm->addElement(new XoopsFormRadioYN('Listing with count:', 'options[1]', $options[1]));
$optFormSort = new XoopsFormRadio('Sorting Key:', 'options[2]', $options[2]);
$optFormSort->addOption('ID', 'ID');
$optFormSort->addOption('name', 'Name');
$optFormSort->addOption('description', 'Description');
$optForm->addElement($optFormSort);
$optFormOrder = new XoopsFormRadio('Sorting Order:', 'options[3]', $options[3]);
$optFormOrder->addOption('asc', 'Ascending');
$optFormOrder->addOption('desc', 'Descending');
$optForm->addElement($optFormOrder);
$_wpTpl =& new WordPresTpl('theme');
$optForm->assign($_wpTpl);
return $_wpTpl->fetch('wp_block_edit.html');
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:22,代码来源:wp_categories.php
示例8: getForm
/**
* Get a {@link XoopsForm} object for creating/editing Spotlight articles
*
* @return object
*/
function getForm($action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = _AMS_AM_SPOTLIGHT;
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
include_once XOOPS_ROOT_PATH . "/modules/AMS/class/formimageselect.php";
$form = new XoopsThemeForm($title, 'spotlightform', $action);
if (!$this->isNew()) {
$form->addElement(new XoopsFormHidden('id', $this->getVar('spotlightid')));
}
$mode_select = new XoopsFormRadio('', 'mode', $this->getVar('mode'));
$mode_select->addOption(1, _AMS_AM_SPOT_LATESTARTICLE);
$mode_select->addOption(2, _AMS_AM_SPOT_LATESTINTOPIC);
$mode_select->addOption(3, _AMS_AM_SPOT_SPECIFICARTICLE);
$mode_select->addOption(4, _AMS_AM_SPOT_CUSTOM);
include_once XOOPS_ROOT_PATH . "/class/tree.php";
include_once XOOPS_ROOT_PATH . "/modules/AMS/class/class.newstopic.php";
include_once XOOPS_ROOT_PATH . "/modules/AMS/class/class.newsstory.php";
$xt = new AmsTopic($GLOBALS['xoopsDB']->prefix("ams_topics"));
$allTopics = $xt->getAllTopics();
$topic_obj_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
$topic_select = new XoopsFormLabel(_AMS_AM_TOPIC, $topic_obj_tree->makeSelBox('topicid', 'topic_title', '--', $this->getVar('topicid'), false));
$topic_select->setDescription(_AMS_AM_SPOT_TOPIC_DESC);
$article_select = new XoopsFormSelect(_AMS_AM_ARTICLE, 'storyid', $this->getVar('storyid'));
$article_select->addOptionArray(AmsStory::getAllPublished($GLOBALS['xoopsModuleConfig']['spotlight_art_num'], 0, false, 0, 1, false));
$article_select->setDescription(_AMS_AM_SPOT_ARTICLE_DESC);
$mode_tray = new XoopsFormElementTray(_AMS_AM_SPOT_MODE_SELECT);
$mode_tray->addElement($mode_select);
$showimage_select = new XoopsFormRadio(_AMS_AM_SPOT_SHOWIMAGE, 'showimage', $this->getVar('showimage'));
$showimage_select->addOption(0, _AMS_AM_SPOT_SPECIFYIMAGE);
$showimage_select->addOption(1, _AMS_AM_SPOT_TOPICIMAGE);
$showimage_select->addOption(2, _AMS_AM_SPOT_AUTHORIMAGE);
$showimage_select->addOption(3, _AMS_AM_SPOT_NOIMAGE);
$showimage_select->setDescription(_AMS_AM_SPOT_SHOWIMAGE_DESC);
$image_select = new XoopsFormImageSelect(_AMS_AM_SPOT_IMAGE, 'image', $this->getVar('image', 'e'), 70, 255);
$autoteaser_select = new XoopsFormRadioYN(_AMS_AM_SPOT_AUTOTEASER, 'autoteaser', $this->getVar('autoteaser'));
$teaser_text = new XoopsFormDhtmlTextArea(_AMS_AM_SPOT_TEASER, 'teaser', $this->getVar('teaser', 'e'));
$maxlength_text = new XoopsFormText(_AMS_AM_SPOT_MAXLENGTH, 'maxlength', 10, 10, $this->getVar('maxlength'));
$display_select = new XoopsFormRadioYN(_AMS_AM_SPOT_DISPLAY, 'display', $this->getVar('display'));
$weight_text = new XoopsFormText(_AMS_AM_SPOT_WEIGHT, 'weight', 10, 10, $this->getVar('weight'));
$form->addElement($mode_tray);
$form->addElement($topic_select);
$form->addElement($article_select);
$form->addElement($showimage_select);
$form->addElement($image_select);
$form->addElement($autoteaser_select);
$form->addElement($maxlength_text);
$form->addElement($teaser_text);
$form->addElement($display_select);
$form->addElement($weight_text);
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton('', 'spotlightsubmit', _AMS_AM_SUBMIT, 'submit'));
return $form;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:61,代码来源:spotlight.php
示例9: unset
$searchform->addElement($element);
unset($element);
break;
case "language":
$element = new XoopsFormSelectLang($fields[$i]->getVar('field_title'), $fields[$i]->getVar('field_name'), null, 6);
$searchform->addElement($element);
unset($element);
break;
}
}
asort($sortby_arr);
$sortby_arr = array_merge(array("" => _NONE, "uname" => _US_NICKNAME, "email" => _US_EMAIL), $sortby_arr);
$sortby_select = new XoopsFormSelect(_PROFILE_MA_SORTBY, 'sortby');
$sortby_select->addOptionArray($sortby_arr);
$searchform->addElement($sortby_select);
$order_select = new XoopsFormRadio(_PROFILE_MA_ORDER, 'order', 0);
$order_select->addOption(0, _ASCENDING);
$order_select->addOption(1, _DESCENDING);
$searchform->addElement($order_select);
$limit_text = new XoopsFormText(_PROFILE_MA_PERPAGE, 'limit', 15, 10, $limit_default);
$searchform->addElement($limit_text);
$searchform->addElement(new XoopsFormHidden('op', 'results'));
$searchform->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
$searchform->assign($GLOBALS['xoopsTpl']);
$GLOBALS['xoopsTpl']->assign('page_title', _PROFILE_MA_SEARCH);
//added count user
$member_handler =& xoops_gethandler('member');
$acttotal = $member_handler->getUserCount(new Criteria('level', 0, '>'));
$total = sprintf(_PROFILE_MA_ACTUS, "<span style='color:#ff0000;'>{$acttotal}</span>");
$GLOBALS['xoopsTpl']->assign('total_users', $total);
break;
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:search.php
示例10: createDataTypeUI
function createDataTypeUI($ele_type, $element, $id_form, $ele_encrypt)
{
// data type controls ... added May 31 2009, jwe
// only do it for existing elements where the datatype choice is relevant
// do not do it for encrypted elements
$renderedUI = "";
// check if there's a special class file for this element type, and if so, instantiate an element object of that kind, so we can check if it needs a datatype UI or not
$customTypeNeedsUI = false;
if (file_exists(XOOPS_ROOT_PATH . "/modules/formulize/class/" . $ele_type . "Element.php")) {
$customTypeHandler = xoops_getmodulehandler($ele_type . "Element", 'formulize');
$customTypeObject = $customTypeHandler->create();
$customTypeNeedsUI = $customTypeObject->needsDataType;
}
if (($ele_type == "text" or $ele_type == "textarea" or $ele_type == "select" or $ele_type == "radio" or $ele_type == "checkbox" or $ele_type == "derived" or $customTypeNeedsUI) and !$ele_encrypt) {
if ($element) {
$defaultTypeInformation = $element->getDataTypeInformation();
$defaultType = $defaultTypeInformation['dataType'];
$defaultTypeSize = $defaultTypeInformation['dataTypeSize'];
//print "defaultType: $defaultType<br>";
//print "defaultTypeSize: $defaultTypeSize<br>";
$renderedUI .= "<input type='hidden' name='element_default_datatype' value='{$defaultType}'>\n";
$renderedUI .= "<input type='hidden' name='element_default_datatypesize' value='{$defaultTypeSize}'>\n";
} else {
$defaultType = 'text';
$defaultTypeSize = '';
}
// setup the UI for the options...
$dataTypeTray = new XoopsFormElementTray(_AM_FORM_DATATYPE_CONTROLS, '<br>');
$dataTypeTray->setDescription(_AM_FORM_DATATYPE_CONTROLS_DESC);
$textType = new XoopsFormRadio('', 'element_datatype', $defaultType);
$textDataTypeLabel = (!$element and $ele_type == 'text') ? _AM_FORM_DATATYPE_TEXT_NEWTEXT : _AM_FORM_DATATYPE_TEXT;
$textType->addOption('text', $textDataTypeLabel);
$intType = new XoopsFormRadio('', 'element_datatype', $defaultType);
$intType->addOption('int', _AM_FORM_DATATYPE_INT);
$decimalType = new XoopsFormRadio('', 'element_datatype', $defaultType);
$decimalTypeSizeDefault = ($defaultTypeSize and $defaultType == "decimal") ? $defaultTypeSize : 2;
$decimalTypeSize = new XoopsFormText('', 'element_datatype_decimalsize', 2, 2, $decimalTypeSizeDefault);
$decimalTypeSize->setExtra(" style=\"width: 2em;\" ");
// style to force width necessary to compensate for silly forced 60% textbox widths in ICMS admin side
$decimalType->addOption('decimal', _AM_FORM_DATATYPE_DECIMAL1 . $decimalTypeSize->render() . _AM_FORM_DATATYPE_DECIMAL2);
$varcharType = new XoopsFormRadio('', 'element_datatype', $defaultType);
$varcharTypeSizeDefault = ($defaultTypeSize and $defaultType == 'varchar') ? $defaultTypeSize : 255;
$varcharTypeSize = new XoopsFormText('', 'element_datatype_varcharsize', 3, 3, $varcharTypeSizeDefault);
$varcharTypeSize->setExtra(" style=\"width: 3em;\" ");
$varcharType->addOption('varchar', _AM_FORM_DATATYPE_VARCHAR1 . $varcharTypeSize->render() . _AM_FORM_DATATYPE_VARCHAR2);
$charType = new XoopsFormRadio('', 'element_datatype', $defaultType);
$charTypeSizeDefault = ($defaultTypeSize and $defaultType == 'char') ? $defaultTypeSize : 255;
$charTypeSize = new XoopsFormText('', 'element_datatype_charsize', 3, 3, $charTypeSizeDefault);
$charTypeSize->setExtra(" style=\"width: 3em;\" ");
$charType->addOption('char', _AM_FORM_DATATYPE_CHAR1 . $charTypeSize->render() . _AM_FORM_DATATYPE_CHAR2);
if ($defaultType != "text" and $defaultType != "int" and $defaultType != "decimal" and $defaultType != "varchar" and $defaultType != "char") {
$otherType = new XoopsFormRadio('', 'element_datatype', $defaultType);
$otherType->addOption($defaultType, _AM_FORM_DATATYPE_OTHER . $defaultType);
$dataTypeTray->addElement($otherType);
}
$dataTypeTray->addElement($textType);
$dataTypeTray->addElement($intType);
$dataTypeTray->addElement($decimalType);
$dataTypeTray->addElement($varcharType);
$dataTypeTray->addElement($charType);
$renderedUI .= $dataTypeTray->render();
}
return $renderedUI;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:64,代码来源:element.php
示例11: die
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true);
if (!preg_match("/^re:/i", $subject)) {
$subject = "Re: " . xoops_substr($subject, 0, 56);
}
$cform->addElement(new XoopsFormText(_CM_TITLE, 'subject', 50, 255, $subject), true);
$icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon);
$subject_icons = XoopsLists::getSubjectsList();
foreach ($subject_icons as $iconfile) {
$icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
}
$cform->addElement($icons_radio);
$cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'message', $message, 10, 50), true);
$option_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
if ($xoopsUser) {
if ($xoopsConfig['anonpost'] == 1) {
$noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
$noname_checkbox->addOption(1, _POSTANON);
$option_tray->addElement($noname_checkbox);
}
if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
$nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:commentform.inc.php
示例12: XoopsFormHidden
$nuova_foto = new XoopsFormHidden("id_foto_principale", $_GET['id_foto_principale']);
$giorni_asta = new XoopsFormSelect("Durata dell'asta?", "giorni_asta");
$giorni_asta->addOption("10", "10 giorni");
$giorni_asta->addOption("7", "7 giorni");
$giorni_asta->addOption("5", "5 giorni");
$giorni_asta->addOption("1", "1 giorno");
/* $cat_link = new XoopsFormLabel( "<a href='javascript:location.href=\"viewcat.php?cid=\"+document.uploadphoto.cid.value;'>"._GO."</a>" ) ;
$cat_tray = new XoopsFormElementTray( _ALBM_PHOTOCAT , ' ' ) ;
$cat_tray->addElement( $cat_select ) ;
$cat_tray->addElement( $cat_link ) ; */
//$desc_tarea = new XoopsFormDhtmlTextArea( _ALBM_PHOTODESC , "desc_text" , $myts->makeTareaData4Edit( $photo['description'] ) , 10 , 50 ) ;
$desc_tarea = new XoopsFormTextArea(_ALBM_PHOTODESC, "desc_text", $myts->makeTareaData4Edit($photo['description']), 10, 50);
$file_form = new XoopsFormFile(_ALBM_SELECTFILE, "photofile", $myalbum_fsize);
$file_form->setExtra("size='30'");
if ($myalbum_canrotate) {
$rotate_radio = new XoopsFormRadio(_ALBM_RADIO_ROTATETITLE, 'rotate', 'rot0');
$rotate_radio->addOption('rot0', _ALBM_RADIO_ROTATE0 . " ");
$rotate_radio->addOption('rot90', "<img src='images/icon_rotate90.gif' alt='" . _ALBM_RADIO_ROTATE90 . "' title='" . _ALBM_RADIO_ROTATE90 . "' /> ");
$rotate_radio->addOption('rot180', "<img src='images/icon_rotate180.gif' alt='" . _ALBM_RADIO_ROTATE180 . "' title='" . _ALBM_RADIO_ROTATE180 . "' /> ");
$rotate_radio->addOption('rot270', "<img src='images/icon_rotate270.gif' alt='" . _ALBM_RADIO_ROTATE270 . "' title='" . _ALBM_RADIO_ROTATE270 . "' /> ");
}
$op_hidden = new XoopsFormHidden("op", "submit");
$counter_hidden = new XoopsFormHidden("fieldCounter", 1);
$preview_hidden = new XoopsFormHidden("preview_name", htmlspecialchars($preview_name), ENT_QUOTES);
$submit_button = new XoopsFormButton("", "submit", _SUBMIT, "submit");
$preview_button = new XoopsFormButton("", "preview", _PREVIEW, "submit");
$reset_button = new XoopsFormButton("", "reset", _CANCEL, "reset");
$submit_tray = new XoopsFormElementTray('');
//riga qui sotto commentata da slyss
//if( $caller != 'imagemanager' ) $submit_tray->addElement( $preview_button ) ;
$submit_tray->addElement($submit_button);
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:submit_block.php
示例13: Metagen
/**
* Metagen
*
* Metagen is a system that can help you to have your page best indexed by search engines.
* Except if you type meta keywords and meta descriptions yourself, the module will automatically create them.
* From here you can also manage some other options like the maximum number of meta keywords to create and
* the keywords apparition's order.
*/
function Metagen()
{
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $cfg;
xoops_cp_header();
$myts =& MyTextSanitizer::getInstance();
if (file_exists(XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php')) {
include_once XOOPS_ROOT_PATH . '/modules/news/language/' . $xoopsConfig['language'] . '/main.php';
} else {
include_once XOOPS_ROOT_PATH . '/modules/news/language/english/main.php';
}
adminmenu(8);
echo "<h1>" . _AM_NEWS_METAGEN . "</h1>";
echo _AM_NEWS_METAGEN_DESC . "<br /><br />";
// Metagen Options
$registry = new news_registryfile('news_metagen_options.txt');
$content = '';
$content = $registry->getfile();
if (xoops_trim($content) != '') {
list($keywordscount, $keywordsorder) = explode(',', $content);
} else {
$keywordscount = $cfg['meta_keywords_count'];
$keywordsorder = $cfg['meta_keywords_order'];
}
$sform = new XoopsThemeForm(_OPTIONS, 'metagenoptions', XOOPS_URL . '/modules/news/admin/index.php', 'post');
$sform->addElement(new XoopsFormHidden('op', 'metagenoptions'), false);
$sform->addElement(new XoopsFormText(_AM_NEWS_META_KEYWORDS_CNT, 'keywordscount', 4, 6, $keywordscount), true);
$keywordsorder = new XoopsFormRadio(_AM_NEWS_META_KEYWORDS_ORDER, 'keywordsorder', $keywordsorder);
$keywordsorder->addOption(0, _AM_NEWS_META_KEYWORDS_INTEXT);
$keywordsorder->addOption(1, _AM_NEWS_META_KEYWORDS_FREQ1);
$keywordsorder->addOption(2, _AM_NEWS_META_KEYWORDS_FREQ2);
$sform->addElement($keywordsorder, false);
$button_tray = new XoopsFormElementTray('', '');
$submit_btn = new XoopsFormButton('', 'post', _AM_MODIFY, 'submit');
$button_tray->addElement($submit_btn);
$sform->addElement($button_tray);
$sform->display();
// Blacklist
$sform = new XoopsThemeForm(_AM_NEWS_BLACKLIST, 'metagenblacklist', XOOPS_URL . '/modules/news/admin/index.php', 'post');
$sform->addElement(new XoopsFormHidden('op', 'metagenblacklist'), false);
// Remove words
$remove_tray = new XoopsFormElementTray(_AM_NEWS_BLACKLIST);
$remove_tray->setDescription(_AM_NEWS_BLACKLIST_DESC);
$blacklist = new XoopsFormSelect('', 'blacklist', '', 5, true);
$words = array();
$metablack = new news_blacklist();
$words = $metablack->getAllKeywords();
if (is_array($words) && count($words) > 0) {
foreach ($words as $key => $value) {
$blacklist->addOption($key, $value);
}
}
$blacklist->setDescription(_AM_NEWS_BLACKLIST_DESC);
$remove_tray->addElement($blacklist, false);
$remove_btn = new XoopsFormButton('', 'go', _AM_DELETE, 'submit');
$remove_tray->addElement($remove_btn, false);
$sform->addElement($remove_tray);
// Add some words
$add_tray = new XoopsFormElementTray(_AM_NEWS_BLACKLIST_ADD);
$add_tray->setDescription(_AM_NEWS_BLACKLIST_ADD_DSC);
$add_field = new XoopsFormTextArea('', 'keywords', '', 5, 70);
$add_tray->addElement($add_field, false);
$add_btn = new XoopsFormButton('', 'go', _AM_ADD, 'submit');
$add_tray->addElement($add_btn, false);
$sform->addElement($add_tray);
$sform->display();
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:75,代码来源:index.php
示例14: XoopsFormSelect
$imgsel = new XoopsFormSelect('', "image");
}
$imgsel->addOptionArray($images_array);
$image->addElement($imgsel);
if ($id != '' && $affimg == '1') {
$imgaff = new XoopsFormCheckBox(" " . _FORM_DISPLAY, 'affimg', 1);
$imgaff->addOption(1, ' ');
} else {
$imgaff = new XoopsFormCheckBox(" " . _FORM_DISPLAY, 'affimg');
$imgaff->addOption(1, ' ');
}
$image->addElement($imgaff);
if ($id != '') {
$ordre_form = new XoopsFormRadio(_FORM_ORDER, 'ordre', $ordre);
} else {
$ordre_form = new XoopsFormRadio(_FORM_ORDER, 'ordre', 'tit');
}
$ordre_form->addOption('tit', _FORM_DTIT);
$ordre_form->addOption('img', _FORM_DIMG);
$email_form = new XoopsFormText(_FORM_EMAIL, 'email', 30, 255, $email);
$select_form_group_perm = new XoopsFormSelectGroup(_FORM_GROUP, 'groupe', true, $tab2[$i], 4, false);
for ($i = 0; $i < $m; $i++) {
if ($id != '' && $tab[$i] == $groupe) {
$select_form_group_perm = new XoopsFormSelectGroup(_FORM_GROUP, 'groupe', true, $groupe, 4, false);
}
}
$select_form_group_perm->addOption(' ', _FORM_NO_GROUP);
if ($id != '' && $admin == '1') {
$admin_form = new XoopsFormCheckBox(_FORM_ADMIN, 'admin', 1);
$admin_form->addOption(1, ' ');
} else {
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:mailindex.php
示例15: profile_getUserForm
/**
* Get {@link XoopsThemeForm} for editing a user
*
* @param object $user {@link XoopsUser} to edit
*
* @return object
*/
function profile_getUserForm(&$user, $profile = null, $action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
if (empty($GLOBALS['xoopsConfigUser'])) {
$config_handler =& xoops_gethandler('config');
$GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
}
include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
$title = $user->isNew() ? _PROFILE_AM_ADDUSER : _US_EDITPROFILE;
$form = new XoopsThemeForm($title, 'userinfo', $action, 'post', true);
$profile_handler =& xoops_getmodulehandler('profile');
// Dynamic fields
if (!$profile) {
$profile_handler =& xoops_getmodulehandler('profile', 'profile');
$profile = $profile_handler->get($user->getVar('uid'));
}
// 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', $GLOBALS['xoopsUser']->getGroups(), $GLOBALS['xoopsModule']->getVar('mid'));
if ($user->isNew() || $GLOBALS['xoopsUser']->isAdmin()) {
$elements[0][] = array('element' => new XoopsFormText(_US_NICKNAME, 'uname', 25, $GLOBALS['xoopsUser']->isAdmin() ? 60 : $GLOBALS['xoopsConfigUser']['maxuname'], $user->getVar('uname', 'e')), 'required' => 1);
$email_text = new XoopsFormText('', 'email', 30, 60, $user->getVar('email'));
} else {
$elements[0][] = array('element' => new XoopsFormLabel(_US_NICKNAME, $user->getVar('uname')), 'required' => 0);
$email_text = new XoopsFormLabel('', $user->getVar('email'));
}
$email_tray = new XoopsFormElementTray(_US_EMAIL, '<br />');
$email_tray->addElement($email_text, $user->isNew() || $GLOBALS['xoopsUser']->isAdmin() ? 1 : 0);
$weights[0][] = 0;
$elements[0][] = array('element' => $email_tray, 'required' => 0);
$weights[0][] = 0;
if ($GLOBALS['xoopsUser']->isAdmin() && $user->getVar('uid') != $GLOBALS['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(_US_PASSWORD . '<br />' . _US_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_USERLEVEL, '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;
$cat_handler = xoops_getmodulehandler('category');
$categories = array();
$all_categories = $cat_handler->getObjects(null, true, false);
$count_fields = count($fields);
foreach (array_keys($fields) as $i) {
if (in_array($fields[$i]->getVar('field_id'), $editable_fields)) {
// Set default value for user fields if available
if ($user->isNew()) {
$default = $fields[$i]->getVar('field_default');
if ($default !== '' && $default !== null) {
$user->setVar($fields[$i]->getVar('field_name'), $default);
}
}
if ($profile->getVar($fields[$i]->getVar('field_name'), 'n') === null) {
$default = $fields[$i]->getVar('field_default', 'n');
$profile->setVar($fields[$i]->getVar('field_name'), $default);
}
$fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile);
$fieldinfo['required'] = $fields[$i]->getVar('field_required');
$key = @$all_categories[$fields[$i]->getVar('cat_id')]['cat_weight'] * $count_fields + $fields[$i]->getVar('cat_id');
$elements[$key][] = $fieldinfo;
$weights[$key][] = $fields[$i]->getVar('field_weight');
$categories[$key] = @$all_categories[$fields[$i]->getVar('cat_id')];
}
}
if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->isAdmin()) {
xoops_loadLanguage('admin', 'profile');
$gperm_handler =& xoops_gethandler('groupperm');
//If user has admin rights on groups
include_once $GLOBALS['xoops']->path('modules/system/constants.php');
if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_GROUP, $GLOBALS['xoopsUser']->getGroups(), 1)) {
//add group selection
$group_select = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $user->getGroups(), 5, true);
$elements[0][] = array('element' => $group_select, 'required' => 0);
//set as latest;
$weights[0][] = $count_fields + 1;
}
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:101,代码来源:forms.php
示例16: constructElement
//.........这里部分代码省略.........
break;
case 'radio':
case 'yn':
$selected = '';
$disabledHiddenValue = "";
$options = array();
$opt_count = 1;
while ($i = each($ele_value)) {
switch ($ele_type) {
case 'radio':
$options[$opt_count] = $myts->stripSlashesGPC($i['key']);
$options[$opt_count] = $myts->displayTarea($options[$opt_count]);
break;
case 'yn':
$options[$opt_count] = constant($i['key']);
$options[$opt_count] = $myts->stripSlashesGPC($options[$opt_count]);
break;
}
if ($i['value'] > 0) {
$selected = $opt_count;
}
$opt_count++;
}
if ($this->_ele->getVar('ele_delim') != "") {
$delimSetting = $this->_ele->getVar('ele_delim');
}
$delimSetting =& $myts->undoHtmlSpecialChars($delimSetting);
if ($delimSetting == "br") {
$delimSetting = "<br />";
}
$hiddenOutOfRangeValuesToWrite = array();
switch ($delimSetting) {
case 'space':
$form_ele1 = new XoopsFormRadio('', $form_ele_id, $selected);
$counter = 0;
while ($o = each($options)) {
$o = formulize_swapUIText($o, $this->_ele->getVar('ele_uitext'));
$other = $this->optOther($o['value'], $form_ele_id, $entry, $counter);
if ($other != false) {
$form_ele1->addOption($o['key'], _formulize_OPT_OTHER . $other);
if ($o['key'] == $selected) {
$disabledOutputText = _formulize_OPT_OTHER . $other;
}
} else {
$o['value'] = get_magic_quotes_gpc() ? stripslashes($o['value']) : $o['value'];
$form_ele1->addOption($o['key'], $o['value']);
if ($o['key'] == $selected) {
$disabledOutputText = $o['value'];
}
if (strstr($o['value'], _formulize_OUTOFRANGE_DATA)) {
$hiddenOutOfRangeValuesToWrite[$o['key']] = str_replace(_formulize_OUTOFRANGE_DATA, "", $o['value']);
// if this is an out of range value, grab the actual value so we can stick it in a hidden element later
}
}
$counter++;
}
$form_ele1->setExtra("onchange=\"javascript:formulizechanged=1;\"");
break;
default:
$form_ele1 = new XoopsFormElementTray('', $delimSetting);
$counter = 0;
while ($o = each($options)) {
$o = formulize_swapUIText($o, $this->_ele->getVar('ele_uitext'));
$t = new XoopsFormRadio('', $form_ele_id, $selected);
$other = $this->optOther($o['value'], $form_ele_id, $entry, $counter);
if ($other != false) {
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:67,代码来源:elementrenderer.php
示例17: XoopsFormRadio
}
$sform->addElement($checkbox);
$sticky_confirmation = new XoopsFormRadio(_AM_NEWBB_PRUNE_STICKY, 'sticky', 1);
$sticky_confirmation->addOption(1, _AM_NEWBB_PRUNE_YES);
$sticky_confirmation->addOption(0, _AM_NEWBB_PRUNE_NO);
$sform->addElement($sticky_confirmation);
$digest_confirmation = new XoopsFormRadio(_AM_NEWBB_PRUNE_DIGEST, 'digest', 1);
$digest_confirmation->addOption(1, _AM_NEWBB_PRUNE_YES);
$digest_confirmation->addOption(0, _AM_NEWBB_PRUNE_NO);
$sform->addElement($digest_confirmation);
$lock_confirmation = new XoopsFormRadio(_AM_NEWBB_PRUNE_LOCK, 'lock', 0);
$lock_confirmation->addOption(1, _AM_NEWBB_PRUNE_YES);
$lock_confirmation->addOption(0, _AM_NEWBB_PRUNE_NO);
$sform->addElement($lock_confirmation);
$hot_confirmation = new XoopsFormSelect(_AM_NEWBB_PRUNE_HOT, 'hot', null, 1, false);
$hot_confirmation->addOptionArray(array('0' => 0, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30));
$sform->addElement($hot_confirmation);
$sform->addElement($radiobox);
$archive_confirmation = new XoopsFormRadio(_AM_NEWBB_PRUNE_ARCHIVE, 'archive', 1);
$archive_
|
请发表评论