summaryrefslogtreecommitdiff
path: root/themes/_custom/theme.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-07-14 16:55:24 +0100
committerGreg Roach <fisharebest@gmail.com>2015-07-14 18:01:09 +0100
commit8c324fa66ae84247c8c5d88c2bb88cb42819e89a (patch)
tree1f263b0c5da192e53f6b2c69257769bbd247af33 /themes/_custom/theme.php
parent5f1548de4590fdad3d95e60d0b7325d861f18022 (diff)
downloadwebtrees-8c324fa66ae84247c8c5d88c2bb88cb42819e89a.tar.gz
webtrees-8c324fa66ae84247c8c5d88c2bb88cb42819e89a.tar.bz2
webtrees-8c324fa66ae84247c8c5d88c2bb88cb42819e89a.zip
Simplify theme examples. We can't catch fatal errors until PHP7
Diffstat (limited to 'themes/_custom/theme.php')
-rw-r--r--themes/_custom/theme.php33
1 files changed, 11 insertions, 22 deletions
diff --git a/themes/_custom/theme.php b/themes/_custom/theme.php
index 6e2d9e0410..aa6f289576 100644
--- a/themes/_custom/theme.php
+++ b/themes/_custom/theme.php
@@ -61,14 +61,9 @@ class MyTheme extends WebtreesTheme {
* {@inheritdoc}
*/
public function stylesheets() {
- try {
- $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) {
- // Something went wrong with our script? Use the default behaviour instead.
- return parent::stylesheets();
- }
+ $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-v1.0.css';
return $css_files;
}
@@ -81,20 +76,14 @@ class MyTheme extends WebtreesTheme {
* {@inheritdoc}
*/
public function menuLists($surname) {
- try {
- // Start with the default "Lists" menu.
- $menu = parent::menuLists($surname);
- // Remove the "notes" sub-menu.
- $submenus = array_filter($menu->getSubmenus(), function (Menu $menu) {
- return $menu->getClass() !== 'menu-list-note';
- });
- // Replace the sub-menus
- $menu->setSubmenus($submenus);
- } 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($surname);
- }
+ // Start with the default "Lists" menu.
+ $menu = parent::menuLists($surname);
+ // Remove the "notes" sub-menu.
+ $submenus = array_filter($menu->getSubmenus(), function (Menu $menu) {
+ return $menu->getClass() !== 'menu-list-note';
+ });
+ // Replace the sub-menus
+ $menu->setSubmenus($submenus);
return $menu;
}