Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / system.module
index ef6e3d5d552bdfd4217a3495b99347e3689a5a5e..6bef11011c4efadf23fdf5543ee710a85c5eea24 100644 (file)
@@ -258,7 +258,7 @@ function system_theme() {
       'file' => 'system.admin.inc',
     ],
     'admin_block' => [
-      'variables' => ['block' => NULL],
+      'variables' => ['block' => NULL, 'attributes' => []],
       'file' => 'system.admin.inc',
     ],
     'admin_block_content' => [
@@ -276,6 +276,9 @@ function system_theme() {
       ],
       'template' => 'entity-add-list',
     ],
+    'off_canvas_page_wrapper' => [
+      'variables' => ['children' => NULL],
+    ],
   ]);
 }
 
@@ -447,7 +450,7 @@ function template_preprocess_entity_add_list(&$variables) {
  *  $form_state->setRedirectUrl(system_authorized_get_url());
  * @endcode
  *
- * @param $callback
+ * @param callable $callback
  *   The name of the function to invoke once the user authorizes the operation.
  * @param $file
  *   The full path to the file where the callback function is implemented.
@@ -1443,7 +1446,7 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl
     $path = file_build_uri(drupal_basename($parsed_url['path']));
   }
   else {
-    if (is_dir(drupal_realpath($destination))) {
+    if (is_dir(\Drupal::service('file_system')->realpath($destination))) {
       // Prevent URIs with triple slashes when glueing parts together.
       $path = str_replace('///', '//', "$destination/") . drupal_basename($parsed_url['path']);
     }
@@ -1522,3 +1525,12 @@ function system_query_entity_reference_alter(AlterableInterface $query) {
   $handler = $query->getMetadata('entity_reference_selection_handler');
   $handler->entityQueryAlter($query);
 }
+
+/**
+ * Implements hook_element_info_alter().
+ */
+function system_element_info_alter(&$type) {
+  if (isset($type['page'])) {
+    $type['page']['#theme_wrappers']['off_canvas_page_wrapper'] = ['#weight' => -1000];
+  }
+}