return; } $owner = $entity->getOwnerEntity(); if (!empty($owner) && elgg_instanceof($owner, "user")) { $icon = elgg_view_entity_icon($owner, "medium", array("use_hover" => false)); $profile_fields = elgg_get_config("profile_fields"); $brief = false; $description = false; if (!empty($profile_fields)) { foreach ($profile_fields as $metadata_name => $type) { if ($metadata_name == "briefdescription") { $brief = $type; } elseif ($metadata_name == "description") { $description = $type; } } } $content = "<h3>" . elgg_view("output/url", array("text" => $owner->name, "href" => $owner->getURL(), "is_trusted" => true)) . "</h3>"; if ($brief && $owner->briefdescription) { $content .= "<div>"; $content .= elgg_view("output/" . $brief, array("value" => $owner->briefdescription)); $content .= "</div>"; } if ($description && $owner->description) { $content .= "<div>"; $content .= "<strong>" . elgg_echo("profile:description") . "</strong>"; $content .= elgg_view("output/" . $description, array("value" => elgg_get_excerpt($owner->description, 200))); $content .= "</div>"; } echo elgg_view_image_block($icon, $content, array("class" => "mtm pam blog-tools-full-owner")); }
/** * Format a recipient to be listed in the recipient autocomplete or listing * * @param mixed $recipient Can be an ElggUser, ElggGroup or email address * * @return array Contains, of false on failure * - type : user, group or email * - label: used in the autocomplete dropdown * - content: used in the listing view * - value: eighter a guid of email address */ function newsletter_format_recipient($recipient) { $result = false; if (!empty($recipient)) { if (elgg_instanceof($recipient, "user")) { $icon = elgg_view_entity_icon($recipient, "tiny", array("use_hover" => false, "use_link" => false)); // label for autoselect listing $label = elgg_view_image_block($icon, $recipient->name, array("class" => "elgg-autocomplete-item")); // content for if selected $content = "<div class='newsletter-recipient-result phs'>"; $content .= elgg_view("input/hidden", array("name" => "user_guids[]", "value" => $recipient->getGUID())); $content .= elgg_view_image_block($icon, $recipient->name, array("image_alt" => elgg_view_icon("delete-alt"))); $content .= "</div>"; $result = array("type" => "user", "value" => $recipient->getGUID(), "label" => $label, "content" => $content); } elseif (elgg_instanceof($recipient, "group")) { $icon = elgg_view_entity_icon($recipient, "tiny", array("use_hover" => false, "href" => false)); // label for autoselect listing $name = "<span>" . elgg_echo("groups:group") . ": </span>" . $recipient->name; $name .= "<span class='elgg-quiet'> (" . $recipient->getMembers(0, 0, true) . " " . elgg_echo("groups:member") . ")</span>"; $label = elgg_view_image_block($icon, $name, array("class" => "elgg-autocomplete-item newsletter-recipient-autocomplete-group")); // content for if selected $name = $recipient->name; $name .= "<span class='elgg-quiet'> (" . $recipient->getMembers(0, 0, true) . " " . elgg_echo("groups:member") . ")</span>"; $content = "<div class='newsletter-recipient-result phs'>"; $content .= elgg_view("input/hidden", array("name" => "group_guids[]", "value" => $recipient->getGUID())); $content .= elgg_view_image_block($icon, $name, array("image_alt" => elgg_view_icon("delete-alt"))); $content .= "</div>"; $result = array("type" => "group", "value" => $recipient->getGUID(), "label" => $label, "content" => $content); } elseif (newsletter_is_email_address($recipient)) { $name = "<span>" . elgg_echo("newsletter:recipients:email") . ": </span>" . $recipient; $label = elgg_view_image_block("", $name, array("class" => "elgg-autocomplete-item newsletter-recipient-autocomplete-email")); $content = "<div class='newsletter-recipient-result phs'>"; $content .= elgg_view("input/hidden", array("name" => "emails[]", "value" => $recipient)); $content .= elgg_view_image_block("", $recipient, array("image_alt" => elgg_view_icon("delete-alt"))); $content .= "</div>"; $result = array("type" => "email", "label" => $label, "content" => $content); } } return $result; }
<?php $entity = elgg_extract('entity', $vars); if (elgg_is_admin_logged_in()) { elgg_require_js('pool/reorder'); } $turns = $entity->getTurnsNowAndAfter(); $items = ''; foreach ($turns as $turn) { $date = date('j.n.Y', $turn->value); $time = date('H:i', $turn->value); $name = $turn->getOwnerEntity()->name; $user = $turn->getOwnerEntity(); $image = elgg_view_entity_icon($user, 'small'); $metadata = null; if (elgg_is_admin_logged_in()) { $metadata = elgg_view('output/confirmlink', array('text' => elgg_echo('pool:remove'), 'href' => "action/pool/remove?guid={$entity->guid}&user_guid={$user->guid}", 'is_action' => true, 'class' => 'elgg-menu-entity')); } $body = elgg_view('object/elements/summary', array('entity' => $user, 'subtitle' => $user->name, 'metadata' => $metadata, 'title' => elgg_echo('pool:list:title', array($date, $time)))); $block = elgg_view_image_block($image, $body, array('id' => $user->guid)); $items .= "<li>{$block}</li>"; } echo "<ul id=\"elgg-pool-users\">{$items}</ul>";
{$anchor} <div class="mbn"> \t{$menu} \t{$commenter_link} \t<span class="elgg-subtext"> \t\t{$friendlytime} \t</span> \t{$comment_text} </div> HTML; if ($moderating) { $html = elgg_view_image_block($commenter_icon, $body); echo elgg_view_image_block($checkbox, $html, array('class' => 'moderated-comment')); } else { echo elgg_view_image_block($commenter_icon, $body); } } else { // brief view $excerpt = elgg_get_excerpt($comment->description, 80); $posted = elgg_echo('generic_comment:on', array($commenter_link, $entity_link)); $body = <<<HTML <span class="elgg-subtext"> \t{$posted} ({$friendlytime}): {$excerpt} </span> HTML; if ($moderating) { echo elgg_view_image_block($commenter_icon, $body, array('class' => 'moderated-comment')); } else { echo elgg_view_image_block($commenter_icon, $body); } }
<?php $entity = elgg_extract('entity', $vars); $full_view = elgg_extract('full_view', $vars); if ($full_view) { echo elgg_view('object/static/full', $vars); return; } $icon = ''; $editor = $entity->getLastEditor(); if ($editor) { $icon = elgg_view_entity_icon($editor, 'tiny'); } $metadata = elgg_view_menu('entity', ['entity' => $entity, 'handler' => 'static', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz']); $excerpt = elgg_get_excerpt($entity->description); $params = ['entity' => $entity, 'metadata' => $metadata, 'subtitle' => elgg_view('static/by_line', $vars), 'content' => $excerpt]; $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($icon, $list_body);
$form_data .= '<table class="elgg-table">'; $form_data .= '<thead>'; $form_data .= '<tr>'; $form_data .= '<th class="center">' . elgg_view('input/checkbox', ['name' => 'checkall', 'default' => false]) . '</th>'; $form_data .= '<th>' . elgg_echo('groups:group') . '</th>'; $form_data .= '<th class="center">' . elgg_echo('groups:edit') . '</th>'; $form_data .= '<th class="center">' . elgg_echo('groups:delete') . '</th>'; $form_data .= '</tr>'; $form_data .= '</thead>'; // add group rows $rows = []; foreach ($batch as $group) { $cells = []; // brief view $icon = elgg_view_entity_icon($group, 'tiny'); $params = ['entity' => $group, 'metadata' => '', 'subtitle' => $group->briefdescription]; $list_body = elgg_view('group/elements/summary', $params); $group_summary = elgg_view_image_block($icon, $list_body); $cells[] = elgg_format_element('td', ['class' => 'center'], elgg_view('input/checkbox', ['name' => 'group_guids[]', 'value' => $group->getGUID(), 'default' => false])); $cells[] = elgg_format_element('td', [], $group_summary); $cells[] = elgg_format_element('td', ['class' => 'center'], elgg_view('output/url', ['text' => elgg_view_icon('settings-alt'), 'title' => elgg_echo('edit'), 'href' => "groups/edit/{$group->getGUID()}"])); $cells[] = elgg_format_element('td', ['class' => 'center'], elgg_view('output/url', ['text' => elgg_view_icon('delete-alt'), 'title' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), 'href' => "action/groups/delete?guid={$group->getGUID()}"])); $rows[] = elgg_format_element('tr', [], implode('', $cells)); } $form_data .= elgg_format_element('tbody', [], implode('', $rows)); $form_data .= '</table>'; $form_data .= $delete_button; // pagination $form_data .= elgg_view('navigation/pagination', ['limit' => $limit, 'offset' => $offset, 'count' => $group_count]); echo elgg_view('input/form', ['id' => 'group-tools-admin-bulk-delete', 'action' => 'action/group_tools/admin/bulk_delete', 'body' => $form_data]); elgg_require_js('group_tools/group_bulk_delete');
break; case 'day': $time_lower = $now - 1 * 24 * 60 * 60; break; default: $time_lower = null; break; } $limit = get_input('limit', 10); $offset = get_input('offset', 0); $leaders = get_leaderboard($time_lower, $now, $limit, $offset); if (sizeof($leaders) > 0) { echo '<ul class="elgg-list">'; foreach ($leaders as $leader) { $icon = elgg_view_entity_icon($leader, 'small'); $link = elgg_view('output/url', array('text' => $leader->name, 'href' => $leader->getURL())); $badges = elgg_list_entities_from_relationship(array('relationship' => HYPEGAMEMECHANICS_CLAIMED_REL, 'relationship_guid' => $leader->guid, 'inverse_relationship' => false, 'limit' => 0, 'full_view' => false, 'list_type' => 'gallery', 'icon_size' => 'small', 'icon_user_status' => false, 'gallery_class' => 'gm-badge-gallery', 'item_class' => 'gm-badge-item')); $score = elgg_get_annotations(array('annotation_calculation' => 'sum', 'annotation_names' => 'gm_score', 'guids' => $leader->guid, 'annotation_created_time_lower' => $time_lower, 'annotation_created_time_upper' => $time_upper)); if ((int) $score < 0) { $score_str = "<span class=\"gm-score-negative\">{$score}</span>"; } else { $score_str = "<span class=\"gm-score-positive\">+{$score}</span>"; } echo '<li class="elgg-item">'; echo elgg_view_image_block($icon, $link . $badges, array('image_alt' => $score_str)); echo '</li>'; } echo '</ul>'; } else { echo '<p>' . elgg_echo('mechanics:leaderboard:empty') . '</p>'; }
* * @package ElggGroups */ $reply = elgg_extract('entity', $vars, FALSE); if (!$reply) { return true; } $poster = $reply->getOwnerEntity(); $poster_icon = elgg_view_entity_icon($poster, 'tiny'); $poster_link = elgg_view('output/url', array('href' => $poster->getURL(), 'text' => $poster->name, 'is_trusted' => true)); $poster_text = elgg_echo('byline', array($poster->name)); $date = elgg_view_friendly_time($reply->time_created); // Do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { $metadata = ''; } else { $metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'discussion_reply', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz')); } $subtitle = "{$poster_text} {$date}"; if (elgg_in_context('activity')) { $content = '<div class="elgg-output elgg-inner" data-role="comment-text">'; $content .= elgg_view('output/text', array('value' => elgg_get_excerpt($reply->description))); $content .= '</div>'; } else { $content = elgg_view('output/longtext', array('value' => $reply->description, 'class' => 'elgg-inner', 'data-role' => 'discussion-reply-text')); } $params = array('entity' => $reply, 'metadata' => $metadata, 'subtitle' => $subtitle, 'content' => $content); $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($poster_icon, $list_body);
* - search_url (defaults to entity->getURL()) * - search_time (defaults to entity->time_updated or entity->time_created) * * @uses $vars['entity'] Entity returned in a search */ namespace hypeJunction\Gallery; $entity = $vars['entity']; $icon = elgg_view_entity_icon($entity->getOwnerEntity(), 'tiny'); $image = elgg_view_entity_icon($entity, 'small'); $title = $entity->getVolatileData('search_matched_title'); $description = $entity->getVolatileData('search_matched_description'); $extra_info = $entity->getVolatileData('search_matched_extra'); $url = $entity->getVolatileData('search_url'); if (!$url) { $url = $entity->getURL(); } $title = "<a href=\"{$url}\">{$title}</a>"; $time = $entity->getVolatileData('search_time'); if (!$time) { $tc = $entity->time_created; $tu = $entity->time_updated; $time = elgg_view_friendly_time($tu > $tc ? $tu : $tc); } $body = "<p class=\"mbn\">{$title}</p>{$description}"; if ($extra_info) { $body .= "<p class=\"elgg-subtext\">{$extra_info}</p>"; } $body .= "<p class=\"elgg-subtext\">{$time}</p>"; echo elgg_view_image_block($icon, $body, array('image_alt' => $image));
<?php $user = elgg_extract('entity', $vars); if (empty($user) || !elgg_instanceof($user, 'user')) { return; } $groups = $user->getGroups('', 6); if (empty($groups)) { return; } $title = elgg_view_icon('group', 'prs'); $title .= elgg_echo('groups'); $content = ''; foreach ($groups as $group) { $icon = elgg_view_entity_icon($group, 'tiny'); $group_link = elgg_view('output/url', array('text' => $group->name, 'href' => $group->getURL(), 'is_trusted' => true)); $content .= elgg_view_image_block($icon, $group_link); } // more groups $icon = elgg_view_icon('arrow-circle-o-right'); $link = elgg_view('output/url', array('text' => elgg_echo('groups:all'), 'href' => 'groups/member/' . $user->username, 'is_trusted' => true)); $content .= elgg_view_image_block($icon, $link, array('class' => 'elgg-divide-top')); echo elgg_view_module('aside', $title, $content, array('class' => 'theme-haarlem-intranet-profile-group-membership'));
} // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { $metadata = ''; } else { $metadata = elgg_view_menu('entity', array('entity' => $entity, 'handler' => 'projects', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz')); } $subtitle .= "{$author_text} {$date} {$comments_link}"; if ($full_view) { $body = "<br><label>" . elgg_echo("gvprojects:description") . "</label>"; $body .= elgg_view('output/longtext', array('value' => $entity->description)); $body .= "<br><label>" . elgg_echo("gvprojects:competencies") . "</label>"; if ($entity->competencies) { $competencies = $entity->competencies; } else { $competencies = elgg_echo("gvproject:no_competency"); } $body .= elgg_view('output/longtext', array('value' => $competencies)); $body .= "<br>" . elgg_echo("gvproject:participate", array($container_link)); $params = array('entity' => $entity, 'metadata' => $metadata, 'subtitle' => $subtitle); $params = $params + $vars; $summary = elgg_view('object/elements/summary', $params); echo elgg_view('object/elements/full', array('entity' => $entity, 'title' => true, 'icon' => $container_icon, 'summary' => $summary, 'body' => $body)); } else { // brief view $params = array('entity' => $entity, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, 'content' => $entity->short_desc); $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($container_icon, $list_body); } }
$menu_params['class'] = 'elgg-menu-user-membership'; $menu = elgg_view_menu('membership', $menu_params); $metadata = ''; if (!elgg_in_context('widgets')) { $menu_params['class'] = 'elgg-menu-hz'; $metadata = elgg_view_menu('entity', $menu_params); } $title = null; $query = elgg_extract('query', $vars, get_input('query')); if ($query && elgg_is_active_plugin('search')) { $name = search_get_highlighted_relevant_substrings($entity->getDisplayName(), $query); $username = search_get_highlighted_relevant_substrings(strtolower($entity->username), $query); $title = elgg_view('output/url', array('href' => $entity->getURL(), 'text' => "{$name} (<small>@{$username}</small>)")); } $subtitle = elgg_trigger_plugin_hook('subtitle', 'user', $vars, $subtitle); $subtitle_str = ''; foreach ($subtitle as $s) { $subtitle_str .= elgg_format_element('span', ['class' => 'elgg-member-subtitle-element'], $s); } if ($entity->briefdescription) { $view_subtitle = $subtitle_str . '<br />' . $entity->briefdescription; } else { $view_subtitle = $subtitle_str; } $icon = elgg_view_entity_icon($entity, $size); $summary = elgg_view('user/elements/summary', array('entity' => $entity, 'title' => $title, 'metadata' => $metadata, 'content' => $menu, 'subtitle' => $view_subtitle)); echo elgg_view_image_block($icon, $summary, array('class' => 'elgg-user-member')); ?> <script> require(['user/format/member']); </script>
$icon = ''; } // @todo Sometimes we find comments on entities we can't display... if ($entity->getVolatileData('search_unavailable_entity')) { $title = elgg_echo('search:comment_on', array(elgg_echo('search:unavailable_entity'))); // keep anchor for formatting. $title = "<a>{$title}</a>"; } else { if ($entity->getType() == 'object') { $title = $entity->title; } else { $title = $entity->name; } if (!$title) { $title = elgg_echo('item:' . $entity->getType() . ':' . $entity->getSubtype()); } if (!$title) { $title = elgg_echo('item:' . $entity->getType()); } $title = elgg_echo('search:comment_on', array($title)); // @todo this should use something like $comment->getURL() $url = $entity->getURL() . '#comment_' . $entity->getVolatileData('search_match_annotation_id'); $title = "<a href=\"{$url}\">{$title}</a>"; } $description = $entity->getVolatileData('search_matched_comment'); $tc = $entity->getVolatileData('search_matched_comment_time_created'); $time = elgg_view_friendly_time($tc); $body = "<p class=\"mbn\">{$title}</p>{$description}"; $body .= "<p class=\"elgg-subtext\">{$time}</p>"; echo elgg_view_image_block($icon, $body);
/** * Group bookmarks sidebar * * @package ElggGroups * * @uses $vars['entity'] Group entity * @uses $vars['limit'] The number of members to display */ if (elgg_is_active_plugin('bookmarks')) { $title = elgg_echo('groups:bookmarks'); $bookmarks = elgg_get_entities(array('type' => 'object', 'subtype' => 'bookmarks', 'container_guid' => $vars['entity']->guid)); //var_dump($bookmarks); $body = ""; /* //TODO:Quizás es mejor, puesto que muestra más objetos como el de compartir, mirar de usarlo más adelante $body = elgg_view_entity_list( $bookmarks, array("count"=> 0, "offset" => 0, "limit" => 5, "full_view" => false, ) );*/ /*TODO:hacer que te mande al sitio además de a la página del enlace (no encuentro el atributo de url del mismo)*/ foreach ($bookmarks as $bookmark) { $body .= elgg_view_image_block(elgg_view('output/url', array('href' => $bookmark->getURL(), 'text' => $bookmark->title, 'is_trusted' => true))); } $all_link = elgg_view('output/url', array('href' => 'bookmarks/group/' . $vars['entity']->guid, 'text' => elgg_echo('groups:bookmarks:more'), 'is_trusted' => true)); $body .= "<div class='center mts'>{$all_link}</div>"; echo elgg_view_module('aside', $title, $body); }
<?php $ipsum = elgg_view('developers/ipsum'); $user = new ElggUser(); $image = elgg_view_entity_icon($user, 'small'); $image_alt = elgg_view_icon('user-plus'); echo elgg_view_image_block($image, "{$ipsum} {$ipsum} {$ipsum} {$ipsum} {$ipsum} {$ipsum} {$ipsum}", ['class' => 'theme-sandbox-image-block', 'data-type' => 'user', 'image_alt' => $image_alt]);
$user_avatar = elgg_view('output/img', array('src' => $vars['entity']->getIconUrl('medium'), 'alt' => elgg_echo('avatar'))); $current_label = elgg_echo('avatar:current'); $remove_button = ''; if ($vars['entity']->icontime) { $remove_button = elgg_view('output/url', array('text' => elgg_echo('remove'), 'title' => elgg_echo('avatar:remove'), 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(), 'is_action' => true, 'class' => 'elgg-button elgg-button-cancel mll')); } $form_params = array('enctype' => 'multipart/form-data'); $upload_form = elgg_view_form('avatar/upload', $form_params, $vars); ?> <p class="mtm"> <?php echo elgg_echo('avatar:upload:instructions'); ?> </p> <?php $image = <<<HTML <div id="current-user-avatar" class="mrl prl"> \t<label>{$current_label}</label><br /> \t{$user_avatar} </div> {$remove_button} HTML; $body = <<<HTML <div id="avatar-upload"> \t{$upload_form} </div> HTML; echo elgg_view_image_block($image, $upload_form);
<?php /** * View for chat message objects * * @package Chat */ $entity = elgg_extract('entity', $vars); $owner = $entity->getOwnerEntity(); $owner_name = $owner->name; $date = elgg_view_friendly_time($entity->time_created); $user = elgg_get_logged_in_user_entity(); $time_created = "<span id=\"timestamp\" class=\"hidden\">{$entity->time_created}</span>"; $subtitle = "{$owner_name} {$date} {$time_created}"; $params = array('entity' => $entity, 'metadata' => $metadata, 'subtitle' => $subtitle, 'content' => $entity->description); $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); $owner_icon = elgg_view_entity_icon($owner, 'small', array('use_hover' => false)); $not_read = check_entity_relationship($entity->getGUID(), 'unread', $user->getGUID()); if ($not_read) { // Additional class to notify that message hasn't been read before. $vars['class'] = 'elgg-chat-unread'; // Mark message read remove_entity_relationship($entity->getGUID(), 'unread', $user->getGUID()); } echo elgg_view_image_block($owner_icon, $list_body, $vars);
<?php $emails = elgg_extract("emails", $vars); $group = elgg_extract("entity", $vars); if (!empty($emails)) { $content = "<ul class='elgg-list'>"; foreach ($emails as $annotation) { list(, $email) = explode("|", $annotation->value); $email_title = elgg_view("output/email", array("value" => $email)); $url = "action/group_tools/revoke_email_invitation?annotation_id=" . $annotation->id . "&group_guid=" . $group->getGUID(); $delete_button = elgg_view("output/url", array("href" => $url, "confirm" => elgg_echo("group_tools:groups:membershipreq:invitations:revoke:confirm"), "text" => elgg_echo("group_tools:revoke"), "class" => "elgg-button elgg-button-delete mlm")); $body = "<h4>{$email_title}</h4>"; $content .= "<li class='elgg-item'>"; $content .= elgg_view_image_block("", $body, array("image_alt" => $delete_button)); $content .= "</li>"; } $content .= "</ul>"; // pagination $content .= elgg_view("navigation/pagination", $vars); } else { $content = elgg_view("output/longtext", array("value" => elgg_echo("group_tools:groups:membershipreq:email_invitations:none"))); } echo $content;
<?php /** * shows a group membership a user has done with a group */ $user = elgg_get_page_owner_entity(); if (!$user instanceof ElggUser || !$user->canEdit()) { return; } $group = elgg_extract('entity', $vars); if (!$group instanceof ElggGroup) { return; } $icon = elgg_view_entity_icon($group, 'small'); $menu = elgg_view_menu('membershiprequest', ['entity' => $group, 'user' => $user, 'order_by' => 'priority', 'class' => 'elgg-menu-hz float-alt']); $summary = elgg_view('group/elements/summary', ['entity' => $group, 'subtitle' => $group->briefdescription, 'metadata' => $menu]); echo elgg_view_image_block($icon, $summary);
* @author Cash Costello * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ $image = $photo = $vars['entity']; $album = $image->getContainerEntity(); $img = elgg_view_entity_icon($image, 'large', array('href' => $image->getIconURL('master'))); $owner_link = elgg_view('output/url', array('href' => "photos/owner/" . $photo->getOwnerEntity()->username, 'text' => $photo->getOwnerEntity()->name)); $author_text = elgg_echo('byline', array($owner_link)); $date = elgg_view_friendly_time($image->time_created); $owner_icon = elgg_view_entity_icon($photo->getOwnerEntity(), 'medium'); $metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'photos', 'sort_by' => 'priority', 'class' => 'list-inline')); $subtitle = "{$author_text} {$date}"; $params = array('entity' => $photo, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags); $list_body = elgg_view('object/elements/summary', $params); $params = array('class' => 'mbl'); $summary = elgg_view_image_block($owner_icon, $list_body, $params); echo $summary; echo '<div class=" center">'; if ($album->getSize() > 1) { echo elgg_view('object/image/navigation', $vars); } echo elgg_view('photos/tagging/help', $vars); echo elgg_view('photos/tagging/select', $vars); echo $img; echo elgg_view('photos/tagging/tags', $vars); echo '</div>'; // alternative way to display the fivestar rating widget in case the default view defined in Elggx Fivestar is not to be used // if (elgg_is_active_plugin('elggx_fivestar')) { // echo '<br>'; // echo elgg_view('elggx_fivestar/voting', array('entity'=> $vars['entity'])); // }
if ($time_preference == 'date') { $friendlytime = date(elgg_echo("friendlytime:date_format"), $folder->time_created); } else { $friendlytime = elgg_view_friendly_time($folder->time_created); } $title = $folder->title; $entity_menu = ""; if (!elgg_in_context("widgets")) { $entity_menu = elgg_view_menu("entity", array("entity" => $folder, "handler" => "bookmark_tools/bmfolder", "sort_by" => "priority", "class" => "elgg-menu-hz")); } if ($full_view) { // full view $icon = elgg_view_entity_icon($folder, "small"); $owner_link = elgg_view("output/url", array("text" => $folder->getOwnerEntity()->name, "href" => $folder->getOwnerEntity()->getURL())); $owner_text = elgg_echo("byline", array($owner_link)); $subtitle = "{$owner_text} {$friendlytime}"; $params = array("entity" => $folder, "metadata" => $entity_menu, "tags" => elgg_view("output/tags", array("value" => $folder->tags)), "subtitle" => $subtitle); $params = $params + $vars; $summary = elgg_view("object/elements/summary", $params); echo elgg_view("object/elements/full", array("entity" => $folder, "title" => false, "icon" => $icon, "summary" => $summary, "body" => elgg_view("output/longtext", array("value" => $folder->description)))); } else { // summary view $icon = elgg_view_entity_icon($folder, "tiny"); if (!elgg_in_context("widgets")) { $icon_alt = elgg_view("input/checkbox", array("name" => "bmfolder_guids[]", "value" => $folder->getGUID(), "default" => false)); } $params = array("entity" => $folder, "metadata" => $entity_menu); $params = $params + $vars; $list_body = elgg_view("object/elements/summary", $params); echo elgg_view_image_block($icon, $list_body, array("class" => "bookmark-tools-folder", "image_alt" => $icon_alt)); }
<?php $entities = elgg_extract('entities', $vars); $content = ''; if (!empty($entities)) { $lis = []; foreach ($entities as $entity) { $icon = elgg_view_entity_icon($entity, 'small'); $info = elgg_view('output/url', ['href' => $entity->getURL(), 'text' => $entity->name, 'is_trusted' => true]); $info .= '<br />'; $info .= elgg_view('output/url', ['href' => "action/friend_request/approve?guid={$entity->getGUID()}", 'text' => elgg_echo('friend_request:approve'), 'is_action' => true]); $info .= ' | '; $info .= elgg_view('output/url', ['href' => "action/friend_request/decline?guid={$entity->getGUID()}", 'text' => elgg_echo('friend_request:decline'), 'is_action' => true]); $lis[] = elgg_format_element('li', ['class' => 'elgg-item elgg-item-user'], elgg_view_image_block($icon, $info)); } $content = elgg_format_element('ul', ['class' => 'elgg-list elgg-list-entity'], implode('', $lis)); } else { $content = elgg_echo('friend_request:received:none'); } echo elgg_view_module('info', elgg_echo('friend_request:received:title'), $content, ['class' => 'mbm']);
* @uses $vars['image_block_vars'] Attributes for the image block wrapper */ $entity = elgg_extract('entity', $vars); if (!$entity instanceof ElggEntity) { elgg_log("object/elements/summary expects an ElggEntity in \$vars['entity']", 'ERROR'); } $title = elgg_extract('title', $vars, ''); if ($title === '' && $entity instanceof ElggEntity) { $vars['title'] = elgg_view('output/url', ['text' => elgg_get_excerpt($entity->getDisplayName(), 100), 'href' => $entity->getURL()]); } $tags = elgg_extract('tags', $vars, ''); if ($tags === '') { $tags = elgg_view('output/tags', ['entity' => $entity]); } $metadata = elgg_view('object/elements/summary/metadata', $vars); $title = elgg_view('object/elements/summary/title', $vars); $subtitle = elgg_view('object/elements/summary/subtitle', $vars); $extensions = elgg_view('object/summary/extend', $vars); $content = elgg_view('object/elements/summary/content', $vars); $summary = $metadata . $title . $subtitle . $tags . $extensions . $content; $icon = elgg_extract('icon', $vars); if (isset($icon)) { $params = (array) elgg_extract('image_block_vars', $vars, []); $class = elgg_extract_class($params); $class = elgg_extract_class($vars, $class); $params['class'] = $class; $params['data-guid'] = $entity->guid; echo elgg_view_image_block($icon, $summary, $params); } else { echo $summary; }
// 'text' => '<i class="wall-icon wall-icon-file"></i>', // 'title' => elgg_echo('wall:file'), // 'href' => '#wall-form-file', // 'class' => 'wall-tab', // 'priority' => 300 // )); // $forms .= elgg_view_form('wall/file', array( // 'id' => 'wall-form-file', // 'class' => 'wall-form hidden', // 'enctype' => 'multipart/form-data' // ), $vars); //} if (hypeWall()->config->get('content') && elgg_is_active_plugin('elgg_tokeninput')) { elgg_register_menu_item('wall-filter', array('name' => 'content', 'text' => '<i class="wall-icon wall-icon-content"></i>', 'title' => elgg_echo('wall:content'), 'href' => '#wall-form-content', 'selected' => $default == 'content', 'link_class' => 'wall-tab', 'priority' => 300)); $class = 'wall-form'; if ($default !== 'content') { $class .= ' hidden'; } $forms .= elgg_view_form('wall/content', array('id' => 'wall-form-content', 'class' => $class), $vars); } $forms .= elgg_view('framework/wall/container/extend', $vars); $tabs = elgg_view_menu('wall-filter', array('sort_by' => 'priority')); $class = elgg_in_context('activity') ? 'wall-river' : 'wall-to-wall'; if (elgg_in_context('widgets')) { $user_icon = $page_owner_icon = ''; $forms = $tabs . $forms; echo elgg_view_image_block($user_icon . $page_owner_icon, $forms, array('class' => "wall-container {$class}")); } else { $forms = $tabs . '<div class="wall-bubble">' . $forms . '</div>'; echo elgg_view_image_block($user_icon . $page_owner_icon, $forms, array('class' => "wall-container wall-post {$class}")); }
<?php /* @var $entity WizardStep */ $entity = elgg_extract('entity', $vars); $full_view = (bool) elgg_extract('full_view', $vars); $entity_menu = ''; if (!elgg_in_context('widgets')) { $entity_menu = elgg_view_menu('entity', ['entity' => $entity, 'handler' => 'wizard_step', 'class' => 'elgg-menu-hz', 'sort_by' => 'priority']); } if ($full_view) { // something } else { $params = ['title' => elgg_view_icon('arrows', ['class' => 'mrs']) . $entity->getDisplayName(), 'content' => $entity->description, 'metadata' => $entity_menu]; $params = $params + $vars; $list_content = elgg_view('object/elements/summary', $params); echo elgg_view_image_block('', $list_content); }
<?php /** * Elgg Polls plugin * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 */ $poll = $vars['entity']; $owner = $poll->getOwnerEntity(); $friendlytime = elgg_get_friendly_time($poll->time_created); $responses = $poll->countAnnotations('vote'); $icon = '<img src="' . elgg_get_site_url() . 'mod/polls/graphics/poll.png" />'; $info = "<a href=\"{$poll->getURL()}\">{$poll->question}</a><br>"; if ($responses == 1) { $noun = elgg_echo('polls:noun_response'); } else { $noun = elgg_echo('polls:noun_responses'); } $info .= "{$responses} {$noun}<br>"; $info .= "<p class=\"owner_timestamp\"><a href=\"{$owner->getURL()}\">{$owner->name}</a> {$friendlytime}</p>"; echo elgg_view_image_block($icon, $info);
/** * Elgg show the users who liked the object * * @uses $vars['annotation'] */ if (!isset($vars['annotation'])) { return true; } $like = $vars['annotation']; $user = $like->getOwnerEntity(); if (!$user) { return true; } $user_icon = elgg_view_entity_icon($user, 'tiny'); $user_link = elgg_view('output/url', array('href' => $user->getURL(), 'text' => $user->name, 'is_trusted' => true)); $likes_string = elgg_echo('likes:this'); $friendlytime = elgg_view_friendly_time($like->time_created); if ($like->canEdit()) { $delete_button = elgg_view("output/confirmlink", array('href' => "action/likes/delete?id={$like->id}", 'text' => elgg_view_icon('delete', 'float-alt'), 'confirm' => elgg_echo('likes:delete:confirm'), 'encode_text' => false)); } $body = <<<HTML <p class="mbn"> \t{$delete_button} \t{$user_link} {$likes_string} \t<span class="elgg-subtext"> \t\t{$friendlytime} \t</span> </p> HTML; echo elgg_view_image_block($user_icon, $body);
$answer_link = elgg_view("output/url", array("href" => $poster->getURL(), "text" => $poster->name)); $answer_text = elgg_echo("questions:answered:correct", array($answer_link, $answer_time)); } elseif ($latestAnswer = $question->getLatestAnswer()) { $poster = $latestAnswer->getOwnerEntity(); $answer_time = elgg_view_friendly_time($latestAnswer->time_created); $answer_link = elgg_view("output/url", array("href" => $poster->getURL(), "text" => $poster->name)); $answer_text = elgg_echo("questions:answered", array($answer_link, $answer_time)); } else { $answer_text = null; } } $title_text .= elgg_get_excerpt($question->title, 100); if ($workflow) { $title = elgg_view('questions/workflow/status', array('question' => $question)); } $title .= elgg_view("output/url", array("text" => $title_text, "href" => $url, "is_trusted" => true)); $subtitle = "{$poster_text} {$date} {$categories}"; $content = elgg_get_excerpt($question->description); $params = array("entity" => $question, "title" => $title, "subtitle" => $subtitle . "<br />" . $answer_text, "tags" => $tags, "content" => $content); if ($workflow) { $params['metadata'] = elgg_view("questions/workflow/overview", array('question' => $question)); } $list_body = elgg_view("object/elements/summary", $params); if (!$workflow) { $list_body .= elgg_view_menu("ffd_questions_body", array("sort_by" => "priority", "entity" => $question, "class" => "elgg-menu-hz float-alt")); $image_alt = elgg_view_menu("ffd_questions_alt", array("sort_by" => "priority", "entity" => $question)); } else { $image_alt = null; } echo elgg_view_image_block($poster_icon, $list_body, array("image_alt" => $image_alt, "class" => "ffd-question-list-item")); }
$result .= "</div>"; } } else { // simple $owner = $entity->getOwnerEntity(); $icon = ""; if ($show_avatar) { $icon = elgg_view_entity_icon($owner, "small"); } $text = elgg_view("output/url", array("href" => $entity_url, "text" => $entity->title)); $text .= "<br />"; $text .= "<a href='" . $owner->getURL() . "'>" . $owner->name . "</a>"; if ($show_timestamp) { $text .= " <span class='elgg-quiet'>" . elgg_view_friendly_time($entity->time_created) . "</span>"; } $result .= elgg_view_image_block($icon, $text); } $result .= "</li>"; } $result .= "</ul>"; } } else { $result = elgg_list_entities($options); } if (empty($result)) { $result = elgg_echo("notfound"); } elseif ($widget->show_search_link == "yes" && !empty($widget->tags) && elgg_is_active_plugin("search")) { $tags = $widget->tags; if (elgg_is_active_plugin("search_advanced")) { $tags_text = $tags; } else {
<?php $card = elgg_extract('object', $vars); $full = elgg_extract('full_view', $vars); if (!$card instanceof Stripe_Card) { return; } $img = strtolower(str_replace(' ', '', $card->type)); $icon = elgg_view('output/img', array('src' => "mod/stripe/graphics/credit_card/{$img}.png", 'class' => 'stripe-card-icon', 'width' => 50)); $title = "{$card->type}-{$card->last4}"; $actions = elgg_view_menu('stripe-actions', array('object' => $card, 'sort_by' => 'priority')); if (!$full) { echo elgg_view_image_block($icon, $title); return; } ?> <div class="stripe-row stripe-object stripe-card"> <div class="stripe-col-1of12 stripe-card-icon"> <?php echo $icon; ?> </div> <div class="stripe-col-4of12 stripe-card-title"> <?php echo $title; ?> </div> <div class="stripe-col-4of12 stripe-card-expiry"> <?php echo "{$card->exp_month} / {$card->exp_year}";