summaryrefslogtreecommitdiff
path: root/app/Module/AlbumModule.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Module/AlbumModule.php')
-rw-r--r--app/Module/AlbumModule.php57
1 files changed, 47 insertions, 10 deletions
diff --git a/app/Module/AlbumModule.php b/app/Module/AlbumModule.php
index 7090e37b3e..4beb7e3f95 100644
--- a/app/Module/AlbumModule.php
+++ b/app/Module/AlbumModule.php
@@ -1,6 +1,4 @@
<?php
-namespace Fisharebest\Webtrees\Module;
-
/**
* webtrees: online genealogy
* Copyright (C) 2015 webtrees development team
@@ -15,6 +13,8 @@ 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\Filter;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
@@ -28,36 +28,63 @@ use Fisharebest\Webtrees\Theme;
* Class AlbumModule
*/
class AlbumModule extends AbstractModule implements ModuleTabInterface {
+ /** @var Media[] List of media objects. */
private $media_list;
- /** {@inheritdoc} */
+ /**
+ * How should this module be labelled on tabs, menus, etc.?
+ *
+ * @return string
+ */
public function getTitle() {
return /* I18N: Name of a module */ I18N::translate('Album');
}
- /** {@inheritdoc} */
+ /**
+ * A sentence describing what this module does.
+ *
+ * @return string
+ */
public function getDescription() {
return /* I18N: Description of the “Album” module */ I18N::translate('An alternative to the “media” tab, and an enhanced image viewer.');
}
- /** {@inheritdoc} */
+ /**
+ * The user can re-arrange the tab order, but until they do, this
+ * is the order in which tabs are shown.
+ *
+ * @return int
+ */
public function defaultTabOrder() {
return 60;
}
- /** {@inheritdoc} */
+ /**
+ * Is this tab empty? If so, we don't always need to display it.
+ *
+ * @return bool
+ */
public function hasTabContent() {
global $WT_TREE;
return Auth::isEditor($WT_TREE) || $this->getMedia();
}
- /** {@inheritdoc} */
+ /**
+ * A greyed out tab has no actual content, but may perhaps have
+ * options to create content.
+ *
+ * @return bool
+ */
public function isGrayedOut() {
return !$this->getMedia();
}
- /** {@inheritdoc} */
+ /**
+ * Generate the HTML content of this tab.
+ *
+ * @return string
+ */
public function getTabContent() {
global $WT_TREE, $controller;
@@ -209,12 +236,22 @@ class AlbumModule extends AbstractModule implements ModuleTabInterface {
return $this->media_list;
}
- /** {@inheritdoc} */
+ /**
+ * Can this tab load asynchronously?
+ *
+ * @return bool
+ */
public function canLoadAjax() {
return !Auth::isSearchEngine(); // Search engines cannot use AJAX
}
- /** {@inheritdoc} */
+ /**
+ * Any content (e.g. Javascript) that needs to be rendered before the tabs.
+ *
+ * This function is probably not needed, as there are better ways to achieve this.
+ *
+ * @return string
+ */
public function getPreLoadContent() {
return '';
}