diff --git a/core/includes/common.inc b/core/includes/common.inc index 4a789c8..1307f5e 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -145,49 +145,6 @@ const LOCALE_PLURAL_DELIMITER = "\03"; /** - * Adds content to a specified region. - * - * @param $region - * Page region the content is added to. - * @param $data - * Content to be added. - */ -function drupal_add_region_content($region = NULL, $data = NULL) { - static $content = array(); - - if (isset($region) && isset($data)) { - $content[$region][] = $data; - } - return $content; -} - -/** - * Gets assigned content for a given region. - * - * @param $region - * A specified region to fetch content for. If NULL, all regions will be - * returned. - * @param $delimiter - * Content to be inserted between imploded array elements. - */ -function drupal_get_region_content($region = NULL, $delimiter = ' ') { - $content = drupal_add_region_content(); - if (isset($region)) { - if (isset($content[$region]) && is_array($content[$region])) { - return implode($delimiter, $content[$region]); - } - } - else { - foreach (array_keys($content) as $region) { - if (is_array($content[$region])) { - $content[$region] = implode($delimiter, $content[$region]); - } - } - return $content; - } -} - -/** * Gets the name of the currently active installation profile. * * When this function is called during Drupal's initial installation process, @@ -237,6 +194,9 @@ function drupal_get_profile() { * An array of all stored HEAD elements. * * @see \Drupal\Core\Render\Element\HtmlTag::preRenderHtmlTag() + * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0 + * Use #attached on render arrays. */ function drupal_add_html_head($data = NULL, $key = NULL) { $stored_head = &drupal_static(__FUNCTION__, array()); @@ -258,6 +218,9 @@ function drupal_add_html_head($data = NULL, $key = NULL) { * * @return string|array * Return the rendered HTML head or the elements itself. + * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0 + * Use #attached on render arrays. */ function drupal_get_html_head($render = TRUE) { $elements = drupal_add_html_head(); @@ -279,6 +242,9 @@ function drupal_get_html_head($render = TRUE) { * An internal system path or a fully qualified external URL of the feed. * @param $title * The title of the feed. + * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0 + * Use #attached on render arrays. */ function drupal_add_feed($url = NULL, $title = '') { $stored_feed_links = &drupal_static(__FUNCTION__, array()); @@ -291,6 +257,9 @@ function drupal_add_feed($url = NULL, $title = '') { /** * Gets the feed URLs for the current page. + * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0 + * Use #attached on render arrays. */ function drupal_get_feeds() { $feeds = drupal_add_feed(); @@ -908,6 +877,9 @@ function base_path() { * Associative array of element attributes including 'href' and 'rel'. * @param $header * Optional flag to determine if a HTTP 'Link:' header should be sent. + * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0 + * Use #attached on render arrays. */ function drupal_add_html_head_link($attributes, $header = FALSE) { $element = array( @@ -2057,6 +2029,9 @@ function drupal_process_states(&$elements) { * * @see \Drupal\Core\Asset\LibraryDiscovery * @see hook_library_info_alter() + * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0 + * Use #attached on render arrays. */ function _drupal_add_library($library_name, $every_page = NULL) { $added = &drupal_static(__FUNCTION__, array()); diff --git a/core/modules/system/src/Tests/Common/RegionContentTest.php b/core/modules/system/src/Tests/Common/RegionContentTest.php deleted file mode 100644 index 9b21924..0000000 --- a/core/modules/system/src/Tests/Common/RegionContentTest.php +++ /dev/null @@ -1,49 +0,0 @@ -getActiveTheme()->getName(); - - $block_regions = array_keys(system_region_list($theme_key)); - $delimiter = $this->randomMachineName(32); - $values = array(); - // Set some random content for each region available. - foreach ($block_regions as $region) { - $first_chunk = $this->randomMachineName(32); - drupal_add_region_content($region, $first_chunk); - $second_chunk = $this->randomMachineName(32); - drupal_add_region_content($region, $second_chunk); - // Store the expected result for a drupal_get_region_content call for this region. - $values[$region] = $first_chunk . $delimiter . $second_chunk; - } - - // Ensure drupal_get_region_content returns expected results when fetching all regions. - $content = drupal_get_region_content(NULL, $delimiter); - foreach ($content as $region => $region_content) { - $this->assertEqual($region_content, $values[$region], format_string('@region region text verified when fetching all regions', array('@region' => $region))); - } - - // Ensure drupal_get_region_content returns expected results when fetching a single region. - foreach ($block_regions as $region) { - $region_content = drupal_get_region_content($region, $delimiter); - $this->assertEqual($region_content, $values[$region], format_string('@region region text verified when fetching single region.', array('@region' => $region))); - } - } -}