Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / entity_browser / entity_browser.module
index a73e5eade078985f196a3050594842c6fb592e0d..872164516d716a888751ac5c9fa4ab7c3da502e6 100644 (file)
@@ -19,7 +19,7 @@ function entity_browser_help($route_name, RouteMatchInterface $arg) {
     case 'help.page.entity_browser':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Entity Browser module provides a generic entity browser/picker/selector. It can be used in any context where one needs to select a few entities and do something with them. For more information, see the online documentation for <a href=":entity_browser-documentation">Entity Browser</a>.', array(':entity_browser-documentation' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html')) . '</p>';
+      $output .= '<p>' . t('The Entity Browser module provides a generic entity browser/picker/selector. It can be used in any context where one needs to select a few entities and do something with them. For more information, see the online documentation for <a href=":entity_browser-documentation">Entity Browser</a>.', [':entity_browser-documentation' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('General') . '</dt>';
@@ -133,7 +133,7 @@ function entity_browser_preprocess_page__entity_browser__modal(&$variables) {
  *   See file_validate_image_resolution()
  */
 function entity_browser_file_validate_image_resolution(FileInterface $file, $maximum_dimensions = 0, $minimum_dimensions = 0) {
-  $errors = array();
+  $errors = [];
 
   // Check first that the file is an image.
   $image_factory = \Drupal::service('image.factory');
@@ -149,7 +149,7 @@ function entity_browser_file_validate_image_resolution(FileInterface $file, $max
         if (!$file->isPermanent() && $image->scale($width, $height)) {
           $image->save();
           $file->filesize = $image->getFileSize();
-          drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions)));
+          drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $maximum_dimensions]));
         }
         else {
           $errors[] = t('The image exceeds the maximum allowed dimensions.');
@@ -161,7 +161,7 @@ function entity_browser_file_validate_image_resolution(FileInterface $file, $max
       // Check that it is larger than the given dimensions.
       list($width, $height) = explode('x', $minimum_dimensions);
       if ($image->getWidth() < $width || $image->getHeight() < $height) {
-        $errors[] = t('The image is too small; the minimum dimensions are %dimensions pixels.', array('%dimensions' => $minimum_dimensions));
+        $errors[] = t('The image is too small; the minimum dimensions are %dimensions pixels.', ['%dimensions' => $minimum_dimensions]);
       }
     }
   }