本文整理汇总了PHP中string_attribute函数的典型用法代码示例。如果您正苦于以下问题:PHP string_attribute函数的具体用法?PHP string_attribute怎么用?PHP string_attribute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了string_attribute函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bug_group_action_print_bug_list
/**
* Print the list of selected issues and the legend for the status colors.
*
* @param $p_bug_ids_array An array of issue ids.
*/
function bug_group_action_print_bug_list($p_bug_ids_array)
{
$t_legend_position = config_get('status_legend_position');
if (STATUS_LEGEND_POSITION_TOP == $t_legend_position) {
html_status_legend();
echo '<br />';
}
echo '<div align="center">';
echo '<table class="width75" cellspacing="1">';
echo '<tr class="row-1">';
echo '<td class="category" colspan="2">';
echo lang_get('actiongroup_bugs');
echo '</td>';
echo '</tr>';
$t_i = 1;
foreach ($p_bug_ids_array as $t_bug_id) {
$t_class = sprintf("row-%d", $t_i++ % 2 + 1);
echo sprintf("<tr bgcolor=\"%s\"> <td>%s</td> <td>%s</td> </tr>\n", get_status_color(bug_get_field($t_bug_id, 'status')), string_get_bug_view_link($t_bug_id), string_attribute(bug_get_field($t_bug_id, 'summary')));
}
echo '</table>';
echo '</form>';
echo '</div>';
if (STATUS_LEGEND_POSITION_BOTTOM == $t_legend_position) {
echo '<br />';
html_status_legend();
}
}
示例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: projax_array_serialize_for_autocomplete
function projax_array_serialize_for_autocomplete($p_array)
{
$t_matches = '<ul>';
foreach ($p_array as $t_entry) {
$t_matches .= '<li>' . string_attribute($t_entry) . '</li>';
}
$t_matches .= '</ul>';
return $t_matches;
}
示例5: prepare_email_link
/**
* return the mailto: href string link
* @param string $p_email
* @param string $p_text
* @return string
*/
function prepare_email_link($p_email, $p_text)
{
if (!access_has_project_level(config_get('show_user_email_threshold'))) {
return string_display_line($p_text);
}
# If we apply string_url() to the whole mailto: link then the @
# gets turned into a %40 and you can't right click in browsers to
# do Copy Email Address.
$t_mailto = string_attribute('mailto:' . $p_email);
$p_text = string_display_line($p_text);
return '<a href="' . $t_mailto . '">' . $p_text . '</a>';
}
示例6: prepare_email_link
function prepare_email_link($p_email, $p_text)
{
if (!access_has_project_level(config_get('show_user_email_threshold'))) {
return $p_text;
}
# If we apply string_url() to the whole mailto: link then the @
# gets turned into a %40 and you can't right click in browsers to
# do Copy Email Address.
$t_mailto = string_attribute("mailto:{$p_email}");
$p_text = string_display($p_text);
return "<a href=\"{$t_mailto}\">{$p_text}</a>";
}
示例7: custom_function_default_format_issue_summary
function custom_function_default_format_issue_summary($p_issue_id, $p_context = 0)
{
switch ($p_context) {
case SUMMARY_CAPTION:
$t_string = bug_format_id($p_issue_id) . ': ' . string_attribute(bug_get_field($p_issue_id, 'summary'));
break;
case SUMMARY_FIELD:
$t_string = bug_format_id($p_issue_id) . ': ' . string_attribute(bug_get_field($p_issue_id, 'summary'));
break;
case SUMMARY_EMAIL:
$t_string = bug_format_id($p_issue_id) . ': ' . string_attribute(bug_get_field($p_issue_id, 'summary'));
break;
default:
$t_string = string_attribute(bug_get_field($p_issue_id, 'summary'));
break;
}
return $t_string;
}
示例8: update_repo_form
public function update_repo_form($p_repo)
{
$t_sf_project = isset($p_repo->info['sf_project']) ? $p_repo->info['sf_project'] : '';
?>
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category"><?php
echo lang_get('plugin_SourceSFSVN_sf_project');
?>
</td>
<td><input name="sf_project" maxlength="250" size="40" value="<?php
echo string_attribute($t_sf_project);
?>
"/></td>
</tr>
<?php
return parent::update_repo_form($p_repo);
}
示例9: cfdef_input_textbox
function cfdef_input_textbox($p_field_def, $t_custom_field_value)
{
echo '<input ' . helper_get_tab_index() . ' type="text" id="custom_field_' . $p_field_def['id'] . '" name="custom_field_' . $p_field_def['id'] . '" size="80"';
if (0 < $p_field_def['length_max']) {
echo ' maxlength="' . $p_field_def['length_max'] . '"';
} else {
echo ' maxlength="255"';
}
echo ' value="' . string_attribute($t_custom_field_value) . '"></input>';
}
示例10: string_attribute
$t_custom_fields_found = true;
?>
<tr>
<th class="category">
<?php
if ($t_def['require_report']) {
?>
<span class="required">*</span>
<?php
}
?>
<?php
if ($t_def['type'] != CUSTOM_FIELD_TYPE_RADIO && $t_def['type'] != CUSTOM_FIELD_TYPE_CHECKBOX) {
?>
<label for="custom_field_<?php
echo string_attribute($t_def['id']);
?>
"><?php
echo string_display(lang_get_defaulted($t_def['name']));
?>
</label>
<?php
} else {
echo string_display(lang_get_defaulted($t_def['name']));
}
?>
</th>
<td>
<?php
print_custom_field_input($t_def, $f_master_bug_id === 0 ? null : $f_master_bug_id);
?>
示例11: print_bug_attachments_list
function print_bug_attachments_list($p_bug_id)
{
$t_attachments = file_get_visible_attachments($p_bug_id);
$t_attachments_count = count($t_attachments);
$i = 0;
$image_previewed = false;
foreach ($t_attachments as $t_attachment) {
$t_file_display_name = string_display_line($t_attachment['display_name']);
$t_filesize = number_format($t_attachment['size']);
$t_date_added = date(config_get('normal_date_format'), $t_attachment['date_added']);
if ($image_previewed) {
$image_previewed = false;
echo '<br />';
}
if ($t_attachment['can_download']) {
$t_href_start = '<a href="' . string_attribute($t_attachment['download_url']) . '">';
$t_href_end = '</a>';
$t_href_clicket = " [<a href=\"file_download.php?file_id={$t_attachment['id']}&type=bug\" target=\"_blank\">^</a>]";
} else {
$t_href_start = '';
$t_href_end = '';
$t_href_clicket = '';
}
if (!$t_attachment['exists']) {
print_file_icon($t_file_display_name);
echo ' <span class="strike">' . $t_file_display_name . '</span>' . lang_get('word_separator') . '(' . lang_get('attachment_missing') . ')';
} else {
echo $t_href_start;
print_file_icon($t_file_display_name);
echo $t_href_end . ' ' . $t_href_start . $t_file_display_name . $t_href_end . $t_href_clicket . ' (' . $t_filesize . ' ' . lang_get('bytes') . ') ' . '<span class="italic">' . $t_date_added . '</span>';
}
if ($t_attachment['can_delete']) {
echo ' [';
print_link('bug_file_delete.php?file_id=' . $t_attachment['id'] . form_security_param('bug_file_delete'), lang_get('delete_link'), false, 'small');
echo ']';
}
if ($t_attachment['exists']) {
if (FTP == config_get('file_upload_method') && $t_attachment['exists']) {
echo ' (' . lang_get('cached') . ')';
}
if ($t_attachment['preview'] && $t_attachment['type'] == 'text') {
$c_id = db_prepare_int($t_attachment['id']);
$t_bug_file_table = db_get_table('mantis_bug_file_table');
echo "<script type=\"text/javascript\" language=\"JavaScript\">\n<!--\nfunction swap_content( span ) {\ndisplayType = ( document.getElementById( span ).style.display == 'none' ) ? '' : 'none';\ndocument.getElementById( span ).style.display = displayType;\n}\n\n -->\n </script>";
echo " <span id=\"hideSection_{$c_id}\">[<a class=\"small\" href='#' id='attmlink_" . $c_id . "' onclick='swap_content(\"hideSection_" . $c_id . "\");swap_content(\"showSection_" . $c_id . "\");return false;'>" . lang_get('show_content') . "</a>]</span>";
echo " <span style='display:none' id=\"showSection_{$c_id}\">[<a class=\"small\" href='#' id='attmlink_" . $c_id . "' onclick='swap_content(\"hideSection_" . $c_id . "\");swap_content(\"showSection_" . $c_id . "\");return false;'>" . lang_get('hide_content') . "</a>]";
echo "<pre>";
/** @todo Refactor into a method that gets contents for download / preview. */
switch (config_get('file_upload_method')) {
case DISK:
if ($t_attachment['exists']) {
$v_content = file_get_contents($t_attachment['diskfile']);
}
break;
case FTP:
if (file_exists($t_attachment['exists'])) {
file_get_contents($t_attachment['diskfile']);
} else {
$ftp = file_ftp_connect();
file_ftp_get($ftp, $t_attachment['diskfile'], $t_attachment['diskfile']);
file_ftp_disconnect($ftp);
$v_content = file_get_contents($t_attachment['diskfile']);
}
break;
default:
$query = "SELECT *\n\t \t\t\t\t\tFROM {$t_bug_file_table}\n\t\t\t\t \t\t\tWHERE id=" . db_param();
$result = db_query_bound($query, array($c_id));
$row = db_fetch_array($result);
$v_content = $row['content'];
}
echo htmlspecialchars($v_content);
echo "</pre></span>\n";
}
if ($t_attachment['can_download'] && $t_attachment['preview'] && $t_attachment['type'] == 'image') {
$t_preview_style = 'border: 0;';
$t_max_width = config_get('preview_max_width');
if ($t_max_width > 0) {
$t_preview_style .= ' max-width:' . $t_max_width . 'px;';
}
$t_max_height = config_get('preview_max_height');
if ($t_max_height > 0) {
$t_preview_style .= ' max-height:' . $t_max_height . 'px;';
}
$t_preview_style = 'style="' . $t_preview_style . '"';
$t_title = file_get_field($t_attachment['id'], 'title');
$t_image_url = $t_attachment['download_url'] . '&show_inline=1' . form_security_param('file_show_inline');
echo "\n<br />{$t_href_start}<img alt=\"{$t_title}\" {$t_preview_style} src=\"{$t_image_url}\" />{$t_href_end}";
$image_previewed = true;
}
}
if ($i != $t_attachments_count - 1) {
echo "<br />\n";
$i++;
}
}
}
示例12: print_multivalue_field
/**
* Prints a multi-value filter field.
* @param string $p_field_name Field name.
* @param mixed $p_field_value Field value.
* @return void
*/
function print_multivalue_field($p_field_name, $p_field_value)
{
$t_output = '';
$t_any_found = false;
if (count($p_field_value) == 0) {
echo lang_get('any');
} else {
$t_first_flag = true;
$t_field_value = is_array($p_field_value) ? $p_field_value : array($p_field_value);
foreach ($t_field_value as $t_current) {
$t_current = stripslashes($t_current);
?>
<input type="hidden" name="<?php
echo string_attribute($p_field_name);
?>
[]" value="<?php
echo string_attribute($t_current);
?>
" />
<?php
$t_this_string = '';
if ($t_current == META_FILTER_ANY && is_numeric($t_current) || is_blank($t_current)) {
$t_any_found = true;
} else {
$t_this_string = string_display($t_current);
}
if ($t_first_flag != true) {
$t_output .= '<br />';
} else {
$t_first_flag = false;
}
$t_output .= $t_this_string;
}
if (true == $t_any_found) {
echo lang_get('any');
} else {
echo $t_output;
}
}
}
示例13: config_get
# --------------------------------------------------------
# $Id: manage_custom_field_delete.php,v 1.17.2.1 2007-10-13 22:33:27 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'custom_field_api.php';
form_security_validate('manage_custom_field_delete');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_custom_fields_threshold'));
$f_field_id = gpc_get_int('field_id');
$f_return = strip_tags(gpc_get_string('return', 'manage_custom_field_page.php'));
$t_definition = custom_field_get_definition($f_field_id);
if (0 < count(custom_field_get_project_ids($f_field_id))) {
helper_ensure_confirmed(lang_get('confirm_used_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
} else {
helper_ensure_confirmed(lang_get('confirm_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
}
custom_field_destroy($f_field_id);
form_security_purge('manage_custom_field_delete');
html_page_top1();
html_meta_redirect($f_return);
html_page_top2();
?>
<br />
<div align="center">
<?php
echo lang_get('operation_successful') . '<br />';
print_bracket_link($f_return, lang_get('proceed'));
?>
</div>
示例14: print_documentation_link
print_documentation_link('category');
?>
</td>
<td width="70%">
<?php
if ($t_changed_project) {
echo "[" . project_get_field($t_bug->project_id, 'name') . "] ";
}
?>
<select <?php
echo helper_get_tab_index();
?>
name="category">
<?php
if (is_blank($f_category)) {
echo '<option value="" selected="selected">', string_attribute(lang_get('select_option')), '</option>';
}
print_category_option_list($f_category);
?>
</select>
</td>
</tr>
<!-- Reproducibility -->
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category">
<?php
示例15: helper_alternate_class
?>
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category">
<span class="required">*</span><?php
print_documentation_link('summary');
?>
</td>
<td>
<input <?php
echo helper_get_tab_index();
?>
type="text" name="summary" size="105" maxlength="128" value="<?php
echo string_attribute($f_summary);
?>
" />
</td>
</tr>
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category">
<span class="required">*</span><?php
print_documentation_link('description');
?>
</td>
<td>
<textarea <?php