aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/latest_photos
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-09-28 22:10:29 +0000
committerCash Costello <cash.costello@gmail.com>2009-09-28 22:10:29 +0000
commit69bbb4d1ca761998263c4aca5e65d6cc0fa7303b (patch)
tree9462a62cf646fa10953985254be11fd61ea22207 /views/default/widgets/latest_photos
parentc2441c3ed8d725902b262e35eb4671450b64f04d (diff)
downloadelgg-69bbb4d1ca761998263c4aca5e65d6cc0fa7303b.tar.gz
elgg-69bbb4d1ca761998263c4aca5e65d6cc0fa7303b.tar.bz2
latest was a horrible name for a widget - what was I thinking? - now I need to add an upgrade script
Diffstat (limited to 'views/default/widgets/latest_photos')
-rw-r--r--views/default/widgets/latest_photos/edit.php15
-rw-r--r--views/default/widgets/latest_photos/view.php15
2 files changed, 30 insertions, 0 deletions
diff --git a/views/default/widgets/latest_photos/edit.php b/views/default/widgets/latest_photos/edit.php
new file mode 100644
index 000000000..15a56af82
--- /dev/null
+++ b/views/default/widgets/latest_photos/edit.php
@@ -0,0 +1,15 @@
+<p>
+<?php
+ echo elgg_echo("tidypics:widget:num_latest") . ": ";
+
+ 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>
+ <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
diff --git a/views/default/widgets/latest_photos/view.php b/views/default/widgets/latest_photos/view.php
new file mode 100644
index 000000000..0c3193907
--- /dev/null
+++ b/views/default/widgets/latest_photos/view.php
@@ -0,0 +1,15 @@
+<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());
+ echo '</div>';
+
+?>
+</div> \ No newline at end of file