diff --git a/plugins/unl_theme/views/default/object/blog.php b/plugins/unl_theme/views/default/object/blog.php new file mode 100644 index 0000000000000000000000000000000000000000..12399f74874149bff60ef89b0308c78c880b84e9 --- /dev/null +++ b/plugins/unl_theme/views/default/object/blog.php @@ -0,0 +1,93 @@ +<?php +/** + * View for blog objects + * + * @package Blog + */ + +$full = elgg_extract('full_view', $vars, FALSE); +$blog = elgg_extract('entity', $vars, FALSE); + +if (!$blog) { + return TRUE; +} + +$owner = $blog->getOwnerEntity(); +$categories = elgg_view('output/categories', $vars); +$excerpt = $blog->excerpt; +if (!$excerpt) { + $excerpt = elgg_get_excerpt($blog->description); +} + +$owner_icon = elgg_view_entity_icon($owner, 'medium'); + +$vars['owner_url'] = "blog/owner/$owner->username"; +$by_line = elgg_view('page/elements/by_line', $vars); + +// The "on" status changes for comments, so best to check for !Off +if ($blog->comments_on != 'Off') { + $comments_count = $blog->countComments(); + //only display if there are commments + if ($comments_count != 0) { + $text = elgg_echo("comments") . " ($comments_count)"; + $comments_link = elgg_view('output/url', array( + 'href' => $blog->getURL() . '#comments', + 'text' => $text, + 'is_trusted' => true, + )); + } else { + $comments_link = ''; + } +} else { + $comments_link = ''; +} + +$subtitle = "$by_line $comments_link $categories"; + +$metadata = ''; +if (!elgg_in_context('widgets')) { + // only show entity menu outside of widgets + $metadata = elgg_view_menu('entity', array( + 'entity' => $vars['entity'], + 'handler' => 'blog', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); +} + +if ($full) { + + $body = elgg_view('output/longtext', array( + 'value' => $blog->description, + 'class' => 'blog-post', + )); + + $params = array( + 'entity' => $blog, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + ); + $params = $params + $vars; + $summary = elgg_view('object/elements/summary', $params); + + echo elgg_view('object/elements/full', array( + 'summary' => $summary, + 'icon' => $owner_icon, + 'body' => $body, + )); + +} else { + // brief view + + $params = array( + 'entity' => $blog, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'content' => $excerpt, + ); + $params = $params + $vars; + $list_body = elgg_view('object/elements/summary', $params); + + echo elgg_view_image_block($owner_icon, $list_body); +} diff --git a/plugins/unl_theme/views/default/object/bookmarks.php b/plugins/unl_theme/views/default/object/bookmarks.php new file mode 100644 index 0000000000000000000000000000000000000000..a70e83854de650b2e66998626b39beae77028dcc --- /dev/null +++ b/plugins/unl_theme/views/default/object/bookmarks.php @@ -0,0 +1,119 @@ +<?php +/** + * Elgg bookmark view + * + * @package ElggBookmarks + */ + +$full = elgg_extract('full_view', $vars, FALSE); +$bookmark = elgg_extract('entity', $vars, FALSE); + +if (!$bookmark) { + return; +} + +$owner = $bookmark->getOwnerEntity(); +$owner_icon = elgg_view_entity_icon($owner, 'medium'); +$categories = elgg_view('output/categories', $vars); + +$link = elgg_view('output/url', array('href' => $bookmark->address)); +$description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl')); + +$vars['owner_url'] = "bookmarks/owner/$owner->username"; +$by_line = elgg_view('page/elements/by_line', $vars); + +$comments_count = $bookmark->countComments(); +//only display if there are commments +if ($comments_count != 0) { + $text = elgg_echo("comments") . " ($comments_count)"; + $comments_link = elgg_view('output/url', array( + 'href' => $bookmark->getURL() . '#comments', + 'text' => $text, + 'is_trusted' => true, + )); +} else { + $comments_link = ''; +} + +$subtitle = "$by_line $comments_link $categories"; + +$metadata = ''; +if (!elgg_in_context('widgets') && !elgg_in_context('gallery')) { + // only show entity menu outside of widgets and gallery view + $metadata = elgg_view_menu('entity', array( + 'entity' => $vars['entity'], + 'handler' => 'bookmarks', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); +} + +if ($full && !elgg_in_context('gallery')) { + + $params = array( + 'entity' => $bookmark, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + ); + $params = $params + $vars; + $summary = elgg_view('object/elements/summary', $params); + + $bookmark_icon = elgg_view_icon('push-pin-alt'); + $body = <<<HTML +<div class="bookmark elgg-content mts"> + $bookmark_icon<span class="elgg-heading-basic mbs">$link</span> + $description +</div> +HTML; + + echo elgg_view('object/elements/full', array( + 'entity' => $bookmark, + 'icon' => $owner_icon, + 'summary' => $summary, + 'body' => $body, + )); + +} elseif (elgg_in_context('gallery')) { + echo <<<HTML +<div class="bookmarks-gallery-item"> + <h3>$bookmark->title</h3> + <p class='subtitle'>$owner_link $date</p> +</div> +HTML; +} else { + // brief view + $url = $bookmark->address; + $display_text = $url; + $excerpt = elgg_get_excerpt($bookmark->description); + if ($excerpt) { + $excerpt = " - $excerpt"; + } + + if (strlen($url) > 25) { + $bits = parse_url($url); + if (isset($bits['host'])) { + $display_text = $bits['host']; + } else { + $display_text = elgg_get_excerpt($url, 100); + } + } + + $link = elgg_view('output/url', array( + 'href' => $bookmark->address, + 'text' => $display_text, + )); + + $content = elgg_view_icon('push-pin-alt') . "$link{$excerpt}"; + + $params = array( + 'entity' => $bookmark, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'content' => $content, + ); + $params = $params + $vars; + $body = elgg_view('object/elements/summary', $params); + + echo elgg_view_image_block($owner_icon, $body); +} diff --git a/plugins/unl_theme/views/default/object/thewire.php b/plugins/unl_theme/views/default/object/thewire.php new file mode 100644 index 0000000000000000000000000000000000000000..4808264086b0fbd765abbd5f31b02b453cc282f8 --- /dev/null +++ b/plugins/unl_theme/views/default/object/thewire.php @@ -0,0 +1,63 @@ +<?php +/** + * View a wire post + * + * @uses $vars['entity'] + */ + +elgg_load_js('elgg.thewire'); + +$full = elgg_extract('full_view', $vars, FALSE); +$post = elgg_extract('entity', $vars, FALSE); + +if (!$post) { + return true; +} + +// make compatible with posts created with original Curverider plugin +$thread_id = $post->wire_thread; +if (!$thread_id) { + $post->wire_thread = $post->guid; +} + +$owner = $post->getOwnerEntity(); + +$owner_icon = elgg_view_entity_icon($owner, 'medium'); +$owner_link = elgg_view('output/url', array( + 'href' => "thewire/owner/$owner->username", + 'text' => $owner->name, + 'is_trusted' => true, +)); +$author_text = elgg_echo('byline', array($owner_link)); +$date = elgg_view_friendly_time($post->time_created); + +$subtitle = "$author_text $date"; + +$metadata = ''; +if (!elgg_in_context('widgets')) { + // only show entity menu outside of widgets + $metadata = elgg_view_menu('entity', array( + 'entity' => $post, + 'handler' => 'thewire', + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); +} + +$params = array( + 'entity' => $post, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'content' => thewire_filter($post->description), + 'tags' => false, +); +$params = $params + $vars; +$list_body = elgg_view('object/elements/summary', $params); + +echo elgg_view_image_block($owner_icon, $list_body, array('class' => 'thewire-post')); + +if ($post->reply) { + echo "<div class=\"thewire-parent hidden\" id=\"thewire-previous-{$post->guid}\">"; + echo "</div>"; +} diff --git a/plugins/unl_theme/views/default/profile/details.php b/plugins/unl_theme/views/default/profile/details.php index 1a3cc42c735311e21d65b84ef4408e69604dbad3..084a0c35aeef8dde9862a71331c0e5e5aef5d743 100755 --- a/plugins/unl_theme/views/default/profile/details.php +++ b/plugins/unl_theme/views/default/profile/details.php @@ -14,7 +14,7 @@ $user = elgg_get_page_owner_entity(); $profile_fields = elgg_get_config('profile_fields'); -echo '<div id="profile-details" class="wdn-col-four-fifths">'; +echo '<div id="profile-details" class="bp2-wdn-col-four-fifths">'; echo "<span class=\"hidden nickname p-nickname\">{$user->username}</span>"; echo "<h2 class=\"p-name fn clear-top\">{$user->name}</h2>"; @@ -34,8 +34,20 @@ $microformats = array( 'contactemail' => 'email u-email', ); +if ($user->description) { + echo "<h3 class='profile-aboutme-title wdn-sans-serif clear-top'>" . elgg_echo("profile:aboutme") . "</h3>"; + echo "<div class='PR-about-me'>"; + echo "<div class='profile-aboutme-contents'>"; + echo elgg_view('output/longtext', array('value' => $user->description, 'class' => 'mtn')); + echo "</div>"; + echo "</div>"; +} + + $even_odd = null; if (is_array($profile_fields) && sizeof($profile_fields) > 0) { + echo "<h3 class='wdn-sans-serif clear-top'>Additional Info</h3>"; + echo "<div class='PR-profile-info'>"; foreach ($profile_fields as $shortname => $valtype) { if ($shortname == "description") { // skip about me and put at bottom @@ -60,7 +72,7 @@ if (is_array($profile_fields) && sizeof($profile_fields) > 0) { // this controls the alternating class $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; ?> - <div class="<?php echo $even_odd; ?>"> + <div class="<?php echo $even_odd; ?> clearfix"> <b><?php echo elgg_echo("profile:{$shortname}"); ?>: </b> <?php $params = array( @@ -79,13 +91,8 @@ if (is_array($profile_fields) && sizeof($profile_fields) > 0) { <?php } } -} - -if ($user->description) { - echo "<p class='profile-aboutme-title'><b>" . elgg_echo("profile:aboutme") . "</b></p>"; - echo "<div class='profile-aboutme-contents'>"; - echo elgg_view('output/longtext', array('value' => $user->description, 'class' => 'mtn')); echo "</div>"; } + echo '</div>'; diff --git a/plugins/unl_theme/views/default/profile/owner_block.php b/plugins/unl_theme/views/default/profile/owner_block.php index 4ffcdc92bcc8ea25ac8b9adb68f43bff2c4f92e1..069c21d5d4e4de1ab613eb4fd13b306bee7a5980 100755 --- a/plugins/unl_theme/views/default/profile/owner_block.php +++ b/plugins/unl_theme/views/default/profile/owner_block.php @@ -25,7 +25,7 @@ $icon = elgg_view_entity_icon($user, 'large', array( 'img_class' => 'photo u-photo', )); -$icon = "<img src='" . $user->getIconURL('large') . "' class='img-responsive'/>"; +$icon = "<img src='" . $user->getIconURL('large') . "' class='img-responsive pr-profile-image'/>"; // grab the actions and admin menu items from user hover $menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array()); @@ -68,7 +68,7 @@ $content_menu = elgg_view_menu('owner_block', array( echo <<<HTML -<div class="bp2-wdn-col-one-fifth"> +<div class="bp2-wdn-col-one-fifth wdn-center"> $icon $profile_actions $content_menu diff --git a/plugins/unl_theme/views/default/resources/index.php b/plugins/unl_theme/views/default/resources/index.php new file mode 100644 index 0000000000000000000000000000000000000000..be9bcc17da1aaa14bd4208b50200da4823f1dff4 --- /dev/null +++ b/plugins/unl_theme/views/default/resources/index.php @@ -0,0 +1,24 @@ +<?php + +if (elgg_is_logged_in()) { + forward('activity'); +} + +$title = elgg_echo('content:latest'); +$content = elgg_list_river(); +if (!$content) { + $content = elgg_echo('river:none'); +} + +$login_box = elgg_view('core/account/login_box'); + +$params = array( + 'title' => $title, + 'content' => $content, + 'sidebar' => $login_box +); +$body = elgg_view_layout('one_sidebar', $params); + +echo elgg_view_page(null, $body); + + diff --git a/plugins/unl_theme/views/default/resources/river.php b/plugins/unl_theme/views/default/resources/river.php new file mode 100644 index 0000000000000000000000000000000000000000..3295a7bca02721b76fc9b2fa1201303e45341acb --- /dev/null +++ b/plugins/unl_theme/views/default/resources/river.php @@ -0,0 +1,75 @@ +<?php +/** + * Main activity stream list page + */ + +$options = array( + 'distinct' => false +); + +$page_type = preg_replace('[\W]', '', elgg_extract('page_type', $vars, 'all')); +$type = preg_replace('[\W]', '', get_input('type', 'all')); +$subtype = preg_replace('[\W]', '', get_input('subtype', '')); +if ($subtype) { + $selector = "type=$type&subtype=$subtype"; +} else { + $selector = "type=$type"; +} + +if ($type != 'all') { + $options['type'] = $type; + if ($subtype) { + $options['subtype'] = $subtype; + } +} + +switch ($page_type) { + case 'mine': + $title = elgg_echo('river:mine'); + $page_filter = 'mine'; + $options['subject_guid'] = elgg_get_logged_in_user_guid(); + break; + case 'owner': + $subject_username = elgg_extract('subject_username', $vars, ''); + $subject = get_user_by_username($subject_username); + if (!$subject) { + register_error(elgg_echo('river:subject:invalid_subject')); + forward(''); + } + elgg_set_page_owner_guid($subject->guid); + $title = elgg_echo('river:owner', array(htmlspecialchars($subject->name, ENT_QUOTES, 'UTF-8', false))); + $page_filter = 'subject'; + $options['subject_guid'] = $subject->guid; + break; + case 'friends': + $title = elgg_echo('river:friends'); + $page_filter = 'friends'; + $options['relationship_guid'] = elgg_get_logged_in_user_guid(); + $options['relationship'] = 'friend'; + break; + default: + $title = elgg_echo('river:all'); + $page_filter = 'all'; + break; +} + +$activity = elgg_list_river($options); +if (!$activity) { + $activity = elgg_echo('river:none'); +} + +$content = elgg_view('core/river/filter', array('selector' => $selector)); + +$sidebar = elgg_view('core/river/sidebar'); + +$params = array( + 'title' => $title, + 'content' => $content . $activity, + 'sidebar' => $sidebar, + 'filter_context' => $page_filter, + 'class' => 'elgg-river-layout', +); + +$body = elgg_view_layout('content', $params); + +echo elgg_view_page($title, $body); diff --git a/plugins/unl_theme/views/default/river/relationship/friend/create.php b/plugins/unl_theme/views/default/river/relationship/friend/create.php new file mode 100644 index 0000000000000000000000000000000000000000..e847b1b83b553b96b12fbf6767a02596d9a2e646 --- /dev/null +++ b/plugins/unl_theme/views/default/river/relationship/friend/create.php @@ -0,0 +1,20 @@ +<?php +/** + * Create friend river view + */ +$item = $vars['item']; +/* @var ElggRiverItem $item */ + +$subject = $item->getSubjectEntity(); +$object = $item->getObjectEntity(); + +$subject_icon = elgg_view_entity_icon($subject, 'small'); +$object_icon = elgg_view_entity_icon($object, 'small'); + +echo elgg_view('river/elements/layout', array( + 'item' => $item, + 'attachments' => $subject_icon . elgg_view_icon('arrow-right') . $object_icon, + + // truthy value to bypass responses rendering + 'responses' => ' ', +)); diff --git a/plugins/unl_theme/views/default/river/user/default/profileiconupdate.php b/plugins/unl_theme/views/default/river/user/default/profileiconupdate.php new file mode 100644 index 0000000000000000000000000000000000000000..6f30c68421fd1a0bcad1b8f49c038d1856b8d8ed --- /dev/null +++ b/plugins/unl_theme/views/default/river/user/default/profileiconupdate.php @@ -0,0 +1,30 @@ +<?php +/** + * Update avatar river view + */ + +$item = $vars['item']; +/* @var ElggRiverItem $item */ + +$subject = $item->getSubjectEntity(); + +$subject_link = elgg_view('output/url', array( + 'href' => $subject->getURL(), + 'text' => $subject->name, + 'class' => 'elgg-river-subject', + 'is_trusted' => true, +)); + +$string = elgg_echo('river:update:user:avatar', array($subject_link)); + +echo elgg_view('river/elements/layout', array( + 'item' => $item, + 'summary' => $string, + 'attachments' => elgg_view_entity_icon($subject, 'small', array( + 'use_hover' => false, + 'use_link' => false, + )), + + // truthy value to bypass responses rendering + 'responses' => ' ', +)); diff --git a/plugins/unl_theme/views/default/thewire/profile_status.php b/plugins/unl_theme/views/default/thewire/profile_status.php new file mode 100644 index 0000000000000000000000000000000000000000..549c52c639babac15f10a04a8ca3258a9b63ca1c --- /dev/null +++ b/plugins/unl_theme/views/default/thewire/profile_status.php @@ -0,0 +1,44 @@ +<?php +/** + * Latest wire post on profile page + * + * @uses $vars['entity'] User that owns this profile page + */ + +$owner = $vars['entity']->guid; + +//grab the user's latest from the wire +$params = array( + 'type' => 'object', + 'subtype' => 'thewire', + 'owner_guid' => $owner, + 'limit' => 1, +); +$latest_wire = elgg_get_entities($params); + +if ($latest_wire && count($latest_wire) > 0) { + $latest_wire = $latest_wire[0]; + $content = thewire_filter($latest_wire->description); + $time = "<p class='elgg-subtext'>(" . elgg_view_friendly_time($latest_wire->time_created) . ")</p>"; + + $button = ''; + if ($owner == elgg_get_logged_in_user_guid()) { + $url_to_wire = "thewire/owner/" . $vars['entity']->username; + $button = elgg_view('output/url', array( + 'text' => elgg_echo('update'), + 'href' => $url_to_wire, + 'class' => 'wdn-button wdn-button-brand wdn-pull-right', + 'is_trusted' => true, + )); + } + + $body = $content . $time; + $content = elgg_view_image_block('', $body, array('image_alt' => $button)); + + echo <<< HTML +<div class="wire-status elgg-border-plain pam mbm clearfix"> + $content +</div> +HTML; + +} diff --git a/plugins/unl_theme/views/default/user/default.php b/plugins/unl_theme/views/default/user/default.php new file mode 100644 index 0000000000000000000000000000000000000000..8ae3e590f27464f5c4d4e158db8eea088394f396 --- /dev/null +++ b/plugins/unl_theme/views/default/user/default.php @@ -0,0 +1,64 @@ +<?php +/** + * Elgg user display + * + * @uses $vars['entity'] ElggUser entity + * @uses $vars['size'] Size of the icon + * @uses $vars['title'] Optional override for the title + */ + +$entity = $vars['entity']; +$size = elgg_extract('size', $vars, 'large'); + +$icon = elgg_view_entity_icon($entity, $size, $vars); + +$title = elgg_extract('title', $vars); +if (!$title) { + $link_params = array( + 'href' => $entity->getUrl(), + 'text' => $entity->name, + ); + + // Simple XFN, see http://gmpg.org/xfn/ + if (elgg_get_logged_in_user_guid() == $entity->guid) { + $link_params['rel'] = 'me'; + } elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $entity->guid)) { + $link_params['rel'] = 'friend'; + } + + $title = elgg_view('output/url', $link_params); +} + +if (elgg_get_context() == 'gallery') { + echo $icon; +} else { + $metadata = ''; + if (!elgg_in_context('owner_block') && !elgg_in_context('widgets')) { + $metadata = elgg_view_menu('entity', array( + 'entity' => $entity, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz', + )); + } + + if ($entity->isBanned()) { + $banned = elgg_echo('banned'); + $params = array( + 'entity' => $entity, + 'title' => $title, + 'metadata' => $metadata, + ); + } else { + $params = array( + 'entity' => $entity, + 'title' => $title, + 'metadata' => $metadata, + 'subtitle' => $entity->briefdescription, + 'content' => elgg_view('user/status', array('entity' => $entity)), + ); + } + + $list_body = elgg_view('user/elements/summary', $params); + + echo elgg_view_image_block($icon, $list_body, $vars); +}