diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-06-17 23:06:24 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-06-17 23:06:24 +0100 |
| commit | 0ee1319888cc0d02945fb962bd91ef97591f55e4 (patch) | |
| tree | 668476652476a3e78799458dd285a109b2ef0cd5 | |
| parent | f5b8f12352d4ad8c8d17b426d08d98b849c35ebd (diff) | |
| download | webtrees-0ee1319888cc0d02945fb962bd91ef97591f55e4.tar.gz webtrees-0ee1319888cc0d02945fb962bd91ef97591f55e4.tar.bz2 webtrees-0ee1319888cc0d02945fb962bd91ef97591f55e4.zip | |
Use rel=nofollow instead of hiding links
23 files changed, 304 insertions, 180 deletions
diff --git a/app/Module/AhnentafelReportModule.php b/app/Module/AhnentafelReportModule.php index 37fbfa1480..51e67fa438 100644 --- a/app/Module/AhnentafelReportModule.php +++ b/app/Module/AhnentafelReportModule.php @@ -55,21 +55,18 @@ class AhnentafelReportModule extends AbstractModule implements ModuleReportInter } /** - * Return a list of (usually just one) menu items. + * Return a menu item for this report. * - * @return Menu[] + * @return Menu */ - public function getReportMenus() { + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/BirthDeathMarriageReportModule.php b/app/Module/BirthDeathMarriageReportModule.php index 8633cf3605..14ff5e21dd 100644 --- a/app/Module/BirthDeathMarriageReportModule.php +++ b/app/Module/BirthDeathMarriageReportModule.php @@ -55,21 +55,18 @@ class BirthDeathMarriageReportModule extends AbstractModule implements ModuleRep } /** - * Return a list of (usually just one) menu items. + * Return a menu item for this report. * - * @return Menu[] + * @return Menu */ - public function getReportMenus() { + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/BirthReportModule.php b/app/Module/BirthReportModule.php index a895ecf985..9c80004b72 100644 --- a/app/Module/BirthReportModule.php +++ b/app/Module/BirthReportModule.php @@ -35,23 +35,30 @@ class BirthReportModule extends AbstractModule implements ModuleReportInterface return /* I18N: Description of the “Births” module */ I18N::translate('A report of individuals who were born in a given time or place.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/CemeteryReportModule.php b/app/Module/CemeteryReportModule.php index 3216b8a323..3729fcd08d 100644 --- a/app/Module/CemeteryReportModule.php +++ b/app/Module/CemeteryReportModule.php @@ -35,23 +35,30 @@ class CemeteryReportModule extends AbstractModule implements ModuleReportInterfa return /* I18N: Description of the “Cemeteries” module */ I18N::translate('A report of individuals who were buried in a given place.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/ChangeReportModule.php b/app/Module/ChangeReportModule.php index 5d608ee1a5..6d85929f7d 100644 --- a/app/Module/ChangeReportModule.php +++ b/app/Module/ChangeReportModule.php @@ -35,23 +35,30 @@ class ChangeReportModule extends AbstractModule implements ModuleReportInterface return /* I18N: Description of the “Changes” module */ I18N::translate('A report of recent and pending changes.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_USER; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/ClippingsCartModule.php b/app/Module/ClippingsCartModule.php index f561a85b83..ea72313949 100644 --- a/app/Module/ClippingsCartModule.php +++ b/app/Module/ClippingsCartModule.php @@ -41,7 +41,13 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, return /* I18N: Description of the “Clippings cart” module */ I18N::translate('Select records from your family tree and save them as a GEDCOM file.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_USER; } @@ -465,12 +471,20 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, } } - /** {@inheritdoc} */ + /** + * The user can re-order menus. Until they do, they are shown in this order. + * + * @return int + */ public function defaultMenuOrder() { return 20; } - /** {@inheritdoc} */ + /** + * A menu, to be added to the main application menu. + * + * @return Menu|null + */ public function getMenu() { global $controller, $WT_TREE; @@ -725,5 +739,4 @@ class ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, return $out; } - } diff --git a/app/Module/DeathReportModule.php b/app/Module/DeathReportModule.php index b8862fb10b..51f6536d6f 100644 --- a/app/Module/DeathReportModule.php +++ b/app/Module/DeathReportModule.php @@ -35,23 +35,30 @@ class DeathReportModule extends AbstractModule implements ModuleReportInterface return /* I18N: Description of the “Deaths” module */ I18N::translate('A report of individuals who died in a given time or place.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/DescendancyReportModule.php b/app/Module/DescendancyReportModule.php index ced9b944b6..ed3c5fa794 100644 --- a/app/Module/DescendancyReportModule.php +++ b/app/Module/DescendancyReportModule.php @@ -35,23 +35,30 @@ class DescendancyReportModule extends AbstractModule implements ModuleReportInte return /* I18N: Description of the “Descendants” module */ I18N::translate('A report of an individual’s descendants, in a narrative style.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/FactSourcesReportModule.php b/app/Module/FactSourcesReportModule.php index b1097a0279..b5cb98857e 100644 --- a/app/Module/FactSourcesReportModule.php +++ b/app/Module/FactSourcesReportModule.php @@ -35,23 +35,30 @@ class FactSourcesReportModule extends AbstractModule implements ModuleReportInte return /* I18N: Description of the “Source” module */ I18N::translate('A report of the information provided by a source.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_USER; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/FamilyGroupReportModule.php b/app/Module/FamilyGroupReportModule.php index 42a9c7fcd9..b9cbcf4c13 100644 --- a/app/Module/FamilyGroupReportModule.php +++ b/app/Module/FamilyGroupReportModule.php @@ -35,23 +35,30 @@ class FamilyGroupReportModule extends AbstractModule implements ModuleReportInte return /* I18N: Description of the “Family” module */ I18N::translate('A report of family members and their details.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&famid=' . $controller->getSignificantFamily()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/FrequentlyAskedQuestionsModule.php b/app/Module/FrequentlyAskedQuestionsModule.php index f2f2e9f871..db2d175f81 100644 --- a/app/Module/FrequentlyAskedQuestionsModule.php +++ b/app/Module/FrequentlyAskedQuestionsModule.php @@ -486,12 +486,20 @@ class FrequentlyAskedQuestionsModule extends AbstractModule implements ModuleMen } } - /** {@inheritdoc} */ + /** + * The user can re-order menus. Until they do, they are shown in this order. + * + * @return int + */ public function defaultMenuOrder() { return 40; } - /** {@inheritdoc} */ + /** + * A menu, to be added to the main application menu. + * + * @return Menu|null + */ public function getMenu() { global $WT_TREE; diff --git a/app/Module/IndividualFamiliesReportModule.php b/app/Module/IndividualFamiliesReportModule.php index 2813d5c7b5..b693305f9f 100644 --- a/app/Module/IndividualFamiliesReportModule.php +++ b/app/Module/IndividualFamiliesReportModule.php @@ -35,23 +35,30 @@ class IndividualFamiliesReportModule extends AbstractModule implements ModuleRep return /* I18N: Description of the “Related families” */ I18N::translate('A report of the families that are closely related to an individual.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_USER; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/IndividualReportModule.php b/app/Module/IndividualReportModule.php index 220feaf264..8484c11f38 100644 --- a/app/Module/IndividualReportModule.php +++ b/app/Module/IndividualReportModule.php @@ -35,23 +35,30 @@ class IndividualReportModule extends AbstractModule implements ModuleReportInter return /* I18N: Description of the “Individual” module */ I18N::translate('A report of an individual’s details.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/MarriageReportModule.php b/app/Module/MarriageReportModule.php index cd5788d1ba..3cd0bad430 100644 --- a/app/Module/MarriageReportModule.php +++ b/app/Module/MarriageReportModule.php @@ -35,23 +35,30 @@ class MarriageReportModule extends AbstractModule implements ModuleReportInterfa return /* I18N: Description of the “Marriages” module */ I18N::translate('A report of individuals who were married in a given time or place.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/MissingFactsReportModule.php b/app/Module/MissingFactsReportModule.php index 63cad3caa1..09dbde4db8 100644 --- a/app/Module/MissingFactsReportModule.php +++ b/app/Module/MissingFactsReportModule.php @@ -35,23 +35,30 @@ class MissingFactsReportModule extends AbstractModule implements ModuleReportInt return /* I18N: Description of the “Missing data” */ I18N::translate('A report of the information that is missing for an individual and their relatives.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_USER; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/ModuleReportInterface.php b/app/Module/ModuleReportInterface.php index 96a1070384..264c3090a5 100644 --- a/app/Module/ModuleReportInterface.php +++ b/app/Module/ModuleReportInterface.php @@ -22,9 +22,9 @@ use Fisharebest\Webtrees\Menu; */ interface ModuleReportInterface { /** - * Return a list of (usually just one) menu items. + * Return a menu item for this report. * - * @return Menu[] + * @return Menu */ - public function getReportMenus(); + public function getReportMenu(); } diff --git a/app/Module/OccupationReportModule.php b/app/Module/OccupationReportModule.php index cf3579d06e..6881e94335 100644 --- a/app/Module/OccupationReportModule.php +++ b/app/Module/OccupationReportModule.php @@ -35,23 +35,30 @@ class OccupationReportModule extends AbstractModule implements ModuleReportInter return /* I18N: Description of the “Occupations” module */ I18N::translate('A report of individuals who had a given occupation.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_USER; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/PageMenuModule.php b/app/Module/PageMenuModule.php index 3a2e6044d5..ce1a4addce 100644 --- a/app/Module/PageMenuModule.php +++ b/app/Module/PageMenuModule.php @@ -32,12 +32,20 @@ class PageMenuModule extends AbstractModule implements ModuleMenuInterface { return /* I18N: Description of the “Edit” module */ I18N::translate('An edit menu for individuals, families, sources, etc.'); } - /** {@inheritdoc} */ + /** + * The user can re-order menus. Until they do, they are shown in this order. + * + * @return int + */ public function defaultMenuOrder() { return 10; } - /** {@inheritdoc} */ + /** + * A menu, to be added to the main application menu. + * + * @return Menu|null + */ public function getMenu() { global $controller, $WT_TREE; diff --git a/app/Module/PedigreeReportModule.php b/app/Module/PedigreeReportModule.php index a5926495c4..fa8330d324 100644 --- a/app/Module/PedigreeReportModule.php +++ b/app/Module/PedigreeReportModule.php @@ -35,24 +35,30 @@ class PedigreeReportModule extends AbstractModule implements ModuleReportInterfa return /* I18N: Description of the “Pedigree” module */ I18N::translate('A report of an individual’s ancestors, formatted as a tree.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; - } } diff --git a/app/Module/RelatedIndividualsReportModule.php b/app/Module/RelatedIndividualsReportModule.php index 83d93977b2..b1de607e49 100644 --- a/app/Module/RelatedIndividualsReportModule.php +++ b/app/Module/RelatedIndividualsReportModule.php @@ -35,23 +35,30 @@ class RelatedIndividualsReportModule extends AbstractModule implements ModuleRep return /* I18N: Description of the “Related individuals” module */ I18N::translate('A report of the individuals that are closely related to an individual.'); } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_PRIVATE; } - /** {@inheritdoc} */ - public function getReportMenus() { + /** + * Return a menu item for this report. + * + * @return Menu + */ + public function getReportMenu() { global $controller, $WT_TREE; - $menus = array(); - $menu = new Menu( + return new Menu( $this->getTitle(), 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), - 'menu-report-' . $this->getName() + 'menu-report-' . $this->getName(), + array('rel' => 'nofollow') ); - $menus[] = $menu; - - return $menus; } } diff --git a/app/Module/StoriesModule.php b/app/Module/StoriesModule.php index b2baba52de..04401ff06b 100644 --- a/app/Module/StoriesModule.php +++ b/app/Module/StoriesModule.php @@ -477,17 +477,31 @@ class StoriesModule extends AbstractModule implements ModuleTabInterface, Module } } - /** {@inheritdoc} */ + /** + * The user can re-order menus. Until they do, they are shown in this order. + * + * @return int + */ public function defaultMenuOrder() { return 30; } - /** {@inheritdoc} */ + /** + * What is the default access level for this module? + * + * Some modules are aimed at admins or managers, and are not generally shown to users. + * + * @return int + */ public function defaultAccessLevel() { return Auth::PRIV_HIDE; } - /** {@inheritdoc} */ + /** + * A menu, to be added to the main application menu. + * + * @return Menu|null + */ public function getMenu() { if (Auth::isSearchEngine()) { return null; diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php index 65952321c3..b010dbb5b8 100644 --- a/app/Theme/AbstractTheme.php +++ b/app/Theme/AbstractTheme.php @@ -1636,13 +1636,11 @@ abstract class AbstractTheme { protected function menuReports() { $submenus = array(); foreach (Module::getActiveReports($this->tree) as $report) { - foreach ($report->getReportMenus() as $submenu) { - $submenus[] = $submenu; - } + $submenus[] = $report->getReportMenu(); } if ($submenus) { - return new Menu(I18N::translate('Reports'), 'reportengine.php?' . $this->tree_url, 'menu-report', array(), $submenus); + return new Menu(I18N::translate('Reports'), 'reportengine.php?' . $this->tree_url, 'menu-report', array('rel' => 'nofollow'), $submenus); } else { return null; } @@ -1654,25 +1652,18 @@ abstract class AbstractTheme { * @return Menu */ protected function menuSearch() { - if (Auth::isSearchEngine()) { - return new Menu(I18N::translate('Search'), '#', 'menu-search'); - } //-- main search menu item - $menu = new Menu(I18N::translate('Search'), 'search.php?' . $this->tree_url, 'menu-search'); + $menu = new Menu(I18N::translate('Search'), 'search.php?' . $this->tree_url, 'menu-search', array('rel' => 'nofollow')); //-- search_general sub menu - $submenu = new Menu(I18N::translate('General search'), 'search.php?' . $this->tree_url, 'menu-search-general'); - $menu->addSubmenu($submenu); + $menu->addSubmenu(new Menu(I18N::translate('General search'), 'search.php?' . $this->tree_url, 'menu-search-general', array('rel' => 'nofollow'))); //-- search_soundex sub menu - $submenu = new Menu(/* I18N: search using “sounds like”, rather than exact spelling */ - I18N::translate('Phonetic search'), 'search.php?' . $this->tree_url . '&action=soundex', 'menu-search-soundex'); - $menu->addSubmenu($submenu); + $menu->addSubmenu(new Menu(/* I18N: search using “sounds like”, rather than exact spelling */ + I18N::translate('Phonetic search'), 'search.php?' . $this->tree_url . '&action=soundex', 'menu-search-soundex', array('rel' => 'nofollow'))); //-- advanced search - $submenu = new Menu(I18N::translate('Advanced search'), 'search_advanced.php?' . $this->tree_url, 'menu-search-advanced'); - $menu->addSubmenu($submenu); + $menu->addSubmenu(new Menu(I18N::translate('Advanced search'), 'search_advanced.php?' . $this->tree_url, 'menu-search-advanced', array('rel' => 'nofollow'))); //-- search_replace sub menu if (Auth::isEditor($this->tree)) { - $submenu = new Menu(I18N::translate('Search and replace'), 'search.php?' . $this->tree_url . '&action=replace', 'menu-search-replace'); - $menu->addSubmenu($submenu); + $menu->addSubmenu(new Menu(I18N::translate('Search and replace'), 'search.php?' . $this->tree_url . '&action=replace', 'menu-search-replace')); } return $menu; diff --git a/reportengine.php b/reportengine.php index bff64a656e..18f3851b36 100644 --- a/reportengine.php +++ b/reportengine.php @@ -97,10 +97,9 @@ foreach ($varnames as $name) { $reports = array(); foreach (Module::getActiveReports($WT_TREE) as $rep) { - foreach ($rep->getReportMenus() as $menu) { - if (preg_match('/report=(' . preg_quote(WT_MODULES_DIR, '/') . '[a-z0-9_]+\/[a-z0-9_]+\.xml)/', $menu->getLink(), $match)) { - $reports[$match[1]] = $menu->getLabel(); - } + $menu = $rep->getReportMenu(); + if (preg_match('/report=(' . preg_quote(WT_MODULES_DIR, '/') . '[a-z0-9_]+\/[a-z0-9_]+\.xml)/', $menu->getLink(), $match)) { + $reports[$match[1]] = $menu->getLabel(); } } |
