From 4e0c1576475390faa2f1fb4c4dc2902a953f440e Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 25 Feb 2009 12:16:53 +0000 Subject: First commit --- views/default/widgets/album_view/edit.php | 21 ++++++++++++ views/default/widgets/album_view/view.php | 53 +++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 views/default/widgets/album_view/edit.php create mode 100644 views/default/widgets/album_view/view.php (limited to 'views/default/widgets/album_view') diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php new file mode 100644 index 000000000..2d7c7708f --- /dev/null +++ b/views/default/widgets/album_view/edit.php @@ -0,0 +1,21 @@ +

+ : + + num_display == '') $vars['entity']->num_display = 5; + ?> + +

\ No newline at end of file diff --git a/views/default/widgets/album_view/view.php b/views/default/widgets/album_view/view.php new file mode 100644 index 000000000..347332971 --- /dev/null +++ b/views/default/widgets/album_view/view.php @@ -0,0 +1,53 @@ +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").'

'; + + //check if owner has write rights. If so, let him edit the album + $container_guid = get_input('container_guid', $_SESSION['user']->getGUID()); + + if ($owner->username == get_entity($container_guid)->username){ + echo '

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

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