aboutsummaryrefslogtreecommitdiff
path: root/mod/lightpics/views/default/object/album
diff options
context:
space:
mode:
Diffstat (limited to 'mod/lightpics/views/default/object/album')
-rw-r--r--mod/lightpics/views/default/object/album/full.php59
-rw-r--r--mod/lightpics/views/default/object/album/gallery.php36
-rw-r--r--mod/lightpics/views/default/object/album/list.php42
3 files changed, 137 insertions, 0 deletions
diff --git a/mod/lightpics/views/default/object/album/full.php b/mod/lightpics/views/default/object/album/full.php
new file mode 100644
index 000000000..7b273c66e
--- /dev/null
+++ b/mod/lightpics/views/default/object/album/full.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Full view of an album
+ *
+ * @uses $vars['entity'] TidypicsAlbum
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$album = elgg_extract('entity', $vars);
+$owner = $album->getOwnerEntity();
+
+$owner_icon = elgg_view_entity_icon($owner, 'tiny');
+
+$metadata = elgg_view_menu('entity', array(
+ 'entity' => $album,
+ 'handler' => 'photos',
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+));
+
+$owner_link = elgg_view('output/url', array(
+ 'href' => "photos/owner/$owner->username",
+ 'text' => $owner->name,
+ 'is_trusted' => true,
+));
+$author_text = elgg_echo('byline', array($owner_link));
+$date = elgg_view_friendly_time($album->time_created);
+$categories = elgg_view('output/categories', $vars);
+
+$subtitle = "$author_text $date $categories";
+
+$params = array(
+ 'entity' => $album,
+ 'title' => false,
+ 'metadata' => $metadata,
+ 'subtitle' => $subtitle,
+ 'tags' => elgg_view('output/tags', array('tags' => $album->tags)),
+);
+$params = $params + $vars;
+$summary = elgg_view('object/elements/summary', $params);
+
+$body = '';
+if ($album->description) {
+ $body = elgg_view('output/longtext', array(
+ 'value' => $album->description,
+ 'class' => 'mbm',
+ ));
+}
+
+$body .= $album->viewImages();
+
+echo elgg_view('object/elements/full', array(
+ 'entity' => $album,
+ 'icon' => $owner_icon,
+ 'summary' => $summary,
+ 'body' => $body,
+));
diff --git a/mod/lightpics/views/default/object/album/gallery.php b/mod/lightpics/views/default/object/album/gallery.php
new file mode 100644
index 000000000..d6fb598e4
--- /dev/null
+++ b/mod/lightpics/views/default/object/album/gallery.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Display an album in a gallery
+ *
+ * @uses $vars['entity'] TidypicsAlbum
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$album = elgg_extract('entity', $vars);
+
+
+$album_cover = elgg_view_entity_icon($album, 'small');
+
+$header = elgg_view('output/url', array(
+ 'text' => $album->getTitle(),
+ 'href' => $album->getURL(),
+ 'is_trusted' => true,
+ 'class' => 'tidypics-heading',
+));
+
+$footer = "";
+if ($album->getContainerEntity()) {
+ $footer .= elgg_view('output/url', array(
+ 'text' => $album->getContainerEntity()->name,
+ 'href' => $album->getContainerEntity()->getURL(),
+ 'is_trusted' => true,
+ ));
+}
+$footer .= '<div class="elgg-subtext">' . elgg_echo('album:num', array($album->getSize())) . '</div>';
+
+$params = array(
+ 'footer' => $footer,
+);
+echo elgg_view_module('tidypics-album', $header, $album_cover, $params);
diff --git a/mod/lightpics/views/default/object/album/list.php b/mod/lightpics/views/default/object/album/list.php
new file mode 100644
index 000000000..e576c92f1
--- /dev/null
+++ b/mod/lightpics/views/default/object/album/list.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Display an album as an item in a list
+ *
+ * @uses $vars['entity'] TidypicsAlbum
+ *
+ * @author Cash Costello
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
+ */
+
+$album = elgg_extract('entity', $vars);
+$owner = $album->getOwnerEntity();
+
+$owner_link = elgg_view('output/url', array(
+ 'href' => "photos/owner/$owner->username",
+ 'text' => $owner->name,
+ 'is_trusted' => true,
+));
+$author_text = elgg_echo('byline', array($owner_link));
+$date = elgg_view_friendly_time($album->time_created);
+$categories = elgg_view('output/categories', $vars);
+
+$subtitle = "$author_text $date $categories";
+
+$title = elgg_view('output/url', array(
+ 'text' => $album->getTitle(),
+ 'href' => $album->getURL(),
+));
+
+$params = array(
+ 'entity' => $album,
+ 'title' => $title,
+ 'metadata' => null,
+ 'subtitle' => $subtitle,
+ 'tags' => elgg_view('output/tags', array('tags' => $album->tags)),
+);
+$params = $params + $vars;
+$summary = elgg_view('object/elements/summary', $params);
+
+$icon = elgg_view_entity_icon($album, 'tiny');
+
+echo $header = elgg_view_image_block($icon, $summary);