From 7c7dc0e249fb4afd1b0f4826bdbd27aa5d9f2a26 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 17 Dec 2010 01:08:23 +0000 Subject: updated the river friend view for the new river code git-svn-id: http://code.elgg.org/elgg/trunk@7649 36083f99-b078-4883-b0ff-0f9b5a30f544 --- _graphics/elgg_sprites.png | Bin 12268 -> 12618 bytes engine/lib/upgrades/2010121601.php | 9 +++ languages/en.php | 2 +- .../default/river/relationship/friend/create.php | 36 ------------ version.php | 2 +- views/default/core/river/controls.php | 3 +- views/default/css/elements/skin.php | 5 ++ views/default/css/screen.php | 3 + views/default/friends/river/create.php | 20 ------- views/default/river/item/list.php | 52 ------------------ views/default/river/item/wrapper.php | 61 --------------------- views/default/river/relationship/friend/create.php | 18 ++++++ 12 files changed, 39 insertions(+), 172 deletions(-) create mode 100644 engine/lib/upgrades/2010121601.php delete mode 100644 mod/riverdashboard/views/default/river/relationship/friend/create.php delete mode 100644 views/default/friends/river/create.php delete mode 100644 views/default/river/item/list.php delete mode 100644 views/default/river/item/wrapper.php create mode 100644 views/default/river/relationship/friend/create.php diff --git a/_graphics/elgg_sprites.png b/_graphics/elgg_sprites.png index 31606034b..7479cd669 100644 Binary files a/_graphics/elgg_sprites.png and b/_graphics/elgg_sprites.png differ diff --git a/engine/lib/upgrades/2010121601.php b/engine/lib/upgrades/2010121601.php new file mode 100644 index 000000000..ad7d26adb --- /dev/null +++ b/engine/lib/upgrades/2010121601.php @@ -0,0 +1,9 @@ +dbprefix}river + SET view='river/relationship/friend/create', action_type='create' + WHERE view='friends/river/create' AND action_type='friend'"; +update_data($query); diff --git a/languages/en.php b/languages/en.php index 34c141a5b..f30f8ffd7 100644 --- a/languages/en.php +++ b/languages/en.php @@ -360,7 +360,7 @@ $english = array( 'friends:collections:members' => "Collection members", 'friends:collections:edit' => "Edit collection", - 'friends:river:add' => "%s is now a friend with", + 'friends:river:add' => "is now a friend with %s", 'friendspicker:chararray' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', diff --git a/mod/riverdashboard/views/default/river/relationship/friend/create.php b/mod/riverdashboard/views/default/river/relationship/friend/create.php deleted file mode 100644 index 916efd407..000000000 --- a/mod/riverdashboard/views/default/river/relationship/friend/create.php +++ /dev/null @@ -1,36 +0,0 @@ -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 "getURL()}\">{$performed_by->name} "; - - // Verb - echo elgg_echo('river:relationship:friend'); - - // user B - echo " getURL()}\">{$userb->name}"; - } - - break; - } -} \ No newline at end of file diff --git a/version.php b/version.php index d2c27318c..5b6a77f0a 100644 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ // YYYYMMDD = Elgg Date // XX = Interim incrementer -$version = 2010121401; +$version = 2010121601; // Human-friendly version name $release = '1.8-svn'; diff --git a/views/default/core/river/controls.php b/views/default/core/river/controls.php index 4ab087458..e239a2adb 100644 --- a/views/default/core/river/controls.php +++ b/views/default/core/river/controls.php @@ -9,7 +9,8 @@ $object = $vars['item']->getObjectEntity(); if (isloggedin()) { - if ($vars['item']->annotation_id == 0) { + // comments and non-objects cannot be commented on + if ($object->getType() == 'object' && $vars['item']->annotation_id == 0) { $params = array( 'href' => '#', 'text' => elgg_echo('generic_comments:text'), diff --git a/views/default/css/elements/skin.php b/views/default/css/elements/skin.php index 9e5fbe9ff..693e6e56e 100644 --- a/views/default/css/elements/skin.php +++ b/views/default/css/elements/skin.php @@ -201,6 +201,11 @@ a.selected { .elgg-icon-arrow-s:hover { background-position: -146px -76px; } +.elgg-icon-following { + background-position: -35px -100px; + width: 22px; + height: 20px; +} .ajax-loader { background-color: white; diff --git a/views/default/css/screen.php b/views/default/css/screen.php index f74823373..6b576f7d3 100644 --- a/views/default/css/screen.php +++ b/views/default/css/screen.php @@ -253,6 +253,9 @@ a.widget-edit-button:hover, a.widget-delete-button:hover { margin: 8px 0 5px 0; padding-left: 5px; } +.elgg-river-excerpt .usericon { + float: left; +} .elgg-river-layout .input-pulldown { float: right; margin: 10px 0; diff --git a/views/default/friends/river/create.php b/views/default/friends/river/create.php deleted file mode 100644 index d7a751945..000000000 --- a/views/default/friends/river/create.php +++ /dev/null @@ -1,20 +0,0 @@ -subject_guid); -$performed_on = get_entity($vars['item']->object_guid); - -$url = "getURL()}\">{$performed_by->name}"; -$string = elgg_echo("friends:river:add", array($url)) . " "; -$string .= "getURL()}\">{$performed_on->name}"; -$string .= "
"; -$string .= ""; -$string .= "
" . elgg_view("profile/icon",array('entity' => $performed_by, 'size' => 'tiny')) . "
" . elgg_view("profile/icon",array('entity' => $performed_on, 'size' => 'tiny')) . "
"; -$string .= "
"; - -echo $string; diff --git a/views/default/river/item/list.php b/views/default/river/item/list.php deleted file mode 100644 index d791c74e8..000000000 --- a/views/default/river/item/list.php +++ /dev/null @@ -1,52 +0,0 @@ - -
-= $vars['limit']) { - break; - } - } - } - } - - if ($vars['pagination'] !== false) { - $baseurl = $_SERVER['REQUEST_URI']; - - $nav = ''; - - if (sizeof($vars['items']) > $vars['limit']) { - $newoffset = $vars['offset'] + $vars['limit']; - $nexturl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); - - $nav .= '« ' . elgg_echo('previous') . ' '; - } - - if ($vars['offset'] > 0) { - $newoffset = $vars['offset'] - $vars['limit']; - if ($newoffset < 0) { - $newoffset = 0; - } - $prevurl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); - - $nav .= '' . elgg_echo('next') . ' » '; - } - - if (!empty($nav)) { - echo '

'.$nav.'

'; - } - } -?> -
\ No newline at end of file diff --git a/views/default/river/item/wrapper.php b/views/default/river/item/wrapper.php deleted file mode 100644 index 0bdf2f4aa..000000000 --- a/views/default/river/item/wrapper.php +++ /dev/null @@ -1,61 +0,0 @@ - -
-
-
-
-
action_type; ?>"> -

- - - (posted); - ?>) - -

-
-
-
-
-
- - -
- - get_entity($vars['item']->subject_guid), 'size' => 'tiny')); - ?> - -

- - - (posted); - ?>) - -

-
- \ No newline at end of file diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php new file mode 100644 index 000000000..80c567795 --- /dev/null +++ b/views/default/river/relationship/friend/create.php @@ -0,0 +1,18 @@ +getSubjectEntity(); +$object = $vars['item']->getObjectEntity(); + +$object_link = "getURL()}\">$object->name"; +$subject_icon = elgg_view("profile/icon", array('entity' => $subject, 'size' => 'tiny')); +$object_icon = elgg_view("profile/icon", array('entity' => $object, 'size' => 'tiny')); + +echo elgg_echo("friends:river:add", array($object_link)); + +echo '
'; +echo $subject_icon; +echo ''; +echo $object_icon; +echo '
'; -- cgit v1.2.3