diff options
Diffstat (limited to 'mod/pages/views')
-rw-r--r-- | mod/pages/views/default/widgets/pages/edit.php | 24 | ||||
-rw-r--r-- | mod/pages/views/default/widgets/pages/view.php | 12 |
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 |