From d611e9c962ce825eb7f4600f27f74c3dc477000f Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 13 Dec 2010 12:32:43 +0000 Subject: Refs #2226 moving riverdashboard into core - need to clean up riverdashboard plugin and move to plugins repository and update plugins with new river views git-svn-id: http://code.elgg.org/elgg/trunk@7610 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/core/river/body.php | 32 +++++++++++++++++++++++ views/default/core/river/controls.php | 22 ++++++++++++++++ views/default/core/river/filter.php | 48 +++++++++++++++++++++++++++++++++++ views/default/core/river/footer.php | 46 +++++++++++++++++++++++++++++++++ views/default/core/river/image.php | 12 +++++++++ 5 files changed, 160 insertions(+) create mode 100644 views/default/core/river/body.php create mode 100644 views/default/core/river/controls.php create mode 100644 views/default/core/river/filter.php create mode 100644 views/default/core/river/footer.php create mode 100644 views/default/core/river/image.php (limited to 'views/default/core/river') diff --git a/views/default/core/river/body.php b/views/default/core/river/body.php new file mode 100644 index 000000000..4129c3b15 --- /dev/null +++ b/views/default/core/river/body.php @@ -0,0 +1,32 @@ +getSubjectEntity(); + +// 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)); + +// footer +$footer = elgg_view('core/river/footer', $vars); + +$params = array( + 'header' => $header, + 'body' => $body, + 'footer' => $footer, + 'show_inner' => false, +); +echo elgg_view('layout/objects/module', $params); diff --git a/views/default/core/river/controls.php b/views/default/core/river/controls.php new file mode 100644 index 000000000..7d6feaadd --- /dev/null +++ b/views/default/core/river/controls.php @@ -0,0 +1,22 @@ +getObjectEntity(); + +if (isloggedin()) { + if ($vars['item']->annotation_id == 0) { + $params = array( + 'href' => '#', + 'text' => elgg_echo('generic_comments:text'), + 'class' => 'elgg-toggle', + 'internalid' => "elgg-toggler-{$object->getGUID()}", + ); + echo elgg_view('output/url', $params); + //echo elgg_view('likes/forms/link', array('entity' => $object)); + } +} \ No newline at end of file diff --git a/views/default/core/river/filter.php b/views/default/core/river/filter.php new file mode 100644 index 000000000..08e211d44 --- /dev/null +++ b/views/default/core/river/filter.php @@ -0,0 +1,48 @@ + $subtypes) { + if (!is_array($subtypes)) { + $label = elgg_echo('river:select', array(elgg_echo("item:$type"))); + $options["type=$type"] = $label; + } else { + foreach ($subtypes as $subtype) { + $label = elgg_echo('river:select', array(elgg_echo("item:$type:$subtype"))); + $options["type=$type&subtype=$subtype"] = $label; + } + } + } +} + +$params = array( + 'internalid' => 'elgg-river-selector', + 'options_values' => $options, +); +$selector = $vars['selector']; +if ($selector) { + $params['value'] = $selector; +} +echo elgg_view('input/pulldown', $params); +?> + + diff --git a/views/default/core/river/footer.php b/views/default/core/river/footer.php new file mode 100644 index 000000000..de27f265f --- /dev/null +++ b/views/default/core/river/footer.php @@ -0,0 +1,46 @@ +getObjectEntity(); + +// annotations do not have comments +if ($item->annotation_id != 0 || !$object) { + return true; +} + +$comment_count = count_annotations($object->getGUID(), '', '', 'generic_comment'); + +$comments = get_annotations($object->getGUID(), "", "", 'generic_comment', "", "", 3, 0, "desc"); +if ($comments) { + $comments = array_reverse($comments); + +?> + + + 'elgg-river-comments')); + + if ($comment_count > count($comments)) { + $num_more_comments = $comment_count - count($comments); + $url = $object->getURL(); + $params = array( + 'href' => $url, + 'text' => elgg_echo('river:comments:more', array($num_more_comments)), + ); + $link = elgg_view('output/url', $params); + echo "
$link
"; + } +} + +// inline comment form +$body = elgg_view('forms/comments/inline', array('entity' => $object)); +$params = array( + 'body' => $body, + 'action' => 'action/comments/add', + 'internalid' => "elgg-togglee-{$object->getGUID()}", +); +echo elgg_view('input/form', $params); diff --git a/views/default/core/river/image.php b/views/default/core/river/image.php new file mode 100644 index 000000000..afb6b4019 --- /dev/null +++ b/views/default/core/river/image.php @@ -0,0 +1,12 @@ +getSubjectEntity(); + +echo elgg_view("profile/icon", array('entity' => $subject, 'size' => 'small')); -- cgit v1.2.3