當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormContainer類代碼示例

本文整理匯總了PHP中FormContainer的典型用法代碼示例。如果您正苦於以下問題:PHP FormContainer類的具體用法?PHP FormContainer怎麽用?PHP FormContainer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FormContainer類的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($enabled)
{
    $form = new Form('index.php?module=cloudflare-ipv46&action=change', 'post');
    $form_container = new FormContainer("IPv6 Support");
    $form_container->output_row('IPv6 Support', 'Enable IPv6 support and gateway', $form->generate_yes_no_radio('enable_ipv6', $enabled ? "1" : "0"));
    $form_container->end();
    $buttons[] = $form->generate_submit_button('Submit');
    $form->output_submit_wrapper($buttons);
    $form->end();
}
開發者ID:dequeues,項目名稱:MyBB-CloudFlare-Manager,代碼行數:10,代碼來源:cloudflare_ipv46.php

示例3: main_page

function main_page()
{
    $form = new Form('index.php?module=cloudflare-purge_cache&action=purge', 'post');
    $form_container = new FormContainer('Purge Cache');
    $form_container->output_row('Purge Entire Cache', 'Remove ALL files from CloudFlare\'s cache. This will include javascript, stylesheets and images. CloudFlare can take up to 3 hours to recache resources again<br /><b>Note: </b>This may have dramatic affects on your origin server load after performing this action.', $form->generate_yes_no_radio('purge_input', 0));
    $form_container->output_row('Purge by URL', 'Granularly remove one or more files from CloudFlare\'s cache either by specifying the URL<br /><b>Note: </b><u>One</u> URL per line (max: 30)', $form->generate_text_area('urls'));
    $form_container->end();
    $buttons[] = $form->generate_submit_button('Submit');
    $form->output_submit_wrapper($buttons);
    $form->end();
}
開發者ID:dequeues,項目名稱:MyBB-CloudFlare-Manager,代碼行數:11,代碼來源:cloudflare_purge_cache.php

示例4: main_page

function main_page()
{
    $form = new Form("index.php?module=cloudflare-blacklist&amp;action=run", "post");
    $form_container = new FormContainer("Blacklist an IP");
    $form_container->output_row("IP Address", "The IP address you would like to blacklist<br /><b>Only a single IP is currently supported!</b>", $form->generate_text_box('ip_address'));
    $form_container->output_row("Notes", "Any notes you would like to add", $form->generate_text_box('notes'));
    $form_container->end();
    $buttons[] = $form->generate_submit_button("Submit");
    $form->output_submit_wrapper($buttons);
    $form->end();
}
開發者ID:dequeues,項目名稱:MyBB-CloudFlare-Manager,代碼行數:11,代碼來源:cloudflare_blacklist.php

示例5: main_page

function main_page()
{
    $form = new Form("index.php?module=cloudflare-challenge&amp;action=add_ip", "post");
    $form_container = new FormContainer("Challenge an IP");
    $form_container->output_row("IP Address", "The IP address won't be able to access your site until they have completed the captcha successfully or you have removed them from the challenge list.", $form->generate_text_box('ip_address'));
    $form_container->output_row("Notes", "Any notes you would like to add", $form->generate_text_box('notes'));
    $form_container->end();
    $buttons[] = $form->generate_submit_button("Submit");
    $form->output_submit_wrapper($buttons);
    $form->end();
}
開發者ID:dequeues,項目名稱:MyBB-CloudFlare-Manager,代碼行數:11,代碼來源:cloudflare_challenge.php

示例6: exportContainer

 /**
  * Exports description for JavaScript.
  * @return array
  */
 public function exportContainer(FormContainer $container)
 {
     $data = array();
     foreach ($container->getComponents() as $name => $control) {
         if ($control instanceof FormContainer) {
             $data[$name] = $this->exportContainer($control);
         } elseif ($control instanceof IFormControl) {
             $data[$name] = $this->exportControl($control);
         }
     }
     return array('class' => $container->getClass(), 'controls' => $data);
 }
開發者ID:jakubkulhan,項目名稱:shopaholic,代碼行數:16,代碼來源:UserClientScript.php

