aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/latest_photos
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/widgets/latest_photos')
-rw-r--r--views/default/widgets/latest_photos/content.php15
-rw-r--r--views/default/widgets/latest_photos/edit.php29
-rw-r--r--views/default/widgets/latest_photos/view.php16
3 files changed, 32 insertions, 28 deletions
diff --git a/views/default/widgets/latest_photos/content.php b/views/default/widgets/latest_photos/content.php
new file mode 100644
index 000000000..ecd72aec4
--- /dev/null
+++ b/views/default/widgets/latest_photos/content.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Display the latest photos uploaded by an individual
+ */
+
+echo elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'image',
+ 'limit' => $vars['entity']->num_display,
+ 'owner_guid' => elgg_get_page_owner_guid(),
+ 'full_view' => false,
+ 'list_type' => 'gallery',
+ 'list_type_toggle' => false,
+ 'gallery_class' => 'tidypics-gallery-widget',
+));
diff --git a/views/default/widgets/latest_photos/edit.php b/views/default/widgets/latest_photos/edit.php
index 06693648d..ac870c9f8 100644
--- a/views/default/widgets/latest_photos/edit.php
+++ b/views/default/widgets/latest_photos/edit.php
@@ -1,17 +1,22 @@
-<p>
-<?php
-echo elgg_echo("tidypics:widget:num_latest") . ": ";
+<?php
+/**
+ * Widget settings for latest photos
+ */
-if ($vars['entity']->num_display == '') {
+// set default value
+if (!isset($vars['entity']->num_display)) {
$vars['entity']->num_display = 6;
}
+$params = array(
+ 'name' => 'params[num_display]',
+ 'value' => $vars['entity']->num_display,
+ 'options' => array(3, 6, 9, 12),
+);
+$dropdown = elgg_view('input/dropdown', $params);
+
?>
- <select name="params[num_display]">
- <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
- <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
- <option value="12" <?php if($vars['entity']->num_display == 12) echo "SELECTED"; ?>>12</option>
- <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>
- <option value="18" <?php if($vars['entity']->num_display == 18) echo "SELECTED"; ?>>18</option>
- </select>
-</p> \ No newline at end of file
+<div>
+ <?php echo elgg_echo('tidypics:widget:num_latest'); ?>:
+ <?php echo $dropdown; ?>
+</div>
diff --git a/views/default/widgets/latest_photos/view.php b/views/default/widgets/latest_photos/view.php
deleted file mode 100644
index 108d070c9..000000000
--- a/views/default/widgets/latest_photos/view.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<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;
-}
-
-echo '<div class="tidypics_widget_latest">';
-echo tp_get_latest_photos($number, page_owner(), 'widget');
-echo '</div>';
-
-?>
-</div> \ No newline at end of file