diff options
Diffstat (limited to 'mod/thewire/views/default/widgets')
-rw-r--r-- | mod/thewire/views/default/widgets/thewire/edit.php | 30 | ||||
-rw-r--r-- | mod/thewire/views/default/widgets/thewire/view.php | 40 |
2 files changed, 32 insertions, 38 deletions
diff --git a/mod/thewire/views/default/widgets/thewire/edit.php b/mod/thewire/views/default/widgets/thewire/edit.php index 32a5c8bf7..969015ab8 100644 --- a/mod/thewire/views/default/widgets/thewire/edit.php +++ b/mod/thewire/views/default/widgets/thewire/edit.php @@ -1,14 +1,22 @@ <?php +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 4; +} +?> +<p> + <?php echo elgg_echo("thewire:num"); ?> + <select name="params[num_display]"> +<?php +$options = array(1,2,3,4,5,6); +foreach ($options as $option) { + $selected = ''; + if ($vars['entity']->num_display == $option) { + $selected = "selected='selected'"; + } + echo " <option value='{$option}' $selected >{$option}</option>\n"; +} ?> - <p> - <?php echo elgg_echo("thewire:num"); ?> - <select name="params[num_display]"> - <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option> - <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option> - <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option> - <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option> - <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option> - <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option> - </select> - </p>
\ No newline at end of file + </select> +</p>
\ No newline at end of file diff --git a/mod/thewire/views/default/widgets/thewire/view.php b/mod/thewire/views/default/widgets/thewire/view.php index 4821b854b..39fe368d0 100644 --- a/mod/thewire/views/default/widgets/thewire/view.php +++ b/mod/thewire/views/default/widgets/thewire/view.php @@ -1,29 +1,15 @@ +<?php + +$num = $vars['entity']->num_display; +if (!$num) { + $num = 4; +} - <?php +$content = elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire', 'container_guid' => $vars['entity']->owner_guid, 'limit' => $num, 'full_view' => FALSE, 'pagination' => FALSE)); - // Get any wire notes to display - // Get the current page's owner - $page_owner = page_owner_entity(); - if ($page_owner === false || is_null($page_owner)) { - $page_owner = $_SESSION['user']; - set_page_owner($page_owner->getGUID()); - } - - $num = $vars['entity']->num_display; - if(!$num) - $num = 4; - - $thewire = $page_owner->getObjects('thewire', $num); - - // If there are any thewire to view, view them - if (is_array($thewire) && sizeof($thewire) > 0) { - - foreach($thewire as $shout) { - - echo elgg_view_entity($shout); - - } - - } - - ?> +echo $content; + +if ($content) { + $blogurl = $vars['url'] . "pg/thewire/" . page_owner_entity()->username; + echo "<div class=\"shares_widget_wrapper\"><a href=\"{$blogurl}\">".elgg_echo('thewire:moreposts')."</a></div>"; +} |