示例7: main_page

function main_page($in_dev_mode, $time_remaining = 0)
{
    global $page;
    if ($in_dev_mode) {
        $page->output_alert("CloudFlare is currently in development mode. This will expire in " . gmdate("H:i:s", $time_remaining));
    }
    $form = new Form('index.php?module=cloudflare-dev_mode&amp;action=change', 'post');
    $form_container = new FormContainer('Change development mode');
    $form_container->output_row('Development Mode', "This will bypass CloudFlare's accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away.", $form->generate_on_off_radio('dev_mode', $in_dev_mode ? 1 : 0));
    $form_container->end();
    $buttons[] = $form->generate_submit_button('Submit');
    $form->output_submit_wrapper($buttons);
    $form->end();
}
開發者ID:dequeues,項目名稱:MyBB-CloudFlare-Manager,代碼行數:14,代碼來源:cloudflare_dev_mode.php

示例8: main_page

function main_page($current_setting)
{
    global $security_levels;
    $form = new Form('index.php?module=cloudflare-security_lvl&amp;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

示例9: get

 /**
  * Produce HTML output for all this fieldset and all contained controls
  *
  * @param Theme $theme
  * @return string HTML that will render this control in the form
  */
 function get(Theme $theme)
 {
     $this->settings['ignore_name'] = true;
     $controls = array();
     foreach ($this->controls as $control) {
         if ($class = $this->get_setting('class_each', '')) {
             $control->add_class($class);
         }
         if ($control instanceof FormContainer) {
             $control->set_template($this->get_setting('tab_template', 'control.fieldset.fortabs'));
             $controls[$control->caption] = $control->get($theme);
         }
     }
     $this->vars['controls'] = $controls;
     return parent::get($theme);
 }
開發者ID:habari,項目名稱:system,代碼行數:22,代碼來源:formcontroltabs.php

示例10: ON

    $user_options['0'] = '----------';
    $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
 */
開發者ID:ThinhNguyenVB,項目名稱:Gradient-Studios-Website,代碼行數:31,代碼來源:adminlog.php

示例11: FormContainer

    } else {
        $mybb->input = $mycode;
    }
    $form_container = new FormContainer($lang->edit_mycode);
    $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->regular_expression . " <em>*</em>", $lang->regular_expression_desc . '<br /><strong>' . $lang->example . '</strong> \\[b\\](.*?)\\[/b\\]', $form->generate_text_area('regex', $mybb->input['regex'], array('id' => 'regex')), 'regex');
    $form_container->output_row($lang->replacement . " <em>*</em>", $lang->replacement_desc . '<br /><strong>' . $lang->example . '</strong> &lt;strong&gt;$1&lt;/strong&gt;', $form->generate_text_area('replacement', $mybb->input['replacement'], array('id' => 'replacement')), 'replacement');
    $form_container->output_row($lang->enabled . " <em>*</em>", '', $form->generate_yes_no_radio('active', $mybb->input['active']));
    $form_container->output_row($lang->parse_order, $lang->parse_order_desc, $form->generate_text_box('parseorder', $mybb->input['parseorder'], array('id' => 'parseorder')), 'parseorder');
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_mycode);
    $form->output_submit_wrapper($buttons);
    // Sandbox
    echo "<br />\n";
    $form_container = new FormContainer($lang->sandbox);
    $form_container->output_row($lang->sandbox_desc);
    $form_container->output_row($lang->test_value, $lang->test_value_desc, $form->generate_text_area('test_value', $mybb->input['test_value'], array('id' => 'test_value')) . "<br />" . $form->generate_submit_button($lang->test, array('id' => 'test', 'name' => 'test')), 'test_value');
    $form_container->output_row($lang->result_html, $lang->result_html_desc, $form->generate_text_area('result_html', $sandbox['html'], array('id' => 'result_html', 'disabled' => 1)), 'result_html');
    $form_container->output_row($lang->result_actual, $lang->result_actual_desc, "<div id=\"result_actual\">{$sandbox['actual']}</div>");
    $form_container->end();
    echo '<script type="text/javascript" src="./jscripts/mycode_sandbox.js"></script>';
    echo '<script type="text/javascript">

