Commit 5d055a76 authored by webchick's avatar webchick

#550228 by tobiasb and sun: Fixed double-escaping of title callbacks in Image module.

parent e6eb4899
......@@ -22,13 +22,6 @@ function image_style_list() {
}
/**
* Menu title callback; Title for editing and deleting image styles.
*/
function image_style_title($string, $style) {
return t($string, array('!name' => $style['name']));
}
/**
* Form builder; Edit an image style name and effects order.
*
......@@ -41,6 +34,9 @@ function image_style_title($string, $style) {
* @see image_style_name_validate()
*/
function image_style_form(&$form_state, $style) {
$title = t('Edit %name style', array('%name' => $style['name']));
drupal_set_title($title, PASS_THROUGH);
$form_state['image_style'] = $style;
$form = array(
'#tree' => TRUE,
......@@ -75,7 +71,7 @@ function image_style_form(&$form_state, $style) {
'#default_value' => $effect['weight'],
);
$form['effects'][$ieid]['configure'] = array(
'#markup' => isset($effect['form callback']) ? l(t('configure'), 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'] ) : '',
'#markup' => isset($effect['form callback']) ? l(t('edit'), 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'] ) : '',
);
$form['effects'][$ieid]['remove'] = array(
'#markup' => l(t('delete'), 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $effect['ieid'] . '/delete'),
......@@ -275,16 +271,6 @@ function image_style_delete_form_submit($form, &$form_state) {
$form_state['redirect'] = 'admin/config/media/image-styles';
}
/**
* Menu title callback; Title for editing, deleting, and adding image effects.
*
* @param $effect
* An image effect array.
*/
function image_effect_title($string, $effect) {
return t($string, array('!label' => $effect['label']));
}
/**
* Form builder; Form for adding and editing image effects.
*
......@@ -309,6 +295,14 @@ function image_effect_title($string, $effect) {
* @see image_effect_form_submit()
*/
function image_effect_form(&$form_state, $style, $effect) {
if (!empty($effect['data'])) {
$title = t('Edit %label effect', array('%label' => $effect['label']));
}
else{
$title = t('Add %label effect', array('%label' => $effect['label']));
}
drupal_set_title($title, PASS_THROUGH);
$form_state['image_style'] = $style;
$form_state['image_effect'] = $effect;
......
......@@ -71,8 +71,6 @@ function image_menu() {
);
$items['admin/config/media/image-styles/edit/%image_style'] = array(
'title' => 'Edit style',
'title callback' => 'image_style_title',
'title arguments' => array('!name', 4),
'description' => 'Configure an image style.',
'page callback' => 'drupal_get_form',
'page arguments' => array('image_style_form', 5),
......@@ -81,8 +79,6 @@ function image_menu() {
);
$items['admin/config/media/image-styles/delete/%image_style'] = array(
'title' => 'Delete style',
'title callback' => 'image_style_title',
'title arguments' => array('Delete !name', 4),
'description' => 'Delete an image style.',
'page callback' => 'drupal_get_form',
'page arguments' => array('image_style_delete_form', 5, TRUE),
......@@ -91,8 +87,6 @@ function image_menu() {
);
$items['admin/config/media/image-styles/edit/%image_style/effects/%image_effect'] = array(
'title' => 'Edit image effect',
'title callback' => 'image_effect_title',
'title arguments' => array('!label effect', 6),
'description' => 'Edit an exiting effect within a style.',
'page callback' => 'drupal_get_form',
'page arguments' => array('image_effect_form', 5, 7),
......@@ -101,8 +95,6 @@ function image_menu() {
);
$items['admin/config/media/image-styles/edit/%image_style/effects/%image_effect/delete'] = array(
'title' => 'Delete image effect',
'title callback' => 'image_effect_title',
'title arguments' => array('Delete !label', 6),
'description' => 'Delete an exiting effect from a style.',
'page callback' => 'drupal_get_form',
'page arguments' => array('image_effect_delete_form', 5, 7),
......@@ -111,8 +103,6 @@ function image_menu() {
);
$items['admin/config/media/image-styles/edit/%image_style/add/%image_effect_definition'] = array(
'title' => 'Add image effect',
'title callback' => 'image_effect_title',
'title arguments' => array('Add !label effect', 6),
'description' => 'Add a new effect to a style.',
'page callback' => 'drupal_get_form',
'page arguments' => array('image_effect_form', 5, 7),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment