Beispiel #1
0
        $icon = elgg_view_entity_icon($user, 'small');
        /*
        		$user_link = elgg_view('output/url', array(
        			'href' => "messages/compose?send_to=$user->guid",
        			'text' => elgg_echo('messages:to_user', array($user->name)),
        			'is_trusted' => true,
        		));
        */
        $user_link = '<span>' . elgg_echo('messages:to_user', array($user->name)) . '</span>';
    } else {
        $icon = '';
        $user_link = elgg_echo('messages:deleted_sender');
    }
    $class = 'message read';
}
$timestamp = elgg_view_friendly_time($message->time_created);
$subject_info = elgg_view('output/url', array('href' => $message->getURL(), 'text' => $message->title, 'is_trusted' => true));
$delete_link = elgg_view("output/url", array('href' => "action/messages/delete?guid=" . $message->getGUID() . "&full={$full}", 'text' => '<i class="fa fa-trash-o fa-lg icon-unsel"><span class="wb-inv">Delete This</span></i>', 'confirm' => elgg_echo('deleteconfirm'), 'encode_text' => false));
$checkbox = elgg_view('input/checkbox', array('name' => 'message_id[]', 'value' => $message->guid, 'default' => false));
$messageLink = $message->getURL();
//<div class="messages-chkbx">$checkbox</div>
$body = <<<HTML


<div class="mrgn-bttm-md clearfix">


<div class="messages-owner">{$user_link}</div>
<div class="messages-subject">{$subject_info}</div>
<div class="messages-timestamp">{$timestamp}</div>
<div class="messages-delete">{$delete_link}</div>
Beispiel #2
0
<?php

/**
 * Display comment view
 */
