summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngie Byron2009-08-23 02:19:02 (GMT)
committerAngie Byron2009-08-23 02:19:02 (GMT)
commit5d055a765c8c3bbcf056498a8930ea263fdfdb8e (patch)
tree0979e81129b4341633579a3fe0bbd4fb256311df
parente6eb489918ed6e217038faf4e45ed510c64596fd (diff)
#550228 by tobiasb and sun: Fixed double-escaping of title callbacks in Image module.
-rw-r--r--modules/image/image.admin.inc30
-rw-r--r--modules/image/image.module10
2 files changed, 12 insertions, 28 deletions
diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc
index 996c142..45942c0 100644
--- a/modules/image/image.admin.inc
+++ b/modules/image/image.admin.inc
@@ -23,13 +23,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.
*
* @param $form_state
@@ -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'),
@@ -276,16 +272,6 @@ function image_style_delete_form_submit($form, &$form_state) {
}
/**
- * 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.
*
* This form is used universally for editing all image effects. Each effect adds
@@ -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;
diff --git a/modules/image/image.module b/modules/image/image.module
index d971b98..b468a55 100644
--- a/modules/image/image.module
+++ b/modules/image/image.module
@@ -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),