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


PHP Form::generate_select_box方法代码示例

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


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

示例1: main_page

function main_page($current_cache_level, $modified_on)
{
    $form = new Form('index.php?module=cloudflare-cache_lvl&action=change', 'post');
    $form_container = new FormContainer('Modify Cache Level');
    $form_container->output_row('Cache Level', "Cache Level functions based off the setting level. The basic setting will cache most static resources (i.e., css, images, and JavaScript). The simplified setting will ignore the query string when delivering a cached resource. The aggressive setting will cache all static resources, including ones with a query string. ", $form->generate_select_box('cache_level', array('basic' => 'Basic', 'simplified' => 'Simplified', 'aggressive' => 'Aggressive'), $current_cache_level));
    $form_container->end();
    $buttons[] = $form->generate_submit_button('Submit');
    $form->output_submit_wrapper($buttons);
    $form->end();
}
开发者ID:dequeues,项目名称:MyBB-CloudFlare-Manager,代码行数:10,代码来源:cloudflare_cache_lvl.php

示例2: main_page

function main_page($current_setting)
{
    global $security_levels;
    $form = new Form('index.php?module=cloudflare-security_lvl&action=change_security_level', 'post');
    $form_container = new FormContainer('Modify Security Level');
    $form_container->output_row('Security Level', 'The Security Level you choose will determine which visitors will be presented with a challenge page<br />
		<ul>
			<li><b>Essentially Off:</b> Challenges only the most grievous offenders</li>
			<li><b>Low:</b> Challenges only the most threatening visitors</li>
			<li><b>Medium:</b> Challenges both moderate threat visitors and the most threatening visitors</li>
			<li><b>High:</b> Challenges all visitors that have exhibited threatening behavior within the last 14 days</li>
			<li><b>I\'m Under Attack!:</b> Should only be used if your website is under a DDoS attack</li>
				<ul><li>Visitors will receive an interstitial page while we analyze their traffic and behavior to make sure they are a legitimate human visitor trying to access your website</li></ul>
			</li>
		</ul>', $form->generate_select_box('sec_level', $security_levels, $current_setting));
    $form_container->end();
    $buttons[] = $form->generate_submit_button('Submit');
    $form->output_submit_wrapper($buttons);
    $form->end();
}
开发者ID:dequeues,项目名称:MyBB-CloudFlare-Manager,代码行数:20,代码来源:cloudflare_security_lvl.php

示例3: FormContainer

	<dt><label style="display: block;"><input type="radio" name="attach" value="0" ' . $global_checked[1] . ' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> ' . $lang->globally . '</label></dt>
		<dt><label style="display: block;"><input type="radio" name="attach" value="1" ' . $global_checked[2] . ' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> ' . $lang->specific_files . ' (<a id="new_specific_file">' . $lang->add_another . '</a>)</label></dt><br />
		' . $specific_files . '
	</dl>
	<script type="text/javascript">
	checkAction(\'attach\');' . $check_actions . '
	</script>';
    echo $form->generate_hidden_field("sid", $stylesheet['sid']) . "<br />\n";
    $form_container = new FormContainer("{$lang->add_stylesheet_to} " . htmlspecialchars_uni($theme['name']));
    $form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');
    $form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);
    $sheetnames = array();
    foreach ($stylesheets as $filename => $style) {
        $sheetnames[basename($filename)] = basename($filename);
    }
    $actions = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">\n\t<dt><label style=\"display: block;\"><input type=\"radio\" name=\"add_type\" value=\"1\" {$add_checked[1]} class=\"adds_check\" onclick=\"checkAction('add');\" style=\"vertical-align: middle;\" /> <strong>{$lang->import_stylesheet_from}</strong></label></dt>\n\t\t<dd style=\"margin-top: 4px;\" id=\"add_1\" class=\"adds\">\n\t\t\t<table cellpadding=\"4\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . $form->generate_select_box('import', $sheetnames, $mybb->input['import'], array('id' => 'import')) . "</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</dd>\n\t\t<dt><label style=\"display: block;\"><input type=\"radio\" name=\"add_type\" value=\"2\" {$add_checked[2]} class=\"adds_check\" onclick=\"checkAction('add');\" style=\"vertical-align: middle;\" /> <strong>{$lang->write_own}</strong></label></dt>\n\t\t<span id=\"add_2\" class=\"adds\"><br />" . $form->generate_text_area('stylesheet', $mybb->input['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => 'codepress css', 'rows' => '30')) . "</span>\n\t</dl>";
    $form_container->output_row("", "", $actions);
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_stylesheet);
    $form->output_submit_wrapper($buttons);
    if ($admin_options['codepress'] != 0) {
        echo "<script type=\"text/javascript\">\n\tEvent.observe('add_stylesheet', 'submit', function()\n\t{\n\t\tif(\$('stylesheet_cp')) {\n\t\t\tvar area = \$('stylesheet_cp');\n\t\t\tarea.id = 'stylesheet';\n\t\t\tarea.value = stylesheet.getCode();\n\t\t\tarea.disabled = false;\n\t\t}\n\t});\n</script>\n";
    }
    echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
    echo '<script type="text/javascript">
Event.observe(window, "load", function() {
//<![CDATA[
    new ThemeSelector(\'' . $count . '\');
	checkAction(\'add\');
});
//]]>
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:themes.php

示例4: get_admin_log_action

    $query = $db->query("\n\t\tSELECT DISTINCT l.uid, u.username\n\t\tFROM " . TABLE_PREFIX . "adminlog l\n\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (l.uid=u.uid)\n\t\tORDER BY u.username ASC\n\t");
    while ($user = $db->fetch_array($query)) {
        $user_options[$user['uid']] = $user['username'];
    }
    $module_options = array();
    $module_options[''] = $lang->all_modules;
    $module_options['0'] = '----------';
    $query = $db->query("\n\t\tSELECT DISTINCT l.module\n\t\tFROM " . TABLE_PREFIX . "adminlog l\n\t\tORDER BY l.module ASC\n\t");
    while ($module = $db->fetch_array($query)) {
        $module_options[$module['module']] = str_replace(' ', ' -&gt; ', ucwords(str_replace('/', ' ', $module['module'])));
    }
    $sort_by = array('dateline' => $lang->date, 'username' => $lang->username);
    $order_array = array('asc' => $lang->asc, 'desc' => $lang->desc);
    $form = new Form("index.php?module=tools-adminlog", "post");
    $form_container = new FormContainer($lang->filter_administrator_logs);
    $form_container->output_row($lang->module, "", $form->generate_select_box('filter_module', $module_options, $mybb->input['filter_module'], array('id' => 'filter_module')), 'filter_module');
    $form_container->output_row($lang->administrator, "", $form->generate_select_box('uid', $user_options, $mybb->input['uid'], array('id' => 'uid')), 'uid');
    $form_container->output_row($lang->sort_by, "", $form->generate_select_box('sortby', $sort_by, $mybb->input['sortby'], array('id' => 'sortby')) . " {$lang->in} " . $form->generate_select_box('order', $order_array, $order, array('id' => 'order')) . " {$lang->order}", 'order');
    $form_container->output_row($lang->results_per_page, "", $form->generate_text_box('perpage', $perpage, array('id' => 'perpage')), 'perpage');
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->filter_administrator_logs);
    $form->output_submit_wrapper($buttons);
    $form->end();
    $page->output_footer();
}
/**
 * Returns language-friendly string describing $logitem
 * @param array The log item (one row from mybb_adminlogs)
 * @return string The description
 */
function get_admin_log_action($logitem)
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:31,代码来源:adminlog.php

示例5: Form

            flash_message($lang->invalid_post_verify_key2, 'error');
            admin_redirect("index.php?module=cloudflare-manage_firewall");
        }
        $request = $cloudflare->update_access_rule($mybb->get_input('mode'), $mybb->get_input('ip_address'), $mybb->get_input('notes'));
        if (!empty($request['success'])) {
            flash_message("Updated the firewall rule with IP {$mybb->get_input('ip_address')}", "success");
            admin_redirect("index.php?module=cloudflare-manage_firewall");
        } else {
            flash_message($request['errors'], "error");
            admin_redirect("index.php?module=cloudflare-manage_firewall");
        }
    }
    $form = new Form('index.php?module=cloudflare-manage_firewall&amp;action=modify_rule_by_ip', 'post');
    $form_container = new FormContainer("Modify Firewall Rule");
    $form_container->output_row("IP Address", "The IP address you would like to whitelist", $form->generate_text_box('ip_address', $mybb->get_input('ip')));
    $form_container->output_row('Mode', '', $form->generate_select_box("mode", array("whitelist" => "Whitelist", "block" => "Blacklist", "challenge" => "Challenge"), $mybb->get_input('current_mode')));
    $form_container->output_row("Notes", "Any notes you would like to add", $form->generate_text_box('notes', $mybb->get_input('current_notes')));
    echo $form->generate_hidden_field('update_rule', 'update');
    $form_container->end();
    $buttons[] = $form->generate_submit_button("Submit");
    $form->output_submit_wrapper($buttons);
    $form->end();
} elseif ($mybb->input['action'] == 'delete_rule_by_id') {
    if (!verify_post_check($mybb->input['my_post_key'])) {
        flash_message($lang->invalid_post_verify_key2, 'error');
        admin_redirect("index.php?module=cloudflare-manage_firewall");
    }
    $request = $cloudflare->delete_firewall_rule($mybb->get_input('rule_id'));
    if (!empty($request->success)) {
        flash_message("Deleted the firewall rule with IP {$mybb->get_input('ip_address')}", "success");
        admin_redirect("index.php?module=cloudflare-manage_firewall");
开发者ID:dequeues,项目名称:MyBB-CloudFlare-Manager,代码行数:31,代码来源:cloudflare_manage_firewall.php

示例6: array

        $sub_tabs['diff_report'] = array('title' => $lang->diff_report, 'link' => "index.php?module=style/templates&amp;action=diff_report&amp;title=" . $db->escape_string($template['title']) . "&amp;sid1=" . intval($template['sid']) . "&amp;sid2=-2");
    }
    $sub_tabs['edit_template'] = array('title' => $lang->edit_template, 'link' => "index.php?module=style/templates&amp;action=edit_template&amp;title=" . htmlspecialchars_uni($template['title']) . $expand_str, 'description' => $lang->edit_template_desc);
    $page->output_nav_tabs($sub_tabs, 'edit_template');
    $form = new Form("index.php?module=style/templates&amp;action=edit_template{$expand_str}", "post", "edit_template");
    echo $form->generate_hidden_field('tid', $template['tid']) . "\n";
    if ($mybb->input['from'] == "diff_report") {
        echo $form->generate_hidden_field('from', "diff_report");
    }
    $form_container = new FormContainer($lang->edit_template_breadcrumb . $template['title']);
    $form_container->output_row($lang->template_name, $lang->template_name_desc, $form->generate_text_box('title', $template['title'], array('id' => 'title')), 'title');
    // Force users to save the default template to a specific set, rather than the "global" templates - where they can delete it
    if ($template['sid'] == "-2") {
        unset($template_sets[-1]);
    }
    $form_container->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid));
    $form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => 'codepress mybb', 'style' => 'width: 100%; height: 500px;')));
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_continue, array('name' => 'continue'));
    $buttons[] = $form->generate_submit_button($lang->save_close, array('name' => 'close'));
    $form->output_submit_wrapper($buttons);
    $form->end();
    if ($admin_options['codepress'] != 0) {
        echo "<script type=\"text/javascript\">\n\tEvent.observe('edit_template', 'submit', function()\n\t{\n\t\tif(\$('template_cp')) {\n\t\t\tvar area = \$('template_cp');\n\t\t\tarea.id = 'template';\n\t\t\tarea.value = template.getCode();\n\t\t\tarea.disabled = false;\n\t\t}\n\t});\n</script>";
    }
    $page->output_footer();
}
if ($mybb->input['action'] == "search_replace") {
    $plugins->run_hooks("admin_style_templates_search_replace");
    if ($mybb->request_method == "post") {
        if ($mybb->input['type'] == "templates") {
开发者ID:benn0034,项目名称:SHIELDsite2.old,代码行数:31,代码来源:templates.php

示例7: array

    if ($errors) {
        $page->output_inline_error($errors);
    } else {
        $mybb->input = array_merge($mybb->input, array("namestyle" => "{username}"));
    }
    $form_container = new FormContainer($lang->add_user_group);
    $form_container->output_row($lang->title . " <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
    $form_container->output_row($lang->short_description, "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
    $form_container->output_row($lang->username_style, $lang->username_style_desc, $form->generate_text_box('namestyle', $mybb->input['namestyle'], array('id' => 'namestyle')), 'namestyle');
    $form_container->output_row($lang->user_title, $lang->user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');
    $options[0] = $lang->do_not_copy_permissions;
    $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
    while ($usergroup = $db->fetch_array($query)) {
        $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
    }
    $form_container->output_row($lang->copy_permissions_from, $lang->copy_permissions_from_desc, $form->generate_select_box('copyfrom', $options, $mybb->input['copyfrom'], array('id' => 'copyfrom')), 'copyfrom');
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_user_group);
    $form->output_submit_wrapper($buttons);
    $form->end();
    $page->output_footer();
}
if ($mybb->input['action'] == "edit") {
    $query = $db->simple_select("usergroups", "*", "gid='" . $mybb->get_input('gid', MyBB::INPUT_INT) . "'");
    $usergroup = $db->fetch_array($query);
    if (!$usergroup['gid']) {
        flash_message($lang->error_invalid_user_group, 'error');
        admin_redirect("index.php?module=user-group");
    } else {
        if (preg_match("#<((m[^a])|(b[^diloru>])|(s[^aemptu>]))(\\s*[^>]*)>#si", $mybb->input['namestyle'])) {
            $errors[] = $lang->error_disallowed_namestyle_username;
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:groups.php

示例8: Form

            $mybb->input['name'] = $doc['name'];
            $mybb->input['description'] = $doc['description'];
            $mybb->input['document'] = $doc['document'];
            $mybb->input['disporder'] = $doc['disporder'];
            $mybb->input['enabled'] = $doc['enabled'];
            $mybb->input['usetranslation'] = $doc['usetranslation'];
        }
        $form = new Form("index.php?module=config-help_documents&amp;action=edit", "post", "edit");
        echo $form->generate_hidden_field("hid", $mybb->input['hid']);
        echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
        $form_container = new FormContainer($lang->edit_document . " ({$lang->id} " . intval($mybb->input['hid']) . ")");
        $query = $db->simple_select("helpsections", "sid, name");
        while ($section = $db->fetch_array($query)) {
            $sections[$section['sid']] = $section['name'];
        }
        $form_container->output_row($lang->section . " <em>*</em>", "", $form->generate_select_box("sid", $sections, $mybb->input['sid']), 'sid');
        $form_container->output_row($lang->title . " <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
        $form_container->output_row($lang->short_description . " <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
        $form_container->output_row($lang->document . " <em>*</em>", "", $form->generate_text_area('document', $mybb->input['document'], array('id' => 'document')), 'document');
        $form_container->output_row($lang->display_order, "", $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');
        $form_container->output_row($lang->enabled . " <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
        $form_container->end();
        $buttons[] = $form->generate_submit_button($lang->edit_document);
        $form->output_submit_wrapper($buttons);
        $form->end();
    }
    $page->output_footer();
}
// Delete something
if ($mybb->input['action'] == "delete") {
    $plugins->run_hooks("admin_config_help_documents_delete");
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:31,代码来源:help_documents.php

示例9: build_attachment_row

    }
    $page->output_header($lang->find_attachments);
    $page->output_nav_tabs($sub_tabs, 'find_attachments');
    // If we have any error messages, show them
    if ($errors) {
        $page->output_inline_error($errors);
    }
    $form = new Form("index.php?module=forum-attachments", "post");
    $form_container = new FormContainer($lang->find_where);
    $form_container->output_row($lang->name_contains, $lang->name_contains_desc, $form->generate_text_box('filename', $mybb->input['filename'], array('id' => 'filename')), 'filename');
    $form_container->output_row($lang->type_contains, "", $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype');
    $form_container->output_row($lang->forum_is, "", $form->generate_forum_select('forum[]', $mybb->input['forum'], array('multiple' => true, 'size' => 5, 'id' => 'forum')), 'forum');
    $form_container->output_row($lang->username_is, "", $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
    $more_options = array("less_than" => $lang->more_than, "greater_than" => $lang->less_than);
    $greater_options = array("greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly, "less_than" => $lang->less_than);
    $form_container->output_row($lang->date_posted_is, "", $form->generate_select_box('dateuploaded_dir', $more_options, $mybb->input['dateuploaded_dir'], array('id' => 'dateuploaded_dir')) . " " . $form->generate_text_box('dateuploaded', $mybb->input['dateuploaded'], array('id' => 'dateuploaded')) . " {$lang->days_ago}", 'dateuploaded');
    $form_container->output_row($lang->file_size_is, "", $form->generate_select_box('filesize_dir', $greater_options, $mybb->input['filesize_dir'], array('id' => 'filesize_dir')) . " " . $form->generate_text_box('filesize', $mybb->input['filesize'], array('id' => 'filesize')) . " {$lang->kb}", 'dateuploaded');
    $form_container->output_row($lang->download_count_is, "", $form->generate_select_box('downloads_dir', $greater_options, $mybb->input['downloads_dir'], array('id' => 'downloads_dir')) . " " . $form->generate_text_box('downloads', $mybb->input['downloads'], array('id' => 'downloads')) . "", 'dateuploaded');
    $form_container->end();
    $form_container = new FormContainer($lang->display_options);
    $sort_options = array("filename" => $lang->filename, "filesize" => $lang->filesize, "downloads" => $lang->download_count, "dateuploaded" => $lang->date_uploaded, "username" => $lang->post_username);
    $sort_directions = array("asc" => $lang->asc, "desc" => $lang->desc);
    $form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby')) . " {$lang->in} " . $form->generate_select_box('order', $sort_directions, $mybb->input['order'], array('id' => 'order')), 'sortby');
    $form_container->output_row($lang->results_per_page, "", $form->generate_text_box('perpage', $mybb->input['perpage'], array('id' => 'perpage')), 'perpage');
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->button_find_attachments);
    $form->output_submit_wrapper($buttons);
    $form->end();
    $page->output_footer();
}
function build_attachment_row($attachment, &$table, $use_form = false)
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:attachments.php

示例10: urlencode

                if ($ip_record['city']) {
                    $ipaddress_location .= htmlspecialchars_uni($ip_record['city']) . $lang->comma . ' ';
                }
                $ipaddress_location .= htmlspecialchars_uni($ip_record['country_name']);
                $table->construct_cell('<a href="https://maps.google.com/maps?q=' . urlencode($ipaddress_location) . '" target="_blank">' . $ipaddress_location . '</a>', array('width' => '25%'));
            } else {
                $table->construct_cell('N/A', array('width' => '25%'));
            }
        }
        if ($mybb->settings['cloudflare_showdns'] == "1") {
            $table->construct_cell(gethostbyaddr($data['ip']), array('width' => '25%'));
        }
        $popup = new PopupMenu("rv_options_" . $number, "Options");
        $popup->add_item("Black List", "index.php?module=cloudflare-blacklist&amp;action=run&amp;my_post_key={$mybb->post_code}&amp;address=" . $data['ip'] . "&amp;submit=Black List");
        $popup->add_item("White List", "index.php?module=cloudflare-whitelist&amp;action=run&my_post_key={$mybb->post_code}&amp;address=" . $data['ip'] . "&amp;submit=White List");
        $controls = $popup->fetch();
        $table->construct_cell($controls, array('width' => '5%'));
        $table->construct_row();
    }
    $table->output("Recent Visitors Data - 48 Hours");
    echo multipage($quantity, (int) $perpage, (int) $page, $profile_page);
    $types = array("all" => "Show All", "" => "----------", "regular" => "Regular", "bot" => "Spider/Bot", "threat" => "Threat");
    $form = new Form("index.php?module=cloudflare-recent_visitors_48", "post");
    $form_container = new FormContainer("Filter Visitors");
    $form_container->output_row("Type:", "", $form->generate_select_box('onlyshow', $types, $mybb->input['onlyshow'], array('id' => 'onlyshow')), 'onlyshow');
    $form_container->end();
    $buttons[] = $form->generate_submit_button("Filter Visitors");
    $form->output_submit_wrapper($buttons);
    $form->end();
    $page->output_footer();
}
开发者ID:EspialWires,项目名称:MyBB-CloudFlare-Manager,代码行数:31,代码来源:cloudflare_recent_visitors.php

示例11: array

 if ($type[0] == "yesno") {
     $setting_code = $form->generate_yes_no_radio($element_name, $setting['value'], true, array('id' => $element_id . '_yes', 'class' => $element_id), array('id' => $element_id . '_no', 'class' => $element_id));
 } else {
     if ($type[0] == "onoff") {
         $setting_code = $form->generate_on_off_radio($element_name, $setting['value'], true, array('id' => $element_id . '_on', 'class' => $element_id), array('id' => $element_id . '_off', 'class' => $element_id));
     } else {
         if ($type[0] == "cpstyle") {
             $dir = @opendir(MYBB_ROOT . $config['admin_dir'] . "/styles");
             while ($folder = readdir($dir)) {
                 if ($file != "." && $file != ".." && @file_exists(MYBB_ROOT . $config['admin_dir'] . "/styles/{$folder}/main.css")) {
                     $folders[$folder] = ucfirst($folder);
                 }
             }
             closedir($dir);
             ksort($folders);
             $setting_code = $form->generate_select_box($element_name, $folders, $setting['value'], array('id' => $element_id));
         } else {
             if ($type[0] == "language") {
                 $languages = $lang->get_languages();
                 $setting_code = $form->generate_select_box($element_name, $languages, $setting['value'], array('id' => $element_id));
             } else {
                 if ($type[0] == "adminlanguage") {
                     $languages = $lang->get_languages(1);
                     $setting_code = $form->generate_select_box($element_name, $languages, $setting['value'], array('id' => $element_id));
                 } else {
                     if ($type[0] == "passwordbox") {
                         $setting_code = $form->generate_password_box($element_name, $setting['value'], array('id' => $element_id));
                     } else {
                         if ($type[0] == "php") {
                             $setting['type'] = substr($setting['type'], 3);
                             eval("\$setting_code = \"" . $setting['type'] . "\";");
开发者ID:ambsalinas,项目名称:anima,代码行数:31,代码来源:settings.php

示例12: Form

    $page->output_nav_tabs($sub_tabs, 'edit_profile_field');
    $form = new Form("index.php?module=config-profile_fields&amp;action=edit", "post", "edit");
    echo $form->generate_hidden_field("fid", $profile_field['fid']);
    if ($errors) {
        $page->output_inline_error($errors);
    } else {
        $type = explode("\n", $profile_field['type'], "2");
        $mybb->input = $profile_field;
        $mybb->input['fieldtype'] = $type[0];
        $mybb->input['options'] = $type[1];
    }
    $form_container = new FormContainer($lang->edit_profile_field);
    $form_container->output_row($lang->title . " <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
    $form_container->output_row($lang->short_description . " <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
    $select_list = array("text" => $lang->text, "textarea" => $lang->textarea, "select" => $lang->select, "multiselect" => $lang->multiselect, "radio" => $lang->radio, "checkbox" => $lang->checkbox);
    $form_container->output_row($lang->field_type . " <em>*</em>", $lang->field_type_desc, $form->generate_select_box('fieldtype', $select_list, $mybb->input['fieldtype'], array('id' => 'fieldtype')), 'fieldtype');
    $form_container->output_row($lang->maximum_length, $lang->maximum_length_desc, $form->generate_text_box('maxlength', $mybb->input['maxlength'], array('id' => 'maxlength')), 'maxlength', array(), array('id' => 'row_maxlength'));
    $form_container->output_row($lang->field_length, $lang->field_length_desc, $form->generate_text_box('length', $mybb->input['length'], array('id' => 'length')), 'length', array(), array('id' => 'row_fieldlength'));
    $form_container->output_row($lang->selectable_options, $lang->selectable_options_desc, $form->generate_text_area('options', $mybb->input['options'], array('id' => 'options')), 'options', array(), array('id' => 'row_options'));
    $form_container->output_row($lang->display_order . " <em>*</em>", $lang->display_order_desc, $form->generate_text_box('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');
    $form_container->output_row($lang->required . " <em>*</em>", $lang->required_desc, $form->generate_yes_no_radio('required', $mybb->input['required']));
    $form_container->output_row($lang->editable_by_user . " <em>*</em>", $lang->editable_by_user_desc, $form->generate_yes_no_radio('editable', $mybb->input['editable']));
    $form_container->output_row($lang->hide_on_profile . " <em>*</em>", $lang->hide_on_profile_desc, $form->generate_yes_no_radio('hidden', $mybb->input['hidden']));
    $form_container->output_row($lang->min_posts_enabled, $lang->min_posts_enabled_desc, $form->generate_text_box('postnum', $mybb->input['postnum'], array('id' => 'postnum')), 'postnum');
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_profile_field);
    $form->output_submit_wrapper($buttons);
    $form->end();
    echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
	<script type="text/javascript">
		Event.observe(window, "load", function() {
开发者ID:slothly,项目名称:mybb,代码行数:31,代码来源:profile_fields.php

示例13: Form

    if (!$querydata['PID']) {
        // The announcement was defined, but did not exist.
        flash_message($lang->bam_delete_error, 'error');
        admin_redirect('index.php?module=config-bam');
    }
    $db->delete_query('bam', "PID='{$PID}'");
    flash_message($lang->bam_delete_success, 'success');
    admin_redirect('index.php?module=config-bam');
}
if ($mybb->input['action'] == "add") {
    // generate add announcement form.
    $form = new Form("index.php?module=config-bam", "post");
    $form_container = new FormContainer($lang->bam_form_add);
    echo $form->generate_hidden_field("action", "submit_add");
    $form_container->output_row($lang->bam_form_announcement, $lang->bam_form_announcement_desc, $form->generate_text_area("announcement", '', array("class" => "text_input align_left", "style" => "width: 50%;")), 'announcement');
    $form_container->output_row($lang->bam_form_style, $lang->bam_form_style_desc, $form->generate_select_box('class', $class_select, $mybb->input['fieldtype'], array('id' => 'style')), 'class');
    $form_container->output_row($lang->bam_form_class_custom, $lang->bam_form_class_custom_desc, $form->generate_text_box("custom_class", $mybb->input['custom_class'], array("class" => "text_input", "style" => "width: 25%;")), 'custom_class');
    $options = array();
    $query = $db->simple_select("usergroups", "gid, title", null, array('order_by' => 'title'));
    while ($usergroup = $db->fetch_array($query)) {
        $options[(int) $usergroup['gid']] = $usergroup['title'];
        $default_usergroups[] = (int) $usergroup['gid'];
    }
    $form_container->output_row($lang->bam_form_groups, $lang->bam_form_groups_desc, $form->generate_select_box('usergroup[]', $options, $default_usergroups, array('id' => 'usergroup', 'multiple' => true, 'size' => 5)), 'usergroup');
    $query = $db->query("SELECT disporder FROM " . TABLE_PREFIX . "bam ORDER BY disporder DESC LIMIT 1");
    // select last announcement by display order.
    $last = $db->fetch_array($query);
    $form_container->output_row($lang->bam_form_order, $lang->bam_form_order_desc, $form->generate_text_box("disporder", (int) $last['disporder'] + 1, array("class" => "text_input align_right", "style" => "width: 25%;")), 'disporder');
    $form_container->output_row($lang->bam_form_url, $lang->bam_form_url_desc, $form->generate_text_box("url", $mybb->input['url'], array("class" => "text_input align_right", "style" => "width: 25%;")), 'url');
    $form_container->output_row($lang->bam_form_pinned, $lang->bam_form_pinned_desc, $form->generate_yes_no_radio('pinned', 0));
    $buttons[] = $form->generate_submit_button($lang->bam_form_add_submit);
开发者ID:Darth-Apple,项目名称:BAM,代码行数:31,代码来源:bam.php

示例14: foreach

        echo $form->generate_hidden_field("add", "moderators");
        // Usergroup Moderator
        if (!is_array($usergroups)) {
            $usergroups = $groupscache;
        }
        foreach ($usergroups as $group) {
            $modgroups[$group['gid']] = $lang->usergroup . " " . $group['gid'] . ": " . htmlspecialchars_uni($group['title']);
        }
        if (!isset($mybb->input['usergroup'])) {
            $mybb->input['usergroup'] = '';
        }
        if (!isset($mybb->input['username'])) {
            $mybb->input['username'] = '';
        }
        $form_container = new FormContainer($lang->add_usergroup_as_moderator);
        $form_container->output_row($lang->usergroup . " <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_select_box('usergroup', $modgroups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
        $form_container->end();
        $buttons[] = $form->generate_submit_button($lang->add_usergroup_moderator);
        $form->output_submit_wrapper($buttons);
        $form->end();
        echo "<br />";
        $form = new Form("index.php?module=forum-management", "post", "management");
        echo $form->generate_hidden_field("fid", $mybb->input['fid']);
        echo $form->generate_hidden_field("add", "moderators");
        $form_container = new FormContainer($lang->add_user_as_moderator);
        $form_container->output_row($lang->username . " <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
        $form_container->end();
        // Autocompletion for usernames
        echo '
		<link rel="stylesheet" href="../jscripts/select2/select2.css">
		<script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script>
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:management.php

示例15: FormContainer

 }
 $form_container = new FormContainer("{$lang->send_mass_mail}: {$lang->step_one} - {$lang->message_settings}");
 $form_container->output_row("{$lang->subject}: <em>*</em>", $lang->subject_desc, $form->generate_text_box('subject', $input['subject'], array('id' => 'subject')), 'subject');
 if ($mybb->input['type'] == 0) {
     $type_email_checked = true;
     $type_pm_checked = false;
 } else {
     if ($mybb->input['type'] == 1) {
         $type_email_checked = false;
         $type_pm_checked = true;
     }
 }
 $type_options = array($form->generate_radio_button("type", 0, $lang->send_via_email, array("id" => "type_email", "checked" => $type_email_checked)), $form->generate_radio_button("type", 1, $lang->send_via_pm, array("id" => "type_pm", "checked" => $type_pm_checked)));
 $form_container->output_row("{$lang->message_type}:", "", implode("<br />", $type_options));
 $format_options = array(0 => $lang->plain_text_only, 1 => $lang->html_only, 2 => $lang->html_and_plain_text);
 $form_container->output_row("{$lang->message_format}:", "", $form->generate_select_box('format', $format_options, $input['format'], array('id' => 'format')), 'format', null, array("id" => "format_container"));
 $form_container->output_row("{$lang->per_page}: <em>*</em>", $lang->per_page_desc, $form->generate_text_box('perpage', $input['perpage'], array('id' => 'perpage')), 'perpage');
 $form_container->end();
 if ($mybb->input['format'] == 2) {
     if ($mybb->input['automatic_text'] && !$email['mid']) {
         $automatic_text_check = true;
         $text_display = 'display: none';
         $automatic_display = 'display: none;';
     }
 } else {
     if ($mybb->input['format'] == 1 && $mybb->input['type'] != 1) {
         $text_display = 'display: none;';
     } else {
         if ($mybb->input['format'] == 0 || $mybb->input['type'] == 1) {
             $html_display = 'display: none';
         }
开发者ID:Nidrax,项目名称:ppm-1.6,代码行数:31,代码来源:mass_mail.php


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