diff options
| -rw-r--r-- | app/Controller/PageController.php | 7 | ||||
| -rw-r--r-- | app/Module/ClippingsCartModule.php | 15 | ||||
| -rw-r--r-- | app/Module/PageMenuModule.php | 1 | ||||
| -rw-r--r-- | app/Theme/AbstractTheme.php | 35 |
4 files changed, 21 insertions, 37 deletions
diff --git a/app/Controller/PageController.php b/app/Controller/PageController.php index 079b9501f3..ab67397dfb 100644 --- a/app/Controller/PageController.php +++ b/app/Controller/PageController.php @@ -163,13 +163,6 @@ class PageController extends BaseController { var WT_CSRF_TOKEN = "' . Filter::escapeJs(Filter::getCsrfToken()) . '"; ', self::JS_PRIORITY_HIGH); - // Temporary fix for access to main menu hover elements on android/blackberry touch devices - $this->addInlineJavascript(' - if(navigator.userAgent.match(/Android|PlayBook/i)) { - jQuery(".primary-menu > li > a").attr("href", "#"); - } - '); - Theme::theme()->sendHeaders(); echo Theme::theme()->doctype(); echo Theme::theme()->html(); diff --git a/app/Module/ClippingsCartModule.php b/app/Module/ClippingsCartModule.php index 0c24ff6306..f293900870 100644 --- a/app/Module/ClippingsCartModule.php +++ b/app/Module/ClippingsCartModule.php @@ -488,18 +488,19 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, public function getMenu() { global $controller, $WT_TREE; - //-- main clippings menu item - $menu = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings', array('rel' => 'nofollow')); + $submenus = array(); if (isset($controller->record)) { - $submenu = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippingscart', array('rel' => 'nofollow')); - $menu->addSubmenu($submenu); + $submenus[] = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippingscart', array('rel' => 'nofollow')); } if (!empty($controller->record) && $controller->record->canShow()) { - $submenu = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd', array('rel' => 'nofollow')); - $menu->addSubmenu($submenu); + $submenus[] = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippingsadd', array('rel' => 'nofollow')); } - return $menu; + if ($submenus) { + return new Menu($this->getTitle(), '#', 'menu-clippings', array('rel' => 'nofollow'), $submenus); + } else { + return new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings', array('rel' => 'nofollow')); + } } /** {@inheritdoc} */ diff --git a/app/Module/PageMenuModule.php b/app/Module/PageMenuModule.php index ce1a4addce..f2acca46c5 100644 --- a/app/Module/PageMenuModule.php +++ b/app/Module/PageMenuModule.php @@ -17,6 +17,7 @@ namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Menu; /** * Class PageMenuModule diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php index f020f31b9c..f47c6f352f 100644 --- a/app/Theme/AbstractTheme.php +++ b/app/Theme/AbstractTheme.php @@ -1004,7 +1004,7 @@ abstract class AbstractTheme { * @return Menu */ protected function menuCalendar() { - return new Menu(I18N::translate('Calendar'), 'calendar.php?' . $this->tree_url . '&view=day', 'menu-calendar', array('rel' => 'nofollow'), array( + return new Menu(I18N::translate('Calendar'), '#', 'menu-calendar', array('rel' => 'nofollow'), array( // Day view new Menu(I18N::translate('Day'), 'calendar.php?' . $this->tree_url . '&view=day', 'menu-calendar-day', array('rel' => 'nofollow')), // Month view @@ -1037,11 +1037,6 @@ abstract class AbstractTheme { * @return Menu */ protected function menuChart(Individual $individual) { - // The top level menu is the pedigree chart - $menu = $this->menuChartPedigree($individual); - $menu->setLabel(I18N::translate('Charts')); - $menu->setClass('menu-chart'); - $submenus = array_filter(array( $this->menuChartAncestors($individual), $this->menuChartCompact($individual), @@ -1062,9 +1057,7 @@ abstract class AbstractTheme { return I18N::strcasecmp($x->getLabel(), $y->getLabel()); }); - $menu->setSubmenus($submenus); - - return $menu; + return new Menu(I18N::translate('Charts'), '#', 'menu-chart', array('rel' => 'nofollow'), $submenus); } /** @@ -1314,7 +1307,7 @@ abstract class AbstractTheme { $submenus[] = new Menu($tree->getTitleHtml(), 'index.php?ctype=gedcom&ged=' . $tree->getNameUrl(), $active . 'menu-tree-' . $tree->getTreeId()); } - return new Menu(I18N::translate('Family trees'), 'index.php?ctype=gedcom&' . $this->tree_url, 'menu-tree', array(), $submenus); + return new Menu(I18N::translate('Family trees'), '#', 'menu-tree', array(), $submenus); } } @@ -1350,8 +1343,6 @@ abstract class AbstractTheme { * @return Menu */ protected function menuLists($surname) { - $menu = new Menu(I18N::translate('Lists'), 'indilist.php?' . $this->tree_url, 'menu-list'); - // Do not show empty lists $row = Database::prepare( "SELECT SQL_CACHE" . @@ -1366,32 +1357,30 @@ abstract class AbstractTheme { $this->tree->getTreeId(), ))->fetchOneRow(); - $menulist = array( + $submenus = array( $this->menuListsIndividuals($surname), $this->menuListsFamilies($surname), $this->menuListsBranches($surname), $this->menuListsPlaces(), ); if ($row->obje) { - $menulist[] = $this->menuListsMedia(); + $submenus[] = $this->menuListsMedia(); } if ($row->repo) { - $menulist[] = $this->menuListsRepositories(); + $submenus[] = $this->menuListsRepositories(); } if ($row->sour) { - $menulist[] = $this->menuListsSources(); + $submenus[] = $this->menuListsSources(); } if ($row->note) { - $menulist[] = $this->menuListsNotes(); + $submenus[] = $this->menuListsNotes(); } - uasort($menulist, function (Menu $x, Menu $y) { + uasort($submenus, function (Menu $x, Menu $y) { return I18N::strcasecmp($x->getLabel(), $y->getLabel()); }); - $menu->setSubmenus($menulist); - - return $menu; + return new Menu(I18N::translate('Lists'), '#', 'menu-list', array(), $submenus); } /** @@ -1618,7 +1607,7 @@ abstract class AbstractTheme { } if ($submenus) { - return new Menu(I18N::translate('Reports'), 'reportengine.php?' . $this->tree_url, 'menu-report', array('rel' => 'nofollow'), $submenus); + return new Menu(I18N::translate('Reports'), '#', 'menu-report', array('rel' => 'nofollow'), $submenus); } else { return null; } @@ -1631,7 +1620,7 @@ abstract class AbstractTheme { */ protected function menuSearch() { //-- main search menu item - $menu = new Menu(I18N::translate('Search'), 'search.php?' . $this->tree_url, 'menu-search', array('rel' => 'nofollow')); + $menu = new Menu(I18N::translate('Search'), '#', 'menu-search', array('rel' => 'nofollow')); //-- search_general sub menu $menu->addSubmenu(new Menu(I18N::translate('General search'), 'search.php?' . $this->tree_url, 'menu-search-general', array('rel' => 'nofollow'))); //-- search_soundex sub menu |
