]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1320: Bundled mods use elgg_echo()'s internal string substitution.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 3 Nov 2010 22:13:10 +0000 (22:13 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 3 Nov 2010 22:13:10 +0000 (22:13 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7229 36083f99-b078-4883-b0ff-0f9b5a30f544

79 files changed:
mod/blog/start.php
mod/blog/views/default/blog/sidebar_menu.php
mod/blog/views/default/object/blog.php
mod/blog/views/default/river/object/blog/create.php
mod/bookmarks/start.php
mod/bookmarks/views/default/bookmarks/bookmarklet.php
mod/bookmarks/views/default/river/object/bookmarks/create.php
mod/categories/listing.php
mod/categories/start.php
mod/diagnostics/actions/download.php
mod/diagnostics/start.php
mod/file/friends.php
mod/file/index.php
mod/file/search.php
mod/file/start.php
mod/file/views/default/object/file.php
mod/file/views/default/river/object/file/create.php
mod/garbagecollector/start.php
mod/groups/actions/addtogroup.php
mod/groups/actions/invite.php
mod/groups/actions/joinrequest.php
mod/groups/activity.php
mod/groups/all.php
mod/groups/views/default/object/groupforumtopic.php
mod/groups/views/default/river/forum/create.php
mod/groups/views/default/river/forum/topic/create.php
mod/groups/views/default/river/group/create.php
mod/groups/views/default/river/object/groupforumtopic/annotate.php
mod/groups/views/default/river/object/groupforumtopic/create.php
mod/groups/views/default/river/object/groupforumtopic/update.php
mod/groups/views/default/river/relationship/member/create.php
mod/invitefriends/actions/invite.php
mod/invitefriends/views/default/invitefriends/formitems.php
mod/members/index.php
mod/messageboard/index.php
mod/messageboard/start.php
mod/messageboard/views/default/river/object/messageboard/create.php
mod/messages/index.php
mod/messages/read.php
mod/messages/send.php
mod/messages/sent.php
mod/messages/start.php
mod/pages/history.php
mod/pages/index.php
mod/pages/new.php
mod/pages/start.php
mod/pages/view.php
mod/pages/views/default/annotation/page.php
mod/pages/views/default/pages/pagelisting.php
mod/pages/views/default/pages/pageprofile.php
mod/pages/views/default/pages/welcome.php
mod/pages/views/default/river/object/page/annotate.php
mod/pages/views/default/river/object/page/create.php
mod/pages/views/default/river/object/page/update.php
mod/pages/views/default/river/object/page_top/annotate.php
mod/pages/views/default/river/object/page_top/create.php
mod/pages/views/default/river/object/page_top/update.php
mod/pages/welcome.php
mod/pages/world.php
mod/profile/actions/addcomment.php
mod/profile/actions/edit.php
mod/profile/views/default/profile/profile_navigation.php
mod/profile/views/default/profile/profile_ownerblock.php
mod/profile/views/default/river/user/default/profileiconupdate.php
mod/profile/views/default/river/user/default/profileupdate.php
mod/riverdashboard/views/default/river/item/wrapper.php
mod/riverdashboard/views/default/riverdashboard/welcome.php
mod/search/index.php
mod/search/views/default/search/comments/entity.php
mod/search/views/default/search/listing.php
mod/search/views/default/search/startblurb.php
mod/search/views/rss/search/comments/entity.php
mod/tagcloud/tagcloud.php
mod/thewire/index.php
mod/thewire/views/default/object/thewire.php
mod/thewire/views/rss/object/thewire.php
mod/thewire/views/rss/search/object/thewire/entity.php
mod/uservalidationbyemail/lib/functions.php
mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php

index 1b2e31d03c1db8270dd69a544c7945ed82c6487d..386870fd420810ac2e039dd02258bbf5d43775a8 100644 (file)
@@ -106,7 +106,7 @@ function blog_page_handler($page) {
                }
 
                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);
 
@@ -117,7 +117,7 @@ function blog_page_handler($page) {
 
                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;
 
index f69e23e298a8c4d4a1c336ea2304581ce4d32a2f..120237ac5e3ebdf567894d83800571fbd1cc1ca5 100644 (file)
@@ -50,13 +50,13 @@ if ($page_owner) {
                        }
 
                        $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);
