From 10bec18dce2a29fb2947888547756438d0972cb7 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 28 Mar 2009 18:14:57 +0000 Subject: condensed group "widget" and profile widget to one view --- views/default/tidypics/albums.php | 45 +++++++++++++++++++ views/default/tidypics/groupprofile_albums.php | 61 ++------------------------ views/default/widgets/album_view/view.php | 43 +----------------- 3 files changed, 50 insertions(+), 99 deletions(-) create mode 100644 views/default/tidypics/albums.php (limited to 'views') diff --git a/views/default/tidypics/albums.php b/views/default/tidypics/albums.php new file mode 100644 index 000000000..de56f08e1 --- /dev/null +++ b/views/default/tidypics/albums.php @@ -0,0 +1,45 @@ +'; + foreach($owner_albums as $album) { + + if($album->cover) + $album_cover = '' . $album->title . ''; + else + $album_cover = '' . $album->title . ''; +?> +
+ +
time_created);?>
+getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")
"; +?> + +
+username) || empty($owner->username)) { + echo '' . elgg_echo('album:all') . ''; + } else { + echo '' . elgg_echo('album:more') . ''; + } + + //close album_widget_container div + echo ""; + + } +?> \ No newline at end of file diff --git a/views/default/tidypics/groupprofile_albums.php b/views/default/tidypics/groupprofile_albums.php index de61b0845..060c540d4 100644 --- a/views/default/tidypics/groupprofile_albums.php +++ b/views/default/tidypics/groupprofile_albums.php @@ -1,64 +1,9 @@ photos_enable != 'no') { - - //the number of files to display - $number = (int) $vars['entity']->num_display; - //if no number has been set, default to 5 - if (!$number) - $number = 5; - - $owner = page_owner_entity(); - $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false); - echo '
'; - echo '

' . elgg_echo('albums') . '

'; - - if ($owner_albums) { - echo '
'; - foreach($owner_albums as $album){ - - //get album cover if one was set - if($album->cover) - $album_cover = 'album cover'; - else - $album_cover = 'new album'; - - ?> -
- -
time_created);?>
- getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")
"; - ?> - -
- username) || empty($owner->username)) { - echo '' . elgg_echo('album:all') . ''; - } else { - echo '' . elgg_echo('album:more') . ''; - } - - //close album_widget_container div - echo "
"; - } else { - - //echo '
'; - //echo '

'.elgg_echo("album:none").'

'; - if ($owner && ($owner->canWriteToContainer($_SESSION['user']))){ - //echo 'username.'>'.elgg_echo("album:add").''; - //echo '
'; - } - - } - //close group_albums_widget div - echo "
"; + echo '

' . elgg_echo('album:group') . '

'; + echo elgg_view('tidypics/albums', array('num_albums' => 5)); + echo ''; } ?> \ No newline at end of file diff --git a/views/default/widgets/album_view/view.php b/views/default/widgets/album_view/view.php index b8b206b22..b4248df35 100644 --- a/views/default/widgets/album_view/view.php +++ b/views/default/widgets/album_view/view.php @@ -1,52 +1,13 @@
num_display; //if no number has been set, default to 5 if (!$number) $number = 5; - - $owner = page_owner_entity(); - $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false); - if ($owner_albums) { - echo '
'; - - foreach($owner_albums as $album){ - - //get album cover if one was set - if($album->cover) - $album_cover = '' . $album->title . ''; - else - $album_cover = '' . $album->title . ''; - ?> -
- -
time_created);?>
- getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")
"; - ?> - -
- username; - echo "" . elgg_echo('album:more') . ""; - echo "
"; - - } else { - - echo '

' . elgg_echo("album:none") . '

'; + echo elgg_view('tidypics/albums', array('num_albums' => $number)); - if (get_loggedin_userid() == page_owner()) { - echo '

username.'>'.elgg_echo("album:create").'

'; - } - - } ?>
\ No newline at end of file -- cgit v1.2.3