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


PHP XoopsFormRadio::addOption方法代码示例

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


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

示例1: 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

示例2: 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

示例3: XoopsSimpleForm

 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: XoopsSimpleForm

 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

示例5: XoopsSimpleForm

 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

示例6: XoopsFormRadio

 $mes = new XoopsFormRadio("Manual evaluation strategy:", "dataset[manualEvaluationStrategy]", "D");
 $mes->addOption("D", "Evaluate a given document on all queries");
 $mes->addOption("Q", "Evaluate all documents on a given query");
 $formulario->addElement($mes);
 $formulario->insertBreak();
 $formulario->addElement(new XoopsFormLabel("Select one of the scale method below:"));
 $escala1 = new XoopsFormRadio("", "dataset[modoEscala]", "1");
 $escala1->addOption("1", "Standard relevance:");
 $formulario->addElement($escala1);
 $formulario->addElement(new XoopsFormLabel('', "<blockquote>\r\n\t\t<input type=\"checkbox\" name=\"escala1_1\" value=\"S\"> No relevance<br>\r\n\t\t<input type=\"checkbox\" name=\"escala1_2\" value=\"S\"> Low relevance<br>\r\n\t\t<input type=\"checkbox\" name=\"escala1_3\" value=\"S\" checked> Medium relevance<br>\r\n\t\t<input type=\"checkbox\" name=\"escala1_4\" value=\"S\" checked> High relevance<br>\r\n\t\t</blockquote>"));
 $escala2 = new XoopsFormRadio("", "dataset[modoEscala]");
 $escala2->addOption("2", "Score:");
 $formulario->addElement($escala2);
 $formulario->addElement(new XoopsFormLabel('', "<blockquote>\r\n\t\t<input type=\"checkbox\" name=\"escala2_1\" value=\"S\"> 1<br>\r\n\t\t<input type=\"checkbox\" name=\"escala2_2\" value=\"S\"> 2<br>\r\n\t\t<input type=\"checkbox\" name=\"escala2_3\" value=\"S\"> 3<br>\r\n\t\t<input type=\"checkbox\" name=\"escala2_4\" value=\"S\" checked> 4<br>\r\n\t\t<input type=\"checkbox\" name=\"escala2_5\" value=\"S\" checked> 5<br>\r\n\t\t</blockquote>"));
 $escala3 = new XoopsFormRadio("", "dataset[modoEscala]");
 $escala3->addOption("3", "Custom:");
 $formulario->addElement($escala3);
 $tray1 = new XoopsFormElementTray("", "<br/>", "", "center");
 $tray1->addElement(new XoopsFormLabel('', "<blockquote>"));
 for ($i = 0; $i < 10; $i++) {
     $traytmp = new XoopsFormElementTray("");
     $namecheck = "check_{$i}";
     ${$namecheck} = new XoopsFormCheckBox("", "escala3_{$i}");
     ${$namecheck}->addOption("S", "{$i} - ");
     $traytmp->addElement(${$namecheck});
     $traytmp->addElement(new XoopsFormText("", "dataset[escalap][{$i}]", 20, 20));
     $nametray = "tray_{$i}";
     ${$nametray} = $traytmp;
     $tray1->addElement(${$nametray});
 }
 $tray1->addElement(new XoopsFormLabel('', "</blockquote>"));
开发者ID:mohamedbiniz,项目名称:qualityranking,代码行数:31,代码来源:datasets.php