index eaf25d726b93774a1f9b17a35e99786baf2626bb..7f91ae6085424405344e368161e8753e5e34a6f1 100644 (file)
@@ -21,7 +21,7 @@ $excerpt = $blog->excerpt;
 $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{
index 3a521894f26cd780975ca92f974c908b66ade1f0..d311c588387d10ef4224db51fe0b2491b49831b4 100644 (file)
@@ -9,7 +9,7 @@ $url = $object->getURL();
 $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()) {
index ca367deb2058cc306d270afd63a5a9cedfa3c9d3..808f88ede64e78e7378ef8958ce4117076839d71 100644 (file)
@@ -59,7 +59,7 @@ function bookmarks_pagesetup() {
        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'));
                        }
                }
        }
@@ -96,7 +96,7 @@ function bookmarks_page_handler($page) {
                $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;
        }
@@ -112,7 +112,7 @@ function bookmarks_page_handler($page) {
        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' : '';
@@ -120,7 +120,7 @@ function bookmarks_page_handler($page) {
 
                        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(
@@ -240,7 +240,7 @@ function bookmarks_page_handler($page) {
 
        $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;
 }
index 5cb8ca6d80bf7ed8aca2c811cff31dc3a45a2652..17a304d78e1e8d184c16f5266103b4b6786aa269 100644 (file)
@@ -9,7 +9,7 @@ $page_owner = elgg_get_page_owner();
 $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;
index faffdec5d3a12fa0de842d6d85b5f6dddee9cd6f..32434471bf4773c597f96e9dc41d9232fbf28017 100644 (file)
@@ -8,7 +8,7 @@ $object = get_entity($vars['item']->object_guid);
 $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>";
index efbac855122d7468ca13e1d77780840be10ca6bc..19fb65069a31835deff165035f320f3a016c8fd8 100644 (file)
@@ -28,7 +28,7 @@ elgg_push_context('search');
 $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;
index 2dedb3dc3eb6c1208ec119a7b8a42e3cdf095a9b..35406459a3e3c53926e8256262edd93a37980424 100644 (file)
@@ -60,7 +60,7 @@ function categories_save($event, $object_type, $object) {
 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;
index 32ef5cbed70094172edcbcacd690785638d96c06..d429f2592c0a683c9cf3469893352a7dbc132f0f 100644 (file)
@@ -1,15 +1,15 @@
 <?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');
index 52bd8a1d88d012793afcdc79c619da40bdf72ee2..46a5e9e1037277cb94078417d339a8810cc46fdf 100644 (file)
@@ -61,7 +61,7 @@ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
        $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;
 }
@@ -76,7 +76,7 @@ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
  */
 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;
 }
@@ -122,7 +122,7 @@ function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params)
 {
        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;
 }
@@ -156,7 +156,7 @@ function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params)
        }
 
 
-       $returnvalue .= sprintf(elgg_echo('diagnostics:report:php'), print_r($phpinfo, true));
+       $returnvalue .= elgg_echo('diagnostics:report:php', array(print_r($phpinfo, true)));
 
        return $returnvalue;
 }
@@ -175,7 +175,7 @@ function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params)
        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;
 }
index f76c4e6928e53fcbf83b30102cee31f9655e7293..8951054806d76b168b9f85f924a48c0aed9180d8 100644 (file)
@@ -1,40 +1,40 @@
 <?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
index 2a82ee1e44b699ab7c16a8811a1765044b692e3e..21d573b2b588812354609adf5d1807a23a76fd51 100644 (file)
@@ -1,10 +1,10 @@
 <?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
index e92cf0362a528e9d5f5d9397f76a05f20269b8dd..b0120d932b529abe4c3a4a198d2691df905d67bc 100644 (file)
@@ -2,7 +2,7 @@
 
        /**
         * Elgg file search
-        * 
+        *
         * @package ElggFile
 
         */
@@ -10,7 +10,7 @@
        // 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));
@@ -68,7 +68,7 @@
                } 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
index 3d66dcc21aed854b8a14c5f5a143587ae3d310db..64e89062643a0e8fc711d8ac0cbbc20cfae7fede 100644 (file)
@@ -1,50 +1,50 @@
 <?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'));
