コード例 #1
0
/**
 * List comments with optional add form
 *
 * @uses $vars['entity']        ElggEntity
 * @uses $vars['show_add_form'] Display add form or not
 * @uses $vars['id']            Optional id for the div
 * @uses $vars['class']         Optional additional class for the div
 */
$show_add_form = elgg_extract('show_add_form', $vars, true);
$id = '';
if (isset($vars['id'])) {
    $id = "id =\"{$vars['id']}\"";
}
$class = 'elgg-comments';
if (isset($vars['class'])) {
    $class = "{$class} {$vars['class']}";
}
// work around for deprecation code in elgg_view()
unset($vars['internalid']);
echo "<div {$id} class=\"{$class}\">";
$options = array('guid' => $vars['entity']->getGUID(), 'annotation_name' => 'generic_comment');
$html = elgg_list_annotations($options);
if ($html) {
    echo '<h3>' . elgg_echo('comments') . '</h3>';
    echo $html;
}
if ($show_add_form) {
    $form_vars = array('name' => 'elgg_add_comment');
    echo elgg_view_form('comments/add', $form_vars, $vars);
}
echo '</div>';
コード例 #2
0
<?php

$entity = elgg_extract("entity", $vars);
$full_view = elgg_extract("full_view", $vars, false);
// the api application of which this is the user settings object
$api_application = $entity->getContainerEntity();
$owner = $entity->getOwnerEntity();
if ($full_view) {
    // display information about the api application
    $summary = elgg_view_entity($api_application, array("full_view" => false));
    // list all the push notification services
    $body = "";
    if ($pns = $api_application->getPushNotificationServices()) {
        $pns_names = array_keys($pns);
        $pns_options = array("guid" => $entity->getGUID(), "annotation_names" => $pns_names, "limit" => false, "owner_guid" => $owner->getGUID(), "pagination" => false);
        $body .= elgg_view_module("pns", elgg_echo("ws_pack:usersettings:push_notification_services"), elgg_list_annotations($pns_options));
    }
    echo elgg_view("object/elements/full", array("summary" => $summary, "body" => $body));
} else {
    // listing view
    $owner_icon = elgg_view_entity_icon($owner, "small");
    $owner_link = elgg_view("output/url", array("text" => $owner->name, "href" => $owner->getURL(), "is_trusted" => true));
    $subtitle = elgg_echo("entity:default:strapline", array(elgg_get_friendly_time($entity->time_created), $owner_link));
    $params = array("entity" => $entity, "metadata" => "", "title" => $api_application->getTitle(), "subtitle" => $subtitle, "content" => "");
    $params = $params + $vars;
    $summary = elgg_view("object/elements/summary", $params);
    echo elgg_view_image_block($owner_icon, $summary);
}
コード例 #3
0
<?php

