diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:41:31 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 20:41:31 +0000 |
commit | 70b08afa64465f4d3457ba6e1c4cc2df1dd2069b (patch) | |
tree | 251d2559ea516ae4e23395dab4b083d079b65d24 /views/default/river | |
parent | c66831fa5138a277a9729174caf14c7eb323fb07 (diff) | |
download | elgg-70b08afa64465f4d3457ba6e1c4cc2df1dd2069b.tar.gz elgg-70b08afa64465f4d3457ba6e1c4cc2df1dd2069b.tar.bz2 |
More views cleanup.
git-svn-id: http://code.elgg.org/elgg/trunk@3556 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/river')
-rw-r--r-- | views/default/river/dashboard.php | 34 | ||||
-rw-r--r-- | views/default/river/item/list.php | 66 | ||||
-rw-r--r-- | views/default/river/item/noaccess.php | 12 | ||||
-rw-r--r-- | views/default/river/item/wrapper.php | 55 | ||||
-rw-r--r-- | views/default/river/relationship/friend/create.php | 81 | ||||
-rw-r--r-- | views/default/river/wrapper.php | 57 |
6 files changed, 157 insertions, 148 deletions
diff --git a/views/default/river/dashboard.php b/views/default/river/dashboard.php index aa9b65615..b049348f1 100644 --- a/views/default/river/dashboard.php +++ b/views/default/river/dashboard.php @@ -1,23 +1,23 @@ <?php - /** - * Elgg river for dashboard. - * - * @package Elgg - * @author Curverider Ltd - * @link http://elgg.com/ - */ +/** + * Elgg river for dashboard. + * + * @package Elgg + * @author Curverider Ltd + * @link http://elgg.com/ + */ - /// Extract the river - $river = $vars['river']; +/// Extract the river +$river = $vars['river']; ?> <div id="river"> - <?php - if (($river) && (count($river)>0)) - { - foreach ($river as $r) echo $r; - //echo "<div>$r</div>"; +<?php +if (($river) && (count($river)>0)) { + foreach ($river as $r) { + echo $r; } - else - echo elgg_echo('river:widget:noactivity'); - ?> +} else { + echo elgg_echo('river:widget:noactivity'); +} +?> </div>
\ No newline at end of file diff --git a/views/default/river/item/list.php b/views/default/river/item/list.php index 7bbac0044..9508a0da6 100644 --- a/views/default/river/item/list.php +++ b/views/default/river/item/list.php @@ -1,51 +1,65 @@ - +<?php +/** + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + */ +?> <div class="river_item_list"> <?php - if (isset($vars['items']) && is_array($vars['items'])) { - + $i = 0; - if (!empty($vars['items'])) - foreach($vars['items'] as $item) { - - echo elgg_view_river_item($item); - $i++; - if ($i >= $vars['limit']) break; - + if (!empty($vars['items'])) { + foreach($vars['items'] as $item) { + echo elgg_view_river_item($item); + $i++; + if ($i >= $vars['limit']) { + break; + } + } } - } - + if ($vars['pagination'] !== false) { - $baseurl = $_SERVER['REQUEST_URI']; - $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl); - + $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl); + $nav = ''; - + if (sizeof($vars['items']) > $vars['limit']) { $newoffset = $vars['offset'] + $vars['limit']; $urladdition = 'offset='.$newoffset; - if (substr_count($baseurl,'?')) $nexturl=$baseurl . '&' . $urladdition; else $nexturl=$baseurl . '?' . $urladdition; - + if (substr_count($baseurl,'?')) { + $nexturl = $baseurl . '&' . $urladdition; + } else { + $nexturl=$baseurl . '?' . $urladdition; + } + $nav .= '<a class="back" href="'.$nexturl.'">« ' . elgg_echo('previous') . '</a> '; } - + if ($vars['offset'] > 0) { $newoffset = $vars['offset'] - $vars['limit']; - if ($newoffset < 0) $newoffset = 0; + if ($newoffset < 0) { + $newoffset = 0; + } $urladdition = 'offset='.$newoffset; - if (substr_count($baseurl,'?')) $prevurl=$baseurl . '&' . $urladdition; else $prevurl=$baseurl . '?' . $urladdition; - + if (substr_count($baseurl,'?')) { + $prevurl=$baseurl . '&' . $urladdition; + } else { + $prevurl=$baseurl . '?' . $urladdition; + } + $nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' »</a> '; } - - + if (!empty($nav)) { echo '<div class="river_pagination"><p>'.$nav.'</p><div class="clearfloat"></div></div>'; } - } - ?> </div>
\ No newline at end of file diff --git a/views/default/river/item/noaccess.php b/views/default/river/item/noaccess.php index 96958170b..a993423a0 100644 --- a/views/default/river/item/noaccess.php +++ b/views/default/river/item/noaccess.php @@ -1,5 +1,11 @@ <?php +/** + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + */ - echo elgg_echo('river:noaccess'); - -?>
\ No newline at end of file +echo elgg_echo('river:noaccess');
\ No newline at end of file diff --git a/views/default/river/item/wrapper.php b/views/default/river/item/wrapper.php index c8d18e9dd..27de4affd 100644 --- a/views/default/river/item/wrapper.php +++ b/views/default/river/item/wrapper.php @@ -1,51 +1,48 @@ <?php +/** + * Elgg river item wrapper. + * Wraps all river items. + * + * @package Elgg + * @author Curverider + * @link http://elgg.com/ + */ - /** - * Elgg river item wrapper. - * Wraps all river items. - * - * @package Elgg +//get the site admins choice avatars or action icons +$avatar_icon = get_plugin_setting("avatar_icon","riverdashboard"); +if(!$avatar_icon) { + $avatar_icon = "icon"; +} - * @author Curverider - - * @link http://elgg.com/ - */ - - //get the site admins choice avatars or action icons - $avatar_icon = get_plugin_setting("avatar_icon","riverdashboard"); - if(!$avatar_icon) - $avatar_icon = "icon"; - - if($avatar_icon == "icon"){ - -?> +if($avatar_icon == "icon"){ + ?> <div class="river_item"> <div class="river_<?php echo $vars['item']->type; ?>"> <div class="river_<?php echo $vars['item']->subtype; ?>"> - <div class="river_<?php echo $vars['item']->action_type; ?>"> + <div class="river_<?php echo $vars['item']->action_type; ?>"> <div class="river_<?php echo $vars['item']->type; ?>_<?php if($vars['item']->subtype) echo $vars['item']->subtype . "_"; ?><?php echo $vars['item']->action_type; ?>"> <p> <?php - echo $vars['body']; + echo $vars['body']; ?> <span class="river_item_time"> (<?php - echo friendly_time($vars['item']->posted); + echo friendly_time($vars['item']->posted); ?>) </span> </p> </div> - </div> + </div> </div> </div> </div> - -<?php - }else{ -?> + + <?php +} else { + ?> <div class="river_item"> - <span class="river_item_useravatar"> + <span class="river_item_useravatar"> <?php echo elgg_view("profile/icon",array('entity' => get_entity($vars['item']->subject_guid), 'size' => 'tiny')); ?> @@ -62,6 +59,6 @@ </p> <div class="clearfloat"></div> </div> -<?php - } + <?php +} ?>
\ No newline at end of file diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php index 1378d8088..f42bf30c6 100644 --- a/views/default/river/relationship/friend/create.php +++ b/views/default/river/relationship/friend/create.php @@ -1,45 +1,40 @@ <?php - /** - * Elgg relationship create event. - * Display something in the river when a relationship is created. - * - * @package Elgg - * @author Curverider Ltd - * @link http://elgg.com/ - */ - - $statement = $vars['statement']; - - $performed_by = $statement->getSubject(); - $event = $statement->getEvent(); - $object = $statement->getObject(); - - if (is_array($object)) - { - switch ($object['relationship']) - { - // Friending - case 'friend' : - case 'friends' : // 'friends' shouldn't be used, but just incase :) - - // Get second object - $userb = $object['object']; - - // Only users can be friends - if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) - { - // User A - echo "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> "; - - // Verb - echo elgg_echo('river:relationship:friend'); - - // user B - echo " <a href=\"{$userb->getURL()}\">{$userb->name}</a>"; - } - - break; - } +/** + * Elgg relationship create event. + * Display something in the river when a relationship is created. + * + * @package Elgg + * @author Curverider Ltd + * @link http://elgg.com/ + */ + +$statement = $vars['statement']; + +$performed_by = $statement->getSubject(); +$event = $statement->getEvent(); +$object = $statement->getObject(); + +if (is_array($object)) { + switch ($object['relationship']) { + // Friending + case 'friend' : + case 'friends' : // 'friends' shouldn't be used, but just incase :) + + // Get second object + $userb = $object['object']; + + // Only users can be friends + if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) { + // User A + echo "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> "; + + // Verb + echo elgg_echo('river:relationship:friend'); + + // user B + echo " <a href=\"{$userb->getURL()}\">{$userb->name}</a>"; + } + + break; } - -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/views/default/river/wrapper.php b/views/default/river/wrapper.php index cba00ff5a..0b5bfad62 100644 --- a/views/default/river/wrapper.php +++ b/views/default/river/wrapper.php @@ -1,31 +1,28 @@ <?php +/** + * Elgg river item wrapper. + * Wraps all river items. + * + * @package Elgg + * @author Curverider + * @link http://elgg.com/ + */ - /** - * Elgg river item wrapper. - * Wraps all river items. - * - * @package Elgg - - * @author Curverider - - * @link http://elgg.com/ - */ - - $statement = $vars['statement']; - $time = $vars['time']; - $event = $vars['event']; - $entry = $vars['entry']; - - if ($statement->getObject() instanceof ElggEntity) { - - $obj = $statement->getObject(); - $subtype = $obj->getSubtype(); - if (empty($subtype)) $subtype = $obj->type; - if (empty($subtype)) $subtype = "general"; - } else if (is_array($statement->getObject())) { - $obj = $statement->getObject(); - $subtype = "relationship_" . $obj['relationship']; - } +$statement = $vars['statement']; +$time = $vars['time']; +$event = $vars['event']; +$entry = $vars['entry']; + +if ($statement->getObject() instanceof ElggEntity) { + + $obj = $statement->getObject(); + $subtype = $obj->getSubtype(); + if (empty($subtype)) $subtype = $obj->type; + if (empty($subtype)) $subtype = "general"; +} else if (is_array($statement->getObject())) { + $obj = $statement->getObject(); + $subtype = "relationship_" . $obj['relationship']; +} ?> <div class="river_item"> @@ -33,15 +30,15 @@ <div class="river_<?php echo $event; ?>"> <p class="river_<?php echo $subtype; ?>_<?php echo $event; ?>"> <?php - + echo $vars['entry']; - + ?> <span class="river_item_time"> (<?php - + echo friendly_time($time); - + ?>) </span> </p> |