}
set_page_owner($user->getGUID());
- $crumbs_title = sprintf(elgg_echo('blog:owned_blogs'), $user->name);
+ $crumbs_title = elgg_echo('blog:owned_blogs', array($user->name));
$crumbs_url = "{$CONFIG->site->url}pg/blog/$username/read";
elgg_push_breadcrumb($crumbs_title, $crumbs_url);
switch ($action) {
case 'read':
- $title = sprintf(elgg_echo('blog:title:user_blogs'), $user->name);
+ $title = elgg_echo('blog:title:user_blogs', array($user->name));
$content_info = blog_get_page_content_read($user->getGUID(), $page2);
break;
}
$link = elgg_get_site_url() . 'pg/blog/' . $page_owner->username . '/archive/' . $timestamplow . '/' . $timestamphigh;
- $month = sprintf(elgg_echo('date:month:' . substr($date,4,2)), substr($date, 0, 4));
+ $month = elgg_echo('date:month:' . substr($date, 4, 2), array(substr($date, 0, 4)));
echo "<li><a href=\"$link\" title=\"$month\">$month</a></li>";
}
echo '</ul>';
}
-
+
// friends page lists all tags; mine lists owner's
$owner_guid = ($vars['page'] == 'friends') ? '' : $page_owner->getGUID();
echo display_tagcloud(0, 50, 'tags', 'object', 'blog', $owner_guid);
$body = autop($blog->description);
$owner_icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny'));
$owner_blog_link = "<a href=\"".elgg_get_site_url()."pg/blog/$owner->username\">{$owner->name}</a>";
-$author_text = sprintf(elgg_echo('blog:author_by_line'), $owner_blog_link);
+$author_text = elgg_echo('blog:author_by_line', array($owner_blog_link));
if($blog->tags){
$tags = "<p class=\"tags\">" . elgg_view('output/tags', array('tags' => $blog->tags)) . "</p>";
}else{
$contents = strip_tags($object->excerpt);
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$title = sprintf(elgg_echo('blog:river:create'), $url);
+$title = elgg_echo('blog:river:create', array($url));
$string .= $title . " <a href=\"{$object->getURL()}\">{$object->title}</a> <span class='entity_subtext'>" . elgg_view_friendly_time($object->time_created);
if (isloggedin()) {
if (isloggedin()) {
if ($page_owner instanceof ElggGroup && elgg_get_context() == 'groups') {
if ($page_owner->bookmarks_enable != "no") {
- //add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), "pg/bookmarks/" . $page_owner->username . '/items');
+ //add_submenu_item(elgg_echo("bookmarks:group",array($page_owner->name), "pg/bookmarks/" . $page_owner->username . '/items'));
}
}
}
$content = elgg_echo("bookmarks:unknown_user");
$body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
- echo elgg_view_page(sprintf(elgg_echo("bookmarks:user"), elgg_get_page_owner()->name), $body);
+ echo elgg_view_page(elgg_echo("bookmarks:user", array(elgg_get_page_owner()->name)), $body);
return FALSE;
}
if ($owner) {
switch($section) {
case 'friends':
- elgg_push_breadcrumb(sprintf(elgg_echo('bookmarks:friends'), $owner->name));
+ elgg_push_breadcrumb(elgg_echo('bookmarks:friends', array($owner->name)));
$content = list_user_friends_objects($owner->getGUID(), 'bookmarks', 10, false, false);
$context = ($owner == $logged_in_user) ? 'friends' : '';
default:
case 'items':
- elgg_push_breadcrumb(sprintf(elgg_echo('bookmarks:user'), $owner->name));
+ elgg_push_breadcrumb(elgg_echo('bookmarks:user', array($owner->name)));
group_gatekeeper();
$options = array(
$content = $header . $content;
$body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
- echo elgg_view_page(sprintf(elgg_echo("bookmarks:user"), elgg_get_page_owner()->name), $body);
+ echo elgg_view_page(elgg_echo("bookmarks:user", array(elgg_get_page_owner()->name)), $body);
return TRUE;
}
$bookmarktext = elgg_echo("bookmarks:this");
if ($page_owner instanceof ElggGroup) {
- $bookmarktext = sprintf(elgg_echo("bookmarks:this:group"), $page_owner->name);
+ $bookmarktext = elgg_echo("bookmarks:this:group", array($page_owner->name));
$name = "group:$page_owner->guid";
} else {
$name = $page_owner->username;
$is_group = get_entity($object->container_guid);
$url = $object->getURL();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("bookmarks:river:created"),$url) . " ";
+$string = elgg_echo("bookmarks:river:created", array($url)) . " ";
$string .= "<a href=\"" . $object->address . "\">" . $object->title . "</a>";
if (($is_group instanceof ElggGroup) && (elgg_get_context() != 'groups')){
$string .= " " . elgg_echo('bookmarks:ingroup') . " <a href=\"{$is_group->getURL()}\">" . $is_group->name . "</a>";
$objects = elgg_list_entities_from_metadata($params);
elgg_pop_context();
-$title = sprintf(elgg_echo('categories:results'), $category);
+$title = elgg_echo('categories:results', array($category));
$content = elgg_view_title($title);
$content .= $objects;
function categories_on_enable() {
if (!$site->categories) {
global $CONFIG;
- $message = sprintf(elgg_echo('categories:on_enable_reminder'), "{$CONFIG->url}pg/admin/plugin_settings/categories");
+ $message = elgg_echo('categories:on_enable_reminder', array("{$CONFIG->url}pg/admin/plugin_settings/categories"));
elgg_add_admin_notice('categories_admin_notice_no_categories', $message);
}
return TRUE;
<?php
/**
* Elgg diagnostics
- *
+ *
* @package ElggDiagnostics
*/
admin_gatekeeper();
-
- $output = sprintf(elgg_echo('diagnostics:header'), date('r'), get_loggedin_user()->name);
+
+ $output = elgg_echo('diagnostics:header', array(date('r'), get_loggedin_user()->name));
$output = trigger_plugin_hook('diagnostics:report', 'system', null, $output);
-
+
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-disposition: attachment; filename=elggdiagnostic.txt');
$version = get_version();
$release = get_version(true);
- $returnvalue .= sprintf(elgg_echo('diagnostics:report:basic'), $release, $version);
+ $returnvalue .= elgg_echo('diagnostics:report:basic', array($release, $version));
return $returnvalue;
}
*/
function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params)
{
- $returnvalue .= sprintf(elgg_echo('diagnostics:report:plugins'), print_r(get_installed_plugins(), true));
+ $returnvalue .= elgg_echo('diagnostics:report:plugins', array(print_r(get_installed_plugins(), true)));
return $returnvalue;
}
{
global $CONFIG;
- $returnvalue .= sprintf(elgg_echo('diagnostics:report:md5'), diagnostics_md5_dir($CONFIG->path));
+ $returnvalue .= elgg_echo('diagnostics:report:md5', array(diagnostics_md5_dir($CONFIG->path)));
return $returnvalue;
}
}
- $returnvalue .= sprintf(elgg_echo('diagnostics:report:php'), print_r($phpinfo, true));
+ $returnvalue .= elgg_echo('diagnostics:report:php', array(print_r($phpinfo, true)));
return $returnvalue;
}
global $CONFIG;
$output = str_replace($CONFIG->dbpass, '<<DBPASS>>', print_r($GLOBALS, true));
- $returnvalue .= sprintf(elgg_echo('diagnostics:report:globals'), $output);
+ $returnvalue .= elgg_echo('diagnostics:report:globals', array($output));
return $returnvalue;
}
<?php
/**
* Elgg file browser
- *
+ *
* @package ElggFile
*/
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
+
if (is_callable('group_gatekeeper')) {
group_gatekeeper();
}
-
+
$owner = elgg_get_page_owner();
-
- $title = sprintf(elgg_echo("file:friends"),$owner->name);
- $area1 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file'));
+
+ $title = elgg_echo("file:friends",array($owner->name));
+ $area1 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file'));
elgg_push_context('search');
// offset is grabbed in list_user_friends_objects
$content = list_user_friends_objects($owner->guid, 'file', 10, false);
elgg_pop_context();
$area1 .= get_filetype_cloud($owner->guid, true);
-
+
// handle case where friends don't have any files
if (empty($content)) {
$area2 .= "<p class='margin_top'>".elgg_echo("file:none")."</p>";
} else {
$area2 .= $content;
}
-
+
//get the latest comments on all files
$comments = get_annotations(0, "object", "file", "generic_comment", "", 0, 4, 0, "desc");
- $area3 = elgg_view('annotation/latest_comments', array('comments' => $comments));
-
+ $area3 = elgg_view('annotation/latest_comments', array('comments' => $comments));
+
$content = "<div class='files'>".$area1.$area2."</div>";
$body = elgg_view_layout('one_column_with_sidebar', $content, $area3);
-
+
echo elgg_view_page($title, $body);
?>
\ No newline at end of file
<?php
/**
* Elgg file browser
- *
+ *
* @package ElggFile
- *
- *
+ *
+ *
* TODO: File icons, download & mime types
*/
// access check for closed groups
group_gatekeeper();
-
+
//set the title
if (elgg_get_page_owner_guid() == get_loggedin_userid()) {
$title = elgg_echo('file:yours');
$area1 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'file'));
} else {
- $title = sprintf(elgg_echo("file:user"),elgg_get_page_owner()->name);
+ $title = elgg_echo("file:user",array(elgg_get_page_owner()->name));
$area1 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file'));
}
-
+
// Get objects
elgg_push_context('search');
$offset = (int)get_input('offset', 0);
} else {
$area2 .= "<p class='margin_top'>".elgg_echo("file:none")."</p>";
}
-
+
//get the latest comments on the current users files
$comments = get_annotations(0, "object", "file", "generic_comment", "", 0, 4, 0, "desc",0,0,page_owner());
$area3 = elgg_view('annotation/latest_comments', array('comments' => $comments));
-
+
$content = "<div class='files'>".$area1.$area2."</div>";
$body = elgg_view_layout('one_column_with_sidebar', $content, $area3);
-
+
echo elgg_view_page($title, $body);
?>
\ No newline at end of file
/**
* Elgg file search
- *
+ *
* @package ElggFile
*/
// Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
+
// Get input
$md_type = 'simpletype';
$tag = get_input('tag');
}
}
$page_owner = get_input('page_owner',0);
- if ($page_owner) {
+ if ($page_owner) {
set_page_owner($page_owner);
} else {
if ($friends) {
- set_page_owner($friends);
+ set_page_owner($friends);
} else {
if ($owner_guid > 0 && !is_array($owner_guid))
set_page_owner($owner_guid);
}
}
-
+
if (is_callable('group_gatekeeper')) group_gatekeeper();
if (empty($tag)) {
$area2 = elgg_view_title(elgg_echo('file:type:all'));
$area2 = elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'file'));
} else {
- $title = sprintf(elgg_echo('searchtitle'),$tag);
+ $title = elgg_echo('searchtitle',array($tag));
if (is_array($owner_guid)) {
//$area2 = elgg_view_title(elgg_echo("file:friends:type:" . $tag));
$area2 = elgg_view('page_elements/content_header', array('context' => "friends", 'type' => 'file'));
} else if (elgg_get_page_owner_guid() && elgg_get_page_owner_guid() != get_loggedin_userid()) {
- //$area2 = elgg_view_title(sprintf(elgg_echo("file:user:type:" . $tag),elgg_get_page_owner()->name));
+ //$area2 = elgg_view_title(elgg_echo("file:user:type:" . $tag,array(elgg_get_page_owner()->name)));
$area2 = elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'file'));
} else{
//$area2 = elgg_view_title(elgg_echo("file:type:" . $tag));
} else {
$area1 = get_filetype_cloud();
}
-
+
elgg_push_context('search');
$offset = (int)get_input('offset', 0);
} else {
$area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'file', 'owner_guid' => $owner_guid, 'limit' => $limit, 'offset' => $offset));
}
-
+
elgg_pop_context();
-
+
$content = "<div class='files'>".$area1.$area2."</div>";
-
+
$body = elgg_view_layout('one_column_with_sidebar', $content);
-
+
echo elgg_view_page($title, $body);
?>
\ No newline at end of file
<?php
/**
* Elgg file browser
- *
+ *
* @package ElggFile
*/
/**
- * Override the ElggFile so that
+ * Override the ElggFile so that
*/
class FilePluginFile extends ElggFile {
protected function initialise_attributes() {
parent::initialise_attributes();
-
+
$this->attributes['subtype'] = "file";
}
-
- public function __construct($guid = null) {
+
+ public function __construct($guid = null) {
parent::__construct($guid);
}
}
-
+
/**
* File plugin initialisation functions.
*/
function file_init() {
global $CONFIG;
-
+
// Set up menu (tools dropdown)
add_menu(elgg_echo('files'), "pg/file/");
-
+
// Extend CSS
elgg_extend_view('css', 'file/css');
-
- // extend group main page
+
+ // extend group main page
elgg_extend_view('groups/tool_latest','file/groupprofile_files');
-
+
// Register a page handler, so we can have nice URLs
register_page_handler('file','file_page_handler');
-
+
// Add a new file widget
add_widget_type('filerepo',elgg_echo("file"),elgg_echo("file:widget:description"));
-
+
// Register a URL handler for files
register_entity_url_handler('file_url','object','file');
-
+
// Register granular notification for this object type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'file', elgg_echo('file:newupload'));
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'file_notify_message');
-
- // add the group files tool option
+
+ // add the group files tool option
add_group_tool_option('file',elgg_echo('groups:enablefiles'),true);
// Register entity type
register_plugin_hook('embed_get_sections', 'all', 'file_embed_get_sections');
register_plugin_hook('embed_get_items', 'file', 'file_embed_get_items');
register_plugin_hook('embed_get_upload_sections', 'all', 'file_embed_get_upload_sections');
-
+
}
-
+
/**
* Sets up submenus for the file system. Triggered on pagesetup.
*
*/
function file_submenus() {
-
+
global $CONFIG;
-
+
$page_owner = elgg_get_page_owner();
-
- // Group submenu option
+
+ // Group submenu option
if ($page_owner instanceof ElggGroup && elgg_get_context() == "groups") {
- if($page_owner->file_enable != "no"){
- add_submenu_item(sprintf(elgg_echo("file:group"),$page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
- }
+ if($page_owner->file_enable != "no"){
+ add_submenu_item(elgg_echo("file:group",array($page_owner->name)), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
+ }
}
}
* @param array $page Array of page elements, forwarded by the page handling mechanism
*/
function file_page_handler($page) {
-
+
global $CONFIG;
-
+
// The username should be the file we're getting
if (isset($page[0])) {
set_input('username',$page[0]);
}
-
+
if (isset($page[1])) {
- switch($page[1]) {
- case "read":
- set_input('guid',$page[2]);
+ switch($page[1]) {
+ case "read":
+ set_input('guid',$page[2]);
include(dirname(dirname(dirname(__FILE__))) . "/pages/entities/index.php");
break;
- case "friends":
- include($CONFIG->pluginspath . "file/friends.php");
- break;
- case "world":
- include($CONFIG->pluginspath . "file/world.php");
- break;
- case "new":
- include($CONFIG->pluginspath . "file/upload.php");
- break;
- }
+ case "friends":
+ include($CONFIG->pluginspath . "file/friends.php");
+ break;
+ case "world":
+ include($CONFIG->pluginspath . "file/world.php");
+ break;
+ case "new":
+ include($CONFIG->pluginspath . "file/upload.php");
+ break;
+ }
} else {
// Include the standard profile index
include($CONFIG->pluginspath . "file/index.php");
}
-
+
}
-
+
/**
* Returns a more meaningful message
*
* @param unknown_type $entity_type
* @param unknown_type $returnvalue
* @param unknown_type $params
- */
+ */
function file_notify_message($hook, $entity_type, $returnvalue, $params) {
$entity = $params['entity'];
$to_entity = $params['to_entity'];
* @return string The overall type
*/
function get_general_file_type($mimetype) {
-
+
switch($mimetype) {
case "application/msword":
return "document";
return "document";
break;
}
-
+
if (substr_count($mimetype,'text/'))
return "document";
-
+
if (substr_count($mimetype,'audio/'))
return "audio";
-
+
if (substr_count($mimetype,'image/'))
return "image";
-
+
if (substr_count($mimetype,'video/'))
return "video";
if (substr_count($mimetype,'opendocument'))
- return "document";
-
- return "general";
+ return "document";
+
+ return "general";
}
-
+
/**
* Returns a list of filetypes to search specifically on
*
- * @param int|array $owner_guid The GUID(s) of the owner(s) of the files
+ * @param int|array $owner_guid The GUID(s) of the owner(s) of the files
* @param true|false $friends Whether we're looking at the owner or the owner's friends
* @return string The typecloud
*/
function get_filetype_cloud($owner_guid = "", $friends = false) {
-
+
if ($friends) {
if ($friendslist = get_user_friends($user_guid, "", 999999, 0)) {
$friendguids = array();
return elgg_view('file/typecloud',array('owner_guid' => $owner_guid, 'friend_guid' => $friendofguid, 'types' => $types));
}
-
+
/**
* Register file as an embed type.
*
'layout' => 'list',
'icon_size' => 'small',
);
-
+
return $value;
}
-
+
/**
* Return a list of files for embedding
*
'type_subtype_pair' => array('object' => 'file'),
'count' => TRUE
);
-
+
if ($count = elgg_get_entities($options)) {
$value['count'] += $count;
-
+
unset($options['count']);
$options['offset'] = $params['offset'];
$options['limit'] = $params['limit'];
-
+
$items = elgg_get_entities($options);
-
+
$value['items'] = array_merge($items, $value['items']);
}
-
+
return $value;
}
-
+
/**
* Register file as an embed type.
*
'name' => elgg_echo('file'),
'view' => 'file/embed_upload'
);
-
+
return $value;
}
-
-
+
+
/**
* Populates the ->getUrl() method for file objects
*
function file_url($entity) {
$title = $entity->title;
$title = elgg_get_friendly_title($title);
- return "pg/file/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title;
+ return "pg/file/" . $entity->getOwnerEntity()->username . "/read/" . $entity->getGUID() . "/" . $title;
}
-
+
// Make sure test_init is called on initialisation
register_elgg_event_handler('init','system','file_init');
register_elgg_event_handler('pagesetup','system','file_submenus');
-
+
// Register actions
register_action("file/upload", false, $CONFIG->pluginspath . "file/actions/upload.php");
register_action("file/save", false, $CONFIG->pluginspath . "file/actions/save.php");
// temporary - see #2010
register_action("file/download", false, $CONFIG->pluginspath. "file/actions/download.php");
-
+
?>
/**
* Elgg file browser.
* File renderer.
- *
+ *
* @package ElggFile
*/
global $CONFIG;
-
+
$file = $vars['entity'];
-
+
$file_guid = $file->getGUID();
$tags = $file->tags;
$title = $file->title;
$owner = $vars['entity']->getOwnerEntity();
$friendlytime = elgg_view_friendly_time($vars['entity']->time_created);
$mime = $file->mimetype;
-
+
if (!$title) {
$title = elgg_echo('untitled');
}
-
+
if (elgg_get_context() == "search") { // Start search listing version
-
+
if (get_input('search_viewtype') == "gallery") {
echo "<div class='filerepo_gallery_item'>";
if ($vars['entity']->smallthumb) {
//get the number of comments
$numcomments = elgg_count_comments($vars['entity']);
if ($numcomments)
- echo "<p class='filerepo_comments'><a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a></p>";
+ echo "<p class='filerepo_comments'><a href=\"{$file->getURL()}\">" . elgg_echo("comments") . " (" . $numcomments . ")</a></p>";
+
-
//if the user can edit, display edit and delete links
if ($file->canEdit()) {
echo "<div class='filerepo_controls'><p>";
echo "<a href=\"".elgg_get_site_url()."mod/file/edit.php?file_guid={$file->getGUID()}\">" . elgg_echo('edit') . "</a> ";
echo elgg_view('output/confirmlink',array(
-
+
'href' => "action/file/delete?file=" . $file->getGUID(),
'text' => elgg_echo("delete"),
'confirm' => elgg_echo("file:delete:confirm"),
'is_action' => true,
-
+
));
echo "</p></div>";
}
-
-
+
+
} else {
echo "<p class='filerepo_title'>{$title}</p>";
echo "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'large')) . "</a>";
//get the number of comments
$numcomments = elgg_count_comments($file);
if ($numcomments)
- echo "<p class='filerepo_comments'><a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a></p>";
+ echo "<p class='filerepo_comments'><a href=\"{$file->getURL()}\">" . elgg_echo("comments") . " (" . $numcomments . ")</a></p>";
}
echo "</div>";
-
+
} else {
-
+
$info = "<p class='entity_title'> <a href=\"{$file->getURL()}\">{$title}</a></p>";
$info .= "<p class='entity_subtext'><a href=\"".elgg_get_site_url()."pg/file/{$owner->username}\">{$owner->name}</a> {$friendlytime}";
$numcomments = elgg_count_comments($file);
if ($numcomments)
- $info .= ", <a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a>";
+ $info .= ", <a href=\"{$file->getURL()}\">" . elgg_echo("comments") . " (" . $numcomments . ")</a>";
$info .= "</p>";
$icon = "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . "</a>";
-
+
echo elgg_view_listing($icon, $info);
-
+
}
-
+
} else { // Start main version
-
+
?>
<div class="filerepo_file">
<div class="filerepo_icon">
- <a href="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php
-
- echo elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid));
-
- ?></a>
+ <a href="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php
+
+ echo elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid));
+
+ ?></a>
</div>
-
+
<div class="filerepo_title_owner_wrapper">
<?php
//get the user and a link to their gallery
$user_gallery = elgg_get_site_url() . "mod/file/search.php?md_type=simpletype&subtype=file&tag=image&owner_guid=" . $owner->guid . "&search_viewtype=gallery";
?>
- <div class="filerepo_user_gallery_link"><a href="<?php echo $user_gallery; ?>"><?php echo sprintf(elgg_echo("file:user:gallery"),''); ?></a></div>
+ <div class="filerepo_user_gallery_link"><a href="<?php echo $user_gallery; ?>"><?php echo elgg_echo("file:user:gallery",array('')); ?></a></div>
<div class="filerepo_title"><h2><a href="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php echo $title; ?></a></h2></div>
<div class="filerepo_owner">
<?php
echo elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny'));
-
+
?>
<p class="filerepo_owner_details"><b><a href="<?php echo elgg_get_site_url(); ?>pg/file/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b><br />
<small><?php echo $friendlytime; ?></small></p>
</div>
</div>
-
+
<div class="filerepo_maincontent">
-
+
<div class="filerepo_description"><?php echo elgg_view('output/longtext', array('value' => $desc)); ?></div>
<?php
}
?>
- <?php
+ <?php
if (elgg_view_exists('file/specialcontent/' . $mime)) {
echo "<div class='filerepo_specialcontent'>".elgg_view('file/specialcontent/' . $mime, $vars)."</div>";
} else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) {
echo "<div class='filerepo_specialcontent'>".elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars)."</div>";
}
-
+
?>
-
+
<div class="filerepo_download"><p><a class="action_button small" href="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("file:download"); ?></a></p></div>
-
+
<?php
if ($file->canEdit()) {
<div class="filerepo_controls">
<p>
- <a href="<?php echo elgg_get_site_url(); ?>mod/file/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('edit'); ?></a>
- <?php
+ <a href="<?php echo elgg_get_site_url(); ?>mod/file/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('edit'); ?></a>
+ <?php
echo elgg_view('output/confirmlink',array(
-
+
'href' => "action/file/delete?file=" . $file->getGUID(),
'text' => elgg_echo("delete"),
'confirm' => elgg_echo("file:delete:confirm"),
'is_action' => true,
-
- ));
+
+ ));
?>
</p>
</div>
-<?php
+<?php
}
?>
<?php
if ($vars['full']) {
-
+
echo elgg_view_comments($file);
-
+
}
?>
$object = get_entity($vars['item']->object_guid);
$url = $object->getURL();
$container = get_entity($object->container_guid);
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("file:river:created"),$url) . " " . elgg_echo("file:river:item");
+ $string = elgg_echo("file:river:created", array($url)) . " " . elgg_echo("file:river:item");
$string .= " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
if ($container && $container instanceof ElggGroup) {
$string .= ' ' . elgg_echo('groups:river:togroup') . " <a href=\"" . $container->getURL() ."\">". $container->name . "</a>";
}
echo $string;
-
+
?>
\ No newline at end of file
<?php
/**
* Elgg garbage collector.
- *
+ *
* @package ElggGarbageCollector
*/
{
case 'weekly':
case 'monthly' :
- case 'yearly' :
+ case 'yearly' :
break;
default: $period = 'monthly';
}
-
+
// Register cron hook
register_plugin_hook('cron', $period, 'garbagecollector_cron');
}
-
+
/**
* Cron job
*
function garbagecollector_cron($hook, $entity_type, $returnvalue, $params)
{
global $CONFIG;
-
+
echo elgg_echo('garbagecollector');
-
+
// Garbage collect metastrings
echo elgg_echo('garbagecollector:gc:metastrings');
-
+
if (delete_orphaned_metastrings()!==false) {
echo elgg_echo('garbagecollector:ok');
} else
echo elgg_echo('garbagecollector:error');
-
+
echo "\n";
-
+
// Now, because we are nice, trigger a plugin hook to let other plugins do some GC
$rv = true;
$period = get_plugin_setting('period','garbagecollector');
trigger_plugin_hook('gc', 'system', array('period' => $period));
-
+
// Now we optimize all tables
$tables = get_db_tables();
foreach ($tables as $table) {
- echo sprintf(elgg_echo('garbagecollector:optimize'), $table);
-
+ echo elgg_echo('garbagecollector:optimize', array($table));
+
if (optimize_table($table)!==false)
echo elgg_echo('garbagecollector:ok');
else
echo "\n";
}
-
+
echo elgg_echo('garbagecollector:done');
}
-
+
// Initialise plugin
register_elgg_event_handler('init','system','garbagecollector_init');
?>
\ No newline at end of file
// send welcome email
notify_user($user->getGUID(), $group->owner_guid,
- sprintf(elgg_echo('groups:welcome:subject'), $group->name),
- sprintf(elgg_echo('groups:welcome:body'), $user->name, $group->name, $group->getURL()),
+ elgg_echo('groups:welcome:subject', array($group->name)),
+ elgg_echo('groups:welcome:body', array($user->name, $group->name, $group->getURL())),
NULL);
system_message(elgg_echo('groups:addedtogroup'));
// Send email
$url = elgg_get_site_url()."pg/groups/invited?user_guid={$user->guid}&group_guid={$group->guid}";
if (notify_user($user->getGUID(), $group->owner_guid,
- sprintf(elgg_echo('groups:invite:subject'), $user->name, $group->name),
- sprintf(elgg_echo('groups:invite:body'), $user->name, $logged_in_user->name, $group->name, $url),
+ elgg_echo('groups:invite:subject', array($user->name, $group->name)),
+ elgg_echo('groups:invite:body', array($user->name, $logged_in_user->name, $group->name, $url)),
NULL))
system_message(elgg_echo("groups:userinvited"));
else
// Send email
$url = "{$CONFIG->url}pg/groups/invitations/{$user->username}";
if (notify_user($user->getGUID(), $group->owner_guid,
- sprintf(elgg_echo('groups:invite:subject'), $user->name, $group->name),
- sprintf(elgg_echo('groups:invite:body'), $user->name, $logged_in_user->name, $group->name, $url),
+ elgg_echo('groups:invite:subject', array($user->name, $group->name)),
+ elgg_echo('groups:invite:body', array($user->name, $logged_in_user->name, $group->name, $url)),
NULL))
system_message(elgg_echo("groups:userinvited"));
else
// Send email
$url = "{$CONFIG->url}mod/groups/membershipreq.php?group_guid={$group->guid}";
if (notify_user($group->owner_guid, $user->getGUID(),
- sprintf(elgg_echo('groups:request:subject'), $user->name, $group->name),
- sprintf(elgg_echo('groups:request:body'), $group->getOwnerEntity()->name, $user->name, $group->name, $user->getURL(), $url),
+ elgg_echo('groups:request:subject', array($user->name, $group->name)),
+ elgg_echo('groups:request:body', array($group->getOwnerEntity()->name, $user->name, $group->name, $user->getURL(), $url)),
NULL))
system_message(elgg_echo("groups:joinrequestmade"));
else
$area1 .= elgg_view_title(elgg_echo('groups:activity'));\r
$area1 .= elgg_view("group_activity/extend");\r
$area1 .= "<div class='group_listings hide_comments'>".$river_items."</div>";\r
-$title = sprintf(elgg_echo("groups:activity"), elgg_get_page_owner()->name);\r
+$title = elgg_echo("groups:activity", array(elgg_get_page_owner()->name));\r
$body = elgg_view_layout('one_column_with_sidebar', $area1);\r
\r
// Finally draw the page\r
$objects = "<div class='group_listings'>".$objects."</div>";
- $title = sprintf(elgg_echo("groups:all"), elgg_get_page_owner()->name);
+ $title = elgg_echo("groups:all", array(elgg_get_page_owner()->name));
if(isloggedin()){
$area1 .= elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new"));
}
if (elgg_get_context() == "search") {
var_export($counter);
if($counter == 1){
- $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created:single'), $forum_created, $counter) . "<br />";
+ $info = "<p class='entity_subtext groups'>" . elgg_echo('groups:forum:created:single', array($forum_created, $counter)) . "<br />";
}else{
- $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created'), $forum_created, $counter) . "<br />";
+ $info = "<p class='entity_subtext groups'>" . elgg_echo('groups:forum:created', array($forum_created, $counter)) . "<br />";
}
- if (($last_time) && ($u)) $info.= sprintf(elgg_echo('groups:lastupdated'), elgg_view_friendly_time($last_time), " <a href=\"" . $u->getURL() . "\">" . $u->name . "</a>");
- $info .= '</p>';
+ if (($last_time) && ($u)) $info.= elgg_echo('groups:lastupdated', array(elgg_view_friendly_time($last_time), " <a href=\"" . $u->getURL() . "\">" . $u->name . "</a>"));
+ $info .= '</p>';
//get the group avatar
$icon = elgg_view("profile/icon",array('entity' => $u, 'size' => 'tiny'));
- //get the group and topic title
- $info .= "<p class='entity_subtext'><b>" . elgg_echo('groups:topic') . ":</b> <a href=\"".elgg_get_site_url()."mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
- if ($group instanceof ElggGroup) {
- $info .= "<p class='entity_title'><b>" . elgg_echo('group') . ":</b> <a href=\"{$group->getURL()}\">".htmlentities($group->name, ENT_QUOTES, 'UTF-8') ."</a></p>";
- }
+ //get the group and topic title
+ $info .= "<p class='entity_subtext'><b>" . elgg_echo('groups:topic') . ":</b> <a href=\"".elgg_get_site_url()."mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
+ if ($group instanceof ElggGroup) {
+ $info .= "<p class='entity_title'><b>" . elgg_echo('group') . ":</b> <a href=\"{$group->getURL()}\">".htmlentities($group->name, ENT_QUOTES, 'UTF-8') ."</a></p>";
+ }
} else {
if($counter == 1){
- $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created:single'), $forum_created, $counter) . "</p>";
+ $info = "<p class='entity_subtext groups'>" . elgg_echo('groups:forum:created:single', array($forum_created, $counter)) . "</p>";
}else{
- $info = "<p class='entity_subtext groups'>" . sprintf(elgg_echo('groups:forum:created'), $forum_created, $counter) . "</p>";
+ $info = "<p class='entity_subtext groups'>" . elgg_echo('groups:forum:created', array($forum_created, $counter)) . "</p>";
}
- $info .= "<p class='entity_title'>" . elgg_echo('groups:started') . " " . $topic_owner->name . ": <a href=\"".elgg_get_site_url()."mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
+ $info .= "<p class='entity_title'>" . elgg_echo('groups:started') . " " . $topic_owner->name . ": <a href=\"".elgg_get_site_url()."mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>";
- if (groups_can_edit_discussion($vars['entity'], elgg_get_page_owner()->owner_guid)) {
- // display the delete link to those allowed to delete
- $info .= "<div class='entity_metadata'>";
+ if (groups_can_edit_discussion($vars['entity'], elgg_get_page_owner()->owner_guid)) {
+ // display the delete link to those allowed to delete
+ $info .= "<div class='entity_metadata'>";
$info .= '<span class="entity_edit">' . elgg_view("output/url", array(
- 'href' => "mod/groups/edittopic.php?group={$vars['entity']->container_guid}&topic={$vars['entity']->guid}",
- 'text' => elgg_echo('edit'),
- ));
+ 'href' => "mod/groups/edittopic.php?group={$vars['entity']->container_guid}&topic={$vars['entity']->guid}",
+ 'text' => elgg_echo('edit'),
+ ));
$info .= '</span>';
-
- // display the delete link to those allowed to delete
- $info .= '<span class="delete_button">' . elgg_view("output/confirmlink", array(
- 'href' => "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm'),
- ));
+
+ // display the delete link to those allowed to delete
+ $info .= '<span class="delete_button">' . elgg_view("output/confirmlink", array(
+ 'href' => "action/groups/deletetopic?topic=" . $vars['entity']->guid . "&group=" . $vars['entity']->container_guid,
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ ));
$info .= "</span></div>";
- }
+}
if (($last_time) && ($u)) {
$commenter_link = "<a href\"{$u->getURL()}\">$u->name</a>";
- $text = sprintf(elgg_echo('groups:lastcomment'), elgg_view_friendly_time($last_time), $commenter_link);
+ $text = elgg_echo('groups:lastcomment', array(elgg_view_friendly_time($last_time), $commenter_link));
$info .= "<p class='entity_subtext'>$text</p>";
}
- //get the user avatar
+ //get the user avatar
$icon = elgg_view("profile/icon",array('entity' => $topic_owner, 'size' => 'tiny'));
}
$group_guid = $object->container_guid;
//grab the annotation, if one exists
if($vars['item']->annotation_id != 0) {
- $comment = get_annotation($vars['item']->annotation_id)->value;
+ $comment = get_annotation($vars['item']->annotation_id)->value;
}
$comment = strip_tags($comment);//this is so we don't get large images etc in the activity river
$url = elgg_get_site_url() . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid;
$url_user = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groupforum:river:posted"),$url_user) . " ";
+ $string = elgg_echo("groupforum:river:posted", array($url_user)) . " ";
$string .= elgg_echo("groupforum:river:annotate:create") . " | <a href=\"" . $url . "\">" . $object->title . "</a> <span class='entity_subtext'>". elgg_view_friendly_time($object->time_created) ."<a class='river_comment_form_button link' href=\"{$object_url}\">Visit discussion</a>";
$string .= elgg_view('likes/forms/link', array('entity' => $object));
$string .= "</span>";
$group_guid = $object->container_guid;
$group = get_entity($group_guid);
$url = elgg_get_site_url() . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid;
- //$comment = $object->getAnnotations("group_topic_post", 1, 0, "asc");
+ //$comment = $object->getAnnotations("group_topic_post", 1, 0, "asc");
//foreach($comment as $c){
$contents = $object->description;
//}
$contents = strip_tags($contents);//this is so we don't get large images etc in the activity river
$url_user = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groupforum:river:postedtopic"),$url_user) . ": ";
+ $string = elgg_echo("groupforum:river:postedtopic", array($url_user)) . ": ";
$string .= "<a href=\"" . $url . "\">" . $object->title . "</a>";
$string .= " " . elgg_echo('groups:ingroup') . " <a href=\"{$group->getURL()}\">" . $group->name . "</a>";
$string .= " <span class='entity_subtext'>". elgg_view_friendly_time($object->time_created);
$string .= "<div class=\"river_content_display\">";
$string .= elgg_get_excerpt($contents, 200);
$string .= "</div>";
-
+
echo $string;
\ No newline at end of file
$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
$object = get_entity($vars['item']->object_guid);
$objecturl = $object->getURL();
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groups:river:create"), $url) . " ";
+ $string = elgg_echo("groups:river:create", array($url)) . " ";
$string .= " <a href=\"" . $object->getURL() . "\">" . $object->name . "</a>";
$string .= " <span class='entity_subtext'>". elgg_view_friendly_time($object->time_created);
if (isloggedin()) {
$statement = $vars['statement'];
$performed_by = $statement->getSubject();
$object = $statement->getObject();
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groupforum:river:posted"),$url) . " ";
+ $string = elgg_echo("groupforum:river:posted", array($url)) . " ";
$string .= elgg_echo("groupforum:river:annotate:create") . " | <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
//$string .= "<div class=\"river_content\">Title: " . $object->title . "</div>";
$statement = $vars['statement'];
$performed_by = $statement->getSubject();
$object = $statement->getObject();
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groupforum:river:created"),$url) . " ";
+ $string = elgg_echo("groupforum:river:created", array($url)) . " ";
$string .= elgg_echo("groupforum:river:create") . " | <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
//$string .= "<div class=\"river_content\">Discussion topic: " . $object->title . "</div>";
$statement = $vars['statement'];
$performed_by = $statement->getSubject();
$object = $statement->getObject();
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groupforum:river:updated"),$url) . " ";
- $string .= elgg_echo("groupforum:river:update") . " | <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
-
+ $string = elgg_echo("groupforum:river:updated", array($url)) . " ";
+ $string .= elgg_echo("groupforum:river:update") . " | <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
+
?>
<?php echo $string; ?>
\ No newline at end of file
$objecturl = $object->getURL();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("groups:river:member"),$url) . " ";
+ $string = elgg_echo("groups:river:member", array($url)) . " ";
$string .= " <a href=\"" . $object->getURL() . "\">" . $object->name . "</a>";
$string .= " <span class='entity_subtext'>". elgg_view_friendly_time($vars['item']->posted);
$string .= "</span>";
}
$link = elgg_get_site_url() . 'pg/register?friend_guid=' . $current_user->guid . '&invitecode=' . generate_invite_code($current_user->username);
- $message = sprintf(elgg_echo('invitefriends:email'),
+ $message = elgg_echo('invitefriends:email', array(
$CONFIG->site->name,
$current_user->name,
$emailmessage,
$link
+ )
);
- $subject = sprintf(elgg_echo('invitefriends:subject'), $CONFIG->site->name);
+ $subject = elgg_echo('invitefriends:subject', array($CONFIG->site->name));
// create the from address
$site = get_entity($CONFIG->site_guid);
}
if ($error) {
- register_error(sprintf(elgg_echo('invitefriends:invitations_sent'), $sent_total));
+ register_error(elgg_echo('invitefriends:invitations_sent', array($sent_total)));
if (count($bad_emails) > 0) {
- register_error(sprintf(elgg_echo('invitefriends:email_error'), implode(', ', $bad_emails)));
+ register_error(elgg_echo('invitefriends:email_error', array(implode(', ', $bad_emails))));
}
if (count($already_members) > 0) {
- register_error(sprintf(elgg_echo('invitefriends:already_members'), implode(', ', $already_members)));
+ register_error(elgg_echo('invitefriends:already_members', array(implode(', ', $already_members))));
}
-
+
} else {
system_message(elgg_echo('invitefriends:success'));
}
$invite = elgg_echo('friends:invite');
$introduction = elgg_echo('invitefriends:introduction');
$message = elgg_echo('invitefriends:message');
- $default = sprintf(elgg_echo('invitefriends:message:default'), $CONFIG->site->name);
+ $default = elgg_echo('invitefriends:message:default', array($CONFIG->site->name));
echo <<< HTML
<h2>$invite</h2>
<?php
/**
* Elgg members index page
- *
+ *
* @package ElggMembers
*/
$body = elgg_view_layout("one_column_with_sidebar", $area2, $area1);
// Display page
-echo elgg_view_page(sprintf(elgg_echo('members:members'), $page_owner->name), $body);
\ No newline at end of file
+echo elgg_view_page(elgg_echo('members:members', array($page_owner->name)), $body);
\ No newline at end of file
$body = elgg_view_layout("two_column_left_sidebar", '', $area2);
// Display page
-echo elgg_view_page(sprintf(elgg_echo('messageboard:user'),$entity->name),$body);
+echo elgg_view_page(elgg_echo('messageboard:user', array($entity->name)), $body);
* Elgg Message board
* This plugin allows users and groups to attach a message board to their profile for other users
* to post comments.
- *
+ *
* @package ElggMessageBoard
*/
if (isset($page[0])) {
set_input('username', $page[0]);
}
-
+
// Include the standard messageboard index
include($CONFIG->pluginspath . "messageboard/index.php");
}
*/
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC) {
global $CONFIG;
-
+
$result = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
if (!$result) {
return FALSE;
// only send notification if not self
if ($poster->guid != $owner->guid) {
$subject = elgg_echo('messageboard:email:subject');
- $body = sprintf(
- elgg_echo('messageboard:email:body'),
+ $body = elgg_echo('messageboard:email:body', array(
$poster->name,
$message,
elgg_get_site_url() . "pg/messageboard/" . $owner->username,
$poster->name,
$poster->getURL()
- );
+ ));
notify_user($owner->guid, $poster->guid, $subject, $body);
}
$performed_on = get_entity($vars['item']->object_guid);
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("messageboard:river:added"),$url) . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard");
+$string = elgg_echo("messageboard:river:added", array($url)) . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard");
-echo $string;
+echo $string;
set_page_owner($page_owner->getGUID());
// Get the user's inbox, this will be all messages where the 'toId' field matches their guid
-// @todo - fix hack where limit + 1 messages are requested
+// @todo - fix hack where limit + 1 messages are requested
$messages = elgg_get_entities_from_metadata(array(
'type' => 'object',
'subtype' => 'messages',
// Draw page
-echo elgg_view_page(sprintf(elgg_echo('messages:user'),$page_owner->name),$body);
+echo elgg_view_page(elgg_echo('messages:user', array($page_owner->name)), $body);
$body = elgg_view_layout("one_column_with_sidebar", $content, $sidebar);
// Display page
-echo elgg_view_page(sprintf(elgg_echo('messages:message')),$body);
\ No newline at end of file
+echo elgg_view_page(elgg_echo('messages:message'), $body);
\ No newline at end of file
$body = elgg_view_layout("one_column_with_sidebar", $area2, $area3);
// Draw page
-echo elgg_view_page(sprintf(elgg_echo('messages:send'),$page_owner->name),$body);
\ No newline at end of file
+echo elgg_view_page(elgg_echo('messages:send', array($page_owner->name)), $body);
\ No newline at end of file
<?php
/**
* Elgg sent messages page
-*
+*
* @package ElggMessages
*/
// Display all the messages a user owns, these will make up the sentbox
// @todo - fix hack where limit + 1 is passed
-$messages = elgg_get_entities_from_metadata(array('metadata_name' => 'fromId', 'metadata_value' => get_loggedin_userid(), 'types' => 'object', 'subtypes' => 'messages', 'owner_guid' => $page_owner->guid, 'limit' => $limit + 1, 'offset' => $offset));
+$messages = elgg_get_entities_from_metadata(array('metadata_name' => 'fromId', 'metadata_value' => get_loggedin_userid(), 'types' => 'object', 'subtypes' => 'messages', 'owner_guid' => $page_owner->guid, 'limit' => $limit + 1, 'offset' => $offset));
// Set the page title
$body = elgg_view_layout("one_column_with_sidebar", $area2);
// Draw page
-echo elgg_view_page(sprintf(elgg_echo('messages:sentMessages'),$page_owner->name),$body);
+echo elgg_view_page(elgg_echo('messages:sentMessages', array($page_owner->name)), $body);
/**
* Elgg internal messages plugin
* This plugin lets user send each other messages.
-*
+*
* @package ElggMessages
*/
* Messages initialisation
*
* These parameters are required for the event API, but we won't use them:
-*
+*
* @param unknown_type $event
* @param unknown_type $object_type
* @param unknown_type $object
*/
function messages_init() {
-
- // Load system configuration
+
+ // Load system configuration
global $CONFIG;
-
+
//add submenu options
if (elgg_get_context() == "messages") {
add_submenu_item(elgg_echo('messages:inbox'), "pg/messages/" . get_loggedin_user()->username);
add_submenu_item(elgg_echo('messages:sentmessages'), "mod/messages/sent.php");
}
-
+
// Extend system CSS with our own styles, which are defined in the shouts/css view
elgg_extend_view('css','messages/css');
-
+
// Extend the elgg topbar
elgg_extend_view('elgg_topbar/extend','messages/topbar');
-
+
// Register a page handler, so we can have nice URLs
register_page_handler('messages','messages_page_handler');
-
+
// Register a URL handler for shouts posts
register_entity_url_handler('messages_url','object','messages');
-
- // Extend avatar user-menu
+
+ // Extend avatar user-menu
elgg_extend_view('profile/menu/links','messages/menu');
-
+
// Register a notification handler for site messages
register_notification_handler("site", "messages_site_notify_handler");
register_plugin_hook('notify:entity:message','object','messages_notification_msg');
register_notification_object('object','messages',elgg_echo('messages:new'));
-
+
// Override metadata permissions
- register_plugin_hook('permissions_check:metadata','object','messages_can_edit_metadata');
-
+ register_plugin_hook('permissions_check:metadata','object','messages_can_edit_metadata');
+
// ecml
register_plugin_hook('get_views', 'ecml', 'messages_ecml_views_hook');
function messages_can_edit_metadata($hook_name, $entity_type, $return_value, $parameters) {
global $messagesendflag;
-
+
if ($messagesendflag == 1) {
$entity = $parameters['entity'];
if ($entity->getSubtype() == "messages") {
return true;
}
}
-
+
return $return_value;
-
+
}
/**
*
*/
function messages_can_edit($hook_name, $entity_type, $return_value, $parameters) {
-
+
global $messagesendflag;
-
+
if ($messagesendflag == 1) {
$entity = $parameters['entity'];
if ($entity->getSubtype() == "messages") {
return true;
}
}
-
+
return $return_value;
-
+
}
/**
function messages_notification_msg($hook_name, $entity_type, $return_value, $parameters) {
global $CONFIG, $messages_pm;
-
+
if ($parameters['entity'] instanceof ElggEntity) {
-
+
if ($parameters['entity']->getSubtype() == 'messages') {
-
+
return false;
- /*if (!$messages_pm) return false;
- if ($parameters['method'] == 'email') {
- return sprintf(
- elgg_echo('messages:email:body'),
- get_loggedin_user()->name,
- strip_tags($parameters['entity']->description),
- elgg_get_site_url() . "pg/messages/" . $user->username,
- get_loggedin_user()->name,
- elgg_get_site_url() . "mod/messages/send.php?send_to=" . get_loggedin_userid()
- );
- } else if ($parameters['method'] == 'site') return false;*/
}
}
return null;
-
+
}
/**
*
*/
function messages_can_edit_container($hook_name, $entity_type, $return_value, $parameters) {
-
+
global $messagesendflag;
-
+
if ($messagesendflag == 1) {
return true;
}
-
+
return $return_value;
-
+
}
/**
* @return true|false Depending on success
*/
function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify = true, $add_to_sent = true) {
-
+
global $messagesendflag;
$messagesendflag = 1;
-
+
global $messages_pm;
if ($notify) {
$messages_pm = 1;
} else {
$messages_pm = 0;
}
-
+
// If $from == 0, set to current user
if ($from == 0)
$from = (int) get_loggedin_userid();
-
- // Initialise a new ElggObject
+
+ // Initialise a new ElggObject
$message_to = new ElggObject();
$message_sent = new ElggObject();
// Tell the system it's a message
$message_to->description = $body;
$message_sent->title = $subject;
$message_sent->description = $body;
- // set the metadata
- $message_to->toId = $send_to; // the user receiving the message
- $message_to->fromId = $from; // the user receiving the message
- $message_to->readYet = 0; // this is a toggle between 0 / 1 (1 = read)
- $message_to->hiddenFrom = 0; // this is used when a user deletes a message in their sentbox, it is a flag
- $message_to->hiddenTo = 0; // this is used when a user deletes a message in their inbox
- $message_sent->toId = $send_to; // the user receiving the message
- $message_sent->fromId = $from; // the user receiving the message
- $message_sent->readYet = 0; // this is a toggle between 0 / 1 (1 = read)
- $message_sent->hiddenFrom = 0; // this is used when a user deletes a message in their sentbox, it is a flag
- $message_sent->hiddenTo = 0; // this is used when a user deletes a message in their inbox
-
- $message_to->msg = 1;
- $message_sent->msg = 1;
-
- // Save the copy of the message that goes to the recipient
+ // set the metadata
+ $message_to->toId = $send_to; // the user receiving the message
+ $message_to->fromId = $from; // the user receiving the message
+ $message_to->readYet = 0; // this is a toggle between 0 / 1 (1 = read)
+ $message_to->hiddenFrom = 0; // this is used when a user deletes a message in their sentbox, it is a flag
+ $message_to->hiddenTo = 0; // this is used when a user deletes a message in their inbox
+ $message_sent->toId = $send_to; // the user receiving the message
+ $message_sent->fromId = $from; // the user receiving the message
+ $message_sent->readYet = 0; // this is a toggle between 0 / 1 (1 = read)
+ $message_sent->hiddenFrom = 0; // this is used when a user deletes a message in their sentbox, it is a flag
+ $message_sent->hiddenTo = 0; // this is used when a user deletes a message in their inbox
+
+ $message_to->msg = 1;
+ $message_sent->msg = 1;
+
+ // Save the copy of the message that goes to the recipient
$success = $message_to->save();
-
+
// Save the copy of the message that goes to the sender
if ($add_to_sent) $success2 = $message_sent->save();
-
+
$message_to->access_id = ACCESS_PRIVATE;
$message_to->save();
-
+
if ($add_to_sent) {
$message_sent->access_id = ACCESS_PRIVATE;
$message_sent->save();
}
-
- // if the new message is a reply then create a relationship link between the new message
- // and the message it is in reply to
- if($reply && $success){
- $create_relationship = add_entity_relationship($message_sent->guid, "reply", $reply);
- }
-
-
- global $CONFIG;
+
+ // if the new message is a reply then create a relationship link between the new message
+ // and the message it is in reply to
+ if($reply && $success){
+ $create_relationship = add_entity_relationship($message_sent->guid, "reply", $reply);
+ }
+
+
+ global $CONFIG;
$message_contents = strip_tags($body);
if ($send_to != get_loggedin_user() && $notify)
- notify_user($send_to, get_loggedin_userid(), elgg_echo('messages:email:subject'),
- sprintf(
- elgg_echo('messages:email:body'),
- get_loggedin_user()->name,
- $message_contents,
- elgg_get_site_url() . "pg/messages/" . $user->username,
- get_loggedin_user()->name,
- elgg_get_site_url() . "mod/messages/send.php?send_to=" . get_loggedin_userid()
- )
+ notify_user($send_to, get_loggedin_userid(), elgg_echo('messages:email:subject'),
+ elgg_echo('messages:email:body', array(
+ get_loggedin_user()->name,
+ $message_contents,
+ elgg_get_site_url() . "pg/messages/" . $user->username,
+ get_loggedin_user()->name,
+ elgg_get_site_url() . "mod/messages/send.php?send_to=" . get_loggedin_userid()
+ ))
);
-
- $messagesendflag = 0;
- return $success;
-
+
+ $messagesendflag = 0;
+ return $success;
+
}
/**
* @return true|false Depending on success
*/
function messages_page_handler($page) {
-
+
// The first component of a messages URL is the username
if (isset($page[0])) {
set_input('username',$page[0]);
}
-
+
// The second part dictates what we're doing
if (isset($page[1])) {
switch($page[1]) {
include(dirname(__FILE__) . "/index.php");
return true;
}
-
+
return false;
-
+
}
function messages_url($message) {
// A simple function to count the number of messages that are unread in a user's inbox
function count_unread_messages() {
-
- //get the users inbox messages
- //$num_messages = get_entities_from_metadata("toId", get_loggedin_userid(), "object", "messages", 0, 10, 0, "", 0, false);
- $num_messages = elgg_get_entities_from_metadata(array('metadata_name_value_pairs' => array(
- 'toId' => get_loggedin_userid(),
- 'readYet' => 0,
- 'msg' => 1
- ), 'owner_guid' => get_loggedin_userid()));
+
+ //get the users inbox messages
+ //$num_messages = get_entities_from_metadata("toId", get_loggedin_userid(), "object", "messages", 0, 10, 0, "", 0, false);
+$num_messages = elgg_get_entities_from_metadata(array('metadata_name_value_pairs' => array(
+ 'toId' => get_loggedin_userid(),
+ 'readYet' => 0,
+ 'msg' => 1
+ ), 'owner_guid' => get_loggedin_userid()));
if (is_array($num_messages))
$counter = sizeof($num_messages);
else
$counter = 0;
-
- return $counter;
-
+
+ return $counter;
+
}
function messages_site_notify_handler(ElggEntity $from, ElggUser $to, $subject, $message, array $params = NULL)
{
global $CONFIG;
-
+
if (!$from)
- throw new NotificationException(sprintf(elgg_echo('NotificationException:MissingParameter'), 'from'));
-
+ throw new NotificationException(elgg_echo('NotificationException:MissingParameter', array('from')));
+
if (!$to)
- throw new NotificationException(sprintf(elgg_echo('NotificationException:MissingParameter'), 'to'));
-
+ throw new NotificationException(elgg_echo('NotificationException:MissingParameter', array('to')));
+
global $messages_pm;
if (!$messages_pm)
return messages_send($subject,$message,$to->guid,$from->guid,0,false,false);
else return true;
-
+
}
/**
* Register messages with ECML.
$page_guid = get_input('page_guid');
$pages = get_entity($page_guid);
-add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
+add_submenu_item(elgg_echo("pages:user", array(elgg_get_page_owner()->name)),
+ "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
$title = $pages->title . ": " . elgg_echo("pages:history");
$content = elgg_view_title($title);
$body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
// Add menus
$owner = elgg_get_page_owner();
if (!($owner instanceof ElggGroup)) {
- add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
+ add_submenu_item(elgg_echo("pages:user", array(elgg_get_page_owner()->name)), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
add_submenu_item(elgg_echo('pages:all'), "mod/pages/world.php", 'pageslinksgeneral');
}
if (($owner instanceof ElggEntity) && (can_write_to_container(0,$owner->guid))){
$offset = get_input("offset", 0);
if($owner instanceof ElggGroup){
- $title = sprintf(elgg_echo("pages:group"),$owner->name);
+ $title = elgg_echo("pages:group",array($owner->name));
}else{
- $title = sprintf(elgg_echo("pages:user"),$owner->name);
+ $title = elgg_echo("pages:user",array($owner->name));
}
}
global $CONFIG;
-add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
+add_submenu_item(elgg_echo("pages:user", array(elgg_get_page_owner()->name)), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
$title = elgg_echo("pages:new");
$area2 .= elgg_view_title($title);
// Group submenu option
if ($page_owner instanceof ElggGroup && elgg_get_context() == 'groups') {
if($page_owner->pages_enable != "no"){
- add_submenu_item(sprintf(elgg_echo("pages:group"),$page_owner->name), "pg/pages/owned/" . $page_owner->username);
+ add_submenu_item(elgg_echo("pages:group", array($page_owner->name)), "pg/pages/owned/" . $page_owner->username);
}
}
}
}
global $CONFIG;
-// add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
if ($pages->canEdit()) {
add_submenu_item(elgg_echo('pages:newchild'), "pg/pages/new/?parent_guid={$pages->getGUID()}&container_guid=" . elgg_get_page_owner_guid(), 'pagesactions');
$owner_guid = $annotation->owner_guid;
$owner = get_entity($owner_guid);
-$rev = sprintf(elgg_echo('pages:revision'),
- elgg_view_friendly_time($annotation->time_created),
+$rev = elgg_echo('pages:revision',
+ array(elgg_view_friendly_time($annotation->time_created)),
"<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>"
);
$owner = get_entity($owner_guid);
- $info .= "<p class=\"owner_timestamp\">".sprintf(elgg_echo("pages:strapline"),
- elgg_view_friendly_time($time_updated),
+ $info .= "<p class=\"owner_timestamp\">" . elgg_echo("pages:strapline",
+ array(elgg_view_friendly_time($time_updated)),
"<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>"
) . "</p>";
}
$owner_guid = $latest->owner_guid;
$owner = get_entity($owner_guid);
- echo sprintf(elgg_echo("pages:strapline"),
- elgg_view_friendly_time($time_updated),
+ echo elgg_echo("pages:strapline",
+ array(elgg_view_friendly_time($time_updated)),
"<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>"
);
}
} else {
?>
-<div class="contentWrapper pageswelcome"><p><?php echo sprintf(elgg_echo('pages:welcomemessage'), $vars['config']->sitename); ?></p></div>
+<div class="contentWrapper pageswelcome"><p><?php echo elgg_echo('pages:welcomemessage', array($vars['config']->sitename)); ?></p></div>
<?php
}
$object = $statement->getObject();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("pages:river:posted"),$url) . " ";
+$string = elgg_echo("pages:river:posted", array($url)) . " ";
$string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("pages:river:annotate:create") . "</a> " . $object->title;
//$string .= "<div class=\"river_content\">" . $object->title . "</div>";
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$contents = strip_tags($object->description); //strip tags from the contents to stop large images etc blowing out the river view
-$string = sprintf(elgg_echo("pages:river:created"),$url) . " ";
+$string = elgg_echo("pages:river:created", array($url)) . " ";
$string .= elgg_echo("pages:river:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a> <span class='entity_subtext'>". elgg_view_friendly_time($object->time_created) ."</span> <a class='river_comment_form_button link'>Comment</a>";
$string .= elgg_view('likes/forms/link', array('entity' => $object));
$string .= "<div class=\"river_content_display\">";
$url = $object->getURL();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("pages:river:updated"),$url) . " ";
+$string = elgg_echo("pages:river:updated", array($url)) . " ";
$string .= elgg_echo("pages:river:update") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
echo $string;
$object = $statement->getObject();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("pages:river:posted"),$url) . " ";
+$string = elgg_echo("pages:river:posted", array($url)) . " ";
$string .= elgg_echo("pages:river:annotate:create") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
echo $string;
$object = $statement->getObject();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("pages:river:created"),$url) . " ";
+$string = elgg_echo("pages:river:created", array($url)) . " ";
$string .= elgg_echo("pages:river:create") . "<a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
echo $string;
\ No newline at end of file
$object = $statement->getObject();
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("pages:river:updated"),$url) . " ";
+$string = elgg_echo("pages:river:updated", array($url)) . " ";
$string .= elgg_echo("pages:river:update") . " <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";
echo $string;
\ No newline at end of file
//get the owners welcome message if it exists
$welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'pages_welcome', 'container_guid' => $page_owner->getGUID(), 'limit' => 1));
global $CONFIG;
-add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
+add_submenu_item(elgg_echo("pages:user", array(elgg_get_page_owner()->name)), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
$title = elgg_echo("pages:welcome");
$area2 .= elgg_view_title($title);
}
if(isloggedin()) {
- add_submenu_item(sprintf(elgg_echo("pages:user"), elgg_get_page_owner()->name), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
+ add_submenu_item(elgg_echo("pages:user", array(elgg_get_page_owner()->name)), "pg/pages/owned/" . elgg_get_page_owner()->username, 'pageslinksgeneral');
}
add_submenu_item(elgg_echo('pages:all'), "mod/pages/world.php", 'pageslinksgeneral');
$limit = get_input("limit", 10);
$offset = get_input("offset", 0);
-$title = sprintf(elgg_echo("pages:all"),elgg_get_page_owner()->name);
+$title = elgg_echo("pages:all",array(elgg_get_page_owner()->name));
// Get objects
elgg_push_context('search');
// Make sure we're logged in; forward to the front page if not
if (!isloggedin()) forward();
-
+
// Get input
$message_content = get_input('message_content'); // the actual message
$page_owner = get_input("pageOwner"); // the message board owner
$message_owner = get_input("guid"); // the user posting the message
$user = get_entity($page_owner); // the commentwall owner details
-
+
// Let's see if we can get a user entity from the specified page_owner
if ($user && !empty($message_content)) {
-
+
// If posting the comment was successful, say so
if ($user->annotate('commentwall',$message_content,$user->access_id, get_loggedin_userid())) {
-
+
global $CONFIG;
-
+
if ($user->getGUID() != get_loggedin_userid())
- notify_user($user->getGUID(), get_loggedin_userid(), elgg_echo('profile:comment:subject'),
- sprintf(
- elgg_echo('profile:comment:body'),
+ notify_user($user->getGUID(), get_loggedin_userid(), elgg_echo('profile:comment:subject'),
+ elgg_echo('profile:comment:body', array(
get_loggedin_user()->name,
$message_content,
elgg_get_site_url() . "pg/profile/" . $user->username,
get_loggedin_user()->name,
get_loggedin_user()->getURL()
- )
- );
-
- system_message(elgg_echo("profile:commentwall:posted"));
- // add to river
- add_to_river('river/object/profile/commentwall/create','commentwall',get_loggedin_userid(),$user->guid);
-
+ ))
+ );
+
+ system_message(elgg_echo("profile:commentwall:posted"));
+ // add to river
+ add_to_river('river/object/profile/commentwall/create','commentwall',get_loggedin_userid(),$user->guid);
+
} else {
register_error(elgg_echo("profile:commentwall:failure"));
}
-
+
} else {
register_error(elgg_echo("profile:commentwall:blank"));
}
-
+
// Forward back to the messageboard
forward(REFERER);
\ No newline at end of file
// limit to reasonable sizes.
if (!is_array($value) && $valuetype != 'longtext' && elgg_strlen($value) > 250) {
- $error = sprintf(elgg_echo('profile:field_too_long'), elgg_echo("profile:{$shortname}"));
+ $error = elgg_echo('profile:field_too_long', array(elgg_echo("profile:{$shortname}")));
register_error($error);
forward(REFERER);
}
//add to river if edited by self
if (get_loggedin_userid() == $user->guid) {
add_to_river('river/user/default/profileupdate','update',get_loggedin_userid(),get_loggedin_userid(),get_default_access(get_loggedin_user()));
- }
+ }
system_message(elgg_echo("profile:saved"));
}
$user = $vars['entity'];
if (!$user) {
// no user so no profile
- echo sprintf(elgg_echo('viewfailure'), __FILE__);
+ echo elgg_echo('viewfailure', array(__FILE__));
return TRUE;
}
$url = "{$user->getURL()}/";
-//select section
+//select section
switch($section){
case 'friends':
$friends = 'class="selected"';
case 'twitter':
$twitter = 'class="selected"';
break;
-
+
case 'commentwall':
$commentwall = 'class="selected"';
break;
<li <?php echo $twitter; ?>><a href="<?php echo $url . 'twitter'; ?>">Twitter</a></li>
<?php
}
-
+
//insert a view which others can extend
echo elgg_view('profile_navigation/extend', array('entity' => $user));
?>
}
if (!$user) {
// no user so we quit view
- echo sprintf(elgg_echo('viewfailure'), __FILE__);
+ echo elgg_echo('viewfailure', array(__FILE__));
return TRUE;
}
<?php
$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("profile:river:update"),$url) ." <span class='entity_subtext'>" . elgg_view_friendly_time($vars['item']->posted) . "</span>";
-
+ $string = elgg_echo("profile:river:update", array($url)) ." <span class='entity_subtext'>" . elgg_view_friendly_time($vars['item']->posted) . "</span>";
+
echo $string;
\ No newline at end of file
<?php
$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
-
+
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
- $string = sprintf(elgg_echo("profile:river:update"),$url) ." <span class='entity_subtext'>" . elgg_view_friendly_time($vars['item']->posted) . "</span>";
-
+ $string = elgg_echo("profile:river:update", array($url)) ." <span class='entity_subtext'>" . elgg_view_friendly_time($vars['item']->posted) . "</span>";
+
?>
<?php echo $string; ?>
\ No newline at end of file
// display appropriate comment link
if ($more_comments_count > 0) {
echo "<a class=\"river_more_comments show_more_button link\">" .
- sprintf(elgg_echo('riverdashboard:n_more_comments'), $more_comments_count) . '</a>';
+ elgg_echo('riverdashboard:n_more_comments', array($more_comments_count)) . '</a>';
echo "<a style=\"display: none\" class=\"river_more_comments show_less_button link\">" . elgg_echo('riverdashboard:show_less') . '</a>';
}
*/
?>
-<h2><?php echo sprintf(elgg_echo('welcome:user'), get_loggedin_user()->name); ?></h2>
\ No newline at end of file
+<h2><?php echo elgg_echo('welcome:user'), array(get_loggedin_user()->name); ?></h2>
\ No newline at end of file
$searched_words = search_remove_ignored_words($query, 'array');
$highlighted_query = search_highlight_words($searched_words, $query);
-$body = elgg_view_title(sprintf(elgg_echo('search:results'), "\"$highlighted_query\""));
+$body = elgg_view_title(elgg_echo('search:results', array("\"$highlighted_query\"")));
if (!$results_html) {
$body .= elgg_view('page_elements/contentwrapper', array('body' => elgg_echo('search:no_results')));
$layout_view = search_get_search_view($params, 'layout');
$layout = elgg_view($layout_view, array('params' => $params, 'body' => $body));
-$title = sprintf(elgg_echo('search:results'), "\"{$params['query']}\"");
+$title = elgg_echo('search:results', array("\"{$params['query']}\""));
echo elgg_view_page($title, $layout);
// @todo Sometimes we find comments on entities we can't display...
if ($entity->getVolatileData('search_unavailable_entity')) {
- $title = sprintf(elgg_echo('search:comment_on'), elgg_echo('search:unavailable_entity'));
+ $title = elgg_echo('search:comment_on', array(elgg_echo('search:unavailable_entity')));
// keep anchor for formatting.
$title = "<a>$title</a>";
} else {
$title = elgg_echo('item:' . $entity->getType());
}
- $title = sprintf(elgg_echo('search:comment_on'), $title);
+ $title = elgg_echo('search:comment_on', array($title));
$url = $entity->getURL() . '#comment_' . $entity->getVolatileData('search_match_annotation_id');
$title = "<a href=\"$url\">$title</a>";
}
if ($more) {
$title_key = ($more == 1) ? 'comment' : 'comments';
- $more_str = sprintf(elgg_echo('search:more'), $count, $type_str);
+ $more_str = elgg_echo('search:more', array($count, $type_str));
$more_link = "<div class='search_listing'><a href=\"$url\">$more_str</a></div>";
} else {
$more_link = '';
* @subpackage Core
*/
-echo sprintf(elgg_echo("tag:search:startblurb"), $vars['query']);
+echo elgg_echo("tag:search:startblurb", array($vars['query']));
// @todo Sometimes we find comments on entities we can't display...
if ($entity->getVolatileData('search_unavailable_entity')) {
- $title = sprintf(elgg_echo('search:comment_on'), elgg_echo('search:unavailable_entity'));
+ $title = elgg_echo('search:comment_on', array(elgg_echo('search:unavailable_entity')));
} else {
if ($entity->getType() == 'object') {
$title = $entity->title;
$title = elgg_echo('item:' . $entity->getType());
}
- $title = sprintf(elgg_echo('search:comment_on'), $title);
+ $title = elgg_echo('search:comment_on', array($title));
$title .= ' ' . elgg_echo('search:comment_by') . ' ' . $author_name;
$url = $entity->getURL() . '#annotation-' . $entity->getVolatileData('search_match_annotation_id');
}
/**
* Display sidebar tagcloud
**/
-
+
// Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
+
$title = elgg_view_title(elgg_echo('tagcloud:site:title'));
$tags = display_tagcloud(0, 100, 'tags');
//select the correct canvas area
$body = elgg_view_layout("one_column_with_sidebar", $title . $tags, $sidebar);
-
+
// Display page
-echo elgg_view_page(sprintf(elgg_echo('tagcloud:site:title'),$page_owner->name),$body);
\ No newline at end of file
+echo elgg_view_page(elgg_echo('tagcloud:site:title', array($page_owner->name)), $body);
\ No newline at end of file
/**
* Elgg thewire index page
- *
+ *
* @package Elggthewire
*/
// Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
+
// Get the current page's owner
$page_owner = elgg_get_page_owner();
if ($page_owner === false || is_null($page_owner)) {
$page_owner = get_loggedin_user();
set_page_owner($page_owner->getGUID());
}
-
+
// title
if (elgg_get_page_owner_guid() == get_loggedin_userid()) {
- $area2 = elgg_view_title(elgg_echo("thewire:read"));
- } else {
- $area2 = elgg_view_title(sprintf(elgg_echo("thewire:user"),$page_owner->name));
- }
-
+ $area2 = elgg_view_title(elgg_echo("thewire:read"));
+ } else {
+ $area2 = elgg_view_title(elgg_echo("thewire:user",array($page_owner->name)));
+ }
+
//add form
$area2 .= elgg_view("thewire/forms/add");
-
+
// Display the user's wire
$area2 .= list_user_objects($page_owner->getGUID(),'thewire');
-
- //select the correct canvas area
- $body = elgg_view_layout("one_column_with_sidebar", $area2);
-
+
+ //select the correct canvas area
+ $body = elgg_view_layout("one_column_with_sidebar", $area2);
+
// Display page
- echo elgg_view_page(sprintf(elgg_echo('thewire:user'),$page_owner->name),$body);
-
+ echo elgg_view_page(elgg_echo('thewire:user', array($page_owner->name)), $body);
+
?>
\ No newline at end of file
/**
* Elgg Wire Posts Listings
- *
+ *
* @package thewire
*
* @question - do we want users to be able to edit thewire?
- *
+ *
* @uses $vars['entity'] Optionally, the note to view
*/
if (isset($vars['entity'])) {
$user_name = $vars['entity']->getOwnerEntity()->name;
-
+
//if the note is a reply, we need some more info
$note_url = '';
- $note_owner = elgg_echo("thewire:notedeleted");
+ $note_owner = elgg_echo("thewire:notedeleted");
?>
<div class="wire_post">
<div class="wire_post_contents clearfix radius8">
- <div class="wire_post_icon">
- <?php
- echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'tiny'));
- ?>
- </div>
+ <div class="wire_post_icon">
+ <?php
+ echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'tiny'));
+ ?>
+ </div>
<div class="wire_post_options">
<?php
if(isloggedin()){
?>
<a href="<?php echo elgg_get_site_url(); ?>mod/thewire/add.php?wire_username=<?php echo $vars['entity']->getOwnerEntity()->username; ?>" class="action_button reply small"><?php echo elgg_echo('thewire:reply'); ?></a>
- <?php
+ <?php
}//close reply if statement
// if the user looking at thewire post can edit, show the delete link
if ($vars['entity']->canEdit()) {
- echo "<span class='delete_button'>" . elgg_view("output/confirmlink",array(
+ echo "<span class='delete_button'>" . elgg_view("output/confirmlink",array(
'href' => "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(),
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
)) . "</span>";
}
?>
- </div>
-
+ </div>
+
<div class="wire_post_info">
<a href="<?php echo elgg_get_site_url(); ?>pg/thewire/<?php echo $vars['entity']->getOwnerEntity()->username; ?>"><?php echo $user_name; ?></a>
<?php
- $desc = $vars['entity']->description;
- //$desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . elgg_get_site_url() . 'pg/thewire/$1">$1</a>',$desc);
+ $desc = $vars['entity']->description;
+ //$desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . elgg_get_site_url() . 'pg/thewire/$1">$1</a>',$desc);
echo parse_urls($desc);
?>
- <p class="entity_subtext">
+ <p class="entity_subtext">
<?php
- echo elgg_echo("thewire:wired") . " " . sprintf(elgg_echo("thewire:strapline"),
- elgg_view_friendly_time($vars['entity']->time_created)
+ echo elgg_echo("thewire:wired") . " " . elgg_echo("thewire:strapline",
+ array(elgg_view_friendly_time($vars['entity']->time_created))
);
echo ' ';
- echo sprintf(elgg_echo('thewire:via_method'), elgg_echo($vars['entity']->method));
+ echo elgg_echo('thewire:via_method', array(elgg_echo($vars['entity']->method)));
echo '.';
?>
- </p>
+ </p>
</div>
</div>
</div>
$owner = $vars['entity']->getOwnerEntity();
if ($owner) {
- $title = sprintf(elgg_echo('thewire:by'), $owner->name);
+ $title = elgg_echo('thewire:by', array($owner->name));
} else {
$subtitle = strip_tags($vars['entity']->description);
$title = substr($subtitle,0,32);
$owner = $vars['entity']->getOwnerEntity();
if ($owner) {
- $title = sprintf(elgg_echo('thewire:by'), $owner->name);
+ $title = elgg_echo('thewire:by', array($owner->name));
}
$description = $vars['entity']->getVolatileData('search_matched_description');
$site = $CONFIG->site;
// Send validation email
- $subject = sprintf(elgg_echo('email:validate:subject'), $user->name, $site->name);
- $body = sprintf(elgg_echo('email:validate:body'), $user->name, $site->name, $link, $site->name, $site->url);
+ $subject = elgg_echo('email:validate:subject', array($user->name, $site->name));
+ $body = elgg_echo('email:validate:body', array($user->name, $site->name, $link, $site->name, $site->url));
$result = notify_user($user->guid, $CONFIG->site->guid, $subject, $body, NULL, 'email');
if ($result) {
$checkbox = "<label><input type=\"checkbox\" value=\"$user->guid\" class=\"input_checkboxes\" name=\"user_guids[]\">"
. "$user->username - \"$user->name\" <$user->email></label>";
-$created = sprintf(elgg_echo('uservalidationbyemail:admin:user_created'), elgg_view_friendly_time($user->time_created));
+$created = elgg_echo('uservalidationbyemail:admin:user_created', array(elgg_view_friendly_time($user->time_created)));
$validate = elgg_view('output/confirmlink', array(
- 'confirm' => sprintf(elgg_echo('uservalidationbyemail:confirm_validate_user'), $user->username),
+ 'confirm' => elgg_echo('uservalidationbyemail:confirm_validate_user', array($user->username)),
'href' => "action/uservalidationbyemail/validate/?user_guids[]=$user->guid",
'text' => elgg_echo('uservalidationbyemail:admin:validate')
));
$resend_email = elgg_view('output/confirmlink', array(
- 'confirm' => sprintf(elgg_echo('uservalidationbyemail:confirm_resend_validation'), $user->username),
+ 'confirm' => elgg_echo('uservalidationbyemail:confirm_resend_validation', array($user->username)),
'href' => "action/uservalidationbyemail/resend_validation/?user_guids[]=$user->guid",
'text' => elgg_echo('uservalidationbyemail:admin:resend_validation')
));
$delete = elgg_view('output/confirmlink', array(
- 'confirm' => sprintf(elgg_echo('uservalidationbyemail:confirm_delete'), $user->username),
+ 'confirm' => elgg_echo('uservalidationbyemail:confirm_delete', array($user->username)),
'href' => "action/uservalidationbyemail/delete/?user_guids[]=$user->guid",
'text' => elgg_echo('uservalidationbyemail:admin:delete')
));