$project_guid = get_input('plugin');
$project = get_entity($project_guid);
$title = elgg_echo('plugins:requests:ownership');
$content = elgg_list_annotations(array('guid' => $project->guid, 'annotation_name' => 'ownership_request', 'no_results' => elgg_echo('none')));
$sidebar = elgg_view('plugins/project_sidebar', array('entity' => $project));
$body = elgg_view_layout('one_sidebar', array('title' => $title, 'sidebar' => $sidebar, 'content' => $content));
echo elgg_view_page($title, $body);
コード例 #4
0
ファイル: answer.php プロジェクト: hejosadi/PiGo-LMS
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $answer, 'handler' => 'answers', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$date} {$comments_link} {$categories}";
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
if ($full) {
    $rating_block = elgg_view("answers/rating_block", $vars);
    $body = elgg_view('output/longtext', array('value' => $answer->description, 'class' => 'question-post'));
    $params = array('entity' => $answer, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle);
    $params = $params + $vars;
    $summary = elgg_view('object/elements/summary', $params);
    $answer_info = elgg_view_image_block($owner_icon, $summary, array('class' => 'mts'));
    $answer_comments = elgg_list_annotations(array('guid' => $answer_guid, 'annotation_name' => 'generic_comment', 'full_view' => 'tiny'));
    if (elgg_is_logged_in()) {
        $answer_edit_form = elgg_view_form('answers/answer/edit', array('id' => 'edit-answer-' . $answer_guid, 'class' => 'hidden'), $vars);
        $answer_add_comment = elgg_view('answers/comment_toggle', $vars);
    }
    echo <<<HTML
<div id="elgg-object-{$answer->guid}" class="elgg-item-answer">
\t{$rating_block}
\t<div class="answer-content mbl">
\t\t<div class="answer-output">
\t\t\t{$body}
\t\t</div>
\t\t{$answer_info}
\t\t{$answer_edit_form}
\t\t<div id="answer-comment-{$answer_guid}" class="elgg-comments">
\t\t\t{$answer_comments}
コード例 #5
0
ファイル: count.php プロジェクト: gzachos/elgg_ellak
<?php

/**
 * Count of who has liked something
 *
 *  @uses $vars['entity']
 */
$list = '';
$num_of_likes = \Elgg\Likes\DataService::instance()->getNumLikes($vars['entity']);
$guid = $vars['entity']->guid;
if ($num_of_likes) {
    // display the number of likes
    if ($num_of_likes == 1) {
        $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
    } else {
        $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
    }
    $params = array('text' => $likes_string, 'title' => elgg_echo('likes:see'), 'rel' => 'popup', 'href' => "#likes-{$guid}", 'class' => 'elgg-non-link');
    $list = elgg_view('output/url', $params);
    $list .= "<div class='elgg-module elgg-module-popup elgg-likes hidden clearfix' id='likes-{$guid}'>";
    $list .= elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99, 'list_class' => 'elgg-list-likes', 'preload_owners' => true));
    $list .= "</div>";
    echo $list;
}
コード例 #6
0
ファイル: revisions.php プロジェクト: coldtrick/static
<?php

$entity = elgg_extract('entity', $vars);
if (empty($entity)) {
    return;
}
$annotations = elgg_list_annotations(['guid' => $entity->getGUID(), 'annotation_name' => 'static_revision', 'limit' => false]);
if (empty($annotations)) {
    return;
}
echo elgg_view_module('aside', elgg_echo('static:revisions'), $annotations);
コード例 #7
0
ファイル: river_footer.php プロジェクト: duanhv/mdg-social
    return true;
}
$object = $vars['item']->getObjectEntity();
$num_of_likes = $object->countAnnotations('likes');
if ($num_of_likes == 0) {
    return true;
}
$guid = $object->guid;
$likes_button = elgg_view_icon('thumbs-up');
// check to see if the user has already liked this
if (elgg_is_logged_in() && $object->canAnnotate(0, 'likes')) {
    if (!elgg_annotation_exists($guid, 'likes')) {
        $likes_button = elgg_view('output/url', array('href' => "action/likes/add?guid={$guid}", 'text' => elgg_view_icon('thumbs-up'), 'title' => elgg_echo('likes:likethis'), 'is_action' => true));
    } else {
        $likes = elgg_get_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'owner_guid' => elgg_get_logged_in_user_guid()));
        $likes_button = elgg_view('output/url', array('href' => "action/likes/delete?annotation_id={$likes[0]->id}", 'text' => elgg_view_icon('thumbs-up-alt'), 'title' => elgg_echo('likes:remove'), 'is_action' => true));
    }
}
// display the number of likes
if ($num_of_likes == 1) {
    $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
} else {
    $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
}
$likes_string = elgg_view('output/url', array('text' => $likes_string, 'title' => elgg_echo('likes:see'), 'rel' => 'popup', 'href' => "#likes-{$guid}"));
$likes_list = elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99));
$likes_module = elgg_view_module('popup', 'Likes', $likes_list, array('class' => 'hidden elgg-likes-list', 'id' => "likes-{$guid}"));
$vars['image'] = $likes_button;
$vars['body'] = $likes_string . $likes_module;
$vars['class'] = 'elgg-river-participation';
echo elgg_view('page/components/image_block', $vars);
コード例 #8
0
 **/