Event.observe(window, "load", function() {
//<![CDATA[
    new MyCodeSandbox("./index.php?module=config/mycode&action=xmlhttp_test_mycode", $("test"), $("regex"), $("replacement"), $("test_value"), $("result_html"), $("result_actual"));
});
//]]>
</script>';
    $form->end();
開發者ID:benn0034,項目名稱:SHIELDsite2.old,代碼行數:31,代碼來源:mycode.php

示例12: user_search_conditions

function user_search_conditions($input = array(), &$form)
{
    global $mybb, $db, $lang;
    if (!$input) {
        $input = $mybb->input;
    }
    if (!is_array($input['conditions'])) {
        $input['conditions'] = unserialize($input['conditions']);
    }
    if (!is_array($input['profile_fields'])) {
        $input['profile_fields'] = unserialize($input['profile_fields']);
    }
    if (!is_array($input['fields'])) {
        $input['fields'] = unserialize($input['fields']);
    }
    $form_container = new FormContainer($lang->find_users_where);
    $form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
    $form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
    $options = array();
    $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->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');
    $form_container->output_row($lang->website_contains, "", $form->generate_text_box('conditions[website]', $input['conditions']['website'], array('id' => 'website')) . " {$lang->or} " . $form->generate_check_box('conditions[website_blank]', 1, $lang->is_not_blank, array('id' => 'website_blank', 'checked' => $input['conditions']['website_blank'])), 'website');
    $form_container->output_row($lang->icq_number_contains, "", $form->generate_text_box('conditions[icq]', $input['conditions']['icq'], array('id' => 'icq')) . " {$lang->or} " . $form->generate_check_box('conditions[icq_blank]', 1, $lang->is_not_blank, array('id' => 'icq_blank', 'checked' => $input['conditions']['icq_blank'])), 'icq');
    $form_container->output_row($lang->aim_handle_contains, "", $form->generate_text_box('conditions[aim]', $input['conditions']['aim'], array('id' => 'aim')) . " {$lang->or} " . $form->generate_check_box('conditions[aim_blank]', 1, $lang->is_not_blank, array('id' => 'aim_blank', 'checked' => $input['conditions']['aim_blank'])), 'aim');
    $form_container->output_row($lang->yahoo_contains, "", $form->generate_text_box('conditions[yahoo]', $input['conditions']['yahoo'], array('id' => 'yahoo')) . " {$lang->or} " . $form->generate_check_box('conditions[yahoo_blank]', 1, $lang->is_not_blank, array('id' => 'yahoo_blank', 'checked' => $input['conditions']['yahoo_blank'])), 'yahoo');
    $form_container->output_row($lang->msn_contains, "", $form->generate_text_box('conditions[msn]', $input['conditions']['msn'], array('id' => 'msn')) . " {$lang->or} " . $form->generate_check_box('conditions[msn_blank]', 1, $lang->is_not_blank, array('id' => 'msn_blank', 'checked' => $input['conditions']['msn_blank'])), 'msn');
    $form_container->output_row($lang->signature_contains, "", $form->generate_text_box('conditions[signature]', $input['conditions']['signature'], array('id' => 'signature')) . " {$lang->or} " . $form->generate_check_box('conditions[signature_blank]', 1, $lang->is_not_blank, array('id' => 'signature_blank', 'checked' => $input['conditions']['signature_blank'])), 'signature');
    $form_container->output_row($lang->user_title_contains, "", $form->generate_text_box('conditions[usertitle]', $input['conditions']['usertitle'], array('id' => 'usertitle')) . " {$lang->or} " . $form->generate_check_box('conditions[usertitle_blank]', 1, $lang->is_not_blank, array('id' => 'usertitle_blank', 'checked' => $input['conditions']['usertitle_blank'])), 'usertitle');
    $greater_options = array("greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly, "less_than" => $lang->less_than);
    $form_container->output_row($lang->post_count_is, "", $form->generate_select_box('conditions[postnum_dir]', $greater_options, $input['conditions']['postnum_dir'], array('id' => 'numposts_dir')) . " " . $form->generate_text_box('conditions[postnum]', $input['conditions']['postnum'], array('id' => 'numposts')), 'numposts');
    $form_container->output_row($lang->reg_in_x_days, '', $form->generate_text_box('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate')) . ' ' . $lang->days, 'regdate');
    $form_container->output_row($lang->reg_ip_matches, $lang->wildcard, $form->generate_text_box('conditions[regip]', $input['conditions']['regip'], array('id' => 'regip')), 'regip');
    $form_container->output_row($lang->last_known_ip, $lang->wildcard, $form->generate_text_box('conditions[lastip]', $input['conditions']['lastip'], array('id' => 'lastip')), 'lastip');
    $form_container->output_row($lang->posted_with_ip, $lang->wildcard, $form->generate_text_box('conditions[postip]', $input['conditions']['postip'], array('id' => 'postip')), 'postip');
    $form_container->end();
    // Custom profile fields go here
    $form_container = new FormContainer($lang->custom_profile_fields_match);
    // Fetch custom profile fields
    $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
    while ($profile_field = $db->fetch_array($query)) {
        if ($profile_field['required'] == 1) {
            $profile_fields['required'][] = $profile_field;
        } else {
            $profile_fields['optional'][] = $profile_field;
        }
    }
    output_custom_profile_fields($profile_fields['required'], $input['profile_fields'], $form_container, $form, true);
    output_custom_profile_fields($profile_fields['optional'], $input['profile_fields'], $form_container, $form, true);
    $form_container->end();
    // Autocompletion for usernames
    echo '
	<script type="text/javascript" src="../jscripts/autocomplete.js?ver=140"></script>
	<script type="text/javascript">
	<!--
		new autoComplete("username", "../xmlhttp.php?action=get_users", {valueSpan: "username"});
	// -->
	</script>';
}
開發者ID:GeorgeLVP,項目名稱:mybb,代碼行數:61,代碼來源:users.php