if (isset($vars['entity'])) {
    $comment = $vars['entity'];
    $owner = get_user($comment->owner_guid);
    $canedit = answers_can_edit_comment($comment);
    $markdown = is_callable('markdown_text');
    if ($comment && $owner) {
        $full_comment_text = parse_urls(filter_tags($comment->value)) . ($markdown ? "\n" : " ") . "&mdash; " . "<span class=\"answers_comment_owner\">" . "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>" . " " . elgg_view_friendly_time($comment->time_created) . "</span>";
        if ($canedit) {
            $full_comment_text .= "&nbsp;&nbsp;" . elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/answers/comment/delete?comment_id=" . $comment->id, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), 'class' => '', 'is_action' => true));
            $edit = elgg_echo('edit');
            $full_comment_text .= "&nbsp;&nbsp;<a class=\"collapsibleboxlink\">{$edit}</a>";
        }
        if ($markdown) {
            $full_comment_text = markdown_text($full_comment_text);
        } else {
            $full_comment_text = autop($full_comment_text);
        }
        ?>
	<div class="answers_comment">
		<a name="<?php 
        echo $comment->id;
        ?>
"></a>
        <?php 
        echo $full_comment_text;
        ?>
/**
 * Displays a UNIX timestamp in a friendly way (eg "less than a minute ago")
 *
 * @param int $time A UNIX epoch timestamp
 *
 * @return string The friendly time
 * @deprecated 1.8 Use elgg_view_friendly_time()
 */
function friendly_time($time)
{
    elgg_deprecated_notice('friendly_time was deprecated by elgg_view_friendly_time', 1.8);
    return elgg_view_friendly_time($time);
}
Beispiel #4
0
				<span class="notification_icon_all">
					<?php 
        $from_entity = get_entity($notify->from_guid);
        ?>
					<?php 
        echo elgg_view_entity_icon($from_entity, 'small', array('use_hover' => false, 'use_link' => true));
        ?>
				</span>
				<span class="notification_message_all">
					<?php 
        echo $notify->description;
        ?>
					<br>
					<p class="notification_timeago">
						<?php 
        echo elgg_view_friendly_time($notify->time_created);
        ?>
					</p>
				</span>

				<?php 
        if ($notify->read != 1) {
            ?>
					<?php 
            $notify->read = 1;
            $notify->save();
            ?>
				<?php 
        }
        ?>
				
<?php

/**
 * Body of river item
 *
 * @uses $vars['item']        ElggRiverItem
 * @uses $vars['summary']     Alternate summary (the short text summary of action)
 * @uses $vars['message']     Optional message (usually excerpt of text)
 * @uses $vars['attachments'] Optional attachments (displaying icons or other non-text data)
 * @uses $vars['responses']   Alternate respones (comments, replies, etc.)
 */
$item = $vars['item'];
$menu = elgg_view_menu('river', array('item' => $item, 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
// river item header
$timestamp = elgg_view_friendly_time($item->getTimePosted());
$summary = elgg_extract('summary', $vars, elgg_view('river/elements/summary', array('item' => $vars['item'])));
if ($summary === false) {
    $subject = $item->getSubjectEntity();
    $summary = elgg_view('output/url', array('href' => $subject->getURL(), 'text' => $subject->name, 'class' => 'elgg-river-subject', 'is_trusted' => true));
}
$message = elgg_extract('message', $vars, false);
if ($message !== false) {
    $message = "<div class=\"elgg-river-message\">{$message}</div>";
}
$attachments = elgg_extract('attachments', $vars, false);
if ($attachments !== false) {
    $attachments = "<div class=\"elgg-river-attachments clearfix\">{$attachments}</div>";
}
$responses = elgg_view('river/elements/responses', $vars);
if ($responses) {
    $responses = "<div class=\"elgg-river-responses\">{$responses}</div>";
Beispiel #6
0
 * View for answer object
 *
 * @package Questions
 */
$full = elgg_extract('full_view', $vars, FALSE);
$answer = elgg_extract('entity', $vars, FALSE);
if (!$answer) {
    return TRUE;
}
$answer_guid = $answer->getGUID();
$owner = $answer->getOwnerEntity();
$container = $answer->getContainerEntity();
$owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array('href' => "answers/owner/{$owner->username}", 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($answer->time_created);
// The "on" status changes for comments, so best to check for !Off
if ($answer->comments_on != 'Off') {
    $comments_count = $answer->countComments();
    //only display if there are commments
    if ($comments_count != 0) {
        $text = elgg_echo("comments") . " ({$comments_count})";
        $comments_link = elgg_view('output/url', array('href' => "#answer-comment-{$answer_guid}", 'text' => $text, 'is_trusted' => true));
    } else {
        $comments_link = '';
    }
} else {
    $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}";
Beispiel #7
0
<?php

$plugin = elgg_extract('entity', $vars);
// set tangram xml url
$tangram_url = '<div>';
$tangram_url .= elgg_echo('haarlem_tangram:settings:url');
$tangram_url .= elgg_view('input/url', ['name' => 'params[tangram_url]', 'value' => $plugin->tangram_url]);
if ($plugin->tangram_last_update_success) {
    $last_update = elgg_view_friendly_time($plugin->tangram_last_update_success);
    $tangram_url .= '<div class="elgg-subtext">' . elgg_echo('haarlem_tangram:settings:url:last_update_success', [$last_update]) . '</div>';
}
$tangram_url .= '</div>';
echo $tangram_url;
// page owner
$page_owner = '<div>';
$page_owner .= elgg_echo('haarlem_tangram:settings:page_owner');
$page_owner .= elgg_view('input/text', ['name' => 'params[page_owner_guid]', 'value' => $plugin->page_owner_guid]);
$page_owner .= '<div class="elgg-subtext">' . elgg_echo('haarlem_tangram:settings:page_owner:description') . '</div>';
$page_owner .= '</div>';
echo $page_owner;
Beispiel #8
0
<?php

/**
 * Forum reply entity view
 *
 * @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);
Beispiel #9
0
$full = elgg_extract('full_view', $vars, FALSE);
$blog = elgg_extract('entity', $vars, FALSE);
if (!$blog) {
    return TRUE;
}
$owner = $blog->getOwnerEntity();
$container = $blog->getContainerEntity();
$categories = elgg_view('output/categories', $vars);
$excerpt = $blog->excerpt;
if (!$excerpt) {
    $excerpt = elgg_get_excerpt($blog->description);
}
$owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array('href' => "blog/owner/{$owner->username}", 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($blog->time_created);
// The "on" status changes for comments, so best to check for !Off
if ($blog->comments_on != 'Off') {
    $comments_count = $blog->countComments();
    //only display if there are commments
    if ($comments_count != 0) {
        $text = elgg_echo("comments") . " ({$comments_count})";
        $comments_link = elgg_view('output/url', array('href' => $blog->getURL() . '#blog-comments', 'text' => $text, 'is_trusted' => true));
    } else {
        $comments_link = '';
    }
} else {
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'blog', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$date} {$comments_link} {$categories}";
Beispiel #10
0
if ($page->write_access_id == ACCESS_PUBLIC) {
    // this works because this metadata is public
    $page->write_access_id = ACCESS_LOGGED_IN;
}
if ($revision) {
    $annotation = $revision;
} else {
    $annotation = $page->getAnnotations('page', 1, 0, 'desc');
    if ($annotation) {
        $annotation = $annotation[0];
    }
}
$page_icon = elgg_view('pages/icon', array('annotation' => $annotation, 'size' => 'small'));
$editor = get_entity($annotation->owner_guid);
$editor_link = elgg_view('output/url', array('href' => "pages/owner/{$editor->username}", 'text' => $editor->name));
$date = elgg_view_friendly_time($annotation->time_created);
$editor_text = elgg_echo('pages:strapline', array($date, $editor_link));
$tags = elgg_view('output/tags', array('tags' => $page->tags));
$comments_count = $page->countComments();
//only display if there are commments
if ($comments_count != 0 && !$revision) {
    $text = elgg_echo("comments") . " ({$comments_count})";
    $comments_link = elgg_view('output/url', array('href' => $page->getURL() . '#page-comments', 'text' => $text));
} else {
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'pages', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$editor_text} {$categories} {$comments_link}";
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets') || $revision) {
    $metadata = '';
Beispiel #11
0
}
$poster = $topic->getOwnerEntity();
$group = $topic->getContainerEntity();
$excerpt = elgg_get_excerpt($topic->description);
$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('groups:started', array($poster->name));
$tags = elgg_view('output/tags', array('tags' => $topic->tags));
$date = elgg_view_friendly_time($topic->time_created);
$replies_link = '';
$reply_text = '';
$num_replies = elgg_get_annotations(array('annotation_name' => 'group_topic_post', 'guid' => $topic->getGUID(), 'count' => true));
if ($num_replies != 0) {
    $last_reply = $topic->getAnnotations('group_topic_post', 1, 0, 'desc');
    $poster = $last_reply[0]->getOwnerEntity();
    $reply_time = elgg_view_friendly_time($last_reply[0]->time_created);
    $reply_text = elgg_echo('groups:updated', array($poster->name, $reply_time));
    $replies_link = elgg_view('output/url', array('href' => $topic->getURL() . '#group-replies', 'text' => elgg_echo('group:replies') . " ({$num_replies})", 'is_trusted' => true));
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'discussion', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
if ($full) {
    $subtitle = "{$poster_text} {$date} {$replies_link}";
    $params = array('entity' => $topic, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags);
    $params = $params + $vars;
    $list_body = elgg_view('object/elements/summary', $params);
    $info = elgg_view_image_block($poster_icon, $list_body);
    $body = elgg_view('output/longtext', array('value' => $topic->description));
Beispiel #12
0
$lang = get_current_language();
if (!$bookmark) {
    return;
}
$owner = $bookmark->getOwnerEntity();
$owner_icon = elgg_view_entity_icon($owner, 'medium');
$categories = elgg_view('output/categories', $vars);
$link = elgg_view('output/url', array('href' => $bookmark->address));
if ($bookmark->description3) {
    $description = elgg_view('output/longtext', array('value' => gc_explode_translation($bookmark->description3, $lang), 'class' => 'pbl'));
} else {
    $description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl'));
}
$owner_link = elgg_view('output/url', array('href' => "bookmarks/owner/{$owner->username}", 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($bookmark->time_created);
$comments_count = $bookmark->countComments();
//only display if there are commments
if ($comments_count != 0) {
    $text = elgg_echo("comments") . " ({$comments_count})";
    $comments_link = elgg_view('output/url', array('href' => $bookmark->getURL() . '#comments', 'text' => $text, 'is_trusted' => true));
} else {
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'bookmarks', 'sort_by' => 'priority', 'class' => 'list-inline'));
$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 && !elgg_in_context('gallery')) {
$full = elgg_extract('full_view', $vars, FALSE);
$file = elgg_extract('entity', $vars, FALSE);
if (!$file) {
    return TRUE;
}
$owner = $file->getOwnerEntity();
$container = $file->getContainerEntity();
$categories = elgg_view('output/categories', $vars);
$excerpt = elgg_get_excerpt($file->description);
$mime = $file->mimetype;
$base_type = substr($mime, 0, strpos($mime, '/'));
$owner_link = elgg_view('output/url', array('href' => "file/owner/{$owner->username}", 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$file_icon = elgg_view_entity_icon($file, 'small');
$tags = elgg_view('output/tags', array('tags' => $file->tags));
$date = elgg_view_friendly_time($file->time_created);
$comments_count = $file->countComments();
//only display if there are commments
if ($comments_count != 0) {
    $text = elgg_echo("comments") . " ({$comments_count})";
    $comments_link = elgg_view('output/url', array('href' => $file->getURL() . '#file-comments', 'text' => $text, 'is_trusted' => true));
} else {
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'file', '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 && !elgg_in_context('gallery')) {
Beispiel #14
0
} else {
    $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);
}
$params = array('href' => $delete_url, 'text' => elgg_echo('reportedcontent:delete'), 'is_action' => true, 'is_trusted' => true, 'class' => 'elgg-button elgg-button-action');
echo elgg_view('output/url', $params);
?>
		</div>
		<p>
			<b><?php 
echo elgg_echo('reportedcontent:by');
?>
:</b>
			<?php 
echo elgg_view('output/url', array('href' => $reporter->getURL(), 'text' => $reporter->name, 'is_trusted' => true));
?>
,
			<?php 
echo elgg_view_friendly_time($report->time_created);
?>
		</p>
		<p>
			<b><?php 
echo elgg_echo('title');
?>
:</b>
			<?php 
echo $report->title;
?>
		<p>
			<b><?php 
echo elgg_echo('reportedcontent:objecturl');
?>
:</b>
Beispiel #16
0
<?php

$video = elgg_extract('entity', $vars, false);
if (!$video) {
    return true;
}
$owner = $video->getOwnerEntity();
$categories = elgg_view('output/categories', $vars);
$excerpt = elgg_get_excerpt($video->description);
$owner_link = elgg_view('output/url', array('href' => "videos/owner/{$owner->username}", 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$video_icon = elgg_view_entity_icon($video, 'medium', array('href' => $video->getURL(), 'title' => $video->title, 'is_trusted' => true, 'img_class' => 'screenshot'));
$date = elgg_view_friendly_time($video->time_created);
$comments_count = $video->countComments();
//only display if there are commments
if ($comments_count != 0) {
    $text = elgg_echo("comments") . " ({$comments_count})";
    $comments_link = elgg_view('output/url', array('href' => $video->getURL() . '#comments', 'text' => $text, 'is_trusted' => true));
} else {
    $comments_link = '';
}
$subtitle = "{$author_text} {$date} {$comments_link} {$categories}";
$metadata = elgg_view_menu('entity', array('entity' => $video, 'handler' => 'videos', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
$params = array('entity' => $video, 'metadata' => $metadata, 'subtitle' => $subtitle, 'content' => $excerpt);
$params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
echo elgg_view_image_block($video_icon, $list_body);
<?php

/**
 * View for chat message objects
 *
 * @package Chat
 */
$entity = elgg_extract('entity', $vars);
$owner = $entity->getOwnerEntity();
$owner_name = $owner->name;
$date = elgg_view_friendly_time($entity->time_created);
$user = elgg_get_logged_in_user_entity();
$time_created = "<span id=\"timestamp\" class=\"hidden\">{$entity->time_created}</span>";
$subtitle = "{$owner_name} {$date} {$time_created}";
$params = array('entity' => $entity, 'metadata' => $metadata, 'subtitle' => $subtitle, 'content' => $entity->description);
$params = $params + $vars;
$list_body = elgg_view('object/elements/summary', $params);
$owner_icon = elgg_view_entity_icon($owner, 'small', array('use_hover' => false));
$not_read = check_entity_relationship($entity->getGUID(), 'unread', $user->getGUID());
if ($not_read) {
    // Additional class to notify that message hasn't been read before.
    $vars['class'] = 'elgg-chat-unread';
    // Mark message read
    remove_entity_relationship($entity->getGUID(), 'unread', $user->getGUID());
}
echo elgg_view_image_block($owner_icon, $list_body, $vars);
Beispiel #18
0
 * @uses $vars['entity']
 */
elgg_load_js('elgg.thewire');
$full = elgg_extract('full_view', $vars, FALSE);
$post = elgg_extract('entity', $vars, FALSE);
if (!$post) {
    return true;
}
// make compatible with posts created with original Curverider plugin
$thread_id = $post->wire_thread;
if (!$thread_id) {
    $post->wire_thread = $post->guid;
}
$owner = $post->getOwnerEntity();
$owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array('href' => "thewire/owner/{$owner->username}", 'text' => $owner->name));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($post->time_created);
$metadata = elgg_view_menu('entity', array('entity' => $post, 'handler' => 'thewire', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$date}";
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
$params = array('entity' => $post, 'metadata' => $metadata, 'subtitle' => $subtitle, 'content' => thewire_filter($post->description), 'tags' => false);
$list_body = elgg_view('page/components/summary', $params);
echo elgg_view_image_block($owner_icon, $list_body);
if ($post->reply) {
    echo "<div class=\"thewire-parent hidden\" id=\"thewire-previous-{$post->guid}\">";
    echo "</div>";
}
Beispiel #19
0
<?php

$folder = elgg_extract("entity", $vars);
$full_view = elgg_extract("full_view", $vars, false);
$time_preference = "date";
if ($user_time_preference = elgg_get_plugin_user_setting('bookmark_tools_time_display', null, "bookmark_tools")) {
    $time_preference = $user_time_preference;
} elseif ($site_time_preference = elgg_get_plugin_setting("bookmark_tools_default_time_display", "bookmark_tools")) {
    $time_preference = $site_time_preference;
}
if ($time_preference == 'date') {
    $friendlytime = date(elgg_echo("friendlytime:date_format"), $folder->time_created);
} else {
    $friendlytime = elgg_view_friendly_time($folder->time_created);
}
$title = $folder->title;
$entity_menu = "";
if (!elgg_in_context("widgets")) {
    $entity_menu = elgg_view_menu("entity", array("entity" => $folder, "handler" => "bookmark_tools/bmfolder", "sort_by" => "priority", "class" => "elgg-menu-hz"));
}
if ($full_view) {
    // full view
    $icon = elgg_view_entity_icon($folder, "small");
    $owner_link = elgg_view("output/url", array("text" => $folder->getOwnerEntity()->name, "href" => $folder->getOwnerEntity()->getURL()));
    $owner_text = elgg_echo("byline", array($owner_link));
    $subtitle = "{$owner_text} {$friendlytime}";
    $params = array("entity" => $folder, "metadata" => $entity_menu, "tags" => elgg_view("output/tags", array("value" => $folder->tags)), "subtitle" => $subtitle);
    $params = $params + $vars;
    $summary = elgg_view("object/elements/summary", $params);
    echo elgg_view("object/elements/full", array("entity" => $folder, "title" => false, "icon" => $icon, "summary" => $summary, "body" => elgg_view("output/longtext", array("value" => $folder->description))));
} else {
Beispiel #20
0
 *   - search_matched_extra
 *   - 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));
Beispiel #21
0
if ($auto_save_annotations) {
    $revisions[] = $auto_save_annotations[0];
}
$saved_revisions = $blog->getAnnotations(['annotation_name' => 'blog_revision', 'reverse_order_by' => true, 'limit' => false]);
$revisions = array_merge($revisions, $saved_revisions);
if (empty($revisions)) {
    return;
}
$load_base_url = "blog/edit/{$blog->getGUID()}";
// show the "published revision"
$published_item = '';
if ($blog->status == 'published') {
    $load = elgg_view('output/url', ['href' => $load_base_url, 'text' => elgg_echo('status:published'), 'is_trusted' => true]);
    $time = elgg_format_element('span', ['class' => 'elgg-subtext'], elgg_view_friendly_time($blog->time_created));
    $published_item = elgg_format_element('li', [], "{$load}: {$time}");
}
$n = count($revisions);
$revisions_list = '';
foreach ($revisions as $revision) {
    $time = elgg_format_element('span', ['class' => 'elgg-subtext'], elgg_view_friendly_time($revision->time_created));
    if ($revision->name == 'blog_auto_save') {
        $revision_lang = elgg_echo('blog:auto_saved_revision');
    } else {
        $revision_lang = elgg_echo('blog:revision') . " {$n}";
    }
    $load = elgg_view('output/url', array('href' => "{$load_base_url}/{$revision->id}", 'text' => $revision_lang, 'is_trusted' => true));
    $revisions_list .= elgg_format_element('li', ['class' => 'auto-saved'], "{$load}: {$time}");
    $n--;
}
$body = elgg_format_element('ul', ['class' => 'blog-revisions'], $published_item . $revisions_list);
echo elgg_view_module('aside', elgg_echo('blog:revisions'), $body);
Beispiel #22
0
<?php

$annotation = elgg_extract('annotation', $vars);
$owner = get_entity($annotation->owner_guid);
if (!$owner) {
    return true;
}
$output = elgg_view('output/url', ['href' => $owner->getURL(), 'text' => $owner->name]);
$output .= elgg_format_element('span', ['class' => 'elgg-subtext'], elgg_view_friendly_time($annotation->time_created));
echo elgg_format_element('div', [], $output);
Beispiel #23
0
 *
 * @uses $vars['entity']    ElggComment
 * @uses $vars['full_view'] Display full view or brief view
 */
$full_view = elgg_extract('full_view', $vars, true);
$comment = $vars['entity'];
$entity = get_entity($comment->container_guid);
$commenter = get_user($comment->owner_guid);
if (!$entity || !$commenter) {
    return true;
}
$moderating = false;
if (!$comment->isEnabled() && $entity && $entity->canEdit()) {
    $moderating = true;
}
$friendlytime = elgg_view_friendly_time($comment->time_created);
$commenter_icon = elgg_view_entity_icon($commenter, 'tiny');
$commenter_link = "<a href=\"{$commenter->getURL()}\">{$commenter->name}</a>";
$entity_title = $entity->title ? $entity->title : elgg_echo('untitled');
$entity_link = "<a href=\"{$entity->getURL()}\">{$entity_title}</a>";
$checkbox = elgg_view('input/checkbox', array('name' => 'guid', 'value' => $comment->guid, 'default' => false));
if ($full_view) {
    $anchor = "<a name=\"comment-{$comment->getGUID()}\"></a>";
    $menu = elgg_view_menu('entity', array('entity' => $comment, 'handler' => 'comment', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz float-alt'));
    $comment_text = elgg_view("output/longtext", array('value' => $comment->description, 'class' => 'elgg-inner', 'data-role' => 'comment-text'));
    $body = <<<HTML
{$anchor}
<div class="mbn">
\t{$menu}
\t{$commenter_link}
\t<span class="elgg-subtext">
Beispiel #24
0
<?php

/**
 * Full view of an image
 *
 * @uses $vars['entity'] TidypicsImage
 *
 * @author Cash Costello
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
 */
$image = $photo = $vars['entity'];
$album = $image->getContainerEntity();
$img = elgg_view_entity_icon($image, 'large', array('href' => $image->getIconURL('master')));
$owner_link = elgg_view('output/url', array('href' => "photos/owner/" . $photo->getOwnerEntity()->username, 'text' => $photo->getOwnerEntity()->name));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($image->time_created);
$owner_icon = elgg_view_entity_icon($photo->getOwnerEntity(), 'medium');
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'photos', 'sort_by' => 'priority', 'class' => 'list-inline'));
$subtitle = "{$author_text} {$date}";
$params = array('entity' => $photo, 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags);
$list_body = elgg_view('object/elements/summary', $params);
$params = array('class' => 'mbl');
$summary = elgg_view_image_block($owner_icon, $list_body, $params);
echo $summary;
echo '<div class=" center">';
if ($album->getSize() > 1) {
    echo elgg_view('object/image/navigation', $vars);
}
echo elgg_view('photos/tagging/help', $vars);
echo elgg_view('photos/tagging/select', $vars);
echo $img;
Beispiel #25
0
<?php

$event = $vars["entity"];
$owner = $event->getOwnerEntity();
$event_details = "";
$owner_link = elgg_view('output/url', array('href' => $owner->getURL(), 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$date = elgg_view_friendly_time($event->time_created);
$subtitle = "{$author_text} {$date}";
// event details
if ($event->icontime) {
    $image = elgg_view("output/img", array("src" => $event->getIconURL()));
    $event_details .= "<div class='event_manager_event_view_image'>";
    $event_details .= elgg_view("output/url", array("href" => $event->getIconURL('master'), "text" => $image, "target" => "_blank", "class" => "elgg-lightbox-photo"));
    $event_details .= "</div>";
}
$event_details .= "<table class='event-manager-event-details'>";
if ($venue = $event->venue) {
    $event_details .= '<tr><td><label>' . elgg_echo('event_manager:edit:form:venue') . ':</label></td><td>' . $venue . '</td></tr>';
}
if ($location = $event->getEventLocation()) {
    $event_details .= '<tr><td><label>' . elgg_echo('event_manager:edit:form:location') . ':</label></td><td>';
    $event_details .= '<a href="' . elgg_get_site_url() . 'events/event/route?from=' . urlencode($event->getEventLocation()) . '" class="openRouteToEvent">' . $event->getEventLocation() . '</a>';
    $event_details .= '</td></tr>';
}
$event_details .= '<tr><td><label>' . elgg_echo('event_manager:edit:form:start') . ':</label></td><td>' . date(EVENT_MANAGER_FORMAT_DATE_EVENTDAY, $event->start_day) . " " . date('H', $event->start_time) . ':' . date('i', $event->start_time) . '</td></tr>';
if ($event->end_ts) {
    $event_details .= '<tr><td><label>' . elgg_echo('event_manager:edit:form:end') . ':</label></td><td>' . date(EVENT_MANAGER_FORMAT_DATE_EVENTDAY, $event->end_ts) . " " . date('H', $event->end_ts) . ':' . date('i', $event->end_ts) . '</td></tr>';
}
// optional end day
if ($organizer = $event->organizer) {
Beispiel #26
0
         $poster = $latestAnswer->getOwnerEntity();
         $answer_time = elgg_view_friendly_time($latestAnswer->time_created);
         $answer_link = elgg_view("output/url", array("href" => $poster->getURL(), "text" => $poster->name));
         $answer_text = elgg_echo("questions:answered", array($answer_link, $answer_time));
     } else {
         $answer_text = null;
     }
 } else {
     if ($question->getCorrectAnswer()) {
         $title_text = elgg_view_icon("checkmark", "mrs question-listing-checkmark");
         $answer_time = elgg_view_friendly_time($question->getCorrectAnswer()->time_created);
         $answer_link = elgg_view("output/url", array("href" => $poster->getURL(), "text" => $poster->name));
         $answer_text = elgg_echo("questions:answered:correct", array($answer_link, $answer_time));
     } elseif ($latestAnswer = $question->getLatestAnswer()) {
         $poster = $latestAnswer->getOwnerEntity();
         $answer_time = elgg_view_friendly_time($latestAnswer->time_created);
         $answer_link = elgg_view("output/url", array("href" => $poster->getURL(), "text" => $poster->name));
         $answer_text = elgg_echo("questions:answered", array($answer_link, $answer_time));
     } else {
         $answer_text = null;
     }
 }
 $title_text .= elgg_get_excerpt($question->title, 100);
 if ($workflow) {
     $title = elgg_view('questions/workflow/status', array('question' => $question));
 }
 $title .= elgg_view("output/url", array("text" => $title_text, "href" => $url, "is_trusted" => true));
 $subtitle = "{$poster_text} {$date} {$categories}";
 $content = elgg_get_excerpt($question->description);
 $params = array("entity" => $question, "title" => $title, "subtitle" => $subtitle . "<br />" . $answer_text, "tags" => $tags, "content" => $content);
 if ($workflow) {
/**
 * Elgg show the users who liked the object
 *
 * @uses $vars['annotation']
 */
if (!isset($vars['annotation'])) {
    return true;
}
$like = $vars['annotation'];
$user = $like->getOwnerEntity();
if (!$user) {
    return true;
}
$user_icon = elgg_view_entity_icon($user, 'tiny');
$user_link = elgg_view('output/url', array('href' => $user->getURL(), 'text' => $user->name, 'is_trusted' => true));
$likes_string = elgg_echo('likes:this');
$friendlytime = elgg_view_friendly_time($like->time_created);
if ($like->canEdit()) {
    $delete_button = elgg_view("output/confirmlink", array('href' => "action/likes/delete?id={$like->id}", 'text' => elgg_view_icon('delete', 'float-alt'), 'confirm' => elgg_echo('likes:delete:confirm'), 'encode_text' => false));
}
$body = <<<HTML
<p class="mbn">
\t{$delete_button}
\t{$user_link} {$likes_string}
\t<span class="elgg-subtext">
\t\t{$friendlytime}
\t</span>
</p>
HTML;
echo elgg_view_image_block($user_icon, $body);
Beispiel #28
0
		<!-- output the actual comment -->
	<?php 
    echo elgg_view("output/longtext", array("value" => $vars['annotation']->value));
    ?>

		<p class="generic_comment_owner">
			<a href="<?php 
    echo $owner->getURL();
    ?>
"><?php 
    echo $owner->name;
    ?>
			</a>
			<?php 
    echo elgg_view_friendly_time($vars['annotation']->time_created);
    ?>
		</p>

		<?php 
    // if the user looking at the comment can edit, show the delete link
    if ($vars['annotation']->canEdit() && $reviewed) {
        ?>
			<p>
			<?php 
        echo elgg_view("output/confirmlink", array('href' => elgg_get_site_url() . "action/comments/delete?annotation_id=" . $vars['annotation']->id, 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm')));
        ?>
			</p>

		<?php 
    }
Beispiel #29
0
                    }
                    $result .= "<a href='" . $entity_url . "'>" . $entity->title . "</a>";
                    $result .= "</div>";
                }
            } else {
                // simple
                $owner = $entity->getOwnerEntity();
                $icon = "";
                if ($show_avatar) {
                    $icon = elgg_view_entity_icon($owner, "small");
                }
                $text = elgg_view("output/url", array("href" => $entity_url, "text" => $entity->title));
                $text .= "<br />";
                $text .= "<a href='" . $owner->getURL() . "'>" . $owner->name . "</a>";
                if ($show_timestamp) {
                    $text .= " <span class='elgg-quiet'>" . elgg_view_friendly_time($entity->time_created) . "</span>";
                }
                $result .= elgg_view_image_block($icon, $text);
            }
            $result .= "</li>";
        }
        $result .= "</ul>";
    }
} else {
    $result = elgg_list_entities($options);
}
if (empty($result)) {
    $result = elgg_echo("notfound");
} elseif ($widget->show_search_link == "yes" && !empty($widget->tags) && elgg_is_active_plugin("search")) {
    $tags = $widget->tags;
    if (elgg_is_active_plugin("search_advanced")) {
Beispiel #30
0
<?php

$entity = elgg_extract('entity', $vars);
if (!$entity instanceof ElggEntity) {
    return;
}
$by_line = [];
$owner = $entity->getLastEditor();
if ($owner instanceof ElggEntity) {
    $owner_url = elgg_extract('owner_url', $vars, $owner->getURL());
    $owner_link = elgg_view('output/url', ['href' => $owner_url, 'text' => $owner->name, 'is_trusted' => true]);
    $by_line[] = elgg_echo('byline', array($owner_link));
}
$by_line[] = elgg_view_friendly_time($entity->time_created);
$container_entity = $entity->getOwnerEntity();
if ($container_entity instanceof ElggGroup && $container_entity->getGUID() !== elgg_get_page_owner_guid()) {
    $group_link = elgg_view('output/url', ['href' => $container_entity->getURL(), 'text' => $container_entity->name, 'is_trusted' => true]);
    $by_line[] = elgg_echo("byline:ingroup", [$group_link]);
}
if (!empty($by_line)) {
    echo implode(' ', $by_line);
}