summaryrefslogtreecommitdiff
path: root/app/Theme/FabTheme.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Theme/FabTheme.php')
-rw-r--r--app/Theme/FabTheme.php190
1 files changed, 99 insertions, 91 deletions
diff --git a/app/Theme/FabTheme.php b/app/Theme/FabTheme.php
index bafcd67919..01911df785 100644
--- a/app/Theme/FabTheme.php
+++ b/app/Theme/FabTheme.php
@@ -21,102 +21,110 @@ use Fisharebest\Webtrees\Menu;
/**
* The F.A.B. theme.
*/
-class FabTheme extends AbstractTheme implements ThemeInterface {
- /**
- * Where are our CSS, JS and other assets?
- */
- const THEME_DIR = 'fab';
- const ASSET_DIR = 'themes/' . self::THEME_DIR . '/css-2.0.0/';
- const STYLESHEET = self::ASSET_DIR . 'style.css';
+class FabTheme extends AbstractTheme implements ThemeInterface
+{
+ /**
+ * Where are our CSS, JS and other assets?
+ */
+ const THEME_DIR = 'fab';
+ const ASSET_DIR = 'themes/' . self::THEME_DIR . '/css-2.0.0/';
+ const STYLESHEET = self::ASSET_DIR . 'style.css';
- /**
- * Add markup to the secondary menu.
- *
- * @return string
- */
- public function formatSecondaryMenu() {
- return
- '<ul class="nav wt-secondary-menu justify-content-end">' .
- implode('', array_map(function (Menu $menu) {
- return $menu->bootstrap4();
- }, $this->secondaryMenu())) .
- '<li>' .
- $this->formQuickSearch() .
- '</li>' .
- '</ul>';
- }
+ /**
+ * Add markup to the secondary menu.
+ *
+ * @return string
+ */
+ public function formatSecondaryMenu()
+ {
+ return
+ '<ul class="nav wt-secondary-menu justify-content-end">' .
+ implode('', array_map(function (Menu $menu) {
+ return $menu->bootstrap4();
+ }, $this->secondaryMenu())) .
+ '<li>' .
+ $this->formQuickSearch() .
+ '</li>' .
+ '</ul>';
+ }
- /**
- * Create a search field and submit button for the quick search form in the header.
- *
- * @return string
- */
- public function formQuickSearchFields() {
- return
- '<input type="search" name="query" size="20" placeholder="' . I18N::translate('Search') . '">';
- }
+ /**
+ * Create a search field and submit button for the quick search form in the header.
+ *
+ * @return string
+ */
+ public function formQuickSearchFields()
+ {
+ return
+ '<input type="search" name="query" size="20" placeholder="' . I18N::translate('Search') . '">';
+ }
- /**
- * Allow themes to add extra scripts to the page footer.
- *
- * @return string
- */
- public function hookFooterExtraJavascript() {
- return
- '<script>' .
- 'activate_colorbox();' .
- 'jQuery.extend(jQuery.colorbox.settings, {' .
- ' width: "85%",' .
- ' height: "85%",' .
- ' transition: "none",' .
- ' slideshowStart: "' . I18N::translate('Play') . '",' .
- ' slideshowStop: "' . I18N::translate('Stop') . '",' .
- ' title: function() { return this.dataset.title; }' .
- '});' .
- '</script>';
- }
+ /**
+ * Allow themes to add extra scripts to the page footer.
+ *
+ * @return string
+ */
+ public function hookFooterExtraJavascript()
+ {
+ return
+ '<script>' .
+ 'activate_colorbox();' .
+ 'jQuery.extend(jQuery.colorbox.settings, {' .
+ ' width: "85%",' .
+ ' height: "85%",' .
+ ' transition: "none",' .
+ ' slideshowStart: "' . I18N::translate('Play') . '",' .
+ ' slideshowStop: "' . I18N::translate('Stop') . '",' .
+ ' title: function() { return this.dataset.title; }' .
+ '});' .
+ '</script>';
+ }
- /**
- * Misecellaneous dimensions, fonts, styles, etc.
- *
- * @param string $parameter_name
- *
- * @return string|int|float
- */
- public function parameter($parameter_name) {
- $parameters = [
- 'chart-background-f' => 'e9daf1',
- 'chart-background-m' => 'b1cff0',
- 'chart-box-x' => 260,
- 'chart-box-y' => 85,
- 'distribution-chart-high-values' => '9ca3d4',
- 'distribution-chart-low-values' => 'e5e6ef',
- ];
+ /**
+ * Misecellaneous dimensions, fonts, styles, etc.
+ *
+ * @param string $parameter_name
+ *
+ * @return string|int|float
+ */
+ public function parameter($parameter_name)
+ {
+ $parameters = [
+ 'chart-background-f' => 'e9daf1',
+ 'chart-background-m' => 'b1cff0',
+ 'chart-box-x' => 260,
+ 'chart-box-y' => 85,
+ 'distribution-chart-high-values' => '9ca3d4',
+ 'distribution-chart-low-values' => 'e5e6ef',
+ ];
- if (array_key_exists($parameter_name, $parameters)) {
- return $parameters[$parameter_name];
- } else {
- return parent::parameter($parameter_name);
- }
- }
+ if (array_key_exists($parameter_name, $parameters)) {
+ return $parameters[$parameter_name];
+ } else {
+ return parent::parameter($parameter_name);
+ }
+ }
- /**
- * A list of CSS files to include for this page.
- *
- * @return string[]
- */
- public function stylesheets() {
- return array_merge(parent::stylesheets(), [
- self::STYLESHEET,
- ]);
- }
+ /**
+ * A list of CSS files to include for this page.
+ *
+ * @return string[]
+ */
+ public function stylesheets()
+ {
+ return array_merge(parent::stylesheets(), [
+ self::STYLESHEET,
+ ]);
+ }
- /**
- * What is this theme called?
- *
- * @return string
- */
- public function themeName() {
- return /* I18N: Name of a theme. */ I18N::translate('F.A.B.');
- }
+ /**
+ * What is this theme called?
+ *
+ * @return string
+ */
+ public function themeName()
+ {
+ return /* I18N: Name of a theme. */
+ I18N::translate('F.A.B.');
+ }
}