? .project ? sites/default/files ? sites/default/private ? sites/default/settings.php Index: modules/image/image.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.admin.inc,v retrieving revision 1.14 diff -u -p -r1.14 image.admin.inc --- modules/image/image.admin.inc 16 Oct 2009 00:52:46 -0000 1.14 +++ modules/image/image.admin.inc 16 Oct 2009 20:56:41 -0000 @@ -62,21 +62,34 @@ function image_style_form($form, &$form_ if ($style['storage'] & IMAGE_STORAGE_MODULE) { $form['name'] = array( '#type' => 'item', - '#title' => t('Image style name'), + '#title' => t('Image style namespace'), '#markup' => $style['name'], '#description' => t('This image style is being provided by %module module and may not be renamed.', array('%module' => $style['module'])), ); + $form['realname'] = array( + '#type' => 'item', + '#title' => t('Image style name'), + '#markup' => $style['realname'], + '#description' => t('This image style is being provided by %module module and may not be renamed.', array('%module' => $style['module'])), + ); } else { $form['name'] = array( '#type' => 'textfield', '#size' => '64', - '#title' => t('Image style name'), + '#title' => t('Image style namespace'), '#default_value' => $style['name'], '#description' => t('The name is used in URLs for generated images. Use only lowercase alphanumeric characters, underscores (_), and hyphens (-).'), '#element_validate' => array('image_style_name_validate'), '#required' => TRUE, ); + $form['realname'] = array( + '#type' => 'textfield', + '#size' => 64, + '#title' => t('Image style name'), + '#default_value' => $style['realname'], + '#description' => t('Enter a human readable name for this preset. This name is displayed in listings of image styles.'), + ); } // Build the list of existing image effects for this image style. @@ -197,6 +210,9 @@ function image_style_form_submit($form, if (isset($form_state['values']['name']) && $style['name'] != $form_state['values']['name']) { $style['name'] = $form_state['values']['name']; } + if (isset($form_state['values']['realname']) && $style['realname'] != $form_state['values']['realname']) { + $style['realname'] = $form_state['values']['realname']; + } // Update image effect weights. if (!empty($form_state['values']['effects'])) { @@ -633,7 +649,7 @@ function theme_image_style_list($variabl $rows = array(); foreach ($styles as $style) { $row = array(); - $row[] = l($style['name'], 'admin/config/media/image-styles/edit/' . $style['name']); + $row[] = l($style['realname'], 'admin/config/media/image-styles/edit/' . $style['name']); $link_attributes = array( 'attributes' => array( 'class' => array('image-style-link'), Index: modules/image/image.field.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.field.inc,v retrieving revision 1.1 diff -u -p -r1.1 image.field.inc --- modules/image/image.field.inc 12 Oct 2009 05:22:57 -0000 1.1 +++ modules/image/image.field.inc 16 Oct 2009 20:56:43 -0000 @@ -431,17 +431,17 @@ function image_field_formatter_info() { foreach (image_styles() as $style) { $formatters['image__' . $style['name']] = array( - 'label' => t('Image "@style"', array('@style' => $style['name'])), + 'label' => t('Image "@style"', array('@style' => $style['realname'])), 'field types' => array('image'), 'theme' => array('function' => 'theme_field_formatter_image'), ); $formatters['image_link_content__' . $style['name']] = array( - 'label' => t('Image "@style" linked to content', array('@style' => $style['name'])), + 'label' => t('Image "@style" linked to content', array('@style' => $style['realname'])), 'field types' => array('image'), 'theme' => array('function' => 'theme_field_formatter_image_link_content'), ); $formatters['image_link_file__' . $style['name']] = array( - 'label' => t('Image "@style" linked to file', array('@style' => $style['name'])), + 'label' => t('Image "@style" linked to file', array('@style' => $style['realname'])), 'field types' => array('image'), 'theme' => array('function' => 'theme_field_formatter_image_link_file'), ); Index: modules/image/image.install =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.install,v retrieving revision 1.3 diff -u -p -r1.3 image.install --- modules/image/image.install 10 Sep 2009 06:38:18 -0000 1.3 +++ modules/image/image.install 16 Oct 2009 20:56:43 -0000 @@ -43,11 +43,18 @@ function image_schema() { 'not null' => TRUE, ), 'name' => array( - 'description' => 'The style name.', + 'description' => 'The style namespace.', 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, ), + 'realname' => array( + 'description' => 'The style name.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'default' => '', + ), ), 'primary key' => array('isid'), 'indexes' => array( Index: modules/image/image.module =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.module,v retrieving revision 1.22 diff -u -p -r1.22 image.module --- modules/image/image.module 16 Oct 2009 00:52:46 -0000 1.22 +++ modules/image/image.module 16 Oct 2009 20:56:46 -0000 @@ -323,6 +323,7 @@ function image_image_default_styles() { $styles = array(); $styles['thumbnail'] = array( + 'realname' => 'Thumbnail (100x100)', 'effects' => array( array( 'name' => 'image_scale', @@ -333,6 +334,7 @@ function image_image_default_styles() { ); $styles['medium'] = array( + 'realname' => 'Medium (220x220)', 'effects' => array( array( 'name' => 'image_scale', @@ -343,6 +345,7 @@ function image_image_default_styles() { ); $styles['large'] = array( + 'realname' => 'Large (640x640)', 'effects' => array( array( 'name' => 'image_scale', @@ -394,6 +397,7 @@ function image_styles() { $module_styles = module_invoke($module, 'image_default_styles'); foreach ($module_styles as $style_name => $style) { $style['name'] = $style_name; + $style['realname'] = ($style['realname'] == '') ? $style['name'] : $style['realname']; $style['module'] = $module; $style['storage'] = IMAGE_STORAGE_DEFAULT; foreach ($style['effects'] as $ieid => $effect) { @@ -409,12 +413,14 @@ function image_styles() { // Select all the user-defined styles. $user_styles = db_select('image_styles', NULL, array('fetch' => PDO::FETCH_ASSOC)) ->fields('image_styles') + ->orderBy('realname') ->orderBy('name') ->execute() ->fetchAllAssoc('name', PDO::FETCH_ASSOC); // Allow the user styles to override the module styles. foreach ($user_styles as $style_name => $style) { + $style['realname'] = ($style['realname'] == '') ? $style['name'] : $style['realname']; $style['module'] = NULL; $style['storage'] = IMAGE_STORAGE_NORMAL; $style['effects'] = image_style_effects($style); @@ -468,6 +474,11 @@ function image_style_load($name = NULL, } } + if (isset($style)) { + if ($style['realname'] == '') { + $style['realname'] = $style['name']; + } + } // Restrict to the specific type of flag. This bitwise operation basically // states "if the storage is X, then allow". if (isset($style) && (!isset($include) || ($style['storage'] & (int) $include))) { @@ -571,7 +582,9 @@ function image_style_options($include_em if ($include_empty && !empty($styles)) { $options[''] = t(''); } - $options = array_merge($options, drupal_map_assoc(array_keys($styles))); + foreach ($styles as $name => $style) { + $options[$name] = $style['realname']; + } if (empty($options)) { $options[''] = t('No defined styles'); }