aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/views/default/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thewire/views/default/widgets')
-rw-r--r--mod/thewire/views/default/widgets/thewire/content.php28
-rw-r--r--mod/thewire/views/default/widgets/thewire/edit.php30
2 files changed, 36 insertions, 22 deletions
diff --git a/mod/thewire/views/default/widgets/thewire/content.php b/mod/thewire/views/default/widgets/thewire/content.php
index 6de5f1e64..a8471a4b1 100644
--- a/mod/thewire/views/default/widgets/thewire/content.php
+++ b/mod/thewire/views/default/widgets/thewire/content.php
@@ -1,15 +1,29 @@
<?php
-
+/**
+ * User wire post widget display view
+ */
+
$num = $vars['entity']->num_display;
-if (!$num) {
- $num = 4;
-}
-$content = elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire', 'container_guid' => $vars['entity']->owner_guid, 'limit' => $num, 'full_view' => FALSE, 'pagination' => FALSE));
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'container_guid' => $vars['entity']->owner_guid,
+ 'limit' => $num,
+ 'full_view' => FALSE,
+ 'pagination' => FALSE,
+);
+$content = elgg_list_entities($options);
echo $content;
if ($content) {
- $blogurl = elgg_get_site_url() . "pg/thewire/" . elgg_get_page_owner_entity()->username;
- echo "<div class=\"shares_widget_wrapper\"><a href=\"{$blogurl}\">".elgg_echo('thewire:moreposts')."</a></div>";
+ $owner_url = "pg/thewire/owner/" . elgg_get_page_owner_entity()->username;
+ $more_link = elgg_view('output/url', array(
+ 'href' => $owner_url,
+ 'text' => elgg_echo('thewire:moreposts'),
+ ));
+ echo "<span class=\"elgg-widget-more\">$more_link</span>";
+} else {
+ echo elgg_echo('thewire:noposts');
}
diff --git a/mod/thewire/views/default/widgets/thewire/edit.php b/mod/thewire/views/default/widgets/thewire/edit.php
index 969015ab8..8c93383ad 100644
--- a/mod/thewire/views/default/widgets/thewire/edit.php
+++ b/mod/thewire/views/default/widgets/thewire/edit.php
@@ -1,22 +1,22 @@
<?php
+/**
+ * User wire widget edit view
+ */
+
// 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";
-}
+$params = array(
+ 'internalname' => 'params[num_display]',
+ 'value' => $vars['entity']->num_display,
+ 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
+);
+$dropdown = elgg_view('input/dropdown', $params);
+
?>
- </select>
-</p> \ No newline at end of file
+<div>
+ <?php echo elgg_echo('thewire:num'); ?>:
+ <?php echo $dropdown; ?>
+</div>