示例13: array

 $sub_tabs['add_smilie'] = array('title' => $lang->add_smilie, 'link' => "index.php?module=config-smilies&amp;action=add");
 $sub_tabs['add_multiple_smilies'] = array('title' => $lang->add_multiple_smilies, 'link' => "index.php?module=config-smilies&amp;action=add_multiple");
 $sub_tabs['mass_edit'] = array('title' => $lang->mass_edit, 'link' => "index.php?module=config-smilies&amp;action=mass_edit", 'description' => $lang->mass_edit_desc);
 $page->output_nav_tabs($sub_tabs, 'mass_edit');
 $form = new Form("index.php?module=config-smilies&amp;action=mass_edit", "post", "mass_edit");
 if ($errors) {
     $page->output_inline_error($errors);
 } else {
     $mybb->input['path'] = 'images/smilies/';
     $mybb->input['showclickable'] = 1;
 }
 if (!$mybb->input['disporder']) {
     $query = $db->simple_select("smilies", "max(disporder) as dispordermax");
     $mybb->input['disporder'] = $db->fetch_field($query, "dispordermax") + 1;
 }
 $form_container = new FormContainer($lang->manage_smilies);
 $form_container->output_row_header($lang->image, array("class" => "align_center", 'width' => '1'));
 $form_container->output_row_header($lang->name);
 $form_container->output_row_header($lang->text_replace, array('width' => '20%'));
 $form_container->output_row_header($lang->order, array('width' => '5%'));
 $form_container->output_row_header($lang->mass_edit_show_clickable, array("width" => 165));
 $form_container->output_row_header($lang->smilie_delete, array("class" => "align_center", 'width' => '5%'));
 $query = $db->simple_select("smilies", "*", "", array('order_by' => 'disporder'));
 while ($smilie = $db->fetch_array($query)) {
     $smilie['image'] = str_replace("{theme:imgdir}", $theme['imgdir'], $smilie['image']);
     if (my_strpos($smilie['image'], "p://") || substr($smilie['image'], 0, 1) == "/") {
         $image = $smilie['image'];
     } else {
         $image = "../" . $smilie['image'];
     }
     $form_container->output_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center", "width" => 1));
開發者ID:GeorgeLVP,項目名稱:mybb,代碼行數:31,代碼來源:smilies.php

示例14: user_search_conditions

/**
 * @param array $input
 * @param DefaultForm $form
 */
function user_search_conditions($input = array(), &$form)
{
    global $mybb, $db, $lang;
    if (!$input) {
        $input = $mybb->input;
    }
    if (!is_array($input['conditions'])) {
        $input['conditions'] = my_unserialize($input['conditions']);
    }
    if (!is_array($input['profile_fields'])) {
        $input['profile_fields'] = my_unserialize($input['profile_fields']);
    }
    if (!is_array($input['fields'])) {
        $input['fields'] = my_unserialize($input['fields']);
    }
    $form_container = new FormContainer($lang->find_users_where);
    $form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
    $form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
    $options = array();
    $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->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');
    $form_container->output_row($lang->website_contains, "", $form->generate_text_box('conditions[website]', $input['conditions']['website'], array('id' => 'website')) . " {$lang->or} " . $form->generate_check_box('conditions[website_blank]', 1, $lang->is_not_blank, array('id' => 'website_blank', 'checked' => $input['conditions']['website_blank'])), 'website');
    $form_container->output_row($lang->icq_number_contains, "", $form->generate_text_box('conditions[icq]', $input['conditions']['icq'], array('id' => 'icq')) . " {$lang->or} " . $form->generate_check_box('conditions[icq_blank]', 1, $lang->is_not_blank, array('id' => 'icq_blank', 'checked' => $input['conditions']['icq_blank'])), 'icq');
    $form_container->output_row($lang->aim_handle_contains, "", $form->generate_text_box('conditions[aim]', $input['conditions']['aim'], array('id' => 'aim')) . " {$lang->or} " . $form->generate_check_box('conditions[aim_blank]', 1, $lang->is_not_blank, array('id' => 'aim_blank', 'checked' => $input['conditions']['aim_blank'])), 'aim');
    $form_container->output_row($lang->yahoo_contains, "", $form->generate_text_box('conditions[yahoo]', $input['conditions']['yahoo'], array('id' => 'yahoo')) . " {$lang->or} " . $form->generate_check_box('conditions[yahoo_blank]', 1, $lang->is_not_blank, array('id' => 'yahoo_blank', 'checked' => $input['conditions']['yahoo_blank'])), 'yahoo');
    $form_container->output_row($lang->skype_contains, "", $form->generate_text_box('conditions[skype]', $input['conditions']['skype'], array('id' => 'skype')) . " {$lang->or} " . $form->generate_check_box('conditions[skype_blank]', 1, $lang->is_not_blank, array('id' => 'skype_blank', 'checked' => $input['conditions']['skype_blank'])), 'skype');
    $form_container->output_row($lang->google_contains, "", $form->generate_text_box('conditions[google]', $input['conditions']['google'], array('id' => 'google')) . " {$lang->or} " . $form->generate_check_box('conditions[google_blank]', 1, $lang->is_not_blank, array('id' => 'google_blank', 'checked' => $input['conditions']['google_blank'])), 'google');
    $form_container->output_row($lang->signature_contains, "", $form->generate_text_box('conditions[signature]', $input['conditions']['signature'], array('id' => 'signature')) . " {$lang->or} " . $form->generate_check_box('conditions[signature_blank]', 1, $lang->is_not_blank, array('id' => 'signature_blank', 'checked' => $input['conditions']['signature_blank'])), 'signature');
    $form_container->output_row($lang->user_title_contains, "", $form->generate_text_box('conditions[usertitle]', $input['conditions']['usertitle'], array('id' => 'usertitle')) . " {$lang->or} " . $form->generate_check_box('conditions[usertitle_blank]', 1, $lang->is_not_blank, array('id' => 'usertitle_blank', 'checked' => $input['conditions']['usertitle_blank'])), 'usertitle');
    $greater_options = array("greater_than" => $lang->greater_than, "is_exactly" => $lang->is_exactly, "less_than" => $lang->less_than);
    $form_container->output_row($lang->post_count_is, "", $form->generate_select_box('conditions[postnum_dir]', $greater_options, $input['conditions']['postnum_dir'], array('id' => 'numposts_dir')) . " " . $form->generate_text_box('conditions[postnum]', $input['conditions']['postnum'], array('id' => 'numposts')), 'numposts');
    $form_container->output_row($lang->thread_count_is, "", $form->generate_select_box('conditions[threadnum_dir]', $greater_options, $input['conditions']['threadnum_dir'], array('id' => 'numthreads_dir')) . " " . $form->generate_text_box('conditions[threadnum]', $input['conditions']['threadnum'], array('id' => 'numthreads')), 'numthreads');
    $form_container->output_row($lang->reg_in_x_days, '', $form->generate_text_box('conditions[regdate]', $input['conditions']['regdate'], array('id' => 'regdate')) . ' ' . $lang->days, 'regdate');
    $form_container->output_row($lang->reg_ip_matches, $lang->wildcard, $form->generate_text_box('conditions[regip]', $input['conditions']['regip'], array('id' => 'regip')), 'regip');
    $form_container->output_row($lang->last_known_ip, $lang->wildcard, $form->generate_text_box('conditions[lastip]', $input['conditions']['lastip'], array('id' => 'lastip')), 'lastip');
    $form_container->output_row($lang->posted_with_ip, $lang->wildcard, $form->generate_text_box('conditions[postip]', $input['conditions']['postip'], array('id' => 'postip')), 'postip');
    $form_container->end();
    // Custom profile fields go here
    $form_container = new FormContainer($lang->custom_profile_fields_match);
    // Fetch custom profile fields
    $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
    $profile_fields = array();
    while ($profile_field = $db->fetch_array($query)) {
        if ($profile_field['required'] == 1) {
            $profile_fields['required'][] = $profile_field;
        } else {
            $profile_fields['optional'][] = $profile_field;
        }
    }
    output_custom_profile_fields($profile_fields['required'], $input['profile_fields'], $form_container, $form, true);
    output_custom_profile_fields($profile_fields['optional'], $input['profile_fields'], $form_container, $form, true);
    $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>
<script type="text/javascript">
<!--
$("#username").select2({
	placeholder: "' . $lang->search_for_a_user . '",
	minimumInputLength: 3,
	maximumSelectionSize: 3,
	multiple: false,
	ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
		url: "../xmlhttp.php?action=get_users",
		dataType: \'json\',
		data: function (term, page) {
			return {
				query: term // search term
			};
		},
		results: function (data, page) { // parse the results into the format expected by Select2.
			// since we are using custom formatting functions we do not need to alter remote JSON data
			return {results: data};
		}
	},
	initSelection: function(element, callback) {
		var query = $(element).val();
		if (query !== "") {
			$.ajax("../xmlhttp.php?action=get_users&getone=1", {
				data: {
					query: query
				},
				dataType: "json"
			}).done(function(data) { callback(data); });
		}
	}
});
// -->
</script>';
}
開發者ID:mainhan1804,項目名稱:xomvanphong,代碼行數:98,代碼來源:users.php

