aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php7
-rw-r--r--start.php2
-rw-r--r--viewalbum.php43
-rw-r--r--views/default/object/album.php56
4 files changed, 64 insertions, 44 deletions
diff --git a/index.php b/index.php
index 45c849878..6b17e12e8 100644
--- a/index.php
+++ b/index.php
@@ -20,17 +20,12 @@
//set the title
$title = sprintf(elgg_echo('album:user'), "$owner->name");
$area2 = elgg_view_title($title);
-
- // temporary code - move to view when cleaned up
- //$area2 .= '<div class="contentWrapper">';
-
+
// Get objects
set_context('search');
set_input('search_viewtype', 'gallery');
$area2 .= list_entities("object", "album", page_owner(), 10);
- //$area2 .= '</div>';
-
set_context('photos');
$body = elgg_view_layout('two_column_left_sidebar', '', $area2);
diff --git a/start.php b/start.php
index 7c3f888e8..9474ed746 100644
--- a/start.php
+++ b/start.php
@@ -125,7 +125,7 @@
case "album": //view an album individually
set_input('guid',$page[1]);
- include(dirname(dirname(dirname(__FILE__))) . "/entities/index.php");
+ include($CONFIG->pluginspath . "tidypics/viewalbum.php");
break;
case "new": //create new album
diff --git a/viewalbum.php b/viewalbum.php
new file mode 100644
index 000000000..5c8f0b2b9
--- /dev/null
+++ b/viewalbum.php
@@ -0,0 +1,43 @@
+<?php
+
+ /**
+ * Tidypics Album View Page
+ */
+
+ include_once(dirname(dirname(__FILE__)) . "/engine/start.php");
+
+ // Get the GUID of the entity we want to view
+ $guid = (int) get_input('guid');
+
+ $context = get_input('context');
+ if ($context) set_context($context);
+
+ // Get the entity, if possible
+ if ($entity = get_entity($guid)) {
+
+ if ($entity->container_guid) {
+ set_page_owner($entity->container_guid);
+ } else {
+ set_page_owner($entity->owner_guid);
+ }
+
+ // Set the body to be the full view of the entity, and the title to be its title
+ if ($entity instanceof ElggObject) {
+ $title = $entity->title;
+ } else if ($entity instanceof ElggEntity) {
+ $title = $entity->name;
+ }
+
+ $area2 = elgg_view_title($title);
+
+ $area2 .= elgg_view_entity($entity, true);
+
+ // Otherwise?
+ } else {
+ }
+
+ $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
+
+ // Display the page
+ page_draw($title, $body);
+?> \ No newline at end of file
diff --git a/views/default/object/album.php b/views/default/object/album.php
index 464806ca1..a1b238812 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -13,7 +13,7 @@
$owner = $vars['entity']->getOwnerEntity();
$friendlytime = friendly_time($vars['entity']->time_created);
$mime = $file->mimetype;
-
+
if (get_context() == "search") {
if (get_input('search_viewtype') == "gallery") {
@@ -59,30 +59,11 @@
} else {
// individual album view
?>
- <div id="pages_breadcrumbs">
-<?php
- if (is_null(page_owner_entity()->username) || empty(page_owner_entity()->username)) { //when no owner available, link to world photos
-?>
- <a href="<?php echo $vars['url'] . 'pg/photos/world'; ?>"><?php echo elgg_echo("albums"); ?></a>&nbsp;&#62;&nbsp;
-<?php
- } else {
-?>
- <a href="<?php echo $vars['url'] . 'pg/photos/owned/' . page_owner_entity()->username; ?>"><?php echo sprintf(elgg_echo("album:user"), page_owner_entity()->name); ?></a>&nbsp;&#62;&nbsp;
-<?php
- }
-?>
- <?php echo $title; ?>
- </div>
-
+<div class="contentWrapper">
<?php
- echo '<div id="tidypics_title">'.$title.'</div>';
- echo '<div id="tidypics_desc">'.autop($desc).'</div>';
+ echo '<div id="tidypics_desc">'.autop($desc).'</div>';
- if ($file->canEdit()) { // add edits
- // specific to my theme only
- //add_submenu_item(elgg_echo('album:addpix'), $vars['url'] . "pg/photos/upload/". $file_guid , '', 'jade');
- //add_submenu_item(elgg_echo('album:edit'), $vars['url'] . "mod/tidypics/edit.php?file_guid=". $file_guid , '', 'jade');
- //add_submenu_item(elgg_echo('album:delete'), $vars['url'] . "action/tidypics/delete?file=". $file_guid , '', 'jade');
+ if ($file->canEdit()) { // add controls
?>
<div id="tidypics_controls">
@@ -97,23 +78,23 @@
?>
</div>
<?php
- }
+ }
- // display the simple image views. Uses: via 'object/image.php'
- $count = get_entities("object","image", $file_guid, '', 999);
+ // display the simple image views. Uses: via 'object/image.php'
+ $count = get_entities("object","image", $file_guid, '', 999);
- //build array for back | next links
- $_SESSION['image_sort'] = array();
+ //build array for back | next links
+ $_SESSION['image_sort'] = array();
- if(count($count) > 0) {
- foreach($count as $image){
- array_push($_SESSION['image_sort'], $image->guid);
- }
+ if(count($count) > 0) {
+ foreach($count as $image){
+ array_push($_SESSION['image_sort'], $image->guid);
+ }
- echo list_entities("object","image", $file_guid, 24, false);
- } else {
- echo elgg_echo('image:none');
- }
+ echo list_entities("object","image", $file_guid, 24, false);
+ } else {
+ echo elgg_echo('image:none');
+ }
?>
<div class="clearfloat"></div>
@@ -128,5 +109,6 @@
echo elgg_view_comments($file);
}
-}
+ echo '</div>';
+ } // end of individual album view
?>