本文整理汇总了PHP中elgg_view_entity函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_view_entity函数的具体用法?PHP elgg_view_entity怎么用?PHP elgg_view_entity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_view_entity函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: blog_get_page_content_read
/**
* Get page components to view a blog post.
*
* @param int $guid GUID of a blog entity.
* @return array
*/
function blog_get_page_content_read($guid = NULL)
{
$return = array();
$blog = get_entity($guid);
// no header or tabs for viewing an individual blog
$return['filter'] = '';
if (!elgg_instanceof($blog, 'object', 'blog')) {
$return['content'] = elgg_echo('noaccess');
return $return;
}
$return['title'] = $blog->title;
$container = $blog->getContainerEntity();
if (elgg_instanceof($container, 'group')) {
elgg_pop_breadcrumb();
elgg_push_breadcrumb(elgg_echo("gvgroups:" . $container->grouptype . "groups"), "groups/" . $container->grouptype);
elgg_push_breadcrumb($container->name, "blog/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($container->name, "blog/owner/{$container->username}");
}
elgg_push_breadcrumb($blog->title);
$return['content'] = elgg_view_entity($blog, array('full_view' => true));
//check to see if comment are on
if ($blog->comments_on != 'Off') {
$return['content'] .= elgg_view_comments($blog);
}
return $return;
}
示例2: blog_get_page_content_read
/**
* Returns HTML for a blog post.
*
* @param int $guid of a blog entity.
* @return string html
*/
function blog_get_page_content_read($owner_guid = NULL, $guid = NULL)
{
$content = elgg_view('page_elements/content_header', array('context' => $context, 'type' => 'blog'));
if ($guid) {
$blog = get_entity($guid);
if (!elgg_instanceof($blog, 'object', 'blog') && $blog->status == 'final') {
$content .= elgg_echo('blog:error:post_not_found');
} else {
elgg_push_breadcrumb($blog->title, $blog->getURL());
$content .= elgg_view_entity($blog, TRUE);
}
} else {
$options = array('type' => 'object', 'subtype' => 'blog', 'full_view' => FALSE, 'order_by_metadata' => array('name' => 'publish_date', 'direction' => 'DESC', 'as' => 'int'));
if ($owner_guid) {
$options['owner_guid'] = $owner_guid;
}
// show all posts for admin or users looking at their own blogs
// show only published posts for other users.
if (!(isadminloggedin() || isloggedin() && $owner_guid == get_loggedin_userid())) {
$options['metadata_name_value_pairs'] = array(array('name' => 'status', 'value' => 'published'), array('name' => 'publish_date', 'operand' => '<', 'value' => time()));
}
$content .= elgg_list_entities_from_metadata($options);
}
return array('content' => $content);
}
示例3: blog_get_page_content_read
/**
* Get page components to view a blog post.
*
* @param int $guid GUID of a blog entity.
* @return array
*/
function blog_get_page_content_read($guid = NULL)
{
$return = array();
$blog = get_entity($guid);
// no header or tabs for viewing an individual blog
$return['filter'] = '';
if (!elgg_instanceof($blog, 'object', 'blog')) {
$return['content'] = elgg_echo('blog:error:post_not_found');
return $return;
}
$return['title'] = htmlspecialchars($blog->title);
$container = $blog->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
elgg_push_breadcrumb($crumbs_title, "blog/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($crumbs_title, "blog/owner/{$container->username}");
}
elgg_push_breadcrumb($blog->title);
$return['content'] = elgg_view_entity($blog, array('full_view' => true));
//check to see if comment are on
if ($blog->comments_on != 'Off') {
$return['content'] .= elgg_view_comments($blog);
}
return $return;
}
示例4: blog_get_page_content_read
/**
* Get page components to view a blog post.
*
* @param int $guid GUID of a blog entity.
* @return array
*/
function blog_get_page_content_read($guid = NULL)
{
$return = array();
elgg_entity_gatekeeper($guid, 'object', 'blog');
$blog = get_entity($guid);
// no header or tabs for viewing an individual blog
$return['filter'] = '';
elgg_set_page_owner_guid($blog->container_guid);
elgg_group_gatekeeper();
$return['title'] = $blog->title;
$container = $blog->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
elgg_push_breadcrumb($crumbs_title, "blog/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($crumbs_title, "blog/owner/{$container->username}");
}
elgg_push_breadcrumb($blog->title);
$return['content'] = elgg_view_entity($blog, array('full_view' => true));
// check to see if we should allow comments
if ($blog->comments_on != 'Off' && $blog->status == 'published') {
$return['content'] .= elgg_view_comments($blog);
}
return $return;
}
示例5: blog_get_page_content_read
/**
* Get page components to view a blog post.
*
* @param int $guid GUID of a blog entity.
* @return array
*/
function blog_get_page_content_read($guid = NULL)
{
$return = array();
$blog = get_entity($guid);
// no header or tabs for viewing an individual blog
$return['filter'] = '';
if (!elgg_instanceof($blog, 'object', 'blog')) {
register_error(elgg_echo('noaccess'));
$_SESSION['last_forward_from'] = current_page_url();
forward('');
}
$return['title'] = $blog->title;
$container = $blog->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
elgg_push_breadcrumb($crumbs_title, "blog/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($crumbs_title, "blog/owner/{$container->username}");
}
elgg_push_breadcrumb($blog->title);
$return['content'] = elgg_view_entity($blog, array('full_view' => true));
// check to see if we should allow comments
if ($blog->comments_on != 'Off' && $blog->status == 'published') {
$return['content'] .= elgg_view_comments($blog);
}
return $return;
}
示例6: podcasts_get_page_content_view
/**
* Get page components to view a podcast
*
* @param int $guid GUID of a podcast entity.
*
* @return array
*/
function podcasts_get_page_content_view($guid = NULL)
{
$return = array();
$podcast = get_entity($guid);
// no header or tabs for viewing an individual podcast
$return['filter'] = '';
if (!elgg_instanceof($podcast, 'object', 'podcast')) {
register_error(elgg_echo('noaccess'));
$_SESSION['last_forward_from'] = current_page_url();
forward('');
}
$return['title'] = elgg_echo('podcasts:episode_title', array(podcasts_get_episode_number($podcast), $podcast->title));
$container = $podcast->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
elgg_push_breadcrumb($crumbs_title, "podcasts/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($crumbs_title, "podcasts/owner/{$container->username}");
}
elgg_push_breadcrumb($podcast->title);
$return['content'] = elgg_view_entity($podcast, array('full_view' => true));
$return['content'] .= elgg_view_comments($podcast);
$return['layout'] = 'one_sidebar';
return $return;
}
示例7: webinar_get_page_content_view
/**
* Get page components to view a webinar.
*
* @param int $guid GUID of a webinar entity.
* @return array
*/
function webinar_get_page_content_view($guid)
{
$return = array();
$return = array('filter' => '');
$webinar = get_entity($guid);
if (!elgg_instanceof($webinar, 'object', 'webinar')) {
register_error(elgg_echo('webinar:error:not_found'));
forward(REFERER);
}
//set button join, subscribe/unsubscribe and start/top
webinar_menu_title($guid);
//set breadcrumb
$container = $webinar->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
elgg_push_breadcrumb($crumbs_title, "webinar/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($crumbs_title, "webinar/owner/{$container->username}");
}
//set Title
$return['title'] = htmlspecialchars($webinar->title);
elgg_push_breadcrumb($webinar->title);
$return['content'] .= elgg_view_entity($webinar, array('full_view' => true));
if ($webinar->comments_on != 'Off') {
$return['content'] .= elgg_view_comments($webinar);
}
$return['sidebar'] = $webinar->getSidebar();
return $return;
}
示例8: elgg_view_widgets
/**
* Output a single column of widgets.
*
* @param ElggUser $user The owner user entity.
* @param string $context The context (profile, dashboard, etc.)
* @param int $column Which column to output.
* @param bool $show_access Show the access control (true by default)
*/
function elgg_view_widgets($user, $context, $column, $show_access = true)
{
$widgets = elgg_get_widgets($user->guid, $context);
$column_widgets = $widgets[$column];
$column_html = "<div class=\"elgg-widgets\" id=\"elgg-widget-col-{$column}\">";
if (sizeof($column_widgets) > 0) {
foreach ($column_widgets as $widget) {
if (elgg_is_widget_type($widget->handler)) {
$column_html .= elgg_view_entity($widget, array('show_access' => $show_access));
}
}
}
$column_html .= '</div>';
return $column_html;
}
示例9: display_widget
/**
* Displays a particular widget
*
* @param ElggObject $widget The widget to display
* @return string The HTML for the widget, including JavaScript wrapper
*
* @deprecated 1.8 Use elgg_view_entity()
*/
function display_widget(ElggObject $widget)
{
elgg_deprecated_notice("display_widget() was been deprecated. Use elgg_view_entity().", 1.8);
return elgg_view_entity($widget);
}
示例10: elgg_echo
* @package ElggRiverDash
* Full Creadit goes to ELGG Core Team for creating a beautiful social networking script
*
* Modified by Satheesh PM, BARC, Mumbai, India..
* http://satheesh.anushaktinagar.net
*
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
* @version 1.0
*
*/
if (elgg_is_active_plugin('tidypics')) {
$title = elgg_echo('river_activity_3C:photo');
$num = (int) elgg_get_plugin_setting('num_photo', 'river_activity_3C');
$box_view = elgg_get_plugin_setting('view_riverbox', 'river_activity_3C');
$latest_photos = elgg_get_entities_from_metadata(array("type" => "object", "subtype" => "album", "limit" => $num, "full_view" => false, "pagination" => false, "view_type_toggle" => false));
if ($latest_photos) {
elgg_push_context('widgets');
$river_body = '';
foreach ($latest_photos as $latest_photo) {
$river_body .= elgg_view_entity($latest_photo, array('full_view' => false));
}
elgg_pop_context();
$river_body .= '<p style="text-align:right; margin:3px 3px;"><a href="' . $vars["url"] . 'photos/all"><b>' . elgg_echo('river_activity_3C:viewmore') . '</b></a></p>';
echo elgg_view_module($box_view, $title, $river_body);
} else {
$river_body = elgg_echo('river_activity_3C:photo-no');
echo elgg_view_module($box_view, $title, $river_body);
}
}
示例11: elgg_view
echo elgg_view('page/layouts/widgets/add_button');
}
$params = array('widgets' => $widgets, 'context' => $context, 'exact_match' => $exact_match, 'show_access' => $show_access, 'class' => 'btn btn-primary mrgn-bttm-sm');
echo elgg_view('page/layouts/widgets/add_panel', $params);
}
/*
if (isset($vars['content'])) {
echo $vars['content'];
}
*/
//$widget_class = "elgg-col-1of{$num_columns}";
$widget_class = "col-sm-6";
for ($column_index = 1; $column_index <= $num_columns; $column_index++) {
if (isset($widgets[$column_index])) {
$column_widgets = $widgets[$column_index];
} else {
$column_widgets = array();
}
echo "<div class=\"{$widget_class} elgg-widgets\" id=\"elgg-widget-col-{$column_index}\">";
if (sizeof($column_widgets) > 0) {
foreach ($column_widgets as $widget) {
if (array_key_exists($widget->handler, $widget_types)) {
echo elgg_view_entity($widget, array('show_access' => $show_access));
}
}
}
echo '</div>';
}
elgg_pop_context();
echo elgg_view('graphics/ajax_loader', array('id' => 'elgg-widget-loader'));
echo '</div>';
示例12: elgg_push_context
<?php
/**
* Elgg owner block
* Displays page ownership information
*
* @package Elgg
* @subpackage Core
*
*/
elgg_push_context('owner_block');
// groups and other users get owner block
$owner = elgg_get_page_owner_entity();
if ($owner instanceof ElggGroup || $owner instanceof ElggUser && $owner->getGUID() != elgg_get_logged_in_user_guid()) {
$header = elgg_view_entity($owner, array('full_view' => false));
$body = elgg_view_menu('owner_block', array('entity' => $owner));
$body .= elgg_view('page/elements/owner_block/extend', $vars);
echo elgg_view('page/components/module', array('header' => $header, 'body' => $body, 'class' => 'elgg-owner-block'));
}
elgg_pop_context();
示例13: elgg_extract
<?php
$group = elgg_extract('entity', $vars);
$subgroup = elgg_extract('subgroup', $vars);
if (!$group instanceof ElggGroup || !$subgroup instanceof ElggGroup) {
return;
}
elgg_push_context('widgets');
// use widgets context so no entity menu is used
if (\AU\SubGroups\can_move_subgroup($subgroup, $group)) {
$class = 'au-subgroups-parentable';
} else {
$class = 'au-subgroups-non-parentable';
}
$action_url = elgg_normalize_url("action/au_subgroups/move?parent_guid={$group->guid}");
$action_url = elgg_add_action_tokens_to_url($action_url);
$view = elgg_view_entity($group, array('full_view' => false));
echo elgg_format_element('div', ['class' => \AU\SubGroups\can_move_subgroup($subgroup, $group) ? 'au-subgroups-parentable' : 'au-subgroups-non-parentable', 'data-action' => $action_url], $view);
elgg_pop_context();
示例14: search_list_users_by_name
/**
* Returns a formatted list of users suitable for injecting into search.
*
*/
function search_list_users_by_name($hook, $user, $returnvalue, $tag)
{
// Change this to set the number of users that display on the search page
$threshold = 4;
$object = get_input('object');
if (!get_input('offset') && (empty($object) || $object == 'user')) {
if ($users = search_for_user($tag, $threshold)) {
$countusers = search_for_user($tag, 0, 0, "", true);
$return = elgg_view('user/search/startblurb', array('count' => $countusers, 'tag' => $tag));
foreach ($users as $user) {
$return .= elgg_view_entity($user);
}
$return .= elgg_view('user/search/finishblurb', array('count' => $countusers, 'threshold' => $threshold, 'tag' => $tag));
return $return;
}
}
}
示例15: elgg_echo
echo '<table class="elgg-table">';
echo '<tr>';
if ($vars['folder'] == "inbox") {
echo "<th class='msg-list-owner'>" . elgg_echo('messages:from') . "</th>";
} elseif ($vars['folder'] == "find") {
echo "<th class='msg-list-owner'>" . elgg_echo('messages:who') . "</th>";
} else {
echo "<th class='msg-list-owner'>" . elgg_echo('messages:to') . "</th>";
}
echo "<th class='msg-list-subject'>" . elgg_echo('messages:title') . "</th>";
echo "<th class='msg-list-timestamp'>" . elgg_echo('messages:date') . "</th>";
echo "<th class='msg-list-delete'></th>";
echo '</tr>';
if ($messages) {
foreach ($messages as $message) {
echo elgg_view_entity($message, array('full_view' => false, 'folder' => $vars['folder'], 'excerpt' => $excerpt));
}
echo '</table>';
} else {
echo '</table>';
echo elgg_echo('messages:nomessages');
}
echo $pagination;
echo "<br>";
echo elgg_view('input/hidden', array('value' => 'process', 'name' => 'page'));
echo '<div class="elgg-foot messages-buttonbank">';
echo elgg_view('input/submit', array('value' => elgg_echo('delete'), 'name' => 'delete', 'class' => 'elgg-button-delete', 'js' => "OnClick=\"return confirm(elgg.echo('messages:delete'));\""));
if ($vars['folder'] == "inbox") {
echo elgg_view('input/submit', array('value' => elgg_echo('messages:markread'), 'name' => 'read'));
}
echo elgg_view('input/button', array('value' => elgg_echo('messages:toggle'), 'class' => 'elgg-button elgg-button-cancel', 'id' => 'messages-toggle'));