From 4562cfbb1a630b14fd194271f99f1f8c098dc38d Mon Sep 17 00:00:00 2001
From: cash
Date: Sat, 19 Nov 2011 12:10:46 -0500
Subject: basic pages for viewing all/mine/friends and viewing an album
---
views/default/object/album.php | 154 +++------------------------------
views/default/object/album/full.php | 60 +++++++++++++
views/default/object/album/summary.php | 41 +++++++++
views/default/object/image.php | 17 +++-
views/default/object/image/full.php | 2 +
views/default/object/image/summary.php | 43 +++++++++
views/default/tidypics/css.php | 12 +++
7 files changed, 185 insertions(+), 144 deletions(-)
create mode 100644 views/default/object/album/full.php
create mode 100644 views/default/object/album/summary.php
create mode 100644 views/default/object/image/full.php
create mode 100644 views/default/object/image/summary.php
(limited to 'views/default')
diff --git a/views/default/object/album.php b/views/default/object/album.php
index 13b94aed5..51b25b7da 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -1,150 +1,18 @@
getGUID();
-$owner = $album->getOwnerEntity();
-$tags = $album->tags;
-$title = $album->title;
-$desc = $album->description;
-$friendlytime = friendly_time($album->time_created);
-$mime = $album->mimetype;
-
-if (get_context() == "search") {
-
- if (get_input('search_viewtype') == "gallery") {
-
-/******************************************************************************
- *
- * Gallery view of an album object
+ * Album view
*
- * This is called when looking at page of albums
- *
- *
- *****************************************************************************/
-
- $album_cover_guid = $album->getCoverImageGuid();
- if ($album_cover_guid) {
- $album_cover = '';
- } else {
- $album_cover = '';
- }
-?>
-
-
-
-
name;?>
-
- getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")";
- }
-?>
-
-
-' . $title . '
';
- $info .= "username}\">{$owner->name} {$friendlytime}";
- $numcomments = elgg_count_comments($album);
- if ($numcomments) {
- $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")";
- }
- $info .= "
";
+$album = elgg_extract('entity', $vars);
+$full_view = elgg_extract('full_view', $vars, false);
- $album_cover_guid = $album->getCoverImageGuid();
- if ($album_cover_guid) {
- $icon = "getURL()}\">" . '';
- } else {
- $icon = "getURL()}\">" . '';
- }
- echo elgg_view_listing($icon, $info);
- }
+if ($full_view) {
+ echo elgg_view('object/album/full', $vars);
} else {
-
-/******************************************************************************
- *
- * Individual view of an album object
- *
- * This is called when getting a listing of the photos in an album
- *
- *
- *****************************************************************************/
-
- $page = get_input("page");
- list($album_placeholder, $album_id, $album_title) = split("/", $page);
-
- $photo_ratings = get_plugin_setting('photo_ratings', 'tidypics');
- if ($photo_ratings == "enabled") {
- add_submenu_item( elgg_echo("tidypics:highestrated"),
- $CONFIG->wwwroot . "pg/photos/highestrated/group:" . $album_id,
- 'photos');
- }
- echo elgg_view_title($title);
-?>
-
-
-
-
-' . autop($desc) . '
';
-
- $offset = (int)get_input('offset', 0);
- echo $album->viewImages(16, $offset);
- // echo '' . elgg_echo('image:none') . '
';
- // $num_images = 0;
- //}
-
-?>
-
-
-
-
$tags));?>
-
-
name; ?>
-
getSize(); ?>
-
-
-
:
-
-
-
-';
-} // end of individual album view
-
+ echo elgg_view('object/album/summary', $vars);
+}
diff --git a/views/default/object/album/full.php b/views/default/object/album/full.php
new file mode 100644
index 000000000..7484a48f3
--- /dev/null
+++ b/views/default/object/album/full.php
@@ -0,0 +1,60 @@
+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 = elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'image',
+ 'container_guid' => $album->getGUID(),
+ 'limit' => 16,
+ 'full_view' => false,
+ 'list_type' => 'gallery',
+ 'list_type_toggle' => false,
+ 'gallery_class' => 'tidypics-gallery',
+));
+
+echo elgg_view('object/elements/full', array(
+ 'entity' => $album,
+ 'icon' => $owner_icon,
+ 'summary' => $summary,
+ 'body' => $body,
+));
diff --git a/views/default/object/album/summary.php b/views/default/object/album/summary.php
new file mode 100644
index 000000000..78eec3517
--- /dev/null
+++ b/views/default/object/album/summary.php
@@ -0,0 +1,41 @@
+ $album->getCoverImageURL(),
+ 'alt' => $album->getTitle(),
+ 'class' => 'elgg-photo',
+));
+
+$header = elgg_view('output/url', array(
+ 'text' => $album->getTitle(),
+ 'href' => $album->getURL(),
+));
+
+$body = elgg_view('output/url', array(
+ 'text' => $album_cover,
+ 'href' => $album->getURL(),
+ 'encode_text' => false,
+ 'is_trusted' => true,
+));
+
+$footer = elgg_view('output/url', array(
+ 'text' => $album->getContainerEntity()->name,
+ 'href' => $album->getContainerEntity()->getURL(),
+ 'is_trusted' => true,
+));
+$footer .= '' . elgg_echo('album:num', array($album->getSize())) . '
';
+
+$params = array(
+ 'footer' => $footer,
+);
+echo elgg_view_module('tidypics-album', $header, $body, $params);
diff --git a/views/default/object/image.php b/views/default/object/image.php
index 8c1f23ec2..12d58440d 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -1,9 +1,24 @@
$image->getSrcURL(),
+ 'alt' => $image->getTitle(),
+ 'class' => 'elgg-photo',
+));
+
+$header = elgg_view('output/url', array(
+ 'text' => $image->getTitle(),
+ 'href' => $image->getURL(),
+));
+
+$body = elgg_view('output/url', array(
+ 'text' => $img,
+ 'href' => $image->getURL(),
+ 'encode_text' => false,
+ 'is_trusted' => true,
+));
+
+/*
+$footer = elgg_view('output/url', array(
+ 'text' => $image->getContainerEntity()->name,
+ 'href' => $image->getContainerEntity()->getURL(),
+ 'is_trusted' => true,
+));
+$footer .= '' . elgg_echo('album:num', array($album->getSize())) . '
';
+*/
+
+$params = array(
+ 'footer' => $footer,
+);
+echo elgg_view_module('tidypics-image', $header, $body, $params);
diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php
index 25a29fdc3..bf47d42b7 100644
--- a/views/default/tidypics/css.php
+++ b/views/default/tidypics/css.php
@@ -3,6 +3,18 @@
* tidypics CSS extender
*/
?>
+
+.elgg-module-tidypics-album,
+.elgg-module-tidypics-image {
+ width: 161px;
+ text-align: center;
+ margin: 5px 10px;
+}
+
+
+
/* ---- tidypics object views ---- */
.tidypics_wrapper > table.entity_gallery {
--
cgit v1.2.3