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)));
}
}
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)));
}
}
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)));
}
}
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)));
}
}
// 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
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'));
}
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 {
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()
- )
+ ))
);
}
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);
$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
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
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()
- )
+ ))
);
}
$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);
}
} 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
// 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);
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);
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();
$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"));
}
protected function initializeAttributes() {
parent::initializeAttributes();
-
+
$this->attributes['type'] = 'annotation';
}
-
+
/**
* Construct a new annotation, optionally from a given id value or db object.
*
$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;
}
$mode = "a+b";
break;
default:
- $msg = sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode);
+ $msg = elgg_echo('InvalidParameterException:UnrecognisedFileMode', array($mode));
throw new InvalidParameterException($msg);
}
}
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);
}
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)));
}
}
{
protected function initializeAttributes() {
parent::initializeAttributes();
-
+
$this->attributes['type'] = '';
}
-
+
/**
* Returns an attribute
*
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;
public function getOwnerEntity() {
return get_entity($this->owner_guid);
}
-
+
/**
* Return the entity this describes.
*
($mode != "write") &&
($mode != "append")
) {
- $msg = sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode);
+ $msg = elgg_echo('InvalidParameterException:UnrecognisedFileMode', array($mode));
throw new InvalidParameterException($msg);
}
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);
}
$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
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);
}
// 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'));
// 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);
}
// 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);
}
* @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.
*
$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;
}
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);
}
// 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'));
// 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);
}
$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;
// 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;
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);
}
// 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'));
// 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);
}
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);
}
// 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'));
// 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);
}
$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
// @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 {
register_error(elgg_echo('actionunauthorized'));
}
} else {
- register_error(sprintf(elgg_echo('actionundefined'), $action));
+ register_error(elgg_echo('actionundefined', array($action)));
}
forward($forwarder);
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>
* {
* }
* </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)) {
} 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;
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);
}
}
$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);
}
// 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
// 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);
}
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);
}
}
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);
}
// 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);
}
}
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);
}
$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);
}
}
$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);
}
return $supported_algos[$algo];
}
- throw new APIException(sprintf(elgg_echo('APIException:AlgorithmNotSupported'), $algo));
+ throw new APIException(elgg_echo('APIException:AlgorithmNotSupported', array($algo)));
}
/**
case 'POST' :
break;
default:
- $msg = sprintf(elgg_echo('NotImplementedException:CallMethodNotImplemented'), $method);
+ $msg = elgg_echo('NotImplementedException:CallMethodNotImplemented', array($method));
throw new NotImplementedException($msg);
}
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
// 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);
}
throw new DatabaseException($msg);
}
} else {
- $msg = sprintf(elgg_echo('DatabaseException:ScriptNotFound'), $scriptlocation);
+ $msg = elgg_echo('DatabaseException:ScriptNotFound', array($scriptlocation));
throw new DatabaseException($msg);
}
}
*
* @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
$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)));
}
}
$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);
}
}
* 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
'view_type_toggle' => FALSE,
'pagination' => TRUE,
);
-
+
$options = array_merge($defaults, $options);
$options['count'] = TRUE;
$count = $getter($options);
-
+
$options['count'] = FALSE;
$entities = $getter($options);
// 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);
}
$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) {
$tmp = new ElggSite($row);
break;
default:
- $msg = sprintf(elgg_echo('InstallationException:TypeNotSupported'), $class);
+ $msg = elgg_echo('InstallationException:TypeNotSupported', array($class));
throw new InstallationException($msg);
}
}
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);
}
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);
}
if ($url == "") {
$url = "pg/view/" . $entity_guid;
}
-
+
return elgg_normalize_url($url);
}
// 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;
$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);
}
}
$url = "export/$view/$guid/$type/$nameid/";
}
-
+
return elgg_normalize_url($url);
}
}
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);
}
}
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);
}
$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) {
$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");
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);
}
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);
}
* @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.
}
}
/**
- * 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;
}
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);
}
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);
}
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));
}
}
}
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;
$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);
}
$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();
}
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);
}
* Returns a viewable list of entities by relationship
*
* @param array $options
- *
+ *
* @see elgg_list_entities()
* @see elgg_get_entities_from_relationship()
*
// 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()))
);
}
}
* @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.
}
* @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.
}
$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');
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');
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);
}
}
$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);
}
}
// 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);
}
$activity = elgg_list_registered_entities($options);
}
elgg_set_context('main');
-
+
global $autofeed;
$autofeed = FALSE;
$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);
}
);
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);
}
}
}
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);
}
'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',
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);
}
}
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))
);
}
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))
);
}
}
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))
);
}
}
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,
$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;
}
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;
}
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;
}
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;
}
}
// 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;
}
}
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,
/**
* Core English Language
*
- * @package ElggLanguage
- * @subpackage Core
+ * @package Elgg.Core
+ * @subpackage Languages.English
*/
$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.',
$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);
$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);
$entity = get_entity($guid);
if (!$entity) {
- $query = sprintf(elgg_echo('InvalidParameterException:GUIDNotFound'), $guid);
+ $query = elgg_echo('InvalidParameterException:GUIDNotFound', array($guid));
throw new InvalidParameterException($query);
}
// 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);
}
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);
}
break;
default :
- $msg = sprintf(elgg_echo('InvalidParameterException:CanNotExportType'), $type);
+ $msg = elgg_echo('InvalidParameterException:CanNotExportType', array($type));
throw new InvalidParameterException($msg);
}
$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'])) {
}
$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>";
$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>";
<div class="contentWrapper">
<?php
- echo sprintf(elgg_echo("group:search:startblurb"),$vars['tag']);
+ echo elgg_echo("group:search:startblurb", array($vars['tag']));
?>
</div>
$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)";
$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>";
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