@@ -52,8 +52,8 @@
 
                // 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");
-       
+
 ?>
index 5858a1f1e87621de518c3601d707e7f4d2bbfc1c..3da9567a54c11009f8f29209796c547af45b90d0 100644 (file)
@@ -2,14 +2,14 @@
        /**
         * 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>&nbsp;";
                                        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>&nbsp; 
-                                       <?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>&nbsp;
+                                       <?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);
-               
+
        }
 
 ?>
index b0e2ca07b2453d128658c288fdbda8f08f6ba9a4..b9b5c42996985e0c8efe35f551ad63659a72d93c 100644 (file)
@@ -4,14 +4,14 @@
        $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
index 63d8e7f2aa495d6c44e901e933f1d2655adf9ef3..e3f8c030fecaa1ebb4b339445db4174045827c43 100644 (file)
@@ -1,7 +1,7 @@
 <?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
index dab44666dccd34244a1122629b72f0cf08bc3ffd..346b6065eb7e5404aea112145ae2289b547ac11f 100644 (file)
@@ -51,8 +51,8 @@
 
                                                        // 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'));
@@ -71,8 +71,8 @@
                                                        // 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
index 9ab4f244035bf95f1212445a92a9216bd99b5b4e..6fe379fe100c04795a94d517aaf810f727466aee 100644 (file)
@@ -40,8 +40,8 @@ if (sizeof($user_guid))
                                                // 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
index a3b372e65fed821a85e2d1fd26ddef9fbe83761d..f9bdf2f21557e12e074eabd325fd631e73cba63f 100644 (file)
@@ -67,8 +67,8 @@ if (($group) && ($user) && (!$group->isMember($user)))
                        // 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
index 4f436cca741798ea19f14497327ba42043faf5e4..487af7e8d0269c98ce00d16dbee80455c9ab2d94 100644 (file)
@@ -50,7 +50,7 @@ if (count($entity_guids) > 0) {
 $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
index da884bac7d6fedbb053240a61455c85099085c23..1e7b93b657d70675cd22dafbef64e67b7b363c3c 100644 (file)
@@ -54,7 +54,7 @@
 
        $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"));
        }
index fb67797d31d2bfb15e42471603232526547d3ee5..4250e9affa7120261bb418222540ab572ecacf91 100644 (file)
@@ -27,53 +27,53 @@ $u = get_user($last_user);
 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'));
 }
 
index ce3638f15e4ea3982d0d4be562aeffe029eab3ca..69481e97e26bbd175d4b5fa9164af1f49da986b1 100644 (file)
        $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>";
index bb38e1cf32c16e66a076230347e0f0dcefe80839..e595b1fdc09b61b85ae28f4d5eee3a552f54cd04 100644 (file)
@@ -7,13 +7,13 @@
        $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);
@@ -25,5 +25,5 @@
        $string .= "<div class=\"river_content_display\">";
        $string .= elgg_get_excerpt($contents, 200);
        $string .= "</div>";
-       
+
        echo $string;
\ No newline at end of file
index aa9fef47a7e036a0642724932a0f310939ed400e..ef0aaab1b4e7d98df1d8a0850442e4e7ad0cda79 100644 (file)
@@ -3,9 +3,9 @@
        $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()) {
index c6aa1e5abb29aa728267b2b5105ebf875c14b214..5456b83020c9a1c6d9d204c89a76c56c086d33ae 100644 (file)
@@ -3,9 +3,9 @@
        $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>";
 
index 7c7d89bad4b8cf591073b5a21f7cb2c4f729b1b2..d9bebc00309acbf5b8d4bb7ef3e48784f5b416e9 100644 (file)
@@ -3,9 +3,9 @@
        $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>";
 
index d13c2b61f496e931042f6eb78fdd24e891543bf3..ba9b91d2cf2bce3c99834cc8103b6c72ad9cea38 100644 (file)
@@ -3,11 +3,11 @@
        $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
index a568920cca02311cf1bc771de74c5a7ad6c1a0d3..3ba191676f261534b7272b3d6283c4dd328e52a0 100644 (file)
@@ -5,7 +5,7 @@
        $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>";
index bb6b71385799f2e6fe46f4f43d2dca31e3c2aadf..a1a6241f0545b30e0da3fba9f804655202e009b3 100644 (file)
@@ -46,14 +46,15 @@ foreach ($emails as $email) {
        }
 
        $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);
@@ -68,16 +69,16 @@ foreach ($emails as $email) {
 }
 
 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'));
 }
index 68296460a523d908ba00f513cbdc1750bb20a1e8..8bf397d547a9e571993db2a05f0e78964e58ab1b 100644 (file)
@@ -10,7 +10,7 @@ if ($CONFIG->allow_registration) {
        $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>
index 8e6c3ddf9183f239da9a1472fabca0620cb6bd80..4df2c10fefe347173ad04c04bb46884df1af4272 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Elgg members index page
- * 
+ *
  * @package ElggMembers
  */
 
