本文整理汇总了PHP中check_selected函数的典型用法代码示例。如果您正苦于以下问题:PHP check_selected函数的具体用法?PHP check_selected怎么用?PHP check_selected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_selected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_status_option_list_plugin
function print_status_option_list_plugin($p_select_label, $p_current_value = 0, $p_allow_close = false, $p_project_id = ALL_PROJECTS)
{
$t_current_auth = access_get_project_level($p_project_id);
#Changement de la fonction de récupération des statuts
$t_enum_list = get_status_option_list_plugin($t_current_auth, $p_current_value, true, $p_allow_close, $p_project_id);
if (count($t_enum_list) > 1) {
# resort the list into ascending order
ksort($t_enum_list);
reset($t_enum_list);
echo '<select ', helper_get_tab_index(), ' name="' . $p_select_label . '">';
foreach ($t_enum_list as $key => $val) {
#On ne veut pas afficher la valeur @0@
if ($val == '@0@') {
continue;
}
echo '<option value="' . $key . '"';
check_selected($key, $p_current_value, false);
#fix 1.3.0
echo '>' . $val . '</option>';
}
echo '</select>';
} else {
if (count($t_enum_list) == 1) {
echo array_pop($t_enum_list);
} else {
echo MantisEnum::getLabel(lang_get('status_enum_string'), $p_current_value);
}
}
}
示例2: kanban_ajax_button_bug_change_status
/**
* Print Change Status to: AJAXified button
* This code is similar to button_bug_change_status except that the
* button is AJAXified.
* Uses projax.php
*
* @param int $p_bug_id
* @param int $t_project_id
* @param int $t_user_id
* @return null
*/
function kanban_ajax_button_bug_change_status($p_bug_id, $t_project_id, $t_user_id)
{
global $g_projax;
$t_bug_project_id = bug_get_field($p_bug_id, 'project_id');
$t_bug_current_state = bug_get_field($p_bug_id, 'status');
$t_current_access = access_get_project_level($t_bug_project_id);
$t_enum_list = get_status_option_list($t_current_access, $t_bug_current_state, false, bug_get_field($p_bug_id, 'reporter_id') == auth_get_current_user_id() && ON == config_get('allow_reporter_close'), $t_bug_project_id);
if (count($t_enum_list) > 0) {
# resort the list into ascending order after noting the key from the first element (the default)
$t_default_arr = each($t_enum_list);
$t_default = $t_default_arr['key'];
ksort($t_enum_list);
reset($t_enum_list);
echo "<div id=\"ajax_statuschange\"><form method=\"post\" id=\"ajax_status_form\" action=\"xmlhttprequest.php\">";
# CSRF protection not required here - form does not result in modifications
echo "<input type=\"hidden\" name=\"project_id\" id=\"project_id\" value=\"{$t_project_id}\" />";
echo "<input type=\"hidden\" name=\"user_id\" id=\"user_id\" value=\"{$t_user_id}\" />";
echo "<input type=\"hidden\" name=\"entrypoint\" id=\"entrypoint\" value=\"bug_update_status\" />";
$t_button_text = lang_get('bug_status_to_button');
// AJAX button options
$options = array('url' => plugin_page('kanban_ajax_request'), 'with' => true, 'confirm' => lang_get('confirm_change_status'), 'success' => 'location.reload()', 'failure' => 'alert("Error: " ' + request . status + ')');
echo $g_projax->submit_to_remote('ajax_status', $t_button_text, $options);
echo " <select name=\"new_status\">";
# space at beginning of line is important
foreach ($t_enum_list as $key => $val) {
echo "<option value=\"{$key}\" ";
check_selected($key, $t_default);
echo ">{$val}</option>";
}
echo '</select>';
$t_bug_id = string_attribute($p_bug_id);
echo "<input type=\"hidden\" name=\"id\" value=\"{$t_bug_id}\" />\n";
echo "</form></div>\n";
}
}
示例3: print_option_list_from_array
function print_option_list_from_array($p_array, $p_filter_value)
{
foreach ($p_array as $t_key => $t_value) {
echo "<option value='{$t_key}'";
check_selected($p_filter_value, $t_key);
echo '>' . string_attribute($t_value) . "</option>\n";
}
}
示例4: print_filter_project_id
/**
* print project field
*/
function print_filter_project_id()
{
global $t_select_modifier, $t_filter, $f_view_type;
?>
<!-- Project -->
<select<?php
echo $t_select_modifier;
?>
name="<?php
echo FILTER_PROPERTY_PROJECT_ID;
?>
[]">
<option value="<?php
echo META_FILTER_CURRENT;
?>
"<?php
check_selected($t_filter[FILTER_PROPERTY_PROJECT_ID], META_FILTER_CURRENT);
?>
>[<?php
echo lang_get('current');
?>
]</option>
<?php
print_project_option_list($t_filter[FILTER_PROPERTY_PROJECT_ID]);
?>
</select>
<?php
}
示例5: html_button_bug_assign_to
/**
* Print Assign To: combo box of possible handlers
* @param BugData $p_bug Bug object.
* @return void
*/
function html_button_bug_assign_to(BugData $p_bug)
{
# make sure status is allowed of assign would cause auto-set-status
# workflow implementation
if (ON == config_get('auto_set_status_to_assigned') && !bug_check_workflow($p_bug->status, config_get('bug_assigned_status'))) {
return;
}
# make sure current user has access to modify bugs.
if (!access_has_bug_level(config_get('update_bug_assign_threshold', config_get('update_bug_threshold')), $p_bug->id)) {
return;
}
$t_current_user_id = auth_get_current_user_id();
$t_options = array();
$t_default_assign_to = null;
if ($p_bug->handler_id != $t_current_user_id && access_has_bug_level(config_get('handle_bug_threshold'), $p_bug->id, $t_current_user_id)) {
$t_options[] = array($t_current_user_id, '[' . lang_get('myself') . ']');
$t_default_assign_to = $t_current_user_id;
}
if ($p_bug->handler_id != $p_bug->reporter_id && user_exists($p_bug->reporter_id) && access_has_bug_level(config_get('handle_bug_threshold'), $p_bug->id, $p_bug->reporter_id)) {
$t_options[] = array($p_bug->reporter_id, '[' . lang_get('reporter') . ']');
if ($t_default_assign_to === null) {
$t_default_assign_to = $p_bug->reporter_id;
}
}
echo '<form method="post" action="bug_update.php">';
echo form_security_field('bug_update');
$t_button_text = lang_get('bug_assign_to_button');
echo '<input type="submit" class="button" value="' . $t_button_text . '" />';
echo ' <select name="handler_id">';
# space at beginning of line is important
$t_already_selected = false;
foreach ($t_options as $t_entry) {
$t_id = (int) $t_entry[0];
$t_caption = string_attribute($t_entry[1]);
# if current user and reporter can't be selected, then select the first
# user in the list.
if ($t_default_assign_to === null) {
$t_default_assign_to = $t_id;
}
echo '<option value="' . $t_id . '" ';
if ($t_id == $t_default_assign_to && !$t_already_selected) {
check_selected($t_id, $t_default_assign_to);
$t_already_selected = true;
}
echo '>' . $t_caption . '</option>';
}
# allow un-assigning if already assigned.
if ($p_bug->handler_id != 0) {
echo '<option value="0"></option>';
}
# 0 means currently selected
print_assign_to_option_list(0, $p_bug->project_id);
echo '</select>';
$t_bug_id = string_attribute($p_bug->id);
echo '<input type="hidden" name="bug_id" value="' . $t_bug_id . '" />' . "\n";
echo '</form>' . "\n";
}
示例6: print_timezone_option_list
/**
* Print the option list for time zones
* @param string $p_timezone Selected time zone.
* @return void
*/
function print_timezone_option_list($p_timezone)
{
if (!function_exists('timezone_identifiers_list')) {
echo "\t" . '<option value="' . $p_timezone . '" selected="selected">' . $p_timezone . '</option>' . "\n";
return;
}
$t_identifiers = timezone_identifiers_list(DateTimeZone::ALL);
foreach ($t_identifiers as $t_identifier) {
$t_zone = explode('/', $t_identifier);
if (isset($t_zone[1]) != '') {
$t_locations[$t_zone[0]][$t_zone[0] . '/' . $t_zone[1]] = array(str_replace('_', ' ', $t_zone[1]), $t_identifier);
}
}
foreach ($t_locations as $t_continent => $t_locations) {
echo "\t" . '<optgroup label="' . $t_continent . '">' . "\n";
foreach ($t_locations as $t_location) {
echo "\t\t" . '<option value="' . $t_location[1] . '"';
check_selected($p_timezone, $t_location[1]);
echo '>' . $t_location[0] . '</option>' . "\n";
}
echo "\t" . '</optgroup>' . "\n";
}
}
示例7: check_selected
<td><select name="bugfix_status_pvm">
<option value="0" <?php
echo check_selected(0, plugin_config_get('bugfix_status_pvm'));
?>
><?php
echo plugin_lang_get('bugfix_status_off');
?>
</option>
<?php
foreach (config_get('plugin_ProductMatrix_status') as $t_status => $t_name) {
?>
<option value="<?php
echo string_attribute($t_status);
?>
" <?php
echo check_selected($t_status, plugin_config_get('bugfix_status_pvm'));
?>
><?php
echo string_display_line($t_name);
?>
</option>
<?php
}
?>
</select></td>
</tr>
<?php
}
?>
<tr <?php
示例8: helper_get_tab_index
</label>
</th>
<td>
<select <?php
echo helper_get_tab_index();
?>
name="status">
<?php
$t_resolution_options = get_status_option_list(access_get_project_level($t_project_id), config_get('bug_submit_status'), true, ON == config_get('allow_reporter_close'), $t_project_id);
foreach ($t_resolution_options as $t_key => $t_value) {
?>
<option value="<?php
echo $t_key;
?>
" <?php
check_selected($t_key, config_get('bug_submit_status'));
?>
>
<?php
echo $t_value;
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
<?php
}
?>
示例9: print_timezone_option_list
/**
* Print the option list for time zones
* @param string $p_timezone Selected time zone.
* @return void
*/
function print_timezone_option_list($p_timezone)
{
$t_identifiers = timezone_identifiers_list(DateTimeZone::ALL);
foreach ($t_identifiers as $t_identifier) {
$t_zone = explode('/', $t_identifier, 2);
if (isset($t_zone[1])) {
$t_id = $t_zone[1];
} else {
$t_id = $t_identifier;
}
$t_locations[$t_zone[0]][$t_identifier] = array(str_replace('_', ' ', $t_id), $t_identifier);
}
foreach ($t_locations as $t_continent => $t_locations) {
echo "\t" . '<optgroup label="' . $t_continent . '">' . "\n";
foreach ($t_locations as $t_location) {
echo "\t\t" . '<option value="' . $t_location[1] . '"';
check_selected($p_timezone, $t_location[1]);
echo '>' . $t_location[0] . '</option>' . "\n";
}
echo "\t" . '</optgroup>' . "\n";
}
}
示例10: plugin_lang_get
><?php
echo plugin_lang_get('na');
?>
</option>
<option value="">--</option>
<?php
foreach ($t_repo->branches as $t_branch) {
if ($t_branch == $t_changeset->branch) {
continue;
}
?>
<option value="<?php
echo string_attribute($t_branch);
?>
" <?php
echo check_selected($t_branch, $t_changeset->ported);
?>
><?php
echo string_display_line($t_branch);
?>
</option>
<?php
}
?>
</select>
<input type="submit" value="<?php
echo plugin_lang_get('update');
?>
"/>
<?php
} else {
示例11: ERP_custom_function_print_tag_attach_option_list
function ERP_custom_function_print_tag_attach_option_list($p_sel_value)
{
require_api('tag_api.php');
$t_rows = tag_get_candidates_for_bug(0);
foreach ($t_rows as $row) {
$t_string = $row['name'];
if (!empty($row['description'])) {
$t_string .= ' - ' . utf8_substr($row['description'], 0, 20);
}
echo '<option value="', $row['id'], '" title="', string_attribute($row['name']), '"';
check_selected((array) $p_sel_value, (int) $row['id']);
echo '>', string_attribute($t_string), '</option>';
}
}
示例12: print_language_option_list
function print_language_option_list($p_language)
{
$t_arr = config_get('language_choices_arr');
$enum_count = count($t_arr);
for ($i = 0; $i < $enum_count; $i++) {
$t_language = string_attribute($t_arr[$i]);
print "<option value=\"{$t_language}\"";
check_selected($t_language, $p_language);
print ">{$t_language}</option>";
}
# end for
}
示例13: print_filter_custom_field_date
function print_filter_custom_field_date($p_field_num, $p_field_id)
{
global $t_filter, $t_accessible_custom_fields_names, $t_accessible_custom_fields_types, $t_accessible_custom_fields_values, $t_accessible_custom_fields_ids, $t_select_modifier;
$t_js_toggle_func = "toggle_custom_date_field_" . $p_field_id . "_controls";
# Resort the values so there ordered numerically, they are sorted as strings otherwise which
# may be wrong for dates before early 2001.
if (is_array($t_accessible_custom_fields_values[$p_field_num])) {
array_multisort($t_accessible_custom_fields_values[$p_field_num], SORT_NUMERIC, SORT_ASC);
}
if (isset($t_accessible_custom_fields_values[$p_field_num][0])) {
$t_sel_start_year = date('Y', $t_accessible_custom_fields_values[$p_field_num][0]);
}
$t_count = count($t_accessible_custom_fields_values[$p_field_num]);
if (isset($t_accessible_custom_fields_values[$p_field_num][$t_count - 1])) {
$t_sel_end_year = date('Y', $t_accessible_custom_fields_values[$p_field_num][$t_count - 1]);
}
$t_start = date('U');
# Default to today in filters..
$t_end = $t_start;
if (isset($t_filter['custom_fields'][$p_field_id][1])) {
$t_start_time = $t_filter['custom_fields'][$p_field_id][1];
} else {
$t_start_time = 0;
}
if (isset($t_filter['custom_fields'][$p_field_id][2])) {
$t_end_time = $t_filter['custom_fields'][$p_field_id][2];
} else {
$t_end_time = 0;
}
$t_start_disable = true;
$t_end_disable = true;
// if $t_filter['custom_fields'][$p_field_id][0] is not set (ie no filter), we will drop through the
// following switch and use the default values above, so no need to check if stuff is set or not.
switch ($t_filter['custom_fields'][$p_field_id][0]) {
case CUSTOM_FIELD_DATE_ANY:
case CUSTOM_FIELD_DATE_NONE:
break;
case CUSTOM_FIELD_DATE_BETWEEN:
$t_start_disable = false;
$t_end_disable = false;
$t_start = $t_start_time;
$t_end = $t_end_time;
break;
case CUSTOM_FIELD_DATE_ONORBEFORE:
$t_start_disable = false;
$t_start = $t_end_time;
break;
case CUSTOM_FIELD_DATE_BEFORE:
$t_start_disable = false;
$t_start = $t_end_time;
break;
case CUSTOM_FIELD_DATE_ON:
$t_start_disable = false;
$t_start = $t_start_time;
break;
case CUSTOM_FIELD_DATE_AFTER:
$t_start_disable = false;
$t_start = $t_start_time;
break;
case CUSTOM_FIELD_DATE_ONORAFTER:
$t_start_disable = false;
$t_start = $t_start_time;
break;
}
echo "\n<table cellspacing=\"0\" cellpadding=\"0\"><tr><td>\n";
echo "<select size=\"1\" name=\"custom_field_" . $p_field_id . "_control\" OnChange=\"" . $t_js_toggle_func . "();\">\n";
echo '<option value="' . CUSTOM_FIELD_DATE_ANY . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ANY);
echo '>' . lang_get('any') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_NONE . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_NONE);
echo '>' . lang_get('none') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_BETWEEN . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_BETWEEN);
echo '>' . lang_get('between') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_ONORBEFORE . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ONORBEFORE);
echo '>' . lang_get('on_or_before') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_BEFORE . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_BEFORE);
echo '>' . lang_get('before') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_ON . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ON);
echo '>' . lang_get('on') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_AFTER . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_AFTER);
echo '>' . lang_get('after') . '</option>' . "\n";
echo '<option value="' . CUSTOM_FIELD_DATE_ONORAFTER . '"';
check_selected($t_filter['custom_fields'][$p_field_id][0], CUSTOM_FIELD_DATE_ONORAFTER);
echo '>' . lang_get('on_or_after') . '</option>' . "\n";
echo '</select>' . "\n";
echo "</td></tr>\n<tr><td>";
print_date_selection_set("custom_field_" . $p_field_id . "_start", config_get('short_date_format'), $t_start, $t_start_disable, false, $t_sel_start_year, $t_sel_end_year);
print "</td></tr>\n<tr><td>";
print_date_selection_set("custom_field_" . $p_field_id . "_end", config_get('short_date_format'), $t_end, $t_end_disable, false, $t_sel_start_year, $t_sel_end_year);
print "</td></tr>\n</table>";
}
示例14: if
<?php if( $t_show_status ) { ?>
<div class="field-container">
<label><span><?php echo lang_get( 'status' ) ?></span></label>
<span class="select">
<select <?php echo helper_get_tab_index() ?> name="status">
<?php
$t_resolution_options = get_status_option_list(
access_get_project_level( $t_project_id ),
config_get( 'bug_submit_status' ),
true,
ON == config_get( 'allow_reporter_close' ),
$t_project_id );
foreach ( $t_resolution_options as $t_key => $t_value ) {
?>
<option value="<?php echo $t_key ?>" <?php check_selected( $t_key, config_get( 'bug_submit_status' ) ); ?> >
<?php echo $t_value ?>
</option>
<?php } ?>
</select>
</span>
<span class="label-style"></span>
</div>
<?php } ?>
<?php if( $t_show_resolution ) { ?>
<div class="field-container">
<label><span><?php echo lang_get( 'resolution' ) ?></span></label>
<span class="select">
<select <?php echo helper_get_tab_index() ?> name="resolution">
<?php
示例15: helper_alternate_class
echo helper_alternate_class();
?>
>
<td class="category" width="60%">
<?php
echo lang_get('custom_field');
?>
</td>
<td width="20%">
<select name="customid_field_id">
<?php
$t_custom_fields = custom_field_get_ids();
foreach ($t_custom_fields as $t_field_id) {
$t_desc = custom_field_get_definition($t_field_id);
echo "<option value=\"{$t_field_id}\"";
check_selected($t_field_id, plugin_config_get('field_id'));
echo ">" . string_attribute($t_desc['name']) . '</option>';
}
?>
</select>
</td>
</tr>
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category" width="60%">
<?php
echo plugin_lang_get('config_prefix');
?>