示例#1
0
<?php

/**
 * History of revisions of a page
 *
 * @package ElggPages
 */
$page_guid = get_input('guid');
$page = get_entity($page_guid);
if (!$page) {
}
$container = $page->getContainerEntity();
if (!$container) {
}
elgg_set_page_owner_guid($container->getGUID());
if (elgg_instanceof($container, 'group')) {
    elgg_push_breadcrumb($container->name, "pages/group/{$container->guid}/all");
} else {
    elgg_push_breadcrumb($container->name, "pages/owner/{$container->username}");
}
pages_prepare_parent_breadcrumbs($page);
elgg_push_breadcrumb($page->title, $page->getURL());
elgg_push_breadcrumb(elgg_echo('pages:history'));
$title = $page->title . ": " . elgg_echo('pages:history');
if ($page->getSubtype() == 'etherpad' || $page->getSubtype() == 'subpad') {
    $content = elgg_view_entity($page, array('timeslider' => true, 'full_view' => true));
} else {
    $content = list_annotations($page_guid, 'page', 20, false);
}
$body = elgg_view_layout('content', array('filter' => '', 'content' => $content, 'title' => $title, 'sidebar' => elgg_view('pages/sidebar/navigation', array('page' => $page))));
echo elgg_view_page($title, $body);
示例#2
0
文件: history.php 项目: eokyere/elgg
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 */
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
gatekeeper();
$page_guid = get_input('page_guid');
$pages = get_entity($page_guid);
if ($pages->container_guid) {
    set_page_owner($pages->container_guid);
} else {
    set_page_owner($pages->owner_guid);
}
if (is_callable('group_gatekeeper')) {
    group_gatekeeper();
}
$limit = (int) get_input('limit', 20);
$offset = (int) get_input('offset');
$page_guid = get_input('page_guid');
$pages = get_entity($page_guid);
add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral');
$title = $pages->title . ": " . elgg_echo("pages:history");
$area2 = elgg_view_title($title);
$context = get_context();
set_context('search');
$area2 .= list_annotations($page_guid, 'page', $limit, false);
set_context($context);
pages_set_navigation_parent($pages);
$area3 = elgg_view('pages/sidebar/tree');
$body = elgg_view_layout('two_column_left_sidebar', '', $area2, $area3);
page_draw($title, $body);
示例#3
0
<?php

/**
 * History of revisions of a project
 *
 * @package ElggPages
 */
$project_guid = get_input('guid');
$project = get_entity($project_guid);
if (!$project) {
}
$container = $project->getContainerEntity();
if (!$container) {
}
elgg_set_page_owner_guid($container->getGUID());
if (elgg_instanceof($container, 'group')) {
    elgg_push_breadcrumb($container->name, "projects/group/{$container->guid}/all");
} else {
    elgg_push_breadcrumb($container->name, "projects/owner/{$container->username}");
}
projects_prepare_parent_breadcrumbs($project);
elgg_push_breadcrumb($project->title, $project->getURL());
elgg_push_breadcrumb(elgg_echo('projects:history'));
$title = $project->title . ": " . elgg_echo('projects:history');
$content = list_annotations($project_guid, 'project', 20, false);
$body = elgg_view_layout('content', array('filter' => '', 'content' => $content, 'title' => $title, 'sidebar' => elgg_view('projects/sidebar/navigation', array('project' => $project))));
echo elgg_view_page($title, $body);
示例#4
0
文件: elgglib.php 项目: eokyere/elgg
/**
 * Automatically views comments and a comment form relating to the given entity
 *
 * @param ElggEntity $entity The entity to comment on
 * @return string|false The HTML (etc) for the comments, or false on failure
 */
function elgg_view_comments($entity)
{
    if (!$entity instanceof ElggEntity) {
        return false;
    }
    if ($comments = trigger_plugin_hook('comments', $entity->getType(), array('entity' => $entity), false)) {
        return $comments;
    } else {
        $comments = list_annotations($entity->getGUID(), 'generic_comment');
        //display the comment form
        $comments .= elgg_view('comments/forms/edit', array('entity' => $entity));
        return $comments;
    }
}
示例#5
0
}
$title = "";
if ($entity instanceof ElggUser || $entity instanceof ElggGroup) {
    $title = $entity->name;
} else {
    if ($entity instanceof ElggObject && $entity->getSubtype() == 'thewire') {
        $title = $entity->description;
    } else {
        $title = $entity->title;
    }
}
$title = sprintf(elgg_echo('river_comments:allcommentsof'), $title);
//$comments_count = (int) count_annotations($entity_guid, "", "", 'generic_comment');
$comments_count = (int) elgg_get_annotations(array('annotation_names' => 'generic_comment', 'guid' => $entity_guid, 'count' => true));
if (!$callback) {
    $content = list_annotations($entity_guid, 'generic_comment', $comments_count);
} else {
    $comments_offset = 0;
    $comments_limit = $comments_count;
    if ($comments_count > 2) {
        $comments_limit -= 2;
    }
    //$comments = get_annotations($entity_guid, "", "", 'generic_comment', "", "", $comments_limit, $comments_offset);
    $comments = elgg_get_annotations(array('guid' => $entity_guid, 'annotation_name' => 'generic_comment', 'limit' => $comments_limit, 'offset' => $comments_offset));
    foreach ($comments as $comment) {
        $owner = get_user($comment->owner_guid);
        $content .= elgg_view('river_comments/river_comment', array('owner' => $owner, 'annotation' => $comment));
    }
}
$content = elgg_view_layout('content', elgg_view_title($title) . $content);
elgg_view_page($title, $content);