diff options
Diffstat (limited to 'mod/lightpics/views/default/object/image')
-rw-r--r-- | mod/lightpics/views/default/object/image/full.php | 62 | ||||
-rw-r--r-- | mod/lightpics/views/default/object/image/navigation.php | 34 | ||||
-rw-r--r-- | mod/lightpics/views/default/object/image/summary.php | 41 |
3 files changed, 137 insertions, 0 deletions
diff --git a/mod/lightpics/views/default/object/image/full.php b/mod/lightpics/views/default/object/image/full.php new file mode 100644 index 000000000..74436f500 --- /dev/null +++ b/mod/lightpics/views/default/object/image/full.php @@ -0,0 +1,62 @@ +<?php +/** + * Full view of an image + * + * @uses $vars['entity'] TidypicsImage + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ + +$image = $photo = $vars['entity']; + +$img = elgg_view_entity_icon($image, 'large', array( + 'href' => $image->getIconURL('master'), + 'img_class' => 'tidypics-photo', + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', +)); + +$owner_link = elgg_view('output/url', array( + 'href' => "photos/owner/" . $photo->getOwnerEntity()->username, + 'text' => $photo->getOwnerEntity()->name, +)); +$author_text = elgg_echo('byline', array($owner_link)); + +$owner_icon = elgg_view_entity_icon($photo->getOwnerEntity(), 'tiny'); + +$metadata = elgg_view_menu('entity', array( + 'entity' => $vars['entity'], + 'handler' => 'photos', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', +)); + +$subtitle = "$author_text $date $categories $comments_link"; + +$params = array( + 'entity' => $photo, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'tags' => $tags, +); +$list_body = elgg_view('object/elements/summary', $params); + +$params = array('class' => 'mbl'); +$summary = elgg_view_image_block($owner_icon, $list_body, $params); + +echo $summary; + +echo '<div class="tidypics-photo-wrapper center">'; +echo elgg_view('object/image/navigation', $vars); +echo $img; +echo '</div>'; + +if ($photo->description) { + echo elgg_view('output/longtext', array( + 'value' => $photo->description, + 'class' => 'mbl', + )); +} + +echo elgg_view_comments($photo); diff --git a/mod/lightpics/views/default/object/image/navigation.php b/mod/lightpics/views/default/object/image/navigation.php new file mode 100644 index 000000000..155b76364 --- /dev/null +++ b/mod/lightpics/views/default/object/image/navigation.php @@ -0,0 +1,34 @@ +<?php +/** + * Photo navigation + * + * @uses $vars['entity'] + */ + +$photo = $vars['entity']; + +$album = $photo->getContainerEntity(); +$previous_photo = $album->getPreviousImage($photo->getGUID()); +$next_photo = $album->getNextImage($photo->getGUID()); +$size = $album->getSize(); +$index = $album->getIndex($photo->getGUID()); + +echo '<ul class="elgg-menu elgg-menu-hz tidypics-album-nav">'; +echo '<li>'; +echo elgg_view('output/url', array( + 'text' => elgg_view_icon('arrow-left'), + 'href' => $previous_photo->getURL(), +)); +echo '</li>'; + +echo '<li>'; +echo '<span>' . elgg_echo('image:index', array($index, $size)) . '</span>'; +echo '</li>'; + +echo '<li>'; +echo elgg_view('output/url', array( + 'text' => elgg_view_icon('arrow-right'), + 'href' => $next_photo->getURL(), +)); +echo '</li>'; +echo '</ul>'; diff --git a/mod/lightpics/views/default/object/image/summary.php b/mod/lightpics/views/default/object/image/summary.php new file mode 100644 index 000000000..0fa03cbe8 --- /dev/null +++ b/mod/lightpics/views/default/object/image/summary.php @@ -0,0 +1,41 @@ +<?php +/** + * Summary of an image for lists/galleries + * + * @uses $vars['entity'] TidypicsImage + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ + +$image = elgg_extract('entity', $vars); + + +$header = elgg_view('output/url', array( + 'text' => $image->getTitle(), + 'href' => $image->getURL(), + 'is_trusted' => true, + 'class' => 'tidypics-heading', +)); + +$body = elgg_view_entity_icon($image, 'small', array( + 'href' => $image->getURL(), + 'img_class' => 'tidypics-photo', + 'encode_text' => false, + 'is_trusted' => true, + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', +)); + +/* +$footer = elgg_view('output/url', array( + 'text' => $image->getContainerEntity()->name, + 'href' => $image->getContainerEntity()->getURL(), + 'is_trusted' => true, +)); +$footer .= '<div class="elgg-subtext">' . elgg_echo('album:num', array($album->getSize())) . '</div>'; +*/ + +$params = array( + 'footer' => $footer, +); +echo elgg_view_module('tidypics-image', $header, $body, $params); |