- Patch #885000 by cwgordon7: drupal_placeholder() takes an array as an argument.
parent
5d6bc299ff
commit
33ef42291f
|
@ -1453,7 +1453,7 @@ function t($string, array $args = array(), array $options = array()) {
|
|||
case '%':
|
||||
default:
|
||||
// Escaped and placeholder.
|
||||
$args[$key] = drupal_placeholder(array('text' => $value));
|
||||
$args[$key] = drupal_placeholder($value);
|
||||
break;
|
||||
|
||||
case '!':
|
||||
|
@ -2958,15 +2958,14 @@ function drupal_is_cli() {
|
|||
* Formats text for emphasized display in a placeholder inside a sentence.
|
||||
* Used automatically by t().
|
||||
*
|
||||
* @param $variables
|
||||
* An associative array containing:
|
||||
* - text: The text to format (plain-text).
|
||||
* @param $text
|
||||
* The text to format (plain-text).
|
||||
*
|
||||
* @return
|
||||
* The formatted text (html).
|
||||
*/
|
||||
function drupal_placeholder($variables) {
|
||||
return '<em class="placeholder">' . check_plain($variables['text']) . '</em>';
|
||||
function drupal_placeholder($text) {
|
||||
return '<em class="placeholder">' . check_plain($text) . '</em>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,8 +23,8 @@ function filter_admin_overview($form) {
|
|||
// to all roles and cannot be deleted via the admin interface.
|
||||
$form['formats'][$id]['#is_fallback'] = ($id == $fallback_format);
|
||||
if ($form['formats'][$id]['#is_fallback']) {
|
||||
$form['formats'][$id]['name'] = array('#markup' => drupal_placeholder(array('text' => $format->name)));
|
||||
$roles_markup = drupal_placeholder(array('text' => t('All roles may use this format')));
|
||||
$form['formats'][$id]['name'] = array('#markup' => drupal_placeholder($format->name));
|
||||
$roles_markup = drupal_placeholder(t('All roles may use this format'));
|
||||
}
|
||||
else {
|
||||
$form['formats'][$id]['name'] = array('#markup' => check_plain($format->name));
|
||||
|
|
|
@ -307,10 +307,10 @@ function filter_permission() {
|
|||
if (!empty($permission)) {
|
||||
// Only link to the text format configuration page if the user who is
|
||||
// viewing this will have access to that page.
|
||||
$format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : drupal_placeholder(array('text' => $format->name));
|
||||
$format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : drupal_placeholder($format->name);
|
||||
$perms[$permission] = array(
|
||||
'title' => t("Use the !text_format text format", array('!text_format' => $format_name_replacement,)),
|
||||
'description' => drupal_placeholder(array('text' => t('Warning: This permission may have security implications depending on how the text format is configured.'))),
|
||||
'description' => drupal_placeholder(t('Warning: This permission may have security implications depending on how the text format is configured.')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -508,7 +508,7 @@ function node_revision_overview($node) {
|
|||
$row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', array('account' => $revision))))
|
||||
. (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''),
|
||||
'class' => array('revision-current'));
|
||||
$operations[] = array('data' => drupal_placeholder(array('text' => t('current revision'))), 'class' => array('revision-current'), 'colspan' => 2);
|
||||
$operations[] = array('data' => drupal_placeholder(t('current revision')), 'class' => array('revision-current'), 'colspan' => 2);
|
||||
}
|
||||
else {
|
||||
$row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', array('account' => $revision))))
|
||||
|
|
|
@ -77,7 +77,7 @@ function profile_browse() {
|
|||
$output .= theme('pager', array('tags' => NULL));
|
||||
|
||||
if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield') {
|
||||
$title = strtr(check_plain($field->page), array('%value' => drupal_placeholder(array('text' => $value))));
|
||||
$title = strtr(check_plain($field->page), array('%value' => drupal_placeholder($value)));
|
||||
}
|
||||
else {
|
||||
$title = check_plain($field->page);
|
||||
|
|
|
@ -168,7 +168,7 @@ function theme_update_report($variables) {
|
|||
foreach ($project['extra'] as $key => $value) {
|
||||
$row .= '<div class="' . implode(' ', $value['class']) . '">';
|
||||
$row .= check_plain($value['label']) . ': ';
|
||||
$row .= drupal_placeholder(array('text' => $value['data']));
|
||||
$row .= drupal_placeholder($value['data']);
|
||||
$row .= "</div>\n";
|
||||
}
|
||||
$row .= "</div>\n"; // extra div.
|
||||
|
@ -203,7 +203,7 @@ function theme_update_report($variables) {
|
|||
break;
|
||||
|
||||
default:
|
||||
$base_themes[] = drupal_placeholder(array('text' => $base_theme));
|
||||
$base_themes[] = drupal_placeholder($base_theme);
|
||||
}
|
||||
}
|
||||
$row .= t('Depends on: !basethemes', array('!basethemes' => implode(', ', $base_themes)));
|
||||
|
|
Loading…
Reference in New Issue