summaryrefslogtreecommitdiff
path: root/app/Module/UserFavoritesModule.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Module/UserFavoritesModule.php')
-rw-r--r--app/Module/UserFavoritesModule.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/app/Module/UserFavoritesModule.php b/app/Module/UserFavoritesModule.php
index d5202b4afd..0e52ccfddc 100644
--- a/app/Module/UserFavoritesModule.php
+++ b/app/Module/UserFavoritesModule.php
@@ -1,6 +1,4 @@
<?php
-namespace Fisharebest\Webtrees\Module;
-
/**
* webtrees: online genealogy
* Copyright (C) 2015 webtrees development team
@@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Module;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+namespace Fisharebest\Webtrees\Module;
use Fisharebest\Webtrees\Auth;
use Fisharebest\Webtrees\Database;
@@ -35,12 +34,20 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule {
return /* I18N: Description of the “Favorites” module */ I18N::translate('Display and manage a user’s favorite pages.');
}
- /** {@inheritdoc} */
+ /**
+ * Can this block be shown on the user’s home page?
+ *
+ * @return bool
+ */
public function isUserBlock() {
return true;
}
- /** {@inheritdoc} */
+ /**
+ * Can this block be shown on the tree’s home page?
+ *
+ * @return bool
+ */
public function isGedcomBlock() {
return false;
}
@@ -63,11 +70,16 @@ class UserFavoritesModule extends FamilyTreeFavoritesModule {
->fetchAll(PDO::FETCH_ASSOC);
}
- /** {@inheritdoc} */
- public function modAction($modAction) {
+ /**
+ * This is a general purpose hook, allowing modules to respond to routes
+ * of the form module.php?mod=FOO&mod_action=BAR
+ *
+ * @param string $mod_action
+ */
+ public function modAction($mod_action) {
global $WT_TREE;
- switch ($modAction) {
+ switch ($mod_action) {
case 'menu-add-favorite':
// Process the "add to user favorites" menu item on indi/fam/etc. pages
$record = GedcomRecord::getInstance(Filter::post('xref', WT_REGEX_XREF), $WT_TREE);