aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/views/default/widgets
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 22:41:25 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 22:41:25 +0000
commitda90ff55725a9118ce6111ab2b6371650bf78ade (patch)
tree937da734d50c8147ca8f2cc52791dabf430464c6 /mod/thewire/views/default/widgets
parentcc6b7d1d223241e397e0d41354924e74606eeffc (diff)
downloadelgg-da90ff55725a9118ce6111ab2b6371650bf78ade.tar.gz
elgg-da90ff55725a9118ce6111ab2b6371650bf78ade.tar.bz2
a mostly completed port of JHU/APL wire plugin to 1.8
git-svn-id: http://code.elgg.org/elgg/trunk@8183 36083f99-b078-4883-b0ff-0f9b5a30f544
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>