示例7: XoopsFormCheckBox

    $delete_attach_checkbox = new XoopsFormCheckBox(_MD_REMOVE, 'delete_tmp[]');
    $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
    foreach ($attachments_tmp as $key => $attachment) {
        $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" targe="_blank" >' . $attachment[1] . '</a>';
        $delete_attach_checkbox->addOption($key, $attach);
    }
    $forum_form->addElement($delete_attach_checkbox);
    unset($delete_attach_checkbox);
    $attachments_tmp = base64_encode(serialize($attachments_tmp));
    $forum_form->addElement(new XoopsFormHidden('attachments_tmp', $attachments_tmp));
}
if ($xoopsModuleConfig['enable_karma'] || $xoopsModuleConfig['allow_require_reply']) {
    $view_require = $require_reply ? 'require_reply' : ($post_karma ? 'require_karma' : 'require_null');
    $radiobox = new XoopsFormRadio(_MD_VIEW_REQUIRE, 'view_require', $view_require);
    if ($xoopsModuleConfig['allow_require_reply']) {
        $radiobox->addOption('require_reply', _MD_REQUIRE_REPLY);
    }
    if ($xoopsModuleConfig['enable_karma']) {
        $karmas = explode(',', $xoopsModuleConfig['karma_options']);
        $karmas = array_map("trim", $karmas);
        if (count($karmas) > 1) {
            foreach ($karmas as $karma) {
                $karma_array[strval($karma)] = intval($karma);
            }
            $karma_select = new XoopsFormSelect('', "post_karma", $post_karma);
            $karma_select->addOptionArray($karma_array);
            $radiobox->addOption('require_karma', _MD_REQUIRE_KARMA . $karma_select->render());
        }
    }
    $radiobox->addOption('require_null', _MD_REQUIRE_NULL);
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:forumform.inc.php

示例8: XoopsThemeForm

 $form = new XoopsThemeForm($form_name, "MainForm", "index.php");
 // title
 $form->addElement(new XoopsFormText(_TC_LINKNAME, "title", 50, 255, htmlspecialchars($title, ENT_QUOTES)));
 // a file should be wrapped
 $address_select = new XoopsFormSelect(_TC_URL, "address", $address);
 $dir_handle = dir($wrap_path);
 while ($file = $dir_handle->read()) {
     if (is_file("{$wrap_path}/{$file}") && $file != 'index.php') {
         $address_select->addOption($file, htmlspecialchars($file, ENT_QUOTES));
     }
 }
 $dir_handle->close();
 $form->addElement($address_select);
 // base path for wrapping
 $wraproot_radio = new XoopsFormRadio(_TC_WRAPROOT, 'wraproot', $link);
 $wraproot_radio->addOption(TC_WRAPTYPE_NORMAL, sprintf(_TC_FMT_WRAPROOTTC, $mymodpath));
 $wraproot_radio->addOption(TC_WRAPTYPE_CONTENTBASE, sprintf(_TC_FMT_WRAPROOTPAGE, $wrap_path));
 $wraproot_radio->addOption(TC_WRAPTYPE_USEREWRITE, sprintf(_TC_FMT_WRAPBYREWRITE, $wrap_path));
 $wraproot_radio->addOption(TC_WRAPTYPE_CHANGESRCHREF, sprintf(_TC_FMT_WRAPCHANGESRCHREF, $wrap_path));
 $form->addElement($wraproot_radio);
 // options
 $option_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
 // visible
 $visible_checkbox = new XoopsFormCheckBox('', 'visible', $visible);
 $visible_checkbox->addOption(1, _TC_VISIBLE);
 $option_tray->addElement($visible_checkbox);
 // submenu
 $submenu_checkbox = new XoopsFormCheckBox('', 'submenu', $submenu);
 $submenu_checkbox->addOption(1, _TC_SUBMENU);
 $option_tray->addElement($submenu_checkbox);
 // comments
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:31,代码来源:index.php

示例9: 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

示例10: Criteria

    }
    if (!empty($counts_module)) {
        $module_handler =& xoops_gethandler("module");
        $module_list = $module_handler->getList(new Criteria("mid", "(" . implode(", ", array_keys($counts_module)) . ")", "IN"));
    }
}
$opform = new XoopsSimpleForm('', 'moduleform', xoops_getenv("PHP_SELF"), "get");
$tray = new XoopsFormElementTray('');
$mod_select = new XoopsFormSelect(_SELECT, 'modid', $modid);
$mod_select->addOption(0, _ALL);
foreach ($module_list as $module => $module_name) {
    $mod_select->addOption($module, $module_name . " (" . $counts_module[$module] . ")");
}
$tray->addElement($mod_select);
$status_select = new XoopsFormRadio("", 'status', $status);
$status_select->addOption(-1, _ALL);
$status_select->addOption(0, TAG_AM_ACTIVE);
$status_select->addOption(1, TAG_AM_INACTIVE);
$tray->addElement($status_select);
$tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
$opform->addElement($tray);
$opform->display();
$criteria = new CriteriaCompo();
$criteria->setSort("a");
$criteria->setOrder("ASC");
$criteria->setStart($start);
$criteria->setLimit($limit);
if ($status >= 0) {
    $criteria->add(new Criteria("o.tag_status", $status));
}
if (!empty($modid)) {
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:admin.tag.php

示例11: addOption

function addOption($id1, $id2, $text, $type = 'check', $checked = null)
{
    if (!isset($text)) {
        $text = "";
    }
    $d = new XoopsFormText('', $id1, 40, 255, $text);
    if ($type == 'check') {
        $c = new XoopsFormCheckBox('', $id2, $checked);
        $c->addOption(1, ' ');
    } else {
        $c = new XoopsFormRadio('', 'checked', $checked);
        $c->addOption($id2, ' ');
    }
    $t = new XoopsFormElementTray('');
    $t->addElement($c);
    $t->addElement($d);
    return $t;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:18,代码来源:elements.php

示例12: 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_confirmation->addOption(1, _AM_NEWBB_PRUNE_YES);
    $archive_confirmation->addOption(0, _AM_NEWBB_PRUNE_NO);
    $sform->addElement($archive_confirmation);
    $button_tray = new XoopsFormElementTray('', '');
    $button_tray->addElement(new XoopsFormButton('', 'submit', _AM_NEWBB_PRUNE_SUBMIT, 'submit'));
    $button_tray->addElement(new XoopsFormButton('', 'reset', _AM_NEWBB_PRUNE_RESET, 'reset'));
    $sform->addElement($button_tray);
    $sform->display();
}
echo "</td></tr></table>";
echo "</fieldset>";
xoops_cp_footer();
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:admin_forum_prune.php

示例13: renderFormSubmit

 function renderFormSubmit($friend)
 {
     global $xoopsUser;
     /**
      * criteria fetch friendship to be edited  
      */
     $criteria_friend1 = new criteria('friend1_uid', $xoopsUser->getVar('uid'));
     $criteria_friend2 = new criteria('friend2_uid', $friend->getVar('uid'));
     $criteria_friendship = new criteriaCompo($criteria_friend1);
     $criteria_friendship->add($criteria_friend2);
     $friendships = $this->getObjects($criteria_friendship);
     $friendship = $friendships[0];
     $form = new XoopsThemeForm(_MD_YOGURT_EDITFRIENDSHIP, "form_editfriendship", "editfriendship.php", "post", true);
     //$field_friend_avatar 		= new XoopsFormLabel(_MD_YOGURT_PHOTO, "<img src=../../uploads/".$friend->getVar('user_avatar')." />");
     if ($friend->getVar('user_avatar') == "blank.gif") {
         $field_friend_avatar = new XoopsFormLabel(_MD_YOGURT_PHOTO, "<img src=images/noavatar.gif />");
     } else {
         $field_friend_avatar = new XoopsFormLabel(_MD_YOGURT_PHOTO, "<img src=../../uploads/" . $friend->getVar('user_avatar') . " />");
     }
     $field_friend_name = new XoopsFormLabel(_MD_YOGURT_FRIENDNAME, $friend->getVar('uname'));
     $field_friend_fan = new XoopsFormRadioYN(_MD_YOGURT_FAN, "fan", $friendship->getVar('fan'), '<img src="images/fans.gif" alt="' . _YES . '" title="' . _YES . '" />', '<img src="images/fansbw.gif" alt="' . _NO . '" title="' . _NO . '" />');
     $field_friend_level = new XoopsFormRadio(_MD_YOGURT_LEVEL, "level", $friendship->getVar('level'), "<br />");
     $field_friend_level->addOption("1", _MD_YOGURT_UNKNOWNACCEPTED);
     $field_friend_level->addOption("3", _MD_YOGURT_AQUAITANCE);
     $field_friend_level->addOption("5", _MD_YOGURT_FRIEND);
     $field_friend_level->addOption("7", _MD_YOGURT_BESTFRIEND);
     $field_friend_sexy = new XoopsFormRadio(_MD_YOGURT_SEXY, "hot", $friendship->getVar('hot'));
     $field_friend_sexy->addOption("1", '<img src="images/sexya.gif" alt="' . _MD_YOGURT_SEXYNO . '" title="' . _MD_YOGURT_SEXYNO . '" />');
     $field_friend_sexy->addOption("2", '<img src="images/sexyb.gif" alt="' . _MD_YOGURT_SEXYYES . '" title="' . _MD_YOGURT_SEXYYES . '" />');
     $field_friend_sexy->addOption("3", '<img src="images/sexyc.gif" alt="' . _MD_YOGURT_SEXYALOT . '" title="' . _MD_YOGURT_SEXYALOT . '" />');
     $field_friend_trusty = new XoopsFormRadio(_MD_YOGURT_TRUSTY, "trust", $friendship->getVar('trust'));
     $field_friend_trusty->addOption("1", '<img src="images/trustya.gif" alt="' . _MD_YOGURT_TRUSTYNO . '" title="' . _MD_YOGURT_TRUSTYNO . '" />');
     $field_friend_trusty->addOption("2", '<img src="images/trustyb.gif" alt="' . _MD_YOGURT_TRUSTYYES . '" title="' . _MD_YOGURT_TRUSTYYES . '" />');
     $field_friend_trusty->addOption("3", '<img src="images/trustyc.gif" alt="' . _MD_YOGURT_TRUSTYALOT . '" title="' . _MD_YOGURT_TRUSTYALOT . '" />');
     $field_friend_cool = new XoopsFormRadio(_MD_YOGURT_COOL, "cool", $friendship->getVar('cool'));
     $field_friend_cool->addOption("1", '<img src="images/coola.gif" alt="' . _MD_YOGURT_COOLNO . '" title="' . _MD_YOGURT_COOLNO . '" />');
     $field_friend_cool->addOption("2", '<img src="images/coolb.gif" alt="' . _MD_YOGURT_COOLYES . '" title="' . _MD_YOGURT_COOLYES . '" />');
     $field_friend_cool->addOption("3", '<img src="images/coolc.gif" alt="' . _MD_YOGURT_COOLALOT . '" title="' . _MD_YOGURT_COOLALOT . '" />');
     $form->setExtra('enctype="multipart/form-data"');
     $button_send = new XoopsFormButton("", "submit_button", _MD_YOGURT_UPDATEFRIEND, "submit");
     $field_friend_friendid = new XoopsFormHidden("friend_uid", $friend->getVar('uid'));
     $field_friend_marker = new XoopsFormHidden("marker", "1");
     $field_friend_friendshio_id = new XoopsFormHidden("friendship_id", $friendship->getVar('friendship_id'));
     $form->addElement($field_friend_friendid);
     $form->addElement($field_friend_friendshio_id);
     $form->addElement($field_friend_marker);
     $form->addElement($field_friend_avatar);
     $form->addElement($field_friend_name);
     $form->addElement($field_friend_level);
     $form->addElement($field_friend_fan);
     $form->addElement($field_friend_sexy);
     $form->addElement($field_friend_trusty);
     $form->addElement($field_friend_cool);
     $form->addElement($button_send);
     $form->display();
     //If your server is php 4.4
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:57,代码来源:yogurt_friendship.php

示例14: render

 function render($ele_value, $caption, $markupName, $isDisabled, $element, $entry_id)
 {
     global $myts;
     $myts =& MyTextSanitizer::getInstance();
     $renderer =& new formulizeElementRenderer();
     $ele_desc = $element->getVar('ele_desc', "f");
     if (strstr($markupName, "de_")) {
         // display element uses a slightly different element name so it can be distinguished on subsequent page load from regular elements...THIS IS NOT TRUE/NECESSARY ANYMORE SINCE FORMULIZE 3, WHERE ALL ELEMENTS ARE DISPLAY ELEMENTS
         $true_ele_id = str_replace("de_" . $element->getVar('id_form') . "_" . $entry_id . "_", "", $markupName);
     } else {
         $true_ele_id = str_replace("ele_", "", $markupName);
     }
     $selected = '';
     $disabledHiddenValue = "";
     $options = array();
     $opt_count = 1;
     while ($i = each($ele_value)) {
         $options[$opt_count] = constant($i['key']);
         $options[$opt_count] = $myts->stripSlashesGPC($options[$opt_count]);
         if ($i['value'] > 0) {
             $selected = $opt_count;
         }
         $opt_count++;
     }
     if ($element->getVar('ele_delim') != "") {
         $delimSetting = $element->getVar('ele_delim');
     }
     $delimSetting =& $myts->undoHtmlSpecialChars($delimSetting);
     if ($delimSetting == "br") {
         $delimSetting = "<br />";
     }
     $hiddenOutOfRangeValuesToWrite = array();
     switch ($delimSetting) {
         case 'space':
             $form_ele1 = new XoopsFormRadio('', $markupName, $selected);
             $counter = 0;
             while ($o = each($options)) {
                 $o = formulize_swapUIText($o, $element->getVar('ele_uitext'));
                 $other = $renderer->optOther($o['value'], $markupName, $entry_id, $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, $element->getVar('ele_uitext'));
                 $t = new XoopsFormRadio('', $markupName, $selected);
                 $other = $renderer->optOther($o['value'], $markupName, $entry_id, $counter);
                 if ($other != false) {
                     $t->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'];
                     $t->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
                     }
                 }
                 $t->setExtra("onchange=\"javascript:formulizechanged=1;\"");
                 $form_ele1->addElement($t);
                 unset($t);
                 $counter++;
             }
             break;
     }
     $renderedHoorvs = "";
     if (count($hiddenOutOfRangeValuesToWrite) > 0) {
         foreach ($hiddenOutOfRangeValuesToWrite as $hoorKey => $hoorValue) {
             $thisHoorv = new xoopsFormHidden('formulize_hoorv_' . $true_ele_id . '_' . $hoorKey, $hoorValue);
             $renderedHoorvs .= $thisHoorv->render() . "\n";
             unset($thisHoorv);
         }
     }
     if ($isDisabled) {
         $disabledHiddenValue = "<input type=hidden name=\"" . $markupName . "\" value=\"{$selected}\">\n";
         $renderedElement = $disabledOutputText;
//.........这里部分代码省略.........
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:101,代码来源:newynElement-example.php

示例15: XoopsFormTextArea

$form->addElement($form_xfn);
$form->addElement(new XoopsFormTextArea(_LANG_WLA_SUB_NOTE, "link_notes", $link_notes, 10, 60));
$form_rating = new XoopsFormSelect(_LANG_WLA_SUB_RATE, "link_rating", $link_rating);
$form_rating->setDescription(_LANG_WLA_CHECK_ZERO);
for ($r = 0; $r < 10; $r++) {
    $form_rating->addOption($r, $r);
}
$form->addElement($form_rating);
$form_target = new XoopsFormRadio(_LANG_WLA_SUB_TARGET, "link_target", $link_target);
$form_target->setDescription(_LANG_WLA_CHECK_STRICT);
$form_target->addOption('_blank', '_blank');
$form_target->addOption('_top', '_top');
$form_target->addOption('', "none");
$form->addElement($form_target);
$form_visible = new XoopsFormRadio(_LANG_WLA_SUB_VISIBLE, "link_visible", $link_visible);
$form_visible->addOption('Y', 'Yes');
$form_visible->addOption('N', 'No');
$form->addElement($form_visible);
$form_category = new XoopsFormSelect(_LANG_WLA_SUB_CAT, "link_category", $link_category);
$form_category->addOptionArray($category_options);
$form->addElement($form_category);
if ($form_id == 'addlink') {
    $form->addElement(new XoopsFormButton("", "submit", _LANG_WLA_BUTTON_TEXTNAME, "submit"));
    $form->addElement(new XoopsFormHidden("action", 'Add'));
} else {
    if ($form_id == 'editlink') {
        $form_button = new XoopsFormElementTray("");
        $form_button->addElement(new XoopsFormButton("", "submit", _LANG_WLM_SAVE_CHANGES, "submit"));
        $form_button->addElement(new XoopsFormButton("", "submit", _LANG_WLM_EDIT_CANCEL, "submit"));
        $form->addElement($form_button);
        $form->addElement(new XoopsFormHidden("action", 'editlink'));
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:link-manager-form.php


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