Пример #1
0
/**
 * 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
0
/**
 * 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);
}
/**
 * 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
0
/**
 * 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
0
/**
 * 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
0
/**
 * 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
0
/**
 * 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
0
/**
 * 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
0
/**
 * 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
0
 * @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
0
        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
0
<?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();
<?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();
/**
 * 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
0
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'));
Пример #16
0
<?php

/**
 * View a bookmark
 *
 * @package ElggBookmarks
 */
$guid = get_input('guid');
elgg_entity_gatekeeper($guid, 'object', 'bookmarks');
$bookmark = get_entity($guid);
$page_owner = elgg_get_page_owner_entity();
elgg_group_gatekeeper();
$crumbs_title = $page_owner->name;
if (elgg_instanceof($page_owner, 'group')) {
    elgg_push_breadcrumb($crumbs_title, "bookmarks/group/{$page_owner->guid}/all");
} else {
    elgg_push_breadcrumb($crumbs_title, "bookmarks/owner/{$page_owner->username}");
}
$title = $bookmark->title;
elgg_push_breadcrumb($title);
$content = elgg_view_entity($bookmark, array('full_view' => true));
$content .= elgg_view_comments($bookmark);
$body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => ''));
echo elgg_view_page($title, $body);
Пример #17
0
* @package ElggMessages
*/
gatekeeper();
$message = get_entity(get_input('guid'));
if (!$message) {
    forward('messages/inbox');
}
// mark the message as read
$message->readYet = true;
elgg_set_page_owner_guid($message->getOwnerGUID());
$page_owner = elgg_get_page_owner_entity();
$title = $message->title;
$inbox = false;
if ($page_owner->getGUID() == $message->toId) {
    $inbox = true;
    elgg_push_breadcrumb(elgg_echo('messages:inbox'), 'messages/inbox/' . $page_owner->username);
} else {
    elgg_push_breadcrumb(elgg_echo('messages:sent'), 'messages/sent/' . $page_owner->username);
}
elgg_push_breadcrumb($title);
$content = elgg_view_entity($message, array('full_view' => true));
if ($inbox) {
    $form_params = array('id' => 'messages-reply-form', 'class' => 'hidden mtl', 'action' => 'action/messages/send');
    $body_params = array('message' => $message);
    $content .= elgg_view_form('messages/reply', $form_params, $body_params);
    if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
        elgg_register_menu_item('title', array('name' => 'reply', 'href' => '#messages-reply-form', 'text' => elgg_echo('messages:answer'), 'link_class' => 'elgg-button elgg-button-action', 'rel' => 'toggle'));
    }
}
$body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => ''));
echo elgg_view_page($title, $body);
Пример #18
0
 * Elgg Market Plugin
 * @package market
 */
// Get the specified market post
$post = (int) get_input('marketpost');
// If we can get out the market post ...
if ($marketpost = get_entity($post)) {
    // Load colorbox
    elgg_load_js('lightbox');
    elgg_load_css('lightbox');
    $category = $marketpost->marketcategory;
    elgg_push_breadcrumb(elgg_echo('market:title'), "market/category");
    elgg_push_breadcrumb(elgg_echo("market:category:{$category}"), "market/category/{$category}");
    elgg_push_breadcrumb($marketpost->title);
    // Display it
    $content = elgg_view_entity($marketpost, array('full_view' => true));
    if (elgg_get_plugin_setting('market_comments', 'market') == 'yes') {
        $content .= elgg_view_comments($marketpost);
    }
    // Set the title appropriately
    $title = elgg_echo("market:category") . ": " . elgg_echo("market:category:{$category}");
} else {
    // Display the 'post not found' page instead
    $content = elgg_view_title(elgg_echo("market:notfound"));
    $title = elgg_echo("market:notfound");
}
// Show market sidebar
//$sidebar = elgg_view("market/sidebar");
$params = array('content' => $content, 'title' => $title, 'sidebar' => $sidebar, 'filter' => '', 'header' => '');
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
Пример #19
0
/**
 * View a list of entities
 *
 * @package Elgg
 * @author Curverider Ltd <*****@*****.**>
 * @link http://elgg.com/
 *
 */
