本文整理汇总了PHP中elgg_view_image_block函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_view_image_block函数的具体用法?PHP elgg_view_image_block怎么用?PHP elgg_view_image_block使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_view_image_block函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elgg_view_entity_icon
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"));
}
示例2: newsletter_format_recipient
/**
* 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;
}
示例3: elgg_extract
<?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>";
示例4: elgg_view_image_block
{$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);
}
}
示例5: elgg_extract
<?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);
示例6: elgg_view
$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');
示例7: get_input
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>';
}
示例8: elgg_extract
*
* @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);
示例9: elgg_view_entity_icon
* - 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));
示例10: elgg_extract
<?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'));
示例11: elgg_view_menu
}
// 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);
}
}
示例12: elgg_view_menu
$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>
示例13: elgg_echo
$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);
示例14: elgg_echo
/**
* 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);
}
示例15: elgg_view
<?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]);