diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/core/river/body.php | 32 | ||||
-rw-r--r-- | views/default/core/river/controls.php | 22 | ||||
-rw-r--r-- | views/default/core/river/filter.php | 48 | ||||
-rw-r--r-- | views/default/core/river/footer.php | 46 | ||||
-rw-r--r-- | views/default/core/river/image.php | 12 | ||||
-rw-r--r-- | views/default/css/screen.php | 93 | ||||
-rw-r--r-- | views/default/forms/comments/inline.php | 15 |
7 files changed, 268 insertions, 0 deletions
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 @@ +<?php +/** + * Body of river item + * + * @uses $vars[item] + */ + +$item = $vars[item]; +$subject = $item->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 <span class=\"elgg-river-timestamp\">$timestamp</span>"; + +// 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 @@ +<?php +/** + * Controls on an river item + * + * + * @uses $vars['item'] + */ + +$object = $vars['item']->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 @@ +<?php +/** + * Content filter for river + * + * @uses $vars[] + */ + +// create selection array +$options = array(); +$options['type=all'] = elgg_echo('river:select', array(elgg_echo('all'))); +$registered_entities = elgg_get_config('registered_entities'); +if (!empty($registered_entities)) { + foreach ($registered_entities as $type => $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); +?> + +<script type="text/javascript"> +$(document).ready(function() { + $('#elgg-river-selector').change(function() { + var url = window.location.href; + if (window.location.search.length) { + url = url.substring(0, url.indexOf('?')); + } + url += '?' + $(this).val(); + elgg.forward(url); + }); +}); +</script> 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 @@ +<?php +/** + * River item footer + */ + +$item = $vars['item']; +$object = $item->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); + +?> + <span class="elgg-river-comments-tab"><?php echo elgg_echo('comments'); ?></span> + +<?php + + echo elgg_view_annotation_list($comments, array('list_class' => '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 "<div class=\"elgg-river-more\">$link</div>"; + } +} + +// 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 @@ +<?php +/** + * Elgg river image + * + * Displayed next to the body of each river item + * + * @uses $vars['item'] + */ + +$subject = $vars['item']->getSubjectEntity(); + +echo elgg_view("profile/icon", array('entity' => $subject, 'size' => 'small')); diff --git a/views/default/css/screen.php b/views/default/css/screen.php index cfbae0e1e..114213a0b 100644 --- a/views/default/css/screen.php +++ b/views/default/css/screen.php @@ -226,6 +226,99 @@ a.widget-edit-button:hover, a.widget-delete-button:hover { } /* *************************************** + RIVER +*************************************** */ +.elgg-river { + border-top: 1px solid #CCCCCC; +} +.elgg-river li { + border-bottom: 1px solid #CCCCCC; +} +.elgg-river-item { + padding: 7px 0; +} +.elgg-river-item .elgg-pict { + margin-right: 20px; +} +.elgg-river-timestamp { + color: #666666; + font-size: 85%; + font-style: italic; + line-height: 1.2em; +} +.elgg-river-excerpt { + border-left: 1px solid #CCCCCC; + font-size: 85%; + line-height: 1.5em; + margin: 8px 0 5px 0; + padding-left: 5px; +} +.elgg-river-layout .input-pulldown { + float: right; + margin: 10px 0; +} + +.elgg-river-comments-tab { + display: block; + background-color: #EEEEEE; + color: #4690D6; + margin-top: 5px; + width: auto; + float: right; + font-size: 85%; + padding: 1px 7px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; +} +.elgg-river-comments { + margin: 0; + border-top: none; +} +.elgg-river-comments li:first-child { + -moz-border-radius-topleft: 5px; + -webkit-border-top-left-radius: 5px; +} +.elgg-river-comments li:last-child { + -moz-border-radius-bottomleft: 5px; + -moz-border-radius-bottomright: 5px; + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; +} +.elgg-river-comments li { + background-color: #EEEEEE; + border-bottom: none; + padding: 4px; + margin-bottom: 2px; +} +.elgg-river-comments .elgg-media { + padding: 0; +} +.elgg-river-more { + background-color: #EEEEEE; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + padding: 2px 4px; + font-size: 85%; + margin-bottom: 2px; +} +.elgg-river-item form { + background-color: #EEEEEE; + padding: 4px 4px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + display: none; + height: 30px; +} +.elgg-river-item input[type=text] { + width: 80%; +} +.elgg-river-item input[type=submit] { + margin: 0 0 0 10px; +} + +/* *************************************** LOGIN / REGISTER *************************************** */ /* login in sidebar */ diff --git a/views/default/forms/comments/inline.php b/views/default/forms/comments/inline.php new file mode 100644 index 000000000..ee5883435 --- /dev/null +++ b/views/default/forms/comments/inline.php @@ -0,0 +1,15 @@ +<?php +/** + * Inline comment form body + * + * @uses $vars['entity'] + */ + +if (isset($vars['entity']) && isloggedin()) { + echo elgg_view('input/text', array('internalname' => 'generic_comment')); + echo elgg_view('input/hidden', array( + 'internalname' => 'entity_guid', + 'value' => $vars['entity']->getGUID() + )); + echo elgg_view('input/submit', array('value' => elgg_echo('comment'))); +} |