]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #1320. Updated core to use elgg_echo()'s native string replacement.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 3 Nov 2010 19:46:47 +0000 (19:46 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 3 Nov 2010 19:46:47 +0000 (19:46 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7227 36083f99-b078-4883-b0ff-0f9b5a30f544

59 files changed:
actions/admin/plugins/disable.php
actions/admin/plugins/disableall.php
actions/admin/plugins/enable.php
actions/admin/plugins/enableall.php
actions/admin/plugins/reorder.php
actions/admin/user/delete.php
actions/admin/user/resetpassword.php
actions/comments/add.php
actions/entities/delete.php
actions/friends/add.php
actions/friends/remove.php
actions/likes/add.php
actions/plugins/settings/save.php
actions/plugins/usersettings/save.php
actions/register.php
actions/user/requestnewpassword.php
actions/useradd.php
engine/classes/ElggAnnotation.php
engine/classes/ElggDiskFilestore.php
engine/classes/ElggExtender.php
engine/classes/ElggFile.php
engine/classes/ElggFileCache.php
engine/classes/ElggGroup.php
engine/classes/ElggMemcache.php
engine/classes/ElggMetadata.php
engine/classes/ElggObject.php
engine/classes/ElggRelationship.php
engine/classes/ElggSite.php
engine/classes/ElggUser.php
engine/handlers/cron_handler.php
engine/lib/actions.php
engine/lib/api.php
engine/lib/cron.php
engine/lib/database.php
engine/lib/entities.php
engine/lib/export.php
engine/lib/extender.php
engine/lib/group.php
engine/lib/notification.php
engine/lib/objects.php
engine/lib/output.php
engine/lib/plugins.php
engine/lib/relationships.php
engine/lib/sites.php
engine/lib/users.php
engine/lib/xml-rpc.php
index.php
install/ElggInstaller.php
install/ElggRewriteTester.php
languages/en.php
pages/friends/index.php
pages/friends/of.php
services/export/handler.php
views/default/admin/plugins/simple.php
views/default/annotation/annotate.php
views/default/friends/river/create.php
views/default/group/search/startblurb.php
views/default/object/default.php
views/default/user/search/startblurb.php

index 48116e43a07737e1e226fc0daee3b13f8ab3e55d..9db5aec11a49c56707116957313af6c61cc9e109 100644 (file)
@@ -20,10 +20,11 @@ if (!is_array($plugin)) {
 
 foreach ($plugin as $p) {
        if (disable_plugin($p)) {
-               system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p));
+               system_message(elgg_echo('admin:plugins:disable:yes', array($p)));
+
                elgg_delete_admin_notice('first_installation_plugin_reminder');
        } else {
-               register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p));
+               register_error(elgg_echo('admin:plugins:disable:no', array($p)));
        }
 }
 
index bd68c17b13e4a3d6a834462331c96a4a2a2899e2..21938727e0738a183c17013fa3acc9d70479d44e 100644 (file)
@@ -16,9 +16,9 @@ $plugins = get_installed_plugins();
 foreach ($plugins as $p => $data) {
        if (disable_plugin($p)) {
                elgg_delete_admin_notice('first_installation_plugin_reminder');
-               system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p));
+               system_message(elgg_echo('admin:plugins:disable:yes', array($p)));
        } else {
-               register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p));
+               register_error(elgg_echo('admin:plugins:disable:no', array($p)));
        }
 }
 
index b1566609359321e6bdf1d5e190540e73636f8b21..d3ad5606deadbbd9424c06af15ac9c6f2f26cea7 100644 (file)
@@ -22,9 +22,9 @@ if (!is_array($plugin)) {
 foreach ($plugin as $p) {
        if (enable_plugin($p)) {
                elgg_delete_admin_notice('first_installation_plugin_reminder');
-               system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p));
+               system_message(elgg_echo('admin:plugins:enable:yes', array($p)));
        } else {
-               register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p));
+               register_error(elgg_echo('admin:plugins:enable:no', array($p)));
        }
 }
 
index b959c235fa620e44416db069b38b08469477a6c6..9a2df00dcc5e497d3102fed3a5d981844ab227a1 100644 (file)
@@ -16,9 +16,9 @@ $plugins = get_installed_plugins();
 foreach ($plugins as $p => $data) {
        if (enable_plugin($p)) {
                elgg_delete_admin_notice('first_installation_plugin_reminder');
-               system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p));
+               system_message(elgg_echo('admin:plugins:enable:yes', array($p)));
        } else {
-               register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p));
+               register_error(elgg_echo('admin:plugins:enable:no', array($p)));
        }
 }
 
index e3c65f6e5838c6a3bf3580d3c8246703c4ea4d52..2158653e12ff339aad090436b34eef2e2bf78ead 100644 (file)
@@ -40,9 +40,9 @@ if ($key = array_search($mod, $plugins)) {
 // Disable
 if (regenerate_plugin_list($plugins)) {
        elgg_delete_admin_notice('first_installation_plugin_reminder');
-       system_message(sprintf(elgg_echo('admin:plugins:reorder:yes'), $plugin));
+       system_message(elgg_echo('admin:plugins:reorder:yes', array($plugin)));
 } else {
-       register_error(sprintf(elgg_echo('admin:plugins:reorder:no'), $plugin));
+       register_error(elgg_echo('admin:plugins:reorder:no', array($plugin)));
 }
 
 // don't regenerate the simplecache because the plugin won't be
index 375f8b80995a853992416e2c3218040d142bca32..e8d83572255f4d6ddb2a8e72158b777516f95bb3 100644 (file)
@@ -22,7 +22,7 @@ $username = $obj->username;
 
 if (($obj instanceof ElggUser) && ($obj->canEdit())) {
        if ($obj->delete()) {
-               system_message(sprintf(elgg_echo('admin:user:delete:yes'), $name));
+               system_message(elgg_echo('admin:user:delete:yes', array($name)));
        } else {
                register_error(elgg_echo('admin:user:delete:no'));
        }
index 46a983c86461a723e88c90b8fbf94126bf3f1839..24127eb8b9145ae11718c7abd9d4271b39b1f204 100644 (file)
@@ -32,7 +32,7 @@ if (($obj instanceof ElggUser) && ($obj->canEdit())) {
                notify_user($obj->guid,
                        $CONFIG->site->guid,
                        elgg_echo('email:resetpassword:subject'),
-                       sprintf(elgg_echo('email:resetpassword:body'), $obj->username, $password),
+                       elgg_echo('email:resetpassword:body', array($obj->username, $password)),
                        NULL,
                        'email');
        } else {
index b7feb4b6670ecebf6814955deb5ae951a179b97f..11418a2e2714571088924150b8f1cd3738e522c6 100644 (file)
@@ -47,15 +47,14 @@ if ($entity->owner_guid != $user->guid) {
        notify_user($entity->owner_guid,
                                $user->guid,
                                elgg_echo('generic_comment:email:subject'),
-                               sprintf(
-                                       elgg_echo('generic_comment:email:body'),
+                               elgg_echo('generic_comment:email:body', array(
                                        $entity->title,
                                        $user->name,
                                        $comment_text,
                                        $entity->getURL(),
                                        $user->name,
                                        $user->getURL()
-                               )
+                               ))
                        );
 }
 
index 3ec88bd04e816630bfc7a7e7eb4a6ce55c14c336..823e85c59da613396bf9cd38b4d0c3ae9ec90fbf 100644 (file)
@@ -13,12 +13,12 @@ $entity = get_entity($guid);
 
 if (($entity) && ($entity->canEdit())) {
        if ($entity->delete()) {
-               system_message(sprintf(elgg_echo('entity:delete:success'), $guid));
+               system_message(elgg_echo('entity:delete:success', array($guid)));
        } else {
-               register_error(sprintf(elgg_echo('entity:delete:fail'), $guid));
+               register_error(elgg_echo('entity:delete:fail', array($guid)));
        }
 } else {
-       register_error(sprintf(elgg_echo('entity:delete:fail'), $guid));
+       register_error(elgg_echo('entity:delete:fail', array($guid)));
 }
 
 forward(REFERER);
index 60431a27dff491c47670859778d1c8122fc36081..d0a0d3d7cbd0673c513764dcf6cbb95076e35e3f 100644 (file)
@@ -21,13 +21,13 @@ try {
                $errors = true;
        }
 } catch (Exception $e) {
-       register_error(sprintf(elgg_echo("friends:add:failure"), $friend->name));
+       register_error(elgg_echo("friends:add:failure", array($friend->name)));
        $errors = true;
 }
 if (!$errors) {
        // add to river
        add_to_river('friends/river/create', 'friend', get_loggedin_userid(), $friend_guid);
-       system_message(sprintf(elgg_echo("friends:add:successful"), $friend->name));
+       system_message(elgg_echo("friends:add:successful", array($friend->name)));
 }
 
 // Forward back to the page you friended the user on
index 786b5975b0394e078cfb0a97eb45d60afa965dd4..1230b12af08b6646528cd8ea0ceb5a58834c794d 100644 (file)
@@ -19,16 +19,16 @@ try{
        if ($friend instanceof ElggUser) {
                get_loggedin_user()->removeFriend($friend_guid);
        } else {
-               register_error(sprintf(elgg_echo("friends:remove:failure"), $friend->name));
+               register_error(elgg_echo("friends:remove:failure", array($friend->name)));
                $errors = true;
        }
 } catch (Exception $e) {
-       register_error(sprintf(elgg_echo("friends:remove:failure"), $friend->name));
+       register_error(elgg_echo("friends:remove:failure", array($friend->name)));
        $errors = true;
 }
 
 if (!$errors) {
-       system_message(sprintf(elgg_echo("friends:remove:successful"), $friend->name));
+       system_message(elgg_echo("friends:remove:successful", array($friend->name)));
 }
 
 // Forward back to the page you made the friend on
index 211cb340bbcd97df9b099e74ecb0f6a735020516..b8c2f18b89f178d1142bac5c461eb0f25847e6e8 100644 (file)
@@ -41,15 +41,14 @@ if ($entity->owner_guid != $user->guid) {
        notify_user($entity->owner_guid,
                                $user->guid,
                                elgg_echo('likes:email:subject'),
-                               sprintf(
-                                       elgg_echo('likes:email:body'),
+                               elgg_echo('likes:email:body', array(
                                        $user->name,
                                        $entity->title,
                                        //$comment_text,
                                        $entity->getURL(),
                                        $user->name,
                                        $user->getURL()
-                               )
+                               ))
                        );
 }
 
index 1a8b2db3d5c7964303e24b359c0554df2ccd58e7..b67fa401fee5486db2180fb0b0d9ed9b70b37d88 100644 (file)
@@ -9,7 +9,7 @@
 $params = get_input('params');
 $plugin = get_input('plugin');
 if (!$plugin_info = load_plugin_manifest($plugin)) {
-       register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin));
+       register_error(elgg_echo('plugins:settings:save:fail', array($plugin)));
        forward(REFERER);
 }
 
