aboutsummaryrefslogtreecommitdiff
path: root/mod/pages/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
commit36ef345eb6425106f061fb866d9fa66d051e16df (patch)
tree53fb2bd05f8b5e2010f9e3d1e93075ad7071ec1e /mod/pages/views
parent5571ca5b350fd1735f13af7ddfbb88afa6befb0c (diff)
downloadelgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.gz
elgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.bz2
Merged 5530:5604 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5622 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/views')
-rw-r--r--mod/pages/views/default/widgets/pages/edit.php24
-rw-r--r--mod/pages/views/default/widgets/pages/view.php12
2 files changed, 29 insertions, 7 deletions
diff --git a/mod/pages/views/default/widgets/pages/edit.php b/mod/pages/views/default/widgets/pages/edit.php
index 8fb2511f7..9504d5fdb 100644
--- a/mod/pages/views/default/widgets/pages/edit.php
+++ b/mod/pages/views/default/widgets/pages/edit.php
@@ -10,8 +10,24 @@
* @link http://elgg.com/
*/
+if (!isset($vars['entity']->pages_num)) {
+ $vars['entity']->pages_num = 4;
+}
+
+?>
+<p>
+ <?php echo elgg_echo("pages:num"); ?>:
+ <select name="params[pages_num]">
+<?php
+
+for ($i=1; $i<=10; $i++) {
+ $selected = '';
+ if ($vars['entity']->pages_num == $i) {
+ $selected = "selected='selected'";
+ }
+
+ echo " <option value='{$i}' $selected >{$i}</option>\n";
+}
?>
- <p>
- <?php echo elgg_echo("pages:num"); ?>
- <input type="text" name="params[pages_num]" value="<?php echo htmlentities($vars['entity']->pages_num); ?>" />
- </p> \ No newline at end of file
+ </select>
+</p> \ No newline at end of file
diff --git a/mod/pages/views/default/widgets/pages/view.php b/mod/pages/views/default/widgets/pages/view.php
index 2ca32b284..425e4f501 100644
--- a/mod/pages/views/default/widgets/pages/view.php
+++ b/mod/pages/views/default/widgets/pages/view.php
@@ -16,11 +16,17 @@
*/
$num_display = (int) $vars['entity']->pages_num;
+ if (!$num_display) {
+ $num_display = 4;
+ }
$pages = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => page_owner(), 'limit' => $num_display, 'full_view' => FALSE));
- $pagesurl = $vars['url'] . "pg/pages/owned/" . page_owner_entity()->username;
- $pages .= "<div class=\"pages_widget_singleitem_more\"><a href=\"{$pagesurl}\">" . elgg_echo('pages:more') . "</a></div>";
-
+
+ if ($pages) {
+ $pagesurl = $vars['url'] . "pg/pages/owned/" . page_owner_entity()->username;
+ $pages .= "<div class=\"pages_widget_singleitem_more\"><a href=\"{$pagesurl}\">" . elgg_echo('pages:more') . "</a></div>";
+ }
+
echo "<div id=\"pages_widget\">" . $pages . "</div>";
?> \ No newline at end of file