$markdown_wiki_guid = get_input('guid');
$markdown_wiki = get_entity($markdown_wiki_guid);
$container = $markdown_wiki->getContainerEntity();
if (!$markdown_wiki || !$container) {
    forward(REFERER);
}
elgg_load_js('markdown_wiki:discussion');
elgg_set_page_owner_guid($markdown_wiki->getContainerGUID());
elgg_register_menu_item('title', array('name' => 'toggle-modification', 'href' => "#", 'text' => elgg_echo('markdown_wiki:toggle-modification'), 'link_class' => 'elgg-button-toggle-modification active'));
$title = elgg_echo('markdown_wiki:discussion', array($markdown_wiki->title));
if (elgg_instanceof($container, 'group')) {
    elgg_push_breadcrumb($container->name, "wiki/group/{$container->guid}/all");
} else {
    elgg_push_breadcrumb($container->name, "wiki/owner/{$container->username}");
}
elgg_push_breadcrumb($markdown_wiki->title, $markdown_wiki->getURL());
elgg_push_breadcrumb(elgg_echo('markdown_wiki:page:discussion'));
elgg_register_menu_item('page', array('name' => 'compare', 'href' => "wiki/compare/{$markdown_wiki_guid}/{$markdown_wiki->title}", 'text' => elgg_echo('markdown_wiki:page:compare')));
elgg_register_menu_item('page', array('name' => 'history', 'href' => "wiki/history/{$markdown_wiki_guid}/{$markdown_wiki->title}", 'text' => elgg_echo('markdown_wiki:page:history')));
if ($markdown_wiki->canEdit($user_guid)) {
    elgg_register_menu_item('page', array('name' => 'edit-page', 'href' => "wiki/edit/{$markdown_wiki_guid}/{$markdown_wiki->title}", 'text' => elgg_echo('markdown_wiki:page:edit')));
}
$content = elgg_trigger_plugin_hook('markdown_wiki_discussion', 'header', $markdown_wiki, '');
$form_vars = array('name' => 'elgg_add_comment', 'class' => 'desc');
$vars['entity'] = $markdown_wiki;
$content .= '<div class="elgg-comments">' . elgg_view_form('comments/add', $form_vars, $vars);
$content .= elgg_list_annotations(array('types' => 'object', 'subtypes' => 'markdown_wiki', 'annotation_names' => array('markdown_wiki', 'generic_comment'), 'guids' => $markdown_wiki_guid, 'order_by' => 'time_created desc', 'summary_view' => true));
$content .= '</div>';
$body = elgg_view_layout('content', array('filter' => '', 'content' => $content, 'title' => $title, 'sidebar' => elgg_view('markdown_wiki/sidebar/sidebar')));
echo elgg_view_page($title, $body);
コード例 #9
0
ファイル: compare.php プロジェクト: akudan/elgg-markdown_wiki
<?php

/**
 *	Elgg-markdown_wiki plugin
 *	@package elgg-markdown_wiki
 *	@author Emmanuel Salomon @ManUtopiK
 *	@license GNU Affero General Public License, version 3 or late
 *	@link https://github.com/ManUtopiK/elgg-markdown_wiki
 *
 *	Elgg-markdown_wiki compare form
 **/
$markdown_wiki = elgg_extract('markdown_wiki', $vars);
$annoff = elgg_extract('annoff', $vars, false);
$annotations = elgg_list_annotations(array('types' => 'object', 'subtypes' => 'markdown_wiki', 'annotation_names' => 'markdown_wiki', 'guids' => $markdown_wiki->guid, 'order_by' => 'time_created desc', 'limit' => $annoff ? 10 : 15, 'summary_view' => true, 'list_class' => 'history-module', 'compare' => true));
if ($annoff) {
    $recent = elgg_list_annotations(array('types' => 'object', 'subtypes' => 'markdown_wiki', 'annotation_names' => 'markdown_wiki', 'guids' => $markdown_wiki->guid, 'order_by' => 'time_created desc', 'limit' => 5, 'summary_view' => true, 'list_class' => 'history-module', 'compare' => true, 'pagination' => false, 'offset' => 0));
    // dumby hack to merge both lists
    $posR = strrpos($recent, '</ul>');
    $posA = strpos($annotations, '<li id="item-annotation');
    echo substr($recent, 0, $posR) . '<li>...</li>' . substr($annotations, $posA);
} else {
    echo $annotations;
}
echo elgg_view('input/hidden', array('name' => 'markdown_wiki', 'value' => $markdown_wiki->guid));
echo elgg_view('input/submit', array('value' => elgg_echo('markdown_wiki:compare:button'), 'class' => 'elgg-button-submit mtm'));
コード例 #10
0
ファイル: history.php プロジェクト: thehereward/Elgg
<?php

