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


PHP XoopsFormRadio::setValue方法代码示例

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


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

示例1: keyword_form

function keyword_form($keyid = 0)
{
    global $keywords, $nodetypes_select;
    if ($keyid) {
        $vals = $keywords->get($keyid);
    } else {
        $vals = array('keyid' => 0, 'name' => '', 'parent' => 0, 'relay' => 0, 'weight' => 1, 'nodetype' => 2, 'description' => '');
    }
    $form = new XoopsThemeForm($keyid ? _AM_KEYWORDS_EDIT : _AM_KEYWORDS_NEW, 'KeysForm', 'keywords.php');
    $form->addElement(new XoopsFormHidden('keyid', $keyid));
    $form->addElement(new XoopsFormText(_AM_KEYWORDS_NAME, 'name', 40, 128, $vals['name']));
    $node_select = new XoopsFormRadio(_AM_KEYWORDS_NODETYPE, 'nodetype');
    $node_select->addOptionArray($nodetypes_select);
    $node_select->setValue($vals['nodetype']);
    $form->addElement($node_select);
    $parent_keys = new KeyFormSelect(_AM_KEYWORDS_PARENT, 'parent');
    $keys = $keywords->getKeys(array(0, 1));
    array_unshift($keys, array('keyid' => '', 'name' => _AM_KEY_NONE));
    if ($keyid) {
        unset($keys["key{$keyid}"]);
    }
    // remove self
    $parent_keys->addOptions($keys);
    $parent_keys->setValue($vals['parent']);
    $form->addElement($parent_keys);
    $relay_keys = new KeyFormSelect(_AM_KEYWORDS_RELAY, 'relay');
    $relays = $keywords->getKeys(array(0, 2));
    array_unshift($relays, array('keyid' => '', 'name' => _AM_KEY_NONE));
    $relay_keys->addOptions($relays);
    $relay_keys->setValue($vals['relay']);
    $form->addElement($relay_keys);
    $form->addElement(new XoopsFormText(_AM_SORT_WEIGHT, 'weight', 4, 4, $vals['weight']));
    $form->addElement(new XoopsFormDhtmlTextArea(_AM_KEYWORDS_DESC, 'description', $vals['description']));
    $form->addElement(new XoopsFormButton('', 'keys', _SUBMIT, 'submit'));
    $form->display();
}
开发者ID:nbuy,项目名称:xoops-modules-medialinks,代码行数:36,代码来源:keywords.php

示例2: elseif

} elseif ($wysiwyg_is_exist == 3) {
    $sform->addElement(new XoopsFormWysiwygTextArea($editor_configs, 'hiddenBodytext'));
} else {
    $sform->addElement(new XoopsFormDhtmlTextArea($editor_configs['caption'], $editor_configs['name'], $editor_configs['value'], $editor_configs['rows'], $editor_configs['cols'], 'hiddenBodytext'));
}
$sform->addElement(new XoopsFormLabel('', '* ' . _MULTIPLE_PAGE_GUIDE), false);
$sform->addElement(new XoopsFormTextArea(_AMS_NW_BANNER, 'banner', $myts->htmlSpecialChars($story->banner)));
if ($edit && !isset($_GET['approve'])) {
    $change_radio = new XoopsFormRadio(_AMS_NW_MAJOR, 'change', $story->change);
    $change_radio->addOption(0, _AMS_NW_NOVERSIONCHANGE);
    $change_radio->addOption(1, _AMS_NW_VERSION);
    $change_radio->addOption(2, _AMS_NW_REVISION);
    $change_radio->addOption(3, _AMS_NW_MINOR);
    $change_radio->addOption(4, _AMS_NW_AUTO);
    $change_radio->setDescription(_AMS_NW_VERSIONDESC);
    $change_radio->setValue(4);
    $sform->addElement($change_radio);
    $sform->addElement(new XoopsFormRadioYN(_AMS_NW_SWITCHAUTHOR . " (" . $story->uname . ")", 'newauthor', 0));
}
// Manage upload(s)
$allowupload = false;
switch ($xoopsModuleConfig['uploadgroups']) {
    case 1:
        //Submitters and Approvers
        $allowupload = true;
        break;
    case 2:
        //Approvers only
        $allowupload = $approveprivilege ? true : false;
        break;
    case 3:
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:storyform.inc.php


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