Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/image/image.field.inc @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
3 /** | 3 /** |
4 * @file | 4 * @file |
5 * Implement an image field, based on the file module's file field. | 5 * Implement an image field, based on the file module's file field. |
6 */ | 6 */ |
7 | 7 |
8 use Drupal\Component\Utility\Unicode; | |
9 use Drupal\Core\Render\Element; | 8 use Drupal\Core\Render\Element; |
10 | 9 |
11 /** | 10 /** |
12 * Prepares variables for image widget templates. | 11 * Prepares variables for image widget templates. |
13 * | 12 * |
62 $variables['image']['#attributes'] = $variables['item_attributes']; | 61 $variables['image']['#attributes'] = $variables['item_attributes']; |
63 | 62 |
64 $item = $variables['item']; | 63 $item = $variables['item']; |
65 | 64 |
66 // Do not output an empty 'title' attribute. | 65 // Do not output an empty 'title' attribute. |
67 if (Unicode::strlen($item->title) != 0) { | 66 if (mb_strlen($item->title) != 0) { |
68 $variables['image']['#title'] = $item->title; | 67 $variables['image']['#title'] = $item->title; |
69 } | 68 } |
70 | 69 |
71 if (($entity = $item->entity) && empty($item->uri)) { | 70 if (($entity = $item->entity) && empty($item->uri)) { |
72 $variables['image']['#uri'] = $entity->getFileUri(); | 71 $variables['image']['#uri'] = $entity->getFileUri(); |