summaryrefslogtreecommitdiff
path: root/themes/_custom/theme.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-02-01 00:01:36 +0000
committerGreg Roach <fisharebest@gmail.com>2015-02-02 17:34:31 +0000
commita25f0a04682c4c39c1947220c90af4118c713952 (patch)
treef7e9c2c630a50dd3e5dd76ce501dff4b1d8d4c26 /themes/_custom/theme.php
parent4d2a5476ceb1c11dc1fd146bfb0be077baa5fb01 (diff)
downloadwebtrees-a25f0a04682c4c39c1947220c90af4118c713952.tar.gz
webtrees-a25f0a04682c4c39c1947220c90af4118c713952.tar.bz2
webtrees-a25f0a04682c4c39c1947220c90af4118c713952.zip
Refactor classes to use namespaces, as per PSR-4. Replace GPL2 with GPL3.
Diffstat (limited to 'themes/_custom/theme.php')
-rw-r--r--themes/_custom/theme.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/themes/_custom/theme.php b/themes/_custom/theme.php
index 74f54eaea7..b3698ce8b9 100644
--- a/themes/_custom/theme.php
+++ b/themes/_custom/theme.php
@@ -1,5 +1,7 @@
<?php
-// webtrees: Web based Family History software
+namespace Webtrees;
+
+// webtrees: online genealogy
// Copyright (C) 2015 webtrees development team.
//
// This program is free software; you can redistribute it and/or modify
@@ -29,12 +31,8 @@
*
* Only the first two functions are required: themeId() and themeName().
* The rest are just examples, and should be removed in actual themes.
- *
- * Many of the core classes are being moved to namespaces. For example,
- * WT_Foo will be renamed to WT\Foo. The object API should remain the
- * same. Avoid unecessary type-hints to allow your
*/
-class CustomTheme extends WT\Theme\Webtrees {
+class CustomTheme extends WebtreesTheme {
/**
* Give your theme a unique identifier. Themes beginning with an underscore
* are reserved for internal use.
@@ -68,7 +66,7 @@ class CustomTheme extends WT\Theme\Webtrees {
$css_files = parent::stylesheets();
// Put a version number in the URL, to prevent browsers from caching old versions.
$css_files[] = WT_BASE_URL . 'themes/custom/custom.css';
- } catch (Exception $ex) {
+ } catch (\Exception $ex) {
// Something went wrong with our script? Use the default behaviour instead.
return parent::stylesheets();
}
@@ -86,12 +84,12 @@ class CustomTheme extends WT\Theme\Webtrees {
// Start with the default "Lists" menu.
$menu = parent::menuLists();
// Remove the "notes" sub-menu.
- $submenus = array_filter($menu->getSubmenus(), function(WT_Menu $menu) {
+ $submenus = array_filter($menu->getSubmenus(), function(Menu $menu) {
return $menu->getId() !== 'menu-list-note';
});
// Replace the sub-menus
$menu->setSubmenus($submenus);
- } catch (Exception $ex) {
+ } catch (\Exception $ex) {
// Something went wrong with our script? Maybe the core code was updated?
// Use the default behaviour instead, so that our theme continues to work.
return parent::menuLists();