@@ -31,29 +31,29 @@ if (elgg_action_exist("settings/$plugin/save")) {
 } else {
        foreach ($params as $k => $v) {
                if (!$result = set_plugin_setting($k, $v, $plugin)) {
-                       register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin_name));
+                       register_error(elgg_echo('plugins:settings:save:fail', array($plugin_name)));
                        forward(REFERER);
                        exit;
                }
        }
 }
 
-system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin_name));
+system_message(elgg_echo('plugins:settings:save:ok', array($plugin_name)));
 forward(REFERER);
 //
 //$trigger = trigger_plugin_hook('plugin:save_settings', $plugin, $options, NULL);
 //if ($trigger === NULL) {
 //     foreach ($params as $k => $v) {
 //             if (!$result = set_plugin_setting($k, $v, $plugin)) {
-//                     register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin_name));
+//                     register_error(elgg_echo('plugins:settings:save:fail', array($plugin_name)));
 //                     forward(REFERER);
 //                     exit;
 //             }
 //     }
 //} elseif ($trigger === FALSE) {
-//     register_error(sprintf(elgg_echo('plugins:settings:save:fail'), $plugin_name));
+//     register_error(elgg_echo('plugins:settings:save:fail', array($plugin_name)));
 //     forward(REFERER);
 //}
 //
-//system_message(sprintf(elgg_echo('plugins:settings:save:ok'), $plugin_name));
+//system_message(elgg_echo('plugins:settings:save:ok', array($plugin_name)));
 //forward(REFERER);
\ No newline at end of file
index 27f54918408c5b79e97ff8eb8f17910c7ca166e8..705871facf2db4e21342ee6806d40245bc9a4626 100644 (file)
@@ -19,11 +19,11 @@ foreach ($params as $k => $v) {
 
        // Error?
        if (!$result) {
-               register_error(sprintf(elgg_echo('plugins:usersettings:save:fail'), $plugin));
+               register_error(elgg_echo('plugins:usersettings:save:fail', array($plugin)));
                forward(REFERER);
                exit;
        }
 }
 
-system_message(sprintf(elgg_echo('plugins:usersettings:save:ok'), $plugin));
+system_message(elgg_echo('plugins:usersettings:save:ok', array($plugin)));
 forward(REFERER);
index fcb25de35d2246df0fe57b9f547c4a3e64ed769d..3a45cb69b96c561614a62669914e552e0b64bf01 100644 (file)
@@ -52,7 +52,7 @@ if ($CONFIG->allow_registration) {
                                throw new RegistrationException(elgg_echo('registerbad'));
                        }
 
-                       system_message(sprintf(elgg_echo("registerok"), $CONFIG->sitename));
+                       system_message(elgg_echo("registerok", array($CONFIG->sitename)));
 
                        // Forward on success, assume everything else is an error...
                        login($new_user);
index 22b4008e8a60887316ad2c1e361d0f56bff27e2c..5dfa24952640098afcbc5ac439da3fcddef53383 100644 (file)
@@ -16,7 +16,7 @@ if ($user) {
                register_error(elgg_echo('user:password:resetreq:fail'));
        }
 } else {
-       register_error(sprintf(elgg_echo('user:username:notfound'), $username));
+       register_error(elgg_echo('user:username:notfound', array($username)));
 }
 
 forward();
index 54def11b349c4e6be57a79fd344985987a620239..82625ad1b37f0fc11cbd4ad23f21948b4649deb0 100644 (file)
@@ -35,12 +35,12 @@ try {
                $new_user->created_by_guid = get_loggedin_userid();
 
                $subject = elgg_echo('useradd:subject');
-               $body = sprintf(elgg_echo('useradd:body'), $name,
-                       $CONFIG->site->name, $CONFIG->site->url, $username, $password);
+               $body = elgg_echo('useradd:body', array($name,
+                       $CONFIG->site->name, $CONFIG->site->url, $username, $password));
 
                notify_user($new_user->guid, $CONFIG->site->guid, $subject, $body);
 
-               system_message(sprintf(elgg_echo("adduser:ok"), $CONFIG->sitename));
+               system_message(elgg_echo("adduser:ok", array($CONFIG->sitename)));
        } else {
                register_error(elgg_echo("adduser:bad"));
        }