$offset = $vars['offset'];
$entities = $vars['entities'];
$limit = $vars['limit'];
$count = $vars['count'];
$base_url = $vars['base_url'];
$pagination = $vars['pagination'];
$full_view = $vars['full_view'];
$html = "";
$nav = "";
if ($pagination) {
    $nav .= elgg_view('navigation/pagination', array('base_url' => $base_url, 'offset' => $offset, 'count' => $count, 'limit' => $limit));
}
$html .= $nav;
if (is_array($entities) && sizeof($entities) > 0) {
    foreach ($entities as $entity) {
        $html .= elgg_view_entity($entity, $full_view);
    }
}
if ($count) {
    $html .= $nav;
}
echo $html;
Пример #20
0
    $obj->title = "Widget {$i}";
    $w[] = $obj;
}
$column1 = array($w[0], $w[1]);
$column2 = array($w[2], $w[3]);
$column3 = array($w[4], $w[5]);
$widgets = array(1 => $column1, 2 => $column2, 3 => $column3);
$num_columns = 3;
echo '<div class="elgg-layout-widgets">';
$widget_class = "elgg-col-1of{$num_columns}";
for ($column_index = 1; $column_index <= $num_columns; $column_index++) {
    $column_widgets = $widgets[$column_index];
    echo "<div class=\"{$widget_class} elgg-widgets\" id=\"elgg-widget-col-{$column_index}\">";
    if (is_array($column_widgets) && sizeof($column_widgets) > 0) {
        foreach ($column_widgets as $widget) {
            echo elgg_view_entity($widget);
        }
    }
    echo '</div>';
}
echo '</div>';
?>
</div>
<script type="text/javascript">
	// widgets do not have guids so we override the edit toggle and delete button
	$(function() {
		$('.elgg-widget-edit-button').unbind('click');
		$('.elgg-widget-edit-button').click(function() {
			$(this).closest('.elgg-module-widget').find('.elgg-widget-edit').slideToggle('medium');
			return false;
		});
Пример #21
0
$photo->addView();
if (elgg_get_plugin_setting('tagging', 'tidypics')) {
    elgg_load_js('jquery.imgareaselect');
    elgg_require_js('tidypics/tagging');
}
// set up breadcrumbs
elgg_push_breadcrumb(elgg_echo('photos'), 'photos/siteimagesall');
elgg_push_breadcrumb(elgg_echo('tidypics:albums'), 'photos/all');
if (elgg_instanceof($owner, 'group')) {
    elgg_push_breadcrumb($owner->name, "photos/group/{$owner->guid}/all");
} else {
    elgg_push_breadcrumb($owner->name, "photos/owner/{$owner->username}");
}
elgg_push_breadcrumb($album->getTitle(), $album->getURL());
elgg_push_breadcrumb($photo->getTitle());
if (elgg_is_logged_in()) {
    if ($owner instanceof ElggGroup) {
        if ($owner->isMember(elgg_get_logged_in_user_entity())) {
            elgg_register_menu_item('title', array('name' => 'addphotos', 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . $owner->getGUID(), 'text' => elgg_echo("photos:addphotos"), 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
        }
    } else {
        elgg_register_menu_item('title', array('name' => 'addphotos', 'href' => "ajax/view/photos/selectalbum/?owner_guid=" . elgg_get_logged_in_user_guid(), 'text' => elgg_echo("photos:addphotos"), 'link_class' => 'elgg-button elgg-button-action elgg-lightbox'));
    }
}
if (elgg_get_plugin_setting('download_link', 'tidypics')) {
    // add download button to title menu
    elgg_register_menu_item('title', array('name' => 'download', 'href' => "photos/download/{$photo_guid}", 'text' => elgg_echo('image:download'), 'link_class' => 'elgg-button elgg-button-action'));
}
$content = elgg_view_entity($photo, array('full_view' => true));
$body = elgg_view_layout('content', array('filter' => false, 'content' => $content, 'title' => $photo->getTitle(), 'sidebar' => elgg_view('photos/sidebar_im', array('page' => 'tp_view', 'image' => $photo))));
echo elgg_view_page($photo->getTitle(), $body);
<?php

/**
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */
$entities = $vars['entities'];
if (is_array($entities) && sizeof($entities) > 0) {
    foreach ($entities as $entity) {
        echo elgg_view_entity($entity);
    }
}
Пример #23
0
<?php

/**
 * View individual wire post
 */
$post = get_entity(get_input('guid'));
if (!$post) {
    register_error(elgg_echo('noaccess'));
    $_SESSION['last_forward_from'] = current_page_url();
    forward('');
}
$owner = $post->getOwnerEntity();
if (!$owner) {
    forward();
}
$title = elgg_echo('thewire:by', array($owner->name));
elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
elgg_push_breadcrumb($owner->name, 'thewire/owner/' . $owner->username);
elgg_push_breadcrumb($title);
$content = elgg_view_entity($post);
$body = elgg_view_layout('content', array('filter' => false, 'content' => $content, 'title' => $title));
echo elgg_view_page($title, $body);
Пример #24
0
<?php

/**
 * View a bookmark
 *
 * @package ElggBookmarks
 */
$bookmark = get_entity(get_input('guid'));
$page_owner = elgg_get_page_owner_entity();
$crumbs_title = $page_owner->name;
if (elgg_instanceof($page_owner, 'group')) {
    elgg_push_breadcrumb($crumbs_title, "bookmarks/group/{$page_owner->guid}/owner");
} else {
    elgg_push_breadcrumb($crumbs_title, "bookmarks/owner/{$page_owner->username}");
}
$title = $bookmark->title;
elgg_push_breadcrumb($title);
$content = elgg_view_entity($bookmark, true);
$content .= elgg_view_comments($bookmark);
$body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => '', 'header' => ''));
echo elgg_view_page($title, $body);
Пример #25
0
            if (elgg_view_exists($enttype . '/' . $entsubtype . '/embed')) {
                $content = elgg_view($enttype . '/' . $entsubtype . '/embed', array('entity' => $entity, 'full' => true));
            } else {
                $content = elgg_view($enttype . '/default/embed', array('entity' => $entity, 'full' => true));
            }
            $content = str_replace("\n", "", $content);
            $content = str_replace("\r", "", $content);
            //$content = htmlentities($content,null,'utf-8');
            $content = htmlentities($content, ENT_COMPAT, "UTF-8");
            $link = "javascript:elggUpdateContent('{$content}','{$vars['internalname']}');";
            if ($entity instanceof ElggObject) {
                $title = $entity->title;
                $mime = $entity->mimetype;
            } else {
                $title = $entity->name;
                $mime = '';
            }
            set_context('search');
            if (elgg_view_exists("{$enttype}/{$entsubtype}/embedlist")) {
                $entview = elgg_view("{$enttype}/{$entsubtype}/embedlist", array('entity' => $entity));
            } else {
                $entview = elgg_view_entity($entity);
            }
            $entview = str_replace($entity->getURL(), $link, $entview);
            echo $entview;
            set_context($context);
        }
    }
}
?>
</div>
Пример #26
0
/**
 * Exports attributes generated on the fly (volatile) about an entity.
 *
 * @param string $hook        volatile
 * @param string $entity_type metadata
 * @param string $returnvalue Return value from previous hook
 * @param array  $params      The parameters, passed 'guid' and 'varname'
 *
 * @return void
 * @elgg_plugin_hook_handler volatile metadata
 * @todo investigate more.
 * @access private
 * @todo document
 */
