aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-07-25 02:01:36 +0000
committerCash Costello <cash.costello@gmail.com>2010-07-25 02:01:36 +0000
commit73403645808a81425381f43c25e0ea2c92705312 (patch)
tree83fb73e9a122054f6f4c2e1c44e399572ee13e28 /views/default
parent791ec4925346cb38ecca9a2f2574b012ab64a88a (diff)
downloadelgg-73403645808a81425381f43c25e0ea2c92705312.tar.gz
elgg-73403645808a81425381f43c25e0ea2c92705312.tar.bz2
first go at brining tidypics up to code standards
Diffstat (limited to 'views/default')
-rw-r--r--views/default/annotation/annotate.php31
-rw-r--r--views/default/object/album.php192
-rw-r--r--views/default/object/image.php295
-rw-r--r--views/default/river/object/album/create.php65
-rw-r--r--views/default/river/object/image/create.php38
-rw-r--r--views/default/river/object/image/tag.php39
-rw-r--r--views/default/settings/tidypics/edit.php6
-rw-r--r--views/default/tidypics/admin/imagelib.php88
-rw-r--r--views/default/tidypics/admin/settings.php36
-rw-r--r--views/default/tidypics/admin/stats.php51
-rw-r--r--views/default/tidypics/admin/tidypics.php58
-rw-r--r--views/default/tidypics/albums.php74
-rw-r--r--views/default/tidypics/breadcrumbs.php33
-rw-r--r--views/default/tidypics/exif.php20
-rw-r--r--views/default/tidypics/forms/edit.php145
-rw-r--r--views/default/tidypics/forms/edit_multi.php12
-rw-r--r--views/default/tidypics/forms/settings.php336
-rw-r--r--views/default/tidypics/forms/setupFlickr.php1
-rw-r--r--views/default/tidypics/forms/upload.php123
-rw-r--r--views/default/tidypics/groupprofile_albums.php1
-rw-r--r--views/default/tidypics/image_menu.php77
-rw-r--r--views/default/tidypics/tagging.php57
-rw-r--r--views/default/widgets/album_view/edit.php11
-rw-r--r--views/default/widgets/album_view/view.php13
-rw-r--r--views/default/widgets/latest_photos/edit.php8
-rw-r--r--views/default/widgets/latest_photos/view.php17
26 files changed, 928 insertions, 899 deletions
diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php
index 8156a4bb4..f81f2b55c 100644
--- a/views/default/annotation/annotate.php
+++ b/views/default/annotation/annotate.php
@@ -1,21 +1,20 @@
<?php
- /*
- * Overriding core view to work around bug dealing with empty titles
- */
+/*
+ * Overriding core view to work around bug dealing with empty titles
+ */
- $performed_by = get_entity($vars['item']->subject_guid);
- $object = get_entity($vars['item']->object_guid);
- $url = $object->getURL();
- $subtype = get_subtype_from_id($object->subtype);
- $title = $object->title;
- if (!$title)
- $title = elgg_echo('untitled');
+$performed_by = get_entity($vars['item']->subject_guid);
+$object = get_entity($vars['item']->object_guid);
+$url = $object->getURL();
+$subtype = get_subtype_from_id($object->subtype);
+$title = $object->title;
+if (!$title) {
+ $title = elgg_echo('untitled');
+}
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
- $string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"" . $object->getURL() . "\">" . $title . "</a>";
+$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+$string = sprintf(elgg_echo("river:posted:generic"),$url) . " ";
+$string .= elgg_echo("{$subtype}:river:annotate") . " <a href=\"" . $object->getURL() . "\">" . $title . "</a>";
-?>
-
-<?php echo $string; ?> \ No newline at end of file
+echo $string;
diff --git a/views/default/object/album.php b/views/default/object/album.php
index 85dd69ac9..0db0d3e49 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -1,22 +1,22 @@
<?php
- /**
- * Tidypics Album Gallery View
- */
+/**
+ * Tidypics Album Gallery View
+ */
- global $CONFIG;
-
- $album = $vars['entity'];
- $album_guid = $album->getGUID();
- $owner = $album->getOwnerEntity();
- $tags = $album->tags;
- $title = $album->title;
- $desc = $album->description;
- $friendlytime = friendly_time($album->time_created);
- $mime = $album->mimetype;
+global $CONFIG;
- if (get_context() == "search") {
+$album = $vars['entity'];
+$album_guid = $album->getGUID();
+$owner = $album->getOwnerEntity();
+$tags = $album->tags;
+$title = $album->title;
+$desc = $album->description;
+$friendlytime = friendly_time($album->time_created);
+$mime = $album->mimetype;
- if (get_input('search_viewtype') == "gallery") {
+if (get_context() == "search") {
+
+ if (get_input('search_viewtype') == "gallery") {
/******************************************************************************
*
@@ -27,30 +27,31 @@
*
*****************************************************************************/
- //get album cover if one was set
- if ($album->cover)
- $album_cover = '<img src="' . $vars['url'] . 'pg/photos/thumbnail/' . $album->cover . '/small/" class="tidypics_album_cover" alt="' . $title . '"/>';
- else
- $album_cover = '<img src="' . $vars['url'] . 'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="new album">';
-
+ //get album cover if one was set
+ if ($album->cover) {
+ $album_cover = '<img src="' . $vars['url'] . 'pg/photos/thumbnail/' . $album->cover . '/small/" class="tidypics_album_cover" alt="' . $title . '"/>';
+ } else {
+ $album_cover = '<img src="' . $vars['url'] . 'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="new album">';
+ }
?>
<div class="tidypics_album_gallery_item">
<div class="tidypics_gallery_title">
<a href="<?php echo $album->getURL();?>"><?php echo $title;?></a>
</div>
<a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a><br>
- <small><a href="<?php echo $vars['url'];?>pg/profile/<?php echo $owner->username;?>"><?php echo $owner->name;?></a>
- <br /><?php echo $friendlytime;?><br />
-<?php
- //get the number of comments
- $numcomments = elgg_count_comments($album);
- if ($numcomments)
- echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
+ <small><a href="<?php echo $vars['url'];?>pg/profile/<?php echo $owner->username;?>"><?php echo $owner->name;?></a>
+ <br /><?php echo $friendlytime;?><br />
+ <?php
+ //get the number of comments
+ $numcomments = elgg_count_comments($album);
+ if ($numcomments) {
+ echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
+ }
?>
</small>
</div>
<?php
- } else {
+ } else {
/******************************************************************************
*
* List view of an album object
@@ -60,22 +61,23 @@
*
*****************************************************************************/
- $info = '<p><a href="' . $album->getURL() . '">' . $title . '</a></p>';
- $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}";
- $numcomments = elgg_count_comments($album);
- if ($numcomments)
- $info .= ", <a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
- $info .= "</p>";
-
- //get album cover if one was set
- if ($album->cover)
- $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" alt="thumbnail" /></a>';
- else
- $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/graphics/image_error_thumb.png" alt="new album"></a>';
-
- echo elgg_view_listing($icon, $info);
+ $info = '<p><a href="' . $album->getURL() . '">' . $title . '</a></p>';
+ $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}";
+ $numcomments = elgg_count_comments($album);
+ if ($numcomments) {
+ $info .= ", <a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
}
- } else {
+ $info .= "</p>";
+
+ //get album cover if one was set
+ if ($album->cover) {
+ $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" alt="thumbnail" /></a>';
+ } else {
+ $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/graphics/image_error_thumb.png" alt="new album"></a>';
+ }
+ echo elgg_view_listing($icon, $info);
+ }
+} else {
/******************************************************************************
*
@@ -86,76 +88,76 @@
*
*****************************************************************************/
- $page = get_input("page");
- list($album_placeholder, $album_id, $album_title) = split("/", $page);
-
- $photo_ratings = get_plugin_setting('photo_ratings', 'tidypics');
- if ($photo_ratings == "enabled")
- add_submenu_item( elgg_echo("tidypics:highestrated"),
- $CONFIG->wwwroot . "pg/photos/highestrated/group:" . $album_id,
- 'photos');
-
- echo elgg_view_title($title);
+ $page = get_input("page");
+ list($album_placeholder, $album_id, $album_title) = split("/", $page);
+
+ $photo_ratings = get_plugin_setting('photo_ratings', 'tidypics');
+ if ($photo_ratings == "enabled") {
+ add_submenu_item( elgg_echo("tidypics:highestrated"),
+ $CONFIG->wwwroot . "pg/photos/highestrated/group:" . $album_id,
+ 'photos');
+ }
+ echo elgg_view_title($title);
?>
<div class="contentWrapper">
<div id="tidypics_breadcrumbs">
- <?php echo elgg_view('tidypics/breadcrumbs', array() ); ?>
+ <?php echo elgg_view('tidypics/breadcrumbs', array() ); ?>
</div>
-<?php
- echo '<div id="tidypics_desc">' . autop($desc) . '</div>';
-
- $images = get_entities("object", "image", $album_guid, '', 999);
-
- //build array for back | next links
- $_SESSION['image_sort'] = array();
-
- if (is_array($images)) {
- foreach ($images as $image) {
- array_push($_SESSION['image_sort'], $image->guid);
- }
-
- // display the simple image views. Uses 'object/image' view
- echo list_entities("object", "image", $album_guid, 24, false);
-
- $num_images = count($images);
- } else {
- echo '<div class="tidypics_info">' . elgg_echo('image:none') . '</div>';
- $num_images = 0;
+<?php
+ echo '<div id="tidypics_desc">' . autop($desc) . '</div>';
+
+ $images = get_entities("object", "image", $album_guid, '', 999);
+
+ //build array for back | next links
+ $_SESSION['image_sort'] = array();
+
+ if (is_array($images)) {
+ foreach ($images as $image) {
+ array_push($_SESSION['image_sort'], $image->guid);
}
-
+
+ // display the simple image views. Uses 'object/image' view
+ echo list_entities("object", "image", $album_guid, 24, false);
+
+ $num_images = count($images);
+ } else {
+ echo '<div class="tidypics_info">' . elgg_echo('image:none') . '</div>';
+ $num_images = 0;
+ }
+
?>
<div class="clearfloat"></div>
<div class="tidypics_info">
-<?php
+<?php
- if (!is_null($tags)) {
+ if (!is_null($tags)) {
?>
<div class="object_tag_string"><?php echo elgg_view('output/tags',array('value' => $tags));?></div>
-<?php
- }
+<?php
+ }
?>
- <?php echo elgg_echo('album:by');?> <b><a href="<?php echo $vars['url'] ;?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime; ?><br>
- <?php echo elgg_echo('image:total');?> <b><?php echo $num_images; ?></b><br>
+ <?php echo elgg_echo('album:by');?> <b><a href="<?php echo $vars['url'] ;?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime; ?><br>
+ <?php echo elgg_echo('image:total');?> <b><?php echo $num_images; ?></b><br>
<?php
- $categories = elgg_view('categories/view',$vars);
- if (!empty($categories)) {
+ $categories = elgg_view('categories/view',$vars);
+ if (!empty($categories)) {
?>
<br />
-<b><?php echo elgg_echo('categories'); ?>:</b>
- <?php
+ <b><?php echo elgg_echo('categories'); ?>:</b>
+<?php
- echo $categories;
+ echo $categories;
- }
+ }
?>
</div>
<?php
- if ($vars['full']) {
- echo elgg_view_comments($album);
- }
-
- echo '</div>';
- } // end of individual album view
-?>
+ if ($vars['full']) {
+ echo elgg_view_comments($album);
+ }
+
+ echo '</div>';
+} // end of individual album view
+
diff --git a/views/default/object/image.php b/views/default/object/image.php
index ee81d800f..cd53120de 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -1,19 +1,19 @@
<?php
- /**
- *
- * Tidypics image object views
- */
+/**
+ *
+ * Tidypics image object views
+ */
- global $CONFIG;
- include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/lib/exif.php";
+global $CONFIG;
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/lib/exif.php";
- $image = $vars['entity'];
- $image_guid = $image->getGUID();
- $tags = $image->tags;
- $title = $image->title;
- $desc = $image->description;
- $owner = $image->getOwnerEntity();
- $friendlytime = friendly_time($image->time_created);
+$image = $vars['entity'];
+$image_guid = $image->getGUID();
+$tags = $image->tags;
+$title = $image->title;
+$desc = $image->description;
+$owner = $image->getOwnerEntity();
+$friendlytime = friendly_time($image->time_created);
/********************************************************************
@@ -21,69 +21,65 @@
* search view of an image
*
********************************************************************/
- if (get_context() == "search") {
+if (get_context() == "search") {
- // gallery view is a matrix view showing just the image - size: small
- if (get_input('search_viewtype') == "gallery") {
- ?>
- <div class="tidypics_album_images">
- <a href="<?php echo $image->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $image_guid;?>&size=small" alt="thumbnail"/></a>
- </div>
- <?php
- }
- else{
- // list view displays a thumbnail icon of the image, its title, and the number of comments
- $info = '<p><a href="' .$image->getURL(). '">'.$title.'</a></p>';
- $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}";
- $numcomments = elgg_count_comments($image);
- if ($numcomments)
- $info .= ", <a href=\"{$image->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
- $info .= "</p>";
- $icon = "<a href=\"{$image->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $image_guid . '&size=thumb" alt="' . $title . '" /></a>';
-
- echo elgg_view_listing($icon, $info);
+ // gallery view is a matrix view showing just the image - size: small
+ if (get_input('search_viewtype') == "gallery") {
+?>
+<div class="tidypics_album_images">
+ <a href="<?php echo $image->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $image_guid;?>&size=small" alt="thumbnail"/></a>
+</div>
+<?php
+ } else {
+ // list view displays a thumbnail icon of the image, its title, and the number of comments
+ $info = '<p><a href="' .$image->getURL(). '">'.$title.'</a></p>';
+ $info .= "<p class=\"owner_timestamp\"><a href=\"{$vars['url']}pg/profile/{$owner->username}\">{$owner->name}</a> {$friendlytime}";
+ $numcomments = elgg_count_comments($image);
+ if ($numcomments) {
+ $info .= ", <a href=\"{$image->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
}
+ $info .= "</p>";
+ $icon = "<a href=\"{$image->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $image_guid . '&size=thumb" alt="' . $title . '" /></a>';
+
+ echo elgg_view_listing($icon, $info);
+ }
/***************************************************************
*
* front page view
*
****************************************************************/
- } else if (get_context() == "front") {
- // the front page view is a clikcable thumbnail of the image
+} else if (get_context() == "front") {
+ // the front page view is a clickable thumbnail of the image
?>
<a href="<?php echo $image->getURL(); ?>">
-<img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $image_guid;?>&amp;size=thumb" class="tidypics_album_cover" alt="<?php echo $title; ?>" title="<?php echo $title; ?>" />
+ <img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $image_guid;?>&amp;size=thumb" class="tidypics_album_cover" alt="<?php echo $title; ?>" title="<?php echo $title; ?>" />
</a>
-<?php
- } else {
+ <?php
+} else {
/********************************************************************
*
* listing of photos in an album
*
*********************************************************************/
- if (!$vars['full']) {
-
-?>
-<?php
- // plugins can override the image link to add lightbox code here
- $image_html = false;
- $image_html = trigger_plugin_hook('tp_thumbnail_link', 'album', array('image' => $image), $image_html);
-
- if ($image_html) {
- echo $image_html;
- } else {
- // default link to image if no one overrides
-?>
- <div class="tidypics_album_images">
- <a href="<?php echo $image->getURL();?>"><img src="<?php echo $vars['url'];?>pg/photos/thumbnail/<?php echo $image_guid;?>/small/" alt="<?php echo $image->title; ?>"/></a>
- </div>
-<?php
- }
+ if (!$vars['full']) {
+
+ // plugins can override the image link to add lightbox code here
+ $image_html = false;
+ $image_html = trigger_plugin_hook('tp_thumbnail_link', 'album', array('image' => $image), $image_html);
+
+ if ($image_html) {
+ echo $image_html;
+ } else {
+ // default link to image if no one overrides
?>
+<div class="tidypics_album_images">
+ <a href="<?php echo $image->getURL();?>"><img src="<?php echo $vars['url'];?>pg/photos/thumbnail/<?php echo $image_guid;?>/small/" alt="<?php echo $image->title; ?>"/></a>
+</div>
<?php
- } else {
+ }
+ } else {
/********************************************************************
*
@@ -91,66 +87,68 @@
*
*********************************************************************/
-
- $viewer = get_loggedin_user();
-
- // Build back and next links
- $back = '';
- $next = '';
+ $viewer = get_loggedin_user();
- $album = get_entity($image->container_guid);
- $current = array_search($image_guid, $_SESSION['image_sort']);
+ // Build back and next links
+ $back = '';
+ $next = '';
- if (!$current) { // means we are no longer using the correct album array
+ $album = get_entity($image->container_guid);
- //rebuild the array
- $count = get_entities("object","image", $album->guid, '', 999);
- $_SESSION['image_sort'] = array();
+ $current = array_search($image_guid, $_SESSION['image_sort']);
- foreach ($count as $img) {
- array_push($_SESSION['image_sort'], $img->guid);
- }
+ if (!$current) { // means we are no longer using the correct album array
- if ($_SESSION['image_sort'])
- $current = array_search($image_guid, $_SESSION['image_sort']);
+ //rebuild the array
+ $count = get_entities("object","image", $album->guid, '', 999);
+ $_SESSION['image_sort'] = array();
+
+ foreach ($count as $img) {
+ array_push($_SESSION['image_sort'], $img->guid);
}
- if ($current != 0)
- $back = '<a href="' .$vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current-1] . '">&laquo; ' . elgg_echo('image:back') . '</a>';
+ if ($_SESSION['image_sort']) {
+ $current = array_search($image_guid, $_SESSION['image_sort']);
+ }
+ }
- if (sizeof($_SESSION['image_sort']) > $current + 1)
- $next = '<a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">' . elgg_echo('image:next') . ' &raquo;</a>';
+ if ($current != 0) {
+ $back = '<a href="' .$vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current-1] . '">&laquo; ' . elgg_echo('image:back') . '</a>';
+ }
+ if (sizeof($_SESSION['image_sort']) > $current + 1) {
+ $next = '<a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">' . elgg_echo('image:next') . ' &raquo;</a>';
+ }
?>
<div class="contentWrapper">
<div id="tidypics_wrapper">
<div id="tidypics_breadcrumbs">
- <?php echo elgg_view('tidypics/breadcrumbs', array('album' => $album,) ); ?> <br />
- <?php
- if (get_plugin_setting('view_count', 'tidypics') != "disabled") {
-
- $image->addView($viewer->guid);
- $views = $image->getViews($viewer->guid);
- if (is_array($views)) {
- echo sprintf(elgg_echo("tidypics:views"), $views['total']);
- if ($owner->guid == $viewer->guid) {
- echo ' ' . sprintf(elgg_echo("tidypics:viewsbyowner"), $views['unique']);
- }
- else {
- if ($views['mine'])
- echo ' ' . sprintf(elgg_echo("tidypics:viewsbyothers"), $views['mine']);
+ <?php echo elgg_view('tidypics/breadcrumbs', array('album' => $album,) ); ?> <br />
+<?php
+ if (get_plugin_setting('view_count', 'tidypics') != "disabled") {
+
+ $image->addView($viewer->guid);
+ $views = $image->getViews($viewer->guid);
+ if (is_array($views)) {
+ echo sprintf(elgg_echo("tidypics:views"), $views['total']);
+ if ($owner->guid == $viewer->guid) {
+ echo ' ' . sprintf(elgg_echo("tidypics:viewsbyowner"), $views['unique']);
+ } else {
+ if ($views['mine']) {
+ echo ' ' . sprintf(elgg_echo("tidypics:viewsbyothers"), $views['mine']);
+ }
+ }
}
}
- }
- ?>
+?>
</div>
<div id="tidypics_desc">
- <?php echo autop($desc); ?>
+ <?php echo autop($desc); ?>
</div>
<div id="tidypics_image_nav">
<ul>
@@ -159,73 +157,74 @@
</ul>
</div>
<div id="tidypics_image_wrapper">
- <?php
- // this code controls whether the photo is a hyperlink or not and what it links to
- if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
- // admin allows downloads so default to inline download link
- $image_html = "<a href=\"{$vars['url']}pg/photos/download/{$image_guid}/inline/\" title=\"{$title}\" >";
- $image_html .= "<img id=\"tidypics_image\" src=\"{$vars['url']}pg/photos/thumbnail/{$image_guid}/large/\" alt=\"{$title}\" />";
- $image_html .= "</a>";
- } else {
- $image_html = "<img id=\"tidypics_image\" src=\"{$vars['url']}pg/photos/thumbnail/{$image_guid}/large/\" alt=\"{$title}\" />";
- }
- // does any plugin want to override the link
- $image_html = trigger_plugin_hook('tp_thumbnail_link', 'image', array('image' => $image), $image_html);
- echo $image_html;
- ?>
+ <?php
+ // this code controls whether the photo is a hyperlink or not and what it links to
+ if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
+ // admin allows downloads so default to inline download link
+ $image_html = "<a href=\"{$vars['url']}pg/photos/download/{$image_guid}/inline/\" title=\"{$title}\" >";
+ $image_html .= "<img id=\"tidypics_image\" src=\"{$vars['url']}pg/photos/thumbnail/{$image_guid}/large/\" alt=\"{$title}\" />";
+ $image_html .= "</a>";
+ } else {
+ $image_html = "<img id=\"tidypics_image\" src=\"{$vars['url']}pg/photos/thumbnail/{$image_guid}/large/\" alt=\"{$title}\" />";
+ }
+ // does any plugin want to override the link
+ $image_html = trigger_plugin_hook('tp_thumbnail_link', 'image', array('image' => $image), $image_html);
+ echo $image_html;
+ ?>
<div class="clearfloat"></div>
</div>
-<?php
- // image menu (start tagging, download, etc.)
-
- echo '<div id="tidypics_controls"><ul>';
- echo elgg_view('tidypics/image_menu', array('image_guid' => $image_guid,
- 'viewer' => $viewer,
- 'owner' => $owner,
- 'anytags' => $image->isPhotoTagged(),
- 'album' => $album, ) );
- echo '</ul></div>';
-
- // tagging code - photo tags on images, photo tag listing and hidden divs used in tagging
- if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
- echo elgg_view('tidypics/tagging', array( 'image' => $image,
- 'viewer' => $viewer,
- 'owner' => $owner, ) );
- }
-
-
- if (get_plugin_setting('exif', 'tidypics') == "enabled") {
+ <?php
+ // image menu (start tagging, download, etc.)
+
+ echo '<div id="tidypics_controls"><ul>';
+ echo elgg_view('tidypics/image_menu', array(
+ 'image_guid' => $image_guid,
+ 'viewer' => $viewer,
+ 'owner' => $owner,
+ 'anytags' => $image->isPhotoTagged(),
+ 'album' => $album, ) );
+ echo '</ul></div>';
+
+ // tagging code - photo tags on images, photo tag listing and hidden divs used in tagging
+ if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+ echo elgg_view('tidypics/tagging', array(
+ 'image' => $image,
+ 'viewer' => $viewer,
+ 'owner' => $owner, ) );
+ }
+
+
+ if (get_plugin_setting('exif', 'tidypics') == "enabled") {
+ echo elgg_view('tidypics/exif', array('guid'=> $image_guid));
+ }
?>
- <?php echo elgg_view('tidypics/exif', array('guid'=> $image_guid)); ?>
-<?php } ?>
<div class="tidypics_info">
-<?php if (!is_null($tags)) { ?>
+<?php
+ if (!is_null($tags)) {
+?>
<div class="object_tag_string"><?php echo elgg_view('output/tags',array('value' => $tags));?></div>
-<?php }
- if (get_plugin_setting('photo_ratings', 'tidypics') == "enabled") {
+<?php
+ }
+ if (get_plugin_setting('photo_ratings', 'tidypics') == "enabled") {
?>
<div id="rate_container">
- <?php echo elgg_view('rate/rate', array('entity'=> $vars['entity'])); ?>
-</div>
+ <?php echo elgg_view('rate/rate', array('entity'=> $vars['entity'])); ?>
+ </div>
<?php
- }
-
- echo elgg_echo('image:by');?> <b><a href="<?php echo $vars['url']; ?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime;
+ }
+
+ echo elgg_echo('image:by');?> <b><a href="<?php echo $vars['url']; ?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime;
?>
</div>
</div> <!-- tidypics wrapper-->
<?php
- echo elgg_view_comments($image);
-
- echo '<div class="clearfloat"></div>';
-
- echo '</div>'; // content wrapper
+ echo elgg_view_comments($image);
- } // end of individual image display
+ echo '<div class="clearfloat"></div>';
- }
-
-?>
+ echo '</div>'; // content wrapper
+ } // end of individual image display
+}
diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php
index 20f9293d7..ef50f9988 100644
--- a/views/default/river/object/album/create.php
+++ b/views/default/river/object/album/create.php
@@ -1,42 +1,41 @@
<?php
- $performed_by = get_entity($vars['item']->subject_guid);
- $album = get_entity($vars['item']->object_guid);
-
- $group_album = ($album->owner_guid != $album->container_guid);
- if ($group_album) {
- $group = get_entity($album->container_guid);
- $group_name = $group->name;
- $group_link = $group->getURL();
+$performed_by = get_entity($vars['item']->subject_guid);
+$album = get_entity($vars['item']->object_guid);
+
+$group_album = ($album->owner_guid != $album->container_guid);
+if ($group_album) {
+ $group = get_entity($album->container_guid);
+ $group_name = $group->name;
+ $group_link = $group->getURL();
+}
+
+$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+$string = sprintf(elgg_echo("album:river:created"), $url) . " ";
+$string .= "<a href=\"" . $album->getURL() . "\">" . $album->title . "</a>";
+if ($group_album) {
+ $string .= ' ' . elgg_echo('album:river:group') . ' ' . "<a href=\"{$group_link}\" >{$group_name}</a>";
+}
+
+$album_river_view = get_plugin_setting('album_river_view', 'tidypics');
+
+if ($album_river_view == "cover") {
+ if ($album->cover) {
+ $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
}
-
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("album:river:created"),$url) . " ";
- $string .= "<a href=\"" . $album->getURL() . "\">" . $album->title . "</a>";
- if ($group_album)
- $string .= ' ' . elgg_echo('album:river:group') . ' ' . "<a href=\"{$group_link}\" >{$group_name}</a>";
-
- $album_river_view = get_plugin_setting('album_river_view', 'tidypics');
-
- if ($album_river_view == "cover") {
- if ($album->cover) {
- $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
- }
- } else {
+} else {
- $string .= "<div class=\"river_content\">";
-
- $images = get_entities("object", "image", $album->guid, 'time_created desc', 7);
+ $string .= "<div class=\"river_content\">";
- if (count($images)) {
- foreach($images as $image){
- $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
- }
- }
+ $images = get_entities("object", "image", $album->guid, 'time_created desc', 7);
- $string .= "</div>";
+ if (count($images)) {
+ foreach($images as $image) {
+ $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
+ }
}
-echo $string;
+ $string .= "</div>";
+}
-?>
+echo $string;
diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php
index cd2351a2e..188fc6ff1 100644
--- a/views/default/river/object/image/create.php
+++ b/views/default/river/object/image/create.php
@@ -1,29 +1,27 @@
<?php
- $performed_by = get_entity($vars['item']->subject_guid);
- $image = get_entity($vars['item']->object_guid);
- if($image->title) {
- $title = $image->title;
- } else {
- $title = "untitled";
- }
+$performed_by = get_entity($vars['item']->subject_guid);
+$image = get_entity($vars['item']->object_guid);
+if ($image->title) {
+ $title = $image->title;
+} else {
+ $title = "untitled";
+}
- $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $album = get_entity($image->container_guid);
+$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+$album = get_entity($image->container_guid);
- $album_link = "<a href='". $album->getURL() . "'>" . $album->title . "</a>";
- $image_link = "<a href=\"" . $image->getURL() . "\">" . $title . "</a>";
-
- $string = sprintf(elgg_echo("image:river:created"), $url, $image_link, $album_link);
-
- $string .= "<div class=\"river_content\">";
+$album_link = "<a href='". $album->getURL() . "'>" . $album->title . "</a>";
+$image_link = "<a href=\"" . $image->getURL() . "\">" . $title . "</a>";
+
+$string = sprintf(elgg_echo("image:river:created"), $url, $image_link, $album_link);
+
+$string .= "<div class=\"river_content\">";
/* // this adds the album cover to the river display
$string .= "<a href=\"" . $album->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
*/
- $string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
- $string .= "</div>";
-
- echo $string;
+$string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
+$string .= "</div>";
-?> \ No newline at end of file
+echo $string;
diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php
index 1b3589afb..961761c99 100644
--- a/views/default/river/object/image/tag.php
+++ b/views/default/river/object/image/tag.php
@@ -1,23 +1,22 @@
<?php
- $image = get_entity($vars['item']->subject_guid);
- $person_tagged = get_entity($vars['item']->object_guid);
- if($image->title) {
- $title = $image->title;
- } else {
- $title = "untitled";
- }
-
- // viewer may not have permission to view image
- if (!$image)
- return;
-
-
- $image_url = "<a href=\"{$image->getURL()}\">{$title}</a>";
- $person_url = "<a href=\"{$person_tagged->getURL()}\">{$person_tagged->name}</a>";
-
- $string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url;
-
- echo $string;
+$image = get_entity($vars['item']->subject_guid);
+$person_tagged = get_entity($vars['item']->object_guid);
+if ($image->title) {
+ $title = $image->title;
+} else {
+ $title = "untitled";
+}
-?> \ No newline at end of file
+// viewer may not have permission to view image
+if (!$image) {
+ return;
+}
+
+
+$image_url = "<a href=\"{$image->getURL()}\">{$title}</a>";
+$person_url = "<a href=\"{$person_tagged->getURL()}\">{$person_tagged->name}</a>";
+
+$string = $person_url . ' ' . elgg_echo('image:river:tagged') . ' ' . $image_url;
+
+echo $string;
diff --git a/views/default/settings/tidypics/edit.php b/views/default/settings/tidypics/edit.php
index eb391c8bc..a6b2c2d0c 100644
--- a/views/default/settings/tidypics/edit.php
+++ b/views/default/settings/tidypics/edit.php
@@ -1,7 +1,7 @@
<?php
- global $CONFIG;
- $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
- $settings_url = $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php';
+global $CONFIG;
+$system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
+$settings_url = $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php';
?>
<p>
diff --git a/views/default/tidypics/admin/imagelib.php b/views/default/tidypics/admin/imagelib.php
index b4656afe1..a0d0c19e7 100644
--- a/views/default/tidypics/admin/imagelib.php
+++ b/views/default/tidypics/admin/imagelib.php
@@ -1,62 +1,62 @@
<?php
- $img_type = get_subtype_id('object', 'image');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_images = $total->total;
-
- $img_type = get_subtype_id('object', 'album');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_albums = $total->total;
+$img_type = get_subtype_id('object', 'image');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_images = $total->total;
- $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
- $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
-
- $num_views = count_annotations(0, 'object', 'image', 'tp_view');
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled")
- $num_tags = count_annotations(0, 'object', 'image', 'phototag');
+$img_type = get_subtype_id('object', 'album');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_albums = $total->total;
+
+$num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
+$num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
+
+$num_views = count_annotations(0, 'object', 'image', 'tp_view');
+
+if (get_plugin_setting('tagging', 'tidypics') != "disabled")
+ $num_tags = count_annotations(0, 'object', 'image', 'phototag');
?>
<br />
<h3>Overview</h3>
<p>
-An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping.
-There are three image library options with Tidypics: PHP extension <a href="http://www.php.net/manual/en/book.image.php">GD</a>,
-<a href="http://www.imagemagick.org/">ImageMagick</a> called via a system call, and the PHP extension
-<a href="http://pecl.php.net/package/imagick/">imagick</a>. GD is the most common of the three on hosted servers but suffers
-from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the
-PHP extension), we recommend that you use that.
+ An image library is required by Tidypics to perform various manipulations: resizing on upload, watermarking, rotation, and cropping.
+ There are three image library options with Tidypics: PHP extension <a href="http://www.php.net/manual/en/book.image.php">GD</a>,
+ <a href="http://www.imagemagick.org/">ImageMagick</a> called via a system call, and the PHP extension
+ <a href="http://pecl.php.net/package/imagick/">imagick</a>. GD is the most common of the three on hosted servers but suffers
+ from serious memory usage problems when resizing photos. If you have access to ImageMagick (whether through system calls or the
+ PHP extension), we recommend that you use that.
</p>
<h3>Testing ImageMagick Commandline</h3>
<p>
-To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our
-<a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; ?>">server analysis page</a> to find out the
-configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should
-be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of
-ImageMagick installed on your server.
+ To use the ImageMagick executables, PHP must be configured to allow calls to exec(). You can check our
+ <a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php'; ?>">server analysis page</a> to find out the
+ configuration of your server. Next, you need to determine the path to ImageMagick on your server. Your hosting service should
+ be able to provide this to you. You can test if the location is correct below. If successful, it should display the version of
+ ImageMagick installed on your server.
</p>
<br />
<p>
-<?php echo elgg_echo('tidypics:settings:im_path'); ?><br />
-<input name="im_location" type="text" />
-<input type="submit" value="Submit" onclick="TestImageMagickLocation();" />
+ <?php echo elgg_echo('tidypics:settings:im_path'); ?><br />
+ <input name="im_location" type="text" />
+ <input type="submit" value="Submit" onclick="TestImageMagickLocation();" />
</p>
<div id="im_results"></div>
<script type="text/javascript">
-function TestImageMagickLocation()
-{
- var loc = $('input[name=im_location]').val();
- $("#im_results").html("");
- $.ajax({
- type: "GET",
- url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/imtest.php'; ?>",
- data: {location: loc},
- cache: false,
- success: function(html){
- $("#im_results").html(html);
- }
- });
-}
+ function TestImageMagickLocation()
+ {
+ var loc = $('input[name=im_location]').val();
+ $("#im_results").html("");
+ $.ajax({
+ type: "GET",
+ url: "<?php echo $CONFIG->wwwroot . 'mod/tidypics/actions/imtest.php'; ?>",
+ data: {location: loc},
+ cache: false,
+ success: function(html){
+ $("#im_results").html(html);
+ }
+ });
+ }
</script> \ No newline at end of file
diff --git a/views/default/tidypics/admin/settings.php b/views/default/tidypics/admin/settings.php
index ce5652c16..bc0befa16 100644
--- a/views/default/tidypics/admin/settings.php
+++ b/views/default/tidypics/admin/settings.php
@@ -1,26 +1,26 @@
<?php
- echo elgg_view('output/longtext', array('value' => elgg_echo("tidypics:admin:instructions")));
-
- global $CONFIG;
- $system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
- $upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php';
- $upgrade_url = elgg_add_action_tokens_to_url($upgrade_url);
-
- $upgrade = false;
- if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album'))
- $upgrade = true;
+echo elgg_view('output/longtext', array('value' => elgg_echo("tidypics:admin:instructions")));
+
+global $CONFIG;
+$system_url = $CONFIG->wwwroot . 'mod/tidypics/pages/server_analysis.php';
+$upgrade_url = $CONFIG->wwwroot . 'mod/tidypics/actions/upgrade.php';
+$upgrade_url = elgg_add_action_tokens_to_url($upgrade_url);
+
+$upgrade = false;
+if (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {
+ $upgrade = true;
+}
?>
<p>
-<?php
+ <?php
if ($upgrade) {
-?>
-<a href="<?php echo $upgrade_url; ?>">Upgrade</a><br />
-<?php
+ ?>
+ <a href="<?php echo $upgrade_url; ?>">Upgrade</a><br />
+ <?php
}
-?>
-<a href="<?php echo $system_url; ?>">Run Server Analysis</a>
+ ?>
+ <a href="<?php echo $system_url; ?>">Run Server Analysis</a>
</p>
<?php
- echo elgg_view("tidypics/forms/settings");
-?> \ No newline at end of file
+echo elgg_view("tidypics/forms/settings");
diff --git a/views/default/tidypics/admin/stats.php b/views/default/tidypics/admin/stats.php
index aea5e75ba..0b088dc2e 100644
--- a/views/default/tidypics/admin/stats.php
+++ b/views/default/tidypics/admin/stats.php
@@ -1,35 +1,36 @@
<?php
- $img_type = get_subtype_id('object', 'image');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_images = $total->total;
-
- $img_type = get_subtype_id('object', 'album');
- $query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
- $total = get_data_row($query);
- $num_albums = $total->total;
+$img_type = get_subtype_id('object', 'image');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_images = $total->total;
- $num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
- $num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
-
- $num_views = count_annotations(0, 'object', 'image', 'tp_view');
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled")
- $num_tags = count_annotations(0, 'object', 'image', 'phototag');
+$img_type = get_subtype_id('object', 'album');
+$query = "SELECT count(guid) as total from {$CONFIG->dbprefix}entities where subtype={$img_type}";
+$total = get_data_row($query);
+$num_albums = $total->total;
+
+$num_comments_photos = count_annotations(0, 'object', 'image', 'generic_comment');
+$num_comments_albums = count_annotations(0, 'object', 'album', 'generic_comment');
+
+$num_views = count_annotations(0, 'object', 'image', 'tp_view');
+
+if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+ $num_tags = count_annotations(0, 'object', 'image', 'phototag');
+}
?>
<p>
-<br />
-Photos: <?php echo $num_images; ?><br />
-Albums: <?php echo $num_albums; ?><br />
-Comments on photos: <?php echo $num_comments_photos; ?><br />
-Comments on albums: <?php echo $num_comments_albums; ?><br />
-Total views: <?php echo $num_views; ?><br />
+ <br />
+ Photos: <?php echo $num_images; ?><br />
+ Albums: <?php echo $num_albums; ?><br />
+ Comments on photos: <?php echo $num_comments_photos; ?><br />
+ Comments on albums: <?php echo $num_comments_albums; ?><br />
+ Total views: <?php echo $num_views; ?><br />
<?php
- if ($num_tags) {
+if ($num_tags) {
?>
-Photo tags: <?php echo $num_tags; ?><br />
+ Photo tags: <?php echo $num_tags; ?><br />
<?php
- }
+}
?>
</p> \ No newline at end of file
diff --git a/views/default/tidypics/admin/tidypics.php b/views/default/tidypics/admin/tidypics.php
index fa518156c..a46781c2a 100644
--- a/views/default/tidypics/admin/tidypics.php
+++ b/views/default/tidypics/admin/tidypics.php
@@ -1,32 +1,32 @@
<?php
- global $CONFIG;
-
- $tab = $vars['tab'];
-
- $settingsselect = '';
- $statsselect = '';
- $imagelibselect = '';
- $thumbnailselect = '';
- $helpselect = '';
- switch($tab) {
- case 'settings':
- $settingsselect = 'class="selected"';
- break;
- case 'stats':
- $statsselect = 'class="selected"';
- break;
- case 'imagelib':
- $imagelibselect = 'class="selected"';
- break;
- case 'thumbnail':
- $thumbnailselect = 'class="selected"';
- break;
- case 'help':
- $helpselect = 'class="selected"';
- break;
- }
-
+global $CONFIG;
+
+$tab = $vars['tab'];
+
+$settingsselect = '';
+$statsselect = '';
+$imagelibselect = '';
+$thumbnailselect = '';
+$helpselect = '';
+switch($tab) {
+ case 'settings':
+ $settingsselect = 'class="selected"';
+ break;
+ case 'stats':
+ $statsselect = 'class="selected"';
+ break;
+ case 'imagelib':
+ $imagelibselect = 'class="selected"';
+ break;
+ case 'thumbnail':
+ $thumbnailselect = 'class="selected"';
+ break;
+ case 'help':
+ $helpselect = 'class="selected"';
+ break;
+}
+
?>
<div class="contentWrapper">
<div id="elgg_horizontal_tabbed_nav">
@@ -38,7 +38,7 @@
<li <?php echo $helpselect; ?>><a href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/pages/admin.php?tab=help'; ?>"><?php echo elgg_echo('tidypics:settings:help'); ?></a></li>
</ul>
</div>
-<?php
+ <?php
switch($tab) {
case 'settings':
echo elgg_view("tidypics/admin/settings");
@@ -56,5 +56,5 @@
echo elgg_view("tidypics/admin/help");
break;
}
-?>
+ ?>
</div>
diff --git a/views/default/tidypics/albums.php b/views/default/tidypics/albums.php
index 42ac15afe..a4b2ee906 100644
--- a/views/default/tidypics/albums.php
+++ b/views/default/tidypics/albums.php
@@ -1,51 +1,53 @@
<?php
- //the number of albums to display
- $number = (int)$vars['num_albums'];
- if (!$number)
- $number = 5;
+//the number of albums to display
+$number = (int)$vars['num_albums'];
+if (!$number) {
+ $number = 5;
+}
- $owner = page_owner_entity();
- $owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false);
+$owner = page_owner_entity();
+$owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false);
- echo '<div id="tidypics_album_widget_container">';
+echo '<div id="tidypics_album_widget_container">';
- if ($owner_albums) {
- foreach($owner_albums as $album) {
+if ($owner_albums) {
+ foreach ($owner_albums as $album) {
- if($album->cover)
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>';
- else
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">';
+ if ($album->cover) {
+ $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>';
+ } else {
+ $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">';
+ }
?>
- <div class="tidypics_album_widget_single_item">
- <div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div>
- <div class="tidypics_album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . friendly_time($album->time_created);?></div>
-<?php
+<div class="tidypics_album_widget_single_item">
+ <div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div>
+ <div class="tidypics_album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . friendly_time($album->time_created);?></div>
+ <?php
//get the number of comments
$numcomments = elgg_count_comments($album);
- if ($numcomments)
+ if ($numcomments) {
echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a><br>";
+ }
?>
- <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a>
- </div>
-<?php
- } //end of foreach loop
-
- // bottom link to all group/user albums
- if (is_null($owner->username) || empty($owner->username)) {
- echo '<p class="profile_info_edit_buttons"><a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a></p>';
- } else {
- echo '<p class="tidypics_download"><a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a></p>';
- }
-
+ <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a>
+</div>
+ <?php
+ } //end of foreach loop
+
+ // bottom link to all group/user albums
+ if (is_null($owner->username) || empty($owner->username)) {
+ echo '<p class="profile_info_edit_buttons"><a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a></p>';
+ } else {
+ echo '<p class="tidypics_download"><a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a></p>';
}
- if (can_write_to_container(0, $owner->guid)) {
- echo '<p class="tidypics_download"><a href=' . $CONFIG->wwwroot .'pg/photos/new/' . $owner->username . '>' . elgg_echo("album:create") . '</a></p>';
- }
+}
+
+if (can_write_to_container(0, $owner->guid)) {
+ echo '<p class="tidypics_download"><a href=' . $CONFIG->wwwroot .'pg/photos/new/' . $owner->username . '>' . elgg_echo("album:create") . '</a></p>';
+}
- //close album_widget_container div
- echo "</div>";
-?> \ No newline at end of file
+//close album_widget_container div
+echo "</div>";
diff --git a/views/default/tidypics/breadcrumbs.php b/views/default/tidypics/breadcrumbs.php
index c4d347e6e..e9f491b38 100644
--- a/views/default/tidypics/breadcrumbs.php
+++ b/views/default/tidypics/breadcrumbs.php
@@ -1,22 +1,23 @@
<?php
- $file_guid = $vars['file_guid'];
- $page_owner = page_owner_entity();
+$file_guid = $vars['file_guid'];
+$page_owner = page_owner_entity();
- $first_level_text = '';
- $first_level_link = $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username;
- if (get_loggedin_userid() == $page_owner->guid)
- $first_level_text = elgg_echo('album:yours');
- else
- $first_level_text = sprintf(elgg_echo('album:user'), $page_owner->name);
+$first_level_text = '';
+$first_level_link = $CONFIG->wwwroot . "pg/photos/owned/" . $page_owner->username;
+if (get_loggedin_userid() == $page_owner->guid) {
+ $first_level_text = elgg_echo('album:yours');
+} else {
+ $first_level_text = sprintf(elgg_echo('album:user'), $page_owner->name);
+}
?>
<a href="<?php echo $first_level_link; ?>"><?php echo $first_level_text; ?></a>
<?php
- $second_level_text = '';
- if (isset($vars['album'])) {
- $second_level_text = $vars['album']->title;
- $second_level_link = $vars['album']->getURL();
-?>
+$second_level_text = '';
+if (isset($vars['album'])) {
+ $second_level_text = $vars['album']->title;
+ $second_level_link = $vars['album']->getURL();
+ ?>
>> <a href="<?php echo $second_level_link; ?>"><?php echo $second_level_text; ?></a>
-<?php
- }
-?>
+ <?php
+}
+
diff --git a/views/default/tidypics/exif.php b/views/default/tidypics/exif.php
index 0100ac575..f21e2eff7 100644
--- a/views/default/tidypics/exif.php
+++ b/views/default/tidypics/exif.php
@@ -1,14 +1,14 @@
<?php
- $guid = $vars['guid'];
-
- $exif = tp_exif_formatted($guid);
- if ($exif) {
- echo '<div id="tidypics_exif">';
- foreach ($exif as $name => $value) {
- echo $name . ': ' . $value . '<br />';
- }
- echo '</div>';
+$guid = $vars['guid'];
+
+$exif = tp_exif_formatted($guid);
+if ($exif) {
+ echo '<div id="tidypics_exif">';
+ foreach ($exif as $name => $value) {
+ echo $name . ': ' . $value . '<br />';
}
-
+ echo '</div>';
+}
+
?> \ No newline at end of file
diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php
index 1758d14f4..74d8e85ec 100644
--- a/views/default/tidypics/forms/edit.php
+++ b/views/default/tidypics/forms/edit.php
@@ -1,45 +1,42 @@
<?php
- /**
- * Tidypics images edit/add form
- * This form is used to:
- * - create albums
- * - edit albums
- * - edit images
- */
-
- //set stuff if we are editing existing album or image
- if (isset($vars['entity'])) {
- $action = "tidypics/edit";
- $title = $vars['entity']->title;
- $body = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $subtype = $vars['subtype'];
+/**
+ * Tidypics images edit/add form
+ * This form is used to:
+ * - create albums
+ * - edit albums
+ * - edit images
+ */
+
+//set stuff if we are editing existing album or image
+if (isset($vars['entity'])) {
+ $action = "tidypics/edit";
+ $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 {
- $action = "tidypics/addalbum";
- $tags = "";
- $title = "";
- $body = "";
- if (defined('ACCESS_DEFAULT'))
- $access_id = ACCESS_DEFAULT;
- else
- $access_id = 1; // logged_in by default
- $subtype = 'album';
-
- $title = $_SESSION['tidypicstitle'];
- $body = $_SESSION['tidypicsbody'];
- $tags = $_SESSION['tidypicstags'];
-
- unset($_SESSION['tidypicstitle']);
- unset($_SESSION['tidypicsbody']);
- unset($_SESSION['tidypicstags']);
- }
-
- // group or individual
- $container_guid = page_owner();
+} else {
+ $action = "tidypics/addalbum";
+ $tags = "";
+ $title = "";
+ $body = "";
+ $access_id = ACCESS_DEFAULT;
+ $subtype = 'album';
+
+ $title = $_SESSION['tidypicstitle'];
+ $body = $_SESSION['tidypicsbody'];
+ $tags = $_SESSION['tidypicstags'];
+
+ unset($_SESSION['tidypicstitle']);
+ unset($_SESSION['tidypicsbody']);
+ unset($_SESSION['tidypicstags']);
+}
+
+// group or individual
+$container_guid = page_owner();
?>
<div class="contentWrapper">
@@ -48,79 +45,79 @@
<label><?php echo elgg_echo('album:title'); ?></label>
<?php echo elgg_view("input/text", array("internalname" => "tidypicstitle", "value" => $title,)); ?>
</p>
-<?php
+ <?php
if ($subtype == 'album') {
-?>
+ ?>
<p>
<label><?php echo elgg_echo('album:desc'); ?></label>
- <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,)); ?>
+ <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,)); ?>
</p>
-<?php
+ <?php
} else {
-?>
+ ?>
<p>
<label><?php echo elgg_echo('caption'); ?></label>
- <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,"class" => 'tidypics_caption_input')); ?>
+ <?php echo elgg_view("input/longtext",array("internalname" => "tidypicsbody","value" => $body,"class" => 'tidypics_caption_input')); ?>
</p>
-<?php
- }
-?>
+ <?php
+ }
+ ?>
<p>
<label><?php echo elgg_echo("tags"); ?></label>
<?php echo elgg_view("input/tags", array( "internalname" => "tidypicstags","value" => $tags,)); ?>
</p>
-<?php
+ <?php
if ($subtype == 'image') {
$container_guid = $vars['entity']->container_guid;
-
+
// should this image be the cover for the album - only ask for non-cover photos
// determine if it is already the cover
$img_guid = $vars['entity']->guid;
$album = get_entity($container_guid);
$cover_guid = $album->cover;
-
- if ($cover_guid != $img_guid) {
-
-?>
+
+ if ($cover_guid != $img_guid) {
+
+ ?>
<p>
-<?php echo elgg_view('input/checkboxes', array('internalname' => "cover",
- 'options' => array(elgg_echo("album:cover")),
- ));
-?>
+ <?php echo elgg_view('input/checkboxes', array('internalname' => "cover",
+ 'options' => array(elgg_echo("album:cover")),
+ ));
+ ?>
</p>
-<?php
+ <?php
}
-
+
} else {
// album so display access control
$categories = elgg_view('categories',$vars);
if (!empty($categories)) {
-?>
+ ?>
<p>
- <?php echo $categories; ?>
+ <?php echo $categories; ?>
</p>
-<?php
- }
-?>
- <p>
- <label><?php echo elgg_echo('access'); ?></label>
+ <?php
+ }
+ ?>
+ <p>
+ <label><?php echo elgg_echo('access'); ?></label>
<?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
- </p>
+ </p>
-<?php
+ <?php
}
-
- if (isset($vars['entity'])) {
-?>
- <input type="hidden" name="guid" value="<?php echo $vars['entity']->getGUID(); ?>" />
-<?php
+
+ if (isset($vars['entity'])) {
+ ?>
+ <input type="hidden" name="guid" value="<?php echo $vars['entity']->getGUID(); ?>" />
+ <?php
}
echo elgg_view('input/securitytoken');
-?>
+ ?>
<input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" />
<input type="hidden" name="subtype" value="<?php echo $subtype; ?>" />
<p><input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" /></p>
diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php
index 4031b7968..c16c8eea9 100644
--- a/views/default/tidypics/forms/edit_multi.php
+++ b/views/default/tidypics/forms/edit_multi.php
@@ -1,7 +1,7 @@
<?php
- /**
- * form for mass editing all uploaded images
- */
+/**
+ * form for mass editing all uploaded images
+ */
?>
<div class="contentWrapper">
<form action="<?php echo $vars['url']; ?>action/tidypics/edit_multi" method="post">
@@ -11,9 +11,11 @@
// make sure one of the images becomes the cover if there isn't one already
$album_entity = get_entity($vars['album_guid']);
- if (!$album_entity->cover) $no_cover = true;
+ if (!$album_entity->cover) {
+ $no_cover = true;
+ }
- foreach ($file_array as $key => $file_guid){
+ foreach ($file_array as $key => $file_guid) {
$entity = get_entity($file_guid);
$guid = $entity->guid;
$body = $entity->description;
diff --git a/views/default/tidypics/forms/settings.php b/views/default/tidypics/forms/settings.php
index 0729b536b..e7d05adcc 100644
--- a/views/default/tidypics/forms/settings.php
+++ b/views/default/tidypics/forms/settings.php
@@ -1,158 +1,182 @@
<?php
- /**
- * Tidypics admin settings form
- */
-
-
-
- $action = $vars['url'] . 'action/tidypics/settings';
-
- $plugin = find_plugin_settings('tidypics');
-
-
- // bootstrap the plugin version here for now
- if (!$plugin->version) {
- set_plugin_setting('version', 1.62, 'tidypics');
+/**
+ * Tidypics admin settings form
+ */
+
+
+
+$action = $vars['url'] . 'action/tidypics/settings';
+
+$plugin = find_plugin_settings('tidypics');
+
+
+// bootstrap the plugin version here for now
+if (!$plugin->version) {
+ set_plugin_setting('version', 1.62, 'tidypics');
+}
+
+
+// Main settings
+$form_body = '<h3>' . elgg_echo('tidypics:settings:heading:main') . '</h3>';
+
+// Tagging
+$tagging = $plugin->tagging;
+if (!$tagging) {
+ $tagging = "enabled";
+}
+$form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "</p>";
+
+// Download Link
+$download_link = $plugin->download_link;
+if (!$download_link) {
+ $download_link = "enabled";
+}
+$form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "</p>";
+
+// Ratings
+$photo_ratings = $plugin->photo_ratings;
+if (!$photo_ratings) {
+ $photo_ratings = "disabled";
+}
+$form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:photo_ratings') => 'enabled'), 'internalname' => 'photo_ratings', 'value' => $photo_ratings )) . "</p>";
+
+// Show EXIF
+$exif = $plugin->exif;
+if (!$exif) {
+ $exif = "disabled";
+}
+$form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:exif') => 'enabled'), 'internalname' => 'exif', 'value' => $exif )) . "</p>";
+
+// Show View count
+$view_count = $plugin->view_count;
+if (!$view_count) {
+ $view_count = "enabled";
+}
+$form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "</p>";
+
+// Watermark Text
+$form_body .= "<p>" . elgg_echo('tidypics:settings:watermark') . "<br />";
+$form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "</p>";
+
+// Max Image Size
+$maxfilesize = $plugin->maxfilesize;
+if (!$maxfilesize) {
+ $maxfilesize = (int)5; // 5 MB
+}
+$form_body .= "<p>" . elgg_echo('tidypics:settings:maxfilesize') . "<br />";
+$form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)) . "</p>";
+
+// Quota Size
+$quota = $plugin->quota;
+if (!$quota) {
+ $quota = 0;
+}
+$form_body .= "<p>" . elgg_echo('tidypics:settings:quota') . "<br />";
+$form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "</p>";
+
+// Image Library
+if (extension_loaded('imagick')) {
+ $img_lib_options['ImageMagickPHP'] = 'imagick PHP extension';
+}
+
+$disablefunc = explode(',', ini_get('disable_functions'));
+if (is_callable('exec') && !in_array('exec',$disablefunc)) {
+ $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline';
+}
+
+$img_lib_options['GD'] = 'GD';
+
+$form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:img_lib') . '</h3>';
+$image_lib = $plugin->image_lib;
+if (!$image_lib) {
+ $image_lib = 'GD';
+}
+$form_body .= '<p>' . elgg_echo('tidypics:settings:image_lib') . ': ';
+$form_body .= elgg_view('input/pulldown', array(
+ 'internalname' => 'params[image_lib]',
+ 'options_values' => $img_lib_options,
+ 'value' => $image_lib
+));
+$form_body .= '<br/>Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.</p>';
+
+if (is_callable('exec') && !in_array('exec',$disablefunc)) {
+ // Image Magick Path
+ $im_path = $plugin->im_path;
+ if(!$im_path) {
+ $im_path = "/usr/bin/";
}
-
-
- // Main settings
- $form_body = '<h3>' . elgg_echo('tidypics:settings:heading:main') . '</h3>';
-
- // Tagging
- $tagging = $plugin->tagging;
- if(!$tagging) $tagging = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:tagging') => 'enabled'), 'internalname' => 'tagging', 'value' => $tagging )) . "</p>";
-
- // Download Link
- $download_link = $plugin->download_link;
- if(!$download_link) $download_link = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:download_link') => 'enabled'), 'internalname' => 'download_link', 'value' => $download_link )) . "</p>";
-
- // Ratings
- $photo_ratings = $plugin->photo_ratings;
- if(!$photo_ratings) $photo_ratings = "disabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:photo_ratings') => 'enabled'), 'internalname' => 'photo_ratings', 'value' => $photo_ratings )) . "</p>";
-
- // Show EXIF
- $exif = $plugin->exif;
- if(!$exif) $exif = "disabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:exif') => 'enabled'), 'internalname' => 'exif', 'value' => $exif )) . "</p>";
-
- // Show View count
- $view_count = $plugin->view_count;
- if(!$view_count) $view_count = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:view_count') => 'enabled'), 'internalname' => 'view_count', 'value' => $view_count )) . "</p>";
-
- // Watermark Text
- $form_body .= "<p>" . elgg_echo('tidypics:settings:watermark') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[watermark_text]', 'value' => $plugin->watermark_text)) . "</p>";
-
- // Max Image Size
- $maxfilesize = $plugin->maxfilesize;
- if (!$maxfilesize) $maxfilesize = (int)5; // 5 MB
- $form_body .= "<p>" . elgg_echo('tidypics:settings:maxfilesize') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[maxfilesize]', 'value' => $maxfilesize)) . "</p>";
-
- // Quota Size
- $quota = $plugin->quota;
- if (!$quota) $quota = 0;
- $form_body .= "<p>" . elgg_echo('tidypics:settings:quota') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[quota]', 'value' => $quota)) . "</p>";
-
- // Image Library
- if (extension_loaded('imagick')) {
- $img_lib_options['ImageMagickPHP'] = 'imagick PHP extension';
- }
-
- $disablefunc = explode(',', ini_get('disable_functions'));
- if (is_callable('exec') && !in_array('exec',$disablefunc)) {
- $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline';
- }
-
- $img_lib_options['GD'] = 'GD';
-
- $form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:img_lib') . '</h3>';
- $image_lib = $plugin->image_lib;
- if (!$image_lib) $image_lib = 'GD';
- $form_body .= '<p>' . elgg_echo('tidypics:settings:image_lib') . ': ';
- $form_body .= elgg_view('input/pulldown', array(
- 'internalname' => 'params[image_lib]',
- 'options_values' => $img_lib_options,
- 'value' => $image_lib
- ));
- $form_body .= '<br/>Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.</p>';
-
- if (is_callable('exec') && !in_array('exec',$disablefunc)) {
- // Image Magick Path
- $im_path = $plugin->im_path;
- if(!$im_path) $im_path = "/usr/bin/";
- $form_body .= "<p>" . elgg_echo('tidypics:settings:im_path') . "<br />";
- $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>";
- }
-
-
- // River Image options
- $form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:river') . '</h3>';
- $img_river_view = $plugin->img_river_view;
- if (!$img_river_view) $img_river_view = '1';
- $form_body .= '<p>' . elgg_echo('tidypics:settings:img_river_view');
- $form_body .= elgg_view('input/pulldown', array(
- 'internalname' => 'params[img_river_view]',
- 'options_values' => array(
- 'all' => 'all',
- '1' => '1',
- 'none' => 'none',
- ),
- 'value' => $img_river_view
- ));
- $form_body .= '</p>';
-
- // River Album options
- $album_river_view = $plugin->album_river_view;
- if (!$album_river_view) $album_river_view = 'set';
- $form_body .= '<p>' . elgg_echo('tidypics:settings:album_river_view');
- $form_body .= elgg_view('input/pulldown', array(
- 'internalname' => 'params[album_river_view]',
- 'options_values' => array(
- 'cover' => 'cover',
- 'set' => 'set',
- ),
- 'value' => $album_river_view
- ));
- $form_body .= '</p>';
-
- // Thumbnail sizes
- $form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:sizes') . '</h3>';
- $form_body .= "<h6>You must edit the css if you change the default sizes</h6>";
- $image_sizes = $plugin->image_sizes;
- if(!$image_sizes) {
- $image_sizes = array(); // set default values
- $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600;
- $image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153;
- $image_sizes['thumb_image_width'] = $image_sizes['thumb_image_height'] = 60;
- } else {
- $image_sizes = unserialize($image_sizes);
- }
- $form_body .= "<p>" . elgg_echo('tidypics:settings:largesize') . "<br />";
- $form_body .= 'width: <input style="width: 20%;" type="text" name="large_thumb_width" value=' . "\"{$image_sizes['large_image_width']}\"" . ' class="input-text" />&nbsp;&nbsp;&nbsp;';
- $form_body .= 'height: <input style="width: 20%;" type="text" name="large_thumb_height" value=' . "\"{$image_sizes['large_image_height']}\"" . ' class="input-text" /></p>';
-
- $form_body .= "<p>" . elgg_echo('tidypics:settings:smallsize') . "<br />";
- $form_body .= 'width and height: <input style="width: 20%;" type="text" name="small_thumb_width" value=' . "\"{$image_sizes['small_image_width']}\"" . ' class="input-text" />&nbsp;&nbsp;&nbsp;';
- //$form_body .= 'height: <input style="width: 20%;" type="text" name="small_thumb_height" value=' . "\"{$image_sizes['small_image_height']}\"" . ' class="input-text" /></p>';
-
- $form_body .= "<p>" . elgg_echo('tidypics:settings:thumbsize') . "<br />";
- $form_body .= 'width and height: <input style="width: 20%;" type="text" name="thumb_width" value=' . "\"{$image_sizes['thumb_image_width']}\"" . ' class="input-text" />&nbsp;&nbsp;&nbsp;';
- //$form_body .= 'height: <input style="width: 20%;" type="text" name="thumb_height" value=' . "\"{$image_sizes['thumb_image_height']}\"" . ' class="input-text" /></p>';
-
-
- // Group permission override
- $form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:groups') . '</h3>';
- $grp_perm_override = $plugin->grp_perm_override;
- if(!$grp_perm_override) $grp_perm_override = "enabled";
- $form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "</p>";
-
- $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
-
- echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
+ $form_body .= "<p>" . elgg_echo('tidypics:settings:im_path') . "<br />";
+ $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>";
+}
+
+
+// River Image options
+$form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:river') . '</h3>';
+$img_river_view = $plugin->img_river_view;
+if (!$img_river_view) {
+ $img_river_view = '1';
+}
+$form_body .= '<p>' . elgg_echo('tidypics:settings:img_river_view');
+$form_body .= elgg_view('input/pulldown', array(
+ 'internalname' => 'params[img_river_view]',
+ 'options_values' => array(
+ 'all' => 'all',
+ '1' => '1',
+ 'none' => 'none',
+ ),
+ 'value' => $img_river_view
+));
+$form_body .= '</p>';
+
+// River Album options
+$album_river_view = $plugin->album_river_view;
+if (!$album_river_view) {
+ $album_river_view = 'set';
+}
+$form_body .= '<p>' . elgg_echo('tidypics:settings:album_river_view');
+$form_body .= elgg_view('input/pulldown', array(
+ 'internalname' => 'params[album_river_view]',
+ 'options_values' => array(
+ 'cover' => 'cover',
+ 'set' => 'set',
+ ),
+ 'value' => $album_river_view
+));
+$form_body .= '</p>';
+
+// Thumbnail sizes
+$form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:sizes') . '</h3>';
+$form_body .= "<h6>You must edit the css if you change the default sizes</h6>";
+$image_sizes = $plugin->image_sizes;
+if(!$image_sizes) {
+ $image_sizes = array(); // set default values
+ $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600;
+ $image_sizes['small_image_width'] = $image_sizes['small_image_height'] = 153;
+ $image_sizes['thumb_image_width'] = $image_sizes['thumb_image_height'] = 60;
+} else {
+ $image_sizes = unserialize($image_sizes);
+}
+$form_body .= "<p>" . elgg_echo('tidypics:settings:largesize') . "<br />";
+$form_body .= 'width: <input style="width: 20%;" type="text" name="large_thumb_width" value=' . "\"{$image_sizes['large_image_width']}\"" . ' class="input-text" />&nbsp;&nbsp;&nbsp;';
+$form_body .= 'height: <input style="width: 20%;" type="text" name="large_thumb_height" value=' . "\"{$image_sizes['large_image_height']}\"" . ' class="input-text" /></p>';
+
+$form_body .= "<p>" . elgg_echo('tidypics:settings:smallsize') . "<br />";
+$form_body .= 'width and height: <input style="width: 20%;" type="text" name="small_thumb_width" value=' . "\"{$image_sizes['small_image_width']}\"" . ' class="input-text" />&nbsp;&nbsp;&nbsp;';
+//$form_body .= 'height: <input style="width: 20%;" type="text" name="small_thumb_height" value=' . "\"{$image_sizes['small_image_height']}\"" . ' class="input-text" /></p>';
+
+$form_body .= "<p>" . elgg_echo('tidypics:settings:thumbsize') . "<br />";
+$form_body .= 'width and height: <input style="width: 20%;" type="text" name="thumb_width" value=' . "\"{$image_sizes['thumb_image_width']}\"" . ' class="input-text" />&nbsp;&nbsp;&nbsp;';
+//$form_body .= 'height: <input style="width: 20%;" type="text" name="thumb_height" value=' . "\"{$image_sizes['thumb_image_height']}\"" . ' class="input-text" /></p>';
+
+
+// Group permission override
+$form_body .= '<h3>' . elgg_echo('tidypics:settings:heading:groups') . '</h3>';
+$grp_perm_override = $plugin->grp_perm_override;
+if (!$grp_perm_override) {
+ $grp_perm_override = "enabled";
+}
+$form_body .= '<p class="admin_debug">' . elgg_view("input/checkboxes", array('options' => array(elgg_echo('tidypics:settings:grp_perm_override') => 'enabled'), 'internalname' => 'grp_perm_override', 'value' => $grp_perm_override )) . "</p>";
+
+$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
+
+echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
diff --git a/views/default/tidypics/forms/setupFlickr.php b/views/default/tidypics/forms/setupFlickr.php
index 8c31d0883..3a9c76d11 100644
--- a/views/default/tidypics/forms/setupFlickr.php
+++ b/views/default/tidypics/forms/setupFlickr.php
@@ -39,4 +39,3 @@ $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
flickr_menu();
echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
-?> \ No newline at end of file
diff --git a/views/default/tidypics/forms/upload.php b/views/default/tidypics/forms/upload.php
index 6e755612c..691d9701b 100644
--- a/views/default/tidypics/forms/upload.php
+++ b/views/default/tidypics/forms/upload.php
@@ -1,78 +1,83 @@
<?php
- global $CONFIG;
-
- //this is for image uploads only. Image edits are handled by edit.php form
-
- $container_guid = get_input('container_guid');
- $album = get_entity($vars['album']);
- $access_id = $album->access_id;
+global $CONFIG;
- $maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics');
- if (!$maxfilesize)
- $maxfilesize = 5;
-
- $quota = get_plugin_setting('quota','tidypics');
- if ($quota) {
- $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size");
- $image_repo_size = (int)$image_repo_size_md->value;
- $image_repo_size = $image_repo_size / 1024 / 1024;
- $quote_percentage = round(100 * ($image_repo_size / $quota));
- // for small quotas, so one decimal place
- if ($quota < 10) {
- $image_repo_size = sprintf('%.1f', $image_repo_size);
- } else {
- $image_repo_size = round($image_repo_size);
- }
- if ($image_repo_size > $quota) {
- $image_repo_size = $quota;
- }
+//this is for image uploads only. Image edits are handled by edit.php form
+
+$container_guid = get_input('container_guid');
+$album = get_entity($vars['album']);
+$access_id = $album->access_id;
+
+$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics');
+if (!$maxfilesize) {
+ $maxfilesize = 5;
+}
+
+$quota = get_plugin_setting('quota','tidypics');
+if ($quota) {
+ $image_repo_size_md = get_metadata_byname($album->container_guid, "image_repo_size");
+ $image_repo_size = (int)$image_repo_size_md->value;
+ $image_repo_size = $image_repo_size / 1024 / 1024;
+ $quote_percentage = round(100 * ($image_repo_size / $quota));
+ // for small quotas, so one decimal place
+ if ($quota < 10) {
+ $image_repo_size = sprintf('%.1f', $image_repo_size);
+ } else {
+ $image_repo_size = round($image_repo_size);
+ }
+ if ($image_repo_size > $quota) {
+ $image_repo_size = $quota;
}
+}
?>
<div id="tidypics_ref"></div>
<div class="contentWrapper">
-<?php
+ <?php
ob_start();
-?>
-<p style="line-height:1.6em;">
- <label><?php echo elgg_echo("images:upload"); ?></label><br />
- <i><?php echo elgg_echo("tidypics:settings:maxfilesize") . ' ' . $maxfilesize; ?></i><br />
-<?php
- if ($quota) {
-?>
- <i><?php echo elgg_echo("tidypics:quota") . ' ' . $image_repo_size . '/' . $quota . " MB ({$quote_percentage}%)"; ?></i><br />
-<?php
- }
-?>
+ ?>
+ <p style="line-height:1.6em;">
+ <label><?php echo elgg_echo("images:upload"); ?></label><br />
+ <i><?php echo elgg_echo("tidypics:settings:maxfilesize") . ' ' . $maxfilesize; ?></i><br />
+ <?php
+ if ($quota) {
+ ?>
+ <i><?php echo elgg_echo("tidypics:quota") . ' ' . $image_repo_size . '/' . $quota . " MB ({$quote_percentage}%)"; ?></i><br />
+ <?php
+ }
+ ?>
<div class="tidypics_popup">
- <?php echo elgg_echo("tidypics:uploading:images"); ?><br />
+ <?php echo elgg_echo("tidypics:uploading:images"); ?><br />
<div style="margin:20px 0px 20px 80px;"><img id="progress" alt="..." border="0" src="<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>" /></div>
</div>
<ol id="tidypics_image_upload_list">
-<?php
+ <?php
for ($x = 0; $x < 10; $x++) {
echo '<li>' . elgg_view("input/file",array('internalname' => "upload_$x")) . '</li>';
- }
-?>
+ }
+ ?>
</ol>
</p>
<p>
-<?php
- if ($container_guid)
- echo '<input type="hidden" name="container_guid" value="' . $container_guid . '" />';
- if ($access_id)
- echo '<input type="hidden" name="access_id" value="' . $access_id . '" />';
-?>
+ <?php
+ if ($container_guid) {
+ echo '<input type="hidden" name="container_guid" value="' . $container_guid . '" />';
+ }
+ if ($access_id) {
+ echo '<input type="hidden" name="access_id" value="' . $access_id . '" />';
+ }
+ ?>
<input type="submit" value="<?php echo elgg_echo("save"); ?>" onclick="displayProgress();" />
</p>
<?php
- $form_body = ob_get_clean();
-
- echo elgg_view('input/form', array( 'action' => "{$vars['url']}action/tidypics/upload",
- 'body' => $form_body,
- 'internalid' => 'tidypicsUpload',
- 'enctype' => 'multipart/form-data',
- 'method' => 'post',));
+$form_body = ob_get_clean();
+
+echo elgg_view('input/form', array(
+ 'action' => "{$vars['url']}action/tidypics/upload",
+ 'body' => $form_body,
+ 'internalid' => 'tidypicsUpload',
+ 'enctype' => 'multipart/form-data',
+ 'method' => 'post',)
+);
?>
</div>
<script type="text/javascript">
@@ -81,11 +86,11 @@
{
offsetY = 60;
offsetX = 120;
-
+
divWidth = $('#tidypics_ref').width();
imgOffset = $('#tidypics_ref').offset();
imgWidth = $('#tidypics_ref').width();
-
+
_top = imgOffset.top + offsetY;
_left = imgOffset.left + offsetX;
@@ -93,7 +98,7 @@
"top": _top + "px",
"left": _left + "px"
});
-
- setTimeout('document.images["progress"].src = "<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>"', 200);
+
+ setTimeout('document.images["progress"].src = "<?php echo $vars['url'].'mod/tidypics/graphics/loader.gif' ?>"', 200);
}
</script> \ No newline at end of file
diff --git a/views/default/tidypics/groupprofile_albums.php b/views/default/tidypics/groupprofile_albums.php
index 7cb89bf1c..85b32425e 100644
--- a/views/default/tidypics/groupprofile_albums.php
+++ b/views/default/tidypics/groupprofile_albums.php
@@ -15,4 +15,3 @@ if ($vars['entity']->photos_enable != 'no') {
echo elgg_view('tidypics/albums', array('num_albums' => 5));
echo '</div>';
}
-?> \ No newline at end of file
diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php
index 498cfe724..50ada2193 100644
--- a/views/default/tidypics/image_menu.php
+++ b/views/default/tidypics/image_menu.php
@@ -1,51 +1,50 @@
<?php
- /**************************************************************************
- *
- * Tidypics Image Menu
- *
- * This is the menu that appears below an image. Admins can override the
- * menu with a different view to provide a look and feel that matches
- * their themes. The view can be extended to provide additional controls.
- *
- **************************************************************************/
-
- $image_guid = $vars['image_guid'];
- $viewer = $vars['viewer'];
- $owner = $vars['owner'];
- $anytags = $vars['anytags'];
- $album = $vars['album'];
-
- if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
-
- $can_tag = false;
-
- $container = get_entity($album->container_guid);
- if ($container instanceof ElggGroup) {
- $can_tag = $viewer && $container->isMember($viewer);
- } else {
- $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
- }
-
- // only owner and friends of owner can tag
- if ($can_tag) {
+/**************************************************************************
+ *
+ * Tidypics Image Menu
+ *
+ * This is the menu that appears below an image. Admins can override the
+ * menu with a different view to provide a look and feel that matches
+ * their themes. The view can be extended to provide additional controls.
+ *
+ **************************************************************************/
+
+$image_guid = $vars['image_guid'];
+$viewer = $vars['viewer'];
+$owner = $vars['owner'];
+$anytags = $vars['anytags'];
+$album = $vars['album'];
+
+if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+
+ $can_tag = false;
+
+ $container = get_entity($album->container_guid);
+ if ($container instanceof ElggGroup) {
+ $can_tag = $viewer && $container->isMember($viewer);
+ } else {
+ $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
+ }
+
+ // only owner and friends of owner can tag
+ if ($can_tag) {
?>
<li id="start_tagging"><a id="tidypics_tag_control" href="javascript:void(0)" onclick="startTagging()"><?php echo elgg_echo('tidypics:tagthisphoto'); ?></a></li>
<?php
- }
-
- // only owner can delete tags
- if ($anytags && $viewer && $viewer->guid == $owner->guid) {
+ }
+
+ // only owner can delete tags
+ if ($anytags && $viewer && $viewer->guid == $owner->guid) {
?>
<li id="delete_tags"><a href="javascript:void(0)" onclick="deleteTags()"><?php echo elgg_echo('tidypics:deletetag'); ?></a></li>
<?php
- }
}
-
- if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
- $download_url = $vars['url'] . "pg/photos/download/{$image_guid}/";
+}
+
+if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
+ $download_url = $vars['url'] . "pg/photos/download/{$image_guid}/";
?>
<li id="download_image"><a href="<?php echo $download_url; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
<?php
- }
-?> \ No newline at end of file
+}
diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php
index 251534b80..2993fe71b 100644
--- a/views/default/tidypics/tagging.php
+++ b/views/default/tidypics/tagging.php
@@ -1,32 +1,32 @@
<?php
- $image = $vars['image'];
- $viewer = $vars['viewer'];
- $owner = $vars['owner'];
+$image = $vars['image'];
+$viewer = $vars['viewer'];
+$owner = $vars['owner'];
- // get photo tags
- $tag_info = $image->getPhotoTags();
+// get photo tags
+$tag_info = $image->getPhotoTags();
- // defining json text as "" makes sure the tagging javascript code doesn't throw errors if no tags
- $photo_tags_json = "\"\"";
- if ($tag_info) {
- $photo_tags_json = $tag_info['json'];
- }
-
- if ($tag_info) {
+// defining json text as "" makes sure the tagging javascript code doesn't throw errors if no tags
+$photo_tags_json = "\"\"";
+if ($tag_info) {
+ $photo_tags_json = $tag_info['json'];
+}
+
+if ($tag_info) {
?>
<div id="tidypics_phototags_list">
<h3><?php echo elgg_echo('tidypics:inthisphoto') ?></h3>
<ul>
<?php
- foreach ($tag_info['links'] as $id=>$link) {
- echo "<li><a class='tidypics_phototag_links' id='taglink{$id}' href='{$link['url']}'>{$link['text']}</a></li>";
- }
+ foreach ($tag_info['links'] as $id=>$link) {
+ echo "<li><a class='tidypics_phototag_links' id='taglink{$id}' href='{$link['url']}'>{$link['text']}</a></li>";
+ }
?>
</ul>
</div>
<?php
- }
+}
?>
<div id='tidypics_tag_instructions'>
<div id='tidypics_tag_instruct_text'><?php echo elgg_echo('tidypics:taginstruct'); ?></div>
@@ -34,10 +34,10 @@
</div>
<div id="tidypics_tag_menu" class="tidypics_popup">
<div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:tagthisphoto'); ?></h3></div>
-<?php
+ <?php
if ($viewer) {
-
+
$people_list = tp_get_tag_list($viewer);
$content = "<div id='tidypics_tagmenu_left'>";
@@ -45,30 +45,30 @@
$content .= "<input type='hidden' name='coordinates' id='coordinates' value='' />";
$content .= "<input type='hidden' name='user_id' id='user_id' value='' />";
$content .= "<input type='hidden' name='word' id='word' value='' />";
-
+
$content .= "<ul id='tidypics_phototag_list'>";
$content .= "<li><a href='javascript:void(0)' onclick='selectUser({$viewer->getGUID()},\"{$viewer->name}\")'> {$viewer->name} (" . elgg_echo('me') . ")</a></li>";
-
+
if ($people_list) {
foreach($people_list as $friend_guid => $friend_name) {
$content .= "<li><a href='javascript:void(0)' onclick='selectUser({$friend_guid}, \"{$friend_name}\")'>{$friend_name}</a></li>";
}
}
-
+
$content .= "</ul></div>";
-
+
$content .= "<div id='tidypics_tagmenu_right'><input type='submit' value='" . elgg_echo('tidypics:actiontag') . "' class='submit_button' /></div>";
-
+
echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'tidypics_phototag_form', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/addtag", 'method' => 'post', 'body' => $content));
}
-?>
-<div class="clearfloat"></div>
+ ?>
+ <div class="clearfloat"></div>
</div>
<div id="tidypics_delete_tag_menu" class="tidypics_popup">
<div class='tidypics_popup_header'><h3><?php echo elgg_echo('tidypics:deltag_title'); ?></h3></div>
-<?php
+ <?php
if ($tag_info) {
$content = "<input type='hidden' name='image_guid' value='{$image->guid}' />";
foreach ($tag_info['links'] as $id => $link) {
@@ -77,7 +77,7 @@
}
$content .= "<input type='submit' value='" . elgg_echo('tidypics:actiondelete') . "' class='submit_button' />";
- $content .= "<input type='button' value='" . elgg_echo('cancel') . "' class='cancel_button' onclick='hideDeleteMenu();' />";
+ $content .= "<input type='button' value='" . elgg_echo('cancel') . "' class='cancel_button' onclick='hideDeleteMenu();' />";
echo elgg_view('input/form', array('internalname' => 'phototag_deletetag_form', 'action' => "{$vars['url']}action/tidypics/deletetag", 'method' => 'post', 'body' => $content));
@@ -85,5 +85,4 @@
?>
</div>
<?php
- echo elgg_view('tidypics/js/tagging', array('photo_tags_json' => $photo_tags_json,) );
-?> \ No newline at end of file
+echo elgg_view('tidypics/js/tagging', array('photo_tags_json' => $photo_tags_json,) );
diff --git a/views/default/widgets/album_view/edit.php b/views/default/widgets/album_view/edit.php
index 992699cb0..9068ffe17 100644
--- a/views/default/widgets/album_view/edit.php
+++ b/views/default/widgets/album_view/edit.php
@@ -1,11 +1,12 @@
<p>
<?php
- echo elgg_echo("tidypics:widget:num_albums") . ": ";
-
-
- if($vars['entity']->num_display == '') $vars['entity']->num_display = 5;
-
+echo elgg_echo("tidypics:widget:num_albums") . ": ";
+
+
+if ($vars['entity']->num_display == '') {
+ $vars['entity']->num_display = 5;
+}
?>
<select name="params[num_display]">
<option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
diff --git a/views/default/widgets/album_view/view.php b/views/default/widgets/album_view/view.php
index b4248df35..1b980aa8b 100644
--- a/views/default/widgets/album_view/view.php
+++ b/views/default/widgets/album_view/view.php
@@ -1,13 +1,14 @@
<div class="contentWrapper">
<?php
- //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;
+//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;
+}
- echo elgg_view('tidypics/albums', array('num_albums' => $number));
+echo elgg_view('tidypics/albums', array('num_albums' => $number));
?>
</div> \ No newline at end of file
diff --git a/views/default/widgets/latest_photos/edit.php b/views/default/widgets/latest_photos/edit.php
index 3b334d722..06693648d 100644
--- a/views/default/widgets/latest_photos/edit.php
+++ b/views/default/widgets/latest_photos/edit.php
@@ -1,9 +1,11 @@
<p>
<?php
- echo elgg_echo("tidypics:widget:num_latest") . ": ";
+echo elgg_echo("tidypics:widget:num_latest") . ": ";
+
+if ($vars['entity']->num_display == '') {
+ $vars['entity']->num_display = 6;
+}
- if($vars['entity']->num_display == '') $vars['entity']->num_display = 6;
-
?>
<select name="params[num_display]">
<option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
diff --git a/views/default/widgets/latest_photos/view.php b/views/default/widgets/latest_photos/view.php
index 0c3193907..d6bc4a0df 100644
--- a/views/default/widgets/latest_photos/view.php
+++ b/views/default/widgets/latest_photos/view.php
@@ -1,15 +1,16 @@
<div class="contentWrapper">
<?php
- //the number of files to display
- $number = (int) $vars['entity']->num_display;
- //if no number has been set, default to 6
- if (!$number)
- $number = 6;
+//the number of files to display
+$number = (int) $vars['entity']->num_display;
+//if no number has been set, default to 6
+if (!$number) {
+ $number = 6;
+}
- echo '<div class="tidypics_widget_latest">';
- echo tp_get_latest_photos($number, page_owner());
- echo '</div>';
+echo '<div class="tidypics_widget_latest">';
+echo tp_get_latest_photos($number, page_owner());
+echo '</div>';
?>
</div> \ No newline at end of file