aboutsummaryrefslogtreecommitdiff
path: root/mod/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/pages')
-rw-r--r--mod/pages/index.php3
-rw-r--r--mod/pages/views/default/widgets/pages/edit.php24
-rw-r--r--mod/pages/views/default/widgets/pages/view.php12
3 files changed, 31 insertions, 8 deletions
diff --git a/mod/pages/index.php b/mod/pages/index.php
index 5b31c6347..ad8aaaad2 100644
--- a/mod/pages/index.php
+++ b/mod/pages/index.php
@@ -24,7 +24,8 @@
if ($owner instanceof ElggUser) add_submenu_item(elgg_echo('pages:welcome'), $CONFIG->url . "pg/pages/welcome/", 'pagesactions');
}
- if (is_callable('group_gatekeeper')) group_gatekeeper();
+ // access check for closed groups
+ group_gatekeeper();
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
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