Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -0,0 +1,52 @@
<?php
/**
* @file
* Handles integration of Nyan cat templates because we love kittens.
*/
use Drupal\Core\Extension\Extension;
/**
* Implements hook_init().
*/
function nyan_cat_init(Extension $theme) {
$theme->load();
}
/**
* Implements hook_theme().
*/
function nyan_cat_theme($existing, $type, $theme, $path) {
$templates = drupal_find_theme_functions($existing, array($theme));
$templates += drupal_find_theme_templates($existing, '.nyan-cat.html', $path);
return $templates;
}
/**
* Implements hook_extension().
*/
function nyan_cat_extension() {
return '.nyan-cat.html';
}
/**
* Implements hook_render_template().
*
* @param string $template_file
* The filename of the template to render.
* @param mixed[] $variables
* A keyed array of variables that will appear in the output.
*
* @return string
* The output generated by the template.
*/
function nyan_cat_render_template($template_file, $variables) {
$output = str_replace('div', 'nyancat', file_get_contents(\Drupal::root() . '/' . $template_file));
foreach ($variables as $key => $variable) {
if (strpos($output, '9' . $key) !== FALSE) {
$output = str_replace('9' . $key, theme_render_and_autoescape($variable), $output);
}
}
return $output;
}

View file

@ -0,0 +1,5 @@
type: theme_engine
name: Nyan cat
core: 8.x
version: VERSION
package: Core

View file

@ -8,8 +8,6 @@ langcode: en
locked: false
pattern: 'U'
dependencies:
theme:
- test_basetheme
enforced:
theme:
- test_basetheme

View file

@ -3,7 +3,20 @@ type: theme
description: 'Test theme which acts as a base theme for other test subthemes.'
version: VERSION
core: 8.x
base theme: false
libraries:
- test_basetheme/global-styling
stylesheets-remove:
- '@theme_test/css/base-remove.css'
libraries-override:
core/drupal.dialog:
js:
misc/dialog/dialog.js: false
core/jquery.farbtastic:
css:
component:
assets/vendor/farbtastic/farbtastic.css: css/farbtastic.css
libraries-extend:
classy/base:
- test_basetheme/global-styling

View file

@ -5,3 +5,4 @@ global-styling:
base-add.css: {}
base-add.sub-remove.css: {}
samename.css: {}
css/base-libraries-extend.css: {}

View file