function volatile_data_export_plugin_hook($hook, $entity_type, $returnvalue, $params)
{
    $guid = (int) $params['guid'];
    $variable_name = sanitise_string($params['varname']);
    if ($hook == 'volatile' && $entity_type == 'metadata') {
        if ($guid && $variable_name) {
            switch ($variable_name) {
                case 'renderedentity':
                    elgg_set_viewtype('default');
                    $view = elgg_view_entity(get_entity($guid));
                    elgg_set_viewtype();
                    $tmp = new ElggMetadata();
                    $tmp->type = 'volatile';
                    $tmp->name = 'renderedentity';
                    $tmp->value = $view;
                    $tmp->entity_guid = $guid;
                    return $tmp;
                    break;
            }
        }
    }
}
Пример #27
0
/**
 * View a question
 */
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
// Get the specified question
$post = (int) get_input('question_id');
// If we can get question ...
$question = get_entity($post);
if ($question instanceof ElggEntity && $question->getSubtype() == "question") {
    // Set the page owner
    if ($question->container_guid) {
        elgg_set_page_owner_guid($question->container_guid);
    } else {
        set_page_owner($question->owner_guid);
    }
    // Display it
    //$area2 = elgg_view_title(elgg_echo("answers"));
    $area2 .= elgg_view_entity($question, array('full_view' => true));
    // Set the title appropriately
    $title = sprintf(elgg_echo("answers:question:fulltitle"), $question->title);
    // Display through the correct canvas area
    //$body = elgg_view_layout("two_column_left_sidebar", '', $area2);
    $body = elgg_view_layout("content", array('content' => $area2, 'title' => sprintf(elgg_echo("answers:question:fulltitle"), $question->title), 'filter_override' => ''));
    // If we're not allowed to see the question
} else {
    // Display the 'post not found' page instead
    $body = elgg_view("answers/notfound");
    $title = elgg_echo("answers:notfound");
}
echo elgg_view_page($title, $body);
//page_draw($title, $body);
Пример #28
0
if ($search_type == 'list') {
    $limit = 10;
    $options['limit'] = $limit;
    $entities = event_manager_search_events($options);
    $returnData['content'] = elgg_view_entity_list($entities['entities'], array("count" => $entities['count'], "offset" => $offset, "limit" => $limit, 'full_view' => false, 'pagination' => false));
    if ($entities['count'] - ($offset + $limit) > 0) {
        $returnData['content'] .= '<div id="event_manager_event_list_search_more" rel="' . ($offset + $limit) . '">';
        $returnData['content'] .= elgg_echo('event_manager:list:showmorevents') . ' (' . ($entities['count'] - ($offset + $limit)) . ')</div>';
    }
    if ($entities['count'] < 1) {
        $returnData['content'] .= elgg_echo('event_manager:list:noresults');
    }
} else {
    $options['latitude'] = $latitude;
    $options['longitude'] = $longitude;
    $options['distance'] = $distance;
    $options['limit'] = 50;
    $entities = event_manager_search_events($options);
    foreach ($entities['entities'] as $event) {
        if ($event->location) {
            elgg_push_context("maps");
            $returnData['markers'][] = array('guid' => $event->getGUID(), 'lat' => $event->getLatitude(), 'lng' => $event->getLongitude(), 'title' => $event->title, 'html' => elgg_view_entity($event, array("full_view" => false)), 'hasrelation' => $event->getRelationshipByUser(), 'iscreator' => $event->getOwnerGUID() == elgg_get_logged_in_user_guid() ? 'owner' : null);
            elgg_pop_context();
        }
    }
}
$returnData['count'] = $entities['count'];
$returnData['valid'] = 1;
$returnData['offset'] = $offset;
echo json_encode($returnData);
exit;
Пример #29
0
<?php

/**
 * View H5P content
 */
$guid = elgg_extract('guid', $vars);
$entity = get_entity($guid);
if (!$entity instanceof \H5P\File) {
    register_error(elgg_echo('h5p:notfound'));
    forward(REFERER);
}
$content = elgg_view_entity($entity);
$body = elgg_view_layout('content', array('title' => $entity->title, 'filter' => false, 'content' => $content));
echo elgg_view_page($entity->title, $body);
Пример #30
0
<?php

/**
 * JSON group profile view
 *
 * @uses $vars['entity']
 */
echo elgg_view_entity($vars['entity']);