summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-04-11 06:30:05 (GMT)
committerAlex Pott2013-04-11 06:30:05 (GMT)
commitb4cc0cc5bda60050e6bf191ae426a514239b724f (patch)
treeac4ea1a59691f8b0dde8befdfe11e8aab1ba8a42
parente45b1a76f091df52d5196c99a7558fab7d537233 (diff)
Issue #1033116 by eojthebrave, c4rl, brianV, tim.plunkett | webchick: Rename template.php to THEMENAME.theme to elimnate ambiguity around 'the template file' vs. 'template files'.
-rw-r--r--core/modules/php/php.module2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php2
-rw-r--r--core/modules/system/system.module20
-rw-r--r--core/modules/system/tests/themes/test_theme/test_theme.theme (renamed from core/modules/system/tests/themes/test_theme/template.php)0
-rw-r--r--core/themes/bartik/bartik.theme (renamed from core/themes/bartik/template.php)0
-rw-r--r--core/themes/engines/phptemplate/phptemplate.engine2
-rw-r--r--core/themes/engines/twig/twig.engine2
-rw-r--r--core/themes/seven/seven.theme (renamed from core/themes/seven/template.php)0
8 files changed, 10 insertions, 18 deletions
diff --git a/core/modules/php/php.module b/core/modules/php/php.module
index 83f0b66..e31b4c5 100644
--- a/core/modules/php/php.module
+++ b/core/modules/php/php.module
@@ -105,7 +105,7 @@ function _php_filter_tips($filter, $format, $long = FALSE) {
$output .= '<li>' . t('<code>register_globals</code> is <strong>turned off</strong>. If you need to use forms, understand and use the functions in <a href="@formapi">the Drupal Form API</a>.', array('@formapi' => url('http://api.drupal.org/api/group/form_api/8'))) . '</li>';
$output .= '<li>' . t('Use a <code>print</code> or <code>return</code> statement in your code to output content.') . '</li>';
$output .= '<li>' . t('Develop and test your PHP code using a separate test script and sample database before deploying on a production site.') . '</li>';
- $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or <code>template.php</code> file rather than embedding it directly into a post or block.') . '</li>';
+ $output .= '<li>' . t('Consider including your custom PHP code within a site-specific module or theme rather than embedding it directly into a post or block.') . '</li>';
$output .= '<li>' . t('Be aware that the ability to embed PHP code within content is provided by the PHP Filter module. If this module is disabled or deleted, then blocks and posts with embedded PHP may display, rather than execute, the PHP code.') . '</li></ul>';
$output .= '<p>' . t('A basic example: <em>Creating a "Welcome" block that greets visitors with a simple message.</em>') . '</p>';
$output .= '<ul><li>' . t('<p>Add a custom block to your site, named "Welcome" . With its text format set to "PHP code" (or another format supporting PHP input), add the following in the Block body:</p>
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index c5bfd17..07c38ae 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -197,7 +197,7 @@ class BreadcrumbTest extends MenuTestBase {
// Do this separately for Main menu and Tools menu, since only the
// latter is a preferred menu by default.
// @todo Also test all themes? Manually testing led to the suspicion that
- // breadcrumbs may differ, possibly due to template.php overrides.
+ // breadcrumbs may differ, possibly due to theme overrides.
$menus = array('main', 'tools');
// Alter node type menu settings.
variable_set("menu_options_$type", $menus);
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 70b8dab..b3f9bc1 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -3053,20 +3053,12 @@ function _system_rebuild_theme_data() {
if (!empty($themes[$key]->info['base theme'])) {
$sub_themes[] = $key;
}
- if ($themes[$key]->info['engine'] == 'theme') {
- $filename = dirname($themes[$key]->uri) . '/' . $themes[$key]->name . '.theme';
- if (file_exists($filename)) {
- $themes[$key]->owner = $filename;
- $themes[$key]->prefix = $key;
- }
- }
- else {
- $engine = $themes[$key]->info['engine'];
- if (isset($engines[$engine])) {
- $themes[$key]->owner = $engines[$engine]->uri;
- $themes[$key]->prefix = $engines[$engine]->name;
- $themes[$key]->template = TRUE;
- }
+
+ $engine = $themes[$key]->info['engine'];
+ if (isset($engines[$engine])) {
+ $themes[$key]->owner = $engines[$engine]->uri;
+ $themes[$key]->prefix = $engines[$engine]->name;
+ $themes[$key]->template = TRUE;
}
// Prefix stylesheets and scripts with module path.
diff --git a/core/modules/system/tests/themes/test_theme/template.php b/core/modules/system/tests/themes/test_theme/test_theme.theme
index 8275818..8275818 100644
--- a/core/modules/system/tests/themes/test_theme/template.php
+++ b/core/modules/system/tests/themes/test_theme/test_theme.theme
diff --git a/core/themes/bartik/template.php b/core/themes/bartik/bartik.theme
index 9a6c8a9..9a6c8a9 100644
--- a/core/themes/bartik/template.php
+++ b/core/themes/bartik/bartik.theme
diff --git a/core/themes/engines/phptemplate/phptemplate.engine b/core/themes/engines/phptemplate/phptemplate.engine
index d293b85..88c09c7 100644
--- a/core/themes/engines/phptemplate/phptemplate.engine
+++ b/core/themes/engines/phptemplate/phptemplate.engine
@@ -9,7 +9,7 @@
* Implements hook_init().
*/
function phptemplate_init($template) {
- $file = dirname($template->filename) . '/template.php';
+ $file = dirname($template->filename) . '/' . $template->name . '.theme';
if (file_exists($file)) {
include_once DRUPAL_ROOT . '/' . $file;
}
diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine
index 887aca1..6166da9 100644
--- a/core/themes/engines/twig/twig.engine
+++ b/core/themes/engines/twig/twig.engine
@@ -24,7 +24,7 @@ function twig_extension() {
* Implements hook_init().
*/
function twig_init($template) {
- $file = dirname($template->filename) . '/template.php';
+ $file = dirname($template->filename) . '/' . $template->name . '.theme';
if (file_exists($file)) {
include_once DRUPAL_ROOT . '/' . $file;
}
diff --git a/core/themes/seven/template.php b/core/themes/seven/seven.theme
index fa7124c..fa7124c 100644
--- a/core/themes/seven/template.php
+++ b/core/themes/seven/seven.theme