/**
 * History of revisions of a page
 *
 * @package ElggPages
 */
$page_guid = elgg_extract('guid', $vars);
$page = get_entity($page_guid);
if (!pages_is_page($page)) {
    forward('', '404');
}
$container = $page->getContainerEntity();
if (!$container) {
    forward('', '404');
}
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');
$content = elgg_list_annotations(array('guid' => $page_guid, 'annotation_name' => 'page', 'limit' => max(20, elgg_get_config('default_limit')), 'order_by' => "n_table.time_created desc"));
$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);
コード例 #11
0
ファイル: add.php プロジェクト: ibou77/elgg
<?php

/**
 * Elgg Message board: add message action
 *
 * @package ElggMessageBoard
 */
$message_content = get_input('message_content');
$owner_guid = get_input("owner_guid");
$owner = get_entity($owner_guid);
if ($owner && !empty($message_content)) {
    $result = messageboard_add(elgg_get_logged_in_user_entity(), $owner, $message_content, $owner->access_id);
    if ($result) {
        system_message(elgg_echo("messageboard:posted"));
        $options = array('annotations_name' => 'messageboard', 'guid' => $owner->getGUID(), 'limit' => $num_display, 'pagination' => false, 'reverse_order_by' => true, 'limit' => 1);
        $output = elgg_list_annotations($options);
        echo $output;
    } else {
        register_error(elgg_echo("messageboard:failure"));
    }
} else {
    register_error(elgg_echo("messageboard:blank"));
}
forward(REFERER);
コード例 #12
0
ファイル: add.php プロジェクト: elgg/elgg
<?php

/**
 * Elgg Message board: add message action
 *
 * @package ElggMessageBoard
 */
$message_content = get_input('message_content');
$owner_guid = (int) get_input('owner_guid');
$owner = get_user($owner_guid);
if (!$owner || empty($message_content)) {
    return elgg_error_response(elgg_echo('messageboard:blank'));
}
$result = messageboard_add(elgg_get_logged_in_user_entity(), $owner, $message_content, $owner->access_id);
if (!$result) {
    return elgg_error_response(elgg_echo('messageboard:failure'));
}
$output = elgg_list_annotations(['annotations_name' => 'messageboard', 'guid' => $owner->guid, 'pagination' => false, 'reverse_order_by' => true, 'limit' => 1]);
return elgg_ok_response($output, elgg_echo('messageboard:posted'));
コード例 #13
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 = elgg_list_annotations(array('annotation_names' => 'generic_comment', 'guid' => $entity_guid, 'count' => $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));
    }
}
if (!$callback) {
    $body = elgg_view_layout('content', array('filter' => false, 'content' => $content, 'title' => $title));
コード例 #14
0
ファイル: popup.php プロジェクト: ibou77/elgg
<?php

$guid = get_input("guid");
if (!get_entity($guid)) {
    echo elgg_echo("error:missing_data");
    return;
}
$list = elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99, 'preload_owners' => true, 'pagination' => false));
echo elgg_format_element('div', ['class' => 'elgg-likes-popup'], $list);
コード例 #15
0
ファイル: history.php プロジェクト: elainenaomi/labxp2014
<?php

/**
 * History of revisions of a page
 *
 * @package ElggPages
 */
$page_guid = get_input('guid');
$page = get_entity($page_guid);
if (!$page) {
    forward('', '404');
}
$container = $page->getContainerEntity();
if (!$container) {
    forward('', '404');
}
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');
$content = elgg_list_annotations(array('guid' => $page_guid, 'annotation_name' => 'page', 'limit' => 20, 'order_by' => "n_table.time_created desc"));
$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);
コード例 #16
0
ファイル: ratings.php プロジェクト: hypejunction/elgg_stars
 * Display a list of ratings and a ratings form
 */
