From b6f99468651309e0b58dbe000958540809df5dcc Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 18:31:27 +0000 Subject: Fixes #2226 moves riverdashboard into secondary plugins from core plugins - most of riverdashboard functionality is now in core (except for displaying who has liked stuff and ajax refreshes) git-svn-id: http://code.elgg.org/elgg/trunk@7750 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/riverdashboard/actions/add.php | 45 --- mod/riverdashboard/actions/delete.php | 28 -- mod/riverdashboard/endpoint/get_comments.php | 40 --- mod/riverdashboard/endpoint/get_likes.php | 22 -- mod/riverdashboard/endpoint/ping.php | 59 ---- mod/riverdashboard/graphics/follow_icon.png | Bin 344 -> 0 bytes mod/riverdashboard/graphics/refresh.png | Bin 327 -> 0 bytes mod/riverdashboard/index.php | 70 ---- mod/riverdashboard/languages/en.php | 51 --- mod/riverdashboard/manifest.xml | 11 - mod/riverdashboard/start.php | 368 --------------------- .../views/default/river/dashboard.php | 19 -- .../views/default/river/item/list.php | 63 ---- .../views/default/river/item/wrapper.php | 150 --------- .../views/default/river/item/wrapper_classic.php | 20 -- .../views/default/riverdashboard/container.php | 52 --- .../views/default/riverdashboard/css.php | 179 ---------- .../views/default/riverdashboard/ecml/activity.php | 26 -- .../views/default/riverdashboard/js.php | 96 ------ .../views/default/riverdashboard/menu.php | 27 -- .../views/default/riverdashboard/nav.php | 57 ---- .../views/default/riverdashboard/river/body.php | 38 --- .../views/default/riverdashboard/river/footer.php | 130 -------- .../views/default/riverdashboard/rivercomment.php | 18 - .../views/default/riverdashboard/sitemessage.php | 77 ----- .../views/default/riverdashboard/welcome.php | 8 - .../views/json/riverdashboard/container.php | 1 - .../views/rss/riverdashboard/container.php | 1 - 28 files changed, 1656 deletions(-) delete mode 100644 mod/riverdashboard/actions/add.php delete mode 100644 mod/riverdashboard/actions/delete.php delete mode 100644 mod/riverdashboard/endpoint/get_comments.php delete mode 100644 mod/riverdashboard/endpoint/get_likes.php delete mode 100644 mod/riverdashboard/endpoint/ping.php delete mode 100644 mod/riverdashboard/graphics/follow_icon.png delete mode 100644 mod/riverdashboard/graphics/refresh.png delete mode 100644 mod/riverdashboard/index.php delete mode 100644 mod/riverdashboard/languages/en.php delete mode 100644 mod/riverdashboard/manifest.xml delete mode 100644 mod/riverdashboard/start.php delete mode 100644 mod/riverdashboard/views/default/river/dashboard.php delete mode 100644 mod/riverdashboard/views/default/river/item/list.php delete mode 100644 mod/riverdashboard/views/default/river/item/wrapper.php delete mode 100644 mod/riverdashboard/views/default/river/item/wrapper_classic.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/container.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/css.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/ecml/activity.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/js.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/menu.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/nav.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/river/body.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/river/footer.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/rivercomment.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/sitemessage.php delete mode 100644 mod/riverdashboard/views/default/riverdashboard/welcome.php delete mode 100644 mod/riverdashboard/views/json/riverdashboard/container.php delete mode 100644 mod/riverdashboard/views/rss/riverdashboard/container.php (limited to 'mod/riverdashboard') diff --git a/mod/riverdashboard/actions/add.php b/mod/riverdashboard/actions/add.php deleted file mode 100644 index 441723ebf..000000000 --- a/mod/riverdashboard/actions/add.php +++ /dev/null @@ -1,45 +0,0 @@ -subtype = "sitemessage"; - // Set its owner to the current user - $sitemessage->owner_guid = get_loggedin_userid(); - // For now, set its access to logged in users - $sitemessage->access_id = 1; // this is for all logged in users - // Set description appropriately - $sitemessage->title = ''; - $sitemessage->description = $message; - // Before we can set metadata, we need to save the message - if (!$sitemessage->save()) { - register_error(elgg_echo("sitemessage:error")); - forward("mod/riverdashboard/"); - } - // Success message - system_message(elgg_echo("sitemessages:posted")); - - // add to river - add_to_river('river/sitemessage/create','create',get_loggedin_userid(),$sitemessage->guid); - - // Forward to the activity page - forward("mod/riverdashboard/"); - -} diff --git a/mod/riverdashboard/actions/delete.php b/mod/riverdashboard/actions/delete.php deleted file mode 100644 index 5352cc778..000000000 --- a/mod/riverdashboard/actions/delete.php +++ /dev/null @@ -1,28 +0,0 @@ -getSubtype() == "sitemessage" && $message->canEdit()) { - - // Delete it! - $rowsaffected = $message->delete(); - if ($rowsaffected > 0) { - // Success message - system_message(elgg_echo("sitemessage:deleted")); - } else { - register_error(elgg_echo("sitemessage:notdeleted")); - } - // Forward to the river - forward("mod/riverdashboard/"); - -} - diff --git a/mod/riverdashboard/endpoint/get_comments.php b/mod/riverdashboard/endpoint/get_comments.php deleted file mode 100644 index f130cfd3c..000000000 --- a/mod/riverdashboard/endpoint/get_comments.php +++ /dev/null @@ -1,40 +0,0 @@ -owner_guid); - //get the comment owner's profile url - $comment_owner_url = $comment_owner->getURL(); - - //display comment - echo "
"; - echo ""; - echo elgg_view("profile/icon", array('entity' => $comment_owner, 'size' => 'tiny')); - echo ""; - - //truncate comment to 150 characters and strip tags - $contents = elgg_get_excerpt($comment->value, 150); - - echo "
"; - echo "" . $comment_owner->name . ' '; - echo "" . elgg_view_friendly_time($comment->time_created) . ""; - echo "
"; -} \ No newline at end of file diff --git a/mod/riverdashboard/endpoint/get_likes.php b/mod/riverdashboard/endpoint/get_likes.php deleted file mode 100644 index cc9e83aaf..000000000 --- a/mod/riverdashboard/endpoint/get_likes.php +++ /dev/null @@ -1,22 +0,0 @@ -getAnnotations('likes', $limit, $offset); - -if (is_array($annotations) && sizeof($annotations) > 0) { - foreach($annotations as $annotation) { - echo elgg_view_annotation($annotation, "", false); - } -} diff --git a/mod/riverdashboard/endpoint/ping.php b/mod/riverdashboard/endpoint/ping.php deleted file mode 100644 index 94c6fe377..000000000 --- a/mod/riverdashboard/endpoint/ping.php +++ /dev/null @@ -1,59 +0,0 @@ - TRUE and not group by object_guid - -// river table does not have columns expected by get_access_sql_suffix so we modify its output -$access = str_replace("and enabled='yes'", '', str_replace('owner_guid', 'subject_guid', riverdashboard_get_access_sql_suffix('r', 'e'))); - -$q = "SELECT COUNT(id) as all_activity FROM {$CONFIG->dbprefix}river r, {$CONFIG->dbprefix}entities e - WHERE r.posted > $last_reload AND r.object_guid = e.guid AND ($access)"; - -if ($d = get_data($q)) { - $all_activity = $d[0]->all_activity; -} else { - $all_activity = 0; -} - -if ($all_activity > 0) { - $s = ($all_activity == 1) ? '' : 's'; - echo "$all_activity update$s!"; -?> - - - $type,'subtype' => $subtype,'orient' => $orient)); -if (isloggedin()) { - $sidebar = elgg_view("riverdashboard/menu",array('type' => $type,'subtype' => $subtype,'orient' => $orient)); - $sidebar .= elgg_view("riverdashboard/sidebar", array("object_type" => 'riverdashboard')); -} else { - $sidebar = ''; -} - -elgg_set_context('riverdashboard'); - -if (empty($callback)) { - $body .= elgg_view('riverdashboard/container', array('body' => $nav . $extend . $river . elgg_view('riverdashboard/js'))); - $params = array( - 'content' => $title . $body, - 'sidebar' => $sidebar - ); - $body = elgg_view_layout('one_sidebar', $params); - echo elgg_view_page($title_wording, $body); -} else { - header("Content-type: text/html; charset=UTF-8"); - echo $nav . $river . elgg_view('riverdashboard/js'); -} diff --git a/mod/riverdashboard/languages/en.php b/mod/riverdashboard/languages/en.php deleted file mode 100644 index a07853680..000000000 --- a/mod/riverdashboard/languages/en.php +++ /dev/null @@ -1,51 +0,0 @@ - 'Mine', - 'filter' => 'Filter', - 'riverdashboard:useasdashboard' => "Replace the default dashboard with this activity river?", - 'activity' => 'Activity', - 'riverdashboard:recentmembers' => 'Recent members', - - /** - * Site messages - **/ - 'sitemessages:announcements' => "Site announcements", - 'sitemessages:posted' => "Posted", - 'sitemessages:river:created' => "Site admin, %s,", - 'sitemessages:river:create' => "posted a new site wide message", - 'sitemessages:add' => "Add a site-wide message to the river page", - 'sitemessage:deleted' => "Site message deleted", - - 'river:widget:noactivity' => 'We could not find any activity.', - 'river:widget:title' => "Activity", - 'river:all' => "All activity", - 'river:mine' => "My activity", - 'river:friends' => "Friends' activity", - 'river:classic' => 'Classic', - 'river:clustered' => 'Clustered', - 'river:type' => 'Would you like the activity stream to be in classic format (chronological) or clustered?', - 'river:widget:description' => "Show your latest activity.", - 'river:widgets:friends' => "Friends", - 'river:widgets:mine' => "Mine", - 'river:friends' => "My friends' activity", - 'river:mine' => "My activity", - 'river:widget:label:displaynum' => "Number of entries to display:", - 'river:widget:type' => "Which river would you like to display? One that shows your activity or one that shows your friends activity?", - 'item:object:sitemessage' => "Site messages", - 'riverdashboard:avataricon' => "Would you like to use user avatars or icons on your site activity stream?", - 'option:icon' => 'Icons', - 'option:avatar' => 'Avatars', - - // likes and comments - 'riverdashboard:n_more_comments' => '+%s more', - 'riverdashboard:show_less' => 'Show less', - - // ecml desc - 'riverdashboard:ecml:riverdashboard' => 'River Dashboard', - - // ecml keywords - 'riverdashboard:ecml:desc:activity' => 'Recent Activity', - 'riverdashboard:ecml:desc:usage' => '[activity user=username limit=limit type=type subtype=subtype]' -); - -add_translation("en", $english); \ No newline at end of file diff --git a/mod/riverdashboard/manifest.xml b/mod/riverdashboard/manifest.xml deleted file mode 100644 index 40c398ae4..000000000 --- a/mod/riverdashboard/manifest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php deleted file mode 100644 index 7955b494e..000000000 --- a/mod/riverdashboard/start.php +++ /dev/null @@ -1,368 +0,0 @@ - $entity)); - return $comments; - } -} - - -/** - * Register activity keyword. - * - * @param unknown_type $hook - * @param unknown_type $type - * @param unknown_type $value - * @param unknown_type $params - * @return unknown_type - */ -function riverdashboard_ecml_keywords_hook($hook, $type, $value, $params) { - $value['activity'] = array( - 'view' => "riverdashboard/ecml/activity", - 'description' => elgg_echo('riverdashboard:ecml:desc:activity'), - 'usage' => elgg_echo('riverdashboard:ecml:usage:activity'), - 'restricted' => array('sitepages/custom_frontpage') - ); - - return $value; -} - -/** - * Register the activity front page with ECML. - * - * @param unknown_type $hook - * @param unknown_type $entity_type - * @param unknown_type $return_value - * @param unknown_type $params - */ -function riverdashboard_ecml_views_hook($hook, $entity_type, $return_value, $params) { - $return_value['riverdashboard/container'] = elgg_echo('riverdashboard:ecml:riverdashboard'); - - return $return_value; -} - -/** - * Retrieves items from the river. All parameters are optional. - * - * @param int|array $subject_guid Acting entity to restrict to. Default: all - * @param int|array $object_guid Entity being acted on to restrict to. Default: all - * @param string $subject_relationship If set to a relationship type, this will use - * $subject_guid as the starting point and set the - * subjects to be all users this entity has this - * relationship with (eg 'friend'). Default: blank - * @param string $type The type of entity to restrict to. Default: all - * @param string $subtype The subtype of entity to restrict to. Default: all - * @param string $action_type The type of river action to restrict to. Default: all - * @param int $limit The number of items to retrieve. Default: 20 - * @param int $offset The page offset. Default: 0 - * @param int $posted_min The minimum time period to look at. Default: none - * @param int $posted_max The maximum time period to look at. Default: none - * - * @return array|false Depending on success - */ -function riverdashboard_get_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '', -$type = '', $subtype = '', $action_type = '', $limit = 10, $offset = 0, $posted_min = 0, -$posted_max = 0) { - - // Get config - global $CONFIG; - - // Sanitise variables - if (!is_array($subject_guid)) { - $subject_guid = (int) $subject_guid; - } else { - foreach ($subject_guid as $key => $temp) { - $subject_guid[$key] = (int) $temp; - } - } - if (!is_array($object_guid)) { - $object_guid = (int) $object_guid; - } else { - foreach ($object_guid as $key => $temp) { - $object_guid[$key] = (int) $temp; - } - } - if (!empty($type)) { - $type = sanitise_string($type); - } - if (!empty($subtype)) { - $subtype = sanitise_string($subtype); - } - if (!empty($action_type)) { - $action_type = sanitise_string($action_type); - } - $limit = (int) $limit; - $offset = (int) $offset; - $posted_min = (int) $posted_min; - $posted_max = (int) $posted_max; - - // Construct 'where' clauses for the river - $where = array(); - // river table does not have columns expected by get_access_sql_suffix so we modify its output - $where[] = str_replace("and enabled='yes'", '', - str_replace('owner_guid', 'subject_guid', riverdashboard_get_access_sql_suffix('er', 'e'))); - - if (empty($subject_relationship)) { - if (!empty($subject_guid)) { - if (!is_array($subject_guid)) { - $where[] = " subject_guid = {$subject_guid} "; - } else { - $where[] = " subject_guid in (" . implode(',', $subject_guid) . ") "; - } - } - } else { - if (!is_array($subject_guid)) { - $entities = elgg_get_entities_from_relationship(array( - 'relationship' => $subject_relationship, - 'relationship_guid' => $subject_guid, - 'limit' => 9999, - )); - if (is_array($entities) && !empty($entities)) { - $guids = array(); - foreach ($entities as $entity) { - $guids[] = (int) $entity->guid; - } - // $guids[] = $subject_guid; - $where[] = " subject_guid in (" . implode(',', $guids) . ") "; - } else { - return array(); - } - } - } - if (!empty($object_guid)) { - if (!is_array($object_guid)) { - $where[] = " object_guid = {$object_guid} "; - } else { - $where[] = " object_guid in (" . implode(',', $object_guid) . ") "; - } - } - if (!empty($type)) { - $where[] = " er.type = '{$type}' "; - } - if (!empty($subtype)) { - $where[] = " er.subtype = '{$subtype}' "; - } - if (!empty($action_type)) { - $where[] = " action_type = '{$action_type}' "; - } - if (!empty($posted_min)) { - $where[] = " posted > {$posted_min} "; - } - if (!empty($posted_max)) { - $where[] = " posted < {$posted_max} "; - } - - $whereclause = implode(' and ', $where); - - // Construct main SQL - $sql = "select er.*" . - " from {$CONFIG->dbprefix}river er, {$CONFIG->dbprefix}entities e " . - " where {$whereclause} AND er.object_guid = e.guid GROUP BY object_guid " . - " ORDER BY e.last_action desc LIMIT {$offset}, {$limit}"; - - // Get data - return get_data($sql, 'elgg_row_to_elgg_river_item'); -} - -/** - * This function has been added here until we decide if it is going to roll into core or not - * Add access restriction sql code to a given query. - * Note that if this code is executed in privileged mode it will return blank. - * - * @TODO: DELETE once Query classes are fully integrated - * - * @param string $table_prefix_one Optional table. prefix for the access code. - * @param string $table_prefix_two Another optiona table prefix? - * @param int $owner Owner GUID - * - * @return string - */ -function riverdashboard_get_access_sql_suffix($table_prefix_one = '', $table_prefix_two = '', $owner = null) { - global $ENTITY_SHOW_HIDDEN_OVERRIDE, $CONFIG; - - $sql = ""; - $friends_bit = ""; - $enemies_bit = ""; - - if ($table_prefix_one) { - $table_prefix_one = sanitise_string($table_prefix_one) . "."; - } - - if ($table_prefix_two) { - $table_prefix_two = sanitise_string($table_prefix_two) . "."; - } - - if (!isset($owner)) { - $owner = get_loggedin_userid(); - } - - if (!$owner) { - $owner = -1; - } - - $ignore_access = elgg_check_access_overrides($owner); - $access = get_access_list($owner); - - if ($ignore_access) { - $sql = " (1 = 1) "; - } else if ($owner != -1) { - $friends_bit = "{$table_prefix_one}access_id = " . ACCESS_FRIENDS . " - AND {$table_prefix_one}owner_guid IN ( - SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships - WHERE relationship='friend' AND guid_two=$owner - )"; - - $friends_bit = '(' . $friends_bit . ') OR '; - - if ((isset($CONFIG->user_block_and_filter_enabled)) && ($CONFIG->user_block_and_filter_enabled)) { - // check to see if the user is in the entity owner's block list - // or if the entity owner is in the user's filter list - // if so, disallow access - $enemies_bit = get_annotation_sql('elgg_block_list', "{$table_prefix_one}owner_guid", - $owner, false); - - $enemies_bit = '(' - . $enemies_bit - . ' AND ' . get_annotation_sql('elgg_filter_list', $owner, "{$table_prefix_one}owner_guid", - false) - . ')'; - } - } - - if (empty($sql)) { - $sql = " $friends_bit ({$table_prefix_one}access_id IN {$access} - OR ({$table_prefix_one}owner_guid = {$owner}) - OR ( - {$table_prefix_one}access_id = " . ACCESS_PRIVATE . " - AND {$table_prefix_one}owner_guid = $owner - ) - )"; - } - - if ($enemies_bit) { - $sql = "$enemies_bit AND ($sql)"; - } - - if (!$ENTITY_SHOW_HIDDEN_OVERRIDE) { - $sql .= " and {$table_prefix_two}enabled='yes'"; - } - - return '(' . $sql . ')'; -} - -/** - * Returns a human-readable version of the river. - * - * @param int|array $subject_guid Acting entity to restrict to. Default: all - * @param int|array $object_guid Entity being acted on to restrict to. Default: all - * @param string $subject_relationship If set to a relationship type, this will use - * $subject_guid as the starting point and set - * the subjects to be all users this entity has this - * relationship with (eg 'friend'). Default: blank - * @param string $type The type of entity to restrict to. Default: all - * @param string $subtype The subtype of entity to restrict to. Default: all - * @param string $action_type The type of river action to restrict to. Default: all - * @param int $limit The number of items to retrieve. Default: 20 - * @param int $posted_min The minimum time period to look at. Default: none - * @param int $posted_max The maximum time period to look at. Default: none - * @param bool $pagination Show pagination? - * @param $bool $chronological Show in chronological order? - * - * @return string Human-readable river. - */ -function riverdashboard_view_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '', -$type = '', $subtype = '', $action_type = '', $limit = 20, $posted_min = 0, -$posted_max = 0, $pagination = true) { - - // Get input from outside world and sanitise it - $offset = (int) get_input('offset', 0); - - $riveritems = riverdashboard_get_river_items($subject_guid, $object_guid, $subject_relationship, $type, - $subtype, $action_type, ($limit + 1), $offset, $posted_min, $posted_max); - - // Get river items, if they exist - if ($riveritems) { - - return elgg_view('river/item/list', array( - 'limit' => $limit, - 'offset' => $offset, - 'items' => $riveritems, - 'pagination' => $pagination - )); - - } - - return ''; -} - -/** - * Returns a human-readable representation of a river item - * - * @param ElggRiverItem $item A river item object - * - * @return string|false Depending on success - */ -function riverdashboard_view_river_item($item) { - - if (!$item || !$item->getView() || !elgg_view_exists($item->getView())) { - return ''; - } - - $subject = $item->getSubjectEntity(); - $object = $item->getObjectEntity(); - if (!$subject || !$object) { - // subject is disabled or subject/object deleted - return ''; - } - - $vars = array( - 'pict' => elgg_view('core/river/image', array('item' => $item)), - 'body' => elgg_view('riverdashboard/river/body', array('item' => $item)), - 'class' => 'elgg-river-item', - 'id' => "river-entity-{$object->guid}", - ); - return elgg_view('layout/objects/image_block', $vars); -} diff --git a/mod/riverdashboard/views/default/river/dashboard.php b/mod/riverdashboard/views/default/river/dashboard.php deleted file mode 100644 index 5fe7c35d3..000000000 --- a/mod/riverdashboard/views/default/river/dashboard.php +++ /dev/null @@ -1,19 +0,0 @@ - -
-0)) { - foreach ($river as $r) { - echo $r; - } -} else { - echo elgg_echo('river:widget:noactivity'); -} -?> -
\ No newline at end of file diff --git a/mod/riverdashboard/views/default/river/item/list.php b/mod/riverdashboard/views/default/river/item/list.php deleted file mode 100644 index fb0656022..000000000 --- a/mod/riverdashboard/views/default/river/item/list.php +++ /dev/null @@ -1,63 +0,0 @@ -= $vars['limit']) { - break; - } - } - } -} - -if ($vars['pagination'] !== false) { - $baseurl = $_SERVER['REQUEST_URI']; - $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; - } - - $nav .= '« ' . elgg_echo('previous') . ' '; - } - - if ($vars['offset'] > 0) { - $newoffset = $vars['offset'] - $vars['limit']; - if ($newoffset < 0) { - $newoffset = 0; - } - $urladdition = 'offset='.$newoffset; - if (substr_count($baseurl,'?')) { - $prevurl=$baseurl . '&' . $urladdition; - } else { - $prevurl=$baseurl . '?' . $urladdition; - } - - $nav .= '' . elgg_echo('next') . ' » '; - } - - if (!empty($nav)) { - echo ''; - } -} - -?> - - \ No newline at end of file diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php deleted file mode 100644 index 4f6100114..000000000 --- a/mod/riverdashboard/views/default/river/item/wrapper.php +++ /dev/null @@ -1,150 +0,0 @@ -object_guid); -$object_url = $object->getURL(); -$likes_count = elgg_count_likes($object); - -//user -//if displaying on the profile get the object owner, else the subject_guid -if (elgg_get_context() == 'profile' && $object->getSubtype() == 'thewire') { - $user = get_entity($object->owner_guid); -} else { - $user = get_entity($vars['item']->subject_guid); -} - -// get last three comments display -// want the 3 most recent comments (order by time_created desc = 3 2 1 limit 3) -// but will display them with the newest at the bottom (1 2 3) -if ($comments = get_annotations($vars['item']->object_guid, "", "", 'generic_comment', "", "", 3, 0, "desc")) { - $comments = array_reverse($comments); -} - -// for displaying "+N more" -// -3 from the count because the 3 displayed don't count in the "more" -$comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, 'generic_comment'); -if ($comment_count < 3) { - $more_comments_count = 0; -} else { - $more_comments_count = $comment_count - 3; -} - -?> -
- - $user, 'size' => 'small')); ?> - - -
-"; - echo "" . elgg_echo('comments') . ''; - - if ($likes_count != 0) { - echo elgg_view('forms/likes/display', array('entity' => $object)); - } - - echo "
"; // close river-comments-tabs - - echo "
"; - - if ($likes_count != 0) { - //show the users who liked the object - // this is loaded via ajax to avoid pounding the server with avatar requests. - echo ""; - } - - echo "
"; - // display appropriate comment link - if ($more_comments_count > 0) { - echo "" . - elgg_echo('riverdashboard:n_more_comments', array($more_comments_count)) . ''; - - echo "" . elgg_echo('riverdashboard:show_less') . ''; - } - echo "
"; - foreach ($comments as $comment) { - //get the comment owner - $comment_owner = get_user($comment->owner_guid); - //get the comment owner's profile url - $comment_owner_url = $comment_owner->getURL(); - // color-code each of the 3 comments - // @todo this isn't used in CSS... - if( ($counter == 2 && $comment_count >= 4) || ($counter == 1 && $comment_count == 2) || ($counter == 0 && $comment_count == 1) || ($counter == 2 && $comment_count == 3) ) { - $alt = 'latest'; - } else if( ($counter == 1 && $comment_count >= 4) || ($counter == 0 && $comment_count == 2) || ($counter == 1 && $comment_count == 3) ) { - $alt = 'penultimate'; - } - //display comment - echo "
"; - echo ""; - echo elgg_view("profile/icon", array('entity' => $comment_owner, 'size' => 'tiny')); - echo ""; - - //truncate comment to 150 characters and strip tags - $contents = elgg_get_excerpt($comment->value, 150); - - echo "
"; - echo "" . $comment_owner->name . ' ' . parse_urls($contents) . ''; - echo "" . elgg_view_friendly_time($comment->time_created) . ""; - echo "
"; - $counter++; - } - - // close comments_list, comments_container and river-comments - echo '
' . elgg_make_river_comment($object) . '
'; -} else { - // tab bar nav - for users that liked object - if ($vars['item']->type != 'user' && $likes_count != 0) { - echo "
"; - } - - if ($likes_count != 0) { - echo elgg_view('forms/likes/display', array('entity' => $object)); - } - - if ($vars['item']->type != 'user' && $likes_count != 0) { - echo "
"; // close river-comments-tabs - } - - if ($vars['item']->type != 'user') { - echo "
"; - } - if ($likes_count != 0) { - //show the users who liked the object - echo ""; - } - - // if there are no comments to display - // and this is not a user - include the inline comment form - if ($vars['item']->type != 'user') { - echo elgg_make_river_comment($object); - } - if ($vars['item']->type != 'user') { - echo "
"; - } -} -?> -
- diff --git a/mod/riverdashboard/views/default/river/item/wrapper_classic.php b/mod/riverdashboard/views/default/river/item/wrapper_classic.php deleted file mode 100644 index 58fe938f4..000000000 --- a/mod/riverdashboard/views/default/river/item/wrapper_classic.php +++ /dev/null @@ -1,20 +0,0 @@ - -
- - get_entity($vars['item']->subject_guid), 'size' => 'small')); -?> - -
- -
-
\ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/container.php b/mod/riverdashboard/views/default/riverdashboard/container.php deleted file mode 100644 index 09a593622..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/container.php +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/mod/riverdashboard/views/default/riverdashboard/css.php b/mod/riverdashboard/views/default/riverdashboard/css.php deleted file mode 100644 index bb207d33c..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/css.php +++ /dev/null @@ -1,179 +0,0 @@ - -#riverdashboard-updates { - border-bottom:1px solid #cccccc; -} -#riverdashboard-updates a.update-link { - display: inline-table; - color:white; - font-weight: bold; - padding:1px 8px 2px 24px; - margin-top:9px; - cursor: pointer; - background: red url("mod/riverdashboard/graphics/refresh.png") no-repeat 5px 3px; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; -} -#riverdashboard-updates a.update-link:hover { - background: #4690D6 url("mod/riverdashboard/graphics/refresh.png") no-repeat 5px -22px; - color:white; - text-decoration: none; -} -.riverdashboard-filtermenu { - margin:10px 0 10px 0; - float:right; -} - -/* RIVER ENTRY */ -.elgg-river-item { - border-bottom:1px solid #cccccc; - padding:7px 0 7px 0; -} -.elgg-river-item p { - margin:0; -} -.elgg-river-item .entity-subtext { - display: block; - line-height: 1.4em; -} -.river-item-useravatar { - float:left; - margin-top:3px; - margin-left:1px; -} -.river-item-contents { - margin-left:55px; -} -.river-item-contents a { - font-weight: bold; -} -.river-content-display { - border-left:1px solid #DDDDDD; - font-size:85%; - line-height:1.5em; - margin:8px 0 5px 0; - padding-left:5px; -} -.following-icon { - width:20px; - height:25px; - margin:0 2px 0 2px; - background: url(mod/riverdashboard/graphics/follow_icon.png) no-repeat left -7px; -} - -/* LATEST COMMENTS IN RIVER */ -.river-comments-tabs { - max-height: 19px; - overflow:hidden; -} -.river-comments { - -moz-border-radius-bottomleft:5px; - -moz-border-radius-bottomright:5px; - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:0; - -webkit-border-top-left-radius:5px; - -webkit-border-top-right-radius:0; - -webkit-border-bottom-right-radius:5px; - -webkit-border-bottom-left-radius:5px; - background-color: #eeeeee; -} -.river-comment { - padding:3px; - border-bottom:1px solid white; -} -.river-comment.penultimate { - -} -.river-comment.latest { - -} -/* hidden inline comment form */ -.river-comment-form.hidden { - padding:5px; - height:26px; -} -.river-comment-form.hidden .input-text { - width:560px; - padding:3px; -} -#profile-content .river-comment-form.hidden .input-text { /* when activity is displayed on profile page */ - width:535px; -} -.river-comment-form.hidden .elgg-submit-button { - margin:0 0 0 10px; - float:right; -} -.river-link-divider { - color:#999999; - font-style: normal; -} -.river-comment-form-button, -.river-item-contents .river_user-like-button { - font-weight:normal; - font-style: normal; -} -.river-comment-form-button { - margin-left: 7px; -} -/* hidden list of users that liked item */ -.elgg-likes-user { - border-bottom:1px solid white; - padding:3px; -} -.elgg-likes-user .entity-listing-icon { - margin:3px 0 4px 2px; -} -.elgg-likes-user .entity-listing-info { - width:635px; -} -#profile-content .river-item .elgg-likes-user .entity-listing-info { /* when likes is displayed on profile page activity stream */ - width:600px; -} -.elgg-likes-user .entity-metadata { - margin-top:3px; -} -p.elgg-likes-owner { - padding-top:0; -} -a.river-more-comments { - display:block; - float:right; - padding:1px 7px 1px 7px; - margin-left:6px; - text-align:right; - font-size:85%; - font-weight:normal; - width:auto; - background-color: #eeeeee; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; -} -a.river-more-comments.off { - background-color: white; -} -.river-comment-owner-icon { - float:left; - margin:3px 8px 4px 2px; -} -.river-comment-contents { - margin-left:34px; -} -a.river-more-comments { - float:right; - font-size:85%; - padding-right:7px; - text-align:right; -} -.elgg-river-item form { - display: block; - height: auto; - padding: 0px; -} - - diff --git a/mod/riverdashboard/views/default/riverdashboard/ecml/activity.php b/mod/riverdashboard/views/default/riverdashboard/ecml/activity.php deleted file mode 100644 index 527be3d82..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/ecml/activity.php +++ /dev/null @@ -1,26 +0,0 @@ -getGUID(); - } -} - -$river = elgg_view_river_items($owner, NULL, NULL, $type, $subtype, '', $limit, 0, 0, true, false) . ""; - -// Replacing callback calls in the nav with something meaningless -$river = str_replace('callback=true','replaced=88,334', $river); - -echo $river; diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php deleted file mode 100644 index 4995799f1..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/js.php +++ /dev/null @@ -1,96 +0,0 @@ - diff --git a/mod/riverdashboard/views/default/riverdashboard/menu.php b/mod/riverdashboard/views/default/riverdashboard/menu.php deleted file mode 100644 index 889cfbbd2..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/menu.php +++ /dev/null @@ -1,27 +0,0 @@ - - \ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/nav.php b/mod/riverdashboard/views/default/riverdashboard/nav.php deleted file mode 100644 index cae3d7bcd..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/nav.php +++ /dev/null @@ -1,57 +0,0 @@ -registered_entities)) { - foreach ($vars['config']->registered_entities as $type => $ar) { - foreach ($vars['config']->registered_entities[$type] as $object) { - if ($object != 'helppage'){ - if (!empty($object )) { - $keyname = 'item:'.$type.':'.$object; - } else { - $keyname = 'item:'.$type; - } - $contents[$keyname] = "{$type},{$object}"; - } - } - } -} - -$allselect = $friendsselect = $mineselect = $display_option = ''; -switch($vars['orient']) { - case '': - $allselect = 'class="selected"'; - break; - case 'friends': - $friendsselect = 'class="selected"'; - $display_option = '&display=friends'; - break; - case 'mine': - $mineselect = 'class="selected"'; - $display_option = '&display=mine'; - break; -} -?> -
- "; - $current = get_input('subtype'); - foreach($contents as $label => $content) { - $get_values = explode(",", $content); - //select the current filter - if ($get_values[1] == $current) { - $selected = "SELECTED"; - } - //set the drop down filter - if ($content[0] && $content[1]) { - $location_filter .= ""; - } - //reset selected - $selected = ''; - } - $location_filter .= ""; - echo $location_filter; - ?> - -
-
diff --git a/mod/riverdashboard/views/default/riverdashboard/river/body.php b/mod/riverdashboard/views/default/riverdashboard/river/body.php deleted file mode 100644 index ab1227609..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/river/body.php +++ /dev/null @@ -1,38 +0,0 @@ -getSubjectEntity(); -$object = $item->getObjectEntity(); - -// river item header -$params = array( - 'href' => $subject->getURL(), - 'text' => $subject->name, -); -$subject_link = elgg_view('output/url', $params); -$timestamp = elgg_get_friendly_time($item->getPostedTime()); -$header = "$subject_link $timestamp"; - -// body -$body = elgg_view($item->getView(), array('item' => $item)); -if ($object->getType() == 'object' && $vars['item']->annotation_id == 0) { - $body .= '
'; - $body .= "Comment"; - $body .= elgg_view('forms/likes/link', array('entity' => $object)); -} - -// footer -$footer = elgg_view('riverdashboard/river/footer', $vars); - -$params = array( - 'header' => $header, - 'body' => $body, - 'footer' => $footer, - 'show_inner' => false, -); -echo elgg_view('layout/objects/module', $params); diff --git a/mod/riverdashboard/views/default/riverdashboard/river/footer.php b/mod/riverdashboard/views/default/riverdashboard/river/footer.php deleted file mode 100644 index 6df58b5da..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/river/footer.php +++ /dev/null @@ -1,130 +0,0 @@ -object_guid); -$object_url = $object->getURL(); -$likes_count = elgg_count_likes($object); - -//user -//if displaying on the profile get the object owner, else the subject_guid -if (elgg_get_context() == 'profile' && $object->getSubtype() == 'thewire') { - $user = get_entity($object->owner_guid); -} else { - $user = get_entity($vars['item']->subject_guid); -} - -// get last three comments display -// want the 3 most recent comments (order by time_created desc = 3 2 1 limit 3) -// but will display them with the newest at the bottom (1 2 3) -if ($comments = get_annotations($vars['item']->object_guid, "", "", 'generic_comment', "", "", 3, 0, "desc")) { - $comments = array_reverse($comments); -} - -// for displaying "+N more" -// -3 from the count because the 3 displayed don't count in the "more" -$comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, 'generic_comment'); -if ($comment_count < 3) { - $more_comments_count = 0; -} else { - $more_comments_count = $comment_count - 3; -} - -// body contents, generated by the river view in each plugin -echo $vars['body']; - -// display latest 3 comments if there are any -if ($comments){ - $counter = 0; - - echo "
"; - echo "" . elgg_echo('comments') . ''; - - if ($likes_count != 0) { - echo elgg_view('forms/likes/display', array('entity' => $object)); - } - - echo "
"; // close river-comments-tabs - - echo "
"; - - if ($likes_count != 0) { - //show the users who liked the object - // this is loaded via ajax to avoid pounding the server with avatar requests. - echo ""; - } - - echo "
"; - // display appropriate comment link - if ($more_comments_count > 0) { - echo "" . - elgg_echo('riverdashboard:n_more_comments', array($more_comments_count)) . ''; - - echo "" . elgg_echo('riverdashboard:show_less') . ''; - } - echo "
"; - foreach ($comments as $comment) { - //get the comment owner - $comment_owner = get_user($comment->owner_guid); - //get the comment owner's profile url - $comment_owner_url = $comment_owner->getURL(); - // color-code each of the 3 comments - // @todo this isn't used in CSS... - if( ($counter == 2 && $comment_count >= 4) || ($counter == 1 && $comment_count == 2) || ($counter == 0 && $comment_count == 1) || ($counter == 2 && $comment_count == 3) ) { - $alt = 'latest'; - } else if( ($counter == 1 && $comment_count >= 4) || ($counter == 0 && $comment_count == 2) || ($counter == 1 && $comment_count == 3) ) { - $alt = 'penultimate'; - } - //display comment - echo "
"; - echo ""; - echo elgg_view("profile/icon", array('entity' => $comment_owner, 'size' => 'tiny')); - echo ""; - - //truncate comment to 150 characters and strip tags - $contents = elgg_get_excerpt($comment->value, 150); - - echo "
"; - echo "" . $comment_owner->name . ' ' . parse_urls($contents) . ''; - echo "" . elgg_view_friendly_time($comment->time_created) . ""; - echo "
"; - $counter++; - } - - // close comments_list, comments_container and river-comments - echo '
' . elgg_make_river_comment($object) . '
'; -} else { - // tab bar nav - for users that liked object - if ($vars['item']->type != 'user' && $likes_count != 0) { - echo "
"; - } - - if ($likes_count != 0) { - echo elgg_view('forms/likes/display', array('entity' => $object)); - } - - if ($vars['item']->type != 'user' && $likes_count != 0) { - echo "
"; // close river-comments-tabs - } - - if ($vars['item']->type != 'user') { - echo "
"; - } - if ($likes_count != 0) { - //show the users who liked the object - echo ""; - } - - // if there are no comments to display - // and this is not a user - include the inline comment form - if ($vars['item']->type != 'user') { - echo elgg_make_river_comment($object); - } - if ($vars['item']->type != 'user') { - echo "
"; - } -} diff --git a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php deleted file mode 100644 index e1c6ab07f..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php +++ /dev/null @@ -1,18 +0,0 @@ -"; - $form_body .= elgg_view('input/text',array( - 'internalname' => 'generic_comment', - 'value' => 'Add a comment...', - 'js' => "onfocus=\"if (this.value=='Add a comment...') { this.value='' };\" onblur=\"if (this.value=='') { this.value='Add a comment...' }\"" - )); - $form_body .= elgg_view('input/hidden', array('internalname' => 'entity_guid', 'value' => $vars['entity']->getGUID())); - $form_body .= elgg_view('input/submit', array('value' => elgg_echo("Comment"))); - $form_body .= ""; - echo elgg_view('input/form', array('body' => $form_body, 'action' => "action/comments/add")); -} \ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/sitemessage.php b/mod/riverdashboard/views/default/riverdashboard/sitemessage.php deleted file mode 100644 index 522b32740..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/sitemessage.php +++ /dev/null @@ -1,77 +0,0 @@ - 'object', 'subtypes' => 'sitemessage', 'limit' => 1)); -if ($site_message) { - $mes = $site_message[0]; - $message = $mes->description; - $dateStamp = elgg_view_friendly_time($mes->time_created); - $delete = elgg_view("output/confirmlink",array( - 'href' => "action/riverdashboard/delete?message=" . $mes->guid, - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )); -} - -//if there is a site message -if ($site_message) { - - echo "