@@ -77,4 +77,4 @@ $area2 .= elgg_view('page_elements/elgg_content', array('body' => elgg_view("mem
 $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
index 816f9480f07c95509ed24156921a966b84da7fb5..e0ab13f0e67bb9365e6f92e6d314f41d5bbc13d6 100644 (file)
@@ -30,5 +30,5 @@ if (isloggedin()) {
 $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);
 
index 88d7c72f3b4403aec37d4162494d151f6d745387..f97e77999bdb6ff86aa986a734d8754ac305490e 100644 (file)
@@ -4,7 +4,7 @@
  * 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
  */
 
@@ -36,7 +36,7 @@ function messageboard_page_handler($page) {
        if (isset($page[0])) {
                set_input('username', $page[0]);
        }
-       
+
        // Include the standard messageboard index
        include($CONFIG->pluginspath . "messageboard/index.php");
 }
@@ -52,7 +52,7 @@ function messageboard_page_handler($page) {
  */
 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;
@@ -69,14 +69,13 @@ function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
        // 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);
        }
index 88bbd56aa7558e13d2d22fbb0c3b71543fc5406f..3bdf595d11a8a96f4cf10477ac7bd5d11a4a9134 100644 (file)
@@ -4,7 +4,7 @@ $performed_by = get_entity($vars['item']->subject_guid);
 $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;
index 5f4a483be864d9f29e15c026e443eabd443fbb2c..16049f918b256c81459e91c438a36ba4a1508928 100644 (file)
@@ -18,7 +18,7 @@ $page_owner = get_loggedin_user();
 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',
@@ -46,4 +46,4 @@ $body = elgg_view_layout("one_column_with_sidebar", $area2);
 
 
 // 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);
index 2bbae1c7114d0bf2074b8e5ccd03eb9c22ce2142..740011c3edb3e124a1b1879354c3a298194406c4 100644 (file)
@@ -51,4 +51,4 @@ $sidebar = elgg_view("messages/menu_options");
 $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
index 92563c91d02043562ee0bdd398b0eeb0f5e930e5..359c38ae1b6b51d3349e2b0bb083219b00be0b5f 100644 (file)
@@ -35,4 +35,4 @@ $area3 = elgg_view("messages/menu_options");
 $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
index e2b22502dac5decd470625604b0b15105ec42eb0..bb0746c807347204d83a963e1f01628cf3eb86d9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
 * Elgg sent messages page
-* 
+*
 * @package ElggMessages
 */
 
@@ -22,7 +22,7 @@ $limit = 10;
 
 // 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
@@ -37,4 +37,4 @@ $area2 .= elgg_view("messages/forms/view",array('entity' => $messages, 'page_vie
 $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);
index 07698d8930f1286becd4622dd1790c76311847ab..7f5f2c647ec42b5cb863cb713e06f587b45e63c3 100644 (file)
@@ -3,7 +3,7 @@
 /**
 * 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');
 
@@ -62,16 +62,16 @@ function messages_init() {
 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;
-       
+
 }
 
 /**
@@ -79,18 +79,18 @@ function messages_can_edit_metadata($hook_name, $entity_type, $return_value, $pa
  *
  */
 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;
-       
+
 }
 
 /**
@@ -100,27 +100,16 @@ function messages_can_edit($hook_name, $entity_type, $return_value, $parameters)
 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;
-       
+
 }
 
 /**
@@ -128,15 +117,15 @@ function messages_notification_msg($hook_name, $entity_type, $return_value, $par
  *
  */
 function messages_can_edit_container($hook_name, $entity_type, $return_value, $parameters) {
-       
+
        global $messagesendflag;
-       
+
        if ($messagesendflag == 1) {
                return true;
        }
-       
+
        return $return_value;
-       
+
 }
 
 /**
@@ -152,22 +141,22 @@ function messages_can_edit_container($hook_name, $entity_type, $return_value, $p
  * @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
@@ -187,59 +176,58 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify
                        $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;
+
 }
 
 /**
@@ -249,12 +237,12 @@ function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify
  * @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]) {
@@ -268,9 +256,9 @@ function messages_page_handler($page) {
                include(dirname(__FILE__) . "/index.php");
                return true;
        }
-       
+
        return false;
-       
+
 }
 
 function messages_url($message) {
@@ -279,39 +267,39 @@ 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.
index 6070a3fd0e25adac71396c35961fc61c3a53817d..d39bf7ae090c2e386430e389c779bafe5e5445b7 100644 (file)
@@ -25,7 +25,8 @@ $offset = (int)get_input('offset');
 $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);
@@ -36,4 +37,4 @@ $sidebar = elgg_view('pages/sidebar/tree');
 
 $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);
index e3d4406922060c6d2b13e58dff2bb9d85dec4ad0..31f76f6257a228cef1ac8f504ddc111bd7d640da 100644 (file)
@@ -12,7 +12,7 @@ global $CONFIG;
 // 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))){
@@ -27,9 +27,9 @@ $limit = get_input("limit", 10);
 $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));
 }
 
 
index 0d467d4497a3c0f127144b4a6bbe8770d56f6855..af1443d0a105b336c8e171223731fbb95197a0e8 100644 (file)
@@ -28,7 +28,7 @@ if(get_input('parent_guid')){
        }
 
        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);
index 0f0af0a80699b893371b07c040c66693a52e35aa..074e2a7717d68c76ecab9dcd228604170637dcfb 100644 (file)
@@ -86,7 +86,7 @@ function pages_submenus() {
        // 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);
                        }
                }
 }
index 2600de5c8dcd74b7eb30ead3564cee30eb1685d6..83b8d69c14911efad4a12cf60223aced01301d47 100644 (file)
@@ -28,7 +28,6 @@ if ($container) {
 }
 
 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');
index cc0f677469a1b4c368b34027a13f5facaa37cb33..53f38831f0edda61a33a48096f7c6d394117ee23 100644 (file)
@@ -18,8 +18,8 @@ $icon = elgg_view(
 $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>"
 );
 
index 419fc8d231c1805541048017e893224a3b92ba75..0c4a411fbf2e4f1d6e9ca67499f4e1e27d1c265a 100644 (file)
@@ -23,8 +23,8 @@ if ($latest) {
        $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>";
 }
index 5702ec415164a14d7fc671e6eada12fda2c9caf3..7008e668c05e6b381f201e8cc845052cc6c274e5 100644 (file)
@@ -62,8 +62,8 @@ if ($rev) {
                        $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>"
                        );
 
index 7802fa5af15f9ad4360082028a03f1f3a254cc2a..7dbc6109a6b0ccea50d965f467ea0ee9d6049bd7 100644 (file)
@@ -11,6 +11,6 @@ if($vars['entity']) {
        }
 } 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
 }
index 4f913dbaa0d39b01afbc9b868d81351c06f9347c..811fc7dea33ea8321e6ab89225de3ad26afc68a5 100644 (file)
@@ -10,7 +10,7 @@ $performed_by = $statement->getSubject();
 $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>";
 
index d182a1ebe32369ebc0c330a5e934b8a48e674587..f85e4d42e219fa4009991e29468b0509ccd9eae9 100644 (file)
@@ -12,7 +12,7 @@ $url = $object->getURL();
 
 $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\">";
index 82b38f315b3f3fa5c9352a70ad4b9bf9ec3c1a0f..8ae506a515d7baaf8a62cab6df1a0c1fa64b4943 100644 (file)
@@ -10,7 +10,7 @@ $object = get_entity($vars['item']->object_guid);
 $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;
index 43270f73684354cea171302f9dee676f57a8e4ad..e12eb55f9f84b61952b36a4e6fa8793cfc2a5f64 100644 (file)
@@ -10,7 +10,7 @@ $performed_by = $statement->getSubject();
 $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;
index d49f3d5c4a310b9709eb6aad15a0841615f6acf3..d951a2f6a31f9f960c2d8bb0fbb8b9d29ec95468 100644 (file)
@@ -10,6 +10,6 @@ $performed_by = $statement->getSubject();
 $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
index 6187f54bc4f43870b3be6ffcd826efe66946c003..611cd21e92e26af6d3461131ee1241431210c1f8 100644 (file)
@@ -10,7 +10,7 @@ $performed_by = $statement->getSubject();
 $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
index 4386c5228dc86020948a70a99306362f484b9fda..7a2a43abddc6ccff872cd2f55869407c36678f8c 100644 (file)
@@ -24,7 +24,7 @@ if ($page_owner === false || is_null($page_owner)) {
 //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);
index 25081e00dc60e0a76391fd03aea80b42386f502d..35a17b1e62ca2db1c3391e150d35fced1058a580 100644 (file)
@@ -21,7 +21,7 @@ if (($page_owner instanceof ElggEntity) && ($page_owner->canWriteToContainer()))
 }
 
 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');
@@ -29,7 +29,7 @@ add_submenu_item(elgg_echo('pages:all'), "mod/pages/world.php", 'pageslinksgener
 $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');
index 5817b8e83676403f382e356b601d9bf8a57e376b..07f72ef8e0d4e3c901d115edeb16dbbda12528f6 100644 (file)
@@ -5,44 +5,43 @@
 
 // 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
index c91e5e5a7d69ccdb2c0e028d358efa60675c3251..f3c928cefc78a33fc39eb30e5a1f85321add593a 100644 (file)
@@ -46,7 +46,7 @@ foreach($CONFIG->profile as $shortname => $valuetype) {
 
        // 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);
        }
@@ -103,7 +103,7 @@ if (sizeof($input) > 0) {
        //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"));
 }
index b441b949ff2c463a39b295be71d0c761d4e4384c..a27cf789d6036146070838a33eb79225ada1191c 100755 (executable)
@@ -8,7 +8,7 @@ if (isset($vars['section'])) {
 $user = $vars['entity'];
 if (!$user) {
        // no user so no profile
-       echo sprintf(elgg_echo('viewfailure'), __FILE__);
+       echo elgg_echo('viewfailure', array(__FILE__));
        return TRUE;
 }
 
@@ -20,7 +20,7 @@ $twitter = '';
 
 $url = "{$user->getURL()}/";
 
-//select section 
+//select section
 switch($section){
        case 'friends':
                $friends = 'class="selected"';
@@ -35,7 +35,7 @@ switch($section){
        case 'twitter':
                $twitter = 'class="selected"';
                break;
-               
+
        case 'commentwall':
                $commentwall = 'class="selected"';
                break;
@@ -60,7 +60,7 @@ switch($section){
                        <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));
        ?>
index fd3ff6b114442d4d9fdd160d34a32f101b181bb4..bfed3aec19466d70eacb265385e17ae958afaad9 100755 (executable)
@@ -16,7 +16,7 @@ if ($vars['entity']) {
 }
 if (!$user) {
        // no user so we quit view
-       echo sprintf(elgg_echo('viewfailure'), __FILE__);
+       echo elgg_echo('viewfailure', array(__FILE__));
        return TRUE;
 }
 
index b1e5baf888cb6b9e453d4faf42ffbc4813b829f2..9e617573b8701e138f748f8fd18f6737c6414f1d 100644 (file)
@@ -1,8 +1,8 @@
 <?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
index 5da11c4b3f4ac957569c673f0ec219d839ca6842..156aa8b1b2fc24b3ddb88da672048f4a19857ebe 100644 (file)
@@ -1,10 +1,10 @@
 <?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
index 98c240de5922b30ab89a40dbc66f6d38f6cea115..0413775d616c5e95f72923c8f1817b319d9bc2f2 100644 (file)
@@ -77,7 +77,7 @@ if ($comments){
        // 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>';
        }
index 3c9778eda321d4587d46113b1b35cfcedcd4e2de..f5152135e5d233a9d30108b510706303811f6e0d 100644 (file)
@@ -5,4 +5,4 @@
  */
 
 ?>
-<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
index c68fb4a0fc46778a2e3914bacc702a4b4b24260f..b042d596fdd5e3c108b6ea9208063d190676f5ed 100644 (file)
@@ -244,7 +244,7 @@ if ($search_type != 'entities' || $search_type == 'all') {
 $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')));
@@ -258,6 +258,6 @@ if (!$results_html) {
 $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);
index 0084552423af89e85e4eda8d5a4d302b1b212a77..0cd760664778a97afb752e6117c8d6a6736012a8 100644 (file)
@@ -17,7 +17,7 @@ if ($owner instanceof ElggUser) {
 
 // @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 {
@@ -35,7 +35,7 @@ if ($entity->getVolatileData('search_unavailable_entity')) {
                $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>";
 }
index c9dda25f0babe75e7cb2ee9717245399c346e4b0..d84d567d42f90b169821586549617a7a2b592f6c 100644 (file)
@@ -84,7 +84,7 @@ $more = ($more_check > 0) ? $more_check : 0;
 
 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 = '';
index 2b723070970bd41413741b191c6a2af2e7cea557..3ffa39e683942a70faaf8f172bbf5e8c5072e0b9 100644 (file)
@@ -4,4 +4,4 @@
  * @subpackage Core
  */
 
-echo sprintf(elgg_echo("tag:search:startblurb"), $vars['query']);
+echo elgg_echo("tag:search:startblurb", array($vars['query']));
index 9bdc062c78b958e8d4e56667f7cfe484d5cbee73..46ef87a14fa469bc1550b2cfdbc92b08d538a3c0 100644 (file)
@@ -16,7 +16,7 @@ if ($author) {
 
 // @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;
@@ -32,7 +32,7 @@ if ($entity->getVolatileData('search_unavailable_entity')) {
                $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');
 }
index a0bc1502f7ff8ce65a784580cbef242af3d8e267..de384b25bcccc20847f808e841c9a79a24e5426a 100644 (file)
@@ -2,15 +2,15 @@
 /**
  * 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
index 41b8969aa6762dafad0e7bedc83a2d99c09e111a..a1de242c58db43d393be7c6f93b909b13fe48cdc 100644 (file)
@@ -2,37 +2,37 @@
 
        /**
         * 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
index 4ef51cae61c1f98e693243c32e88b85c7078b9ab..a94d3a4aa64883ae5e41806d4224b4cb51ec27dc 100644 (file)
@@ -2,65 +2,65 @@
 
        /**
         * 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>
index 23a11a9d398cd0c3949f5d6abb52b2f36119e702..fbbb670b7bf19dbc9ee3d1466ffab509ad4b4931 100644 (file)
@@ -8,7 +8,7 @@
 
 $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);
index 3d4a17b78383cada6ed987aad7b7e20c48a88e80..d9ea81ad133b2299edb65654e3180935270b2fd7 100644 (file)
@@ -12,7 +12,7 @@ if (!array_key_exists('entity', $vars)) {
 
 $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');
 
index 92b37c843a49692002a412fb896b0b12b3409370..b7ca30bcce27434cd8cde34843d1b55c63c128fa 100644 (file)
@@ -40,8 +40,8 @@ function uservalidationbyemail_request_validation($user_guid) {
                $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) {
index 9e9efa29a219b9b0a5bd0d535a10885ba2e11f85..5844fb5f4155a2ea1774ec21955edc06bd65d10d 100644 (file)
@@ -16,22 +16,22 @@ $user = elgg_get_array_value('user', $vars);
 $checkbox = "<label><input type=\"checkbox\" value=\"$user->guid\" class=\"input_checkboxes\" name=\"user_guids[]\">"
        . "$user->username - \"$user->name\" &lt;$user->email&gt;</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')
 ));