index da43aea23c8525bd10ed1d59d7ccdb8262591b28..60a79bac9f6610a5e2f296742c7d39dd539923e4 100644 (file)
@@ -16,10 +16,10 @@ class ElggAnnotation extends ElggExtender {
 
        protected function initializeAttributes() {
                parent::initializeAttributes();
-               
+
                $this->attributes['type'] = 'annotation';
        }
-       
+
        /**
         * Construct a new annotation, optionally from a given id value or db object.
         *
@@ -59,7 +59,7 @@ class ElggAnnotation extends ElggExtender {
                                $this->value_type, $this->owner_guid, $this->access_id);
 
                        if (!$this->id) {
-                               throw new IOException(sprintf(elgg_echo('IOException:UnableToSaveNew'), get_class()));
+                               throw new IOException(elgg_echo('IOException:UnableToSaveNew', array(get_class())));
                        }
                        return $this->id;
                }
index 4f9aae1aff0682e4735eaab6402400f419a5ac94..780598a87ea5de424321851e76ef68a8ba7e1853 100644 (file)
@@ -83,7 +83,7 @@ class ElggDiskFilestore extends ElggFilestore {
                                $mode = "a+b";
                                break;
                        default:
-                               $msg = sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode);
+                               $msg = elgg_echo('InvalidParameterException:UnrecognisedFileMode', array($mode));
                                throw new InvalidParameterException($msg);
                }
 
@@ -206,8 +206,8 @@ class ElggDiskFilestore extends ElggFilestore {
                }
 
                if ((!$owner) || (!$owner->username)) {
-                       $msg = sprintf(elgg_echo('InvalidParameterException:MissingOwner'),
-                               $file->getFilename(), $file->guid);
+                       $msg = elgg_echo('InvalidParameterException:MissingOwner',
+                               array($file->getFilename(), $file->guid));
                        throw new InvalidParameterException($msg);
                }
 
@@ -278,7 +278,7 @@ class ElggDiskFilestore extends ElggFilestore {
        protected function makeDirectoryRoot($dirroot) {
                if (!file_exists($dirroot)) {
                        if (!@mkdir($dirroot, 0700, true)) {
-                               throw new IOException(sprintf(elgg_echo('IOException:CouldNotMake'), $dirroot));
+                               throw new IOException(elgg_echo('IOException:CouldNotMake', array($dirroot)));
                        }
                }
 
index 8d0f4bd66db476292de3952e583aef38018a3293..78ccea3950bb9b6342b68b3031f02190b5151872 100644 (file)
@@ -21,10 +21,10 @@ abstract class ElggExtender extends ElggData
 {
        protected function initializeAttributes() {
                parent::initializeAttributes();
-               
+
                $this->attributes['type'] = '';
        }
-       
+
        /**
         * Returns an attribute
         *
@@ -48,8 +48,8 @@ abstract class ElggExtender extends ElggData
                                                break;
 
                                        default :
-                                               $msg = sprintf(elgg_echo('InstallationException:TypeNotSupported'),
-                                                       $this->attributes['value_type']);
+                                               $msg = elgg_echo('InstallationException:TypeNotSupported', array(
+                                                       $this->attributes['value_type']));
 
                                                throw new InstallationException($msg);
                                                break;
@@ -96,7 +96,7 @@ abstract class ElggExtender extends ElggData
        public function getOwnerEntity() {
                return get_entity($this->owner_guid);
        }
-       
+
        /**
         * Return the entity this describes.
         *
index 46cd0b6a0ddffca7fa4911678443fa5e6e0dbca7..a55bbc443d867a9da4b7a0304a85999e8d28fdaf 100644 (file)
@@ -164,7 +164,7 @@ class ElggFile extends ElggObject {
                        ($mode != "write") &&
                        ($mode != "append")
                ) {
-                       $msg = sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode);
+                       $msg = elgg_echo('InvalidParameterException:UnrecognisedFileMode', array($mode));
                        throw new InvalidParameterException($msg);
                }
 
@@ -343,9 +343,9 @@ class ElggFile extends ElggObject {
 
                if (isset($parameters['filestore'])) {
                        if (!class_exists($parameters['filestore'])) {
-                               $msg = sprintf(elgg_echo('ClassNotFoundException:NotFoundNotSavedWithFile'),
-                                                               $parameters['filestore'],
-                                                               $this->guid);
+                               $msg = elgg_echo('ClassNotFoundException:NotFoundNotSavedWithFile',
+                                                               array($parameters['filestore'],
+                                                               $this->guid));
                                throw new ClassNotFoundException($msg);
                        }
 
index 2072af620c911df4dd7d5fafe350188ab8905780..c27e9aa32bd50bd1d3fc567412600ff5abfcfc72 100644 (file)
@@ -188,7 +188,7 @@ class ElggFileCache extends ElggCache {
 
                $files = scandir($dir);
                if (!$files) {
-                       throw new IOException(sprintf(elgg_echo('IOException:NotDirectory'), $dir));
+                       throw new IOException(elgg_echo('IOException:NotDirectory', array($dir)));
                }
 
                // Perform cleanup
index 00502dd399abe8650f8c8590012e72665824080f..963d808219e880f017968fa7eb16922a8ae7a560 100644 (file)
@@ -54,7 +54,7 @@ class ElggGroup extends ElggEntity
                        if ($guid instanceof stdClass) {
                                // Load the rest
                                if (!$this->load($guid->guid)) {
-                                       $msg = sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid->guid);
+                                       $msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
                                        throw new IOException($msg);
                                }
 
@@ -73,7 +73,7 @@ class ElggGroup extends ElggEntity
                                // We assume if we have got this far, $guid is an int
                        } else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
                                }
                        } else {
                                throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
@@ -342,7 +342,7 @@ class ElggGroup extends ElggEntity
 
                // Check the type
                if ($this->attributes['type'] != 'group') {
-                       $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class());
+                       $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($guid, get_class()));
                        throw new InvalidClassException($msg);
                }
 
index e0d8e7beecf2bdf225342a21e4df2ba271e6f658..7d19fb2c7a20563cd419a3b370f83c92ef5ab3a9 100644 (file)
@@ -85,10 +85,10 @@ class ElggMemcache extends ElggSharedMemoryCache {
                // Get version
                $this->version = $this->memcache->getVersion();
                if (version_compare($this->version, ElggMemcache::$MINSERVERVERSION, '<')) {
-                       $msg = sprintf(elgg_echo('memcache:versiontoolow'),
-                               ElggMemcache::$MINSERVERVERSION,
+                       $msg = elgg_echo('memcache:versiontoolow',
+                               array(ElggMemcache::$MINSERVERVERSION,
                                $this->version
-                       );
+                       ));
 
                        throw new ConfigurationException($msg);
                }
index 90cbba5bd11818a82b44bb7ff0ac559697030301..12e458629c6d7efb7001477c37d6e12ceaaef85f 100644 (file)
@@ -8,13 +8,13 @@
  * @subpackage Metadata
  */
 class ElggMetadata extends ElggExtender {
-       
+
        protected function initializeAttributes() {
                parent::initializeAttributes();
-               
+
                $this->attributes['type'] = "metadata";
        }
-       
+
        /**
         * Construct a new site object, optionally from a given id value or row.
         *
@@ -68,7 +68,7 @@ class ElggMetadata extends ElggExtender {
                                $this->value_type, $this->owner_guid, $this->access_id);
 
                        if (!$this->id) {
-                               throw new IOException(sprintf(elgg_echo('IOException:UnableToSaveNew'), get_class()));
+                               throw new IOException(elgg_echo('IOException:UnableToSaveNew', array(get_class())));
                        }
                        return $this->id;
                }
index b721c479c5f85f842fd560c09cd9c2e141374516..a808f4b9fbf1fa34851f85fbb42a9770f2525572 100644 (file)
@@ -69,7 +69,7 @@ class ElggObject extends ElggEntity {
                        if ($guid instanceof stdClass) {
                                // Load the rest
                                if (!$this->load($guid->guid)) {
-                                       $msg = sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid->guid);
+                                       $msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
                                        throw new IOException($msg);
                                }
 
@@ -88,7 +88,7 @@ class ElggObject extends ElggEntity {
                                // We assume if we have got this far, $guid is an int
                        } else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
                                }
                        } else {
                                throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
@@ -112,7 +112,7 @@ class ElggObject extends ElggEntity {
 
                // Check the type
                if ($this->attributes['type'] != 'object') {
-                       $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class());
+                       $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($guid, get_class()));
                        throw new InvalidClassException($msg);
                }
 
index 413527df34862bbaefd140fafc78f1664ddb16f0..50a86fff1ab8d23a1df4499c9310a355a48aec57 100644 (file)
@@ -73,7 +73,7 @@ class ElggRelationship extends ElggData implements
 
                $this->id = add_entity_relationship($this->guid_one, $this->relationship, $this->guid_two);
                if (!$this->id) {
-                       throw new IOException(sprintf(elgg_echo('IOException:UnableToSaveNew'), get_class()));
+                       throw new IOException(elgg_echo('IOException:UnableToSaveNew', array(get_class())));
                }
 
                return $this->id;
@@ -168,7 +168,7 @@ class ElggRelationship extends ElggData implements
                                // save
                                $result = $this->save();
                                if (!$result) {
-                                       throw new ImportException(sprintf(elgg_echo('ImportException:ProblemSaving'), get_class()));
+                                       throw new ImportException(elgg_echo('ImportException:ProblemSaving', array(get_class())));
                                }
 
                                return $this;
index febd70be683fb6f3e828761c9f315159852027e9..0a4c48d8e3b3d56ff54b240ec9ca810bea015475 100644 (file)
@@ -82,7 +82,7 @@ class ElggSite extends ElggEntity {
                        if ($guid instanceof stdClass) {
                                // Load the rest
                                if (!$this->load($guid->guid)) {
-                                       $msg = sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid->guid);
+                                       $msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
                                        throw new IOException($msg);
                                }
 
@@ -108,7 +108,7 @@ class ElggSite extends ElggEntity {
                                // We assume if we have got this far, $guid is an int
                        } else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
                                }
                        } else {
                                throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
@@ -132,7 +132,7 @@ class ElggSite extends ElggEntity {
 
                // Check the type
                if ($this->attributes['type'] != 'site') {
-                       $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class());
+                       $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($guid, get_class()));
                        throw new InvalidClassException($msg);
                }
 
index ec951b3599b2050376c4a7e081fe6c9219f694de..cb2d565fcb4ea4ad3e2089fa6ed7f61b4d2b5bd1 100644 (file)
@@ -65,7 +65,7 @@ class ElggUser extends ElggEntity
                        if ($guid instanceof stdClass) {
                                // Load the rest
                                if (!$this->load($guid->guid)) {
-                                       $msg = sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid->guid);
+                                       $msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
                                        throw new IOException($msg);
                                }
 
@@ -91,7 +91,7 @@ class ElggUser extends ElggEntity
                                // We assume if we have got this far, $guid is an int
                        } else if (is_numeric($guid)) {
                                if (!$this->load($guid)) {
-                                       throw new IOException(sprintf(elgg_echo('IOException:FailedToLoadGUID'), get_class(), $guid));
+                                       throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
                                }
                        } else {
                                throw new InvalidParameterException(elgg_echo('InvalidParameterException:UnrecognisedValue'));
@@ -116,7 +116,7 @@ class ElggUser extends ElggEntity
 
                // Check the type
                if ($this->attributes['type'] != 'user') {
-                       $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class());
+                       $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($guid, get_class()));
                        throw new InvalidClassException($msg);
                }
 
index 537b34f39513c0754b0db4b97ed9cc203b96964f..939beeaf4817131dba7c4df8e991c458b9300788 100644 (file)
@@ -18,7 +18,7 @@ global $CONFIG;
 
 $period = get_input('period');
 if (!$period) {
-       throw new CronException(sprintf(elgg_echo('CronException:unknownperiod'), $period));
+       throw new CronException(elgg_echo('CronException:unknownperiod', array($period)));
 }
 
 // Get a list of parameters
index bcd7e759ec874ee331a355d166f7b104f64a6be5..35f9dc4b358141d84cf5a473afee0d67943fae94 100644 (file)
@@ -100,7 +100,7 @@ function action($action, $forwarder = "") {
                                // @todo make this better!
                                if ($event_result) {
                                        if (!include($CONFIG->actions[$action]['file'])) {
-                                               register_error(sprintf(elgg_echo('actionnotfound'), $action));
+                                               register_error(elgg_echo('actionnotfound', array($action)));
                                        }
                                }
                        } else {
@@ -110,7 +110,7 @@ function action($action, $forwarder = "") {
                        register_error(elgg_echo('actionunauthorized'));
                }
        } else {
-               register_error(sprintf(elgg_echo('actionundefined'), $action));
+               register_error(elgg_echo('actionundefined', array($action)));
        }
 
        forward($forwarder);
@@ -359,26 +359,26 @@ function elgg_action_exist($action) {
 function actions_init()
 {
        register_action('security/refreshtoken', TRUE);
-       
+
        elgg_view_register_simplecache('js/languages/en');
-               
+
        register_plugin_hook('action', 'all', 'ajax_action_hook');
        register_plugin_hook('forward', 'all', 'ajax_forward_hook');
 }
 
 /**
  * Checks whether the request was requested via ajax
- * 
+ *
  * @return bool whether page was requested via ajax
  */
 function elgg_is_xhr() {
-       return isset($_SERVER['HTTP_X_REQUESTED_WITH']) 
-               && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; 
+       return isset($_SERVER['HTTP_X_REQUESTED_WITH'])
+               && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
 }
 
 /**
  * Catch calls to forward() in ajax request and force an exit.
- * 
+ *
  * Forces response is json of the following form:
  * <pre>
  * {
@@ -392,18 +392,18 @@ function elgg_is_xhr() {
  * }
  * </pre>
  * where "system_messages" is all message registers at the point of forwarding
- * 
+ *
  * @param string $hook
- * @param string $type 
+ * @param string $type
  * @param string $reason
  * @param array $params
- * 
+ *
  */
 function ajax_forward_hook($hook, $type, $reason, $params) {
        if (elgg_is_xhr()) {
                //grab any data echo'd in the action
                $output = ob_get_clean();
-               
+
                //Avoid double-encoding in case data is json
                $json = json_decode($output);
                if (isset($json)) {
@@ -411,16 +411,16 @@ function ajax_forward_hook($hook, $type, $reason, $params) {
                } else {
                        $params['output'] = $output;
                }
-               
+
                //Grab any system messages so we can inject them via ajax too
                $params['system_messages'] = system_messages(NULL, "");
-               
+
                if (isset($params['system_messages']['errors'])) {
                        $params['status'] = -1;
                } else {
                        $params['status'] = 0;
                }
-               
+
                header("Content-type: application/json");
                echo json_encode($params);
                exit;
index 93de88d5bb14d1af78fd40f3b75d8b1a3e0cf13f..642449fffd304ed343745e714cd44b88ecf8cd03 100644 (file)
@@ -82,14 +82,14 @@ $call_method = "GET", $require_api_auth = false, $require_user_auth = false) {
 
        if ($parameters != NULL) {
                if (!is_array($parameters)) {
-                       $msg = sprintf(elgg_echo('InvalidParameterException:APIParametersArrayStructure'), $method);
+                       $msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', array($method));
                        throw new InvalidParameterException($msg);
                }
 
                // catch common mistake of not setting up param array correctly
                $first = current($parameters);
                if (!is_array($first)) {
-                       $msg = sprintf(elgg_echo('InvalidParameterException:APIParametersArrayStructure'), $method);
+                       $msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', array($method));
                        throw new InvalidParameterException($msg);
                }
        }
@@ -115,8 +115,8 @@ $call_method = "GET", $require_api_auth = false, $require_user_auth = false) {
                        $API_METHODS[$method]["call_method"] = 'GET';
                        break;
                default :
-                       $msg = sprintf(elgg_echo('InvalidParameterException:UnrecognisedHttpMethod'),
-                       $call_method, $method);
+                       $msg = elgg_echo('InvalidParameterException:UnrecognisedHttpMethod',
+                       array($call_method, $method));
 
                        throw new InvalidParameterException($msg);
        }
@@ -159,7 +159,7 @@ function authenticate_method($method) {
 
        // method must be exposed
        if (!isset($API_METHODS[$method])) {
-               throw new APIException(sprintf(elgg_echo('APIException:MethodCallNotImplemented'), $method));
+               throw new APIException(elgg_echo('APIException:MethodCallNotImplemented', array($method)));
        }
 
        // make sure that POST variables are available if needed
@@ -201,7 +201,7 @@ function execute_method($method) {
 
        // method must be exposed
        if (!isset($API_METHODS[$method])) {
-               $msg = sprintf(elgg_echo('APIException:MethodCallNotImplemented'), $method);
+               $msg = elgg_echo('APIException:MethodCallNotImplemented', array($method));
                throw new APIException($msg);
        }
 
@@ -209,14 +209,14 @@ function execute_method($method) {
        if (!(isset($API_METHODS[$method]["function"]))
        || !(is_callable($API_METHODS[$method]["function"]))) {
 
-               $msg = sprintf(elgg_echo('APIException:FunctionDoesNotExist'), $method);
+               $msg = elgg_echo('APIException:FunctionDoesNotExist', array($method));
                throw new APIException($msg);
        }
 
        // check http call method
        if (strcmp(get_call_method(), $API_METHODS[$method]["call_method"]) != 0) {
-               $msg = sprintf(elgg_echo('CallException:InvalidCallMethod'), $method,
-               $API_METHODS[$method]["call_method"]);
+               $msg = elgg_echo('CallException:InvalidCallMethod', array($method,
+               $API_METHODS[$method]["call_method"]));
 
                throw new CallException($msg);
        }
@@ -242,13 +242,13 @@ function execute_method($method) {
        }
 
        if ($result === false) {
-               $msg = sprintf(elgg_echo('APIException:FunctionParseError'), $function, $serialised_parameters);
+               $msg = elgg_echo('APIException:FunctionParseError', array($function, $serialised_parameters));
                throw new APIException($msg);
        }
 
        if ($result === NULL) {
                // If no value
-               $msg = sprintf(elgg_echo('APIException:FunctionNoReturn'), $function, $serialised_parameters);
+               $msg = elgg_echo('APIException:FunctionNoReturn', array($function, $serialised_parameters));
                throw new APIException($msg);
        }
 
@@ -365,13 +365,13 @@ function verify_parameters($method, $parameters) {
                // this tests the expose structure: must be array to describe parameter and type must be defined
                if (!is_array($value) || !isset($value['type'])) {
 
-                       $msg = sprintf(elgg_echo('APIException:InvalidParameter'), $key, $method);
+                       $msg = elgg_echo('APIException:InvalidParameter', array($key, $method));
                        throw new APIException($msg);
                }
 
                // Check that the variable is present in the request if required
                if ($value['required'] && !array_key_exists($key, $parameters)) {
-                       $msg = sprintf(elgg_echo('APIException:MissingParameterInMethod'), $key, $method);
+                       $msg = elgg_echo('APIException:MissingParameterInMethod', array($key, $method));
                        throw new APIException($msg);
                }
        }
@@ -433,7 +433,7 @@ function serialise_parameters($method, $parameters) {
                        case 'array':
                                // we can handle an array of strings, maybe ints, definitely not booleans or other arrays
                                if (!is_array($parameters[$key])) {
-                                       $msg = sprintf(elgg_echo('APIException:ParameterNotArray'), $key);
+                                       $msg = elgg_echo('APIException:ParameterNotArray', array($key));
                                        throw new APIException($msg);
                                }
 
@@ -454,7 +454,7 @@ function serialise_parameters($method, $parameters) {
                                $serialised_parameters .= $array;
                                break;
                        default:
-                               $msg = sprintf(elgg_echo('APIException:UnrecognisedTypeCast'), $value['type'], $key, $method);
+                               $msg = elgg_echo('APIException:UnrecognisedTypeCast', array($value['type'], $key, $method));
                                throw new APIException($msg);
                }
        }
@@ -548,8 +548,8 @@ function api_auth_hmac() {
                $calculated_posthash = calculate_posthash($postdata, $api_header->posthash_algo);
 
                if (strcmp($api_header->posthash, $calculated_posthash) != 0) {
-                       $msg = sprintf(elgg_echo('SecurityException:InvalidPostHash'),
-                       $calculated_posthash, $api_header->posthash);
+                       $msg = elgg_echo('SecurityException:InvalidPostHash',
+                       array($calculated_posthash, $api_header->posthash));
 
                        throw new SecurityException($msg);
                }
@@ -652,7 +652,7 @@ function map_api_hash($algo) {
                return $supported_algos[$algo];
        }
 
-       throw new APIException(sprintf(elgg_echo('APIException:AlgorithmNotSupported'), $algo));
+       throw new APIException(elgg_echo('APIException:AlgorithmNotSupported', array($algo)));
 }
 
 /**
@@ -1039,7 +1039,7 @@ $content_type = 'application/octet-stream') {
                case 'POST' :
                        break;
                default:
-                       $msg = sprintf(elgg_echo('NotImplementedException:CallMethodNotImplemented'), $method);
+                       $msg = elgg_echo('NotImplementedException:CallMethodNotImplemented', array($method));
                        throw new NotImplementedException($msg);
        }
 
index 811a4cdda75b544061fa0f74926667b60d529d99..d51a34bf737c755280d0c630af17552ac5b5198d 100644 (file)
@@ -44,7 +44,7 @@ function cron_page_handler($page) {
                                set_input('period', $page[0]);
                                break;
                        default :
-                               throw new CronException(sprintf(elgg_echo('CronException:unknownperiod'), $page[0]));
+                               throw new CronException(elgg_echo('CronException:unknownperiod', array($page[0])));
                }
 
                // Include cron handler
index 16efb5874dac005387440a973f37539e48693527..4a99afea176c7acf837b0cc2d36ff144a17c98da 100644 (file)
@@ -95,13 +95,13 @@ function establish_db_link($dblinkname = "readwrite") {
 
        // Connect to database
        if (!$dblink[$dblinkname] = mysql_connect($dbhost, $dbuser, $dbpass, true)) {
-               $msg = sprintf(elgg_echo('DatabaseException:WrongCredentials'),
-                               $dbuser, $dbhost, "****");
+               $msg = elgg_echo('DatabaseException:WrongCredentials',
+                               array($dbuser, $dbhost, "****"));
                throw new DatabaseException($msg);
        }
 
        if (!mysql_select_db($dbname, $dblink[$dblinkname])) {
-               $msg = sprintf(elgg_echo('DatabaseException:NoConnect'), $dbname);
+               $msg = elgg_echo('DatabaseException:NoConnect', array($dbname));
                throw new DatabaseException($msg);
        }
 
@@ -640,7 +640,7 @@ function run_sql_script($scriptlocation) {
                        throw new DatabaseException($msg);
                }
        } else {
-               $msg = sprintf(elgg_echo('DatabaseException:ScriptNotFound'), $scriptlocation);
+               $msg = elgg_echo('DatabaseException:ScriptNotFound', array($scriptlocation));
                throw new DatabaseException($msg);
        }
 }
index 376133fec3ade9d520b57fbd5478d8e4eb451584..36e9eb115dfd6cd1122e3856a7e49d94a3ba4fba 100644 (file)
@@ -439,7 +439,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null) {
  *
  * @param int    $user_guid      The user guid, or 0 for get_loggedin_userid()
  * @param int    $container_guid The container, or 0 for the current page owner.
- * @param string $type           The type of entity we're looking to write 
+ * @param string $type           The type of entity we're looking to write
  * @param string $subtype        The subtype of the entity we're looking to write
  *
  * @return bool
@@ -619,11 +619,11 @@ function entity_row_to_elggstar($row) {
                        $new_entity = new $classname($row);
 
                        if (!($new_entity instanceof ElggEntity)) {
-                               $msg = sprintf(elgg_echo('ClassException:ClassnameNotClass'), $classname, 'ElggEntity');
+                               $msg = elgg_echo('ClassException:ClassnameNotClass', array($classname, 'ElggEntity'));
                                throw new ClassException($msg);
                        }
                } else {
-                       error_log(sprintf(elgg_echo('ClassNotFoundException:MissingClass'), $classname));
+                       error_log(elgg_echo('ClassNotFoundException:MissingClass', array($classname)));
                }
        }
 
@@ -643,7 +643,7 @@ function entity_row_to_elggstar($row) {
                                $new_entity = new ElggSite($row);
                                break;
                        default:
-                               $msg = sprintf(elgg_echo('InstallationException:TypeNotSupported'), $row->type);
+                               $msg = elgg_echo('InstallationException:TypeNotSupported', array($row->type));
                                throw new InstallationException($msg);
                }
        }
@@ -1317,7 +1317,7 @@ function elgg_get_entity_site_where_sql($table, $site_guids) {
  *      full_view => BOOL Display full view entities
  *      view_type_toggle => BOOL Display gallery / list switch
  *      pagination => BOOL Display pagination links
- * 
+ *
  * @param mixed $getter  The entity getter function to use to fetch the entities
  *
  * @return string
@@ -1334,12 +1334,12 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
                'view_type_toggle' => FALSE,
                'pagination' => TRUE,
        );
-       
+
        $options = array_merge($defaults, $options);
 
        $options['count'] = TRUE;
        $count = $getter($options);
-       
+
        $options['count'] = FALSE;
        $entities = $getter($options);
 
@@ -1817,7 +1817,7 @@ function export_entity_plugin_hook($hook, $entity_type, $returnvalue, $params) {
        // Get the entity
        $entity = get_entity($guid);
        if (!($entity instanceof ElggEntity)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class());
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($guid, get_class()));
                throw new InvalidClassException($msg);
        }
 
@@ -1858,11 +1858,11 @@ function oddentity_to_elggentity(ODDEntity $element) {
                                $tmp = new $classname();
 
                                if (!($tmp instanceof ElggEntity)) {
-                                       $msg = sprintf(elgg_echo('ClassException:ClassnameNotClass', $classname, get_class()));
+                                       $msg = elgg_echo('ClassException:ClassnameNotClass', array($classname, get_class()));
                                        throw new ClassException($msg);
                                }
                        } else {
-                               error_log(sprintf(elgg_echo('ClassNotFoundException:MissingClass'), $classname));
+                               error_log(elgg_echo('ClassNotFoundException:MissingClass', array($classname)));
                        }
                } else {
                        switch ($class) {
@@ -1879,7 +1879,7 @@ function oddentity_to_elggentity(ODDEntity $element) {
                                        $tmp = new ElggSite($row);
                                        break;
                                default:
-                                       $msg = sprintf(elgg_echo('InstallationException:TypeNotSupported'), $class);
+                                       $msg = elgg_echo('InstallationException:TypeNotSupported', array($class));
                                        throw new InstallationException($msg);
                        }
                }
@@ -1887,7 +1887,7 @@ function oddentity_to_elggentity(ODDEntity $element) {
 
        if ($tmp) {
                if (!$tmp->import($element)) {
-                       $msg = sprintf(elgg_echo('ImportException:ImportFailed'), $element->getAttribute('uuid'));
+                       $msg = elgg_echo('ImportException:ImportFailed', array($element->getAttribute('uuid')));
                        throw new ImportException($msg);
                }
 
@@ -1925,7 +1925,7 @@ function import_entity_plugin_hook($hook, $entity_type, $returnvalue, $params) {
                if ($tmp) {
                        // Make sure its saved
                        if (!$tmp->save()) {
-                               sprintf(elgg_echo('ImportException:ProblemSaving'), $element->getAttribute('uuid'));
+                               elgg_echo('ImportException:ProblemSaving', array($element->getAttribute('uuid')));
                                throw new ImportException($msg);
                        }
 
@@ -2141,7 +2141,7 @@ function get_entity_url($entity_guid) {
                if ($url == "") {
                        $url = "pg/view/" . $entity_guid;
                }
-               
+
                return elgg_normalize_url($url);
 
        }
index 3a5c74a0f5e92d85b81a249f7453f685d4c07397..1704ef81d53b02d0f4b7ff8f86f96f43132d54f9 100644 (file)
@@ -149,7 +149,7 @@ function exportAsArray($guid) {
 
        // Sanity check
        if ((!is_array($to_be_serialised)) || (count($to_be_serialised) == 0)) {
-               throw new ExportException(sprintf(elgg_echo('ExportException:NoSuchEntity'), $guid));
+               throw new ExportException(elgg_echo('ExportException:NoSuchEntity', array($guid)));
        }
 
        return $to_be_serialised;
index 845cfd85ff4642863792da78cd6fe234a8d2b087..a67f29a68fa15ed862641e8806d6e1c574d67cfe 100644 (file)
@@ -97,14 +97,14 @@ function import_extender_plugin_hook($hook, $entity_type, $returnvalue, $params)
                $entity_uuid = $element->getAttribute('entity_uuid');
                $entity = get_entity_from_uuid($entity_uuid);
                if (!$entity) {
-                       throw new ImportException(sprintf(elgg_echo('ImportException:GUIDNotFound'), $entity_uuid));
+                       throw new ImportException(elgg_echo('ImportException:GUIDNotFound', array($entity_uuid)));
                }
 
                oddmetadata_to_elggextender($entity, $element);
 
                // Save
                if (!$entity->save()) {
-                       $msg = sprintf(elgg_echo('ImportException:ProblemUpdatingMeta'), $attr_name, $entity_uuid);
+                       $msg = elgg_echo('ImportException:ProblemUpdatingMeta', array($attr_name, $entity_uuid));
                        throw new ImportException($msg);
                }
 
@@ -231,7 +231,7 @@ function get_extender_url(ElggExtender $extender) {
                }
                $url = "export/$view/$guid/$type/$nameid/";
        }
-       
+
        return elgg_normalize_url($url);
 }
 
index 31dc434ab632ff58c3bcd8d4c3542e3dd65063bb..53053976aca6d53239d21cd8fcc3e7c3ad480be0 100644 (file)
@@ -116,12 +116,12 @@ function add_object_to_group($group_guid, $object_guid) {
        }
 
        if (!($group instanceof ElggGroup)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $group_guid, 'ElggGroup');
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($group_guid, 'ElggGroup'));
                throw new InvalidClassException($msg);
        }
 
        if (!($object instanceof ElggObject)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $object_guid, 'ElggObject');
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($object_guid, 'ElggObject'));
                throw new InvalidClassException($msg);
        }
 
@@ -150,12 +150,12 @@ function remove_object_from_group($group_guid, $object_guid) {
        }
 
        if (!($group instanceof ElggGroup)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $group_guid, 'ElggGroup');
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($group_guid, 'ElggGroup'));
                throw new InvalidClassException($msg);
        }
 
        if (!($object instanceof ElggObject)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $object_guid, 'ElggObject');
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($object_guid, 'ElggObject'));
                throw new InvalidClassException($msg);
        }
 
@@ -390,7 +390,7 @@ function get_entities_from_metadata_groups_multi($group_guid, $meta_array, $enti
 $entity_subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "",
 $site_guid = 0, $count = false) {
        elgg_deprecated_notice("get_entities_from_metadata_groups_multi was deprecated in 1.8.", 1.8);
-       
+
        global $CONFIG;
 
        if (!is_array($meta_array) || sizeof($meta_array) == 0) {
index cfb79715cd7213362286c09279d5002246364236..5aef42aad9f8a975f1ca2a1cc1935b90d8ede74d 100644 (file)
@@ -132,7 +132,7 @@ function notify_user($to, $from, $subject, $message, array $params = NULL, $meth
                                        $handler = $details->handler;
 
                                        if ((!$NOTIFICATION_HANDLERS[$method]) || (!$handler)) {
-                                               error_log(sprintf(elgg_echo('NotificationException:NoHandlerFound'), $method));
+                                               error_log(elgg_echo('NotificationException:NoHandlerFound', array($method)));
                                        }
 
                                        elgg_log("Sending message to $guid using $method");
@@ -238,17 +238,17 @@ array $params = NULL) {
        global $CONFIG;
 
        if (!$from) {
-               $msg = sprintf(elgg_echo('NotificationException:MissingParameter'), 'from');
+               $msg = elgg_echo('NotificationException:MissingParameter', array('from'));
                throw new NotificationException($msg);
        }
 
        if (!$to) {
-               $msg = sprintf(elgg_echo('NotificationException:MissingParameter'), 'to');
+               $msg = elgg_echo('NotificationException:MissingParameter', array('to'));
                throw new NotificationException($msg);
        }
 
        if ($to->email == "") {
-               $msg = sprintf(elgg_echo('NotificationException:NoEmailAddress'), $to->guid);
+               $msg = elgg_echo('NotificationException:NoEmailAddress', array($to->guid));
                throw new NotificationException($msg);
        }
 
@@ -287,12 +287,12 @@ function elgg_send_email($from, $to, $subject, $body, array $params = NULL) {
        global $CONFIG;
 
        if (!$from) {
-               $msg = sprintf(elgg_echo('NotificationException:NoEmailAddress'), 'from');
+               $msg = elgg_echo('NotificationException:NoEmailAddress', array('from'));
                throw new NotificationException($msg);
        }
 
        if (!$to) {
-               $msg = sprintf(elgg_echo('NotificationException:NoEmailAddress'), 'to');
+               $msg = elgg_echo('NotificationException:NoEmailAddress', array('to'));
                throw new NotificationException($msg);
        }
 
index ae30edb13d881d64a3b3275b035951a3720d7870..5b752192213120e491627339321b22c7a81e249c 100644 (file)
@@ -89,7 +89,7 @@ function create_object_entity($guid, $title, $description) {
  * @return 1
  */
 function delete_object_entity($guid) {
-       system_message(sprintf(elgg_echo('deprecatedfunction'), 'delete_user_entity'));
+       system_message(elgg_echo('deprecatedfunction', array('delete_user_entity')));
 
        return 1; // Always return that we have deleted one row in order to not break existing code.
 }
index 35ace7c09587348c6dd3939846db4cdc1d4bba49..84b012631c1ece05a11f2139b3dd0d821f80b5a9 100644 (file)
@@ -140,31 +140,31 @@ function elgg_format_url($url) {
 }
 
 /**
- * Converts shorthand urls to absolute urls.  
- * 
+ * Converts shorthand urls to absolute urls.
+ *
  * If the url is already absolute or protocol-relative, no change is made.
- * 
- * @example 
+ *
+ * @example
  * elgg_normalize_url('');                   // 'http://my.site.com/'
  * elgg_normalize_url('pg/dashboard');       // 'http://my.site.com/pg/dashboard'
  * elgg_normalize_url('http://google.com/'); // no change
  * elgg_normalize_url('//google.com/');      // no change
- * 
+ *
  * @param  string $url The URL to normalize
- * 
+ *
  * @return string The absolute url
  */
 function elgg_normalize_url($url) {
        // 'http://example.com', 'https://example.com', '//example.com'
        if (preg_match("#^(https?:)?//#i", $url)) {
                return $url;
-       } 
-       
+       }
+
        // 'example.com', 'example.com/subpage'
        elseif (preg_match("#[^/]*\.[^/]*/?#i", $url)) {
                return "http://$url";
-       } 
-       
+       }
+
        // 'pg/page/handler'
        else {
                return elgg_get_site_url().$url;
@@ -257,9 +257,9 @@ function elgg_get_friendly_time($time) {
                }
 
                if ($diff > 1) {
-                       return sprintf(elgg_echo("friendlytime:minutes"), $diff);
+                       return elgg_echo("friendlytime:minutes", array($diff));
                } else {
-                       return sprintf(elgg_echo("friendlytime:minutes:singular"), $diff);
+                       return elgg_echo("friendlytime:minutes:singular", array($diff));
                }
        } else if ($diff < $day) {
                $diff = round($diff / $hour);
@@ -268,9 +268,9 @@ function elgg_get_friendly_time($time) {
                }
 
                if ($diff > 1) {
-                       return sprintf(elgg_echo("friendlytime:hours"), $diff);
+                       return elgg_echo("friendlytime:hours", array($diff));
                } else {
-                       return sprintf(elgg_echo("friendlytime:hours:singular"), $diff);
+                       return elgg_echo("friendlytime:hours:singular", array($diff));
                }
        } else {
                $diff = round($diff / $day);
@@ -279,9 +279,9 @@ function elgg_get_friendly_time($time) {
                }
 
                if ($diff > 1) {
-                       return sprintf(elgg_echo("friendlytime:days"), $diff);
+                       return elgg_echo("friendlytime:days", array($diff));
                } else {
-                       return sprintf(elgg_echo("friendlytime:days:singular"), $diff);
+                       return elgg_echo("friendlytime:days:singular", array($diff));
                }
        }
 }
index d6352cbc69aeb5461601a48365888cba7afe9714..b6aae9d7dd0670ff2a77501d036dee3553c224bb 100644 (file)
@@ -164,7 +164,7 @@ function load_plugins() {
                                                        disable_plugin($mod);
 
                                                        // register error rather than rendering the site unusable with exception
-                                                       register_error(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod));
+                                                       register_error(elgg_echo('PluginException:MisconfiguredPlugin', array($mod)));
 
                                                        // continue loading remaining plugins
                                                        continue;
@@ -657,7 +657,7 @@ function enable_plugin($plugin, $site_guid = 0) {
 
        $site = get_entity($site_guid);
        if (!($site instanceof ElggSite)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $site_guid, "ElggSite");
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($site_guid, "ElggSite"));
                throw new InvalidClassException($msg);
        }
 
@@ -744,7 +744,7 @@ function disable_plugin($plugin, $site_guid = 0) {
 
        $site = get_entity($site_guid);
        if (!($site instanceof ElggSite)) {
-               $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $site_guid, "ElggSite");
+               $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($site_guid, "ElggSite"));
                throw new InvalidClassException();
        }
 
@@ -826,7 +826,7 @@ function is_plugin_enabled($plugin, $site_guid = 0) {
        if (!$ENABLED_PLUGINS_CACHE) {
                $site = get_entity($site_guid);
                if (!($site instanceof ElggSite)) {
-                       $msg = sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $site_guid, "ElggSite");
+                       $msg = elgg_echo('InvalidClassException:NotValidElggStar', array($site_guid, "ElggSite"));
                        throw new InvalidClassException($msg);
                }
 
index 186e5a595e29ec67f583ec4cab76ab3c295c0a62..c9b47df08ed004db0a68df7ee19b730195ce7e1d 100644 (file)
@@ -402,7 +402,7 @@ $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0) {
  * Returns a viewable list of entities by relationship
  *
  * @param array $options
- * 
+ *
  * @see elgg_list_entities()
  * @see elgg_get_entities_from_relationship()
  *
@@ -859,8 +859,8 @@ function relationship_notification_hook($event, $object_type, $object) {
 
                // Notify target user
                return notify_user($object->guid_two, $object->guid_one,
-                       sprintf(elgg_echo('friend:newfriend:subject'), $user_one->name),
-                       sprintf(elgg_echo("friend:newfriend:body"), $user_one->name, $user_one->getURL())
+                       elgg_echo('friend:newfriend:subject', array($user_one->name)),
+                       elgg_echo("friend:newfriend:body", array($user_one->name, $user_one->getURL()))
                );
        }
 }
index 960e54ee3bd35f82c83c7fbd4bdf4d653d481ab9..8044f8fd2d7651f8514fcb0eff77da1ce980ca67 100644 (file)
@@ -94,7 +94,7 @@ function create_site_entity($guid, $name, $description, $url) {
  * @return 1
  */
 function delete_site_entity($guid) {
-       system_message(sprintf(elgg_echo('deprecatedfunction'), 'delete_user_entity'));
+       system_message(elgg_echo('deprecatedfunction', array('delete_user_entity')));
 
        return 1; // Always return that we have deleted one row in order to not break existing code.
 }
index 7533b2af01148b1be0571d24c4b8cb76121740c6..ab7e6734d3bfe62203e52beba633eb5ac8cb8561 100644 (file)
@@ -293,7 +293,7 @@ function remove_user_admin($user_guid) {
  * @return 1
  */
 function delete_user_entity($guid) {
-       system_message(sprintf(elgg_echo('deprecatedfunction'), 'delete_user_entity'));
+       system_message(elgg_echo('deprecatedfunction', array('delete_user_entity')));
 
        return 1; // Always return that we have deleted one row in order to not break existing code.
 }
@@ -861,7 +861,7 @@ function send_new_password_request($user_guid) {
                $link = $CONFIG->site->url . "pg/resetpassword?u=$user_guid&c=$code";
 
                // generate email
-               $email = sprintf(elgg_echo('email:resetreq:body'), $user->name, $_SERVER['REMOTE_ADDR'], $link);
+               $email = elgg_echo('email:resetreq:body', array($user->name, $_SERVER['REMOTE_ADDR'], $link));
 
                return notify_user($user->guid, $CONFIG->site->guid,
                        elgg_echo('email:resetreq:subject'), $email, NULL, 'email');
@@ -923,7 +923,7 @@ function execute_new_password_request($user_guid, $conf_code) {
                if (force_user_password_reset($user_guid, $password)) {
                        remove_private_setting($user_guid, 'passwd_conf_code');
 
-                       $email = sprintf(elgg_echo('email:resetpassword:body'), $user->name, $password);
+                       $email = elgg_echo('email:resetpassword:body', array($user->name, $password));
 
                        return notify_user($user->guid, $CONFIG->site->guid,
                                elgg_echo('email:resetpassword:subject'), $email, NULL, 'email');
@@ -1049,7 +1049,7 @@ function validate_username($username) {
 
        for ($n = 0; $n < strlen($blacklist2); $n++) {
                if (strpos($username, $blacklist2[$n]) !== false) {
-                       $msg = sprintf(elgg_echo('registration:invalidchars'), $blacklist2[$n], $blacklist2);
+                       $msg = elgg_echo('registration:invalidchars', array($blacklist2[$n], $blacklist2));
                        throw new RegistrationException($msg);
                }
        }
index 251d470a1e3cdf88be65378a8fb90f0da1676214..6c1084f7009f7f95544fe23de5ff1911b603ee7b 100644 (file)
@@ -119,8 +119,8 @@ function trigger_xmlrpc_handler(XMLRPCCall $parameters) {
                $result  = $handler($parameters);
 
                if (!($result instanceof XMLRPCResponse)) {
-                       $msg = sprintf(elgg_echo('InvalidParameterException:UnexpectedReturnFormat'),
-                               $parameters->getMethodName());
+                       $msg = elgg_echo('InvalidParameterException:UnexpectedReturnFormat',
+                               array($parameters->getMethodName()));
                        throw new InvalidParameterException($msg);
                }
 
@@ -129,8 +129,8 @@ function trigger_xmlrpc_handler(XMLRPCCall $parameters) {
        }
 
        // if no handler then throw exception
-       $msg = sprintf(elgg_echo('NotImplementedException:XMLRPCMethodNotImplemented'),
-               $parameters->getMethodName());
+       $msg = elgg_echo('NotImplementedException:XMLRPCMethodNotImplemented',
+               array($parameters->getMethodName()));
        throw new NotImplementedException($msg);
 }
 
index c036f0766d25af59050b4365046235d234594201..5b8d621c7d1e57f31b6ffc5af763e8d0e613b7c6 100644 (file)
--- a/index.php
+++ b/index.php
@@ -45,7 +45,7 @@ if (!trigger_plugin_hook('index', 'system', null, FALSE)) {
                $activity = elgg_list_registered_entities($options);
        }
        elgg_set_context('main');
-       
+
        global $autofeed;
        $autofeed = FALSE;
 
index 61f4cc4e37c8ca9f9a8ef7f915f6271e5ed60cd7..2eba692b3cd5049d98009766dad3b897e23495ff 100644 (file)
@@ -59,7 +59,7 @@ class ElggInstaller {
                $this->processRewriteTest();
 
                if (!in_array($step, $this->getSteps())) {
-                       $msg = sprintf(elgg_echo('InstallationException:UnknownStep'), $step);
+                       $msg = elgg_echo('InstallationException:UnknownStep', array($step));
                        throw new InstallationException($msg);
                }
 
@@ -131,7 +131,7 @@ class ElggInstaller {
                );
                foreach ($requiredParams as $key) {
                        if (!array_key_exists($key, $params)) {
-                               $msg = sprintf(elgg_echo('install:error:requiredfield'), $key);
+                               $msg = elgg_echo('install:error:requiredfield', array($key));
                                throw new InstallationException($msg);
                        }
                }
@@ -580,7 +580,7 @@ class ElggInstaller {
                }
 
                if (!include_once("{$CONFIG->path}engine/lib/database.php")) {
-                       $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), 'database.php');
+                       $msg = elgg_echo('InstallationException:MissingLibrary', array('database.php'));
                        throw new InstallationException($msg);
                }
 
@@ -736,7 +736,7 @@ class ElggInstaller {
                                'calendar.php', 'configuration.php', 'cron.php', 'entities.php',
                                'extender.php', 'filestore.php', 'group.php',
                                'location.php', 'mb_wrapper.php',
-                               'memcache.php', 'metadata.php', 'metastrings.php', 
+                               'memcache.php', 'metadata.php', 'metastrings.php',
                                'navigation.php', 'notification.php',
                                'objects.php', 'opendd.php', 'pagehandler.php',
                                'pageowner.php', 'pam.php', 'plugins.php',
@@ -748,7 +748,7 @@ class ElggInstaller {
                        foreach ($lib_files as $file) {
                                $path = $lib_dir . $file;
                                if (!include_once($path)) {
-                                       $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), $file);
+                                       $msg = elgg_echo('InstallationException:MissingLibrary', array($file));
                                        throw new InstallationException($msg);
                                }
                        }
@@ -922,7 +922,7 @@ class ElggInstaller {
                if (version_compare(PHP_VERSION, $elgg_php_version, '<')) {
                        $phpReport[] = array(
                                'severity' => 'failure',
-                               'message' => sprintf(elgg_echo('install:check:php:version'), $elgg_php_version, PHP_VERSION)
+                               'message' => elgg_echo('install:check:php:version', array($elgg_php_version, PHP_VERSION))
                        );
                }
 
@@ -959,7 +959,7 @@ class ElggInstaller {
                        if (!in_array($extension, $extensions)) {
                                $phpReport[] = array(
                                        'severity' => 'failure',
-                                       'message' => sprintf(elgg_echo('install:check:php:extension'), $extension)
+                                       'message' => elgg_echo('install:check:php:extension', array($extension))
                                );
                        }
                }
@@ -971,7 +971,7 @@ class ElggInstaller {
                        if (!in_array($extension, $extensions)) {
                                $phpReport[] = array(
                                        'severity' => 'warning',
-                                       'message' => sprintf(elgg_echo('install:check:php:extension:recommend'), $extension)
+                                       'message' => elgg_echo('install:check:php:extension:recommend', array($extension))
                                );
                        }
                }
@@ -1001,7 +1001,7 @@ class ElggInstaller {
 
                if (ini_get('arg_separator.output') !== '&') {
                        $separator = htmlspecialchars(ini_get('arg_separator.output'));
-                       $msg = sprintf(elgg_echo("install:check:php:arg_separator"), $separator);
+                       $msg = elgg_echo("install:check:php:arg_separator", array($separator));
                        $phpReport[] = array(
                                'severity' => 'failure',
                                'message' => $msg,
@@ -1122,14 +1122,14 @@ class ElggInstaller {
                $version = mysql_get_server_info();
                $points = explode('.', $version);
                if ($points[0] < $required_version) {
-                       register_error(sprintf(elgg_echo('install:error:oldmysql'), $version));
+                       register_error(elgg_echo('install:error:oldmysql', array($version)));
                        return FALSE;
                }
 
                mysql_close($mysql_dblink);
 
                if (!$result) {
-                       register_error(sprintf(elgg_echo('install:error:nodatabase'), $dbname));
+                       register_error(elgg_echo('install:error:nodatabase', array($dbname)));
                }
 
                return $result;
@@ -1180,7 +1180,7 @@ class ElggInstaller {
                }
 
                if (!include_once("{$CONFIG->path}engine/lib/database.php")) {
-                       $msg = sprintf(elgg_echo('InstallationException:MissingLibrary'), 'database.php');
+                       $msg = elgg_echo('InstallationException:MissingLibrary', array('database.php'));
                        register_error($msg);
                        return FALSE;
                }
@@ -1234,28 +1234,28 @@ class ElggInstaller {
                foreach ($formVars as $field => $info) {
                        if ($info['required'] == TRUE && !$submissionVars[$field]) {
                                $name = elgg_echo("install:settings:label:$field");
-                               register_error(sprintf(elgg_echo('install:error:requiredfield'), $name));
+                               register_error(elgg_echo('install:error:requiredfield', array($name)));
                                return FALSE;
                        }
                }
 
                // check that data root is writable
                if (!is_writable($submissionVars['dataroot'])) {
-                       $msg = sprintf(elgg_echo('install:error:writedatadirectory'), $submissionVars['dataroot']);
+                       $msg = elgg_echo('install:error:writedatadirectory', array($submissionVars['dataroot']));
                        register_error($msg);
                        return FALSE;
                }
 
                // check that data root is not subdirectory of Elgg root
                if (stripos($submissionVars['dataroot'], $submissionVars['path']) !== FALSE) {
-                       $msg = sprintf(elgg_echo('install:error:locationdatadirectory'), $submissionVars['dataroot']);
+                       $msg = elgg_echo('install:error:locationdatadirectory', array($submissionVars['dataroot']));
                        register_error($msg);
                        return FALSE;
                }
 
                // check that email address is email address
                if ($submissionVars['siteemail'] && !is_email_address($submissionVars['siteemail'])) {
-                       $msg = sprintf(elgg_echo('install:error:emailaddress'), $submissionVars['siteemail']);
+                       $msg = elgg_echo('install:error:emailaddress', array($submissionVars['siteemail']));
                        register_error($msg);
                        return FALSE;
                }
@@ -1353,7 +1353,7 @@ class ElggInstaller {
                foreach ($formVars as $field => $info) {
                        if ($info['required'] == TRUE && !$submissionVars[$field]) {
                                $name = elgg_echo("install:admin:label:$field");
-                               register_error(sprintf(elgg_echo('install:error:requiredfield'), $name));
+                               register_error(elgg_echo('install:error:requiredfield', array($name)));
                                return FALSE;
                        }
                }
@@ -1376,7 +1376,7 @@ class ElggInstaller {
 
                // check that email address is email address
                if ($submissionVars['email'] && !is_email_address($submissionVars['email'])) {
-                       $msg = sprintf(elgg_echo('install:error:emailaddress'), $submissionVars['email']);
+                       $msg = elgg_echo('install:error:emailaddress', array($submissionVars['email']));
                        register_error($msg);
                        return FALSE;
                }
index b2e914e558c296c3443b3367ae2bf6a2c084feea..64785da1a2663bde007f81be7eeebd8e0bdac084 100644 (file)
@@ -152,7 +152,7 @@ class ElggRewriteTester {
                }
 
                if ($this->serverSupportsRemoteRead == FALSE) {
-                       $msg = sprintf(elgg_echo('install:warning:rewrite:unknown'), $url);
+                       $msg = elgg_echo('install:warning:rewrite:unknown', array($url));
                        return array(
                                'severity' => 'warning',
                                'message' => $msg,
index 6ed5bb709c057e9ecd3d1973d5f762f55debafed..522f9e364c11024f3abbd0dd7a31bb7cbcb9a188 100644 (file)
@@ -2,8 +2,8 @@
 /**
  * Core English Language
  *
- * @package ElggLanguage
- * @subpackage Core
+ * @package Elgg.Core
+ * @subpackage Languages.English
  */
 
 $english = array(
@@ -41,7 +41,8 @@ $english = array(
        'actionloggedout' => "Sorry, you cannot perform this action while logged out.",
        'actionunauthorized' => 'You are unauthorized to perform this action',
 
-       'InstallationException:SiteNotInstalled' => 'Unable to handle this request. This site is not configured or the database is down.',
+       'InstallationException:SiteNotInstalled' => 'Unable to handle this request. This site '
+               . ' is not configured or the database is down.',
        'InstallationException:MissingLibrary' => 'Could not load %s',
        'InstallationException:CannotLoadSettings' => 'Elgg could not load the settings file. It does not exist or there is a file permissions issue.',
 
index 4e379cae4de587df9d6a9d822e1f72e5b8ae8035..473e456c4a141103fdf734e2057a8ceea32c5416 100644 (file)
@@ -13,7 +13,7 @@ if (!$owner) {
        $owner = elgg_get_page_owner();
 }
 
-$title = sprintf(elgg_echo("friends:owned"), $owner->name);
+$title = elgg_echo("friends:owned", array($owner->name));
 
 $content = elgg_view_title($title);
 
index 19806786e453986be0eadfc113e6e0977a191785..9e49ccfd4d56f7f967773e6358a9a853d351800a 100644 (file)
@@ -13,7 +13,7 @@ if (!$owner) {
        $owner = elgg_get_page_owner();
 }
 
-$title = sprintf(elgg_echo("friends:of:owned"), $owner->name);
+$title = elgg_echo("friends:of:owned", array($owner->name));
 
 $content = elgg_view_title($title);
 
index 21336bbec464f881078c2b1794e9f0c978997bbe..9ce1419dfcad8beaa652fbccfeddf4db5fc45f89 100644 (file)
@@ -26,7 +26,7 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
        $entity = get_entity($guid);
 
        if (!$entity) {
-               $query = sprintf(elgg_echo('InvalidParameterException:GUIDNotFound'), $guid);
+               $query = elgg_echo('InvalidParameterException:GUIDNotFound', array($guid));
                throw new InvalidParameterException($query);
        }
 
@@ -38,7 +38,7 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
        // Get a uuid
        $entity = get_entity($guid);
        if (!$entity) {
-               $msg = sprintf(elgg_echo('InvalidParameterException:GUIDNotFound'), $guid);
+               $msg = elgg_echo('InvalidParameterException:GUIDNotFound', array($guid));
                throw new InvalidParameterException($msg);
        }
 
@@ -48,7 +48,7 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
                case 'attr' : // @todo: Do this better? - This is a bit of a hack...
                        $v = $entity->get($id_or_name);
                        if (!$v) {
-                               $msg = sprintf(elgg_echo('InvalidParameterException:IdNotExistForGUID'), $id_or_name, $guid);
+                               $msg = elgg_echo('InvalidParameterException:IdNotExistForGUID', array($id_or_name, $guid));
                                throw new InvalidParameterException($msg);
                        }
 
@@ -78,7 +78,7 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
                        break;
 
                default :
-                       $msg = sprintf(elgg_echo('InvalidParameterException:CanNotExportType'), $type);
+                       $msg = elgg_echo('InvalidParameterException:CanNotExportType', array($type));
                        throw new InvalidParameterException($msg);
        }
 
index 017c6e7fea67cd23ef80568f30cd62ee7aa2a00f..9b989794418ca240c1bdc9d8110804f53aaaa52d 100644 (file)
@@ -45,11 +45,11 @@ foreach ($plugin_list as $name => $info) {
        $author = $link = $version = $settings = '';
 
        if (isset($manifest['author'])) {
-               $author = sprintf(elgg_echo('admin:plugins:author'), $manifest['author']);
+               $author = elgg_echo('admin:plugins:author', array($manifest['author']));
        }
 
        if (isset($manifest['version'])) {
-               $version = ' | ' . sprintf(elgg_echo('admin:plugins:version'), $manifest['version']);
+               $version = ' | ' . elgg_echo('admin:plugins:version', array($manifest['version']));
        }
 
        if (isset($manifest['website'])) {
index 3266b2904ff39978606f74ebc3f32c433eb2c799..6e83e8afb836fd6ac3fba5d64161818678f9562a 100644 (file)
@@ -16,7 +16,7 @@ if ($vars['item']->annotation_id != 0) {
 }
 
 $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("river:posted:generic"), $url) . " ";
+$string = elgg_echo("river:posted:generic", array($url)) . " ";
 $string .= elgg_echo("{$subtype}:river:annotate") . "  <a href=\"{$object->getURL()}\">" . $title . "</a> <span class='entity_subtext'>" . elgg_view_friendly_time($object->time_created) . "<a class='river_comment_form_button link'>Comment</a>";
 $string .= elgg_view('likes/forms/link', array('entity' => $object));
 $string .= "</span>";
index b0319beb50faff28ae9cacea8ef4bb6e32e13d0f..cd84c5289a13eccc84ab3d3da8c107093fc3ab5d 100644 (file)
@@ -10,7 +10,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("friends:river:add"),$url) . " ";
+$string = elgg_echo("friends:river:add", array($url) . " ";
 $string .= "<a href=\"{$performed_on->getURL()}\">{$performed_on->name}</a>";
 $string .= "<div class=\"river_content_display\">";
 $string .= "<table><tr><td>" . elgg_view("profile/icon",array('entity' => $performed_by, 'size' => 'tiny')) . "</td>";
index 3a5809193a839ecccca25f36457af48282de488d..92256d1db5a5397e011974aae6c712743e39ba15 100644 (file)
@@ -9,6 +9,6 @@ elgg_deprecated_notice('view groups/search/startblurb was deprecated.', 1.7);
 
 <div class="contentWrapper">
        <?php
-               echo sprintf(elgg_echo("group:search:startblurb"),$vars['tag']);
+               echo elgg_echo("group:search:startblurb", array($vars['tag']));
        ?>
 </div>
index 0f07996b259a0dffdc03dcb59e01d6cfb1e37a4f..040bae8329f9235944ca9e91005436c67f93458a 100644 (file)
@@ -29,7 +29,7 @@ if ($vars['full']) {
        $controls = "";
        if ($vars['entity']->canEdit()) {
                $delete = elgg_view('output/confirm_link', array(
-                       'href' => "action/entities/delete?guid={$vars['entity']->guid}", 
+                       'href' => "action/entities/delete?guid={$vars['entity']->guid}",
                        'text' => elgg_echo('delete')
                ));
                $controls .= " ($delete)";
@@ -44,13 +44,13 @@ if ($vars['full']) {
        $owner = $vars['entity']->getOwnerEntity();
        $ownertxt = elgg_echo('unknown');
        if ($owner) {
-               $ownertxt = "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>";
+               $ownertxt = "<a href=\"" . $owner->getURL() . "\">" . $owner->name . "</a>";
        }
 
-       $info .= "<div>".sprintf(elgg_echo("entity:default:strapline"),
+       $info .= "<div>" . elgg_echo("entity:default:strapline", array(
                elgg_view_friendly_time($vars['entity']->time_created),
                $ownertxt
-       );
+       ));
 
        $info .= "</div>";
 
index a4ee421a1039bb4c97fa3108add5ca0616765f58..806157609331338eaeb7d30eb8e94681cb1ab33f 100644 (file)
@@ -7,6 +7,4 @@
 
 elgg_deprecated_notice('view user/search/startblurb was deprecated.', 1.7);
 
-echo sprintf(elgg_echo("user:search:startblurb"),$vars['tag']);
-
-?>
+echo elgg_echo("user:search:startblurb", array($vars['tag']));
\ No newline at end of file