diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 16:36:30 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 16:36:30 +0000 |
commit | af5b59b518123a15a7182ebfe2487a9e10f67ee8 (patch) | |
tree | 4fcb24176b2b445acee48869aa816813f03352b6 /mod/pages/views/default/widgets | |
parent | 186f5474e37f9ebde09b9afe2c82fa711402b421 (diff) | |
download | elgg-af5b59b518123a15a7182ebfe2487a9e10f67ee8.tar.gz elgg-af5b59b518123a15a7182ebfe2487a9e10f67ee8.tar.bz2 |
more clean up of the pages plugin to use new HTML/CSS
git-svn-id: http://code.elgg.org/elgg/trunk@7898 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/views/default/widgets')
-rw-r--r-- | mod/pages/views/default/widgets/pages/content.php | 38 | ||||
-rw-r--r-- | mod/pages/views/default/widgets/pages/edit.php | 24 |
2 files changed, 31 insertions, 31 deletions
diff --git a/mod/pages/views/default/widgets/pages/content.php b/mod/pages/views/default/widgets/pages/content.php index f42a1a85f..63a2d8e7e 100644 --- a/mod/pages/views/default/widgets/pages/content.php +++ b/mod/pages/views/default/widgets/pages/content.php @@ -1,27 +1,31 @@ -<style type="text/css"> -#pages_widget .pagination { - display:none; -} -</style> <?php - /** - * Elgg pages widget edit + * Elgg pages widget * * @package ElggPages */ -$num_display = (int) $vars['entity']->pages_num; +$num = (int) $vars['entity']->pages_num; -if (!$num_display) { - $num_display = 4; -} +$options = array( + 'type' => 'object', + 'subtype' => 'page_top', + 'container_guid' => $vars['entity']->owner_guid, + 'limit' => $num, + 'full_view' => FALSE, + 'pagination' => FALSE, +); +$content = elgg_list_entities($options); -$pages = elgg_list_entities(array('types' => 'object', 'subtypes' => 'page_top', 'container_guid' => elgg_get_page_owner_guid(), 'limit' => $num_display, 'full_view' => FALSE)); +echo $content; -if ($pages) { - $pagesurl = elgg_get_site_url() . "pg/pages/owned/" . elgg_get_page_owner()->username; - $pages .= "<div class=\"pages_widget_singleitem_more\"><a href=\"{$pagesurl}\">" . elgg_echo('pages:more') . "</a></div>"; +if ($content) { + $url = "pg/pages/owner/" . elgg_get_page_owner()->username; + $more_link = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('pages:more'), + )); + echo "<span class=\"elgg-widget-more\">$more_link</span>"; +} else { + echo elgg_echo('pages:none'); } - -echo "<div id=\"pages_widget\">" . $pages . "</div>";
\ No newline at end of file diff --git a/mod/pages/views/default/widgets/pages/edit.php b/mod/pages/views/default/widgets/pages/edit.php index 4ddfec428..7e76e69d5 100644 --- a/mod/pages/views/default/widgets/pages/edit.php +++ b/mod/pages/views/default/widgets/pages/edit.php @@ -5,24 +5,20 @@ * @package ElggPages */ +// set default value 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'"; - } +$params = array( + 'internalname' => 'params[pages_num]', + 'value' => $vars['entity']->pages_num, + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), +); +$dropdown = elgg_view('input/pulldown', $params); - echo " <option value='{$i}' $selected >{$i}</option>\n"; -} ?> -</select> +<p> + <?php echo elgg_echo('pages:num'); ?>: + <?php echo $dropdown; ?> </p> |