@ -28,3 +28,9 @@ function test_basetheme_views_post_render(ViewExecutable $view, &$output, CacheP
*/
function test_basetheme_preprocess_theme_test_template_test(&$variables) {
}
/**
* Implements hook_preprocess_HOOK() for theme_test_function_suggestions theme functions.
*/
function test_basetheme_preprocess_theme_test_function_suggestions(&$variables) {
}

View file

@ -4,3 +4,4 @@ description: 'Test theme which has a non-existent theme engine.'
version: VERSION
core: 8.x
engine: not_real_engine
base theme: false

View file

@ -0,0 +1,5 @@
name: Test Stable
type: theme
description: A theme to test that stable is set as the default.
version: VERSION
core: 8.x

View file

@ -9,3 +9,7 @@ libraries:
stylesheets-remove:
- '@theme_test/css/sub-remove.css'
- '@test_basetheme/base-add.sub-remove.css'
libraries-extend:
classy/base:
- test_subtheme/global-styling

View file

@ -4,3 +4,4 @@ global-styling:
base:
css/sub-add.css: {}
css/samename.css: {}
css/sub-libraries-extend.css: {}

View file

@ -0,0 +1,4 @@
/**
* @file
* Test CSS asset file for test_theme.theme.
*/

View file

@ -0,0 +1,4 @@
/**
* @file
* Test JS asset file for test_theme.theme.
*/

View file

@ -8,7 +8,7 @@
# here in order for a test to ensure that this correctly prevents the module
# version from being loaded, and that errors aren't caused by the lack of this
# file within the theme folder.
name: 'Test theme'
name: '<strong>Test theme</strong>'
type: theme
description: 'Theme for testing the theme system'
version: VERSION
@ -18,6 +18,49 @@ stylesheets-remove:
- '@system/css/system.module.css'
libraries:
- test_theme/global-styling
libraries-override:
# Replace an entire library.
core/drupal.collapse: test_theme/collapse
# Remove an entire library.
core/drupal.progress: false
# Replace particular library assets.
classy/base:
css:
component:
css/components/button.css: css/my-button.css
css/components/collapse-processed.css: css/my-collapse-processed.css
css/components/container-inline.css: /themes/my_theme/css/my-container-inline.css
css/components/details.css: /themes/my_theme/css/my-details.css
# Remove particular library assets.
classy/dialog:
css:
component:
css/components/dialog.css: false
# It works for JS as well.
core/jquery:
js:
assets/vendor/jquery/jquery.min.js: js/collapse.js
# Use Drupal-relative paths.
core/drupal.dropbutton:
css:
component:
misc/dropbutton/dropbutton.css: /themes/my_theme/css/dropbutton.css
# Use stream wrappers.
core/drupal.vertical-tabs:
css:
component:
misc/vertical-tabs.css: public://my_css/vertical-tabs.css
# Use a protocol-relative URI.
core/jquery.ui:
css:
component:
assets/vendor/jquery.ui/themes/base/core.css: //my-server/my_theme/css/jquery_ui.css
# Use an absolute URI.
core/jquery.farbtastic:
css:
component:
assets/vendor/farbtastic/farbtastic.css: http://example.com/my_theme/css/farbtastic.css
regions:
content: Content
left: Left

View file

@ -3,3 +3,11 @@ global-styling:
css:
base:
kitten.css: {}
collapse:
version: VERSION
js:
js/collapse.js: { }
css:
base:
css/collapse.css: { }

View file

@ -0,0 +1,15 @@
name: 'Test theme libraries-extend'
type: theme
description: 'Test Theme with libraries-extend'
version: VERSION
base theme: classy
core: 8.x
libraries-extend:
classy/book-navigation:
- test_theme_libraries_extend/extend_one
- test_theme_libraries_extend/extend_two
core/drupal.dialog:
- test_theme_libraries_extend/non_existent_library
test_theme/collapse:
- not_a_string:
expected: 'an exception'

View file

@ -0,0 +1,11 @@
extend_one:
css:
theme:
css/extend_1.css: { }
js:
js/extend_1.js: { }
extend_two:
css:
theme:
css/extend_2.css: { }

View file

@ -0,0 +1,12 @@
name: 'Test theme libraries-override'
type: theme
description: 'Theme with drupalSettings libraries-override'
version: VERSION
base theme: classy
core: 8.x
libraries-override:
# drupalSettings libraries override. Should throw a
# \Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException.
core/drupal.ajax:
drupalSettings:
ajaxPageState: { }

View file

@ -0,0 +1,11 @@
name: 'Test theme libraries-override'
type: theme
description: 'Theme with invalid libraries-override asset spec.'
version: VERSION
base theme: classy
core: 8.x
libraries-override:
# A malformed library asset name. Should throw a
# \Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecificationException.
core/drupal.dialog:
css: false

View file

@ -0,0 +1,7 @@
name: 'Test theme for Nyan Cat engine'
type: theme
description: 'Theme for testing the theme system with the Nyan Cat theme engine'
version: VERSION
core: 8.x
engine: nyan_cat
base theme: false

View file

@ -0,0 +1,8 @@
<?php
/**
* Implements hook_preprocess_theme_test_template_test().
*/
function test_theme_nyan_cat_engine_preprocess_theme_test_template_test(&$variables) {
$variables['kittens'] = 'All of them';
}

View file

@ -0,0 +1 @@
Success: Template overridden with Nyan Cat theme. 9kittens

View file

@ -1,4 +0,0 @@
<?php
// node--1.tpl.php - Dummy file for finding the template
?>
Node Content Dummy

View file

@ -1,6 +0,0 @@
name: 'Test theme PHPTemplate'
type: theme
description: 'Theme for testing the theme system with the PHPTemplate engine'
version: VERSION
core: 8.x
engine: phptemplate

View file

@ -1,2 +0,0 @@
<!-- Output for Theme API test -->
<?php print 'Success: Template overridden with PHPTemplate theme.'; ?>

View file

@ -0,0 +1,6 @@
name: Test Wild West
type: theme
description: A theme that doesn't use Stable as its base. It tests the wild west instead.
version: VERSION
base theme: false
core: 8.x