diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-03-21 16:57:57 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-03-21 16:57:57 +0000 |
commit | ac0e60fd90c55a3a7d4f2001eb9e4cce44a5b259 (patch) | |
tree | be51851578c3c7cffe0ad6c7bd3dda379ed2bbb3 | |
parent | fd2278f46e5123c43343f57cf764d45a0b57ec24 (diff) | |
download | elgg-ac0e60fd90c55a3a7d4f2001eb9e4cce44a5b259.tar.gz elgg-ac0e60fd90c55a3a7d4f2001eb9e4cce44a5b259.tar.bz2 |
cleaning up friends album view and individual album view
-rw-r--r-- | edit.php | 45 | ||||
-rw-r--r-- | friends.php | 4 | ||||
-rw-r--r-- | index.php | 14 | ||||
-rw-r--r-- | views/default/object/album.php | 8 | ||||
-rw-r--r-- | views/default/tidypics/css.php | 10 | ||||
-rw-r--r-- | views/default/tidypics/forms/edit.php | 63 |
6 files changed, 70 insertions, 74 deletions
@@ -10,33 +10,30 @@ set_context('photos');
$file = (int) get_input('file_guid');
- if (!$file = get_entity($file))
- forward();
+ if (!$file = get_entity($file))
+ forward();
- if(!$file->canEdit())
- forward();
+ if (!$file->canEdit())
+ forward();
- $subtype = $file->getSubtype();
+ $subtype = $file->getSubtype();
- if($subtype == 'album'){
- if($container = $file->container_guid)
- set_page_owner($container);
-
- $area2 .= elgg_view_title($title = elgg_echo('album:edit'));
- }
- elseif($subtype == 'image'){
- if($container = get_entity($file->container_guid)->container_guid)
- set_page_owner($container);
+ if ($subtype == 'album') {
+ if($container = $file->container_guid)
+ set_page_owner($container);
- $area2 .= elgg_view_title($title = elgg_echo('image:edit'));
- }
- else{
- forward();
- }
-
- $area2 .= elgg_view("tidypics/forms/edit",array('entity' => $file, 'subtype' => $subtype));
- $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
- page_draw(elgg_echo("edit"), $body);
-
+ $title = elgg_echo('album:edit');
+ } else if ($subtype == 'image') {
+ if ($container = get_entity($file->container_guid)->container_guid)
+ set_page_owner($container);
+
+ $title = elgg_echo('image:edit');
+ } else {
+ forward();
+ }
+ $area2 .= elgg_view_title($title);
+ $area2 .= elgg_view('tidypics/forms/edit', array('entity' => $file, 'subtype' => $subtype));
+ $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
+ page_draw($title, $body);
?>
\ No newline at end of file diff --git a/friends.php b/friends.php index 50e4aabc3..c9deb4772 100644 --- a/friends.php +++ b/friends.php @@ -24,12 +24,12 @@ if(isloggedin() && (page_owner() == $_SESSION['guid'])) {
$area2 = elgg_view_title($title = elgg_echo('album:yours:friends'));
} else {
- $area2 = elgg_view_title($title = sprintf(elgg_echo('album:friends'), "$friendname"));
+ $area2 = elgg_view_title($title = sprintf(elgg_echo('album:friends'), $friendname));
}
set_context('search');
set_input('search_viewtype', 'gallery');
- $area2 .= list_user_friends_objects(page_owner(), 'album');
+ $area2 .= list_user_friends_objects(page_owner(), 'album', 10, true, false);
set_context('photos');
$body = elgg_view_layout('two_column_left_sidebar', '', $area2);
@@ -18,16 +18,22 @@ }
//set the title
- $area2 = elgg_view_title($title = sprintf(elgg_echo('album:user'), "$owner->name"));
-
+ $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 .= list_entities("object", "album", page_owner(), 10);
+
+ //$area2 .= '</div>';
set_context('photos');
$body = elgg_view_layout('two_column_left_sidebar', '', $area2);
// Finally draw the page
- page_draw(sprintf(elgg_echo("album:user"),page_owner_entity()->name), $body);
+ 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 9d3dc507f..464806ca1 100644 --- a/views/default/object/album.php +++ b/views/default/object/album.php @@ -1,12 +1,6 @@ <?php /** - * Elgg file browser. - * File renderer. - * - * @package ElggFile - * @author Curverider Ltd - * @copyright Curverider Ltd 2008 - * @link http://elgg.com/ + * Tidypics Album Gallery View */ global $CONFIG; diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php index f9f5b09e6..a682ff677 100644 --- a/views/default/tidypics/css.php +++ b/views/default/tidypics/css.php @@ -35,7 +35,7 @@ height:160px; margin:4px; padding:5px; - border:1px solid #ccc; + border:1px solid #cccccc; text-align:center; } @@ -47,7 +47,7 @@ } #image_full img{ padding:5px; - border:1px solid #ccc; + border:1px solid #cccccc; margin:7px 0; } @@ -55,7 +55,7 @@ .album_cover{ padding:2px; - border:1px solid #ccc; + border:1px solid #cccccc; margin:8px 0; } @@ -96,7 +96,7 @@ height:160px; margin:4px; padding:5px; - border:1px solid #ccc; + border:1px solid #cccccc; text-align:center; } .image_info{ @@ -108,7 +108,7 @@ } .edit_image{ float:right; - border:1px solid #ccc; + border:1px solid #cccccc; width:153px; height:153px; } diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php index 97170163b..bef87c64b 100644 --- a/views/default/tidypics/forms/edit.php +++ b/views/default/tidypics/forms/edit.php @@ -1,6 +1,6 @@ <?php
/**
- * Elgg images edit/add page
+ * Tidypics images edit/add page
* This form is used to:
* - create albums
* - edit albums
@@ -8,39 +8,39 @@ */
//set stuff if we are editing existing album or image
- if (isset($vars['entity'])) {
- $title = sprintf(elgg_echo("album:edit"),$object->title);
- $action = "tidypics/editalbum";
- $title = $vars['entity']->title;
- $body = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $subtype = $vars['subtype'];
+ if (isset($vars['entity'])) {
+ $title = sprintf(elgg_echo("album:edit"),$object->title);
+ $action = "tidypics/editalbum";
+ $title = $vars['entity']->title;
+ $body = $vars['entity']->description;
+ $tags = $vars['entity']->tags;
+ $access_id = $vars['entity']->access_id;
+ $subtype = $vars['subtype'];
- // if nothing is sent, create new, but only new albums are sent here
- // new images are sent to upload.php
- } else {
- $title = elgg_echo("album:add");
- $action = "tidypics/addalbum";
- $tags = "";
- $title = "";
- $description = "";
- if (defined('ACCESS_DEFAULT'))
- $access_id = ACCESS_DEFAULT;
- else
- $access_id = 0;
- }
+ // if nothing is sent, create new, but only new albums are sent here
+ // new images are sent to upload.php
+ } else {
+ $title = elgg_echo("album:add");
+ $action = "tidypics/addalbum";
+ $tags = "";
+ $title = "";
+ $description = "";
+ if (defined('ACCESS_DEFAULT'))
+ $access_id = ACCESS_DEFAULT;
+ else
+ $access_id = 0;
+ }
// in case we have some cached details
- if (isset($vars['albumtitle'])) {
- $title = $vars['albumtitle'];
- $body = $vars['albumbody'];
- $tags = $vars['albumtags'];
- }
+ if (isset($vars['albumtitle'])) {
+ $title = $vars['albumtitle'];
+ $body = $vars['albumbody'];
+ $tags = $vars['albumtags'];
+ }
- $container_guid = get_input('container_guid');
- if (!$container_guid) $container_guid = page_owner();
-
+ $container_guid = get_input('container_guid');
+ if (!$container_guid) $container_guid = page_owner();
+
?>
<div class="contentWrapper">
<form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post">
@@ -49,8 +49,7 @@ <?php echo elgg_view("input/text", array("internalname" => "albumtitle", "value" => $title,)); ?>
</p>
<?php
- if($vars['subtype'] == 'album' || $action == "tidypics/addalbum")
- {
+ if ($vars['subtype'] == 'album' || $action == "tidypics/addalbum") {
?>
<p>
<label><?php echo elgg_echo('album:desc'); ?></label>
|