示例15: array

    $actions = "\n\t<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">\n\t<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"1\" {$move_checked[1]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_move_thread}</strong></label></dt>\n\t\t<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"2\" {$move_checked[2]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->move_thread}</strong></label></dt>\n\t\t<dd style=\"margin-top: 4px;\" id=\"move_2\" class=\"moves\">\n\t\t\t<table cellpadding=\"4\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><small>{$lang->forum_to_move_to}</small></td>\n\t\t\t\t\t<td>" . $form->generate_forum_select('move_1_forum', $mybb->input['move_1_forum']) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><small>{$lang->leave_redirect}</small></td>\n\t\t\t\t\t<td>" . $form->generate_yes_no_radio('move_2_redirect', $mybb->input['move_2_redirect']) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><small>{$lang->delete_redirect_after}</small></td>\n\t\t\t\t\t<td>" . $form->generate_text_box('move_3_redirecttime', $mybb->input['move_3_redirecttime'], array('style' => 'width: 2em;')) . " {$lang->days}</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</dd>\n\t</dl>\n\t<script type=\"text/javascript\">\n\tcheckAction('move');\n\t</script>";
    $form_container->output_row($lang->move_thread . " <em>*</em>", $lang->move_thread_desc, $actions);
    $actions = "\n\t<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">\n\t<dt><label style=\"display: block;\"><input type=\"radio\" name=\"copy_type\" value=\"1\" {$copy_checked[1]} class=\"copys_check\" onclick=\"checkAction('copy');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_copy_thread}</strong></label></dt>\n\t\t<dt><label style=\"display: block;\"><input type=\"radio\" name=\"copy_type\" value=\"2\" {$copy_checked[2]} class=\"copys_check\" onclick=\"checkAction('copy');\" style=\"vertical-align: middle;\" /> <strong>{$lang->copy_thread}</strong></label></dt>\n\t\t<dd style=\"margin-top: 4px;\" id=\"copy_2\" class=\"copys\">\n\t\t\t<table cellpadding=\"4\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><small>{$lang->forum_to_copy_to}</small></td>\n\t\t\t\t\t<td>" . $form->generate_forum_select('copy_1_forum', $mybb->input['copy_1_forum']) . "</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</dd>\n\t</dl>\n\t<script type=\"text/javascript\">\n\tcheckAction('copy');\n\t</script>";
    $form_container->output_row($lang->copy_thread . " <em>*</em>", '', $actions);
    $form_container->output_row($lang->delete_thread . " <em>*</em>", '', $form->generate_yes_no_radio('deletethread', $mybb->input['deletethread']));
    $query = $db->simple_select('threadprefixes', 'pid, prefix');
    if ($db->num_rows($query) > 0) {
        $thread_prefixes = array('-1' => $lang->no_change, '0' => $lang->no_prefix);
        while ($prefix = $db->fetch_array($query)) {
            $thread_prefixes[$prefix['pid']] = $prefix['prefix'];
        }
        $form_container->output_row($lang->apply_thread_prefix . " <em>*</em>", '', $form->generate_select_box('threadprefix', $thread_prefixes, $mybb->input['threadprefix'], array('id' => 'threadprefix')), 'threadprefix');
    }
    $form_container->output_row($lang->new_subject . " <em>*</em>", $lang->new_subject_desc, $form->generate_text_box('newsubject', $mybb->input['newsubject']));
    $form_container->end();
    $form_container = new FormContainer($lang->add_new_reply);
    $form_container->output_row($lang->add_new_reply, $lang->add_new_reply_desc, $form->generate_text_area('newreply', $mybb->input['newreply'], array('id' => 'newreply')), 'newreply');
    $form_container->output_row($lang->reply_subject, $lang->reply_subject_desc, $form->generate_text_box('newreplysubject', $mybb->input['newreplysubject'], array('id' => 'newreplysubject')), 'newreplysubject');
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_post_tool);
    $form->output_submit_wrapper($buttons);
    $form->end();
    $page->output_footer();
}
if (!$mybb->input['action']) {
    $plugins->run_hooks("admin_config_mod_tools_start");
    $page->output_header($lang->mod_tools . " - " . $lang->thread_tools);
    $sub_tabs['thread_tools'] = array('title' => $lang->thread_tools, 'link' => "index.php?module=config-mod_tools", 'description' => $lang->thread_tools_desc);
    $sub_tabs['add_thread_tool'] = array('title' => $lang->add_new_thread_tool, 'link' => "index.php?module=config-mod_tools&amp;action=add_thread_tool");
    $sub_tabs['post_tools'] = array('title' => $lang->post_tools, 'link' => "index.php?module=config-mod_tools&amp;action=post_tools");
    $sub_tabs['add_post_tool'] = array('title' => $lang->add_new_post_tool, 'link' => "index.php?module=config-mod_tools&amp;action=add_post_tool");
開發者ID:GeorgeLVP,項目名稱:mybb,代碼行數:31,代碼來源:mod_tools.php


注:本文中的FormContainer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。