if (!(bool) elgg_get_plugin_setting('extend_comments', 'elgg_stars')) {
    return;
}
$entity = elgg_extract('entity', $vars);
$show_add_form = elgg_extract('show_add_form', $vars, true);
if (!elgg_instanceof($entity)) {
    return;
}
$type_subtype_pairs = elgg_stars_get_rateable_type_subtype_pairs();
$type = $entity->getType();
$subtype = $entity->getSubtype();
if (!array_key_exists($type, $type_subtype_pairs)) {
    return;
}
if ($subtype && array_search($subtype, $type_subtype_pairs[$type]) === false) {
    return;
}
if ($show_add_form) {
    $body .= elgg_view_form('stars/rate', array(), array('entity' => $entity));
}
$title = elgg_echo('stars:ratings');
$annotation_names = elgg_stars_get_rating_annotation_names($entity);
$body .= elgg_list_annotations(array('guid' => $entity->guid, 'annotation_names' => $annotation_names));
$entity_ratings = elgg_stars_get_entity_rating_values($entity, $annotation_names);
$label = '<label>' . elgg_echo('stars:stats:totals') . '</label>';
$total = elgg_view('output/stars', array('value' => $entity_ratings['value']));
$stats = elgg_echo('stars:stats', array($entity_ratings['value'], $entity_ratings['max'], $entity_ratings['count']));
$footer = elgg_view_image_block($label, $total, array('image_alt' => $stats));
echo elgg_view_module('aside', $title, $body, array('footer' => $footer));
コード例 #17
0
<?php

/**
 * Count of who has liked something
 *
 *  @uses $vars['entity']
 */
$list = '';
$num_of_likes = likes_count($vars['entity']);
$guid = $vars['entity']->getGUID();
if ($num_of_likes) {
    // display the number of likes
    if ($num_of_likes == 1) {
        $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
    } else {
        $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
    }
    $params = array('text' => $likes_string, 'title' => elgg_echo('likes:see'), 'rel' => 'popup', 'href' => "#likes-{$guid}", 'class' => 'elgg-non-link');
    $list = elgg_view('output/url', $params);
    $list .= "<div class='elgg-module elgg-module-popup elgg-likes hidden clearfix' id='likes-{$guid}'>";
    $list .= elgg_list_annotations(array('guid' => $guid, 'annotation_name' => 'likes', 'limit' => 99, 'list_class' => 'elgg-list-likes'));
    $list .= "</div>";
    echo $list;
}
コード例 #18
0
ファイル: membership.php プロジェクト: pleio/subsite_manager
<?php

$site = elgg_get_site_entity();
$count = $site->countMembershipRequests();
if ($count > 0) {
    $old_ia = elgg_set_ignore_access(true);
    $options = array("guid" => $site->getGUID(), "annotation_names" => array("request_membership"), "limit" => $count, "site_guids" => false);
    $body = elgg_list_annotations($options);
    elgg_set_ignore_access($old_ia);
} else {
    $body = elgg_echo("notfound");
}
echo "<div>";
echo elgg_echo("subsite_manager:subsites:membership:description");
echo "</div>";
echo elgg_view_module("inline", elgg_echo("subsite_manager:subsites:membership:list:title"), $body);
コード例 #19
0
ファイル: content.php プロジェクト: ibou77/elgg
<?php

/**
 * Elgg messageboard widget view
 *
 */
$owner = elgg_get_page_owner_entity();
$num_display = $vars['entity']->num_display;
if (elgg_is_logged_in()) {
    echo elgg_view_form('messageboard/add', array('name' => 'elgg-messageboard'));
}
$options = array('annotations_name' => 'messageboard', 'guid' => $owner->getGUID(), 'limit' => $num_display, 'pagination' => false, 'reverse_order_by' => true);
echo elgg_list_annotations($options);
if ($owner instanceof ElggGroup) {
    $url = "messageboard/group/{$owner->guid}/all";
} else {
    $url = "messageboard/owner/{$owner->username}";
}
echo elgg_view('output/url', array('href' => $url, 'text' => elgg_echo('messageboard:viewall'), 'is_trusted' => true));
コード例 #20
0
ファイル: content.php プロジェクト: elgg/elgg
<?php