" . elgg_echo("sitemessages:announcements") . "

"; - echo "

" . elgg_echo("sitemessages:posted") . ": " . $dateStamp; - //if admin display the delete link - if (isadminloggedin()) { - echo " " . $delete . " "; - } - echo "

"; - //display the message - echo "

" . $message . "

"; - - //display the input form to add a new message - if (isadminloggedin()) { - //action - $action = "riverdashboard/add"; - $link = elgg_echo("sitemessages:add"); - $input_area = elgg_view('input/plaintext', array('internalname' => 'sitemessage', 'value' => '')); - $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save'))); - $form_body = <<{$link}

-
- {$input_area}
{$submit_input} -
- -EOT; - //display the form - echo elgg_view('input/form', array('action' => "action/$action", 'body' => $form_body)); - - }//end of admin if statement - - //if there is no message, add a form to create one -} else { - - if (isadminloggedin()) { - - //action - $action = "riverdashboard/add"; - $link = elgg_echo("sitemessages:add"); - $input_area = elgg_view('input/text', array('internalname' => 'sitemessage', 'value' => '')); - $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save'))); - $form_body = <<{$link}

-
- {$input_area}
{$submit_input} -
-EOT; - //display the form - echo elgg_view('input/form', array('action' => "action/$action", 'body' => $form_body)); - - }//end of admin check -}//end of main if diff --git a/mod/riverdashboard/views/default/riverdashboard/welcome.php b/mod/riverdashboard/views/default/riverdashboard/welcome.php deleted file mode 100644 index f5152135e..000000000 --- a/mod/riverdashboard/views/default/riverdashboard/welcome.php +++ /dev/null @@ -1,8 +0,0 @@ - -

name); ?>

\ No newline at end of file diff --git a/mod/riverdashboard/views/json/riverdashboard/container.php b/mod/riverdashboard/views/json/riverdashboard/container.php deleted file mode 100644 index 871a6cc7e..000000000 --- a/mod/riverdashboard/views/json/riverdashboard/container.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/mod/riverdashboard/views/rss/riverdashboard/container.php b/mod/riverdashboard/views/rss/riverdashboard/container.php deleted file mode 100644 index 871a6cc7e..000000000 --- a/mod/riverdashboard/views/rss/riverdashboard/container.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file -- cgit v1.2.3