/**
 * Messageboard widget view
 */
$widget = elgg_extract('entity', $vars);
$owner = $widget->getOwnerEntity();
if (elgg_is_logged_in()) {
    echo elgg_view_form('messageboard/add', ['name' => 'elgg-messageboard']);
}
echo elgg_list_annotations(['annotations_name' => 'messageboard', 'guid' => $owner->guid, 'limit' => $widget->num_display, 'pagination' => false, 'reverse_order_by' => true]);
if ($owner instanceof ElggGroup) {
    $url = "messageboard/group/{$owner->guid}/all";
} else {
    $url = "messageboard/owner/{$owner->username}";
}
$more_link = elgg_view('output/url', ['href' => $url, 'text' => elgg_echo('messageboard:viewall'), 'is_trusted' => true]);
echo "<div class=\"elgg-widget-more\">{$more_link}</div>";
elgg_require_js('elgg/messageboard');
コード例 #21
0
ファイル: history.php プロジェクト: amcfarlane1251/ongarde
<?php

/**
 * History of this project
 *
 * @uses $vars['project']
 */
$title = elgg_echo('projects:history');
if ($vars['project']) {
    $options = array('guid' => $vars['project']->guid, 'annotation_name' => 'project', 'limit' => 20, 'reverse_order_by' => true);
    $content = elgg_list_annotations($options);
}
echo elgg_view_module('aside', $title, $content);
コード例 #22
0
ファイル: question.php プロジェクト: hejosadi/PiGo-LMS
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $question, 'handler' => 'answers', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$group_text} {$date} {$comments_link} {$categories}";
$params = array('entity' => $question, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle);
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
if ($full === true) {
    $rating_block = elgg_view("answers/rating_block", $vars);
    $body = elgg_view('output/longtext', array('value' => $question->description, 'class' => 'question-post'));
    $question_info = elgg_view_image_block($owner_icon, $summary, array('class' => 'mbs'));
    $question_comments = elgg_list_annotations(array('guid' => $question->getGUID(), 'annotation_name' => 'generic_comment', 'full_view' => 'tiny'));
    if (elgg_is_logged_in()) {
        $question_add_comment = elgg_view('answers/comment_toggle', $vars);
    }
    echo <<<HTML
<div id="elgg-object-{$question->guid}" class="elgg-item-question">
\t{$rating_block}
\t<div class="question-content mbl">
\t\t{$question_info}
\t\t{$body}
\t\t<div id="comments" class="elgg-comments">
\t\t\t{$question_comments}
\t\t\t{$question_add_comment}
\t\t</div>
\t</div>
</div>
コード例 #23
0
/**
 * Returns a human-readable list of annotations on a particular entity.
 *
 * @param int        $entity_guid The entity GUID
 * @param string     $name        The name of the kind of annotation
 * @param int        $limit       The number of annotations to display at once
 * @param true|false $asc         Display annotations in ascending order. (Default: true)
 *
 * @return string HTML (etc) version of the annotation list
 * @deprecated 1.8 Use elgg_list_annotations()
 */
function list_annotations($entity_guid, $name = "", $limit = 25, $asc = true)
{
    elgg_deprecated_notice('list_annotations() is deprecated by elgg_list_annotations()', 1.8);
    if ($asc) {
        $asc = "asc";
    } else {
        $asc = "desc";
    }
    $options = array('guid' => $entity_guid, 'limit' => $limit, 'order_by' => "n_table.time_created {$asc}");
    return elgg_list_annotations($options);
}
コード例 #24
0
ファイル: reasons.php プロジェクト: beck24/member_selfdelete
<?php

namespace Beck24\MemberSelfDelete;

// get our inputs
$offset = get_input('offset', 0);
if ($offset < 0) {
    $offset = 0;
}
$limit = get_input('limit', 10);
// get total for pagination
$params = array('guid' => elgg_get_site_entity()->guid, 'annotation_names' => array('selfdeletefeedback'), 'no_results' => elgg_echo('member_selfdelete:feedback:no_results'));
echo elgg_list_annotations($params);