diff --git a/.gitignore b/.gitignore
index 1e42a82f5f9..2f181223062 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,6 +61,7 @@ tmtags
Thumbs.db
Desktop.ini
npm-debug.log
+phpcbf-fixed.diff
# Codio.com
startup.sh
diff --git a/actions/admin/delete_admin_notice.php b/actions/admin/delete_admin_notice.php
index a9c3b875854..3f320d7a86d 100644
--- a/actions/admin/delete_admin_notice.php
+++ b/actions/admin/delete_admin_notice.php
@@ -10,4 +10,4 @@
register_error(elgg_echo("admin:notices:could_not_delete"));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/admin/menu/save.php b/actions/admin/menu/save.php
index 66ce71082ef..304340c8652 100644
--- a/actions/admin/menu/save.php
+++ b/actions/admin/menu/save.php
@@ -7,7 +7,7 @@
*/
// featured menu items
-$featured_names = get_input('featured_menu_names', array());
+$featured_names = get_input('featured_menu_names', []);
$featured_names = array_unique($featured_names);
if (in_array(' ', $featured_names)) {
unset($featured_names[array_search(' ', $featured_names)]);
@@ -15,10 +15,10 @@
elgg_save_config('site_featured_menu_names', $featured_names);
// custom menu items
-$custom_menu_titles = get_input('custom_menu_titles', array());
-$custom_menu_urls = get_input('custom_menu_urls', array());
+$custom_menu_titles = get_input('custom_menu_titles', []);
+$custom_menu_urls = get_input('custom_menu_urls', []);
$num_menu_items = count($custom_menu_titles);
-$custom_menu_items = array();
+$custom_menu_items = [];
for ($i = 0; $i < $num_menu_items; $i++) {
if (trim($custom_menu_urls[$i]) && trim($custom_menu_titles[$i])) {
$url = $custom_menu_urls[$i];
diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php
index b00c163f8d4..ff2102e281e 100644
--- a/actions/admin/plugins/activate.php
+++ b/actions/admin/plugins/activate.php
@@ -14,33 +14,32 @@
$plugin_guids = get_input('plugin_guids');
if (!is_array($plugin_guids)) {
- $plugin_guids = array($plugin_guids);
+ $plugin_guids = [$plugin_guids];
}
-$activated_guids = array();
+$activated_guids = [];
foreach ($plugin_guids as $guid) {
$plugin = get_entity($guid);
if (!($plugin instanceof ElggPlugin)) {
- register_error(elgg_echo('admin:plugins:activate:no', array($guid)));
+ register_error(elgg_echo('admin:plugins:activate:no', [$guid]));
continue;
}
if ($plugin->activate()) {
$activated_guids[] = $guid;
- $ids = array(
+ $ids = [
'cannot_start' . $plugin->getID(),
'invalid_and_deactivated_' . $plugin->getID()
- );
+ ];
foreach ($ids as $id) {
elgg_delete_admin_notice($id);
}
-
} else {
$msg = $plugin->getError();
$string = ($msg) ? 'admin:plugins:activate:no_with_msg' : 'admin:plugins:activate:no';
- register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError())));
+ register_error(elgg_echo($string, [$plugin->getFriendlyName(), $plugin->getError()]));
}
}
@@ -50,7 +49,7 @@
if (count($activated_guids) === 1) {
$url = 'admin/plugins';
- $query = (string)parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
+ $query = (string) parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
if ($query) {
$url .= "?$query";
}
diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php
index a87d0c720fe..7add398a5e6 100644
--- a/actions/admin/plugins/activate_all.php
+++ b/actions/admin/plugins/activate_all.php
@@ -39,10 +39,10 @@
continue;
}
- $ids = array(
+ $ids = [
'cannot_start' . $plugin->getID(),
'invalid_and_deactivated_' . $plugin->getID()
- );
+ ];
foreach ($ids as $id) {
elgg_delete_admin_notice($id);
@@ -63,7 +63,7 @@
foreach ($plugins as $plugin) {
$msg = $plugin->getError();
$string = ($msg) ? 'admin:plugins:activate:no_with_msg' : 'admin:plugins:activate:no';
- register_error(elgg_echo($string, array($plugin->getFriendlyName(), $msg)));
+ register_error(elgg_echo($string, [$plugin->getFriendlyName(), $msg]));
}
}
@@ -71,4 +71,4 @@
// loaded until next run. Just invalidate and let it regnerate as needed
elgg_flush_caches();
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php
index 6daecce47c6..a0e81290a42 100644
--- a/actions/admin/plugins/deactivate.php
+++ b/actions/admin/plugins/deactivate.php
@@ -14,14 +14,14 @@
$plugin_guids = get_input('plugin_guids');
if (!is_array($plugin_guids)) {
- $plugin_guids = array($plugin_guids);
+ $plugin_guids = [$plugin_guids];
}
foreach ($plugin_guids as $guid) {
$plugin = get_entity($guid);
if (!($plugin instanceof ElggPlugin)) {
- register_error(elgg_echo('admin:plugins:deactivate:no', array($guid)));
+ register_error(elgg_echo('admin:plugins:deactivate:no', [$guid]));
continue;
}
@@ -30,7 +30,7 @@
} else {
$msg = $plugin->getError();
$string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no';
- register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError())));
+ register_error(elgg_echo($string, [$plugin->getFriendlyName(), $plugin->getError()]));
}
}
@@ -40,7 +40,7 @@
if (count($plugin_guids) == 1) {
$url = 'admin/plugins';
- $query = (string)parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
+ $query = (string) parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
if ($query) {
$url .= "?$query";
}
diff --git a/actions/admin/plugins/deactivate_all.php b/actions/admin/plugins/deactivate_all.php
index ed6bbaf1842..d0edc83980b 100644
--- a/actions/admin/plugins/deactivate_all.php
+++ b/actions/admin/plugins/deactivate_all.php
@@ -34,7 +34,7 @@
if (!$plugin->deactivate()) {
$msg = $plugin->getError();
$string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no';
- register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError())));
+ register_error(elgg_echo($string, [$plugin->getFriendlyName(), $plugin->getError()]));
}
}
diff --git a/actions/admin/plugins/set_priority.php b/actions/admin/plugins/set_priority.php
index af4f1937205..61842d6996b 100644
--- a/actions/admin/plugins/set_priority.php
+++ b/actions/admin/plugins/set_priority.php
@@ -19,7 +19,7 @@
$plugin = get_entity($plugin_guid);
if (!($plugin instanceof ElggPlugin)) {
- register_error(elgg_echo('admin:plugins:set_priority:no', array($plugin_guid)));
+ register_error(elgg_echo('admin:plugins:set_priority:no', [$plugin_guid]));
forward(REFERER);
}
@@ -28,11 +28,11 @@
} else {
$msg = $plugin->getError();
$string = ($msg) ? 'admin:plugins:set_priority:no_with_msg' : 'admin:plugins:set_priority:no';
- register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError())));
+ register_error(elgg_echo($string, [$plugin->getFriendlyName(), $plugin->getError()]));
}
// don't regenerate the simplecache because the plugin won't be
// loaded until next run. Just invalidate and let it regnerate as needed
elgg_flush_caches();
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/admin/site/flush_cache.php b/actions/admin/site/flush_cache.php
index 58735cecc83..91e53855802 100644
--- a/actions/admin/site/flush_cache.php
+++ b/actions/admin/site/flush_cache.php
@@ -7,4 +7,4 @@
_elgg_services()->autoloadManager->deleteCache();
system_message(elgg_echo('admin:cache:flushed'));
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/admin/site/set_maintenance_mode.php b/actions/admin/site/set_maintenance_mode.php
index a9831fef5df..047dee8f874 100644
--- a/actions/admin/site/set_maintenance_mode.php
+++ b/actions/admin/site/set_maintenance_mode.php
@@ -3,7 +3,7 @@
* Configure site maintenance mode
*/
-$mode = (int)get_input('mode');
+$mode = (int) get_input('mode');
$message = get_input('message');
$site = elgg_get_site_entity();
diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php
index 8641e6554b9..6f74ab7a294 100644
--- a/actions/admin/site/update_advanced.php
+++ b/actions/admin/site/update_advanced.php
@@ -25,13 +25,13 @@
// check for relative paths
if (stripos(PHP_OS, 'win') === 0) {
if (strpos($dataroot, ':') !== 1) {
- $msg = elgg_echo('admin:configuration:dataroot:relative_path', array($dataroot));
+ $msg = elgg_echo('admin:configuration:dataroot:relative_path', [$dataroot]);
register_error($msg);
forward(REFERER);
}
} else {
if (strpos($dataroot, '/') !== 0) {
- $msg = elgg_echo('admin:configuration:dataroot:relative_path', array($dataroot));
+ $msg = elgg_echo('admin:configuration:dataroot:relative_path', [$dataroot]);
register_error($msg);
forward(REFERER);
}
diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php
index 3b4d09aa89f..99421ed8332 100644
--- a/actions/admin/site/update_basic.php
+++ b/actions/admin/site/update_basic.php
@@ -25,7 +25,7 @@
elgg_save_config('language', get_input('language'));
-$default_limit = (int)get_input('default_limit');
+$default_limit = (int) get_input('default_limit');
if ($default_limit < 1) {
register_error(elgg_echo('admin:configuration:default_limit'));
forward(REFERER);
diff --git a/actions/admin/user/ban.php b/actions/admin/user/ban.php
index 209ece2a057..e94a6fb10aa 100644
--- a/actions/admin/user/ban.php
+++ b/actions/admin/user/ban.php
@@ -27,4 +27,4 @@
register_error(elgg_echo('admin:user:ban:no'));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/admin/user/delete.php b/actions/admin/user/delete.php
index 7cfbd092564..a3228e58a19 100644
--- a/actions/admin/user/delete.php
+++ b/actions/admin/user/delete.php
@@ -23,7 +23,7 @@
if (($user instanceof ElggUser) && ($user->canEdit())) {
if ($user->delete()) {
- system_message(elgg_echo('admin:user:delete:yes', array($name)));
+ system_message(elgg_echo('admin:user:delete:yes', [$name]));
} else {
register_error(elgg_echo('admin:user:delete:no'));
}
@@ -33,7 +33,7 @@
// forward to user administration if on a user's page as it no longer exists
$forward = REFERER;
-if (strpos($_SERVER['HTTP_REFERER'], $username) != FALSE) {
+if (strpos($_SERVER['HTTP_REFERER'], $username) != false) {
$forward = "admin/users/newest";
}
diff --git a/actions/admin/user/resetpassword.php b/actions/admin/user/resetpassword.php
index fdebadb5b06..87c6d22b556 100644
--- a/actions/admin/user/resetpassword.php
+++ b/actions/admin/user/resetpassword.php
@@ -25,13 +25,13 @@
notify_user($user->guid,
elgg_get_site_entity()->guid,
- elgg_echo('email:resetpassword:subject', array(), $user->language),
- elgg_echo('email:resetpassword:body', array($user->username, $password), $user->language),
- array(
+ elgg_echo('email:resetpassword:subject', [], $user->language),
+ elgg_echo('email:resetpassword:body', [$user->username, $password], $user->language),
+ [
'object' => $user,
'action' => 'resetpassword',
'password' => $password,
- ),
+ ],
'email');
} else {
register_error(elgg_echo('admin:user:resetpassword:no'));
diff --git a/actions/avatar/crop.php b/actions/avatar/crop.php
index 73bfdf559f8..9d13825799d 100644
--- a/actions/avatar/crop.php
+++ b/actions/avatar/crop.php
@@ -32,13 +32,13 @@
system_message(elgg_echo('avatar:crop:success'));
$view = 'river/user/default/profileiconupdate';
-_elgg_delete_river(array('subject_guid' => $owner->guid, 'view' => $view));
-elgg_create_river_item(array(
+_elgg_delete_river(['subject_guid' => $owner->guid, 'view' => $view]);
+elgg_create_river_item([
'view' => $view,
'action_type' => 'update',
'subject_guid' => $owner->guid,
'object_guid' => $owner->guid,
-));
+]);
forward(REFERER);
diff --git a/actions/avatar/upload.php b/actions/avatar/upload.php
index 562140fe304..e88b7837947 100644
--- a/actions/avatar/upload.php
+++ b/actions/avatar/upload.php
@@ -26,13 +26,13 @@
system_message(elgg_echo("avatar:upload:success"));
$view = 'river/user/default/profileiconupdate';
- _elgg_delete_river(array('subject_guid' => $owner->guid, 'view' => $view));
- elgg_create_river_item(array(
+ _elgg_delete_river(['subject_guid' => $owner->guid, 'view' => $view]);
+ elgg_create_river_item([
'view' => $view,
'action_type' => 'update',
'subject_guid' => $owner->guid,
'object_guid' => $owner->guid,
- ));
+ ]);
}
forward(REFERER);
diff --git a/actions/comment/delete.php b/actions/comment/delete.php
index e9db5d067c0..5a90b30e8ec 100644
--- a/actions/comment/delete.php
+++ b/actions/comment/delete.php
@@ -19,4 +19,4 @@
register_error(elgg_echo('generic_comment:notfound'));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/comment/save.php b/actions/comment/save.php
index a73ace58767..07d0942fce1 100644
--- a/actions/comment/save.php
+++ b/actions/comment/save.php
@@ -34,11 +34,11 @@
if (elgg_is_xhr()) {
// @todo move to its own view object/comment/content in 1.x
- echo elgg_view('output/longtext', array(
+ echo elgg_view('output/longtext', [
'value' => $comment->description,
'class' => 'elgg-inner',
'data-role' => 'comment-text',
- ));
+ ]);
}
} else {
register_error(elgg_echo('generic_comment:failure'));
@@ -66,13 +66,13 @@
}
// Add to river
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/comment/create',
'action_type' => 'comment',
'subject_guid' => $user->guid,
'object_guid' => $guid,
'target_guid' => $entity_guid,
- ));
+ ]);
system_message(elgg_echo('generic_comment:posted'));
}
diff --git a/actions/entity/delete.php b/actions/entity/delete.php
index 099b14e9f90..b94a9578f3f 100644
--- a/actions/entity/delete.php
+++ b/actions/entity/delete.php
@@ -29,7 +29,7 @@
$container = $entity->getContainerEntity();
if (!$entity->delete()) {
- register_error(elgg_echo('entity:delete:fail', array($display_name)));
+ register_error(elgg_echo('entity:delete:fail', [$display_name]));
forward(REFERRER);
}
@@ -51,15 +51,15 @@
}
}
-$success_keys = array(
+$success_keys = [
"entity:delete:$type:$subtype:success",
"entity:delete:$type:success",
"entity:delete:success",
-);
+];
foreach ($success_keys as $success_key) {
if (elgg_language_key_exists($success_key)) {
- system_message(elgg_echo($success_key, array($display_name)));
+ system_message(elgg_echo($success_key, [$display_name]));
break;
}
}
diff --git a/actions/friends/add.php b/actions/friends/add.php
index ffb6745e672..d5d6edbc1dc 100644
--- a/actions/friends/add.php
+++ b/actions/friends/add.php
@@ -16,9 +16,9 @@
}
if (!elgg_get_logged_in_user_entity()->addFriend($friend->guid, true)) {
- register_error(elgg_echo("friends:add:failure", array($friend->name)));
+ register_error(elgg_echo("friends:add:failure", [$friend->name]));
forward(REFERER);
}
-system_message(elgg_echo("friends:add:successful", array($friend->name)));
+system_message(elgg_echo("friends:add:successful", [$friend->name]));
forward(REFERER);
diff --git a/actions/friends/remove.php b/actions/friends/remove.php
index 07c43bf77fd..5cd99368232 100644
--- a/actions/friends/remove.php
+++ b/actions/friends/remove.php
@@ -16,10 +16,10 @@
}
if (!elgg_get_logged_in_user_entity()->removeFriend($friend->guid)) {
- register_error(elgg_echo("friends:remove:failure", array($friend->name)));
+ register_error(elgg_echo("friends:remove:failure", [$friend->name]));
forward(REFERER);
}
-system_message(elgg_echo("friends:remove:successful", array($friend->name)));
+system_message(elgg_echo("friends:remove:successful", [$friend->name]));
forward(REFERER);
diff --git a/actions/login.php b/actions/login.php
index c198403fbca..f917f10f96f 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -70,7 +70,7 @@
// @todo we need to use the config object to store this so that the current language
// can be changed. Refs #4171
if ($user->language) {
- $message = elgg_echo('loginok', array(), $user->language);
+ $message = elgg_echo('loginok', [], $user->language);
} else {
$message = elgg_echo('loginok');
}
@@ -78,7 +78,7 @@
// clear after login in case login fails
$session->remove('last_forward_from');
-$params = array('user' => $user, 'source' => $forward_source);
+$params = ['user' => $user, 'source' => $forward_source];
$forward_url = elgg_trigger_plugin_hook('login:forward', 'user', $params, $forward_url);
$output = [
diff --git a/actions/logout.php b/actions/logout.php
index c48a26b159f..262db850227 100644
--- a/actions/logout.php
+++ b/actions/logout.php
@@ -15,4 +15,4 @@
forward();
} else {
register_error(elgg_echo('logouterror'));
-}
\ No newline at end of file
+}
diff --git a/actions/plugins/settings/save.php b/actions/plugins/settings/save.php
index 581a2f9ecc2..1135e84a055 100644
--- a/actions/plugins/settings/save.php
+++ b/actions/plugins/settings/save.php
@@ -17,7 +17,7 @@
$plugin = elgg_get_plugin_from_id($plugin_id);
if (!($plugin instanceof ElggPlugin)) {
- register_error(elgg_echo('plugins:settings:save:fail', array($plugin_id)));
+ register_error(elgg_echo('plugins:settings:save:fail', [$plugin_id]));
forward(REFERER);
}
@@ -32,12 +32,12 @@
foreach ($params as $k => $v) {
$result = $plugin->setSetting($k, $v);
if (!$result) {
- register_error(elgg_echo('plugins:settings:save:fail', array($plugin_name)));
+ register_error(elgg_echo('plugins:settings:save:fail', [$plugin_name]));
forward(REFERER);
exit;
}
}
}
-system_message(elgg_echo('plugins:settings:save:ok', array($plugin_name)));
-forward(REFERER);
\ No newline at end of file
+system_message(elgg_echo('plugins:settings:save:ok', [$plugin_name]));
+forward(REFERER);
diff --git a/actions/plugins/usersettings/save.php b/actions/plugins/usersettings/save.php
index f6b8ab0b698..c48e08f2399 100644
--- a/actions/plugins/usersettings/save.php
+++ b/actions/plugins/usersettings/save.php
@@ -20,12 +20,12 @@
$user = get_entity($user_guid);
if (!($plugin instanceof ElggPlugin)) {
- register_error(elgg_echo('plugins:usersettings:save:fail', array($plugin_id)));
+ register_error(elgg_echo('plugins:usersettings:save:fail', [$plugin_id]));
forward(REFERER);
}
if (!($user instanceof ElggUser)) {
- register_error(elgg_echo('plugins:usersettings:save:fail', array($plugin_id)));
+ register_error(elgg_echo('plugins:usersettings:save:fail', [$plugin_id]));
forward(REFERER);
}
@@ -33,7 +33,7 @@
// make sure we're admin or the user
if (!$user->canEdit()) {
- register_error(elgg_echo('plugins:usersettings:save:fail', array($plugin_name)));
+ register_error(elgg_echo('plugins:usersettings:save:fail', [$plugin_name]));
forward(REFERER);
}
@@ -48,11 +48,11 @@
// Error?
if (!$result) {
- register_error(elgg_echo('plugins:usersettings:save:fail', array($plugin_name)));
+ register_error(elgg_echo('plugins:usersettings:save:fail', [$plugin_name]));
forward(REFERER);
}
}
}
-system_message(elgg_echo('plugins:usersettings:save:ok', array($plugin_name)));
+system_message(elgg_echo('plugins:usersettings:save:ok', [$plugin_name]));
forward(REFERER);
diff --git a/actions/profile/edit.php b/actions/profile/edit.php
index 8133f3da40c..dc0a647e710 100644
--- a/actions/profile/edit.php
+++ b/actions/profile/edit.php
@@ -16,11 +16,11 @@
// grab the defined profile field names and their load the values from POST.
// each field can have its own access, so sort that too.
-$input = array();
+$input = [];
$accesslevel = get_input('accesslevel');
if (!is_array($accesslevel)) {
- $accesslevel = array();
+ $accesslevel = [];
}
$profile_fields = elgg_get_config('profile_fields');
@@ -53,9 +53,9 @@
}
if ($valuetype == 'email' && !empty($value) && !is_email_address($value)) {
- register_error(elgg_echo('profile:invalid_email', array(
+ register_error(elgg_echo('profile:invalid_email', [
elgg_echo("profile:{$shortname}")
- )));
+ ]));
forward(REFERER);
}
@@ -75,16 +75,15 @@
// go through custom fields
if (sizeof($input) > 0) {
-
// fetch default access level for the user for use in fallback cases
$user_default_access = get_default_access($owner);
foreach ($input as $shortname => $value) {
- $options = array(
+ $options = [
'guid' => $owner->guid,
'metadata_name' => $shortname,
'limit' => false
- );
+ ];
elgg_delete_metadata($options);
if (!is_null($value) && ($value !== '')) {
@@ -101,7 +100,7 @@
$i = 0;
foreach ($value as $interval) {
$i++;
- $multiple = ($i > 1) ? TRUE : FALSE;
+ $multiple = ($i > 1) ? true : false;
create_metadata($owner->guid, $shortname, $interval, 'text', $owner->guid, $access_id, $multiple);
}
} else {
diff --git a/actions/profile/fields/add.php b/actions/profile/fields/add.php
index 08aafebac7f..740971c66e3 100644
--- a/actions/profile/fields/add.php
+++ b/actions/profile/fields/add.php
@@ -14,7 +14,7 @@
} else {
$fieldlistarray = explode(',', $fieldlist);
foreach ($fieldlistarray as $key => $value) {
- $fieldlistarray[$key] = (int)$value;
+ $fieldlistarray[$key] = (int) $value;
}
$id = max($fieldlistarray) + 1;
}
@@ -28,7 +28,6 @@
if (elgg_save_config("admin_defined_profile_$id", $label) &&
elgg_save_config("admin_defined_profile_type_$id", $type) &&
elgg_save_config('profile_custom_fields', $fieldlist)) {
-
system_message(elgg_echo('profile:editdefault:success'));
} else {
register_error(elgg_echo('profile:editdefault:fail'));
@@ -37,4 +36,4 @@
register_error(elgg_echo('profile:editdefault:fail'));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/profile/fields/delete.php b/actions/profile/fields/delete.php
index fe703ea2ff5..8f54ea2779e 100644
--- a/actions/profile/fields/delete.php
+++ b/actions/profile/fields/delete.php
@@ -19,10 +19,9 @@
elgg_remove_config("admin_defined_profile_$id") &&
elgg_remove_config("admin_defined_profile_type_$id") &&
elgg_save_config('profile_custom_fields', $fieldlist)) {
-
system_message(elgg_echo('profile:editdefault:delete:success'));
} else {
register_error(elgg_echo('profile:editdefault:delete:fail'));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/profile/fields/edit.php b/actions/profile/fields/edit.php
index 5fc84ff11bf..d9f540ae67c 100644
--- a/actions/profile/fields/edit.php
+++ b/actions/profile/fields/edit.php
@@ -17,4 +17,4 @@
register_error(elgg_echo('profile:editdefault:fail'));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/profile/fields/reset.php b/actions/profile/fields/reset.php
index 124645070b0..76aca67ad89 100644
--- a/actions/profile/fields/reset.php
+++ b/actions/profile/fields/reset.php
@@ -17,4 +17,4 @@
system_message(elgg_echo('profile:defaultprofile:reset'));
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/actions/register.php b/actions/register.php
index c92f5ce1f90..0637ea2d14a 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -36,15 +36,15 @@
// note: To catch all new users, even those created by an admin,
// register for the create, user event instead.
// only passing vars that aren't in ElggUser.
- $params = array(
+ $params = [
'user' => $new_user,
'password' => $password,
'friend_guid' => $friend_guid,
'invitecode' => $invitecode
- );
+ ];
// @todo should registration be allowed no matter what the plugins return?
- if (!elgg_trigger_plugin_hook('register', 'user', $params, TRUE)) {
+ if (!elgg_trigger_plugin_hook('register', 'user', $params, true)) {
$ia = elgg_set_ignore_access(true);
$new_user->delete();
elgg_set_ignore_access($ia);
@@ -57,7 +57,7 @@
elgg_clear_sticky_form('register');
if ($new_user->enabled == "yes") {
- system_message(elgg_echo("registerok", array(elgg_get_site_entity()->name)));
+ system_message(elgg_echo("registerok", [elgg_get_site_entity()->name]));
// if exception thrown, this probably means there is a validation
// plugin that has disabled the user
@@ -73,7 +73,7 @@
$forward_url = '';
$forward_source = null;
}
- $params = array('user' => $new_user, 'source' => $forward_source);
+ $params = ['user' => $new_user, 'source' => $forward_source];
$forward_url = elgg_trigger_plugin_hook('login:forward', 'user', $params, $forward_url);
forward($forward_url);
} catch (LoginException $e) {
diff --git a/actions/river/delete.php b/actions/river/delete.php
index d86d6f2d1b8..a3697947eed 100644
--- a/actions/river/delete.php
+++ b/actions/river/delete.php
@@ -6,7 +6,7 @@
* @subpackage Core
*/
-$id = (int)get_input('id');
+$id = (int) get_input('id');
$items = elgg_get_river(['id' => $id]);
if (!$items) {
diff --git a/actions/user/changepassword.php b/actions/user/changepassword.php
index a1815c6fc73..ce8cb3c68cb 100644
--- a/actions/user/changepassword.php
+++ b/actions/user/changepassword.php
@@ -13,7 +13,7 @@
try {
validate_password($password);
-} catch(RegistrationException $e) {
+} catch (RegistrationException $e) {
register_error($e->getMessage());
forward(REFERER);
}
diff --git a/actions/user/requestnewpassword.php b/actions/user/requestnewpassword.php
index 6984690483b..cbb12d5dced 100644
--- a/actions/user/requestnewpassword.php
+++ b/actions/user/requestnewpassword.php
@@ -21,7 +21,7 @@
register_error(elgg_echo('user:password:changereq:fail'));
}
} else {
- register_error(elgg_echo('user:username:notfound', array($username)));
+ register_error(elgg_echo('user:username:notfound', [$username]));
}
forward();
diff --git a/actions/useradd.php b/actions/useradd.php
index ddcf6fac54d..475175c27d5 100644
--- a/actions/useradd.php
+++ b/actions/useradd.php
@@ -43,7 +43,7 @@
// For now, just try and register the user
try {
- $guid = register_user($username, $password, $name, $email, TRUE);
+ $guid = register_user($username, $password, $name, $email, true);
if ($guid) {
$new_user = get_entity($guid);
@@ -53,7 +53,7 @@
elgg_clear_sticky_form('useradd');
- $new_user->admin_created = TRUE;
+ $new_user->admin_created = true;
// @todo ugh, saving a guid as metadata!
$new_user->created_by_guid = elgg_get_logged_in_user_guid();
@@ -61,14 +61,14 @@
// language of the current user (admin), so we need to fix it here.
$new_user->language = $language;
- $subject = elgg_echo('useradd:subject', array(), $new_user->language);
- $body = elgg_echo('useradd:body', array(
+ $subject = elgg_echo('useradd:subject', [], $new_user->language);
+ $body = elgg_echo('useradd:body', [
$name,
elgg_get_site_entity()->name,
elgg_get_site_entity()->url,
$username,
$password,
- ), $new_user->language);
+ ], $new_user->language);
notify_user($new_user->guid, elgg_get_site_entity()->guid, $subject, $body, [
'action' => 'useradd',
@@ -76,7 +76,7 @@
'password' => $password,
]);
- system_message(elgg_echo("adduser:ok", array(elgg_get_site_entity()->name)));
+ system_message(elgg_echo("adduser:ok", [elgg_get_site_entity()->name]));
} else {
register_error(elgg_echo("adduser:bad"));
}
diff --git a/actions/widgets/add.php b/actions/widgets/add.php
index 95061940b22..83dea4fbaae 100644
--- a/actions/widgets/add.php
+++ b/actions/widgets/add.php
@@ -9,7 +9,7 @@
$page_owner_guid = (int) get_input('page_owner_guid');
$handler = get_input('handler');
$context = get_input('context');
-$show_access = (bool)get_input('show_access', true);
+$show_access = (bool) get_input('show_access', true);
$column = (int) get_input('column', 1);
$default_widgets = (int) get_input('default_widgets', 0);
diff --git a/actions/widgets/save.php b/actions/widgets/save.php
index e20abd551d2..c1e89274911 100644
--- a/actions/widgets/save.php
+++ b/actions/widgets/save.php
@@ -48,4 +48,4 @@
elgg_pop_context();
}
-return elgg_ok_response($output);
\ No newline at end of file
+return elgg_ok_response($output);
diff --git a/composer.json b/composer.json
index b088ba438c3..c0009d112d5 100644
--- a/composer.json
+++ b/composer.json
@@ -35,12 +35,18 @@
"htmlawed/htmlawed": "^1.1.22",
"imagine/imagine": "^0.6.3"
},
+ "config": {
+ "process-timeout": 0
+ },
"scripts": {
"pre-install-cmd": "php .scripts/check_global_requirements.php",
"lint": [
- "phpcs --standard=vendor/elgg/sniffs/elgg.xml --warning-severity=0 --ignore=*/tests/*,*/upgrades/*,*/deprecated* engine/classes engine/lib",
+ "phpcs --standard=vendor/elgg/sniffs/elgg.xml -sv engine/classes engine/lib",
"composer validate"
],
+ "lint-fixer": [
+ "phpcbf --standard=vendor/elgg/sniffs/elgg.xml *.php actions engine install mod views"
+ ],
"test": "phpunit",
"travis:install": [
"composer self-update",
@@ -70,9 +76,15 @@
},
"require-dev": {
"phpunit/phpunit": "~4.1",
- "elgg/sniffs": "dev-master",
- "squizlabs/php_codesniffer": "~1.5",
+ "elgg/sniffs": "3.x-dev",
+ "squizlabs/php_codesniffer": "^2.8.1",
"simpletest/simpletest": "~1.1",
"phpdocumentor/reflection-docblock": "~2.0"
- }
+ },
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/elgg/elgg-coding-standards"
+ }
+ ]
}
diff --git a/composer.lock b/composer.lock
index da26ce48ad0..cab87fa808b 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "33d388cd5717f3741514d1d534a1b84e",
+ "content-hash": "d15c1a8d288ddfff002415f7c59fc853",
"packages": [
{
"name": "bower-asset/jquery",
@@ -133,16 +133,16 @@
},
{
"name": "bower-asset/requirejs",
- "version": "2.3.2",
+ "version": "2.3.3",
"source": {
"type": "git",
"url": "https://github.com/requirejs/requirejs-bower.git",
- "reference": "ccebb20d187a88aef04c643b2d61325e469902a8"
+ "reference": "ccfdde8efdbfe046cdb68f86ecfcfc198acccd09"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/requirejs/requirejs-bower/zipball/ccebb20d187a88aef04c643b2d61325e469902a8",
- "reference": "ccebb20d187a88aef04c643b2d61325e469902a8",
+ "url": "https://api.github.com/repos/requirejs/requirejs-bower/zipball/ccfdde8efdbfe046cdb68f86ecfcfc198acccd09",
+ "reference": "ccfdde8efdbfe046cdb68f86ecfcfc198acccd09",
"shasum": ""
},
"type": "bower-asset-library",
@@ -317,18 +317,21 @@
},
{
"name": "container-interop/container-interop",
- "version": "1.1.0",
+ "version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/container-interop/container-interop.git",
- "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e"
+ "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e",
- "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e",
+ "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8",
+ "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8",
"shasum": ""
},
+ "require": {
+ "psr/container": "^1.0"
+ },
"type": "library",
"autoload": {
"psr-4": {
@@ -340,20 +343,21 @@
"MIT"
],
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
- "time": "2014-12-30T15:22:37+00:00"
+ "homepage": "https://github.com/container-interop/container-interop",
+ "time": "2017-02-14T19:40:03+00:00"
},
{
"name": "doctrine/annotations",
- "version": "v1.3.1",
+ "version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
- "reference": "bd4461328621bde0ae6b1b2675fbc6aca4ceb558"
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/bd4461328621bde0ae6b1b2675fbc6aca4ceb558",
- "reference": "bd4461328621bde0ae6b1b2675fbc6aca4ceb558",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97",
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97",
"shasum": ""
},
"require": {
@@ -362,7 +366,7 @@
},
"require-dev": {
"doctrine/cache": "1.*",
- "phpunit/phpunit": "^5.6.1"
+ "phpunit/phpunit": "^5.7"
},
"type": "library",
"extra": {
@@ -408,7 +412,7 @@
"docblock",
"parser"
],
- "time": "2016-12-30T15:59:45+00:00"
+ "time": "2017-02-24T16:22:25+00:00"
},
{
"name": "doctrine/cache",
@@ -482,28 +486,29 @@
},
{
"name": "doctrine/collections",
- "version": "v1.3.0",
+ "version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
- "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
+ "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
- "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
+ "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba",
+ "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba",
"shasum": ""
},
"require": {
- "php": ">=5.3.2"
+ "php": "^5.6 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.0"
+ "doctrine/coding-standard": "~0.1@dev",
+ "phpunit/phpunit": "^5.7"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2.x-dev"
+ "dev-master": "1.3.x-dev"
}
},
"autoload": {
@@ -544,20 +549,20 @@
"collections",
"iterator"
],
- "time": "2015-04-14T22:21:58+00:00"
+ "time": "2017-01-03T10:49:41+00:00"
},
{
"name": "doctrine/common",
- "version": "v2.6.2",
+ "version": "v2.7.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
- "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3"
+ "reference": "930297026c8009a567ac051fd545bf6124150347"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
- "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
+ "url": "https://api.github.com/repos/doctrine/common/zipball/930297026c8009a567ac051fd545bf6124150347",
+ "reference": "930297026c8009a567ac051fd545bf6124150347",
"shasum": ""
},
"require": {
@@ -566,10 +571,10 @@
"doctrine/collections": "1.*",
"doctrine/inflector": "1.*",
"doctrine/lexer": "1.*",
- "php": "~5.5|~7.0"
+ "php": "~5.6|~7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.8|~5.0"
+ "phpunit/phpunit": "^5.4.6"
},
"type": "library",
"extra": {
@@ -617,24 +622,24 @@
"persistence",
"spl"
],
- "time": "2016-11-30T16:50:46+00:00"
+ "time": "2017-01-13T14:02:13+00:00"
},
{
"name": "doctrine/dbal",
- "version": "v2.5.5",
+ "version": "v2.5.12",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
- "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9"
+ "reference": "7b9e911f9d8b30d43b96853dab26898c710d8f44"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
- "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/7b9e911f9d8b30d43b96853dab26898c710d8f44",
+ "reference": "7b9e911f9d8b30d43b96853dab26898c710d8f44",
"shasum": ""
},
"require": {
- "doctrine/common": ">=2.4,<2.7-dev",
+ "doctrine/common": ">=2.4,<2.8-dev",
"php": ">=5.3.2"
},
"require-dev": {
@@ -688,7 +693,7 @@
"persistence",
"queryobject"
],
- "time": "2016-09-09T19:13:33+00:00"
+ "time": "2017-02-08T12:53:47+00:00"
},
{
"name": "doctrine/inflector",
@@ -1070,16 +1075,16 @@
},
{
"name": "league/flysystem",
- "version": "1.0.32",
+ "version": "1.0.36",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
- "reference": "1b5c4a0031697f46e779a9d1b309c2e1b24daeab"
+ "reference": "d9c1698582dfbfbd092ec9c5c3325f862cdb3297"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/1b5c4a0031697f46e779a9d1b309c2e1b24daeab",
- "reference": "1b5c4a0031697f46e779a9d1b309c2e1b24daeab",
+ "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d9c1698582dfbfbd092ec9c5c3325f862cdb3297",
+ "reference": "d9c1698582dfbfbd092ec9c5c3325f862cdb3297",
"shasum": ""
},
"require": {
@@ -1149,7 +1154,7 @@
"sftp",
"storage"
],
- "time": "2016-10-19T20:38:46+00:00"
+ "time": "2017-03-18T16:02:30+00:00"
},
{
"name": "league/flysystem-memory",
@@ -1255,23 +1260,23 @@
},
{
"name": "misd/linkify",
- "version": "v1.1.2",
+ "version": "v1.1.3",
"source": {
"type": "git",
"url": "https://github.com/misd-service-development/php-linkify.git",
- "reference": "4dbe3e9f966e446a257d0f60a91f39e0b7f4f4d6"
+ "reference": "78c0da54f3e772cc569bb88d8dc8c46413bce4e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/misd-service-development/php-linkify/zipball/4dbe3e9f966e446a257d0f60a91f39e0b7f4f4d6",
- "reference": "4dbe3e9f966e446a257d0f60a91f39e0b7f4f4d6",
+ "url": "https://api.github.com/repos/misd-service-development/php-linkify/zipball/78c0da54f3e772cc569bb88d8dc8c46413bce4e7",
+ "reference": "78c0da54f3e772cc569bb88d8dc8c46413bce4e7",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.0"
+ "phpunit/phpunit": "^4.0 || ^5.0"
},
"type": "library",
"extra": {
@@ -1280,20 +1285,14 @@
}
},
"autoload": {
- "psr-0": {
- "Misd\\Linkify\\": "src/"
+ "psr-4": {
+ "Misd\\Linkify\\": "src/Misd/Linkify"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "authors": [
- {
- "name": "Chris Wilkinson",
- "email": "chris.wilkinson@admin.cam.ac.uk"
- }
- ],
"description": "Converts URLs and email addresses in text into HTML links",
"homepage": "https://github.com/misd-service-development/php-linkify",
"keywords": [
@@ -1302,7 +1301,7 @@
"link",
"url"
],
- "time": "2014-05-12T11:52:18+00:00"
+ "time": "2017-02-18T13:30:02+00:00"
},
{
"name": "mrclay/minify",
@@ -1395,18 +1394,67 @@
],
"time": "2016-08-06T20:24:11+00:00"
},
+ {
+ "name": "psr/container",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "time": "2017-02-14T16:28:37+00:00"
+ },
{
"name": "roave/security-advisories",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
- "reference": "b809da53b92844354dda4423ed1d393e279b64ca"
+ "reference": "66f7b04100fb2a7bdeaaddf02579189e15835056"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b809da53b92844354dda4423ed1d393e279b64ca",
- "reference": "b809da53b92844354dda4423ed1d393e279b64ca",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/66f7b04100fb2a7bdeaaddf02579189e15835056",
+ "reference": "66f7b04100fb2a7bdeaaddf02579189e15835056",
"shasum": ""
},
"conflict": {
@@ -1415,6 +1463,7 @@
"aws/aws-sdk-php": ">=3,<3.2.1",
"bugsnag/bugsnag-laravel": ">=2,<2.0.2",
"cakephp/cakephp": ">=3,<3.0.15|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=1.3,<1.3.18|>=2.7,<2.7.6|>=3.1,<3.1.4",
+ "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4",
"cartalyst/sentry": "<2.1",
"codeigniter/framework": "<=3.0.6",
"composer/composer": "<=1.0.0-alpha11",
@@ -1430,8 +1479,8 @@
"doctrine/mongodb-odm-bundle": ">=2,<3.0.1",
"doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1",
"dompdf/dompdf": ">=0.6,<0.6.2",
- "drupal/core": ">=8,<8.2.3",
- "drupal/drupal": ">=8,<8.2.3",
+ "drupal/core": ">=8,<8.2.7",
+ "drupal/drupal": ">=8,<8.2.7",
"firebase/php-jwt": "<2",
"friendsofsymfony/rest-bundle": ">=1.2,<1.2.2",
"friendsofsymfony/user-bundle": ">=1.2,<1.3.5",
@@ -1442,23 +1491,26 @@
"joomla/session": "<1.3.1",
"laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29",
"laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
+ "magento/magento1ce": ">=1.5.0.1,<1.9.3.2",
+ "magento/magento1ee": ">=1.9,<1.14.3.2",
"magento/magento2ce": ">=2,<2.2",
"monolog/monolog": ">=1.8,<1.12",
"namshi/jose": "<2.2",
"oro/crm": ">=1.7,<1.7.4",
"oro/platform": ">=1.7,<1.7.4",
- "phpmailer/phpmailer": ">=5,<5.2.20",
+ "phpmailer/phpmailer": ">=5,<5.2.22",
"pusher/pusher-php-server": "<2.2.1",
"sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
- "shopware/shopware": "<4.3.7|>=5,<5.1.5",
+ "shopware/shopware": "<4.4|>=5,<5.2.16",
"silverstripe/cms": ">=3.1,<3.1.11|>=3,<=3.0.11",
"silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3",
"silverstripe/framework": ">=3,<3.3",
"silverstripe/userforms": "<3",
- "simplesamlphp/saml2": ">=1.9,<1.9.1|>=1.10,<1.10.3|>=2.3,<2.3.3",
+ "simplesamlphp/saml2": "<1.8.1|>=1.9,<1.9.1|>=1.10,<1.10.3|>=2,<2.3.3",
"simplesamlphp/simplesamlphp": "<1.14.11",
"simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
"socalnick/scn-social-auth": "<1.15.2",
+ "squizlabs/php_codesniffer": ">=1,<2.8.1",
"swiftmailer/swiftmailer": ">=4,<5.4.5",
"symfony/dependency-injection": ">=2,<2.0.17",
"symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.7",
@@ -1478,7 +1530,7 @@
"thelia/backoffice-default-template": ">=2.1,<2.1.2",
"thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2",
"twig/twig": "<1.20",
- "typo3/cms": ">=6.2,<6.2.29|>=8,<8.4.1|>=7,<7.6.13",
+ "typo3/cms": ">=6.2,<6.2.30|>=8,<8.6.1|>=7,<7.6.16",
"typo3/flow": ">=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5|>=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1",
"typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4",
"willdurand/js-translation-bundle": "<2.1.1",
@@ -1524,20 +1576,20 @@
}
],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
- "time": "2016-12-29T12:33:36+00:00"
+ "time": "2017-03-16T14:24:35+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v2.8.15",
+ "version": "v2.8.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "216c111ac427f5f773c6a8bfc0c15f0a7dd74876"
+ "reference": "88af747e7af17d8d7d439ad4639dc3e23ddd3edd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/216c111ac427f5f773c6a8bfc0c15f0a7dd74876",
- "reference": "216c111ac427f5f773c6a8bfc0c15f0a7dd74876",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/88af747e7af17d8d7d439ad4639dc3e23ddd3edd",
+ "reference": "88af747e7af17d8d7d439ad4639dc3e23ddd3edd",
"shasum": ""
},
"require": {
@@ -1579,7 +1631,7 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2016-11-27T04:20:28+00:00"
+ "time": "2017-03-04T12:20:59+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -1860,16 +1912,16 @@
},
{
"name": "zendframework/zend-mail",
- "version": "2.7.2",
+ "version": "2.7.3",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-mail.git",
- "reference": "8210faa6865f94962f9a5c76269703bfdcf2fa4c"
+ "reference": "e92b4bc1cf6fe0fdad571bd7b4af2762414d58ff"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-mail/zipball/8210faa6865f94962f9a5c76269703bfdcf2fa4c",
- "reference": "8210faa6865f94962f9a5c76269703bfdcf2fa4c",
+ "url": "https://api.github.com/repos/zendframework/zend-mail/zipball/e92b4bc1cf6fe0fdad571bd7b4af2762414d58ff",
+ "reference": "e92b4bc1cf6fe0fdad571bd7b4af2762414d58ff",
"shasum": ""
},
"require": {
@@ -1881,7 +1933,7 @@
},
"require-dev": {
"phpunit/phpunit": "^4.8",
- "squizlabs/php_codesniffer": "^2.3.1",
+ "zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-config": "^2.6",
"zendframework/zend-crypt": "^2.6",
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3"
@@ -1916,20 +1968,20 @@
"mail",
"zf2"
],
- "time": "2016-12-19T22:46:35+00:00"
+ "time": "2017-02-14T18:03:34+00:00"
},
{
"name": "zendframework/zend-mime",
- "version": "2.6.0",
+ "version": "2.6.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-mime.git",
- "reference": "340769c3d962ac4d9d3cf9da7e75419368e56fcc"
+ "reference": "9e53a97a3c190d45cc5d584daaaf487d509a9285"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/340769c3d962ac4d9d3cf9da7e75419368e56fcc",
- "reference": "340769c3d962ac4d9d3cf9da7e75419368e56fcc",
+ "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/9e53a97a3c190d45cc5d584daaaf487d509a9285",
+ "reference": "9e53a97a3c190d45cc5d584daaaf487d509a9285",
"shasum": ""
},
"require": {
@@ -1937,8 +1989,8 @@
"zendframework/zend-stdlib": "^2.7 || ^3.0"
},
"require-dev": {
- "fabpot/php-cs-fixer": "1.7.*",
- "phpunit/phpunit": "~4.0",
+ "phpunit/phpunit": "^4.7 || ^5.7",
+ "zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-mail": "^2.6"
},
"suggest": {
@@ -1965,7 +2017,7 @@
"mime",
"zf2"
],
- "time": "2016-04-20T21:02:01+00:00"
+ "time": "2017-01-16T16:43:38+00:00"
},
{
"name": "zendframework/zend-stdlib",
@@ -2014,27 +2066,27 @@
},
{
"name": "zendframework/zend-validator",
- "version": "2.8.1",
+ "version": "2.9.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-validator.git",
- "reference": "8ec9f57a717dd37340308aa632f148a2c2be1cfc"
+ "reference": "b71641582297eab52753b72cd4eb45a5ded4485c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/8ec9f57a717dd37340308aa632f148a2c2be1cfc",
- "reference": "8ec9f57a717dd37340308aa632f148a2c2be1cfc",
+ "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/b71641582297eab52753b72cd4eb45a5ded4485c",
+ "reference": "b71641582297eab52753b72cd4eb45a5ded4485c",
"shasum": ""
},
"require": {
"container-interop/container-interop": "^1.1",
- "php": "^5.5 || ^7.0",
- "zendframework/zend-stdlib": "^2.7 || ^3.0"
+ "php": "^5.6 || ^7.0",
+ "zendframework/zend-stdlib": "^2.7.6 || ^3.1"
},
"require-dev": {
- "fabpot/php-cs-fixer": "1.7.*",
- "phpunit/phpunit": "^4.0",
+ "phpunit/phpunit": "^6.0.8 || ^5.7.15",
"zendframework/zend-cache": "^2.6.1",
+ "zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-config": "^2.6",
"zendframework/zend-db": "^2.7",
"zendframework/zend-filter": "^2.6",
@@ -2046,20 +2098,20 @@
"zendframework/zend-uri": "^2.5"
},
"suggest": {
- "zendframework/zend-db": "Zend\\Db component",
+ "zendframework/zend-db": "Zend\\Db component, required by the (No)RecordExists validator",
"zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator",
- "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages as well as to use the various Date validators",
+ "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages",
"zendframework/zend-i18n-resources": "Translations of validator messages",
- "zendframework/zend-math": "Zend\\Math component",
+ "zendframework/zend-math": "Zend\\Math component, required by the Csrf validator",
"zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains",
- "zendframework/zend-session": "Zend\\Session component",
+ "zendframework/zend-session": "Zend\\Session component, required by the Csrf validator",
"zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev",
- "dev-develop": "2.9-dev"
+ "dev-master": "2.9-dev",
+ "dev-develop": "2.10-dev"
},
"zf": {
"component": "Zend\\Validator",
@@ -2081,7 +2133,7 @@
"validator",
"zf2"
],
- "time": "2016-06-23T13:44:31+00:00"
+ "time": "2017-03-17T10:15:50+00:00"
}
],
"packages-dev": [
@@ -2141,20 +2193,20 @@
},
{
"name": "elgg/sniffs",
- "version": "dev-master",
+ "version": "3.x-dev",
"source": {
"type": "git",
"url": "https://github.com/Elgg/elgg-coding-standards.git",
- "reference": "047834f978b1485c6262f2f99998c0ff3a9ed968"
+ "reference": "462f40f55a3c169f6befe8034776147f31d60a0f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Elgg/elgg-coding-standards/zipball/047834f978b1485c6262f2f99998c0ff3a9ed968",
- "reference": "047834f978b1485c6262f2f99998c0ff3a9ed968",
+ "url": "https://api.github.com/repos/Elgg/elgg-coding-standards/zipball/462f40f55a3c169f6befe8034776147f31d60a0f",
+ "reference": "462f40f55a3c169f6befe8034776147f31d60a0f",
"shasum": ""
},
"require": {
- "squizlabs/php_codesniffer": ">=1.3.4"
+ "squizlabs/php_codesniffer": "^2.8.1"
},
"type": "library",
"autoload": {
@@ -2162,9 +2214,12 @@
"Elgg_Sniffs_": "src/"
}
},
- "notification-url": "https://packagist.org/downloads/",
"description": "Elgg coding standards",
- "time": "2015-02-12 23:28:43"
+ "support": {
+ "source": "https://github.com/Elgg/elgg-coding-standards/tree/3.x",
+ "issues": "https://github.com/Elgg/elgg-coding-standards/issues"
+ },
+ "time": "2017-03-21T13:20:20+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
@@ -2217,27 +2272,27 @@
},
{
"name": "phpspec/prophecy",
- "version": "v1.6.2",
+ "version": "v1.7.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "6c52c2722f8460122f96f86346600e1077ce22cb"
+ "reference": "93d39f1f7f9326d746203c7c056f300f7f126073"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb",
- "reference": "6c52c2722f8460122f96f86346600e1077ce22cb",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073",
+ "reference": "93d39f1f7f9326d746203c7c056f300f7f126073",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
- "sebastian/comparator": "^1.1",
- "sebastian/recursion-context": "^1.0|^2.0"
+ "sebastian/comparator": "^1.1|^2.0",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
"require-dev": {
- "phpspec/phpspec": "^2.0",
+ "phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8 || ^5.6.5"
},
"type": "library",
@@ -2276,7 +2331,7 @@
"spy",
"stub"
],
- "time": "2016-11-21T14:58:47+00:00"
+ "time": "2017-03-02T20:05:34+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -2430,25 +2485,30 @@
},
{
"name": "phpunit/php-timer",
- "version": "1.0.8",
+ "version": "1.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3 || ^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4|~5"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
"autoload": {
"classmap": [
"src/"
@@ -2470,20 +2530,20 @@
"keywords": [
"timer"
],
- "time": "2016-05-12T18:03:57+00:00"
+ "time": "2017-02-26T11:10:40+00:00"
},
{
"name": "phpunit/php-token-stream",
- "version": "1.4.9",
+ "version": "1.4.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b"
+ "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b",
- "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7",
+ "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7",
"shasum": ""
},
"require": {
@@ -2519,20 +2579,20 @@
"keywords": [
"tokenizer"
],
- "time": "2016-11-15T14:06:22+00:00"
+ "time": "2017-02-27T10:12:30+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "4.8.31",
+ "version": "4.8.35",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "98b2b39a520766bec663ff5b7ff1b729db9dbfe3"
+ "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/98b2b39a520766bec663ff5b7ff1b729db9dbfe3",
- "reference": "98b2b39a520766bec663ff5b7ff1b729db9dbfe3",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87",
+ "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87",
"shasum": ""
},
"require": {
@@ -2591,7 +2651,7 @@
"testing",
"xunit"
],
- "time": "2016-12-09T02:45:31+00:00"
+ "time": "2017-02-06T05:18:07+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -2651,16 +2711,16 @@
},
{
"name": "sebastian/comparator",
- "version": "1.2.2",
+ "version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f"
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
- "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": ""
},
"require": {
@@ -2711,7 +2771,7 @@
"compare",
"equality"
],
- "time": "2016-11-19T09:18:40+00:00"
+ "time": "2017-01-29T09:50:25+00:00"
},
{
"name": "sebastian/diff",
@@ -2935,16 +2995,16 @@
},
{
"name": "sebastian/recursion-context",
- "version": "1.0.2",
+ "version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
- "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
+ "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": ""
},
"require": {
@@ -2984,7 +3044,7 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "time": "2015-11-11T19:50:13+00:00"
+ "time": "2016-10-03T07:41:43+00:00"
},
{
"name": "sebastian/version",
@@ -3096,32 +3156,35 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "1.5.6",
+ "version": "2.8.1",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5"
+ "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5",
- "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d",
+ "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d",
"shasum": ""
},
"require": {
+ "ext-simplexml": "*",
"ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
"php": ">=5.1.2"
},
- "suggest": {
- "phpunit/php-timer": "dev-master"
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
},
"bin": [
- "scripts/phpcs"
+ "scripts/phpcs",
+ "scripts/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
- "dev-phpcs-fixer": "2.0.x-dev"
+ "dev-master": "2.x-dev"
}
},
"autoload": {
@@ -3130,12 +3193,12 @@
"CodeSniffer/CLI.php",
"CodeSniffer/Exception.php",
"CodeSniffer/File.php",
+ "CodeSniffer/Fixer.php",
"CodeSniffer/Report.php",
"CodeSniffer/Reporting.php",
"CodeSniffer/Sniff.php",
"CodeSniffer/Tokens.php",
"CodeSniffer/Reports/",
- "CodeSniffer/CommentParser/",
"CodeSniffer/Tokenizers/",
"CodeSniffer/DocGenerators/",
"CodeSniffer/Standards/AbstractPatternSniff.php",
@@ -3161,26 +3224,26 @@
"role": "lead"
}
],
- "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "http://www.squizlabs.com/php-codesniffer",
"keywords": [
"phpcs",
"standards"
],
- "time": "2014-12-04T22:32:15+00:00"
+ "time": "2017-03-01T22:17:45+00:00"
},
{
"name": "symfony/yaml",
- "version": "v3.2.1",
+ "version": "v3.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "a7095af4b97a0955f85c8989106c249fa649011f"
+ "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/a7095af4b97a0955f85c8989106c249fa649011f",
- "reference": "a7095af4b97a0955f85c8989106c249fa649011f",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a",
+ "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a",
"shasum": ""
},
"require": {
@@ -3222,7 +3285,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2016-12-10T10:07:06+00:00"
+ "time": "2017-03-07T16:47:02+00:00"
}
],
"aliases": [],
diff --git a/docs/contribute/code.rst b/docs/contribute/code.rst
index d561bab172e..6c8cd969851 100644
--- a/docs/contribute/code.rst
+++ b/docs/contribute/code.rst
@@ -181,6 +181,30 @@ Otherwise you may need to perform an interactive rebase:
4. ``git push -f your_remote your_branch`` to force push the branch (updating your PR).
5. Rename the PR title to match
+
+.. _contribute/code#standards:
+
+Coding Standards
+================
+
+Elgg uses set of standards that are based partially on PEAR and PSR2 standards. You can view the ruleset in ``vendor/elgg/sniffs/elgg.xml``.
+
+To check your code for standard violations (provided you have installed Elgg with dev dependencies), run:
+
+.. code::
+
+ phpcs --standard=vendor/elgg/sniffs/elgg.xml -s path/to/dir/to/check
+
+
+To automatically fix fixable violations, run:
+
+.. code::
+
+ phpcbf --standard=vendor/elgg/sniffs/elgg.xml path/to/dir/to/fix
+
+To check core directories, you can use shortcut ``composer lint`` and ``composer lint-fixer``.
+
+
.. _contribute/code#testing:
Testing
diff --git a/docs/guides/upgrading.rst b/docs/guides/upgrading.rst
index 2f2127675cd..c47a0fd6242 100644
--- a/docs/guides/upgrading.rst
+++ b/docs/guides/upgrading.rst
@@ -155,6 +155,7 @@ Removed classes/interfaces
* ``ImportException``
* ``ODD`` and all classes beginning with ``ODD*``.
* ``XmlElement``
+ * ``Elgg_Notifications_Event``: Use ``\Elgg\Notifications\Event``
Schema changes
--------------
diff --git a/engine/classes/CallException.php b/engine/classes/CallException.php
index 266320710a0..cfe90008e0c 100644
--- a/engine/classes/CallException.php
+++ b/engine/classes/CallException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exceptions.Stub
*/
-class CallException extends \Exception {}
+class CallException extends \Exception {
+}
diff --git a/engine/classes/ClassException.php b/engine/classes/ClassException.php
index e89ab025093..a27e74a50a6 100644
--- a/engine/classes/ClassException.php
+++ b/engine/classes/ClassException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exceptions.Stub
*/
-class ClassException extends \Exception {}
+class ClassException extends \Exception {
+}
diff --git a/engine/classes/ClassNotFoundException.php b/engine/classes/ClassNotFoundException.php
index 8ba4439ede0..a1af7d90efd 100644
--- a/engine/classes/ClassNotFoundException.php
+++ b/engine/classes/ClassNotFoundException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exceptions
*/
-class ClassNotFoundException extends \ClassException {}
+class ClassNotFoundException extends \ClassException {
+}
diff --git a/engine/classes/ConfigurationException.php b/engine/classes/ConfigurationException.php
index ccaca418740..9218867c72d 100644
--- a/engine/classes/ConfigurationException.php
+++ b/engine/classes/ConfigurationException.php
@@ -7,4 +7,5 @@
* @package Elgg
* @subpackage Exceptions.Stub
*/
-class ConfigurationException extends \Exception {}
+class ConfigurationException extends \Exception {
+}
diff --git a/engine/classes/CronException.php b/engine/classes/CronException.php
index d8fb16725b7..1c0ed22eaa0 100644
--- a/engine/classes/CronException.php
+++ b/engine/classes/CronException.php
@@ -7,4 +7,5 @@
* @package Elgg
* @subpackage Exceptions.Stub
*/
-class CronException extends \Exception {}
+class CronException extends \Exception {
+}
diff --git a/engine/classes/DataFormatException.php b/engine/classes/DataFormatException.php
index 27e5873c5e5..419e2ebc4cd 100644
--- a/engine/classes/DataFormatException.php
+++ b/engine/classes/DataFormatException.php
@@ -6,4 +6,5 @@
* @package Elgg.Core
* @subpackage Exceptions.Stub
*/
-class DataFormatException extends \Exception {}
+class DataFormatException extends \Exception {
+}
diff --git a/engine/classes/DatabaseException.php b/engine/classes/DatabaseException.php
index fa2a3ce0e0a..a1b5f35a081 100644
--- a/engine/classes/DatabaseException.php
+++ b/engine/classes/DatabaseException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exceptions.Stub
*/
-class DatabaseException extends \Exception {}
+class DatabaseException extends \Exception {
+}
diff --git a/engine/classes/Elgg/ActionsService.php b/engine/classes/Elgg/ActionsService.php
index 2f63470c88d..d57df9a9cbf 100644
--- a/engine/classes/Elgg/ActionsService.php
+++ b/engine/classes/Elgg/ActionsService.php
@@ -11,7 +11,7 @@
* Use the elgg_* versions instead.
*
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Actions
* @since 1.9.0
@@ -44,11 +44,11 @@ class ActionsService {
*
* @var array
*/
- private $actions = array();
+ private $actions = [];
- /**
+ /**
* The current action being processed
- * @var string
+ * @var string
*/
private $currentAction = null;
@@ -74,7 +74,7 @@ public function __construct(Config $config, ElggSession $session, ElggCrypto $cr
* Executes an action
* If called from action() redirect will be issued by the response factory
* If called as /action page handler response will be handled by \Elgg\Router
- *
+ *
* @param string $action Action name
* @param string $forwarder URL to forward to after completion
* @return ResponseBuilder|null
@@ -90,11 +90,11 @@ public function execute($action, $forwarder = "") {
// remove plugins that are incompatible.
// Login and logout are for convenience.
// file/download (see #2010)
- $exceptions = array(
+ $exceptions = [
'admin/plugins/disable',
'logout',
'file/download',
- );
+ ];
if (!in_array($action, $exceptions)) {
// All actions require a token.
@@ -201,10 +201,10 @@ public function register($action, $filename = "", $access = 'logged_in') {
$access = 'admin';
}
- $this->actions[$action] = array(
+ $this->actions[$action] = [
'file' => $filename,
'access' => $access,
- );
+ ];
return true;
}
@@ -241,10 +241,10 @@ public function validateActionToken($visible_errors = true, $token = null, $ts =
if ($this->validateTokenTimestamp($ts)) {
// We have already got this far, so unless anything
// else says something to the contrary we assume we're ok
- $returnval = _elgg_services()->hooks->trigger('action_gatekeeper:permissions:check', 'all', array(
+ $returnval = _elgg_services()->hooks->trigger('action_gatekeeper:permissions:check', 'all', [
'token' => $token,
'time' => $ts
- ), true);
+ ], true);
if ($returnval) {
return true;
@@ -254,7 +254,7 @@ public function validateActionToken($visible_errors = true, $token = null, $ts =
} else if ($visible_errors) {
// this is necessary because of #5133
if (elgg_is_xhr()) {
- register_error(_elgg_services()->translator->translate('js:security:token_refresh_failed', array($this->config->getSiteUrl())));
+ register_error(_elgg_services()->translator->translate('js:security:token_refresh_failed', [$this->config->getSiteUrl()]));
} else {
register_error(_elgg_services()->translator->translate('actiongatekeeper:timeerror'));
}
@@ -262,7 +262,7 @@ public function validateActionToken($visible_errors = true, $token = null, $ts =
} else if ($visible_errors) {
// this is necessary because of #5133
if (elgg_is_xhr()) {
- register_error(_elgg_services()->translator->translate('js:security:token_refresh_failed', array($this->config->getSiteUrl())));
+ register_error(_elgg_services()->translator->translate('js:security:token_refresh_failed', [$this->config->getSiteUrl()]));
} else {
register_error(_elgg_services()->translator->translate('actiongatekeeper:tokeninvalid'));
}
@@ -273,10 +273,10 @@ public function validateActionToken($visible_errors = true, $token = null, $ts =
$post_count = count($req->request);
if ($length && $post_count < 1) {
// The size of $_POST or uploaded file has exceed the size limit
- $error_msg = _elgg_services()->hooks->trigger('action_gatekeeper:upload_exceeded_msg', 'all', array(
+ $error_msg = _elgg_services()->hooks->trigger('action_gatekeeper:upload_exceeded_msg', 'all', [
'post_size' => $length,
'visible_errors' => $visible_errors,
- ), _elgg_services()->translator->translate('actiongatekeeper:uploadexceeded'));
+ ], _elgg_services()->translator->translate('actiongatekeeper:uploadexceeded'));
} else {
$error_msg = _elgg_services()->translator->translate('actiongatekeeper:missingfields');
}
@@ -290,9 +290,9 @@ public function validateActionToken($visible_errors = true, $token = null, $ts =
/**
* Is the token timestamp within acceptable range?
- *
+ *
* @param int $ts timestamp from the CSRF token
- *
+ *
* @return bool
*/
protected function validateTokenTimestamp($ts) {
@@ -313,7 +313,7 @@ public function getActionTokenTimeout() {
$timeout = 2;
}
$hour = 60 * 60;
- return (int)((float)$timeout * $hour);
+ return (int) ((float) $timeout * $hour);
}
/**
@@ -328,9 +328,9 @@ public function gatekeeper($action) {
}
$token = get_input('__elgg_token');
- $ts = (int)get_input('__elgg_ts');
+ $ts = (int) get_input('__elgg_ts');
if ($token && $this->validateTokenTimestamp($ts)) {
- // The tokens are present and the time looks valid: this is probably a mismatch due to the
+ // The tokens are present and the time looks valid: this is probably a mismatch due to the
// login form being on a different domain.
register_error(_elgg_services()->translator->translate('actiongatekeeper:crosssitelogin'));
_elgg_services()->responseFactory->redirect('login', 'csrf');
@@ -381,7 +381,7 @@ public function generateActionToken($timestamp, $session_token = '') {
}
}
- return _elgg_services()->crypto->getHmac([(int)$timestamp, $session_token], 'md5')
+ return _elgg_services()->crypto->getHmac([(int) $timestamp, $session_token], 'md5')
->getToken();
}
@@ -440,7 +440,7 @@ public function ajaxActionHook() {
/**
* Get all actions
- *
+ *
* @return array
*/
public function getAllActions() {
@@ -461,8 +461,8 @@ public function handleTokenRefreshRequest() {
// the page's session_token might have expired (not matching __elgg_session in the session), but
// we still allow it to be given to validate the tokens in the page.
$session_token = get_input('session_token', null, false);
- $pairs = (array)get_input('pairs', array(), false);
- $valid_tokens = (object)array();
+ $pairs = (array) get_input('pairs', [], false);
+ $valid_tokens = (object) [];
foreach ($pairs as $pair) {
list($ts, $token) = explode(',', $pair, 2);
if ($this->validateTokenOwnership($token, $ts, $session_token)) {
@@ -472,16 +472,16 @@ public function handleTokenRefreshRequest() {
$ts = $this->getCurrentTime()->getTimestamp();
$token = $this->generateActionToken($ts);
- $data = array(
- 'token' => array(
+ $data = [
+ 'token' => [
'__elgg_ts' => $ts,
'__elgg_token' => $token,
'logged_in' => $this->session->isLoggedIn(),
- ),
+ ],
'valid_tokens' => $valid_tokens,
'session_token' => $this->session->get('__elgg_session'),
'user_guid' => $this->session->getLoggedInUserGuid(),
- );
+ ];
elgg_set_http_header("Content-Type: application/json;charset=utf-8");
return elgg_ok_response($data);
diff --git a/engine/classes/Elgg/Ajax/Response.php b/engine/classes/Elgg/Ajax/Response.php
index e7c930695b1..76f50366394 100644
--- a/engine/classes/Elgg/Ajax/Response.php
+++ b/engine/classes/Elgg/Ajax/Response.php
@@ -18,7 +18,7 @@ class Response implements \Elgg\Services\AjaxResponse {
* {@inheritdoc}
*/
public function setTtl($ttl = 0) {
- $this->ttl = (int)max($ttl, 0);
+ $this->ttl = (int) max($ttl, 0);
return $this;
}
diff --git a/engine/classes/Elgg/Ajax/Service.php b/engine/classes/Elgg/Ajax/Service.php
index cdb93825c87..5d8730d5061 100644
--- a/engine/classes/Elgg/Ajax/Service.php
+++ b/engine/classes/Elgg/Ajax/Service.php
@@ -118,7 +118,7 @@ public function respondFromOutput($output, $hook_type = '', $try_decode = true)
}
$api_response = new Response();
- $api_response->setData((object)[
+ $api_response->setData((object) [
'value' => $output,
]);
$api_response = $this->filterApiResponse($api_response, $hook_type);
@@ -238,7 +238,7 @@ public function prepareResponse($hook, $type, $response, $params) {
}
if ($this->input->get('elgg_fetch_messages', true)) {
- $response->getData()->_elgg_msgs = (object)$this->msgs->dumpRegister();
+ $response->getData()->_elgg_msgs = (object) $this->msgs->dumpRegister();
}
if ($this->input->get('elgg_fetch_deps', true)) {
@@ -276,4 +276,4 @@ public function getViews() {
return array_keys($this->allowed_views);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Amd/Config.php b/engine/classes/Elgg/Amd/Config.php
index 6ee2631a9f8..0cd9dc83d5a 100644
--- a/engine/classes/Elgg/Amd/Config.php
+++ b/engine/classes/Elgg/Amd/Config.php
@@ -6,14 +6,14 @@
*
* @package Elgg.Core
* @subpackage JavaScript
- *
+ *
* @access private
*/
class Config {
private $baseUrl = '';
- private $paths = array();
- private $shim = array();
- private $dependencies = array();
+ private $paths = [];
+ private $shim = [];
+ private $dependencies = [];
/**
* @var \Elgg\PluginHooksService
@@ -53,7 +53,7 @@ public function addPath($name, $path) {
}
if (!isset($this->paths[$name])) {
- $this->paths[$name] = array();
+ $this->paths[$name] = [];
}
array_unshift($this->paths[$name], $path);
@@ -94,14 +94,14 @@ public function removePath($name, $path = null) {
* @throws \InvalidParameterException
*/
public function addShim($name, array $config) {
- $deps = elgg_extract('deps', $config, array());
+ $deps = elgg_extract('deps', $config, []);
$exports = elgg_extract('exports', $config);
if (empty($deps) && empty($exports)) {
throw new \InvalidParameterException("Shimmed modules must have deps or exports");
}
- $this->shim[$name] = array();
+ $this->shim[$name] = [];
if (!empty($deps)) {
$this->shim[$name]['deps'] = $deps;
@@ -182,9 +182,9 @@ public function hasDependency($name) {
*
* @return void
*/
- public function addModule($name, array $config = array()) {
+ public function addModule($name, array $config = []) {
$url = elgg_extract('url', $config);
- $deps = elgg_extract('deps', $config, array());
+ $deps = elgg_extract('deps', $config, []);
$exports = elgg_extract('exports', $config);
if (!empty($url)) {
@@ -241,17 +241,17 @@ public function hasModule($name) {
* @return array
*/
public function getConfig() {
- $defaults = array(
+ $defaults = [
'baseUrl' => $this->baseUrl,
'paths' => $this->paths,
'shim' => $this->shim,
'deps' => $this->getDependencies(),
'waitSeconds' => 20,
- );
+ ];
- $params = array(
+ $params = [
'defaults' => $defaults
- );
+ ];
return $this->hooks->trigger('config', 'amd', $params, $defaults);
}
diff --git a/engine/classes/Elgg/Amd/ViewFilter.php b/engine/classes/Elgg/Amd/ViewFilter.php
index 9534395dc0f..e628022854d 100644
--- a/engine/classes/Elgg/Amd/ViewFilter.php
+++ b/engine/classes/Elgg/Amd/ViewFilter.php
@@ -3,21 +3,21 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* This filter adds AMD names to anonymous AMD modules defined in views.
- *
+ *
* @package Elgg.Core
* @subpackage JavaScript
* @since 1.9
- *
+ *
* @access private
*/
class ViewFilter {
/**
* Given the view name, returns the AMD name.
- *
+ *
* @param string $name The name of the view (e.g., 'elgg/module.js')
- *
+ *
* @return string The AMD name (e.g., 'elgg/module'), or blank for no AMD name.
*/
private function getAmdName($name) {
@@ -43,10 +43,10 @@ private function getAmdName($name) {
/**
* Inserts the AMD name into `$content` and returns the new value.
- *
+ *
* @param string $viewName The name of the view.
* @param string $content The output of the view to be filtered.
- *
+ *
* @return string The new content with the AMD name inserted, if applicable.
*/
public function filter($viewName, $content) {
diff --git a/engine/classes/Elgg/Application.php b/engine/classes/Elgg/Application.php
index a8d14183732..40886b4dcbf 100644
--- a/engine/classes/Elgg/Application.php
+++ b/engine/classes/Elgg/Application.php
@@ -128,7 +128,7 @@ public function loadCore() {
// load the rest of the library files from engine/lib/
// All on separate lines to make diffs easy to read + make it apparent how much
// we're actually loading on every page (Hint: it's too much).
- $lib_files = array(
+ $lib_files = [
// Needs to be loaded first to correctly bootstrap
'autoloader.php',
'elgglib.php',
@@ -178,12 +178,12 @@ public function loadCore() {
// backward compatibility
'deprecated-2.1.php',
'deprecated-3.0.php',
- );
+ ];
// isolate global scope
call_user_func(function () use ($lib_dir, $lib_files) {
- $setups = array();
+ $setups = [];
// include library files, capturing setup functions
foreach ($lib_files as $file) {
@@ -511,7 +511,7 @@ public static function upgrade() {
// turn any full in-site URLs into absolute paths
$forward_url = get_input('forward', '/admin', false);
- $forward_url = str_replace(array($site_url, $site_host), '/', $forward_url);
+ $forward_url = str_replace([$site_url, $site_host], '/', $forward_url);
if (strpos($forward_url, '/') !== 0) {
$forward_url = '/' . $forward_url;
@@ -561,9 +561,9 @@ public static function upgrade() {
exit;
}
- $vars = array(
+ $vars = [
'forward' => $forward_url
- );
+ ];
// reset cache to have latest translations available during upgrade
elgg_reset_system_cache();
@@ -583,7 +583,7 @@ public static function upgrade() {
private function setupPath() {
if (!isset($_GET[self::GET_PATH_KEY]) || is_array($_GET[self::GET_PATH_KEY])) {
if (php_sapi_name() === 'cli-server') {
- $_GET[self::GET_PATH_KEY] = (string)parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+ $_GET[self::GET_PATH_KEY] = (string) parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
} else {
$_GET[self::GET_PATH_KEY] = '/';
}
@@ -613,7 +613,7 @@ private function allowPathRewrite() {
/**
* Flag this application as running for testing (PHPUnit)
- *
+ *
* @param bool $testing Is testing application
* @return void
*/
diff --git a/engine/classes/Elgg/Application/CacheHandler.php b/engine/classes/Elgg/Application/CacheHandler.php
index c755a5e5350..a3980939fd5 100644
--- a/engine/classes/Elgg/Application/CacheHandler.php
+++ b/engine/classes/Elgg/Application/CacheHandler.php
@@ -100,7 +100,6 @@ public function handleRequest($path) {
// we can't use $config->get yet. It fails before the core is booted
if (!$config->getVolatile('simplecache_enabled')) {
-
$this->application->bootCore();
if (!$this->isCacheableView($view)) {
@@ -135,7 +134,7 @@ public function handleRequest($path) {
$this->send403("Requested view is not an asset");
}
- $lastcache = (int)$config->get('lastcache');
+ $lastcache = (int) $config->get('lastcache');
$filename = $config->getVolatile('cacheroot') . "views_simplecache/$lastcache/$viewtype/$view";
@@ -168,25 +167,25 @@ public function handleRequest($path) {
public function parsePath($path) {
// no '..'
if (false !== strpos($path, '..')) {
- return array();
+ return [];
}
// only alphanumeric characters plus /, ., -, and _
if (preg_match('#[^a-zA-Z0-9/\.\-_]#', $path)) {
- return array();
+ return [];
}
// testing showed regex to be marginally faster than array / string functions over 100000 reps
// it won't make a difference in real life and regex is easier to read.
// //.
if (!preg_match('#^/cache/([0-9]+)/([^/]+)/(.+)$#', $path, $matches)) {
- return array();
+ return [];
}
- return array(
+ return [
'ts' => $matches[1],
'viewtype' => $matches[2],
'view' => $matches[3],
- );
+ ];
}
/**
@@ -351,11 +350,11 @@ protected function getProcessedView($view, $viewtype) {
$content = $this->renderView($view, $viewtype);
$hook_type = $this->getViewFileType($view);
- $hook_params = array(
+ $hook_params = [
'view' => $view,
'viewtype' => $viewtype,
'view_content' => $content,
- );
+ ];
return \_elgg_services()->hooks->trigger('simplecache:generate', $hook_type, $hook_params, $content);
}
diff --git a/engine/classes/Elgg/Application/ServeFileHandler.php b/engine/classes/Elgg/Application/ServeFileHandler.php
index 925b9df5e5d..295ee2b4cae 100644
--- a/engine/classes/Elgg/Application/ServeFileHandler.php
+++ b/engine/classes/Elgg/Application/ServeFileHandler.php
@@ -63,13 +63,13 @@ public function getResponse(Request $request) {
return $response->setStatusCode(403)->setContent('URL has expired');
}
- $hmac_data = array(
+ $hmac_data = [
'expires' => (int) $expires,
'last_updated' => (int) $last_updated,
'disposition' => $disposition,
'path' => $path_from_dataroot,
'use_cookie' => (int) $use_cookie,
- );
+ ];
if ((bool) $use_cookie) {
$hmac_data['cookie'] = $this->getCookieValue($request);
}
@@ -121,7 +121,7 @@ public function getResponse(Request $request) {
if ($sendfile_type) {
$request->headers->set('X-Sendfile-Type', $sendfile_type);
- $mapping = (string)$this->config->getVolatile('X-Accel-Mapping');
+ $mapping = (string) $this->config->getVolatile('X-Accel-Mapping');
$request->headers->set('X-Accel-Mapping', $mapping);
$response->trustXSendfileTypeHeader();
diff --git a/engine/classes/Elgg/Assets/ExternalFiles.php b/engine/classes/Elgg/Assets/ExternalFiles.php
index fedca185374..3c350333b9f 100644
--- a/engine/classes/Elgg/Assets/ExternalFiles.php
+++ b/engine/classes/Elgg/Assets/ExternalFiles.php
@@ -61,7 +61,7 @@ public function register($type, $name, $url, $location, $priority = 500) {
}
// no negative priorities right now.
- $priority = max((int)$priority, 0);
+ $priority = max((int) $priority, 0);
$item = elgg_extract($name, $GLOBALS['_ELGG']->externals_map[$type]);
@@ -178,7 +178,7 @@ public function getLoadedFiles($type, $location) {
}
return $items;
}
- return array();
+ return [];
}
/**
@@ -190,7 +190,7 @@ public function getLoadedFiles($type, $location) {
protected function bootstrap($type) {
if (!isset($GLOBALS['_ELGG']->externals)) {
- $GLOBALS['_ELGG']->externals = array();
+ $GLOBALS['_ELGG']->externals = [];
}
if (!isset($GLOBALS['_ELGG']->externals[$type]) || !$GLOBALS['_ELGG']->externals[$type] instanceof \ElggPriorityList) {
@@ -198,11 +198,11 @@ protected function bootstrap($type) {
}
if (!isset($GLOBALS['_ELGG']->externals_map)) {
- $GLOBALS['_ELGG']->externals_map = array();
+ $GLOBALS['_ELGG']->externals_map = [];
}
if (!isset($GLOBALS['_ELGG']->externals_map[$type])) {
- $GLOBALS['_ELGG']->externals_map[$type] = array();
+ $GLOBALS['_ELGG']->externals_map[$type] = [];
}
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/AttributeLoader.php b/engine/classes/Elgg/AttributeLoader.php
index 2aed43d1e38..586d82dc993 100644
--- a/engine/classes/Elgg/AttributeLoader.php
+++ b/engine/classes/Elgg/AttributeLoader.php
@@ -16,7 +16,7 @@ class AttributeLoader {
*
* @todo require this to be injected and get it from \ElggEntity
*/
- protected static $primary_attr_names = array(
+ protected static $primary_attr_names = [
'guid',
'type',
'subtype',
@@ -27,12 +27,12 @@ class AttributeLoader {
'time_updated',
'last_action',
'enabled',
- );
+ ];
/**
* @var array names of attributes in all entities that should be stored as integer values
*/
- protected static $integer_attr_names = array(
+ protected static $integer_attr_names = [
'guid',
'owner_guid',
'container_guid',
@@ -44,22 +44,22 @@ class AttributeLoader {
'prev_last_action',
'last_login',
'prev_last_login'
- );
+ ];
/**
* @var array names of attributes in all entities that should be stored as null if empty
*/
- protected static $null_attr_names = array(
+ protected static $null_attr_names = [
'name',
'title',
'description',
'url',
- );
+ ];
/**
* @var array names of secondary attributes required for the entity
*/
- protected $secondary_attr_names = array();
+ protected $secondary_attr_names = [];
/**
* @var string entity type (not class) required for fetched primaries
@@ -99,7 +99,7 @@ class AttributeLoader {
/**
* @var array retrieved values that are not attributes
*/
- protected $additional_select_values = array();
+ protected $additional_select_values = [];
/**
* Constructor
@@ -132,7 +132,7 @@ public function __construct($class, $required_type, array $initialized_attrs) {
* @return array
*/
protected function isMissingPrimaries($row) {
- return array_diff(self::$primary_attr_names, array_keys($row)) !== array();
+ return array_diff(self::$primary_attr_names, array_keys($row)) !== [];
}
/**
@@ -142,7 +142,7 @@ protected function isMissingPrimaries($row) {
* @return array
*/
protected function isMissingSecondaries($row) {
- return array_diff($this->secondary_attr_names, array_keys($row)) !== array();
+ return array_diff($this->secondary_attr_names, array_keys($row)) !== [];
}
/**
@@ -184,7 +184,7 @@ public function getAdditionalSelectValues() {
public function getRequiredAttributes($row) {
if (!is_array($row) && !($row instanceof \stdClass)) {
// assume row is the GUID
- $row = array('guid' => $row);
+ $row = ['guid' => $row];
}
$row = (array) $row;
if (empty($row['guid'])) {
@@ -198,7 +198,7 @@ public function getRequiredAttributes($row) {
if (($was_missing_primaries || $was_missing_secondaries) && is_callable($this->full_loader)) {
$fetched = (array) call_user_func($this->full_loader, $row['guid']);
if (!$fetched) {
- return array();
+ return [];
}
$row = array_merge($row, $fetched);
$this->checkType($row);
@@ -215,7 +215,7 @@ public function getRequiredAttributes($row) {
elgg_set_ignore_access($ignoring_access);
}
if (!$fetched) {
- return array();
+ return [];
}
$row = array_merge($row, $fetched);
}
@@ -238,7 +238,7 @@ public function getRequiredAttributes($row) {
$row = $this->filterAddedColumns($row);
- $row['subtype'] = (int)$row['subtype'];
+ $row['subtype'] = (int) $row['subtype'];
// set to null when reading empty value, to match default empty value; See #5456
foreach (self::$null_attr_names as $key) {
diff --git a/engine/classes/Elgg/AutoloadManager.php b/engine/classes/Elgg/AutoloadManager.php
index b9b88e69131..86ed2111362 100644
--- a/engine/classes/Elgg/AutoloadManager.php
+++ b/engine/classes/Elgg/AutoloadManager.php
@@ -4,7 +4,7 @@
* Manages core autoloading and caching of class maps
*
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Autoloader
*/
@@ -22,7 +22,7 @@ class AutoloadManager {
/**
* @var array directories that have already been scanned for classes
*/
- protected $scannedDirs = array();
+ protected $scannedDirs = [];
/**
* @var bool was data in the manager altered?
@@ -36,7 +36,7 @@ class AutoloadManager {
/**
* Constructor
- *
+ *
* @param \Elgg\ClassLoader $loader Class loader object
*/
public function __construct(\Elgg\ClassLoader $loader) {
@@ -75,7 +75,7 @@ public function addClasses($dir) {
*/
protected function scanClassesDir($dir) {
$dir = new \DirectoryIterator($dir);
- $map = array();
+ $map = [];
foreach ($dir as $file) {
/* @var \SplFileInfo $file */
@@ -146,7 +146,7 @@ public function loadCache() {
/**
* Some method that does something
- *
+ *
* @todo what is a spec?
* @return bool|array
*/
@@ -177,7 +177,7 @@ public function deleteCache() {
/**
* Get the class loader
- *
+ *
* @return \Elgg\ClassLoader
*/
public function getLoader() {
@@ -186,7 +186,7 @@ public function getLoader() {
/**
* Set the cache storage object
- *
+ *
* @param \ElggCache $storage Cache object
* @return void
*/
diff --git a/engine/classes/Elgg/BatchResult.php b/engine/classes/Elgg/BatchResult.php
index 24fb6af9f18..876725baaf8 100644
--- a/engine/classes/Elgg/BatchResult.php
+++ b/engine/classes/Elgg/BatchResult.php
@@ -6,4 +6,5 @@
*
* @since 2.3
*/
-interface BatchResult extends \Countable, \Iterator {}
+interface BatchResult extends \Countable, \Iterator {
+}
diff --git a/engine/classes/Elgg/BatchUpgrader.php b/engine/classes/Elgg/BatchUpgrader.php
index 676c5ddb02c..ff72ec8aa09 100644
--- a/engine/classes/Elgg/BatchUpgrader.php
+++ b/engine/classes/Elgg/BatchUpgrader.php
@@ -69,7 +69,6 @@ public function run(ElggUpgrade $upgrade) {
$has_errors = (bool) $upgrade->has_errors;
while ($count > $processed && (microtime(true) - $started) < $this->config->get('batch_run_time_in_secs')) {
-
$result = $batch->run(new Result(), $offset);
$failure_count = $result->getFailureCount();
@@ -124,11 +123,11 @@ public function run(ElggUpgrade $upgrade) {
}
// Give feedback to the user interface about the current batch.
- return array(
+ return [
'errors' => $errors,
'numErrors' => $batch_failure_count,
'numSuccess' => $batch_success_count,
- );
+ ];
}
}
diff --git a/engine/classes/Elgg/BootData.php b/engine/classes/Elgg/BootData.php
index b516858e99c..94ac45b5fb5 100644
--- a/engine/classes/Elgg/BootData.php
+++ b/engine/classes/Elgg/BootData.php
@@ -122,7 +122,7 @@ public function populate(\stdClass $config, Database $db, EntityTable $entities,
HAVING COUNT(*) > $limit
";
$unsuitable_guids = $db->getData($sql, function ($row) {
- return (int)$row->entity_guid;
+ return (int) $row->entity_guid;
});
$guids = array_values($guids);
$guids = array_diff($guids, $unsuitable_guids);
diff --git a/engine/classes/Elgg/BootService.php b/engine/classes/Elgg/BootService.php
index b2389f05aff..d49195f9fcf 100644
--- a/engine/classes/Elgg/BootService.php
+++ b/engine/classes/Elgg/BootService.php
@@ -79,7 +79,7 @@ public function boot() {
if (!$GLOBALS['_ELGG']->dataroot_in_settings) {
$CONFIG->dataroot = rtrim($configs['dataroot'], '/\\') . DIRECTORY_SEPARATOR;
}
- $CONFIG->site_guid = (int)$configs['default_site'];
+ $CONFIG->site_guid = (int) $configs['default_site'];
if (!isset($CONFIG->boot_cache_ttl)) {
$CONFIG->boot_cache_ttl = self::DEFAULT_BOOT_CACHE_TTL;
}
@@ -122,7 +122,7 @@ public function boot() {
$CONFIG->system_cache_enabled = ($system_cache_enabled === false) ? 1 : $system_cache_enabled;
// needs to be set before [init, system] for links in html head
- $CONFIG->lastcache = (int)$configs_cache['simplecache_lastupdate'];
+ $CONFIG->lastcache = (int) $configs_cache['simplecache_lastupdate'];
$GLOBALS['_ELGG']->i18n_loaded_from_cache = false;
diff --git a/engine/classes/Elgg/Cache/EntityCache.php b/engine/classes/Elgg/Cache/EntityCache.php
index 9467303c639..2aa9332d3fd 100644
--- a/engine/classes/Elgg/Cache/EntityCache.php
+++ b/engine/classes/Elgg/Cache/EntityCache.php
@@ -69,7 +69,7 @@ public function get($guid) {
/**
* Returns cached user entity by username
- *
+ *
* @param string $username Username
* @return \ElggUser|false
*/
@@ -119,7 +119,7 @@ public function set(ElggEntity $entity) {
* @return void
*/
public function remove($guid) {
- $guid = (int)$guid;
+ $guid = (int) $guid;
if (!isset($this->entities[$guid])) {
return;
diff --git a/engine/classes/Elgg/Cache/LRUCache.php b/engine/classes/Elgg/Cache/LRUCache.php
index 9c0670005a6..89c33227340 100644
--- a/engine/classes/Elgg/Cache/LRUCache.php
+++ b/engine/classes/Elgg/Cache/LRUCache.php
@@ -6,11 +6,11 @@
*
* A fixed sized cache that removes the element used last when it reaches its
* size limit.
- *
+ *
* Based on https://github.com/cash/LRUCache
- *
+ *
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Cache
*/
@@ -23,7 +23,7 @@ class LRUCache implements \ArrayAccess {
*
* @var array
*/
- protected $data = array();
+ protected $data = [];
/**
* Create a LRU Cache
@@ -112,16 +112,16 @@ public function remove($key) {
/**
* Clear the cache
- *
+ *
* @return void
*/
public function clear() {
- $this->data = array();
+ $this->data = [];
}
/**
* Moves the element from current position to end of array
- *
+ *
* @param int|string $key The key
* @return void
*/
diff --git a/engine/classes/Elgg/Cache/MetadataCache.php b/engine/classes/Elgg/Cache/MetadataCache.php
index ea945e24bf1..175ba550fe7 100644
--- a/engine/classes/Elgg/Cache/MetadataCache.php
+++ b/engine/classes/Elgg/Cache/MetadataCache.php
@@ -13,7 +13,7 @@ class MetadataCache {
*
* @var array
*/
- protected $values = array();
+ protected $values = [];
/**
* @var \ElggSession
@@ -101,7 +101,7 @@ public function isLoaded($entity_guid) {
* @return void
*/
public function clearAll() {
- $this->values = array();
+ $this->values = [];
}
/**
@@ -139,7 +139,7 @@ public function populateFromEntities($guids) {
$access_key = $this->getAccessKey();
if (!is_array($guids)) {
- $guids = array($guids);
+ $guids = [$guids];
}
$guids = array_unique($guids);
@@ -147,7 +147,7 @@ public function populateFromEntities($guids) {
//$guids = $this->filterMetadataHeavyEntities($guids);
$db_prefix = _elgg_services()->db->prefix;
- $options = array(
+ $options = [
'guids' => $guids,
'limit' => 0,
'callback' => false,
@@ -155,11 +155,11 @@ public function populateFromEntities($guids) {
'order_by' => 'n_table.entity_guid, n_table.time_created ASC, n_table.id ASC',
// @todo don't know why this is necessary
- 'wheres' => array(_elgg_get_access_where_sql(array(
+ 'wheres' => [_elgg_get_access_where_sql([
'table_alias' => 'n_table',
'guid_column' => 'entity_guid',
- ))),
- );
+ ])],
+ ];
$data = _elgg_services()->metadataTable->getAll($options);
// make sure we show all entities as loaded
@@ -169,7 +169,7 @@ public function populateFromEntities($guids) {
// build up metadata for each entity, save when GUID changes (or data ends)
$last_guid = null;
- $metadata = array();
+ $metadata = [];
$last_row_idx = count($data) - 1;
foreach ($data as $i => $row) {
$name = $row->name;
@@ -179,7 +179,7 @@ public function populateFromEntities($guids) {
if ($last_guid) {
$this->values[$access_key][$last_guid] = $metadata;
}
- $metadata = array();
+ $metadata = [];
}
if (isset($metadata[$name])) {
$metadata[$name] = (array) $metadata[$name];
@@ -206,14 +206,14 @@ public function populateFromEntities($guids) {
public function filterMetadataHeavyEntities(array $guids, $limit = 1024000) {
$db_prefix = _elgg_services()->config->get('dbprefix');
- $options = array(
+ $options = [
'guids' => $guids,
'limit' => 0,
'callback' => false,
- 'selects' => array('SUM(LENGTH(n_table.value)) AS bytes'),
+ 'selects' => ['SUM(LENGTH(n_table.value)) AS bytes'],
'order_by' => 'n_table.entity_guid, n_table.time_created ASC',
'group_by' => 'n_table.entity_guid',
- );
+ ];
$data = _elgg_services()->metadataTable->getAll($options);
// don't cache if metadata for entity is over 10MB (or rolled INT)
foreach ($data as $row) {
@@ -233,6 +233,6 @@ protected function getAccessKey() {
if ($this->session->getIgnoreAccess()) {
return "ignored";
}
- return (string)$this->session->getLoggedInUserGuid();
+ return (string) $this->session->getLoggedInUserGuid();
}
}
diff --git a/engine/classes/Elgg/Cache/PluginSettingsCache.php b/engine/classes/Elgg/Cache/PluginSettingsCache.php
index b7d3dec3e16..db97f4c8dae 100644
--- a/engine/classes/Elgg/Cache/PluginSettingsCache.php
+++ b/engine/classes/Elgg/Cache/PluginSettingsCache.php
@@ -16,7 +16,7 @@ class PluginSettingsCache {
*
* @var array GUID => string[]
*/
- private $values = array();
+ private $values = [];
/**
* Set the settings cache for known plugins
diff --git a/engine/classes/Elgg/Cache/Pool.php b/engine/classes/Elgg/Cache/Pool.php
index f1a245f352d..0e1fbfc9406 100644
--- a/engine/classes/Elgg/Cache/Pool.php
+++ b/engine/classes/Elgg/Cache/Pool.php
@@ -4,10 +4,10 @@
/**
* Represents a group of key-value pairs whose values can be invalidated,
* forcing a recalculation of the value.
- *
+ *
* Exactly how/when the values are invalidated is not specified by this API,
* except that specific values can be forcefully invalidated with ::invalidate().
- *
+ *
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* @package Elgg
@@ -19,39 +19,39 @@
interface Pool {
/**
* Fetches a value from the cache, with the option of calculating on miss
- *
+ *
* @param string|int $key A plain string ID for the cache entry
* @param callable|null $callback Logic for calculating the cache entry on miss
* @param mixed $default Default value returned if the value is missing and no callback is provided
- *
+ *
* @return mixed The cache value or the $default if no value and no callable
*/
public function get($key, callable $callback = null, $default = null);
/**
* Forcefully invalidates the value associated with the given key.
- *
+ *
* Implementations must:
* * Immediately consider the value stale
* * Recalculate the value at the next opportunity
- *
+ *
* @param string|int $key A plain string ID for the cache entry to invalidate.
- *
+ *
* @return void
*/
public function invalidate($key);
/**
* Prime the cache to a specific value.
- *
+ *
* This is useful when the value was calculated by some out-of-band means.
* For example, when a list of rows is fetched from the database, you can
* prime the cache for each individual result.
- *
+ *
* @param string|int $key A plain string ID for the cache entry
* @param mixed $value The cache value
- *
+ *
* @return void
*/
public function put($key, $value);
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Cache/Pool/InMemory.php b/engine/classes/Elgg/Cache/Pool/InMemory.php
index 5967d548655..2f76e38a65d 100644
--- a/engine/classes/Elgg/Cache/Pool/InMemory.php
+++ b/engine/classes/Elgg/Cache/Pool/InMemory.php
@@ -6,9 +6,9 @@
/**
* An in-memory implementation of a cache pool.
- *
+ *
* NB: Data put into this cache is not persisted between requests.
- *
+ *
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* @since 1.10.0
@@ -19,7 +19,7 @@ final class InMemory implements Pool {
/**
* @var array
*/
- private $values = array();
+ private $values = [];
/** @inheritDoc */
public function get($key, callable $callback = null, $default = null) {
diff --git a/engine/classes/Elgg/Cache/Pool/Noop.php b/engine/classes/Elgg/Cache/Pool/Noop.php
index 3aa1fd97f7b..2819bf4eaa4 100644
--- a/engine/classes/Elgg/Cache/Pool/Noop.php
+++ b/engine/classes/Elgg/Cache/Pool/Noop.php
@@ -32,4 +32,4 @@ public function invalidate($key) {
public function put($key, $value) {
// values are always expired, so nothing to do
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Cache/Pool/StashWrapper.php b/engine/classes/Elgg/Cache/Pool/StashWrapper.php
index 0a337f7a8b6..3c84b1af717 100644
--- a/engine/classes/Elgg/Cache/Pool/StashWrapper.php
+++ b/engine/classes/Elgg/Cache/Pool/StashWrapper.php
@@ -7,7 +7,7 @@
/**
* Defers to Stash for the meat of the caching logic.
- *
+ *
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* @since 1.10.0
@@ -32,7 +32,7 @@ public function __construct(Stash\Pool $stash) {
public function get($key, callable $callback = null, $default = null) {
assert(is_string($key) || is_int($key));
- $item = $this->stash->getItem((string)$key);
+ $item = $this->stash->getItem((string) $key);
$result = $item->get();
@@ -55,14 +55,14 @@ public function get($key, callable $callback = null, $default = null) {
public function invalidate($key) {
assert(is_string($key) || is_int($key));
- $this->stash->getItem((string)$key)->clear();
+ $this->stash->getItem((string) $key)->clear();
}
/** @inheritDoc */
public function put($key, $value) {
assert(is_string($key) || is_int($key));
- $this->stash->getItem((string)$key)->set($value);
+ $this->stash->getItem((string) $key)->set($value);
}
/**
@@ -73,4 +73,4 @@ public function put($key, $value) {
public static function createEphemeral() {
return new self(new Stash\Pool(new Stash\Driver\Ephemeral()));
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Cache/SimpleCache.php b/engine/classes/Elgg/Cache/SimpleCache.php
index 62f1f5f2c6c..ce18c797477 100644
--- a/engine/classes/Elgg/Cache/SimpleCache.php
+++ b/engine/classes/Elgg/Cache/SimpleCache.php
@@ -102,7 +102,7 @@ function getUrl($view, $subview = '') {
function getRoot() {
$viewtype = elgg_get_viewtype();
if ($this->isEnabled()) {
- $lastcache = (int)$this->config->get('lastcache');
+ $lastcache = (int) $this->config->get('lastcache');
} else {
$lastcache = 0;
}
@@ -180,7 +180,7 @@ function invalidate() {
function init() {
$lastcache = $this->config->get('lastcache');
if (!defined('UPGRADING') && empty($lastcache)) {
- $this->config->set('lastcache', (int)$this->config->get('simplecache_lastupdate'));
+ $this->config->set('lastcache', (int) $this->config->get('simplecache_lastupdate'));
}
}
}
diff --git a/engine/classes/Elgg/Cache/SystemCache.php b/engine/classes/Elgg/Cache/SystemCache.php
index 1a32361c3a0..8363ed873d4 100644
--- a/engine/classes/Elgg/Cache/SystemCache.php
+++ b/engine/classes/Elgg/Cache/SystemCache.php
@@ -85,7 +85,7 @@ function load($type) {
* @return bool
*/
function isEnabled() {
- return (bool)$this->config->getVolatile('system_cache_enabled');
+ return (bool) $this->config->getVolatile('system_cache_enabled');
}
/**
@@ -165,7 +165,6 @@ function init() {
}
if (!$GLOBALS['_ELGG']->i18n_loaded_from_cache) {
-
_elgg_services()->translator->reloadAllTranslations();
foreach ($GLOBALS['_ELGG']->translations as $lang => $map) {
@@ -173,4 +172,4 @@ function init() {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/ClassLoader.php b/engine/classes/Elgg/ClassLoader.php
index 62ed2d1f8e8..d99fd961213 100644
--- a/engine/classes/Elgg/ClassLoader.php
+++ b/engine/classes/Elgg/ClassLoader.php
@@ -48,9 +48,9 @@
*/
class ClassLoader {
- protected $namespaces = array();
- protected $prefixes = array();
- protected $fallbacks = array();
+ protected $namespaces = [];
+ protected $prefixes = [];
+ protected $fallbacks = [];
/**
* @var \Elgg\ClassMap Map of classes to files
@@ -59,7 +59,7 @@ class ClassLoader {
/**
* Constructor
- *
+ *
* @param \Elgg\ClassMap $map Class map
*/
public function __construct(\Elgg\ClassMap $map) {
@@ -68,7 +68,7 @@ public function __construct(\Elgg\ClassMap $map) {
/**
* Get the class map
- *
+ *
* @return \Elgg\ClassMap
*/
public function getClassMap() {
@@ -101,7 +101,7 @@ public function getPrefixes() {
*/
public function registerNamespaces(array $namespaces) {
foreach ($namespaces as $namespace => $locations) {
- $this->namespaces[$namespace] = (array)$locations;
+ $this->namespaces[$namespace] = (array) $locations;
}
}
@@ -113,7 +113,7 @@ public function registerNamespaces(array $namespaces) {
* @return void
*/
public function registerNamespace($namespace, $paths) {
- $this->namespaces[$namespace] = (array)$paths;
+ $this->namespaces[$namespace] = (array) $paths;
}
/**
@@ -124,7 +124,7 @@ public function registerNamespace($namespace, $paths) {
*/
public function registerPrefixes(array $classes) {
foreach ($classes as $prefix => $locations) {
- $this->prefixes[$prefix] = (array)$locations;
+ $this->prefixes[$prefix] = (array) $locations;
}
}
@@ -136,7 +136,7 @@ public function registerPrefixes(array $classes) {
* @return void
*/
public function registerPrefix($prefix, $paths) {
- $this->prefixes[$prefix] = (array)$paths;
+ $this->prefixes[$prefix] = (array) $paths;
}
/**
@@ -151,11 +151,11 @@ public function addFallback($path) {
/**
* Registers this instance as an autoloader.
- *
+ *
* @return void
*/
public function register() {
- spl_autoload_register(array($this, 'loadClass'));
+ spl_autoload_register([$this, 'loadClass']);
}
/**
@@ -211,7 +211,6 @@ public function findFile($class) {
}
}
}
-
} else {
// PEAR-like class name
$normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
diff --git a/engine/classes/Elgg/ClassMap.php b/engine/classes/Elgg/ClassMap.php
index 60815852972..e32ca14b7fe 100644
--- a/engine/classes/Elgg/ClassMap.php
+++ b/engine/classes/Elgg/ClassMap.php
@@ -4,7 +4,7 @@
* A map of class names to absolute file paths
*
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Autoloader
*/
@@ -13,7 +13,7 @@ class ClassMap {
/**
* @var array
*/
- protected $map = array();
+ protected $map = [];
/**
* @var bool
@@ -62,7 +62,7 @@ public function getAltered() {
/**
* Set the altered flag
- *
+ *
* @param bool $altered Whether the class map has been altered
* @return \Elgg\ClassMap
*/
@@ -94,7 +94,7 @@ public function setMap(array $map) {
/**
* Merge a class map with the current map
- *
+ *
* @param array $map array with keys being class/interface/trait names and
* values the absolute file paths that define them
* @return \Elgg\ClassMap
diff --git a/engine/classes/Elgg/CommitMessage.php b/engine/classes/Elgg/CommitMessage.php
index 44abf6829f9..aadb52beb96 100644
--- a/engine/classes/Elgg/CommitMessage.php
+++ b/engine/classes/Elgg/CommitMessage.php
@@ -6,10 +6,10 @@
/**
* Provides a structured format for parsing and examining our commit messages.
- *
+ *
* @package Elgg.Core
* @since 1.9
- *
+ *
* @access private
*/
class CommitMessage {
@@ -18,12 +18,12 @@ class CommitMessage {
* The index is the index of the $matches array for regex
* @var array
*/
- private $validMsgParts = array(
+ private $validMsgParts = [
1 => 'type',
2 => 'component',
3 => 'summary',
5 => 'body'
- );
+ ];
/**
* Message type
@@ -79,7 +79,7 @@ class CommitMessage {
*
* @var array
*/
- private static $validTypes = array(
+ private static $validTypes = [
'feature',
'feat',
'fix',
@@ -93,7 +93,7 @@ class CommitMessage {
'security',
'deprecate',
'deprecates'
- );
+ ];
/**
* Valid components
@@ -102,7 +102,7 @@ class CommitMessage {
*
* @var array
*/
- private $validComponents = array(
+ private $validComponents = [
'i18n',
'seo',
'a11y',
@@ -111,7 +111,7 @@ class CommitMessage {
'views',
'session',
'router'
- );
+ ];
/**
* Ignore messages that match this regex
@@ -122,7 +122,7 @@ class CommitMessage {
/**
* Regex to extract the message parts
- *
+ *
* type(component): message
* with an optional body following
*
@@ -158,15 +158,15 @@ public function __construct($msg = null) {
/**
* Sets the active message
- *
+ *
* @param string $msg The message content
- *
+ *
* @return void
*/
public function setMsg($msg) {
$this->originalMsg = $msg;
- $msg = str_replace(array("\r", "\n"), "\n", $msg);
+ $msg = str_replace(["\r", "\n"], "\n", $msg);
$this->msg = $this->removeComments($msg);
$this->processMsg();
}
@@ -204,7 +204,7 @@ public function shouldIgnore() {
* @return array
*/
private function processMsg() {
- $matches = array();
+ $matches = [];
preg_match($this->formatRegex, $this->msg, $matches);
foreach ($this->validMsgParts as $i => $part) {
@@ -227,7 +227,7 @@ public function isValid() {
/**
* Whether the message format conforms to our standards.
- *
+ *
* @return boolean
*/
public function isValidFormat() {
@@ -286,18 +286,18 @@ public function getMaxLineLength() {
* Defaults to 160.
*
* @param int $len The maximum length.
- *
+ *
* @return void
*/
public function setMaxLineLength($len) {
- $this->maxLineLength = (int)$len;
+ $this->maxLineLength = (int) $len;
}
/**
* Get part of the message
*
* @param string $part One section of the message.
- *
+ *
* @return string
* @throws UnexpectedValueException
*/
@@ -313,11 +313,11 @@ public function getPart($part) {
* Removes all lines that start with #
*
* @param string $msg The msg body of the commit
- *
+ *
* @return string
*/
public static function removeComments($msg) {
- $msg_arr = array();
+ $msg_arr = [];
foreach (explode("\n", rtrim($msg)) as $line) {
if (substr($line, 0, 1) !== '#') {
$msg_arr[] = $line;
@@ -332,12 +332,12 @@ public static function removeComments($msg) {
*
* @param string $msg The content to parse
* @param int $max_len Maximum length between \n in the $msg
- *
+ *
* @return array
*/
public static function findLengthyLines($msg, $max_len) {
$lines = explode("\n", $msg);
- $lengthy_lines = array();
+ $lengthy_lines = [];
foreach ($lines as $i => $line) {
if (strlen($line) > $max_len) {
diff --git a/engine/classes/Elgg/Config.php b/engine/classes/Elgg/Config.php
index f4f86ec8b05..86ca4800dd7 100644
--- a/engine/classes/Elgg/Config.php
+++ b/engine/classes/Elgg/Config.php
@@ -90,16 +90,16 @@ public function getCookieConfig() {
// set cookie values for session and remember me
if (!isset($c->cookies)) {
- $c->cookies = array();
+ $c->cookies = [];
}
if (!isset($c->cookies['session'])) {
- $c->cookies['session'] = array();
+ $c->cookies['session'] = [];
}
$session_defaults = session_get_cookie_params();
$session_defaults['name'] = 'Elgg';
$c->cookies['session'] = array_merge($session_defaults, $c->cookies['session']);
if (!isset($c->cookies['remember_me'])) {
- $c->cookies['remember_me'] = array();
+ $c->cookies['remember_me'] = [];
}
$session_defaults['name'] = 'elggperm';
$session_defaults['expire'] = strtotime("+30 days");
@@ -287,4 +287,4 @@ public function loadSettingsFile() {
public function getStorageObject() {
return $this->config;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Context.php b/engine/classes/Elgg/Context.php
index e625e04f4a1..b59585b13be 100644
--- a/engine/classes/Elgg/Context.php
+++ b/engine/classes/Elgg/Context.php
@@ -9,7 +9,7 @@
* output could be different for those two contexts ('blog' vs 'widget').
*
* Pages that pass through the page handling system set the context to the
- * first string after the root url. Example: http://example.org/elgg/bookmarks/
+ * first string after the root url. Example: http://example.org/elgg/bookmarks/
* results in the initial context being set to 'bookmarks'.
*
* The context is a stack so that for a widget on a profile, the context stack
@@ -23,7 +23,7 @@
*/
final class Context {
- private $stack = array();
+ private $stack = [];
/**
* Get the most recently pushed context value.
@@ -108,4 +108,4 @@ public function toArray() {
public function fromArray(array $stack) {
$this->stack = array_map('strval', $stack);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Database.php b/engine/classes/Elgg/Database.php
index 9f771e011df..a1b90a3b26c 100644
--- a/engine/classes/Elgg/Database.php
+++ b/engine/classes/Elgg/Database.php
@@ -62,7 +62,7 @@ class Database {
*
* @var array $delayed_queries Queries to be run during shutdown
*/
- private $delayed_queries = array();
+ private $delayed_queries = [];
/**
* @var bool $installed Is the database installed?
@@ -174,7 +174,6 @@ public function connect($type = "readwrite") {
// https://github.com/Elgg/Elgg/issues/8121
$sub_query = "SELECT REPLACE(@@SESSION.sql_mode, 'ONLY_FULL_GROUP_BY', '')";
$this->connections[$type]->exec("SET SESSION sql_mode=($sub_query);");
-
} catch (\PDOException $e) {
// @todo just allow PDO exceptions
// http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html
@@ -250,7 +249,7 @@ public function insertData($query, array $params = []) {
$this->invalidateQueryCache();
$this->executeQuery($query, $connection, $params);
- return (int)$connection->lastInsertId();
+ return (int) $connection->lastInsertId();
}
/**
@@ -305,7 +304,7 @@ public function deleteData($query, array $params = []) {
$this->invalidateQueryCache();
$stmt = $this->executeQuery("$query", $connection, $params);
- return (int)$stmt->rowCount();
+ return (int) $stmt->rowCount();
}
/**
@@ -356,7 +355,7 @@ protected function getResults($query, $callback = null, $single = false, array $
// Since we want to cache results of running the callback, we need to
// need to namespace the query with the callback and single result request.
// https://github.com/elgg/elgg/issues/4049
- $query_id = (int)$single . $query . '|';
+ $query_id = (int) $single . $query . '|';
if ($params) {
$query_id .= serialize($params) . '|';
}
@@ -382,7 +381,7 @@ protected function getResults($query, $callback = null, $single = false, array $
}
}
- $return = array();
+ $return = [];
$stmt = $this->executeQuery($query, $this->getConnection('read'), $params);
while ($row = $stmt->fetch()) {
@@ -483,8 +482,7 @@ protected function executeQuery($query, Connection $connection, array $params =
public function runSqlScript($scriptlocation) {
$script = file_get_contents($scriptlocation);
if ($script) {
-
- $errors = array();
+ $errors = [];
// Remove MySQL '-- ' and '# ' style comments
$script = preg_replace('/^(?:--|#) .*$/m', '', $script);
@@ -564,7 +562,6 @@ public function executeDelayedQueries() {
$params = $set[self::DELAYED_PARAMS];
try {
-
$stmt = $this->executeQuery($query, $this->getConnection($type), $params);
if (is_callable($handler)) {
@@ -581,9 +578,9 @@ public function executeDelayedQueries() {
/**
* Enable the query cache
- *
+ *
* This does not take precedence over the \Elgg\Database\Config setting.
- *
+ *
* @return void
* @access private
*/
@@ -596,10 +593,10 @@ public function enableQueryCache() {
/**
* Disable the query cache
- *
+ *
* This is useful for special scripts that pull large amounts of data back
* in single queries.
- *
+ *
* @return void
* @access private
*/
diff --git a/engine/classes/Elgg/Database/AccessCollections.php b/engine/classes/Elgg/Database/AccessCollections.php
index b297698f5b8..ef36a8cc4be 100644
--- a/engine/classes/Elgg/Database/AccessCollections.php
+++ b/engine/classes/Elgg/Database/AccessCollections.php
@@ -207,9 +207,9 @@ public function getAccessArray($user_guid = 0, $flush = false) {
}
}
- $options = array(
+ $options = [
'user_id' => $user_guid,
- );
+ ];
// see the warning in the docs for this function about infinite loop potential
return $this->hooks->trigger('access:collections:read', 'user', $options, $access_array);
@@ -255,16 +255,16 @@ public function getAccessArray($user_guid = 0, $flush = false) {
* @return string
* @access private
*/
- public function getWhereSql(array $options = array()) {
+ public function getWhereSql(array $options = []) {
- $defaults = array(
+ $defaults = [
'table_alias' => 'e',
'user_guid' => $this->session->getLoggedInUserGuid(),
'use_enabled_clause' => !access_get_show_hidden_status(),
'access_column' => 'access_id',
'owner_guid_column' => 'owner_guid',
'guid_column' => 'guid',
- );
+ ];
foreach ($options as $key => $value) {
if (is_null($value)) {
@@ -278,7 +278,7 @@ public function getWhereSql(array $options = array()) {
// just in case someone passes a . at the end
$options['table_alias'] = rtrim($options['table_alias'], '.');
- foreach (array('table_alias', 'access_column', 'owner_guid_column', 'guid_column') as $key) {
+ foreach (['table_alias', 'access_column', 'owner_guid_column', 'guid_column'] as $key) {
$options[$key] = sanitize_string($options[$key]);
}
$options['user_guid'] = sanitize_int($options['user_guid'], false);
@@ -290,10 +290,10 @@ public function getWhereSql(array $options = array()) {
$options['ignore_access'] = elgg_check_access_overrides($options['user_guid']);
}
- $clauses = array(
- 'ors' => array(),
- 'ands' => array()
- );
+ $clauses = [
+ 'ors' => [],
+ 'ands' => []
+ ];
$prefix = $this->db->prefix;
@@ -414,7 +414,7 @@ public function hasAccessToEntity($entity, $user = null) {
*
* @return array List of access permissions
*/
- public function getWriteAccessArray($user_guid = 0, $flush = false, array $input_params = array()) {
+ public function getWriteAccessArray($user_guid = 0, $flush = false, array $input_params = []) {
global $init_finished;
$cache = $this->access_cache;
@@ -434,11 +434,11 @@ public function getWriteAccessArray($user_guid = 0, $flush = false, array $input
$access_array = $cache[$hash];
} else {
// @todo is there such a thing as public write access?
- $access_array = array(
+ $access_array = [
ACCESS_PRIVATE => $this->getReadableAccessLevel(ACCESS_PRIVATE),
ACCESS_LOGGED_IN => $this->getReadableAccessLevel(ACCESS_LOGGED_IN),
ACCESS_PUBLIC => $this->getReadableAccessLevel(ACCESS_PUBLIC)
- );
+ ];
$collections = $this->getEntityCollections($user_guid);
if ($collections) {
@@ -452,10 +452,10 @@ public function getWriteAccessArray($user_guid = 0, $flush = false, array $input
}
}
- $options = array(
+ $options = [
'user_id' => $user_guid,
'input_params' => $input_params,
- );
+ ];
return $this->hooks->trigger('access:collections:write', 'user', $options, $access_array);
}
@@ -538,11 +538,11 @@ public function create($name, $owner_guid = 0) {
$this->access_cache->clear();
- $hook_params = array(
+ $hook_params = [
'collection_id' => $id,
'name' => $name,
'owner_guid' => $owner_guid,
- );
+ ];
if (!$this->hooks->trigger('access:collections:addcollection', 'collection', $hook_params, true)) {
$this->delete($id);
@@ -752,10 +752,10 @@ public function addUser($user_guid, $collection_id) {
return false;
}
- $hook_params = array(
+ $hook_params = [
'collection_id' => $collection->id,
'user_guid' => (int) $user_guid
- );
+ ];
$result = $this->hooks->trigger('access:collections:add_user', 'collection', $hook_params, true);
if ($result == false) {
@@ -791,10 +791,10 @@ public function addUser($user_guid, $collection_id) {
*/
public function removeUser($user_guid, $collection_id) {
- $params = array(
+ $params = [
'collection_id' => (int) $collection_id,
'user_guid' => (int) $user_guid,
- );
+ ];
if (!$this->hooks->trigger('access:collections:remove_user', 'collection', $params, true)) {
return false;
@@ -901,12 +901,12 @@ public function getReadableAccessLevel($entity_access_id) {
$translator = $this->translator;
// Check if entity access id is a defined global constant
- $access_array = array(
+ $access_array = [
ACCESS_PRIVATE => $translator->translate("PRIVATE"),
ACCESS_FRIENDS => $translator->translate("access:friends:label"),
ACCESS_LOGGED_IN => $translator->translate("LOGGED_IN"),
ACCESS_PUBLIC => $translator->translate("PUBLIC"),
- );
+ ];
if (array_key_exists($access, $access_array)) {
return $access_array[$access];
@@ -933,4 +933,4 @@ public function getReadableAccessLevel($entity_access_id) {
return $translator->translate('access:limited:label');
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Database/AdminNotices.php b/engine/classes/Elgg/Database/AdminNotices.php
index b2ccc52be6a..8f397d3b72b 100644
--- a/engine/classes/Elgg/Database/AdminNotices.php
+++ b/engine/classes/Elgg/Database/AdminNotices.php
@@ -51,7 +51,7 @@ function add($id, $message) {
elgg_set_ignore_access($old_ia);
- return (bool)$result;
+ return (bool) $result;
}
/**
@@ -73,7 +73,7 @@ function delete($id) {
$result = true;
- $notices = elgg_get_entities_from_metadata(array(
+ $notices = elgg_get_entities_from_metadata([
'type' => 'object',
'subtype' => 'admin_notice',
'metadata_name' => 'admin_notice_id',
@@ -81,7 +81,7 @@ function delete($id) {
'limit' => false,
'batch' => true,
'batch_inc_offset' => false,
- ));
+ ]);
// in case a bad plugin adds many, let it remove them all at once.
foreach ($notices as $notice) {
@@ -98,12 +98,12 @@ function delete($id) {
* @return array Array of admin notices
*/
function find($limit = 10) {
- return elgg_get_entities_from_metadata(array(
+ return elgg_get_entities_from_metadata([
'type' => 'object',
'subtype' => 'admin_notice',
'limit' => $limit,
'distinct' => false,
- ));
+ ]);
}
/**
@@ -116,14 +116,14 @@ function find($limit = 10) {
*/
function exists($id) {
$old_ia = elgg_set_ignore_access(true);
- $notice = elgg_get_entities_from_metadata(array(
+ $notice = elgg_get_entities_from_metadata([
'type' => 'object',
'subtype' => 'admin_notice',
- 'metadata_name_value_pair' => array('name' => 'admin_notice_id', 'value' => $id),
+ 'metadata_name_value_pair' => ['name' => 'admin_notice_id', 'value' => $id],
'count' => true,
- ));
+ ]);
elgg_set_ignore_access($old_ia);
return ($notice) ? true : false;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Database/Annotations.php b/engine/classes/Elgg/Database/Annotations.php
index 06467afc040..fe14a8a2cb1 100644
--- a/engine/classes/Elgg/Database/Annotations.php
+++ b/engine/classes/Elgg/Database/Annotations.php
@@ -100,7 +100,6 @@ function create($entity_guid, $name, $value, $value_type = '', $owner_guid = 0,
$entity = get_entity($entity_guid);
if ($this->events->trigger('annotate', $entity->type, $entity)) {
-
$sql = "INSERT INTO {$this->db->prefix}annotations
(entity_guid, name, value, value_type, owner_guid, time_created, access_id)
VALUES
@@ -217,7 +216,7 @@ function update($annotation_id, $name, $value, $value_type, $owner_guid, $access
*
* @return \ElggAnnotation[]|mixed
*/
- function find(array $options = array()) {
+ function find(array $options = []) {
// support shortcut of 'count' => true for 'annotation_calculation' => 'count'
if (isset($options['count']) && $options['count']) {
@@ -321,26 +320,26 @@ function enableAll(array $options) {
*
* @return mixed If count, int. If not count, array. false on errors.
*/
- function getEntities(array $options = array()) {
- $defaults = array(
+ function getEntities(array $options = []) {
+ $defaults = [
'annotation_names' => ELGG_ENTITIES_ANY_VALUE,
'annotation_values' => ELGG_ENTITIES_ANY_VALUE,
'annotation_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
'annotation_name_value_pairs_operator' => 'AND',
'annotation_case_sensitive' => true,
- 'order_by_annotation' => array(),
+ 'order_by_annotation' => [],
'annotation_created_time_lower' => ELGG_ENTITIES_ANY_VALUE,
'annotation_created_time_upper' => ELGG_ENTITIES_ANY_VALUE,
'annotation_owner_guids' => ELGG_ENTITIES_ANY_VALUE,
- );
+ ];
$options = array_merge($defaults, $options);
- $singulars = array('annotation_name', 'annotation_value',
- 'annotation_name_value_pair', 'annotation_owner_guid');
+ $singulars = ['annotation_name', 'annotation_value',
+ 'annotation_name_value_pair', 'annotation_owner_guid'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
$options = _elgg_entities_get_metastrings_options('annotation', $options);
@@ -398,10 +397,10 @@ function getEntitiesFromCalculation($options) {
}
$db_prefix = $this->db->prefix;
- $defaults = array(
+ $defaults = [
'calculation' => 'sum',
'order_by' => 'annotation_calculation desc'
- );
+ ];
$options = array_merge($defaults, $options);
@@ -450,4 +449,4 @@ function exists($entity_guid, $annotation_type, $owner_guid = null) {
return (bool) $result;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Database/Config.php b/engine/classes/Elgg/Database/Config.php
index 49073317a0a..59d249206fd 100644
--- a/engine/classes/Elgg/Database/Config.php
+++ b/engine/classes/Elgg/Database/Config.php
@@ -83,7 +83,7 @@ public function isDatabaseSplit() {
* @return array
*/
public function getConnectionConfig($type = self::READ_WRITE) {
- $config = array();
+ $config = [];
switch ($type) {
case self::READ:
case self::WRITE:
@@ -103,12 +103,12 @@ public function getConnectionConfig($type = self::READ_WRITE) {
* @return array
*/
protected function getGeneralConnectionConfig() {
- return array(
+ return [
'host' => $this->config->dbhost,
'user' => $this->config->dbuser,
'password' => $this->config->dbpass,
'database' => $this->config->dbname,
- );
+ ];
}
/**
@@ -120,38 +120,38 @@ protected function getGeneralConnectionConfig() {
protected function getParticularConnectionConfig($type) {
if (is_object($this->config->db[$type])) {
// old style single connection (Elgg < 1.9)
- $config = array(
+ $config = [
'host' => $this->config->db[$type]->dbhost,
'user' => $this->config->db[$type]->dbuser,
'password' => $this->config->db[$type]->dbpass,
'database' => $this->config->db[$type]->dbname,
- );
+ ];
} else if (array_key_exists('dbhost', $this->config->db[$type])) {
// new style single connection
- $config = array(
+ $config = [
'host' => $this->config->db[$type]['dbhost'],
'user' => $this->config->db[$type]['dbuser'],
'password' => $this->config->db[$type]['dbpass'],
'database' => $this->config->db[$type]['dbname'],
- );
+ ];
} else if (is_object(current($this->config->db[$type]))) {
// old style multiple connections
$index = array_rand($this->config->db[$type]);
- $config = array(
+ $config = [
'host' => $this->config->db[$type][$index]->dbhost,
'user' => $this->config->db[$type][$index]->dbuser,
'password' => $this->config->db[$type][$index]->dbpass,
'database' => $this->config->db[$type][$index]->dbname,
- );
+ ];
} else {
// new style multiple connections
$index = array_rand($this->config->db[$type]);
- $config = array(
+ $config = [
'host' => $this->config->db[$type][$index]['dbhost'],
'user' => $this->config->db[$type][$index]['dbuser'],
'password' => $this->config->db[$type][$index]['dbpass'],
'database' => $this->config->db[$type][$index]['dbname'],
- );
+ ];
}
return $config;
diff --git a/engine/classes/Elgg/Database/ConfigTable.php b/engine/classes/Elgg/Database/ConfigTable.php
index 65fd5c69c98..7c0403eedd1 100644
--- a/engine/classes/Elgg/Database/ConfigTable.php
+++ b/engine/classes/Elgg/Database/ConfigTable.php
@@ -163,7 +163,7 @@ function get($name) {
// check for deprecated values.
// @todo might be a better spot to define this?
$new_name = false;
- switch($name) {
+ switch ($name) {
case 'pluginspath':
$new_name = 'plugins_path';
break;
@@ -206,4 +206,4 @@ function get($name) {
return null;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Database/EntityTable.php b/engine/classes/Elgg/Database/EntityTable.php
index d00abedff80..146c853f8f9 100644
--- a/engine/classes/Elgg/Database/EntityTable.php
+++ b/engine/classes/Elgg/Database/EntityTable.php
@@ -500,11 +500,11 @@ public function enable($guid, $recursive = true) {
* @see elgg_get_entities_from_annotations()
* @see elgg_list_entities()
*/
- public function getEntities(array $options = array()) {
+ public function getEntities(array $options = []) {
_elgg_check_unsupported_site_guid($options);
- $defaults = array(
+ $defaults = [
'types' => ELGG_ENTITIES_ANY_VALUE,
'subtypes' => ELGG_ENTITIES_ANY_VALUE,
'type_subtype_pairs' => ELGG_ENTITIES_ANY_VALUE,
@@ -524,9 +524,9 @@ public function getEntities(array $options = array()) {
'limit' => $this->config->get('default_limit'),
'offset' => 0,
'count' => false,
- 'selects' => array(),
- 'wheres' => array(),
- 'joins' => array(),
+ 'selects' => [],
+ 'wheres' => [],
+ 'joins' => [],
'preload_owners' => false,
'preload_containers' => false,
@@ -539,7 +539,7 @@ public function getEntities(array $options = array()) {
// private API
'__ElggBatch' => null,
- );
+ ];
$options = array_merge($defaults, $options);
@@ -564,14 +564,14 @@ public function getEntities(array $options = array()) {
}
}
- $singulars = array('type', 'subtype', 'guid', 'owner_guid', 'container_guid');
+ $singulars = ['type', 'subtype', 'guid', 'owner_guid', 'container_guid'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
$options = $this->autoJoinTables($options);
// evaluate where clauses
if (!is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
}
$wheres = $options['wheres'];
@@ -601,7 +601,7 @@ public function getEntities(array $options = array()) {
// evaluate join clauses
if (!is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
}
// remove identical join clauses
@@ -685,7 +685,7 @@ public function getEntities(array $options = array()) {
}
// populate entity and metadata caches, and prepare $entities for preloader
- $guids = array();
+ $guids = [];
foreach ($results as $item) {
// A custom callback could result in items that aren't \ElggEntity's, so check for them
if ($item instanceof ElggEntity) {
@@ -792,19 +792,19 @@ public function fetchFromSql($sql, \ElggBatch $batch = null) {
// Keys are types, values are columns that, if present, suggest that the secondary
// table is already JOINed. Note it's OK if guess incorrectly because entity load()
// will fetch any missing attributes.
- $types_to_optimize = array(
+ $types_to_optimize = [
'object' => 'title',
'user' => 'password_hash',
'group' => 'name',
'site' => 'url',
- );
+ ];
$rows = $this->db->getData($sql);
// guids to look up in each type
- $lookup_types = array();
+ $lookup_types = [];
// maps GUIDs to the $rows key
- $guid_to_key = array();
+ $guid_to_key = [];
if (isset($rows[0]->type, $rows[0]->subtype)
&& $rows[0]->type === 'object'
@@ -812,7 +812,7 @@ public function fetchFromSql($sql, \ElggBatch $batch = null) {
// Likely the entire resultset is plugins, which have already been optimized
// to JOIN the secondary table. In this case we allow retrieving from cache,
// but abandon the extra queries.
- $types_to_optimize = array();
+ $types_to_optimize = [];
}
// First pass: use cache where possible, gather GUIDs that we're optimizing
@@ -905,14 +905,14 @@ public function getEntityTypeSubtypeWhereSql($table, $types, $subtypes, $pairs)
$valid_types = $this->config->get('entity_types');
// pairs override
- $wheres = array();
+ $wheres = [];
if (!is_array($pairs)) {
if (!is_array($types)) {
- $types = array($types);
+ $types = [$types];
}
if ($subtypes && !is_array($subtypes)) {
- $subtypes = array($subtypes);
+ $subtypes = [$subtypes];
}
// decrementer for valid types. Return false if no valid types
@@ -943,7 +943,7 @@ public function getEntityTypeSubtypeWhereSql($table, $types, $subtypes, $pairs)
// subtypes are based upon types, so we need to look at each
// type individually to get the right subtype id.
foreach ($types as $type) {
- $subtype_ids = array();
+ $subtype_ids = [];
if ($subtypes) {
foreach ($subtypes as $subtype) {
// check that the subtype is valid
@@ -994,7 +994,7 @@ public function getEntityTypeSubtypeWhereSql($table, $types, $subtypes, $pairs)
unset($pairs[array_search($paired_type, $pairs)]);
} else {
if ($paired_subtypes && !is_array($paired_subtypes)) {
- $pairs[$paired_type] = array($paired_subtypes);
+ $pairs[$paired_type] = [$paired_subtypes];
}
$valid_pairs_subtypes_count += count($paired_subtypes);
}
@@ -1007,10 +1007,9 @@ public function getEntityTypeSubtypeWhereSql($table, $types, $subtypes, $pairs)
// this will always be an array because of line 2027, right?
// no...some overly clever person can say pair => array('object' => null)
if (is_array($paired_subtypes)) {
- $paired_subtype_ids = array();
+ $paired_subtype_ids = [];
foreach ($paired_subtypes as $paired_subtype) {
if (ELGG_ENTITIES_NO_VALUE === $paired_subtype || ($paired_subtype_id = get_subtype_id($paired_type, $paired_subtype))) {
-
$paired_subtype_ids[] = (ELGG_ENTITIES_NO_VALUE === $paired_subtype) ?
ELGG_ENTITIES_NO_VALUE : $paired_subtype_id;
} else {
@@ -1065,10 +1064,10 @@ public function getGuidBasedWhereSql($column, $guids) {
// normalize and sanitise owners
if (!is_array($guids)) {
- $guids = array($guids);
+ $guids = [$guids];
}
- $guids_sanitized = array();
+ $guids_sanitized = [];
foreach ($guids as $guid) {
if ($guid !== ELGG_ENTITIES_NO_VALUE) {
$guid = sanitise_int($guid);
@@ -1107,7 +1106,7 @@ public function getGuidBasedWhereSql($column, $guids) {
public function getEntityTimeWhereSql($table, $time_created_upper = null,
$time_created_lower = null, $time_updated_upper = null, $time_updated_lower = null) {
- $wheres = array();
+ $wheres = [];
// exploit PHP's loose typing (quack) to check that they are INTs and not str cast to 0
if ($time_created_upper && $time_created_upper == sanitise_int($time_created_upper)) {
@@ -1165,15 +1164,15 @@ public function getEntityTimeWhereSql($table, $time_created_upper = null,
* @throws InvalidArgumentException
* @todo Does not support ordering by attributes or using an attribute pair shortcut like this ('title' => 'foo')
*/
- public function getEntitiesFromAttributes(array $options = array()) {
- $defaults = array(
+ public function getEntitiesFromAttributes(array $options = []) {
+ $defaults = [
'attribute_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
'attribute_name_value_pairs_operator' => 'AND',
- );
+ ];
$options = array_merge($defaults, $options);
- $singulars = array('type', 'attribute_name_value_pair');
+ $singulars = ['type', 'attribute_name_value_pair'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
$clauses = _elgg_get_entity_attribute_where_sql($options);
@@ -1181,18 +1180,18 @@ public function getEntitiesFromAttributes(array $options = array()) {
if ($clauses) {
// merge wheres to pass to elgg_get_entities()
if (isset($options['wheres']) && !is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
} elseif (!isset($options['wheres'])) {
- $options['wheres'] = array();
+ $options['wheres'] = [];
}
$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
// merge joins to pass to elgg_get_entities()
if (isset($options['joins']) && !is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
} elseif (!isset($options['joins'])) {
- $options['joins'] = array();
+ $options['joins'] = [];
}
$options['joins'] = array_merge($options['joins'], $clauses['joins']);
@@ -1208,7 +1207,7 @@ public function getEntitiesFromAttributes(array $options = array()) {
* @access private
* @throws InvalidArgumentException
*/
- public function getEntityAttributeWhereSql(array $options = array()) {
+ public function getEntityAttributeWhereSql(array $options = []) {
if (!isset($options['types'])) {
throw new InvalidArgumentException("The entity type must be defined for elgg_get_entities_from_attributes()");
@@ -1225,17 +1224,17 @@ public function getEntityAttributeWhereSql(array $options = array()) {
}
// @todo the types should be defined somewhere (as constant on \ElggEntity?)
- if (!in_array($type, array('group', 'object', 'site', 'user'))) {
+ if (!in_array($type, ['group', 'object', 'site', 'user'])) {
throw new InvalidArgumentException("Invalid type '$type' passed to elgg_get_entities_from_attributes()");
}
$type_table = "{$this->db->prefix}{$type}s_entity";
- $return = array(
- 'joins' => array(),
- 'wheres' => array(),
- );
+ $return = [
+ 'joins' => [],
+ 'wheres' => [],
+ ];
// short circuit if nothing requested
if ($options['attribute_name_value_pairs'] == ELGG_ENTITIES_ANY_VALUE) {
@@ -1246,15 +1245,15 @@ public function getEntityAttributeWhereSql(array $options = array()) {
throw new InvalidArgumentException("attribute_name_value_pairs must be an array for elgg_get_entities_from_attributes()");
}
- $wheres = array();
+ $wheres = [];
// check if this is an array of pairs or just a single pair.
$pairs = $options['attribute_name_value_pairs'];
if (isset($pairs['name']) || isset($pairs['value'])) {
- $pairs = array($pairs);
+ $pairs = [$pairs];
}
- $pair_wheres = array();
+ $pair_wheres = [];
foreach ($pairs as $index => $pair) {
// must have at least a name and value
if (!isset($pair['name']) || !isset($pair['value'])) {
@@ -1270,7 +1269,7 @@ public function getEntityAttributeWhereSql(array $options = array()) {
if (is_numeric($pair['value'])) {
$value = sanitize_string($pair['value']);
} else if (is_array($pair['value'])) {
- $values_array = array();
+ $values_array = [];
foreach ($pair['value'] as $pair_value) {
if (is_numeric($pair_value)) {
$values_array[] = sanitize_string($pair_value);
@@ -1325,7 +1324,7 @@ public function getEntityAttributeWhereSql(array $options = array()) {
*/
public function getDates($type = '', $subtype = '', $container_guid = 0, $order_by = 'time_created') {
- $where = array();
+ $where = [];
if ($type != "") {
$type = sanitise_string($type);
@@ -1377,7 +1376,7 @@ public function getDates($type = '', $subtype = '', $container_guid = 0, $order_
}
}
- $where[] = _elgg_get_access_where_sql(array('table_alias' => ''));
+ $where[] = _elgg_get_access_where_sql(['table_alias' => '']);
$sql = "SELECT DISTINCT EXTRACT(YEAR_MONTH FROM FROM_UNIXTIME(time_created)) AS yearmonth
FROM {$this->db->prefix}entities where ";
@@ -1388,7 +1387,7 @@ public function getDates($type = '', $subtype = '', $container_guid = 0, $order_
$sql .= "1=1 ORDER BY $order_by";
if ($result = $this->db->getData($sql)) {
- $endresult = array();
+ $endresult = [];
foreach ($result as $res) {
$endresult[] = $res->yearmonth;
}
@@ -1462,7 +1461,7 @@ public function getUserForPermissionsCheck($guid = 0) {
if (!$user) {
// requested to check access for a specific user_guid, but there is no user entity, so the caller
// should cancel the check and return false
- $message = $this->translator->translate('UserFetchFailureException', array($guid));
+ $message = $this->translator->translate('UserFetchFailureException', [$guid]);
$this->logger->warn($message);
throw new UserFetchFailureException();
diff --git a/engine/classes/Elgg/Database/EntityTable/UserFetchFailureException.php b/engine/classes/Elgg/Database/EntityTable/UserFetchFailureException.php
index e2633076b32..1d3ab8527ee 100644
--- a/engine/classes/Elgg/Database/EntityTable/UserFetchFailureException.php
+++ b/engine/classes/Elgg/Database/EntityTable/UserFetchFailureException.php
@@ -5,4 +5,5 @@
/**
* Exception indicating a user could not be looked up for a permissions check
*/
-class UserFetchFailureException extends \RuntimeException {}
+class UserFetchFailureException extends \RuntimeException {
+}
diff --git a/engine/classes/Elgg/Database/MetadataTable.php b/engine/classes/Elgg/Database/MetadataTable.php
index 9d9591bf0b6..f5736f504cb 100644
--- a/engine/classes/Elgg/Database/MetadataTable.php
+++ b/engine/classes/Elgg/Database/MetadataTable.php
@@ -22,7 +22,7 @@ class MetadataTable {
use \Elgg\TimeUsing;
/** @var array */
- protected $independents = array();
+ protected $independents = [];
/** @var Cache */
protected $cache;
@@ -132,7 +132,7 @@ function create($entity_guid, $name, $value, $value_type = '', $owner_guid = 0,
':name' => $name,
]);
if ($existing && !$allow_multiple) {
- $id = (int)$existing->id;
+ $id = (int) $existing->id;
$result = $this->update($id, $name, $value, $value_type, $owner_guid, $access_id);
if (!$result) {
@@ -141,7 +141,7 @@ function create($entity_guid, $name, $value, $value_type = '', $owner_guid = 0,
} else {
// Support boolean types
if (is_bool($value)) {
- $value = (int)$value;
+ $value = (int) $value;
}
// If ok then add it
@@ -162,7 +162,6 @@ function create($entity_guid, $name, $value, $value_type = '', $owner_guid = 0,
if ($id !== false) {
$obj = $this->get($id);
if ($this->events->trigger('create', 'metadata', $obj)) {
-
$this->cache->clear($entity_guid);
return $id;
@@ -208,7 +207,7 @@ function update($id, $name, $value, $value_type, $owner_guid, $access_id) {
// Support boolean types (as integers)
if (is_bool($value)) {
- $value = (int)$value;
+ $value = (int) $value;
}
// If ok then add it
@@ -230,7 +229,6 @@ function update($id, $name, $value, $value_type, $owner_guid, $access_id) {
]);
if ($result !== false) {
-
$this->cache->clear($md->entity_guid);
// @todo this event tells you the metadata has been updated, but does not
@@ -301,7 +299,7 @@ function createFromArray($entity_guid, array $name_and_values, $value_type, $own
*
* @return \ElggMetadata[]|mixed
*/
- function getAll(array $options = array()) {
+ function getAll(array $options = []) {
// @todo remove support for count shortcut - see #4393
// support shortcut of 'count' => true for 'metadata_calculation' => 'count'
@@ -442,23 +440,23 @@ function enableAll(array $options) {
*
* @return \ElggEntity[]|mixed If count, int. If not count, array. false on errors.
*/
- function getEntities(array $options = array()) {
- $defaults = array(
+ function getEntities(array $options = []) {
+ $defaults = [
'metadata_names' => ELGG_ENTITIES_ANY_VALUE,
'metadata_values' => ELGG_ENTITIES_ANY_VALUE,
'metadata_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
'metadata_name_value_pairs_operator' => 'AND',
'metadata_case_sensitive' => true,
- 'order_by_metadata' => array(),
+ 'order_by_metadata' => [],
'metadata_owner_guids' => ELGG_ENTITIES_ANY_VALUE,
- );
+ ];
$options = array_merge($defaults, $options);
- $singulars = array('metadata_name', 'metadata_value',
- 'metadata_name_value_pair', 'metadata_owner_guid');
+ $singulars = ['metadata_name', 'metadata_value',
+ 'metadata_name_value_pair', 'metadata_owner_guid'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
@@ -514,30 +512,30 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
// only supported on values.
$binary = ($case_sensitive) ? ' BINARY ' : '';
- $access = _elgg_get_access_where_sql(array(
+ $access = _elgg_get_access_where_sql([
'table_alias' => 'n_table',
'guid_column' => 'entity_guid',
- ));
+ ]);
- $return = array (
- 'joins' => array (),
- 'wheres' => array(),
- 'orders' => array()
- );
+ $return = [
+ 'joins' => [],
+ 'wheres' => [],
+ 'orders' => []
+ ];
$return['joins'][] = "JOIN {$this->db->prefix}{$n_table} n_table on
{$e_table}.guid = n_table.entity_guid";
- $wheres = array();
+ $wheres = [];
// get names wheres and joins
$names_where = '';
if ($names !== null) {
if (!is_array($names)) {
- $names = array($names);
+ $names = [$names];
}
- $sanitised_names = array();
+ $sanitised_names = [];
foreach ($names as $name) {
// normalise to 0.
if (!$name) {
@@ -555,10 +553,10 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
$values_where = '';
if ($values !== null) {
if (!is_array($values)) {
- $values = array($values);
+ $values = [$values];
}
- $sanitised_values = array();
+ $sanitised_values = [];
foreach ($values as $value) {
// normalize to 0
if (!$value) {
@@ -585,10 +583,10 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
if (is_array($pairs)) {
// check if this is an array of pairs or just a single pair.
if (isset($pairs['name']) || isset($pairs['value'])) {
- $pairs = array($pairs);
+ $pairs = [$pairs];
}
- $pair_wheres = array();
+ $pair_wheres = [];
// @todo when the pairs are > 3 should probably split the query up to
// denormalize the strings table.
@@ -597,10 +595,10 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
// @todo move this elsewhere?
// support shortcut 'n' => 'v' method.
if (!is_array($pair)) {
- $pair = array(
+ $pair = [
'name' => $index,
'value' => $pair
- );
+ ];
}
// must have at least a name and value
@@ -626,24 +624,24 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
// for comparing
$trimmed_operand = trim(strtolower($operand));
- $access = _elgg_get_access_where_sql(array(
+ $access = _elgg_get_access_where_sql([
'table_alias' => "n_table{$i}",
'guid_column' => 'entity_guid',
- ));
+ ]);
// certain operands can't work well with strings that can be interpreted as numbers
// for direct comparisons like IN, =, != we treat them as strings
// gt/lt comparisons need to stay unencapsulated because strings '5' > '15'
// see https://github.com/Elgg/Elgg/issues/7009
- $num_safe_operands = array('>', '<', '>=', '<=');
+ $num_safe_operands = ['>', '<', '>=', '<='];
$num_test_operand = trim(strtoupper($operand));
if (is_numeric($pair['value']) && in_array($num_test_operand, $num_safe_operands)) {
$value = $this->db->sanitizeString($pair['value']);
} else if (is_bool($pair['value'])) {
- $value = (int)$pair['value'];
+ $value = (int) $pair['value'];
} else if (is_array($pair['value'])) {
- $values_array = array();
+ $values_array = [];
foreach ($pair['value'] as $pair_value) {
if (is_numeric($pair_value) && !in_array($num_test_operand, $num_safe_operands)) {
@@ -688,7 +686,7 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
$sanitised = array_map('sanitise_int', $owner_guids);
$owner_str = implode(',', $sanitised);
} else {
- $owner_str = (int)$owner_guids;
+ $owner_str = (int) $owner_guids;
}
$wheres[] = "(n_table.owner_guid IN ($owner_str))";
@@ -701,7 +699,7 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
if (is_array($order_by_metadata)) {
if ((count($order_by_metadata) > 0) && !isset($order_by_metadata[0])) {
// singleton, so fix
- $order_by_metadata = array($order_by_metadata);
+ $order_by_metadata = [$order_by_metadata];
}
foreach ($order_by_metadata as $order_by) {
if (is_array($order_by) && isset($order_by['name'])) {
@@ -714,10 +712,10 @@ function getEntityMetadataWhereSql($e_table, $n_table, $names = null, $values =
$return['joins'][] = "JOIN {$this->db->prefix}{$n_table} n_table{$i}
on {$e_table}.guid = n_table{$i}.entity_guid";
- $access = _elgg_get_access_where_sql(array(
+ $access = _elgg_get_access_where_sql([
'table_alias' => "n_table{$i}",
'guid_column' => 'entity_guid',
- ));
+ ]);
$return['wheres'][] = "(n_table{$i}.name = '$name' AND $access)";
if (isset($order_by['as']) && $order_by['as'] == 'integer') {
@@ -759,7 +757,7 @@ function getUrl($id) {
*/
function registerMetadataAsIndependent($type, $subtype = '*') {
if (!isset($this->independents[$type])) {
- $this->independents[$type] = array();
+ $this->independents[$type] = [];
}
$this->independents[$type][$subtype] = true;
@@ -796,8 +794,8 @@ function isMetadataIndependent($type, $subtype) {
function handleUpdate($event, $object_type, $object) {
if ($object instanceof \ElggEntity) {
if (!$this->isMetadataIndependent($object->getType(), $object->getSubtype())) {
- $access_id = (int)$object->access_id;
- $guid = (int)$object->getGUID();
+ $access_id = (int) $object->access_id;
+ $guid = (int) $object->getGUID();
$query = "update {$this->table} set access_id = {$access_id} where entity_guid = {$guid}";
$this->db->updateData($query);
}
diff --git a/engine/classes/Elgg/Database/Plugins.php b/engine/classes/Elgg/Database/Plugins.php
index d06d3b9ca2e..589bd80131a 100644
--- a/engine/classes/Elgg/Database/Plugins.php
+++ b/engine/classes/Elgg/Database/Plugins.php
@@ -31,7 +31,7 @@ class Plugins {
/**
* @var string[] Active plugins, with plugin ID => GUID. Missing keys imply inactive plugins.
*/
- private $active_guids = array();
+ private $active_guids = [];
/**
* @var bool Has $active_guids been populated?
@@ -86,7 +86,7 @@ function getDirsInDir($dir = null) {
$dir = elgg_get_plugins_path();
}
- $plugin_dirs = array();
+ $plugin_dirs = [];
$handle = opendir($dir);
if ($handle) {
@@ -124,22 +124,22 @@ function generateEntities() {
$old_access = access_get_show_hidden_status();
access_show_hidden_entities(true);
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'plugin',
- 'selects' => array('plugin_oe.*'),
- 'joins' => array("JOIN {$db_prefix}objects_entity plugin_oe on plugin_oe.guid = e.guid"),
+ 'selects' => ['plugin_oe.*'],
+ 'joins' => ["JOIN {$db_prefix}objects_entity plugin_oe on plugin_oe.guid = e.guid"],
'limit' => ELGG_ENTITIES_NO_VALUE,
- );
+ ];
$known_plugins = elgg_get_entities_from_relationship($options);
/* @var \ElggPlugin[] $known_plugins */
if (!$known_plugins) {
- $known_plugins = array();
+ $known_plugins = [];
}
// map paths to indexes
- $id_map = array();
+ $id_map = [];
foreach ($known_plugins as $i => $plugin) {
// if the ID is wrong, delete the plugin because we can never load it.
$id = $plugin->getID();
@@ -226,15 +226,15 @@ function get($plugin_id) {
$plugin_id = sanitize_string($plugin_id);
$db_prefix = elgg_get_config('dbprefix');
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'plugin',
- 'joins' => array("JOIN {$db_prefix}objects_entity oe on oe.guid = e.guid"),
- 'selects' => array("oe.title", "oe.description"),
- 'wheres' => array("oe.title = '$plugin_id'"),
+ 'joins' => ["JOIN {$db_prefix}objects_entity oe on oe.guid = e.guid"],
+ 'selects' => ["oe.title", "oe.description"],
+ 'wheres' => ["oe.title = '$plugin_id'"],
'limit' => 1,
'distinct' => false,
- );
+ ];
$plugins = elgg_get_entities($options);
@@ -257,7 +257,7 @@ function get($plugin_id) {
* @return bool
*/
function exists($id) {
- return (bool)$this->get($id);
+ return (bool) $this->get($id);
}
/**
@@ -378,7 +378,7 @@ function load() {
$plugin->deactivate();
$msg = _elgg_services()->translator->translate('PluginException:CannotStart',
- array($id, $plugin->guid, $e->getMessage()));
+ [$id, $plugin->guid, $e->getMessage()]);
elgg_add_admin_notice("cannot_start $id", $msg);
$return = false;
}
@@ -406,20 +406,20 @@ function find($status = 'active') {
$site_guid = elgg_get_site_entity()->guid;
// grab plugins
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'plugin',
'limit' => ELGG_ENTITIES_NO_VALUE,
- 'selects' => array('plugin_oe.*', 'ps.value'),
- 'joins' => array(
+ 'selects' => ['plugin_oe.*', 'ps.value'],
+ 'joins' => [
"JOIN {$db_prefix}private_settings ps on ps.entity_guid = e.guid",
"JOIN {$db_prefix}objects_entity plugin_oe on plugin_oe.guid = e.guid"
- ),
- 'wheres' => array("ps.name = '$priority'"),
+ ],
+ 'wheres' => ["ps.name = '$priority'"],
// ORDER BY CAST(ps.value) is super slow. We usort() below.
'order_by' => false,
'distinct' => false,
- );
+ ];
switch ($status) {
case 'active':
@@ -486,7 +486,7 @@ function setPriorities(array $order) {
// though we do start with 1
$order = array_values($order);
- $missing_plugins = array();
+ $missing_plugins = [];
/* @var \ElggPlugin[] $missing_plugins */
foreach ($plugins as $plugin) {
@@ -591,20 +591,20 @@ function getProvides($type = null, $name = null) {
if ($this->provides_cache === null) {
$active_plugins = $this->find('active');
- $provides = array();
+ $provides = [];
foreach ($active_plugins as $plugin) {
- $plugin_provides = array();
+ $plugin_provides = [];
$manifest = $plugin->getManifest();
if ($manifest instanceof \ElggPluginManifest) {
$plugin_provides = $plugin->getManifest()->getProvides();
}
if ($plugin_provides) {
foreach ($plugin_provides as $provided) {
- $provides[$provided['type']][$provided['name']] = array(
+ $provides[$provided['type']][$provided['name']] = [
'version' => $provided['version'],
'provided_by' => $plugin->getID()
- );
+ ];
}
}
}
@@ -647,7 +647,7 @@ function invalidateProvidesCache() {
* @access private
*/
public function invalidateIsActiveCache() {
- $this->active_guids = array();
+ $this->active_guids = [];
$this->active_guids_known = false;
}
@@ -669,10 +669,10 @@ public function invalidateIsActiveCache() {
function checkProvides($type, $name, $version = null, $comparison = 'ge') {
$provided = $this->getProvides($type, $name);
if (!$provided) {
- return array(
+ return [
'status' => false,
'value' => ''
- );
+ ];
}
if ($version) {
@@ -681,10 +681,10 @@ function checkProvides($type, $name, $version = null, $comparison = 'ge') {
$status = true;
}
- return array(
+ return [
'status' => $status,
'value' => $provided['version']
- );
+ ];
}
/**
@@ -713,7 +713,7 @@ function getDependencyStrings($dep) {
// rewrite some of these to be more readable
$comparison = elgg_extract('comparison', $info);
- switch($comparison) {
+ switch ($comparison) {
case 'lt':
$comparison = '<';
break;
@@ -739,7 +739,7 @@ function getDependencyStrings($dep) {
'provides' 'plugin oauth_lib' 1.3 -- --
'priority' 'before blog' -- after 'move it'
*/
- $strings = array();
+ $strings = [];
$strings['type'] = $translator->translate('ElggPlugin:Dependencies:' . ucwords($dep_system));
switch ($type) {
@@ -761,7 +761,7 @@ function getDependencyStrings($dep) {
case 'php_extension':
// PHP Extension %s [version]
- $strings['name'] = $translator->translate('ElggPlugin:Dependencies:PhpExtension', array($info['name']));
+ $strings['name'] = $translator->translate('ElggPlugin:Dependencies:PhpExtension', [$info['name']]);
if ($info['version']) {
$strings['expected_value'] = "$comparison {$info['version']}";
$strings['local_value'] = $dep['value'];
@@ -773,14 +773,14 @@ function getDependencyStrings($dep) {
break;
case 'php_ini':
- $strings['name'] = $translator->translate('ElggPlugin:Dependencies:PhpIni', array($info['name']));
+ $strings['name'] = $translator->translate('ElggPlugin:Dependencies:PhpIni', [$info['name']]);
$strings['expected_value'] = "$comparison {$info['value']}";
$strings['local_value'] = $dep['value'];
$strings['comment'] = '';
break;
case 'plugin':
- $strings['name'] = $translator->translate('ElggPlugin:Dependencies:Plugin', array($info['name']));
+ $strings['name'] = $translator->translate('ElggPlugin:Dependencies:Plugin', [$info['name']]);
$expected = $info['version'] ? "$comparison {$info['version']}" : $translator->translate('any');
$strings['expected_value'] = $expected;
$strings['local_value'] = $dep['value'] ? $dep['value'] : '--';
@@ -791,8 +791,8 @@ function getDependencyStrings($dep) {
$expected_priority = ucwords($info['priority']);
$real_priority = ucwords($dep['value']);
$strings['name'] = $translator->translate('ElggPlugin:Dependencies:Priority');
- $strings['expected_value'] = $translator->translate("ElggPlugin:Dependencies:Priority:$expected_priority", array($info['plugin']));
- $strings['local_value'] = $translator->translate("ElggPlugin:Dependencies:Priority:$real_priority", array($info['plugin']));
+ $strings['expected_value'] = $translator->translate("ElggPlugin:Dependencies:Priority:$expected_priority", [$info['plugin']]);
+ $strings['local_value'] = $translator->translate("ElggPlugin:Dependencies:Priority:$real_priority", [$info['plugin']]);
$strings['comment'] = '';
break;
}
@@ -824,13 +824,13 @@ function getDependencyStrings($dep) {
* @return array
* @see \ElggPlugin::getAllUserSettings()
*/
- function getAllUserSettings($user_guid = 0, $plugin_id, $return_obj = false) {
+ function getAllUserSettings($user_guid = 0, $plugin_id = null, $return_obj = false) {
$plugin = $this->get($plugin_id);
if (!$plugin) {
return false;
}
- $settings = $plugin->getAllUserSettings((int)$user_guid);
+ $settings = $plugin->getAllUserSettings((int) $user_guid);
if ($settings && $return_obj) {
$return = new \stdClass;
@@ -856,13 +856,13 @@ function getAllUserSettings($user_guid = 0, $plugin_id, $return_obj = false) {
* @return bool
* @see \ElggPlugin::setUserSetting()
*/
- function setUserSetting($name, $value, $user_guid = 0, $plugin_id) {
+ function setUserSetting($name, $value, $user_guid = 0, $plugin_id = null) {
$plugin = $this->get($plugin_id);
if (!$plugin) {
return false;
}
- return $plugin->setUserSetting($name, $value, (int)$user_guid);
+ return $plugin->setUserSetting($name, $value, (int) $user_guid);
}
/**
@@ -875,13 +875,13 @@ function setUserSetting($name, $value, $user_guid = 0, $plugin_id) {
* @return bool
* @see \ElggPlugin::unsetUserSetting()
*/
- function unsetUserSetting($name, $user_guid = 0, $plugin_id) {
+ function unsetUserSetting($name, $user_guid = 0, $plugin_id = null) {
$plugin = $this->get($plugin_id);
if (!$plugin) {
return false;
}
- return $plugin->unsetUserSetting($name, (int)$user_guid);
+ return $plugin->unsetUserSetting($name, (int) $user_guid);
}
/**
@@ -895,13 +895,13 @@ function unsetUserSetting($name, $user_guid = 0, $plugin_id) {
* @return mixed
* @see \ElggPlugin::getUserSetting()
*/
- function getUserSetting($name, $user_guid = 0, $plugin_id, $default = null) {
+ function getUserSetting($name, $user_guid = 0, $plugin_id = null, $default = null) {
$plugin = $this->get($plugin_id);
if (!$plugin) {
return false;
}
- return $plugin->getUserSetting($name, (int)$user_guid, $default);
+ return $plugin->getUserSetting($name, (int) $user_guid, $default);
}
/**
@@ -1004,19 +1004,19 @@ function unsetAllSettings($plugin_id) {
*
* @return mixed int If count, int. If not count, array. false on errors.
*/
- function getEntitiesFromUserSettings(array $options = array()) {
- $singulars = array('plugin_user_setting_name', 'plugin_user_setting_value',
- 'plugin_user_setting_name_value_pair');
+ function getEntitiesFromUserSettings(array $options = []) {
+ $singulars = ['plugin_user_setting_name', 'plugin_user_setting_value',
+ 'plugin_user_setting_name_value_pair'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
// rewrite plugin_user_setting_name_* to the right PS ones.
- $map = array(
+ $map = [
'plugin_user_setting_names' => 'private_setting_names',
'plugin_user_setting_values' => 'private_setting_values',
'plugin_user_setting_name_value_pairs' => 'private_setting_name_value_pairs',
'plugin_user_setting_name_value_pairs_operator' => 'private_setting_name_value_pairs_operator',
- );
+ ];
foreach ($map as $plugin => $private) {
if (!isset($options[$plugin])) {
@@ -1025,7 +1025,7 @@ function getEntitiesFromUserSettings(array $options = array()) {
if (isset($options[$private])) {
if (!is_array($options[$private])) {
- $options[$private] = array($options[$private]);
+ $options[$private] = [$options[$private]];
}
$options[$private] = array_merge($options[$private], $options[$plugin]);
diff --git a/engine/classes/Elgg/Database/PrivateSettingsTable.php b/engine/classes/Elgg/Database/PrivateSettingsTable.php
index 96aa4839737..9041bf57a94 100644
--- a/engine/classes/Elgg/Database/PrivateSettingsTable.php
+++ b/engine/classes/Elgg/Database/PrivateSettingsTable.php
@@ -85,22 +85,22 @@ public function __construct(Database $db, EntityTable $entities, PluginSettingsC
*
* @return mixed int If count, int. If not count, array. false on errors.
*/
- public function getEntities(array $options = array()) {
- $defaults = array(
+ public function getEntities(array $options = []) {
+ $defaults = [
'private_setting_names' => ELGG_ENTITIES_ANY_VALUE,
'private_setting_values' => ELGG_ENTITIES_ANY_VALUE,
'private_setting_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
'private_setting_name_value_pairs_operator' => 'AND',
'private_setting_name_prefix' => '',
- );
+ ];
$options = array_merge($defaults, $options);
- $singulars = array(
+ $singulars = [
'private_setting_name',
'private_setting_value',
'private_setting_name_value_pair',
- );
+ ];
$options = _elgg_normalize_plural_options_array($options, $singulars);
@@ -114,18 +114,18 @@ public function getEntities(array $options = array()) {
if ($clauses) {
// merge wheres to pass to get_entities()
if (isset($options['wheres']) && !is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
} elseif (!isset($options['wheres'])) {
- $options['wheres'] = array();
+ $options['wheres'] = [];
}
$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
// merge joins to pass to get_entities()
if (isset($options['joins']) && !is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
} elseif (!isset($options['joins'])) {
- $options['joins'] = array();
+ $options['joins'] = [];
}
$options['joins'] = array_merge($options['joins'], $clauses['joins']);
@@ -150,24 +150,24 @@ private function getWhereSql($table, $names = null, $values = null,
// @todo short circuit test
- $return = array (
- 'joins' => array (),
- 'wheres' => array(),
- );
+ $return = [
+ 'joins' => [],
+ 'wheres' => [],
+ ];
$return['joins'][] = "JOIN {$this->table} ps on
{$table}.guid = ps.entity_guid";
- $wheres = array();
+ $wheres = [];
// get names wheres
$names_where = '';
if ($names !== null) {
if (!is_array($names)) {
- $names = array($names);
+ $names = [$names];
}
- $sanitised_names = array();
+ $sanitised_names = [];
foreach ($names as $name) {
$name = $name_prefix . $name;
$sanitised_names[] = '\'' . $this->db->sanitizeString($name) . '\'';
@@ -183,10 +183,10 @@ private function getWhereSql($table, $names = null, $values = null,
$values_where = '';
if ($values !== null) {
if (!is_array($values)) {
- $values = array($values);
+ $values = [$values];
}
- $sanitised_values = array();
+ $sanitised_values = [];
foreach ($values as $value) {
// normalize to 0
if (!$value) {
@@ -216,19 +216,19 @@ private function getWhereSql($table, $names = null, $values = null,
// check if this is an array of pairs or just a single pair.
if (isset($pairs['name']) || isset($pairs['value'])) {
- $pairs = array($pairs);
+ $pairs = [$pairs];
}
- $pair_wheres = array();
+ $pair_wheres = [];
foreach ($pairs as $index => $pair) {
// @todo move this elsewhere?
// support shortcut 'n' => 'v' method.
if (!is_array($pair)) {
- $pair = array(
+ $pair = [
'name' => $index,
'value' => $pair
- );
+ ];
}
// must have at least a name and value
@@ -251,7 +251,7 @@ private function getWhereSql($table, $names = null, $values = null,
if (is_numeric($pair['value'])) {
$value = $this->db->sanitizeString($pair['value']);
} else if (is_array($pair['value'])) {
- $values_array = array();
+ $values_array = [];
foreach ($pair['value'] as $pair_value) {
if (is_numeric($pair_value)) {
diff --git a/engine/classes/Elgg/Database/RelationshipsTable.php b/engine/classes/Elgg/Database/RelationshipsTable.php
index 21a6d607fad..48647d32eb3 100644
--- a/engine/classes/Elgg/Database/RelationshipsTable.php
+++ b/engine/classes/Elgg/Database/RelationshipsTable.php
@@ -41,7 +41,7 @@ class RelationshipsTable {
* Constructor
*
* @param Database $db Elgg Database
- * @param EntityTable $entities Entity table
+ * @param EntityTable $entities Entity table
* @param MetadataTable $metadata Metadata table
* @param EventsService $events Events service
*/
@@ -93,7 +93,7 @@ public function getRow($id) {
* @return bool
*/
public function delete($id, $call_event = true) {
- $id = (int)$id;
+ $id = (int) $id;
$relationship = $this->get($id);
@@ -141,8 +141,8 @@ public function add($guid_one, $relationship, $guid_two, $return_id = false) {
ON DUPLICATE KEY UPDATE time_created = :time
";
$params = [
- ':guid1' => (int)$guid_one,
- ':guid2' => (int)$guid_two,
+ ':guid1' => (int) $guid_one,
+ ':guid2' => (int) $guid_two,
':relationship' => $relationship,
':time' => $this->getCurrentTime()->getTimestamp(),
];
@@ -183,8 +183,8 @@ public function check($guid_one, $relationship, $guid_two) {
LIMIT 1
";
$params = [
- ':guid1' => (int)$guid_one,
- ':guid2' => (int)$guid_two,
+ ':guid1' => (int) $guid_one,
+ ':guid2' => (int) $guid_two,
':relationship' => $relationship,
];
$row = $this->rowToElggRelationship($this->db->getDataRow($query, null, $params));
@@ -272,7 +272,7 @@ public function removeAll($guid, $relationship = "", $inverse_relationship = fal
* @return \ElggRelationship[]
*/
public function getAll($guid, $inverse_relationship = false) {
- $params[':guid'] = (int)$guid;
+ $params[':guid'] = (int) $guid;
$where = ($inverse_relationship ? "guid_two = :guid" : "guid_one = :guid");
@@ -323,7 +323,7 @@ public function getAll($guid, $inverse_relationship = false) {
* @return \ElggEntity[]|mixed If count, int. If not count, array. false on errors.
*/
public function getEntities($options) {
- $defaults = array(
+ $defaults = [
'relationship' => null,
'relationship_guid' => null,
'inverse_relationship' => false,
@@ -331,7 +331,7 @@ public function getEntities($options) {
'relationship_created_time_lower' => ELGG_ENTITIES_ANY_VALUE,
'relationship_created_time_upper' => ELGG_ENTITIES_ANY_VALUE,
- );
+ ];
$options = array_merge($defaults, $options);
@@ -343,9 +343,9 @@ public function getEntities($options) {
if ($clauses) {
// merge wheres to pass to get_entities()
if (isset($options['wheres']) && !is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
} elseif (!isset($options['wheres'])) {
- $options['wheres'] = array();
+ $options['wheres'] = [];
}
$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
@@ -355,24 +355,24 @@ public function getEntities($options) {
$options['relationship_created_time_upper'],
$options['relationship_created_time_lower']);
if ($time_wheres) {
- $options['wheres'] = array_merge($options['wheres'], array($time_wheres));
+ $options['wheres'] = array_merge($options['wheres'], [$time_wheres]);
}
// merge joins to pass to get_entities()
if (isset($options['joins']) && !is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
} elseif (!isset($options['joins'])) {
- $options['joins'] = array();
+ $options['joins'] = [];
}
$options['joins'] = array_merge($options['joins'], $clauses['joins']);
if (isset($options['selects']) && !is_array($options['selects'])) {
- $options['selects'] = array($options['selects']);
+ $options['selects'] = [$options['selects']];
} elseif (!isset($options['selects'])) {
- $options['selects'] = array();
+ $options['selects'] = [];
}
- $select = array('r.id');
+ $select = ['r.id'];
$options['selects'] = array_merge($options['selects'], $select);
@@ -405,8 +405,8 @@ public function getEntityRelationshipWhereSql($column, $relationship = null,
return '';
}
- $wheres = array();
- $joins = array();
+ $wheres = [];
+ $joins = [];
$group_by = '';
if ($inverse_relationship) {
@@ -432,8 +432,7 @@ public function getEntityRelationshipWhereSql($column, $relationship = null,
}
if ($where_str = implode(' AND ', $wheres)) {
-
- return array('wheres' => array("($where_str)"), 'joins' => $joins, 'group_by' => $group_by);
+ return ['wheres' => ["($where_str)"], 'joins' => $joins, 'group_by' => $group_by];
}
return '';
@@ -448,7 +447,7 @@ public function getEntityRelationshipWhereSql($column, $relationship = null,
*
* @return \ElggEntity[]|int|boolean If count, int. If not count, array. false on errors.
*/
- public function getEntitiesFromCount(array $options = array()) {
+ public function getEntitiesFromCount(array $options = []) {
$options['selects'][] = "COUNT(e.guid) as total";
$options['group_by'] = 'r.guid_two';
$options['order_by'] = 'total desc';
diff --git a/engine/classes/Elgg/Database/UsersTable.php b/engine/classes/Elgg/Database/UsersTable.php
index f5f9403a823..b8a3cccf022 100644
--- a/engine/classes/Elgg/Database/UsersTable.php
+++ b/engine/classes/Elgg/Database/UsersTable.php
@@ -331,25 +331,25 @@ public function getByEmail($email) {
*/
public function findActive(array $options = []) {
- $options = array_merge(array(
+ $options = array_merge([
'seconds' => 600,
'limit' => $this->config->get('default_limit'),
- ), $options);
+ ], $options);
// cast options we're sending to hook
- foreach (array('seconds', 'limit', 'offset') as $key) {
+ foreach (['seconds', 'limit', 'offset'] as $key) {
$options[$key] = (int) $options[$key];
}
$options['count'] = (bool) $options['count'];
// allow plugins to override
- $params = array(
+ $params = [
'seconds' => $options['seconds'],
'limit' => $options['limit'],
'offset' => $options['offset'],
'count' => $options['count'],
'options' => $options,
- );
+ ];
$data = _elgg_services()->hooks->trigger('find_active_users', 'system', $params, null);
// check null because the handler could legitimately return falsey values.
if ($data !== null) {
@@ -358,15 +358,15 @@ public function findActive(array $options = []) {
$dbprefix = $this->config->get('dbprefix');
$time = $this->getCurrentTime()->getTimestamp() - $options['seconds'];
- return elgg_get_entities(array(
+ return elgg_get_entities([
'type' => 'user',
'limit' => $options['limit'],
'offset' => $options['offset'],
'count' => $options['count'],
- 'joins' => array("join {$dbprefix}users_entity u on e.guid = u.guid"),
- 'wheres' => array("u.last_action >= {$time}"),
+ 'joins' => ["join {$dbprefix}users_entity u on e.guid = u.guid"],
+ 'wheres' => ["u.last_action >= {$time}"],
'order_by' => "u.last_action desc",
- ));
+ ]);
}
/**
diff --git a/engine/classes/Elgg/Debug/Inspector.php b/engine/classes/Elgg/Debug/Inspector.php
index 8484f7828a4..020ba3ae953 100644
--- a/engine/classes/Elgg/Debug/Inspector.php
+++ b/engine/classes/Elgg/Debug/Inspector.php
@@ -51,7 +51,7 @@ public function getViews($viewtype = 'default') {
$view_data = $this->getViewsData();
// maps view name to array of ViewComponent[] with priority as keys
- $views = array();
+ $views = [];
// add plugins and handle overrides
foreach ($view_data['locations'][$viewtype] as $view => $location) {
@@ -64,7 +64,7 @@ public function getViews($viewtype = 'default') {
// now extensions
foreach ($view_data['extensions'] as $view => $extensions) {
- $view_list = array();
+ $view_list = [];
foreach ($extensions as $priority => $ext_view) {
if (isset($views[$ext_view])) {
$view_list[$priority] = $views[$ext_view][500];
@@ -80,7 +80,7 @@ public function getViews($viewtype = 'default') {
// now overrides
foreach ($views as $view => $view_list) {
if (!empty($view_data['overrides'][$viewtype][$view])) {
- $overrides_list = array();
+ $overrides_list = [];
foreach ($view_data['overrides'][$viewtype][$view] as $i => $location) {
$component = new ViewComponent();
$component->overridden = true;
@@ -96,17 +96,17 @@ public function getViews($viewtype = 'default') {
// view handlers
$handlers = _elgg_services()->hooks->getAllHandlers();
- $input_filtered_views = array();
+ $input_filtered_views = [];
if (!empty($handlers['view_vars'])) {
$input_filtered_views = array_keys($handlers['view_vars']);
}
- $filtered_views = array();
+ $filtered_views = [];
if (!empty($handlers['view'])) {
$filtered_views = array_keys($handlers['view']);
}
- $global_hooks = array();
+ $global_hooks = [];
if (!empty($handlers['view_vars']['all'])) {
$global_hooks[] = 'view_vars, all';
}
@@ -114,12 +114,12 @@ public function getViews($viewtype = 'default') {
$global_hooks[] = 'view, all';
}
- return array(
+ return [
'views' => $views,
'global_hooks' => $global_hooks,
'input_filtered_views' => $input_filtered_views,
'filtered_views' => $filtered_views,
- );
+ ];
}
/**
@@ -128,9 +128,9 @@ public function getViews($viewtype = 'default') {
* @return array [widget] => array(name, contexts)
*/
public function getWidgets() {
- $tree = array();
+ $tree = [];
foreach (_elgg_services()->widgets->getAllTypes() as $handler => $handler_obj) {
- $tree[$handler] = array($handler_obj->name, implode(',', array_values($handler_obj->context)));
+ $tree[$handler] = [$handler_obj->name, implode(',', array_values($handler_obj->context))];
}
ksort($tree);
@@ -147,16 +147,16 @@ public function getWidgets() {
* @return array
*/
public function getActions() {
- $tree = array();
- $access = array(
+ $tree = [];
+ $access = [
'public' => 'public',
'logged_in' => 'logged in only',
'admin' => 'admin only',
- );
+ ];
$start = strlen(elgg_get_root_path());
foreach (_elgg_services()->actions->getAllActions() as $action => $info) {
$info['file'] = substr($info['file'], $start);
- $tree[$action] = array($info['file'], $access[$info['access']]);
+ $tree[$action] = [$info['file'], $access[$info['access']]];
}
ksort($tree);
return $tree;
@@ -199,19 +199,19 @@ public function getSimpleCache() {
public function getWebServices() {
global $API_METHODS;
- $tree = array();
+ $tree = [];
foreach ($API_METHODS as $method => $info) {
$params = implode(', ', array_keys(elgg_extract('parameters', $info, [])));
if (!$params) {
$params = 'none';
}
- $tree[$method] = array(
+ $tree[$method] = [
$info['function'],
"params: $params",
$info['call_method'],
($info['require_api_auth']) ? 'API authentication required' : 'No API authentication required',
($info['require_user_auth']) ? 'User authentication required' : 'No user authentication required',
- );
+ ];
}
ksort($tree);
@@ -230,7 +230,7 @@ public function getMenus() {
// get JIT menu items
// note that 'river' is absent from this list - hooks attempt to get object/subject entities cause problems
- $jit_menus = array('annotation', 'entity', 'login', 'longtext', 'owner_block', 'user_hover', 'widget');
+ $jit_menus = ['annotation', 'entity', 'login', 'longtext', 'owner_block', 'user_hover', 'widget'];
// create generic ElggEntity, ElggAnnotation, ElggUser, ElggWidget
$annotation = new \ElggAnnotation();
@@ -255,8 +255,8 @@ public function getMenus() {
// call plugin hooks
foreach ($jit_menus as $type) {
- $params = array('entity' => $entity, 'annotation' => $annotation, 'user' => $user);
- switch ($type){
+ $params = ['entity' => $entity, 'annotation' => $annotation, 'user' => $user];
+ switch ($type) {
case 'owner_block':
case 'user_hover':
$params['entity'] = $user;
@@ -271,11 +271,11 @@ public function getMenus() {
default:
break;
}
- $menus[$type] = elgg_trigger_plugin_hook('register', "menu:$type", $params, array());
+ $menus[$type] = elgg_trigger_plugin_hook('register', "menu:$type", $params, []);
}
// put the menus in tree form for inspection
- $tree = array();
+ $tree = [];
foreach ($menus as $menu_name => $attributes) {
foreach ($attributes as $item) {
@@ -294,12 +294,12 @@ public function getMenus() {
$parent = 'none';
}
- $tree[$menu_name][$name] = array(
+ $tree[$menu_name][$name] = [
"text: $text",
"href: $href",
"section: $section",
"parent: $parent",
- );
+ ];
}
}
@@ -329,7 +329,7 @@ public function describeCallable($callable, $file_root = '') {
* @return array
*/
protected function buildHandlerTree($all_handlers) {
- $tree = array();
+ $tree = [];
$root = elgg_get_root_path();
$handlers_svc = _elgg_services()->handlers;
diff --git a/engine/classes/Elgg/DeprecationService.php b/engine/classes/Elgg/DeprecationService.php
index 8421a366f5f..9961fb857a1 100644
--- a/engine/classes/Elgg/DeprecationService.php
+++ b/engine/classes/Elgg/DeprecationService.php
@@ -45,7 +45,7 @@ function sendNotice($msg, $dep_version, $backtrace_level = 1) {
// Get a file and line number for the log. Skip over the function that
// sent this notice and see who called the deprecated function itself.
- $stack = array();
+ $stack = [];
$backtrace = debug_backtrace();
// never show this call.
array_shift($backtrace);
diff --git a/engine/classes/Elgg/DeprecationWrapper.php b/engine/classes/Elgg/DeprecationWrapper.php
index dd736ae7bbd..d7b7c1d2bb6 100644
--- a/engine/classes/Elgg/DeprecationWrapper.php
+++ b/engine/classes/Elgg/DeprecationWrapper.php
@@ -19,7 +19,7 @@
* config object in ElggPlugin::includeFile
*
* @access private
- *
+ *
* @package Elgg.Core
*/
class DeprecationWrapper implements \ArrayAccess {
@@ -40,7 +40,7 @@ class DeprecationWrapper implements \ArrayAccess {
/**
* Create the wrapper
- *
+ *
* @param mixed $object The object or string to wrap
* @param string $message The deprecation message to display when used
* @param string $version The Elgg version this was deprecated
@@ -59,7 +59,7 @@ public function __construct($object, $message, $version, $reporter = 'elgg_depre
/**
* Get a property on the object
- *
+ *
* @param string $name Property name
* @return mixed
*/
@@ -70,7 +70,7 @@ public function __get($name) {
/**
* Set a property on the object
- *
+ *
* @param string $name Property name
* @param mixed $value Property value
* @return void
@@ -82,19 +82,19 @@ public function __set($name, $value) {
/**
* Call a method on the object
- *
+ *
* @param string $name Method name
* @param array $arguments Method arguments
* @return mixed
*/
public function __call($name, $arguments) {
$this->displayWarning();
- return call_user_func_array(array($this->object, $name), $arguments);
+ return call_user_func_array([$this->object, $name], $arguments);
}
/**
* Get the object as string
- *
+ *
* @return string
*/
public function __toString() {
@@ -108,7 +108,7 @@ public function __toString() {
/**
* Display a warning
- *
+ *
* @return void
*/
protected function displayWarning() {
diff --git a/engine/classes/Elgg/Di/DiContainer.php b/engine/classes/Elgg/Di/DiContainer.php
index 8ba5090f968..7e3148c722c 100644
--- a/engine/classes/Elgg/Di/DiContainer.php
+++ b/engine/classes/Elgg/Di/DiContainer.php
@@ -21,7 +21,7 @@
*
*
* @access private
- *
+ *
* @package Elgg.Core
* @since 1.9
*/
@@ -30,7 +30,7 @@ class DiContainer {
/**
* @var array each element is an array: ['callable' => mixed $factory, 'shared' => bool $isShared]
*/
- private $factories_ = array();
+ private $factories_ = [];
const CLASS_NAME_PATTERN_53 = '/^(\\\\?[a-z_\x7f-\xff][a-z0-9_\x7f-\xff]*)+$/i';
@@ -57,7 +57,7 @@ public function __get($name) {
/**
* Build a value
- *
+ *
* @param mixed $factory The factory for the value
* @param string $name The name of the value
* @return mixed
@@ -114,10 +114,10 @@ public function setFactory($name, $callable, $shared = true) {
throw new \InvalidArgumentException('$factory must appear callable');
}
$this->remove($name);
- $this->factories_[$name] = array(
+ $this->factories_[$name] = [
'callable' => $callable,
'shared' => $shared,
- );
+ ];
return $this;
}
@@ -146,7 +146,7 @@ public function setClassName($name, $class_name, $shared = true) {
/**
* Remove a value from the container
- *
+ *
* @param string $name The name of the value
* @return \Elgg\Di\DiContainer
*/
@@ -161,7 +161,7 @@ public function remove($name) {
/**
* Does the container have this value
- *
+ *
* @param string $name The name of the value
* @return bool
*/
@@ -172,7 +172,7 @@ public function has($name) {
if (substr($name, -1) === '_') {
return false;
}
- return (bool)property_exists($this, $name);
+ return (bool) property_exists($this, $name);
}
/**
diff --git a/engine/classes/Elgg/Di/FactoryUncallableException.php b/engine/classes/Elgg/Di/FactoryUncallableException.php
index aecafe4915b..b1499278dca 100644
--- a/engine/classes/Elgg/Di/FactoryUncallableException.php
+++ b/engine/classes/Elgg/Di/FactoryUncallableException.php
@@ -3,10 +3,11 @@
/**
* Factory uncallable exception
- *
+ *
* @access private
- *
+ *
* @package Elgg.Core
*/
-class FactoryUncallableException extends \Exception {}
+class FactoryUncallableException extends \Exception {
+}
diff --git a/engine/classes/Elgg/Di/MissingValueException.php b/engine/classes/Elgg/Di/MissingValueException.php
index 17639825e94..514efc20d0a 100644
--- a/engine/classes/Elgg/Di/MissingValueException.php
+++ b/engine/classes/Elgg/Di/MissingValueException.php
@@ -3,10 +3,11 @@
/**
* Missing value exception
- *
+ *
* @access private
- *
+ *
* @package Elgg.Core
*/
-class MissingValueException extends \Exception {}
+class MissingValueException extends \Exception {
+}
diff --git a/engine/classes/Elgg/EntityDirLocator.php b/engine/classes/Elgg/EntityDirLocator.php
index 3580ce6b6b0..64043d3f623 100644
--- a/engine/classes/Elgg/EntityDirLocator.php
+++ b/engine/classes/Elgg/EntityDirLocator.php
@@ -10,7 +10,7 @@
* being used directly.
*
* @access private
- *
+ *
* @package Elgg.Core
*/
class EntityDirLocator {
@@ -22,7 +22,7 @@ class EntityDirLocator {
/**
* Find an entity's data dir.
- *
+ *
* @param int $guid GUID of the entity.
*
* @throws \InvalidArgumentException
diff --git a/engine/classes/Elgg/EntityIcon.php b/engine/classes/Elgg/EntityIcon.php
index d8369a04d4a..8aeee921bac 100644
--- a/engine/classes/Elgg/EntityIcon.php
+++ b/engine/classes/Elgg/EntityIcon.php
@@ -7,38 +7,38 @@
interface EntityIcon {
/**
* Saves icons using an uploaded file as the source.
- *
+ *
* @param string $input_name Form input name
* @param string $type The name of the icon. e.g., 'icon', 'cover_photo'
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromUploadedFile($input_name, $type = 'icon', array $coords = array());
+ public function saveIconFromUploadedFile($input_name, $type = 'icon', array $coords = []);
/**
* Saves icons using a local file as the source.
- *
+ *
* @param string $filename The full path to the local file
* @param string $type The name of the icon. e.g., 'icon', 'cover_photo'
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromLocalFile($filename, $type = 'icon', array $coords = array());
+ public function saveIconFromLocalFile($filename, $type = 'icon', array $coords = []);
/**
* Saves icons using a file located in the data store as the source.
- *
+ *
* @param string $file An ElggFile instance
* @param string $type The name of the icon. e.g., 'icon', 'cover_photo'
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromElggFile(\ElggFile $file, $type = 'icon', array $coords = array());
+ public function saveIconFromElggFile(\ElggFile $file, $type = 'icon', array $coords = []);
/**
* Returns entity icon as an ElggIcon object
* The icon file may or may not exist on filestore
- *
+ *
* @param string $size Size of the icon
* @param string $type The name of the icon. e.g., 'icon', 'cover_photo'
* @return \ElggIcon
@@ -47,7 +47,7 @@ public function getIcon($size, $type = 'icon');
/**
* Removes all icon files and metadata for the passed type of icon.
- *
+ *
* @param string $type The name of the icon. e.g., 'icon', 'cover_photo'
* @return bool
*/
@@ -55,7 +55,7 @@ public function deleteIcon($type = 'icon');
/**
* Returns a URL of the icon.
- *
+ *
* @param array $params An array of paramaters including:
* string 'size' => the size of the icon (default: medium)
* string 'type' => the icon type (default: icon)
@@ -65,10 +65,10 @@ public function getIconURL($params);
/**
* Returns the timestamp of when the icon was changed.
- *
+ *
* @param string $size The size of the icon
* @param string $type The name of the icon. e.g., 'icon', 'cover_photo'
- *
+ *
* @return int|null A unix timestamp of when the icon was last changed, or null if not set.
*/
public function getIconLastChange($size, $type = 'icon');
@@ -81,4 +81,4 @@ public function getIconLastChange($size, $type = 'icon');
* @return bool
*/
public function hasIcon($size, $type = 'icon');
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/EntityIconService.php b/engine/classes/Elgg/EntityIconService.php
index a7ebda949c7..2efbba95649 100644
--- a/engine/classes/Elgg/EntityIconService.php
+++ b/engine/classes/Elgg/EntityIconService.php
@@ -76,7 +76,7 @@ public function __construct(Config $config, PluginHooksService $hooks, Request $
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromUploadedFile(ElggEntity $entity, $input_name, $type = 'icon', array $coords = array()) {
+ public function saveIconFromUploadedFile(ElggEntity $entity, $input_name, $type = 'icon', array $coords = []) {
$files = $this->request->files;
if (!$files->has($input_name)) {
return false;
@@ -117,7 +117,7 @@ public function saveIconFromUploadedFile(ElggEntity $entity, $input_name, $type
* @return bool
* @throws InvalidParameterException
*/
- public function saveIconFromLocalFile(ElggEntity $entity, $filename, $type = 'icon', array $coords = array()) {
+ public function saveIconFromLocalFile(ElggEntity $entity, $filename, $type = 'icon', array $coords = []) {
if (!file_exists($filename) || !is_readable($filename)) {
throw new InvalidParameterException(__METHOD__ . " expects a readable local file. $filename is not readable");
}
@@ -150,7 +150,7 @@ public function saveIconFromLocalFile(ElggEntity $entity, $filename, $type = 'ic
* @return bool
* @throws InvalidParameterException
*/
- public function saveIconFromElggFile(ElggEntity $entity, ElggFile $file, $type = 'icon', array $coords = array()) {
+ public function saveIconFromElggFile(ElggEntity $entity, ElggFile $file, $type = 'icon', array $coords = []) {
if (!$file->exists()) {
throw new InvalidParameterException(__METHOD__ . ' expects an instance of ElggFile with an existing file on filestore');
}
@@ -182,7 +182,7 @@ public function saveIconFromElggFile(ElggEntity $entity, ElggFile $file, $type =
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIcon(ElggEntity $entity, ElggFile $file, $type = 'icon', array $coords = array()) {
+ public function saveIcon(ElggEntity $entity, ElggFile $file, $type = 'icon', array $coords = []) {
$entity_type = $entity->getType();
$entity_subtype = $entity->getSubtype();
@@ -248,7 +248,6 @@ public function saveIcon(ElggEntity $entity, ElggFile $file, $type = 'icon', arr
$sizes = $this->getSizes($entity_type, $entity_subtype, $type);
foreach ($sizes as $size => $opts) {
-
$square = (bool) elgg_extract('square', $opts);
if ($type === 'icon' && $cropping_mode) {
@@ -366,12 +365,12 @@ public function deleteIcon(ElggEntity $entity, $type = 'icon') {
* or an array of parameters including 'size'
* @return string|void
*/
- public function getIconURL(ElggEntity $entity, $params = array()) {
+ public function getIconURL(ElggEntity $entity, $params = []) {
if (is_array($params)) {
$size = elgg_extract('size', $params, 'medium');
} else {
$size = is_string($params) ? $params : 'medium';
- $params = array();
+ $params = [];
}
$size = elgg_strtolower($size);
@@ -399,7 +398,7 @@ public function getIconURL(ElggEntity $entity, $params = array()) {
/**
* Returns default/fallback icon
- *
+ *
* @param ElggEntity $entity Entity
* @param array $params Icon params
* @return string
@@ -490,7 +489,6 @@ public function getSizes($entity_type = null, $entity_subtype = null, $type = 'i
if (empty($sizes)) {
$this->logger->error("Failed to find size configuration for image of type '$type' for entity type " .
"'$entity_type'. Use the 'entity:$type:sizes, $entity_type' hook to define the icon sizes");
-
}
return $sizes;
diff --git a/engine/classes/Elgg/EntityPreloader.php b/engine/classes/Elgg/EntityPreloader.php
index cbcc3f3cda2..eeb476c3e8e 100644
--- a/engine/classes/Elgg/EntityPreloader.php
+++ b/engine/classes/Elgg/EntityPreloader.php
@@ -53,9 +53,9 @@ public function preload($objects, array $guid_properties) {
// If only 1 to load, not worth the overhead of elgg_get_entities(),
// get_entity() will handle it later.
if (count($guids) > 1) {
- call_user_func($this->_callable_entity_loader, array(
+ call_user_func($this->_callable_entity_loader, [
'guids' => $guids,
- ));
+ ]);
}
}
@@ -70,9 +70,9 @@ public function preload($objects, array $guid_properties) {
*/
protected function getGuidsToLoad($objects, array $guid_properties) {
if (!is_array($objects) || count($objects) < 2) {
- return array();
+ return [];
}
- $preload_guids = array();
+ $preload_guids = [];
foreach ($objects as $object) {
if (is_object($object)) {
foreach ($guid_properties as $property) {
diff --git a/engine/classes/Elgg/EventsService.php b/engine/classes/Elgg/EventsService.php
index a0ebfd3bae1..2f112bb72b4 100644
--- a/engine/classes/Elgg/EventsService.php
+++ b/engine/classes/Elgg/EventsService.php
@@ -40,12 +40,12 @@ public function registerHandler($name, $type, $callback, $priority = 500) {
* @see elgg_trigger_after_event
* @access private
*/
- public function trigger($name, $type, $object = null, array $options = array()) {
- $options = array_merge(array(
+ public function trigger($name, $type, $object = null, array $options = []) {
+ $options = array_merge([
self::OPTION_STOPPABLE => true,
self::OPTION_DEPRECATION_MESSAGE => '',
self::OPTION_DEPRECATION_VERSION => '',
- ), $options);
+ ], $options);
$handlers = $this->hasHandler($name, $type);
if ($handlers && $options[self::OPTION_DEPRECATION_MESSAGE]) {
@@ -129,9 +129,9 @@ function triggerBefore($event, $object_type, $object = null) {
* @since 2.0.0
*/
public function triggerAfter($event, $object_type, $object = null) {
- $options = array(
+ $options = [
self::OPTION_STOPPABLE => false,
- );
+ ];
return $this->trigger("$event:after", $object_type, $object, $options);
}
@@ -148,11 +148,11 @@ public function triggerAfter($event, $object_type, $object = null) {
*
* @see trigger
*/
- function triggerDeprecated($event, $object_type, $object = null, $message, $version) {
- $options = array(
+ function triggerDeprecated($event, $object_type, $object = null, $message = null, $version = null) {
+ $options = [
self::OPTION_DEPRECATION_MESSAGE => $message,
self::OPTION_DEPRECATION_VERSION => $version,
- );
+ ];
return $this->trigger($event, $object_type, $object, $options);
}
}
diff --git a/engine/classes/Elgg/FileService/File.php b/engine/classes/Elgg/FileService/File.php
index c49edcf828a..271a0d585dc 100644
--- a/engine/classes/Elgg/FileService/File.php
+++ b/engine/classes/Elgg/FileService/File.php
@@ -6,7 +6,7 @@
/**
* File service
- *
+ *
* @access private
*/
class File {
@@ -15,7 +15,7 @@ class File {
const ATTACHMENT = 'attachment';
/**
- * @var \ElggFile
+ * @var \ElggFile
*/
private $file;
@@ -69,7 +69,7 @@ public function setExpires($expires = '+2 hours') {
* @return void
*/
public function setDisposition($disposition = self::ATTACHMENT) {
- if (!in_array($disposition, array(self::ATTACHMENT, self::INLINE))) {
+ if (!in_array($disposition, [self::ATTACHMENT, self::INLINE])) {
throw new \InvalidArgumentException("Disposition $disposition is not supported in " . __CLASS__);
}
$this->disposition = $disposition;
@@ -114,12 +114,12 @@ public function getURL() {
$relative_path = ':' . Base64Url::encode($relative_path);
}
- $data = array(
+ $data = [
'expires' => isset($this->expires) ? $this->expires : 0,
'last_updated' => filemtime($this->file->getFilenameOnFilestore()),
'disposition' => $this->disposition == self::INLINE ? 'i' : 'a',
'path' => $relative_path,
- );
+ ];
if ($this->use_cookie) {
$data['cookie'] = _elgg_services()->session->getId();
@@ -134,7 +134,7 @@ public function getURL() {
ksort($data);
$mac = _elgg_services()->crypto->getHmac($data)->getToken();
- $url_segments = array(
+ $url_segments = [
'serve-file',
"e{$data['expires']}",
"l{$data['last_updated']}",
@@ -142,7 +142,7 @@ public function getURL() {
"c{$data['use_cookie']}",
$mac,
$relative_path,
- );
+ ];
return elgg_normalize_url(implode('/', $url_segments));
}
diff --git a/engine/classes/Elgg/Filesystem/Directory.php b/engine/classes/Elgg/Filesystem/Directory.php
index 9341a207c45..d91986162ae 100644
--- a/engine/classes/Elgg/Filesystem/Directory.php
+++ b/engine/classes/Elgg/Filesystem/Directory.php
@@ -5,18 +5,18 @@
/**
* A simple directory abstraction.
- *
+ *
* @since 1.10.2
- *
+ *
* @access private
*/
interface Directory {
/**
* Returns a subdirectory with access limited to the given directory.
- *
+ *
* @param string $path The path relative to this directory to chroot to.
- *
+ *
* @return Directory A new directory instance.
*
* @throws \InvalidArgumentException
@@ -25,9 +25,9 @@ public function chroot($path);
/**
* Read the file off the filesystem.
- *
+ *
* @param string $path The directory-relative path to the target file.
- *
+ *
* @return string Empty string if the file doesn't exist.
*
* @throws \InvalidArgumentException
@@ -36,11 +36,11 @@ public function getContents($path);
/**
* A reference to the file at the given path, even if it doesn't exist yet.
- *
+ *
* However, will throw an exception if the file is already a directory.
- *
+ *
* @param string $path The path to the file, relative to this directory.
- *
+ *
* @return File
*
* @throws \InvalidArgumentException
@@ -49,10 +49,10 @@ public function getFile($path);
/**
* List the files in the given directory path.
- *
+ *
* @param string $path The subdirectory path within this directory
* @param bool $recursive Find files recursively
- *
+ *
* @return Collection
*
* @throws \InvalidArgumentException
@@ -85,11 +85,11 @@ public function getPath($path = '');
/**
* Do a PHP include of the file and return the result.
- *
+ *
* NB: This only really works with local filesystems amirite?
- *
+ *
* @param string $path Filesystem-relative path for the file to include.
- *
+ *
* @return mixed
*
* @throws \InvalidArgumentException
@@ -98,9 +98,9 @@ public function includeFile($path);
/**
* Whether this directory has an existing file at the given location.
- *
+ *
* @param string $path The relative path within this directory
- *
+ *
* @return boolean
*
* @throws \InvalidArgumentException
@@ -109,10 +109,10 @@ public function isFile($path);
/**
* Write a file, overwriting the contents if necessary.
- *
+ *
* @param string $path The path to the file.
* @param string $content The literal text content of the file.
- *
+ *
* @return void
*
* @throws \InvalidArgumentException
diff --git a/engine/classes/Elgg/Filesystem/Directory/Fly.php b/engine/classes/Elgg/Filesystem/Directory/Fly.php
index 114f94a41b9..4133c23b905 100644
--- a/engine/classes/Elgg/Filesystem/Directory/Fly.php
+++ b/engine/classes/Elgg/Filesystem/Directory/Fly.php
@@ -64,7 +64,7 @@ public function isFile($path) {
/** @inheritDoc */
public function getContents($path) {
- return (string)$this->fs->read($this->getInternalPath($path));
+ return (string) $this->fs->read($this->getInternalPath($path));
}
/** @inheritDoc */
diff --git a/engine/classes/Elgg/Filesystem/Directory/InMemory.php b/engine/classes/Elgg/Filesystem/Directory/InMemory.php
index 106b39892c9..4b701d9f92d 100644
--- a/engine/classes/Elgg/Filesystem/Directory/InMemory.php
+++ b/engine/classes/Elgg/Filesystem/Directory/InMemory.php
@@ -14,7 +14,7 @@ final class InMemory {
/**
* Shorthand for generating a new in-memory-only filesystem.
- *
+ *
* @param array $files A structure like ['/path' => 'contents']
*
* @return Directory
@@ -28,4 +28,4 @@ public static function fromArray(array $files) /*: Directory*/ {
return $dir;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Filesystem/Directory/Local.php b/engine/classes/Elgg/Filesystem/Directory/Local.php
index 4c8c75a7be4..4e96335e49d 100644
--- a/engine/classes/Elgg/Filesystem/Directory/Local.php
+++ b/engine/classes/Elgg/Filesystem/Directory/Local.php
@@ -25,7 +25,7 @@ public static function fromPath(/*string*/ $path) /*: Directory*/ {
/**
* Returns a directory that points to the root composer install.
- *
+ *
* Note: This is not the same as the Elgg root! In the Elgg 1.x series, Elgg
* was always at the install root, but as of 2.0, Elgg can be installed as a
* composer dependency, so you cannot assume that it is at the root anymore.
@@ -46,4 +46,4 @@ public static function root() /*: Directory*/ {
return $dir;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Filesystem/File.php b/engine/classes/Elgg/Filesystem/File.php
index d52f465cf58..1a2aa5b6c7a 100644
--- a/engine/classes/Elgg/Filesystem/File.php
+++ b/engine/classes/Elgg/Filesystem/File.php
@@ -3,9 +3,9 @@
/**
* Represents a file that may or may not actually exist.
- *
+ *
* @since 1.10.0
- *
+ *
* @access private
*/
class File {
@@ -18,7 +18,7 @@ class File {
/**
* Constructor
- *
+ *
* @param Directory $directory The directory where this file resides
* @param string $path The path to this file relative to the directory
*/
@@ -43,7 +43,7 @@ public function getBasename() {
/**
* Get the text content of this file. Empty string if it doesn't exist.
- *
+ *
* @return string
*/
public function getContents() {
@@ -76,9 +76,9 @@ public function getPath() {
/**
* Do a PHP include of the file and return the result.
- *
+ *
* TODO(ewinslow): This may only work for local filesystems?
- *
+ *
* @return mixed
*/
public function includeFile() {
diff --git a/engine/classes/Elgg/Filesystem/MimeTypeDetector.php b/engine/classes/Elgg/Filesystem/MimeTypeDetector.php
index efa86ad5223..232641a851c 100644
--- a/engine/classes/Elgg/Filesystem/MimeTypeDetector.php
+++ b/engine/classes/Elgg/Filesystem/MimeTypeDetector.php
@@ -26,7 +26,7 @@ class MimeTypeDetector {
/**
* @var array
*/
- public $extensions = array(
+ public $extensions = [
'txt' => 'text/plain',
'htm' => 'text/html',
'html' => 'text/html',
@@ -103,7 +103,7 @@ class MimeTypeDetector {
'onetmp' => 'application/msonenote',
'onepkg' => 'application/msonenote',
'thmx' => 'application/vnd.ms-officetheme',
- );
+ ];
/**
* Sniff the MIME type
diff --git a/engine/classes/Elgg/Forms/StickyForms.php b/engine/classes/Elgg/Forms/StickyForms.php
index e8ba63c4410..fd66b8e0193 100644
--- a/engine/classes/Elgg/Forms/StickyForms.php
+++ b/engine/classes/Elgg/Forms/StickyForms.php
@@ -32,7 +32,7 @@ public function makeStickyForm($form_name) {
}
$session = _elgg_services()->session;
- $data = $session->get('sticky_forms', array());
+ $data = $session->get('sticky_forms', []);
$req = _elgg_services()->request;
// will go through XSS filtering in elgg_get_sticky_value()
@@ -58,7 +58,7 @@ public function makeStickyForm($form_name) {
*/
function clearStickyForm($form_name) {
$session = _elgg_services()->session;
- $data = $session->get('sticky_forms', array());
+ $data = $session->get('sticky_forms', []);
unset($data[$form_name]);
$session->set('sticky_forms', $data);
}
@@ -72,7 +72,7 @@ function clearStickyForm($form_name) {
*/
function isStickyForm($form_name) {
$session = _elgg_services()->session;
- $data = $session->get('sticky_forms', array());
+ $data = $session->get('sticky_forms', []);
return isset($data[$form_name]);
}
@@ -90,7 +90,7 @@ function isStickyForm($form_name) {
*/
function getStickyValue($form_name, $variable = '', $default = null, $filter_result = true) {
$session = _elgg_services()->session;
- $data = $session->get('sticky_forms', array());
+ $data = $session->get('sticky_forms', []);
if (isset($data[$form_name][$variable])) {
$value = $data[$form_name][$variable];
if ($filter_result) {
@@ -112,9 +112,9 @@ function getStickyValue($form_name, $variable = '', $default = null, $filter_res
*/
function getStickyValues($form_name, $filter_result = true) {
$session = _elgg_services()->session;
- $data = $session->get('sticky_forms', array());
+ $data = $session->get('sticky_forms', []);
if (!isset($data[$form_name])) {
- return array();
+ return [];
}
$values = $data[$form_name];
@@ -137,8 +137,8 @@ function getStickyValues($form_name, $filter_result = true) {
*/
function clearStickyValue($form_name, $variable) {
$session = _elgg_services()->session;
- $data = $session->get('sticky_forms', array());
+ $data = $session->get('sticky_forms', []);
unset($data[$form_name][$variable]);
$session->set('sticky_forms', $data);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/FormsService.php b/engine/classes/Elgg/FormsService.php
index b631ce789c1..554f4a900fa 100644
--- a/engine/classes/Elgg/FormsService.php
+++ b/engine/classes/Elgg/FormsService.php
@@ -77,11 +77,11 @@ public function __construct(ViewsService $views, Logger $logger) {
*
* @return string The complete form
*/
- public function render($action, $form_vars = array(), $body_vars = array()) {
+ public function render($action, $form_vars = [], $body_vars = []) {
- $defaults = array(
+ $defaults = [
'action' => elgg_normalize_url("action/$action"),
- );
+ ];
// append elgg-form class to any class options set
$form_vars['class'] = (array) elgg_extract('class', $form_vars, []);
diff --git a/engine/classes/Elgg/GroupItemVisibility.php b/engine/classes/Elgg/GroupItemVisibility.php
index 2049d1095fa..13c2f666dcb 100644
--- a/engine/classes/Elgg/GroupItemVisibility.php
+++ b/engine/classes/Elgg/GroupItemVisibility.php
@@ -40,7 +40,7 @@ static public function factory($container_guid, $use_cache = true) {
// cache because this may be called repeatedly during river display, and
// due to need to check group visibility, cache will be disabled for some
// get_entity() calls
- static $cache = array();
+ static $cache = [];
if (!$container_guid) {
return new \Elgg\GroupItemVisibility();
diff --git a/engine/classes/Elgg/HandlersService.php b/engine/classes/Elgg/HandlersService.php
index cd2b1dc049f..f1a2efde218 100644
--- a/engine/classes/Elgg/HandlersService.php
+++ b/engine/classes/Elgg/HandlersService.php
@@ -103,7 +103,6 @@ private function resolveCallable($callable) {
if (is_string($callable)
&& preg_match(DiContainer::CLASS_NAME_PATTERN_53, $callable)
&& class_exists($callable)) {
-
// @todo Eventually a more advanced DIC could auto-inject dependencies
$callable = new $callable;
}
@@ -120,7 +119,7 @@ private function resolveCallable($callable) {
*/
private function acceptsObject($callable) {
// note: caching string callables didn't help any
- $type = (string)$this->getParamTypeForCallable($callable);
+ $type = (string) $this->getParamTypeForCallable($callable);
if (0 === strpos($type, 'Elgg\\')) {
// probably right. We can just assume and let PHP handle it
return true;
@@ -160,7 +159,7 @@ public function getType(\ReflectionParameter $param) {
if (method_exists($param, 'getType')
&& ($type = $param->getType())
&& $type->isBuiltin()) {
- return (string)$type;
+ return (string) $type;
}
// can be dropped when dropping PHP7 support:
@@ -174,7 +173,7 @@ public function getType(\ReflectionParameter $param) {
}
// ReflectionParameter::__toString() doesn't require loading class
- if (preg_match('~\[\s\<\w+?>\s([\S]+)~s', (string)$param, $m)) {
+ if (preg_match('~\[\s\<\w+?>\s([\S]+)~s', (string) $param, $m)) {
if ($m[1][0] !== '$') {
return $m[1];
}
@@ -196,7 +195,7 @@ public function describeCallable($callable, $file_root = '') {
if (is_string($callable)) {
return $callable;
}
- if (is_array($callable) && array_keys($callable) === array(0, 1) && is_string($callable[1])) {
+ if (is_array($callable) && array_keys($callable) === [0, 1] && is_string($callable[1])) {
if (is_string($callable[0])) {
return "{$callable[0]}::{$callable[1]}";
}
diff --git a/engine/classes/Elgg/HooksRegistrationService.php b/engine/classes/Elgg/HooksRegistrationService.php
index 0dd895d5377..d7c79f7719a 100644
--- a/engine/classes/Elgg/HooksRegistrationService.php
+++ b/engine/classes/Elgg/HooksRegistrationService.php
@@ -78,7 +78,6 @@ public function unregisterHandler($name, $type, $callback) {
$matcher = $this->getMatcher($callback);
foreach ($this->registrations[$name][$type] as $i => $registration) {
-
if ($matcher) {
if (!$matcher->matches($registration[self::REG_KEY_HANDLER])) {
continue;
diff --git a/engine/classes/Elgg/Http/ErrorResponse.php b/engine/classes/Elgg/Http/ErrorResponse.php
index 4172742e37d..4c76f245e8a 100644
--- a/engine/classes/Elgg/Http/ErrorResponse.php
+++ b/engine/classes/Elgg/Http/ErrorResponse.php
@@ -9,7 +9,7 @@ class ErrorResponse extends OkResponse {
/**
* Constructor
- *
+ *
* @param string $error Error message
* @param int $status_code HTTP status code
* @param string $forward_url Forward url
diff --git a/engine/classes/Elgg/Http/Input.php b/engine/classes/Elgg/Http/Input.php
index 493df945b0e..1fb14d0c682 100644
--- a/engine/classes/Elgg/Http/Input.php
+++ b/engine/classes/Elgg/Http/Input.php
@@ -40,11 +40,13 @@ public function __construct() {
public function set($variable, $value) {
if (!isset($this->CONFIG->input)) {
- $this->CONFIG->input = array();
+ $this->CONFIG->input = [];
}
if (is_array($value)) {
- array_walk_recursive($value, function(&$v, $k) { $v = trim($v);});
+ array_walk_recursive($value, function(&$v, $k) { $v = trim($v);
+
+ });
$this->CONFIG->input[trim($variable)] = $value;
} else {
$this->CONFIG->input[trim($variable)] = trim($value);
@@ -104,4 +106,4 @@ function get($variable, $default = null, $filter_result = true) {
return $result;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Http/Request.php b/engine/classes/Elgg/Http/Request.php
index ed54a614975..204ef5931ae 100644
--- a/engine/classes/Elgg/Http/Request.php
+++ b/engine/classes/Elgg/Http/Request.php
@@ -24,7 +24,7 @@ public function getUrlSegments($raw = false) {
$path = htmlspecialchars($path, ENT_QUOTES, 'UTF-8');
}
if (!$path) {
- return array();
+ return [];
}
return explode('/', $path);
diff --git a/engine/classes/Elgg/Http/ResponseBuilder.php b/engine/classes/Elgg/Http/ResponseBuilder.php
index 927f9e2d0b9..7f8ff804673 100644
--- a/engine/classes/Elgg/Http/ResponseBuilder.php
+++ b/engine/classes/Elgg/Http/ResponseBuilder.php
@@ -6,7 +6,7 @@
/**
* HTTP response builder interface
- *
+ *
* @access private
*/
interface ResponseBuilder {
diff --git a/engine/classes/Elgg/Http/ResponseFactory.php b/engine/classes/Elgg/Http/ResponseFactory.php
index 1726b25263b..4e2e451fd30 100644
--- a/engine/classes/Elgg/Http/ResponseFactory.php
+++ b/engine/classes/Elgg/Http/ResponseFactory.php
@@ -51,7 +51,7 @@ class ResponseFactory {
/**
* Constructor
- *
+ *
* @param Request $request HTTP request
* @param PluginHooksService $hooks Plugin hooks service
* @param AjaxService $ajax AJAX service
@@ -110,7 +110,7 @@ public function getHeaders($remove_existing = true) {
* @param array $headers An array of response headers
* @return Response
*/
- public function prepareResponse($content = '', $status = 200, array $headers = array()) {
+ public function prepareResponse($content = '', $status = 200, array $headers = []) {
$header_bag = $this->getHeaders();
$header_bag->add($headers);
$response = new Response($content, $status, $header_bag->all());
@@ -127,7 +127,7 @@ public function prepareResponse($content = '', $status = 200, array $headers = a
* @return SymfonyRedirectResponse
* @throws InvalidArgumentException
*/
- public function prepareRedirectResponse($url, $status = 302, array $headers = array()) {
+ public function prepareRedirectResponse($url, $status = 302, array $headers = []) {
$header_bag = $this->getHeaders();
$header_bag->add($headers);
$response = new SymfonyRedirectResponse($url, $status, $header_bag->all());
@@ -211,7 +211,7 @@ public function respond(ResponseBuilder $response) {
}
if ($response->getForwardURL() !== null && !$is_xhr) {
- // non-xhr requests should issue a forward if redirect url is set
+ // non-xhr requests should issue a forward if redirect url is set
// unless it's an error, in which case we serve an error page
if ($this->isAction() || (!$response->isClientError() && !$response->isServerError())) {
$response->setStatusCode(ELGG_HTTP_FOUND);
@@ -516,7 +516,7 @@ public function isAction() {
/**
* Normalizes content into serializable data by walking through arrays
* and objectifying Elgg entities
- *
+ *
* @param mixed $content Data to normalize
* @return mixed
*/
diff --git a/engine/classes/Elgg/Http/ResponseTransport.php b/engine/classes/Elgg/Http/ResponseTransport.php
index 198c072184c..6d8b35311c2 100644
--- a/engine/classes/Elgg/Http/ResponseTransport.php
+++ b/engine/classes/Elgg/Http/ResponseTransport.php
@@ -14,7 +14,7 @@ interface ResponseTransport {
/**
* Sends HTTP response to the requester
- *
+ *
* @param Response $response Symfony Response
* @return bool
*/
diff --git a/engine/classes/Elgg/Http/WebAppManifestResource.php b/engine/classes/Elgg/Http/WebAppManifestResource.php
index 13ede92d6d9..0eac44cc6d1 100644
--- a/engine/classes/Elgg/Http/WebAppManifestResource.php
+++ b/engine/classes/Elgg/Http/WebAppManifestResource.php
@@ -21,7 +21,7 @@ class WebAppManifestResource {
/**
* Constructor
- *
+ *
* @param ElggSite $site The site serving this manifest.
*/
public function __construct(ElggSite $site) {
@@ -30,7 +30,7 @@ public function __construct(ElggSite $site) {
/**
* Behavior for HTTP GET method
- *
+ *
* @return array
*/
public function get() {
@@ -40,4 +40,4 @@ public function get() {
'start_url' => $this->site->getUrl(),
];
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/ArrayMessageBundle.php b/engine/classes/Elgg/I18n/ArrayMessageBundle.php
index 56d09dec885..50860ed2492 100644
--- a/engine/classes/Elgg/I18n/ArrayMessageBundle.php
+++ b/engine/classes/Elgg/I18n/ArrayMessageBundle.php
@@ -3,14 +3,14 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* Uses an array as a source for the message bundle.
- *
+ *
* This is mostly useful for testing so we can configure translators
* in-memory instead of going to the file system.
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
final class ArrayMessageBundle implements MessageBundle {
@@ -20,7 +20,7 @@ final class ArrayMessageBundle implements MessageBundle {
/**
* Constructor
- *
+ *
* @param array $messages Map of locales to maps of keys to message-templates
*/
public function __construct(array $messages) {
diff --git a/engine/classes/Elgg/I18n/InvalidLocaleException.php b/engine/classes/Elgg/I18n/InvalidLocaleException.php
index d8b2b38d415..7e0997e561a 100644
--- a/engine/classes/Elgg/I18n/InvalidLocaleException.php
+++ b/engine/classes/Elgg/I18n/InvalidLocaleException.php
@@ -6,4 +6,5 @@
*
* @access private
*/
-class InvalidLocaleException extends \InvalidArgumentException {}
+class InvalidLocaleException extends \InvalidArgumentException {
+}
diff --git a/engine/classes/Elgg/I18n/Locale.php b/engine/classes/Elgg/I18n/Locale.php
index ea8a8c56ea0..1e6a60bfe19 100644
--- a/engine/classes/Elgg/I18n/Locale.php
+++ b/engine/classes/Elgg/I18n/Locale.php
@@ -3,11 +3,11 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* Language class to ensure only valid languages are used.
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
final class Locale {
@@ -17,7 +17,7 @@ final class Locale {
/**
* Use Locale::parse to construct
- *
+ *
* @param string $locale A string representation of the locale
*/
private function __construct($locale) {
@@ -33,9 +33,9 @@ public function __toString() {
* Create a language, asserting that the language code is valid.
*
* @param string $locale Language code
- *
+ *
* @return Locale
- *
+ *
* @throws InvalidLocaleException
*/
public static function parse($locale) {
@@ -46,4 +46,4 @@ public static function parse($locale) {
return new Locale($locale);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/MessageBundle.php b/engine/classes/Elgg/I18n/MessageBundle.php
index 1d8cd07273f..7c6f5c7861d 100644
--- a/engine/classes/Elgg/I18n/MessageBundle.php
+++ b/engine/classes/Elgg/I18n/MessageBundle.php
@@ -3,23 +3,23 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* TODO(ewinslow): Have this extend Table(row=string, column=Locale, value=?MessageTemplate)
* if we ever support a Table data structure.
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
interface MessageBundle {
/**
* Fetches the translatable message associated with the given key
- *
+ *
* @param string $key String identifier for the message
* @param Locale $locale Locale in which the message is written
- *
+ *
* @return ?MessageTemplate The message object or null if not found.
*/
public function get($key, Locale $locale);
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/MessageTemplate.php b/engine/classes/Elgg/I18n/MessageTemplate.php
index 152e1377ede..31adfdeef50 100644
--- a/engine/classes/Elgg/I18n/MessageTemplate.php
+++ b/engine/classes/Elgg/I18n/MessageTemplate.php
@@ -3,18 +3,18 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* A single localizable message template.
- *
+ *
* We introduced this class because we want to have the flexibility of
* easily switching our message template language from sprintf to ICU...
- *
+ *
* Example messages:
* - "{subject} spent {num_nights,number,integer} nights camping in {location}." (ICU)
* - "%s spent %d nights camping in %s" (sprintf)
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
abstract class MessageTemplate {
@@ -23,7 +23,7 @@ abstract class MessageTemplate {
/**
* Constructor
- *
+ *
* @param string $template The message template
*/
public function __construct($template) {
@@ -32,19 +32,19 @@ public function __construct($template) {
/**
* Applies the inputs to the message template and returns the result.
- *
+ *
* @param array $args The inputs to this message
- *
+ *
* @return string The rendered including all the interpolated inputs
*/
public abstract function format(array $args);
/**
* Get the string template this message uses for translation.
- *
+ *
* @return string
*/
public function __toString() {
return $this->template;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/MessageTranslator.php b/engine/classes/Elgg/I18n/MessageTranslator.php
index 9357798dccf..bd1f27fca5b 100644
--- a/engine/classes/Elgg/I18n/MessageTranslator.php
+++ b/engine/classes/Elgg/I18n/MessageTranslator.php
@@ -19,7 +19,7 @@ class MessageTranslator implements TranslatorInterface {
/**
* Constructor
- *
+ *
* @param Locale $defaultLocale The fallback locale
* @param MessageBundle $messages Messages that this translator is aware of
*/
@@ -50,4 +50,4 @@ public function translate($key, array $args = [], Locale $locale = null) {
return $key;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/NullMessageTemplate.php b/engine/classes/Elgg/I18n/NullMessageTemplate.php
index e2d4c1cc34e..bcca48f3807 100644
--- a/engine/classes/Elgg/I18n/NullMessageTemplate.php
+++ b/engine/classes/Elgg/I18n/NullMessageTemplate.php
@@ -3,11 +3,11 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* A message that always ignores all parameters and just returns the template.
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
final class NullMessage extends Message {
@@ -15,4 +15,4 @@ final class NullMessage extends Message {
public function format(array $args) {
return "$this";
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/NullTranslator.php b/engine/classes/Elgg/I18n/NullTranslator.php
index d4f7b1d7f7c..d7e8fabe5b5 100644
--- a/engine/classes/Elgg/I18n/NullTranslator.php
+++ b/engine/classes/Elgg/I18n/NullTranslator.php
@@ -6,17 +6,17 @@
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* A translator that does nothing except return the key that was requested.
- *
+ *
* This translator is useful during development if you want to be able to
* easily tell what the available keys are for changing the wording of UI elements.
- *
+ *
* @since 1.10.0
*
* @access private
*/
final class NullTranslator extends Translator {
/** @inheritDoc */
- public function translate($key, $args = array(), $lang = '') {
+ public function translate($key, $args = [], $lang = '') {
return $key;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/SprintfMessageTemplate.php b/engine/classes/Elgg/I18n/SprintfMessageTemplate.php
index 7c77d3b21d0..0be52a669f3 100644
--- a/engine/classes/Elgg/I18n/SprintfMessageTemplate.php
+++ b/engine/classes/Elgg/I18n/SprintfMessageTemplate.php
@@ -3,11 +3,11 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* A message that uses vsprintf to insert arguments into the template.
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
final class SprintfMessageTemplate extends MessageTemplate {
@@ -15,4 +15,4 @@ final class SprintfMessageTemplate extends MessageTemplate {
public function format(array $args) {
return \vsprintf($this->template, $args);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/Translator.php b/engine/classes/Elgg/I18n/Translator.php
index 0aed39d2775..c4a44e15479 100644
--- a/engine/classes/Elgg/I18n/Translator.php
+++ b/engine/classes/Elgg/I18n/Translator.php
@@ -107,7 +107,7 @@ public function translate($message_key, array $args = [], $language = "") {
public function addTranslation($country_code, $language_array) {
if (!isset($GLOBALS['_ELGG']->translations)) {
- $GLOBALS['_ELGG']->translations = array();
+ $GLOBALS['_ELGG']->translations = [];
}
$country_code = strtolower($country_code);
@@ -187,9 +187,9 @@ public function loadTranslations($language = null) {
$loaded = true;
if ($language) {
- $languages = array($language);
+ $languages = [$language];
} else {
- $languages = array_unique(array('en', $this->getCurrentLanguage()));
+ $languages = array_unique(['en', $this->getCurrentLanguage()]);
}
foreach ($languages as $language) {
@@ -262,7 +262,7 @@ private function loadPluginTranslations($language) {
// Register translations from the plugin languages directory
if (!$this->registerTranslations($languages_path, false, $language)) {
throw new \PluginException(sprintf('Cannot register languages for plugin %s (guid: %s) at %s.',
- array($plugin->getID(), $plugin->guid, $languages_path)));
+ [$plugin->getID(), $plugin->guid, $languages_path]));
}
}
}
@@ -300,23 +300,23 @@ public function registerTranslations($path, $load_all = false, $language = null)
// Make a note of this path just incase we need to register this language later
if (!isset($GLOBALS['_ELGG']->language_paths)) {
- $GLOBALS['_ELGG']->language_paths = array();
+ $GLOBALS['_ELGG']->language_paths = [];
}
$GLOBALS['_ELGG']->language_paths[$path] = true;
_elgg_services()->logger->info("Translations loaded from: $path");
if ($language) {
- $load_language_files = array("$language.php");
+ $load_language_files = ["$language.php"];
$load_all = false;
} else {
// Get the current language based on site defaults and user preference
$current_language = $this->getCurrentLanguage();
- $load_language_files = array(
+ $load_language_files = [
'en.php',
"$current_language.php"
- );
+ ];
$load_language_files = array_unique($load_language_files);
}
@@ -368,7 +368,7 @@ public function reloadAllTranslations() {
if ($GLOBALS['_ELGG']->i18n_loaded_from_cache) {
$cache = elgg_get_system_cache();
$cache_dir = $cache->getVariable("cache_path");
- $filenames = elgg_get_file_list($cache_dir, array(), array(), array(".lang"));
+ $filenames = elgg_get_file_list($cache_dir, [], [], [".lang"]);
foreach ($filenames as $filename) {
// Look for files matching for example 'en.lang', 'cmn.lang' or 'pt_br.lang'.
// Note that this regex is just for the system cache. The original language
@@ -402,7 +402,7 @@ public function getInstalledTranslations() {
// Ensure that all possible translations are loaded
$this->reloadAllTranslations();
- $installed = array();
+ $installed = [];
$admin_logged_in = _elgg_services()->session->isAdminLoggedIn();
@@ -472,7 +472,7 @@ public function getMissingLanguageKeys($language) {
// Ensure that all possible translations are loaded
$this->reloadAllTranslations();
- $missing = array();
+ $missing = [];
foreach ($GLOBALS['_ELGG']->translations['en'] as $k => $v) {
if ((!isset($GLOBALS['_ELGG']->translations[$language][$k]))
@@ -701,4 +701,4 @@ public static function normalizeLanguageCode($code) {
$code = preg_replace('~[^a-z0-9]~', '_', $code);
return $code;
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/I18n/TranslatorInterface.php b/engine/classes/Elgg/I18n/TranslatorInterface.php
index d468f5a5d31..676bf970b47 100644
--- a/engine/classes/Elgg/I18n/TranslatorInterface.php
+++ b/engine/classes/Elgg/I18n/TranslatorInterface.php
@@ -3,25 +3,25 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* Can "translate" language keys into various human-readable, localized strings.
- *
+ *
* TODO(ewinslow): Remove the "Interface" suffix
- *
+ *
* @since 1.11
- *
+ *
* @access private
*/
interface TranslatorInterface {
/**
* Given a message key, returns a best-effort translated string.
- *
+ *
* If the translator doesn't know how to translate into the specified locale,
* it can try translating into a related or similar locale (e.g. en-US => en).
- *
+ *
* If no locale is specified, or if no translation can be found for the specified
* locale, the translator may choose to fall back to some other language(s).
- *
+ *
* It should never throw exceptions, since lack of translation should never be
* cause to bring down an app or cancel a request. However, implementations may
* log warnings to alert admins that requested language strings are missing.
@@ -34,4 +34,4 @@ interface TranslatorInterface {
* @return string The final, best-effort translation.
*/
function translate($key, array $args = [], Locale $locale = null);
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Logger.php b/engine/classes/Elgg/Logger.php
index 0c2a57b9489..0a1e245b885 100644
--- a/engine/classes/Elgg/Logger.php
+++ b/engine/classes/Elgg/Logger.php
@@ -20,13 +20,13 @@ class Logger {
const NOTICE = 250;
const INFO = 200;
- protected static $levels = array(
+ protected static $levels = [
0 => 'OFF',
200 => 'INFO',
250 => 'NOTICE',
300 => 'WARNING',
400 => 'ERROR',
- );
+ ];
/**
* @var int The logging level
@@ -212,12 +212,12 @@ public function dump($data, $display = true) {
protected function process($data, $display, $level) {
// plugin can return false to stop the default logging method
- $params = array(
+ $params = [
'level' => $level,
'msg' => $data,
'display' => $display,
'to_screen' => $display,
- );
+ ];
if (!$this->hooks->trigger('debug', 'log', $params, true)) {
return;
diff --git a/engine/classes/Elgg/Menu/Service.php b/engine/classes/Elgg/Menu/Service.php
index 542a6ec7990..059813b7d9a 100644
--- a/engine/classes/Elgg/Menu/Service.php
+++ b/engine/classes/Elgg/Menu/Service.php
@@ -114,7 +114,7 @@ public function prepareMenu(UnpreparedMenu $menu) {
*/
function combineMenus(array $names = [], array $params = [], $new_name = '') {
if (!$new_name) {
- $new_name = implode('__' , $names);
+ $new_name = implode('__', $names);
}
$all_items = [];
diff --git a/engine/classes/Elgg/Notifications/Event.php b/engine/classes/Elgg/Notifications/Event.php
index 891435f0e89..eb72b3d2275 100644
--- a/engine/classes/Elgg/Notifications/Event.php
+++ b/engine/classes/Elgg/Notifications/Event.php
@@ -8,7 +8,7 @@
/**
* Subscription notification event
- *
+ *
* @package Elgg.Core
* @subpackage Notifications
* @deprecated 2.3
@@ -32,11 +32,11 @@ class Event implements NotificationEvent {
* @param ElggData $object The object of the event (ElggEntity)
* @param string $action The name of the action (default: create)
* @param ElggEntity $actor The entity that caused the event (default: logged in user)
- *
+ *
* @throws InvalidArgumentException
*/
public function __construct(ElggData $object, $action, ElggEntity $actor = null) {
- if (get_class($this) == Event::class || get_class($this) == Elgg_Notifications_Event::class) {
+ if (get_class($this) == Event::class) {
_elgg_services()->deprecation->sendNotice(__CLASS__ . ' is deprecated. '
. 'Use ' . SubscriptionNotificationEvent::class . ' instead', '2.3');
}
@@ -89,7 +89,7 @@ public function getActorGUID() {
* @note Note that the actor and the object of the notification event
* may have been deleted/disabled since the event was serialized and
* stored in the database.
- *
+ *
* @return ElggData|false|null
*/
public function getObject() {
@@ -138,13 +138,3 @@ public function toObject() {
}
}
-/**
- * Notification event
- *
- * @package Elgg.Core
- * @subpackage Notifications
- * @since 1.9.0
- * @deprecated 2.3
- */
-class Elgg_Notifications_Event extends Event {}
-
diff --git a/engine/classes/Elgg/Notifications/InstantNotificationEvent.php b/engine/classes/Elgg/Notifications/InstantNotificationEvent.php
index ecd07069320..63e7fe6493c 100644
--- a/engine/classes/Elgg/Notifications/InstantNotificationEvent.php
+++ b/engine/classes/Elgg/Notifications/InstantNotificationEvent.php
@@ -65,7 +65,7 @@ public function getActor() {
* @note Note that the actor and the object of the notification event
* may have been deleted/disabled since the event was serialized and
* stored in the database.
- *
+ *
* @return int
*/
public function getActorGUID() {
@@ -78,7 +78,7 @@ public function getActorGUID() {
* @note Note that the actor and the object of the notification event
* may have been deleted/disabled since the event was serialized and
* stored in the database.
- *
+ *
* @return ElggData|false|null
*/
public function getObject() {
diff --git a/engine/classes/Elgg/Notifications/Notification.php b/engine/classes/Elgg/Notifications/Notification.php
index 9195ff6e46c..c98e0b83a9a 100644
--- a/engine/classes/Elgg/Notifications/Notification.php
+++ b/engine/classes/Elgg/Notifications/Notification.php
@@ -3,7 +3,7 @@
/**
* Notification container
- *
+ *
* @package Elgg.Core
* @subpackage Notifications
* @since 1.10
@@ -49,7 +49,7 @@ class Notification {
* @param array $params Optional array of parameters
* @throws \InvalidArgumentException
*/
- public function __construct(\ElggEntity $from, \ElggEntity $to, $language, $subject, $body, $summary = '', array $params = array()) {
+ public function __construct(\ElggEntity $from, \ElggEntity $to, $language, $subject, $body, $summary = '', array $params = []) {
if (!$from) {
throw new \InvalidArgumentException('$from is not a valid \ElggEntity');
}
diff --git a/engine/classes/Elgg/Notifications/NotificationsService.php b/engine/classes/Elgg/Notifications/NotificationsService.php
index a1aae9dbb30..02f429fa44a 100644
--- a/engine/classes/Elgg/Notifications/NotificationsService.php
+++ b/engine/classes/Elgg/Notifications/NotificationsService.php
@@ -49,16 +49,16 @@ class NotificationsService {
protected $logger;
/** @var array Registered notification events */
- protected $events = array();
+ protected $events = [];
/** @var array Registered notification methods */
- protected $methods = array();
+ protected $methods = [];
/** @var array Deprecated notification handlers */
- protected $deprHandlers = array();
+ protected $deprHandlers = [];
/** @var array Deprecated message subjects */
- protected $deprSubjects = array();
+ protected $deprSubjects = [];
/**
* Constructor
@@ -92,13 +92,13 @@ public function __construct(
* @see elgg_register_notification_event()
* @access private
*/
- public function registerEvent($type, $subtype, array $actions = array()) {
+ public function registerEvent($type, $subtype, array $actions = []) {
if (!isset($this->events[$type])) {
- $this->events[$type] = array();
+ $this->events[$type] = [];
}
if (!isset($this->events[$type][$subtype])) {
- $this->events[$type][$subtype] = array();
+ $this->events[$type][$subtype] = [];
}
$action_list =& $this->events[$type][$subtype];
@@ -179,10 +179,10 @@ public function enqueueEvent($action, $type, $object) {
}
if ($registered) {
- $params = array(
+ $params = [
'action' => $action,
'object' => $object,
- );
+ ];
$registered = $this->hooks->trigger('enqueue', 'notification', $params, $registered);
}
@@ -310,7 +310,7 @@ protected function sendNotifications($event, $subscriptions, array $params = [])
* @param ElggEntity $sender Sender of the notification
* @param ElggUser[] $recipients An array of entities to notify
* @param array $params Notification parameters
- *
+ *
* @uses $params['subject'] string
* Default message subject
* @uses $params['body'] string
@@ -363,7 +363,6 @@ public function sendInstantNotifications(\ElggEntity $sender, array $recipients
$subscriptions = [];
foreach ($recipients as $recipient) {
-
// Are we overriding delivery?
$methods = $methods_override;
if (empty($methods)) {
@@ -483,10 +482,10 @@ protected function sendNotification(NotificationEvent $event, $guid, $method, ar
if ($this->hooks->hasHandler('send', "notification:$method")) {
// return true to indicate the notification has been sent
- $params = array(
+ $params = [
'notification' => $notification,
'event' => $event,
- );
+ ];
$result = $this->hooks->trigger('send', "notification:$method", $params, false);
if ($this->logger->getLevel() == Logger::INFO) {
@@ -505,7 +504,7 @@ protected function sendNotification(NotificationEvent $event, $guid, $method, ar
$subject = $notification->subject;
$body = $notification->body;
$params = $notification->params;
- return (bool) _elgg_notify_user($userGuid, $senderGuid, $subject, $body, $params, array($method));
+ return (bool) _elgg_notify_user($userGuid, $senderGuid, $subject, $body, $params, [$method]);
}
}
@@ -537,14 +536,14 @@ private function getNotificationSubject(NotificationEvent $event, ElggUser $reci
} else {
$display_name = '';
}
- return $this->translator->translate($subject_key, array(
+ return $this->translator->translate($subject_key, [
$actor->name,
$display_name,
- ), $language);
+ ], $language);
}
// Fall back to default subject
- return $this->translator->translate('notification:subject', array($actor->name), $language);
+ return $this->translator->translate('notification:subject', [$actor->name], $language);
}
/**
@@ -604,18 +603,18 @@ private function getNotificationBody(NotificationEvent $event, ElggUser $recipie
$container_name = '';
}
- return $this->translator->translate($body_key, array(
+ return $this->translator->translate($body_key, [
$recipient->name,
$actor->name,
$display_name,
$container_name,
$object->description,
$object->getURL(),
- ), $language);
+ ], $language);
}
// Fall back to default body
- return $this->translator->translate('notification:body', array($object->getURL()), $language);
+ return $this->translator->translate('notification:body', [$object->getURL()], $language);
}
/**
@@ -650,7 +649,7 @@ public function getDeprecatedHandler($method) {
* @return array
*/
public function getMethodsAsDeprecatedGlobal() {
- $data = array();
+ $data = [];
foreach ($this->methods as $method) {
$data[$method] = 'empty';
}
@@ -670,11 +669,11 @@ protected function getDeprecatedNotificationBody(Notification $notification, Not
if (!$entity) {
return $notification;
}
- $params = array(
+ $params = [
'entity' => $entity,
'to_entity' => $notification->getRecipient(),
'method' => $method,
- );
+ ];
$subject = $this->getDeprecatedNotificationSubject($entity->getType(), $entity->getSubtype());
$string = $subject . ": " . $entity->getURL();
$body = $this->hooks->trigger('notify:entity:message', $entity->getType(), $params, $string);
@@ -704,7 +703,7 @@ public function setDeprecatedNotificationSubject($type, $subtype, $subject) {
}
if (!isset($this->deprSubjects[$type])) {
- $this->deprSubjects[$type] = array();
+ $this->deprSubjects[$type] = [];
}
$this->deprSubjects[$type][$subtype] = $subject;
diff --git a/engine/classes/Elgg/Notifications/SubscriptionsService.php b/engine/classes/Elgg/Notifications/SubscriptionsService.php
index 5c10ecc7f7f..89c95199cb9 100644
--- a/engine/classes/Elgg/Notifications/SubscriptionsService.php
+++ b/engine/classes/Elgg/Notifications/SubscriptionsService.php
@@ -34,7 +34,7 @@ class SubscriptionsService {
* @param Database $db Database object
* @param array $methods Notification delivery method names
*/
- public function __construct(Database $db, array $methods = array()) {
+ public function __construct(Database $db, array $methods = []) {
$this->db = $db;
$this->methods = $methods;
}
@@ -53,7 +53,7 @@ public function __construct(Database $db, array $methods = array()) {
*/
public function getSubscriptions(NotificationEvent $event) {
- $subscriptions = array();
+ $subscriptions = [];
if (!$this->methods) {
return $subscriptions;
@@ -74,7 +74,7 @@ public function getSubscriptions(NotificationEvent $event) {
}
}
- $params = array('event' => $event, 'origin' => Notification::ORIGIN_SUBSCRIPTIONS);
+ $params = ['event' => $event, 'origin' => Notification::ORIGIN_SUBSCRIPTIONS];
return _elgg_services()->hooks->trigger('get', 'subscriptions', $params, $subscriptions);
}
@@ -92,7 +92,7 @@ public function getSubscriptions(NotificationEvent $event) {
*/
public function getSubscriptionsForContainer($container_guid) {
- $subscriptions = array();
+ $subscriptions = [];
if (!$this->methods) {
return $subscriptions;
@@ -155,9 +155,9 @@ protected function getSubscriptionRecords($container_guid) {
// create IN clause
$rels = $this->getMethodRelationships();
if (!$rels) {
- return array();
+ return [];
}
- array_walk($rels, array($this->db, 'sanitizeString'));
+ array_walk($rels, [$this->db, 'sanitizeString']);
$methods_string = "'" . implode("','", $rels) . "'";
$db_prefix = $this->db->prefix;
@@ -175,7 +175,7 @@ protected function getSubscriptionRecords($container_guid) {
*/
protected function getMethodRelationships() {
$prefix = self::RELATIONSHIP_PREFIX;
- $names = array();
+ $names = [];
foreach ($this->methods as $method) {
$names[] = "$prefix$method";
}
diff --git a/engine/classes/Elgg/PasswordService.php b/engine/classes/Elgg/PasswordService.php
index be20f6fb431..d41fae625b0 100644
--- a/engine/classes/Elgg/PasswordService.php
+++ b/engine/classes/Elgg/PasswordService.php
@@ -3,7 +3,7 @@
/**
* PRIVATE CLASS. API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* @package Elgg.Core
* @access private
* @since 1.10.0
@@ -63,7 +63,7 @@ function generateHash($password) {
* @return bool
*/
function sendNewPasswordRequest($user_guid) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$user = _elgg_services()->entityTable->get($user_guid);
if (!$user instanceof \ElggUser) {
@@ -82,9 +82,9 @@ function sendNewPasswordRequest($user_guid) {
// generate email
$ip_address = _elgg_services()->request->getClientIp();
$message = _elgg_services()->translator->translate(
- 'email:changereq:body', array($user->name, $ip_address, $link), $user->language);
+ 'email:changereq:body', [$user->name, $ip_address, $link], $user->language);
$subject = _elgg_services()->translator->translate(
- 'email:changereq:subject', array(), $user->language);
+ 'email:changereq:subject', [], $user->language);
$params = [
'action' => 'requestnewpassword',
@@ -117,7 +117,7 @@ function forcePasswordReset($user, $password) {
$user->setPassword($password);
$ia = elgg_set_ignore_access(true);
- $result = (bool)$user->save();
+ $result = (bool) $user->save();
elgg_set_ignore_access($ia);
return $result;
@@ -133,7 +133,7 @@ function forcePasswordReset($user, $password) {
* @return bool True on success
*/
function executeNewPasswordReset($user_guid, $conf_code, $password = null) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$user = get_entity($user_guid);
if ($password === null) {
@@ -172,8 +172,8 @@ function executeNewPasswordReset($user_guid, $conf_code, $password = null) {
$ns = $reset ? 'resetpassword' : 'changepassword';
$message = _elgg_services()->translator->translate(
- "email:$ns:body", array($user->username, $password), $user->language);
- $subject = _elgg_services()->translator->translate("email:$ns:subject", array(), $user->language);
+ "email:$ns:body", [$user->username, $password], $user->language);
+ $subject = _elgg_services()->translator->translate("email:$ns:subject", [], $user->language);
$params = [
'action' => $ns,
diff --git a/engine/classes/Elgg/PersistentLoginService.php b/engine/classes/Elgg/PersistentLoginService.php
index 2659c560ade..97de5d0863c 100644
--- a/engine/classes/Elgg/PersistentLoginService.php
+++ b/engine/classes/Elgg/PersistentLoginService.php
@@ -50,14 +50,14 @@ public function __construct(
$prefix = $this->db->prefix;
$this->table = "{$prefix}users_remember_me_cookies";
- $this->time = is_numeric($time) ? (int)$time : time();
+ $this->time = is_numeric($time) ? (int) $time : time();
}
/**
* Make the user's login persistent
*
* @param \ElggUser $user The user who logged in
- *
+ *
* @return void
*/
public function makeLoginPersistent(\ElggUser $user) {
@@ -71,7 +71,7 @@ public function makeLoginPersistent(\ElggUser $user) {
/**
* Remove the persisted login token from client and server
- *
+ *
* @return void
*/
public function removePersistentLogin() {
@@ -89,7 +89,7 @@ public function removePersistentLogin() {
*
* @param \ElggUser $subject The user whose password changed
* @param \ElggUser $modifier The user who changed the password
- *
+ *
* @return void
*/
public function handlePasswordChange(\ElggUser $subject, \ElggUser $modifier = null) {
@@ -133,7 +133,7 @@ public function bootSession() {
* Replace the user's token if it's a legacy hexadecimal token
*
* @param \ElggUser $logged_in_user The logged in user
- *
+ *
* @return void
*/
public function replaceLegacyToken(\ElggUser $logged_in_user) {
@@ -150,7 +150,7 @@ public function replaceLegacyToken(\ElggUser $logged_in_user) {
* Find a user with the given hash
*
* @param string $hash The hashed token
- *
+ *
* @return \ElggUser|null
*/
public function getUserFromHash($hash) {
@@ -178,7 +178,7 @@ public function getUserFromHash($hash) {
*
* @param \ElggUser $user The user for whom we're storing the hash
* @param string $hash The hashed token
- *
+ *
* @return void
*/
protected function storeHash(\ElggUser $user, $hash) {
@@ -222,7 +222,7 @@ protected function removeHash($hash) {
*
* @param \DatabaseException $exception The exception to handle
* @param string $default The value to return if the table doesn't exist yet
- *
+ *
* @return mixed
*
* @throws \DatabaseException
@@ -240,7 +240,7 @@ protected function handleDbException(\DatabaseException $exception, $default = n
* Remove all the hashes associated with a user
*
* @param \ElggUser $user The user for whom we're removing hashes
- *
+ *
* @return void
*/
protected function removeAllHashes(\ElggUser $user) {
@@ -256,7 +256,7 @@ protected function removeAllHashes(\ElggUser $user) {
* Create a hash from the token
*
* @param string $token The token to hash
- *
+ *
* @return string
*/
protected function hashToken($token) {
@@ -269,12 +269,12 @@ protected function hashToken($token) {
* Store the token in the client cookie (or remove the cookie)
*
* @param string $token Empty string to remove cookie
- *
+ *
* @return void
*/
protected function setCookie($token) {
$cookie = new \ElggCookie($this->cookie_config['name']);
- foreach (array('expire', 'path', 'domain', 'secure', 'httponly') as $key) {
+ foreach (['expire', 'path', 'domain', 'secure', 'httponly'] as $key) {
$cookie->$key = $this->cookie_config[$key];
}
$cookie->value = $token;
@@ -288,7 +288,7 @@ protected function setCookie($token) {
* Store the token in the session (or remove it from the session)
*
* @param string $token The token to store in session. Empty string to remove.
- *
+ *
* @return void
*/
protected function setSession($token) {
@@ -315,7 +315,7 @@ protected function generateToken() {
* Is the given token a legacy MD5 hash?
*
* @param string $token The token to analyze
- *
+ *
* @return bool
*/
protected function isLegacyToken($token) {
diff --git a/engine/classes/Elgg/PluginHooksService.php b/engine/classes/Elgg/PluginHooksService.php
index b5f6f67a177..39777b483f7 100644
--- a/engine/classes/Elgg/PluginHooksService.php
+++ b/engine/classes/Elgg/PluginHooksService.php
@@ -5,11 +5,11 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* Use the elgg_* versions instead.
- *
+ *
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Hooks
* @since 1.9.0
@@ -33,7 +33,6 @@ public function trigger($name, $type, $params = null, $value = null) {
$handlers_svc = _elgg_services()->handlers;
foreach ($this->getOrderedHandlers($name, $type) as $handler) {
-
$exit_warning = null;
if (in_array($name, ['forward', 'action', 'route'])) {
diff --git a/engine/classes/Elgg/Profiler.php b/engine/classes/Elgg/Profiler.php
index 24ca2504e54..7d149cb7ea4 100644
--- a/engine/classes/Elgg/Profiler.php
+++ b/engine/classes/Elgg/Profiler.php
@@ -45,7 +45,7 @@ public function buildTree(Timer $timer) {
* @param string $prefix Prefix of period string. Leave empty.
* @return void
*/
- public function flattenTree(array &$list = [], array $tree, $prefix = '') {
+ public function flattenTree(array &$list = [], array $tree = [], $prefix = '') {
$is_root = empty($list);
if (isset($tree['periods'])) {
@@ -216,8 +216,8 @@ private function findEndTime(array $times) {
private function diffMicrotime($start, $end) {
list($start_usec, $start_sec) = explode(" ", $start);
list($end_usec, $end_sec) = explode(" ", $end);
- $diff_sec = (int)$end_sec - (int)$start_sec;
- $diff_usec = (float)$end_usec - (float)$start_usec;
- return (float)$diff_sec + $diff_usec;
+ $diff_sec = (int) $end_sec - (int) $start_sec;
+ $diff_usec = (float) $end_usec - (float) $start_usec;
+ return (float) $diff_sec + $diff_usec;
}
}
diff --git a/engine/classes/Elgg/Project/CodeStyle.php b/engine/classes/Elgg/Project/CodeStyle.php
index 10a929269a5..babb1e0b086 100644
--- a/engine/classes/Elgg/Project/CodeStyle.php
+++ b/engine/classes/Elgg/Project/CodeStyle.php
@@ -36,7 +36,7 @@ class CodeStyle {
* @return array Report of notable files
*/
public function fixDirectory($root, $dry_run = false) {
- $return = array();
+ $return = [];
$this->substr_start = strlen($this->normalizePath($root)) + 1;
@@ -75,7 +75,7 @@ public function fixDirectory($root, $dry_run = false) {
* @return string[] File paths. All directory separators will be "/"
*/
public function findFilesToAnalyze($root) {
- $files = array();
+ $files = [];
$this->substr_start = strlen($this->normalizePath($root)) + 1;
$this->findFiles(rtrim($root, '/\\'), $files);
return $files;
@@ -100,11 +100,11 @@ public function analyzeFile($filepath, $content = null) {
$old = $content;
unset($content);
- $return = array(
- self::KEY_REMAINING => array(),
- self::KEY_CORRECTIONS => array(),
+ $return = [
+ self::KEY_REMAINING => [],
+ self::KEY_CORRECTIONS => [],
self::KEY_NEW_CONTENT => null,
- );
+ ];
// remove WS after non-WS
$new = preg_replace('~(\S)[ \t]+(\r?\n)~', '$1$2', $old, -1, $count);
@@ -163,7 +163,7 @@ protected function findFiles($dir, &$files) {
}
}
- if (in_array($relative_path, array('node_modules', 'docs/_build'))) {
+ if (in_array($relative_path, ['node_modules', 'docs/_build'])) {
continue;
}
diff --git a/engine/classes/Elgg/Queue/DatabaseQueue.php b/engine/classes/Elgg/Queue/DatabaseQueue.php
index 366d1a38dac..a00c8603d1c 100644
--- a/engine/classes/Elgg/Queue/DatabaseQueue.php
+++ b/engine/classes/Elgg/Queue/DatabaseQueue.php
@@ -7,7 +7,7 @@
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Queue
* @since 1.9.0
@@ -96,7 +96,7 @@ public function size() {
$name = $this->db->sanitizeString($this->name);
$result = $this->db->getDataRow("SELECT COUNT(id) AS total FROM {$prefix}queue WHERE name = '$name'");
- return (int)$result->total;
+ return (int) $result->total;
}
}
diff --git a/engine/classes/Elgg/Queue/MemoryQueue.php b/engine/classes/Elgg/Queue/MemoryQueue.php
index 4d71d86155f..8c507b01c96 100644
--- a/engine/classes/Elgg/Queue/MemoryQueue.php
+++ b/engine/classes/Elgg/Queue/MemoryQueue.php
@@ -3,11 +3,11 @@
/**
* FIFO queue that is memory based (not persistent)
- *
+ *
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Queue
* @since 1.9.0
@@ -15,20 +15,20 @@
class MemoryQueue implements \Elgg\Queue\Queue {
/* @var array */
- protected $queue = array();
+ protected $queue = [];
/**
* Create a queue
*/
public function __construct() {
- $this->queue = array();
+ $this->queue = [];
}
/**
* {@inheritdoc}
*/
public function enqueue($item) {
- return (bool)array_push($this->queue, $item);
+ return (bool) array_push($this->queue, $item);
}
/**
@@ -42,7 +42,7 @@ public function dequeue() {
* {@inheritdoc}
*/
public function clear() {
- $this->queue = array();
+ $this->queue = [];
}
/**
diff --git a/engine/classes/Elgg/Queue/Queue.php b/engine/classes/Elgg/Queue/Queue.php
index 3ef2c52cfbf..581442d5776 100644
--- a/engine/classes/Elgg/Queue/Queue.php
+++ b/engine/classes/Elgg/Queue/Queue.php
@@ -7,7 +7,7 @@
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
*
* @access private
- *
+ *
* @package Elgg.Core
* @subpackage Queue
* @since 1.9.0
@@ -30,7 +30,7 @@ public function dequeue();
/**
* Clear all items from the queue
- *
+ *
* @return void
*/
public function clear();
diff --git a/engine/classes/Elgg/Router.php b/engine/classes/Elgg/Router.php
index dc6d46a458a..16bea19b5a4 100644
--- a/engine/classes/Elgg/Router.php
+++ b/engine/classes/Elgg/Router.php
@@ -22,7 +22,7 @@ class Router {
use Profilable;
- private $handlers = array();
+ private $handlers = [];
private $hooks;
/**
@@ -68,11 +68,11 @@ public function route(Request $request) {
// return false to stop processing the request (because you handled it)
// return a new $result array if you want to route the request differently
- $old = array(
+ $old = [
'identifier' => $identifier,
'handler' => $identifier, // backward compatibility
'segments' => $segments,
- );
+ ];
if ($this->timer) {
$this->timer->begin(['build page']);
@@ -154,7 +154,7 @@ public function unregisterPageHandler($identifier) {
/**
* Get page handlers as array of identifier => callback
- *
+ *
* @return array
*/
public function getPageHandlers() {
@@ -177,10 +177,10 @@ public function allowRewrite(Request $request) {
$identifier = '';
}
- $old = array(
+ $old = [
'identifier' => $identifier,
'segments' => $segments,
- );
+ ];
$new = _elgg_services()->hooks->trigger('route:rewrite', $identifier, $old, $old);
if ($new === $old) {
return $request;
@@ -226,7 +226,7 @@ public function isPublicPage($url = '') {
}
// default public pages
- $defaults = array(
+ $defaults = [
'walled_garden/.*',
'action/.*',
'login',
@@ -244,7 +244,7 @@ public function isPublicPage($url = '') {
'serve-file/.*',
'robots.txt',
'favicon.ico',
- );
+ ];
$params = [
'url' => $url,
diff --git a/engine/classes/Elgg/Security/UrlSigner.php b/engine/classes/Elgg/Security/UrlSigner.php
index 54931ea312d..c4644fb55a1 100644
--- a/engine/classes/Elgg/Security/UrlSigner.php
+++ b/engine/classes/Elgg/Security/UrlSigner.php
@@ -16,7 +16,7 @@ class UrlSigner {
* Normalizes and signs the URL with SHA256 HMAC key
*
* @note Signed URLs do not offer CSRF protection and should not be used instead of action tokens.
- *
+ *
* @param string $url URL to sign
* @param string $expires Expiration time
* Accepts a string suitable for strtotime()
diff --git a/engine/classes/Elgg/Structs/Collection.php b/engine/classes/Elgg/Structs/Collection.php
index 7e7cf9768cc..cc6e9b5b2fa 100644
--- a/engine/classes/Elgg/Structs/Collection.php
+++ b/engine/classes/Elgg/Structs/Collection.php
@@ -6,19 +6,19 @@
/**
* A read-only interface to a (possibly mutable) group of items.
- *
+ *
* Read-only provides some nice guarantees that can be harnessed for things
* like caching, lazy evaluation, respecting HTTP semantics of GET/HEAD, etc.
- *
+ *
* We do not extend ArrayAccess, because:
* * Collections aren't writable by default
* * Collections don't have a defined order by default
* * Collections aren't all Maps by default ;)
- *
+ *
* Extensions may provide one or more of these features.
- *
+ *
* TODO(ewinslow): If PHP had generics support, we'd add that here.
- *
+ *
* DO NOT EXTEND OR IMPLEMENT this interface outside of this package.
* Doing so would cause additions to the API to be breaking changes, which is
* not what we want. You have a couple of options for how to proceed:
@@ -34,18 +34,18 @@ interface Collection extends Countable, Iterator {
/**
* Returns a new collection only containing the elements which pass the filter.
- *
+ *
* @param callable $filter Receives an item. Return true to keep the item.
- *
+ *
* @return Collection
*/
public function filter(callable $filter);
/**
* Returns true iff the item is in this collection at least once.
- *
- * @param mixed $item The object or value to check for
- *
+ *
+ * @param mixed $item The object or value to check for
+ *
* @return boolean
*/
public function contains($item);
@@ -53,12 +53,12 @@ public function contains($item);
/**
* Take items of the collection and return a new collection
* with all the items having the $mapper applied to them.
- *
+ *
* The callable is not guaranteed to execute immediately for each item.
- *
+ *
* @param callable $mapper Returns the mapped value
- *
+ *
* @return Collection
*/
public function map(callable $mapper);
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/Structs/Collection/InMemory.php b/engine/classes/Elgg/Structs/Collection/InMemory.php
index 4628b9e9ecf..2a60affe523 100644
--- a/engine/classes/Elgg/Structs/Collection/InMemory.php
+++ b/engine/classes/Elgg/Structs/Collection/InMemory.php
@@ -5,7 +5,7 @@
/**
* Uses native PHP array to implement the Collection interface.
- *
+ *
* @since 1.10
*
* @access private
@@ -16,10 +16,10 @@ final class InMemory implements Collection {
/**
* Constructor
- *
+ *
* @param array $items The set of items in the collection
*/
- private function __construct(array $items = array()) {
+ private function __construct(array $items = []) {
$this->items = $items;
}
@@ -40,7 +40,7 @@ public function current() {
/** @inheritDoc */
public function filter(callable $filter) {
- $results = array();
+ $results = [];
foreach ($this->items as $item) {
if ($filter($item)) {
@@ -58,7 +58,7 @@ public function key() {
/** @inheritDoc */
public function map(callable $mapper) {
- $results = array();
+ $results = [];
foreach ($this->items as $item) {
$results[] = $mapper($item);
}
@@ -77,17 +77,17 @@ public function rewind() {
/** @inheritDoc */
public function valid() {
- return key($this->items) !== NULL;
+ return key($this->items) !== null;
}
/**
* Factory function for converting from an array to a ton of items.
- *
+ *
* @param array $items The list of objects to include. Generics come later.
- *
+ *
* @return self
*/
public static function fromArray(array $items) {
return new self($items);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/Elgg/SystemMessagesService.php b/engine/classes/Elgg/SystemMessagesService.php
index 9c4b471bf1b..441c0a11fcc 100644
--- a/engine/classes/Elgg/SystemMessagesService.php
+++ b/engine/classes/Elgg/SystemMessagesService.php
@@ -94,7 +94,7 @@ public function count($register_name = "") {
*/
public function addSuccessMessage($message) {
$set = $this->loadRegisters();
- foreach ((array)$message as $str) {
+ foreach ((array) $message as $str) {
$set->success[] = $str;
}
$this->saveRegisters($set);
@@ -109,7 +109,7 @@ public function addSuccessMessage($message) {
*/
public function addErrorMessage($error) {
$set = $this->loadRegisters();
- foreach ((array)$error as $str) {
+ foreach ((array) $error as $str) {
$set->error[] = $str;
}
$this->saveRegisters($set);
@@ -121,7 +121,7 @@ public function addErrorMessage($error) {
* @return RegisterSet
*/
public function loadRegisters() {
- $registers = $this->session->get(self::SESSION_KEY, array());
+ $registers = $this->session->get(self::SESSION_KEY, []);
$set = new RegisterSet();
foreach ($registers as $key => $register) {
$set->{$key} = $register;
diff --git a/engine/classes/Elgg/Translit.php b/engine/classes/Elgg/Translit.php
index 1ffe60d1f9f..29f5837e0b5 100644
--- a/engine/classes/Elgg/Translit.php
+++ b/engine/classes/Elgg/Translit.php
@@ -55,11 +55,11 @@ static public function urlize($string, $separator = '-') {
// more substitutions
// @todo put these somewhere else
- $string = strtr($string, array(
+ $string = strtr($string, [
// currency
"\xE2\x82\xAC" /* € */ => ' E ',
"\xC2\xA3" /* £ */ => ' GBP ',
- ));
+ ]);
// remove all ASCII except 0-9a-zA-Z, hyphen, underscore, and whitespace
// note: "x" modifier did not work with this pattern.
@@ -123,7 +123,7 @@ static public function transliterateAscii($utf8) {
* @return array
*/
static public function getAsciiTranslitMap() {
- return array(
+ return [
// Decompositions for Latin-1 Supplement
"\xC2\xAA" /* ª */ => 'a', "\xC2\xBA" /* º */ => 'o', "\xC3\x80" /* À */ => 'A',
"\xC3\x81" /* Á */ => 'A', "\xC3\x82" /* Â */ => 'A', "\xC3\x83" /* Ã */ => 'A',
@@ -247,7 +247,7 @@ static public function getAsciiTranslitMap() {
"\xE1\xBB\xA4" /* Ụ */ => 'U', "\xE1\xBB\xA5" /* ụ */ => 'u',
"\xE1\xBB\xB0" /* Ự */ => 'U', "\xE1\xBB\xB1" /* ự */ => 'u',
"\xE1\xBB\xB4" /* Ỵ */ => 'Y', "\xE1\xBB\xB5" /* ỵ */ => 'y',
- );
+ ];
}
/**
diff --git a/engine/classes/Elgg/Upgrade/Locator.php b/engine/classes/Elgg/Upgrade/Locator.php
index 1783557856b..df54a9298f5 100644
--- a/engine/classes/Elgg/Upgrade/Locator.php
+++ b/engine/classes/Elgg/Upgrade/Locator.php
@@ -160,12 +160,12 @@ public function getBatch($class) {
* @return boolean
*/
public function upgradeExists($upgrade_id) {
- $upgrade = $this->privateSettings->getEntities(array(
+ $upgrade = $this->privateSettings->getEntities([
'type' => 'object',
'subtype' => 'elgg_upgrade',
'private_setting_name' => 'id',
'private_setting_value' => $upgrade_id,
- ));
+ ]);
return !empty($upgrade);
}
diff --git a/engine/classes/Elgg/UpgradeService.php b/engine/classes/Elgg/UpgradeService.php
index 12a037e9154..a88237c2794 100644
--- a/engine/classes/Elgg/UpgradeService.php
+++ b/engine/classes/Elgg/UpgradeService.php
@@ -69,10 +69,10 @@ public function __construct(
* @return array $result Associative array containing possible errors
*/
public function run() {
- $result = array(
+ $result = [
'failure' => false,
'reason' => '',
- );
+ ];
// prevent someone from running the upgrade script in parallel (see #4643)
if (!$this->mutex->lock('upgrade')) {
@@ -228,7 +228,7 @@ protected function getUpgradeFiles($upgrade_path = null) {
return false;
}
- $upgrade_files = array();
+ $upgrade_files = [];
while ($upgrade_file = readdir($handle)) {
// make sure this is a wellformed upgrade.
@@ -263,7 +263,7 @@ protected function getUnprocessedUpgrades($upgrade_files = null, $processed_upgr
if ($processed_upgrades === null) {
$processed_upgrades = $this->config->get('processed_upgrades');
if (!is_array($processed_upgrades)) {
- $processed_upgrades = array();
+ $processed_upgrades = [];
}
}
diff --git a/engine/classes/Elgg/UserCapabilities.php b/engine/classes/Elgg/UserCapabilities.php
index 2d3996cb039..af2e1fe91d9 100644
--- a/engine/classes/Elgg/UserCapabilities.php
+++ b/engine/classes/Elgg/UserCapabilities.php
@@ -13,9 +13,9 @@
/**
* WARNING: API IN FLUX. DO NOT USE DIRECTLY.
- *
+ *
* Use the elgg_* versions instead.
- *
+ *
* @access private
* @since 2.2
*/
@@ -98,7 +98,7 @@ public function canEdit(ElggEntity $entity, $user_guid = 0) {
return ($container && $container->canEdit($user->guid));
});
- $params = array('entity' => $entity, 'user' => $user);
+ $params = ['entity' => $entity, 'user' => $user];
return $this->hooks->trigger('permissions_check', $entity->getType(), $params, $default);
}
diff --git a/engine/classes/Elgg/ViewsService.php b/engine/classes/Elgg/ViewsService.php
index 35bb824b86a..7911cd20779 100644
--- a/engine/classes/Elgg/ViewsService.php
+++ b/engine/classes/Elgg/ViewsService.php
@@ -275,7 +275,7 @@ public function renderView($view, array $vars = [], $ignored = false, $viewtype
if (!is_array($vars)) {
$this->logger->log("Vars in views must be an array: $view", 'ERROR');
- $vars = array();
+ $vars = [];
}
// Get the current viewtype
@@ -293,7 +293,7 @@ public function renderView($view, array $vars = [], $ignored = false, $viewtype
// allow $vars to hijack output
if (isset($vars[self::OUTPUT_KEY])) {
- return (string)$vars[self::OUTPUT_KEY];
+ return (string) $vars[self::OUTPUT_KEY];
}
$view_orig = $view;
@@ -302,7 +302,6 @@ public function renderView($view, array $vars = [], $ignored = false, $viewtype
$content = '';
foreach ($viewlist as $view) {
-
$rendering = $this->renderViewFile($view, $vars, $viewtype, $issue_missing_notice);
if ($rendering !== false) {
$content .= $rendering;
@@ -311,7 +310,6 @@ public function renderView($view, array $vars = [], $ignored = false, $viewtype
// attempt to load default view
if ($viewtype !== 'default' && $this->doesViewtypeFallback($viewtype)) {
-
$rendering = $this->renderViewFile($view, $vars, 'default', $issue_missing_notice);
if ($rendering !== false) {
$content .= $rendering;
@@ -503,7 +501,7 @@ public function isCacheableView($view) {
// build list of viewtypes to check
$current_viewtype = elgg_get_viewtype();
- $viewtypes = array($current_viewtype);
+ $viewtypes = [$current_viewtype];
if ($this->doesViewtypeFallback($current_viewtype) && $current_viewtype != 'default') {
$viewtypes[] = 'default';
diff --git a/engine/classes/Elgg/WidgetsService.php b/engine/classes/Elgg/WidgetsService.php
index c1beeaf5473..53d866d91c4 100644
--- a/engine/classes/Elgg/WidgetsService.php
+++ b/engine/classes/Elgg/WidgetsService.php
@@ -25,7 +25,7 @@ class WidgetsService {
* @see \Elgg\WidgetsService::getWidgets()
* @var array
*/
- private $widgetCache = array();
+ private $widgetCache = [];
/**
* @see elgg_get_widgets
@@ -39,25 +39,25 @@ public function getWidgets($owner_guid, $context) {
return $this->widgetCache[$widget_cache_key];
}
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'widget',
'owner_guid' => $owner_guid,
'private_setting_name' => 'context',
'private_setting_value' => $context,
'limit' => 0,
- );
+ ];
$widgets = elgg_get_entities_from_private_settings($options);
if (!$widgets) {
- return array();
+ return [];
}
- $sorted_widgets = array();
+ $sorted_widgets = [];
foreach ($widgets as $widget) {
- if (!isset($sorted_widgets[(int)$widget->column])) {
- $sorted_widgets[(int)$widget->column] = array();
+ if (!isset($sorted_widgets[(int) $widget->column])) {
+ $sorted_widgets[(int) $widget->column] = [];
}
- $sorted_widgets[(int)$widget->column][$widget->order] = $widget;
+ $sorted_widgets[(int) $widget->column][$widget->order] = $widget;
}
foreach ($sorted_widgets as $col => $widgets) {
@@ -125,11 +125,11 @@ public function canEditLayout($context, $user_guid = 0) {
$return = false;
}
- $params = array(
+ $params = [
'user' => $user,
'context' => $context,
'page_owner' => elgg_get_page_owner_entity(),
- );
+ ];
return _elgg_services()->hooks->trigger('permissions_check', 'widget_layout', $params, $return);
}
diff --git a/engine/classes/ElggAccessCollection.php b/engine/classes/ElggAccessCollection.php
index 99f6a1ce949..dd5f2bfb94e 100644
--- a/engine/classes/ElggAccessCollection.php
+++ b/engine/classes/ElggAccessCollection.php
@@ -5,7 +5,7 @@
*
* @package Elgg.Core
* @subpackage Core
- *
+ *
* @property-read int $id The unique identifier (read-only)
* @property int $owner_guid GUID of the owner
* @property string $name Name of the collection
@@ -89,7 +89,7 @@ public function delete() {
/**
* Check if user can this collection
- *
+ *
* @param int $user_guid GUID of the user
* @return bool
*/
@@ -99,7 +99,7 @@ public function canEdit($user_guid = null) {
/**
* Returns members of the access collection
- *
+ *
* @param array $options ege options
* @return ElggEntity|int|false
*/
@@ -109,7 +109,7 @@ public function getMembers(array $options = []) {
/**
* Checks if user is already in access collection
- *
+ *
* @param int $member_guid GUID of the user
* @return bool
*/
@@ -119,7 +119,7 @@ public function hasMember($member_guid = 0) {
/**
* Adds a new member to access collection
- *
+ *
* @param int $member_guid GUID of the user
* @return bool
*/
@@ -129,7 +129,7 @@ public function addMember($member_guid = 0) {
/**
* Removes a user from access collection
- *
+ *
* @param int $member_guid GUID of the user
* @return bool
*/
diff --git a/engine/classes/ElggAnnotation.php b/engine/classes/ElggAnnotation.php
index 4749a153d4a..0d9b2e3424c 100644
--- a/engine/classes/ElggAnnotation.php
+++ b/engine/classes/ElggAnnotation.php
@@ -41,7 +41,7 @@ public function __construct(\stdClass $row = null) {
$this->initializeAttributes();
if ($row) {
- foreach ((array)$row as $key => $value) {
+ foreach ((array) $row as $key => $value) {
$this->attributes[$key] = $value;
}
}
@@ -77,7 +77,7 @@ public function save() {
public function delete() {
$result = _elgg_delete_metastring_based_object_by_id($this->id, 'annotation');
if ($result) {
- _elgg_delete_river(array('annotation_id' => $this->id));
+ _elgg_delete_river(['annotation_id' => $this->id]);
}
return $result;
diff --git a/engine/classes/ElggAutoP.php b/engine/classes/ElggAutoP.php
index b9cdaa3df6e..e962b842090 100644
--- a/engine/classes/ElggAutoP.php
+++ b/engine/classes/ElggAutoP.php
@@ -7,7 +7,7 @@
*
* In DIV elements, Ps are only added when there would be at
* least two of them.
- *
+ *
* @package Elgg.Core
* @subpackage Output
*/
@@ -81,7 +81,7 @@ public function __construct() {
*/
public function process($html) {
// normalize whitespace
- $html = str_replace(array("\r\n", "\r"), "\n", $html);
+ $html = str_replace(["\r\n", "\r"], "\n", $html);
// allows preserving entities untouched
$html = str_replace('&', $this->_unique . 'AMP', $html);
@@ -95,10 +95,9 @@ public function process($html) {
// Do not load entities. May be unnecessary, better safe than sorry
$disable_load_entities = libxml_disable_entity_loader(true);
- if (!$this->_doc->loadHTML(" _doc->loadHTML(" encoding}'>{$html}"
. "")) {
-
libxml_disable_entity_loader($disable_load_entities);
return false;
}
@@ -117,7 +116,7 @@ public function process($html) {
// split AUTOPs into multiples at /\n\n+/
$html = preg_replace('/(' . $this->_unique . 'NL){2,}/', '', $html);
- $html = str_replace(array($this->_unique . 'BR', $this->_unique . 'NL', ' '),
+ $html = str_replace([$this->_unique . 'BR', $this->_unique . 'NL', ' '],
' ',
$html);
$html = str_replace(' ', '', $html);
@@ -195,8 +194,8 @@ public function process($html) {
*/
protected function addParagraphs(DOMElement $el) {
// no need to call recursively, just queue up
- $elsToProcess = array($el);
- $inlinesToProcess = array();
+ $elsToProcess = [$el];
+ $inlinesToProcess = [];
while ($el = array_shift($elsToProcess)) {
// if true, we can alter all child nodes, if not, we'll just call
// addParagraphs on each element in the descendInto list
diff --git a/engine/classes/ElggBatch.php b/engine/classes/ElggBatch.php
index 23d81dfb5a1..bb4512fa08c 100644
--- a/engine/classes/ElggBatch.php
+++ b/engine/classes/ElggBatch.php
@@ -77,7 +77,7 @@ class ElggBatch implements BatchResult {
*
* @var array
*/
- private $results = array();
+ private $results = [];
/**
* The function used to get results.
@@ -91,7 +91,7 @@ class ElggBatch implements BatchResult {
*
* @var array
*/
- private $options = array();
+ private $options = [];
/**
* The number of results to grab at a time.
@@ -175,7 +175,7 @@ class ElggBatch implements BatchResult {
*
* @var \stdClass[]
*/
- private $incompleteEntities = array();
+ private $incompleteEntities = [];
/**
* Total number of incomplete entities fetched
@@ -237,7 +237,7 @@ public function __construct($getter, $options, $callback = null, $chunk_size = 2
if ($result === true || $result === false || $result === null) {
$all_results = $result;
} else {
- $all_results = array();
+ $all_results = [];
}
}
@@ -271,7 +271,7 @@ public function reportIncompleteEntity(\stdClass $row) {
private function getNextResultsChunk() {
// always reset results.
- $this->results = array();
+ $this->results = [];
if (!isset($this->validGetter)) {
$this->validGetter = is_callable($this->getter);
@@ -305,15 +305,15 @@ private function getNextResultsChunk() {
$offset = $this->offset + $this->totalIncompletes;
}
- $current_options = array(
+ $current_options = [
'limit' => $limit,
'offset' => $offset,
'__ElggBatch' => $this,
- );
+ ];
$options = array_merge($this->options, $current_options);
- $this->incompleteEntities = array();
+ $this->incompleteEntities = [];
$this->results = call_user_func($this->getter, $options);
// batch result sets tend to be large; we don't want to cache these.
@@ -326,7 +326,7 @@ private function getNextResultsChunk() {
if ($this->incompleteEntities) {
// pad the front of the results with nulls representing the incompletes
- array_splice($this->results, 0, 0, array_pad(array(), $num_incomplete, null));
+ array_splice($this->results, 0, 0, array_pad([], $num_incomplete, null));
// ...and skip past them
reset($this->results);
for ($i = 0; $i < $num_incomplete; $i++) {
@@ -404,14 +404,14 @@ public function key() {
public function next() {
// if we'll be at the end.
if (($this->processedResults + 1) >= $this->limit && $this->limit > 0) {
- $this->results = array();
+ $this->results = [];
return false;
}
// if we'll need new results.
if (($this->resultIndex + 1) >= $this->chunkSize) {
if (!$this->getNextResultsChunk()) {
- $this->results = array();
+ $this->results = [];
return false;
}
diff --git a/engine/classes/ElggCache.php b/engine/classes/ElggCache.php
index 6bd0372dfeb..af4349dae30 100644
--- a/engine/classes/ElggCache.php
+++ b/engine/classes/ElggCache.php
@@ -18,7 +18,7 @@ abstract class ElggCache implements \ArrayAccess {
* Set the constructor.
*/
public function __construct() {
- $this->variables = array();
+ $this->variables = [];
}
/**
@@ -31,7 +31,7 @@ public function __construct() {
*/
public function setVariable($variable, $value) {
if (!is_array($this->variables)) {
- $this->variables = array();
+ $this->variables = [];
}
$this->variables[$variable] = $value;
@@ -83,7 +83,7 @@ public function __set($key, $value) {
* @return bool
*/
public function __isset($key) {
- return (bool)$this->load($key);
+ return (bool) $this->load($key);
}
/**
diff --git a/engine/classes/ElggComment.php b/engine/classes/ElggComment.php
index 337d8b93b16..40a4e95a493 100644
--- a/engine/classes/ElggComment.php
+++ b/engine/classes/ElggComment.php
@@ -1,7 +1,7 @@
expire = strtotime($time);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/ElggCrypto.php b/engine/classes/ElggCrypto.php
index 343cfafc2f5..66703311d5d 100644
--- a/engine/classes/ElggCrypto.php
+++ b/engine/classes/ElggCrypto.php
@@ -73,7 +73,8 @@ public function getRandomBytes($length) {
if (is_callable('random_bytes')) {
try {
return random_bytes($length);
- } catch (\Exception $e) {}
+ } catch (\Exception $e) {
+ }
}
$SSLstr = '4'; // http://xkcd.com/221/
@@ -180,7 +181,6 @@ public function getRandomBytes($length) {
// We assume sha1 is a deterministic extractor for the $entropy variable.
$str .= sha1($entropy, true);
-
} while ($length > strlen($str));
if ($handle) {
diff --git a/engine/classes/ElggData.php b/engine/classes/ElggData.php
index 568c4a40a44..f9adf7fd49f 100644
--- a/engine/classes/ElggData.php
+++ b/engine/classes/ElggData.php
@@ -21,7 +21,7 @@ abstract class ElggData implements
* Subclasses should add to this in their constructors.
* Any field not appearing in this will be viewed as metadata
*/
- protected $attributes = array();
+ protected $attributes = [];
/**
* Initialize the attributes array.
@@ -33,7 +33,7 @@ abstract class ElggData implements
protected function initializeAttributes() {
// Create attributes array if not already created
if (!is_array($this->attributes)) {
- $this->attributes = array();
+ $this->attributes = [];
}
$this->attributes['time_created'] = null;
@@ -93,7 +93,7 @@ public function getTimeCreated() {
/**
* Get a plain old object copy for public consumption
- *
+ *
* @return \stdClass
*/
abstract public function toObject();
diff --git a/engine/classes/ElggDiskFilestore.php b/engine/classes/ElggDiskFilestore.php
index 9d786b787ae..bbb81a0e358 100644
--- a/engine/classes/ElggDiskFilestore.php
+++ b/engine/classes/ElggDiskFilestore.php
@@ -294,7 +294,7 @@ protected function makeDirectoryRoot($dirroot) {
* @return array
*/
public function getParameters() {
- return array("dir_root" => $this->dir_root);
+ return ["dir_root" => $this->dir_root];
}
/**
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index c87f04fec09..c51eeda9e74 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -53,30 +53,30 @@ abstract class ElggEntity extends \ElggData implements
* Holds metadata until entity is saved. Once the entity is saved,
* metadata are written immediately to the database.
*/
- protected $temp_metadata = array();
+ protected $temp_metadata = [];
/**
* Holds annotations until entity is saved. Once the entity is saved,
* annotations are written immediately to the database.
*/
- protected $temp_annotations = array();
+ protected $temp_annotations = [];
/**
* Holds private settings until entity is saved. Once the entity is saved,
* private settings are written immediately to the database.
*/
- protected $temp_private_settings = array();
+ protected $temp_private_settings = [];
/**
* Volatile data structure for this object, allows for storage of data
* in-memory that isn't sync'd back to the metadata table.
*/
- protected $volatile = array();
+ protected $volatile = [];
/**
* Holds the original (persisted) attribute values that have been changed but not yet saved.
*/
- protected $orig_attributes = array();
+ protected $orig_attributes = [];
/**
* Initialize the attributes array.
@@ -121,10 +121,10 @@ public function __clone() {
return;
}
- $metadata_array = elgg_get_metadata(array(
+ $metadata_array = elgg_get_metadata([
'guid' => $this->guid,
'limit' => 0
- ));
+ ]);
$this->attributes['guid'] = "";
@@ -134,7 +134,7 @@ public function __clone() {
// handling of metadata arrays
if (is_array($metadata_array)) {
// create list of metadata names
- $metadata_names = array();
+ $metadata_names = [];
foreach ($metadata_array as $metadata) {
$metadata_names[] = $metadata['name'];
}
@@ -171,7 +171,7 @@ public function __set($name, $value) {
// if an attribute is 1 (integer) and it's set to "1" (string), don't consider that a change.
if (is_int($this->attributes[$name])
&& is_string($value)
- && ((string)$this->attributes[$name] === $value)) {
+ && ((string) $this->attributes[$name] === $value)) {
return;
}
@@ -200,7 +200,7 @@ public function __set($name, $value) {
case 'owner_guid':
case 'container_guid':
if ($value !== null) {
- $this->attributes[$name] = (int)$value;
+ $this->attributes[$name] = (int) $value;
} else {
$this->attributes[$name] = null;
}
@@ -291,19 +291,19 @@ public function getMetadata($name) {
if ($cache->isLoaded($guid)) {
return $cache->getSingle($guid, $name);
} else {
- $cache->populateFromEntities(array($guid));
+ $cache->populateFromEntities([$guid]);
// in case ignore_access was on, we have to check again...
if ($cache->isLoaded($guid)) {
return $cache->getSingle($guid, $name);
}
}
- $md = elgg_get_metadata(array(
+ $md = elgg_get_metadata([
'guid' => $guid,
'metadata_name' => $name,
'limit' => 0,
'distinct' => false,
- ));
+ ]);
$value = null;
@@ -364,18 +364,18 @@ public function setMetadata($name, $value, $value_type = '', $multiple = false,
if (is_array($value)) {
$value = array_values($value);
} else {
- $value = array($value);
+ $value = [$value];
}
// saved entity. persist md to db.
if ($this->guid) {
// if overwriting, delete first.
if (!$multiple) {
- $options = array(
+ $options = [
'guid' => $this->getGUID(),
'metadata_name' => $name,
'limit' => 0
- );
+ ];
// @todo in 1.9 make this return false if can't add metadata
// https://github.com/elgg/elgg/issues/4520
//
@@ -388,12 +388,12 @@ public function setMetadata($name, $value, $value_type = '', $multiple = false,
elgg_set_ignore_access($ia);
}
- $owner_guid = $owner_guid ? (int)$owner_guid : $this->owner_guid;
+ $owner_guid = $owner_guid ? (int) $owner_guid : $this->owner_guid;
if ($access_id === null) {
$access_id = $this->access_id;
} elseif ($access_id != ACCESS_PUBLIC) {
- $access_id = (int)$access_id;
+ $access_id = (int) $access_id;
elgg_deprecated_notice('Setting $access_id to a value other than ACCESS_PUBLIC is deprecated. '
. 'All metadata will be public in 3.0.', '2.3');
}
@@ -423,7 +423,7 @@ public function setMetadata($name, $value, $value_type = '', $multiple = false,
// if overwrite, delete first
if (!$multiple || !isset($this->temp_metadata[$name])) {
- $this->temp_metadata[$name] = array();
+ $this->temp_metadata[$name] = [];
}
// add new md
@@ -448,10 +448,10 @@ public function deleteMetadata($name = null) {
return false;
}
- $options = array(
+ $options = [
'guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['metadata_name'] = $name;
}
@@ -471,10 +471,10 @@ public function deleteOwnedMetadata($name = null) {
// access is turned off for this because they might
// no longer have access to an entity they created metadata on.
$ia = elgg_set_ignore_access(true);
- $options = array(
+ $options = [
'metadata_owner_guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['metadata_name'] = $name;
}
@@ -492,10 +492,10 @@ public function deleteOwnedMetadata($name = null) {
* @since 1.8
*/
public function disableMetadata($name = '') {
- $options = array(
+ $options = [
'guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['metadata_name'] = $name;
}
@@ -513,10 +513,10 @@ public function disableMetadata($name = '') {
* @since 1.8
*/
public function enableMetadata($name = '') {
- $options = array(
+ $options = [
'guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['metadata_name'] = $name;
}
@@ -563,7 +563,7 @@ public function storeInPersistedCache(\ElggSharedMemoryCache $cache, $last_actio
// don't store volatile data
$this->volatile = [];
if ($last_action) {
- $this->attributes['last_action'] = (int)$last_action;
+ $this->attributes['last_action'] = (int) $last_action;
}
$cache->save($this->guid, $this);
@@ -584,7 +584,7 @@ public function storeInPersistedCache(\ElggSharedMemoryCache $cache, $last_actio
* @see \ElggEntity::removeRelationship()
*/
public function deleteRelationships($relationship = null) {
- $relationship = (string)$relationship;
+ $relationship = (string) $relationship;
$result = remove_entity_relationships($this->getGUID(), $relationship);
return $result && remove_entity_relationships($this->getGUID(), $relationship, true);
}
@@ -679,10 +679,10 @@ public function removePrivateSetting($name) {
* @since 1.8
*/
public function deleteAnnotations($name = null) {
- $options = array(
+ $options = [
'guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['annotation_name'] = $name;
}
@@ -702,10 +702,10 @@ public function deleteOwnedAnnotations($name = null) {
// access is turned off for this because they might
// no longer have access to an entity they created annotations on.
$ia = elgg_set_ignore_access(true);
- $options = array(
+ $options = [
'annotation_owner_guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['annotation_name'] = $name;
}
@@ -723,10 +723,10 @@ public function deleteOwnedAnnotations($name = null) {
* @since 1.8
*/
public function disableAnnotations($name = '') {
- $options = array(
+ $options = [
'guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['annotation_name'] = $name;
}
@@ -744,10 +744,10 @@ public function disableAnnotations($name = '') {
* @since 1.8
*/
public function enableAnnotations($name = '') {
- $options = array(
+ $options = [
'guid' => $this->guid,
'limit' => 0
- );
+ ];
if ($name) {
$options['annotation_name'] = $name;
}
@@ -763,12 +763,12 @@ public function enableAnnotations($name = '') {
* @return mixed
*/
private function getAnnotationCalculation($name, $calculation) {
- $options = array(
+ $options = [
'guid' => $this->getGUID(),
'distinct' => false,
'annotation_name' => $name,
'annotation_calculation' => $calculation
- );
+ ];
return elgg_get_annotations($options);
}
@@ -818,11 +818,11 @@ public function getAnnotations(array $options = []) {
$name = elgg_extract('annotation_name', $options, '');
if (isset($this->temp_annotations[$name])) {
- return array($this->temp_annotations[$name]);
+ return [$this->temp_annotations[$name]];
}
}
- return array();
+ return [];
}
/**
@@ -887,19 +887,19 @@ public function getAnnotationsMax($name) {
* @since 1.8.0
*/
public function countComments() {
- $params = array('entity' => $this);
+ $params = ['entity' => $this];
$num = _elgg_services()->hooks->trigger('comments:count', $this->getType(), $params);
if (is_int($num)) {
return $num;
} else {
- return elgg_get_entities(array(
+ return elgg_get_entities([
'type' => 'object',
'subtype' => 'comment',
'container_guid' => $this->getGUID(),
'count' => true,
'distinct' => false,
- ));
+ ]);
}
}
@@ -927,12 +927,12 @@ public function getEntitiesFromRelationship(array $options = []) {
* @return int|false The number of entities or false on failure
*/
public function countEntitiesFromRelationship($relationship, $inverse_relationship = false) {
- return elgg_get_entities_from_relationship(array(
+ return elgg_get_entities_from_relationship([
'relationship' => $relationship,
'relationship_guid' => $this->getGUID(),
'inverse_relationship' => $inverse_relationship,
'count' => true
- ));
+ ]);
}
/**
@@ -1075,7 +1075,7 @@ public function getSubtype() {
* @return int The owner GUID
*/
public function getOwnerGUID() {
- return (int)$this->owner_guid;
+ return (int) $this->owner_guid;
}
/**
@@ -1095,7 +1095,7 @@ public function getOwnerEntity() {
* @return bool
*/
public function setContainerGUID($container_guid) {
- return $this->container_guid = (int)$container_guid;
+ return $this->container_guid = (int) $container_guid;
}
/**
@@ -1104,7 +1104,7 @@ public function setContainerGUID($container_guid) {
* @return int
*/
public function getContainerGUID() {
- return (int)$this->container_guid;
+ return (int) $this->container_guid;
}
/**
@@ -1152,7 +1152,7 @@ public function getURL() {
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromUploadedFile($input_name, $type = 'icon', array $coords = array()) {
+ public function saveIconFromUploadedFile($input_name, $type = 'icon', array $coords = []) {
return _elgg_services()->iconService->saveIconFromUploadedFile($this, $input_name, $type, $coords);
}
@@ -1164,7 +1164,7 @@ public function saveIconFromUploadedFile($input_name, $type = 'icon', array $coo
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromLocalFile($filename, $type = 'icon', array $coords = array()) {
+ public function saveIconFromLocalFile($filename, $type = 'icon', array $coords = []) {
return _elgg_services()->iconService->saveIconFromLocalFile($this, $filename, $type, $coords);
}
@@ -1176,7 +1176,7 @@ public function saveIconFromLocalFile($filename, $type = 'icon', array $coords =
* @param array $coords An array of cropping coordinates x1, y1, x2, y2
* @return bool
*/
- public function saveIconFromElggFile(\ElggFile $file, $type = 'icon', array $coords = array()) {
+ public function saveIconFromElggFile(\ElggFile $file, $type = 'icon', array $coords = []) {
return _elgg_services()->iconService->saveIconFromElggFile($this, $file, $type, $coords);
}
@@ -1236,7 +1236,7 @@ public function hasIcon($size, $type = 'icon') {
* @return string The URL
* @since 1.8.0
*/
- public function getIconURL($params = array()) {
+ public function getIconURL($params = []) {
return _elgg_services()->iconService->getIconURL($this, $params);
}
@@ -1246,7 +1246,7 @@ public function getIconURL($params = array()) {
* @return bool
*/
public function isFullyLoaded() {
- return (bool)$this->guid;
+ return (bool) $this->guid;
}
/**
@@ -1303,17 +1303,17 @@ protected function create() {
$subtype = $this->attributes['subtype'];
$subtype_id = add_subtype($type, $subtype);
- $owner_guid = (int)$this->attributes['owner_guid'];
- $access_id = (int)$this->attributes['access_id'];
+ $owner_guid = (int) $this->attributes['owner_guid'];
+ $access_id = (int) $this->attributes['access_id'];
$now = $this->getCurrentTime()->getTimestamp();
- $time_created = isset($this->attributes['time_created']) ? (int)$this->attributes['time_created'] : $now;
+ $time_created = isset($this->attributes['time_created']) ? (int) $this->attributes['time_created'] : $now;
$container_guid = $this->attributes['container_guid'];
if ($container_guid == 0) {
$container_guid = $owner_guid;
$this->attributes['container_guid'] = $container_guid;
}
- $container_guid = (int)$container_guid;
+ $container_guid = (int) $container_guid;
if ($access_id == ACCESS_DEFAULT) {
throw new \InvalidParameterException('ACCESS_DEFAULT is not a valid access level. See its documentation in elgglib.h');
@@ -1371,12 +1371,12 @@ protected function create() {
}
// for BC with 1.8, ->subtype always returns ID, ->getSubtype() the string
- $this->attributes['subtype'] = (int)$subtype_id;
- $this->attributes['guid'] = (int)$result;
- $this->attributes['time_created'] = (int)$time_created;
- $this->attributes['time_updated'] = (int)$now;
- $this->attributes['last_action'] = (int)$now;
- $this->attributes['container_guid'] = (int)$container_guid;
+ $this->attributes['subtype'] = (int) $subtype_id;
+ $this->attributes['guid'] = (int) $result;
+ $this->attributes['time_created'] = (int) $time_created;
+ $this->attributes['time_updated'] = (int) $now;
+ $this->attributes['last_action'] = (int) $now;
+ $this->attributes['container_guid'] = (int) $container_guid;
// We are writing this new entity to cache to make sure subsequent calls
// to get_entity() load entity from cache and not from the DB
@@ -1390,7 +1390,7 @@ protected function create() {
$this->$name = $value;
}
- $this->temp_metadata = array();
+ $this->temp_metadata = [];
}
// Save any unsaved annotations.
@@ -1399,7 +1399,7 @@ protected function create() {
$this->annotate($name, $value);
}
- $this->temp_annotations = array();
+ $this->temp_annotations = [];
}
// Save any unsaved private settings.
@@ -1408,7 +1408,7 @@ protected function create() {
$this->setPrivateSetting($name, $value);
}
- $this->temp_private_settings = array();
+ $this->temp_private_settings = [];
}
return $result;
@@ -1435,11 +1435,11 @@ protected function update() {
}
// See #6225. We copy these after the update event in case a handler changed one of them.
- $guid = (int)$this->guid;
- $owner_guid = (int)$this->owner_guid;
- $access_id = (int)$this->access_id;
- $container_guid = (int)$this->container_guid;
- $time_created = (int)$this->time_created;
+ $guid = (int) $this->guid;
+ $owner_guid = (int) $this->owner_guid;
+ $access_id = (int) $this->access_id;
+ $container_guid = (int) $this->container_guid;
+ $time_created = (int) $this->time_created;
$time = $this->getCurrentTime()->getTimestamp();
if ($access_id == ACCESS_DEFAULT) {
@@ -1489,7 +1489,7 @@ protected function load($guid) {
if ($row) {
// Create the array if necessary - all subclasses should test before creating
if (!is_array($this->attributes)) {
- $this->attributes = array();
+ $this->attributes = [];
}
// Now put these into the attributes array as core values
@@ -1499,10 +1499,10 @@ protected function load($guid) {
}
// guid needs to be an int https://github.com/elgg/elgg/issues/4111
- $this->attributes['guid'] = (int)$this->attributes['guid'];
+ $this->attributes['guid'] = (int) $this->attributes['guid'];
// for BC with 1.8, ->subtype always returns ID, ->getSubtype() the string
- $this->attributes['subtype'] = (int)$this->attributes['subtype'];
+ $this->attributes['subtype'] = (int) $this->attributes['subtype'];
// Cache object handle
if ($this->attributes['guid']) {
@@ -1667,7 +1667,7 @@ public function disable($reason = "", $recursive = true) {
* @return bool
*/
public function enable($recursive = true) {
- $guid = (int)$this->guid;
+ $guid = (int) $this->guid;
if (!$guid) {
return false;
}
@@ -1695,12 +1695,12 @@ public function enable($recursive = true) {
$this->enableAnnotations();
if ($recursive) {
- $disabled_with_it = elgg_get_entities_from_relationship(array(
+ $disabled_with_it = elgg_get_entities_from_relationship([
'relationship' => 'disabled_with',
'relationship_guid' => $guid,
'inverse_relationship' => true,
'limit' => 0,
- ));
+ ]);
foreach ($disabled_with_it as $e) {
$e->enable();
@@ -1819,9 +1819,9 @@ public function delete($recursive = true) {
access_show_hidden_entities($entity_disable_override);
elgg_set_ignore_access($ia);
- _elgg_delete_river(array('subject_guid' => $guid));
- _elgg_delete_river(array('object_guid' => $guid));
- _elgg_delete_river(array('target_guid' => $guid));
+ _elgg_delete_river(['subject_guid' => $guid]);
+ _elgg_delete_river(['object_guid' => $guid]);
+ _elgg_delete_river(['target_guid' => $guid]);
remove_all_private_settings($guid);
_elgg_invalidate_cache_for_entity($guid);
@@ -1850,7 +1850,7 @@ public function delete($recursive = true) {
_elgg_clear_entity_files($this);
- return (bool)$deleted;
+ return (bool) $deleted;
}
/**
@@ -1858,7 +1858,7 @@ public function delete($recursive = true) {
*/
public function toObject() {
$object = $this->prepareObject(new \stdClass());
- $params = array('entity' => $this);
+ $params = ['entity' => $this];
$object = _elgg_services()->hooks->trigger('to:object', 'entity', $params, $object);
return $object;
}
@@ -1878,7 +1878,7 @@ protected function prepareObject($object) {
$object->time_created = date('c', $this->getTimeCreated());
$object->time_updated = date('c', $this->getTimeUpdated());
$object->url = $this->getURL();
- $object->read_access = (int)$this->access_id;
+ $object->read_access = (int) $this->access_id;
return $object;
}
@@ -1927,7 +1927,7 @@ public function setLatLong($lat, $long) {
* @todo Unimplemented
*/
public function getLatitude() {
- return (float)$this->{"geo:lat"};
+ return (float) $this->{"geo:lat"};
}
/**
@@ -1937,7 +1937,7 @@ public function getLatitude() {
* @todo Unimplemented
*/
public function getLongitude() {
- return (float)$this->{"geo:long"};
+ return (float) $this->{"geo:long"};
}
/*
@@ -1976,11 +1976,11 @@ public function getObjectFromID($id) {
*/
public function getTags($tag_names = null) {
if ($tag_names && !is_array($tag_names)) {
- $tag_names = array($tag_names);
+ $tag_names = [$tag_names];
}
$valid_tags = elgg_get_registered_tag_metadata_names();
- $entity_tags = array();
+ $entity_tags = [];
foreach ($valid_tags as $tag_name) {
if (is_array($tag_names) && !in_array($tag_name, $tag_names)) {
diff --git a/engine/classes/ElggExtender.php b/engine/classes/ElggExtender.php
index 0f8a08a7bb5..21bf5376728 100644
--- a/engine/classes/ElggExtender.php
+++ b/engine/classes/ElggExtender.php
@@ -11,7 +11,7 @@
* @subpackage DataModel.Extender
* @see \ElggAnnotation
* @see \ElggMetadata
- *
+ *
* @property string $type annotation or metadata (read-only after save)
* @property int $id The unique identifier (read-only)
* @property int $entity_guid The GUID of the entity that this extender describes
@@ -64,7 +64,7 @@ public function __set($name, $value) {
/**
* Set the value of the extender
- *
+ *
* @param mixed $value The value being set
* @param string $value_type The type of the : 'integer' or 'text'
* @return void
@@ -86,7 +86,7 @@ public function __get($name) {
if ($name == 'value') {
switch ($this->attributes['value_type']) {
case 'integer' :
- return (int)$this->attributes['value'];
+ return (int) $this->attributes['value'];
break;
case 'text' :
return $this->attributes['value'];
@@ -154,10 +154,10 @@ public function toObject() {
$object->value = $this->value;
$object->time_created = date('c', $this->getTimeCreated());
$object->read_access = $this->access_id;
- $params = array(
+ $params = [
$this->getSubtype() => $this, // deprecated use
$this->getType() => $this,
- );
+ ];
if (_elgg_services()->hooks->hasHandler('to:object', $this->getSubtype())) {
_elgg_services()->deprecation->sendNotice("Triggering 'to:object' hook by extender name '{$this->getSubtype()}' has been deprecated. "
. "Use the generic 'to:object','{$this->getType()}' hook instead.", '2.3');
@@ -236,7 +236,7 @@ public function getURL() {
}
}
- $params = array('extender' => $this);
+ $params = ['extender' => $this];
$url = _elgg_services()->hooks->trigger('extender:url', $type, $params, $url);
return elgg_normalize_url($url);
diff --git a/engine/classes/ElggFile.php b/engine/classes/ElggFile.php
index 4e3008ffa79..c8fd1235d48 100644
--- a/engine/classes/ElggFile.php
+++ b/engine/classes/ElggFile.php
@@ -144,11 +144,11 @@ public function detectMimeType($file = null, $default = null) {
}
$original_filename = isset($this) && $this instanceof $class ? $this->originalfilename : basename($file);
- $params = array(
+ $params = [
'filename' => $file,
'original_filename' => $original_filename, // @see file upload action
'default' => $default,
- );
+ ];
return _elgg_services()->hooks->trigger('mime_type', 'file', $params, $mime);
}
@@ -359,9 +359,9 @@ protected function getFilestore() {
* Transfer a file to a new owner and sets a new filename,
* copies file contents to a new location.
*
- * This is an alternative to using rename() which fails to move files to
+ * This is an alternative to using rename() which fails to move files to
* a non-existent directory under new owner's filestore directory
- *
+ *
* @param int $owner_guid New owner's guid
* @param string $filename New filename (uses old filename if not set)
* @return bool
@@ -401,7 +401,7 @@ public function transfer($owner_guid, $filename = null) {
* calling this method.
*
* @param UploadedFile $upload Uploaded file object
- * @return bool
+ * @return bool
*/
public function acceptUploadedFile(UploadedFile $upload) {
if (!$upload->isValid()) {
@@ -463,10 +463,10 @@ public function acceptUploadedFile(UploadedFile $upload) {
* @return string[]
*/
public function __sleep() {
- return array_diff(array_keys(get_object_vars($this)), array(
+ return array_diff(array_keys(get_object_vars($this)), [
// a resource
'handle',
- ));
+ ]);
}
}
diff --git a/engine/classes/ElggFileCache.php b/engine/classes/ElggFileCache.php
index d887024f1d1..eb06d9c2866 100644
--- a/engine/classes/ElggFileCache.php
+++ b/engine/classes/ElggFileCache.php
@@ -147,7 +147,7 @@ public function delete($key) {
public function clear() {
$dir = $this->getVariable("cache_path");
- $exclude = array(".", "..");
+ $exclude = [".", ".."];
$files = scandir($dir);
if (!$files) {
@@ -176,7 +176,7 @@ public function __destruct() {
return;
}
- $exclude = array(".", "..");
+ $exclude = [".", ".."];
$files = scandir($dir);
if (!$files) {
diff --git a/engine/classes/ElggGroup.php b/engine/classes/ElggGroup.php
index dc945e88b8b..a6f355918a8 100644
--- a/engine/classes/ElggGroup.php
+++ b/engine/classes/ElggGroup.php
@@ -5,7 +5,7 @@
*
* @package Elgg.Core
* @subpackage Groups
- *
+ *
* @property string $name A short name that captures the purpose of the group
* @property string $description A longer body of content that gives more details about the group
*/
@@ -193,12 +193,12 @@ public function isMember(\ElggUser $user = null) {
return false;
}
- $result = (bool)check_entity_relationship($user->guid, 'member', $this->guid);
+ $result = (bool) check_entity_relationship($user->guid, 'member', $this->guid);
- $params = array(
+ $params = [
'user' => $user,
'group' => $this,
- );
+ ];
return _elgg_services()->hooks->trigger('is_member', 'group', $params, $result);
}
@@ -213,7 +213,7 @@ public function join(\ElggUser $user) {
$result = add_entity_relationship($user->guid, 'member', $this->guid);
if ($result) {
- $params = array('group' => $this, 'user' => $user);
+ $params = ['group' => $this, 'user' => $user];
_elgg_services()->events->trigger('join', 'group', $params);
}
@@ -229,7 +229,7 @@ public function join(\ElggUser $user) {
*/
public function leave(\ElggUser $user) {
// event needs to be triggered while user is still member of group to have access to group acl
- $params = array('group' => $this, 'user' => $user);
+ $params = ['group' => $this, 'user' => $user];
_elgg_services()->events->trigger('leave', 'group', $params);
return remove_entity_relationship($user->guid, 'member', $this->guid);
@@ -269,7 +269,7 @@ protected function update() {
return false;
}
- $guid = (int)$this->guid;
+ $guid = (int) $this->guid;
$name = sanitize_string($this->name);
$description = sanitize_string($this->description);
diff --git a/engine/classes/ElggInstaller.php b/engine/classes/ElggInstaller.php
index b518c79dc43..fb44922b872 100644
--- a/engine/classes/ElggInstaller.php
+++ b/engine/classes/ElggInstaller.php
@@ -31,25 +31,25 @@
*/
class ElggInstaller {
- protected $steps = array(
+ protected $steps = [
'welcome',
'requirements',
'database',
'settings',
'admin',
'complete',
- );
+ ];
- protected $status = array(
- 'config' => FALSE,
- 'database' => FALSE,
- 'settings' => FALSE,
- 'admin' => FALSE,
- );
+ protected $status = [
+ 'config' => false,
+ 'database' => false,
+ 'settings' => false,
+ 'admin' => false,
+ ];
- protected $isAction = FALSE;
+ protected $isAction = false;
- protected $autoLogin = TRUE;
+ protected $autoLogin = true;
private $view_path = '';
@@ -92,7 +92,7 @@ public function __construct() {
set_exception_handler('_elgg_php_exception_handler');
_elgg_services()->config->set('simplecache_enabled', false);
- _elgg_services()->translator->registerTranslations(\Elgg\Application::elggDir()->getPath("/install/languages/"), TRUE);
+ _elgg_services()->translator->registerTranslations(\Elgg\Application::elggDir()->getPath("/install/languages/"), true);
_elgg_services()->views->registerPluginViews(\Elgg\Application::elggDir()->getPath("/"));
}
@@ -114,7 +114,7 @@ public function run($step) {
$this->processRewriteTest();
if (!in_array($step, $this->getSteps())) {
- $msg = _elgg_services()->translator->translate('InstallationException:UnknownStep', array($step));
+ $msg = _elgg_services()->translator->translate('InstallationException:UnknownStep', [$step]);
throw new InstallationException($msg);
}
@@ -161,22 +161,22 @@ public function setAutoLogin($flag) {
* @return void
* @throws InstallationException
*/
- public function batchInstall(array $params, $createHtaccess = FALSE) {
+ public function batchInstall(array $params, $createHtaccess = false) {
restore_error_handler();
restore_exception_handler();
- $defaults = array(
+ $defaults = [
'dbhost' => 'localhost',
'dbprefix' => 'elgg_',
'language' => 'en',
'siteaccess' => ACCESS_PUBLIC,
'site_guid' => 1,
- );
+ ];
$params = array_merge($defaults, $params);
- $requiredParams = array(
+ $requiredParams = [
'dbuser',
'dbpassword',
'dbname',
@@ -187,10 +187,10 @@ public function batchInstall(array $params, $createHtaccess = FALSE) {
'email',
'username',
'password',
- );
+ ];
foreach ($requiredParams as $key) {
if (empty($params[$key])) {
- $msg = _elgg_services()->translator->translate('install:error:requiredfield', array($key));
+ $msg = _elgg_services()->translator->translate('install:error:requiredfield', [$key]);
throw new InstallationException($msg);
}
}
@@ -243,7 +243,7 @@ public function batchInstall(array $params, $createHtaccess = FALSE) {
*
* @return void
*/
- protected function render($step, $vars = array()) {
+ protected function render($step, $vars = []) {
$vars['next_step'] = $this->getNextStep($step);
$title = _elgg_services()->translator->translate("install:$step");
@@ -253,10 +253,10 @@ protected function render($step, $vars = array()) {
$title,
$body,
'default',
- array(
+ [
'step' => $step,
'steps' => $this->getSteps(),
- )
+ ]
);
exit;
}
@@ -287,7 +287,7 @@ protected function welcome($vars) {
*/
protected function requirements($vars) {
- $report = array();
+ $report = [];
// check PHP parameters and libraries
$this->checkPHP($report);
@@ -296,16 +296,16 @@ protected function requirements($vars) {
$this->checkRewriteRules($report);
// check for existence of settings file
- if ($this->checkSettingsFile($report) != TRUE) {
+ if ($this->checkSettingsFile($report) != true) {
// no file, so check permissions on engine directory
$this->isInstallDirWritable($report);
}
// check the database later
- $report['database'] = array(array(
+ $report['database'] = [[
'severity' => 'info',
'message' => _elgg_services()->translator->translate('install:check:database')
- ));
+ ]];
// any failures?
$numFailures = $this->countNumConditions($report, 'failure');
@@ -314,11 +314,11 @@ protected function requirements($vars) {
$numWarnings = $this->countNumConditions($report, 'warning');
- $params = array(
+ $params = [
'report' => $report,
'num_failures' => $numFailures,
'num_warnings' => $numWarnings,
- );
+ ];
$this->render('requirements', $params);
}
@@ -334,43 +334,43 @@ protected function requirements($vars) {
*/
protected function database($submissionVars) {
- $formVars = array(
- 'dbuser' => array(
+ $formVars = [
+ 'dbuser' => [
'type' => 'text',
'value' => '',
- 'required' => TRUE,
- ),
- 'dbpassword' => array(
+ 'required' => true,
+ ],
+ 'dbpassword' => [
'type' => 'password',
'value' => '',
- 'required' => FALSE,
- ),
- 'dbname' => array(
+ 'required' => false,
+ ],
+ 'dbname' => [
'type' => 'text',
'value' => '',
- 'required' => TRUE,
- ),
- 'dbhost' => array(
+ 'required' => true,
+ ],
+ 'dbhost' => [
'type' => 'text',
'value' => 'localhost',
- 'required' => TRUE,
- ),
- 'dbprefix' => array(
+ 'required' => true,
+ ],
+ 'dbprefix' => [
'type' => 'text',
'value' => 'elgg_',
- 'required' => TRUE,
- ),
- 'timezone' => array(
+ 'required' => true,
+ ],
+ 'timezone' => [
'type' => 'dropdown',
'value' => 'UTC',
'options' => \DateTimeZone::listIdentifiers(),
- 'required' => TRUE
- )
- );
+ 'required' => true
+ ]
+ ];
if ($this->checkSettingsFile()) {
// user manually created settings file so we fake out action test
- $this->isAction = TRUE;
+ $this->isAction = true;
}
if ($this->isAction) {
@@ -399,16 +399,16 @@ protected function database($submissionVars) {
system_message(_elgg_services()->translator->translate('install:success:database'));
$this->continueToNextStep('database');
- } while (FALSE); // PHP doesn't support breaking out of if statements
+ } while (false); // PHP doesn't support breaking out of if statements
}
$formVars = $this->makeFormSticky($formVars, $submissionVars);
- $params = array('variables' => $formVars,);
+ $params = ['variables' => $formVars,];
if ($this->checkSettingsFile()) {
// settings file exists and we're here so failed to create database
- $params['failure'] = TRUE;
+ $params['failure'] = true;
}
$this->render('database', $params);
@@ -426,33 +426,33 @@ protected function database($submissionVars) {
protected function settings($submissionVars) {
- $formVars = array(
- 'sitename' => array(
+ $formVars = [
+ 'sitename' => [
'type' => 'text',
'value' => 'My New Community',
- 'required' => TRUE,
- ),
- 'siteemail' => array(
+ 'required' => true,
+ ],
+ 'siteemail' => [
'type' => 'email',
'value' => '',
- 'required' => FALSE,
- ),
- 'wwwroot' => array(
+ 'required' => false,
+ ],
+ 'wwwroot' => [
'type' => 'url',
'value' => _elgg_services()->config->getSiteUrl(),
- 'required' => TRUE,
- ),
- 'dataroot' => array(
+ 'required' => true,
+ ],
+ 'dataroot' => [
'type' => 'text',
'value' => '',
- 'required' => TRUE,
- ),
- 'siteaccess' => array(
+ 'required' => true,
+ ],
+ 'siteaccess' => [
'type' => 'access',
'value' => ACCESS_PUBLIC,
- 'required' => TRUE,
- ),
- );
+ 'required' => true,
+ ],
+ ];
// if Apache, we give user option of having Elgg create data directory
//if (ElggRewriteTester::guessWebServer() == 'apache') {
@@ -478,13 +478,12 @@ protected function settings($submissionVars) {
system_message(_elgg_services()->translator->translate('install:success:settings'));
$this->continueToNextStep('settings');
-
- } while (FALSE); // PHP doesn't support breaking out of if statements
+ } while (false); // PHP doesn't support breaking out of if statements
}
$formVars = $this->makeFormSticky($formVars, $submissionVars);
- $this->render('settings', array('variables' => $formVars));
+ $this->render('settings', ['variables' => $formVars]);
}
/**
@@ -497,34 +496,34 @@ protected function settings($submissionVars) {
* @return void
*/
protected function admin($submissionVars) {
- $formVars = array(
- 'displayname' => array(
+ $formVars = [
+ 'displayname' => [
'type' => 'text',
'value' => '',
- 'required' => TRUE,
- ),
- 'email' => array(
+ 'required' => true,
+ ],
+ 'email' => [
'type' => 'email',
'value' => '',
- 'required' => TRUE,
- ),
- 'username' => array(
+ 'required' => true,
+ ],
+ 'username' => [
'type' => 'text',
'value' => '',
- 'required' => TRUE,
- ),
- 'password1' => array(
+ 'required' => true,
+ ],
+ 'password1' => [
'type' => 'password',
'value' => '',
- 'required' => TRUE,
+ 'required' => true,
'pattern' => '.{6,}',
- ),
- 'password2' => array(
+ ],
+ 'password2' => [
'type' => 'password',
'value' => '',
- 'required' => TRUE,
- ),
- );
+ 'required' => true,
+ ],
+ ];
if ($this->isAction) {
do {
@@ -539,8 +538,7 @@ protected function admin($submissionVars) {
system_message(_elgg_services()->translator->translate('install:success:admin'));
$this->continueToNextStep('admin');
-
- } while (FALSE); // PHP doesn't support breaking out of if statements
+ } while (false); // PHP doesn't support breaking out of if statements
}
// bit of a hack to get the password help to show right number of characters
@@ -552,7 +550,7 @@ protected function admin($submissionVars) {
$formVars = $this->makeFormSticky($formVars, $submissionVars);
- $this->render('admin', array('variables' => $formVars));
+ $this->render('admin', ['variables' => $formVars]);
}
/**
@@ -562,7 +560,7 @@ protected function admin($submissionVars) {
*/
protected function complete() {
- $params = array();
+ $params = [];
if ($this->autoLogin) {
$params['destination'] = 'admin';
} else {
@@ -593,7 +591,7 @@ protected function getSteps() {
* @return void
*/
protected function continueToNextStep($currentStep) {
- $this->isAction = FALSE;
+ $this->isAction = false;
forward($this->getNextStepUrl($currentStep));
}
@@ -638,7 +636,7 @@ protected function setInstallStatus() {
$this->loadSettingsFile();
- $this->status['config'] = TRUE;
+ $this->status['config'] = true;
// must be able to connect to database to jump install steps
$dbSettingsPass = $this->checkDatabaseSettings(
@@ -648,12 +646,12 @@ protected function setInstallStatus() {
$this->CONFIG->dbhost
);
- if ($dbSettingsPass == FALSE) {
+ if ($dbSettingsPass == false) {
return;
}
if (!include_once(\Elgg\Application::elggDir()->getPath("engine/lib/database.php"))) {
- throw new InstallationException(_elgg_services()->translator->translate('InstallationException:MissingLibrary', array('database.php')));
+ throw new InstallationException(_elgg_services()->translator->translate('InstallationException:MissingLibrary', ['database.php']));
}
// check that the config table has been created
@@ -663,10 +661,10 @@ protected function setInstallStatus() {
foreach ($result as $table) {
$table = (array) $table;
if (in_array("{$this->CONFIG->dbprefix}config", $table)) {
- $this->status['database'] = TRUE;
+ $this->status['database'] = true;
}
}
- if ($this->status['database'] == FALSE) {
+ if ($this->status['database'] == false) {
return;
}
} else {
@@ -678,7 +676,7 @@ protected function setInstallStatus() {
$query = "SELECT COUNT(*) AS total FROM {$this->CONFIG->dbprefix}config";
$result = _elgg_services()->db->getData($query);
if ($result && $result[0]->total > 0) {
- $this->status['settings'] = TRUE;
+ $this->status['settings'] = true;
} else {
return;
}
@@ -687,7 +685,7 @@ protected function setInstallStatus() {
$query = "SELECT COUNT(*) AS total FROM {$this->CONFIG->dbprefix}users_entity";
$result = _elgg_services()->db->getData($query);
if ($result && $result[0]->total > 0) {
- $this->status['admin'] = TRUE;
+ $this->status['admin'] = true;
} else {
return;
}
@@ -703,7 +701,7 @@ protected function setInstallStatus() {
*/
protected function checkInstallCompletion($step) {
if ($step != 'complete') {
- if (!in_array(FALSE, $this->status)) {
+ if (!in_array(false, $this->status)) {
// install complete but someone is trying to view an install page
forward();
}
@@ -724,15 +722,15 @@ protected function resumeInstall($step) {
return;
}
- if ($this->status['database'] == FALSE) {
+ if ($this->status['database'] == false) {
return;
}
- if ($this->status['settings'] == FALSE) {
+ if ($this->status['settings'] == false) {
forward("install.php?step=settings");
}
- if ($this->status['admin'] == FALSE) {
+ if ($this->status['admin'] == false) {
forward("install.php?step=admin");
}
@@ -789,7 +787,7 @@ protected function finishBootstraping($step) {
$this->loadSettingsFile();
- $lib_files = array(
+ $lib_files = [
// these want to be loaded first apparently?
'autoloader.php',
'database.php',
@@ -822,11 +820,11 @@ protected function finishBootstraping($step) {
'users.php',
'upgrade.php',
'widgets.php',
- );
+ ];
foreach ($lib_files as $file) {
if (!include_once($lib_dir->getPath($file))) {
- throw new InstallationException('InstallationException:MissingLibrary', array($file));
+ throw new InstallationException('InstallationException:MissingLibrary', [$file]);
}
}
@@ -859,8 +857,8 @@ protected function bootstrapConfig() {
$this->CONFIG->path = \Elgg\Application::elggDir()->getPath() . "/";
$this->view_path = $this->CONFIG->path . 'views/';
$this->CONFIG->pluginspath = $this->CONFIG->path . 'mod/';
- $this->CONFIG->context = array();
- $this->CONFIG->entity_types = array('group', 'object', 'site', 'user');
+ $this->CONFIG->context = [];
+ $this->CONFIG->entity_types = ['group', 'object', 'site', 'user'];
// required by elgg_view_page()
$this->CONFIG->sitename = '';
@@ -931,7 +929,7 @@ protected function loadSettingsFile() {
* @return array
*/
protected function getPostVariables() {
- $vars = array();
+ $vars = [];
foreach ($_POST as $k => $v) {
$vars[$k] = $v;
}
@@ -953,14 +951,12 @@ protected function makeFormSticky($formVars, $submissionVars) {
return $formVars;
}
- /**
- * Requirement checks support methods
- */
+ /* Requirement checks support methods */
/**
* Indicates whether the webserver can add settings.php on its own or not.
*
- * @param array &$report The requirements report object
+ * @param array $report The requirements report object
*
* @return bool
*/
@@ -977,42 +973,42 @@ protected function isInstallDirWritable(&$report) {
$writable = is_writable(Directory\Local::root()->getPath('elgg-config'));
if (!$writable) {
- $report['settings'] = array(
- array(
+ $report['settings'] = [
+ [
'severity' => 'failure',
'message' => _elgg_services()->translator->translate('install:check:installdir', [$relative_path]),
- )
- );
- return FALSE;
+ ]
+ ];
+ return false;
}
- return TRUE;
+ return true;
}
/**
* Check that the settings file exists
*
- * @param array &$report The requirements report array
+ * @param array $report The requirements report array
*
* @return bool
*/
- protected function checkSettingsFile(&$report = array()) {
+ protected function checkSettingsFile(&$report = []) {
if (!file_exists($this->getSettingsPath())) {
- return FALSE;
+ return false;
}
if (!is_readable($this->getSettingsPath())) {
- $report['settings'] = array(
- array(
+ $report['settings'] = [
+ [
'severity' => 'failure',
'message' => _elgg_services()->translator->translate('install:check:readsettings'),
- )
- );
+ ]
+ ];
}
- return TRUE;
+ return true;
}
/**
@@ -1027,19 +1023,19 @@ private function getSettingsPath() {
/**
* Check version of PHP, extensions, and variables
*
- * @param array &$report The requirements report array
+ * @param array $report The requirements report array
*
* @return void
*/
protected function checkPHP(&$report) {
- $phpReport = array();
+ $phpReport = [];
$min_php_version = '5.6.0';
if (version_compare(PHP_VERSION, $min_php_version, '<')) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'failure',
- 'message' => _elgg_services()->translator->translate('install:check:php:version', array($min_php_version, PHP_VERSION))
- );
+ 'message' => _elgg_services()->translator->translate('install:check:php:version', [$min_php_version, PHP_VERSION])
+ ];
}
$this->checkPhpExtensions($phpReport);
@@ -1047,10 +1043,10 @@ protected function checkPHP(&$report) {
$this->checkPhpDirectives($phpReport);
if (count($phpReport) == 0) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'pass',
'message' => _elgg_services()->translator->translate('install:check:php:success')
- );
+ ];
}
$report['php'] = $phpReport;
@@ -1059,36 +1055,36 @@ protected function checkPHP(&$report) {
/**
* Check the server's PHP extensions
*
- * @param array &$phpReport The PHP requirements report array
+ * @param array $phpReport The PHP requirements report array
*
* @return void
*/
protected function checkPhpExtensions(&$phpReport) {
$extensions = get_loaded_extensions();
- $requiredExtensions = array(
+ $requiredExtensions = [
'pdo_mysql',
'json',
'xml',
'gd',
- );
+ ];
foreach ($requiredExtensions as $extension) {
if (!in_array($extension, $extensions)) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'failure',
- 'message' => _elgg_services()->translator->translate('install:check:php:extension', array($extension))
- );
+ 'message' => _elgg_services()->translator->translate('install:check:php:extension', [$extension])
+ ];
}
}
- $recommendedExtensions = array(
+ $recommendedExtensions = [
'mbstring',
- );
+ ];
foreach ($recommendedExtensions as $extension) {
if (!in_array($extension, $extensions)) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'warning',
- 'message' => _elgg_services()->translator->translate('install:check:php:extension:recommend', array($extension))
- );
+ 'message' => _elgg_services()->translator->translate('install:check:php:extension:recommend', [$extension])
+ ];
}
}
}
@@ -1096,53 +1092,53 @@ protected function checkPhpExtensions(&$phpReport) {
/**
* Check PHP parameters
*
- * @param array &$phpReport The PHP requirements report array
+ * @param array $phpReport The PHP requirements report array
*
* @return void
*/
protected function checkPhpDirectives(&$phpReport) {
if (ini_get('open_basedir')) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'warning',
'message' => _elgg_services()->translator->translate("install:check:php:open_basedir")
- );
+ ];
}
if (ini_get('safe_mode')) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'warning',
'message' => _elgg_services()->translator->translate("install:check:php:safe_mode")
- );
+ ];
}
if (ini_get('arg_separator.output') !== '&') {
$separator = htmlspecialchars(ini_get('arg_separator.output'));
- $msg = _elgg_services()->translator->translate("install:check:php:arg_separator", array($separator));
- $phpReport[] = array(
+ $msg = _elgg_services()->translator->translate("install:check:php:arg_separator", [$separator]);
+ $phpReport[] = [
'severity' => 'failure',
'message' => $msg,
- );
+ ];
}
if (ini_get('register_globals')) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'failure',
'message' => _elgg_services()->translator->translate("install:check:php:register_globals")
- );
+ ];
}
if (ini_get('session.auto_start')) {
- $phpReport[] = array(
+ $phpReport[] = [
'severity' => 'failure',
'message' => _elgg_services()->translator->translate("install:check:php:session.auto_start")
- );
+ ];
}
}
/**
* Confirm that the rewrite rules are firing
*
- * @param array &$report The requirements report array
+ * @param array $report The requirements report array
*
* @return void
*/
@@ -1151,7 +1147,7 @@ protected function checkRewriteRules(&$report) {
$tester = new ElggRewriteTester();
$url = _elgg_services()->config->getSiteUrl() . "rewrite.php";
- $report['rewrite'] = array($tester->run($url, Directory\Local::root()->getPath()));
+ $report['rewrite'] = [$tester->run($url, Directory\Local::root()->getPath())];
}
/**
@@ -1161,7 +1157,7 @@ protected function checkRewriteRules(&$report) {
* @return void
*/
protected function processRewriteTest() {
- if (strpos($_SERVER['REQUEST_URI'], 'rewrite.php') !== FALSE) {
+ if (strpos($_SERVER['REQUEST_URI'], 'rewrite.php') !== false) {
echo \Elgg\Application::REWRITE_TEST_OUTPUT;
exit;
}
@@ -1204,10 +1200,10 @@ protected function countNumConditions($report, $condition) {
protected function validateDatabaseVars($submissionVars, $formVars) {
foreach ($formVars as $field => $info) {
- if ($info['required'] == TRUE && !$submissionVars[$field]) {
+ if ($info['required'] == true && !$submissionVars[$field]) {
$name = _elgg_services()->translator->translate("install:database:label:$field");
- register_error(_elgg_services()->translator->translate('install:error:requiredfield', array($name)));
- return FALSE;
+ register_error(_elgg_services()->translator->translate('install:error:requiredfield', [$name]));
+ return false;
}
}
@@ -1218,7 +1214,7 @@ protected function validateDatabaseVars($submissionVars, $formVars) {
// Refs #4994
if (!preg_match("/^[a-zA-Z_][\w]*$/", $submissionVars['dbprefix'])) {
register_error(_elgg_services()->translator->translate('install:error:database_prefix'));
- return FALSE;
+ return false;
}
return $this->checkDatabaseSettings(
@@ -1240,7 +1236,7 @@ protected function validateDatabaseVars($submissionVars, $formVars) {
* @return bool
*/
protected function checkDatabaseSettings($user, $password, $dbname, $host) {
- $config = new \Elgg\Database\Config((object)[
+ $config = new \Elgg\Database\Config((object) [
'dbhost' => $host,
'dbuser' => $user,
'dbpass' => $password,
@@ -1254,9 +1250,9 @@ protected function checkDatabaseSettings($user, $password, $dbname, $host) {
if (0 === strpos($e->getMessage(), "Elgg couldn't connect")) {
register_error(_elgg_services()->translator->translate('install:error:databasesettings'));
} else {
- register_error(_elgg_services()->translator->translate('install:error:nodatabase', array($dbname)));
+ register_error(_elgg_services()->translator->translate('install:error:nodatabase', [$dbname]));
}
- return FALSE;
+ return false;
}
// check MySQL version - must be 5.0 or >
@@ -1264,11 +1260,11 @@ protected function checkDatabaseSettings($user, $password, $dbname, $host) {
$required_version = 5.0;
$points = explode('.', $version);
if ($points[0] < $required_version) {
- register_error(_elgg_services()->translator->translate('install:error:oldmysql', array($version)));
- return FALSE;
+ register_error(_elgg_services()->translator->translate('install:error:oldmysql', [$version]));
+ return false;
}
- return TRUE;
+ return true;
}
/**
@@ -1282,7 +1278,7 @@ protected function createSettingsFile($params) {
$template = \Elgg\Application::elggDir()->getContents("elgg-config/settings.example.php");
if (!$template) {
register_error(_elgg_services()->translator->translate('install:error:readsettingsphp'));
- return FALSE;
+ return false;
}
foreach ($params as $k => $v) {
@@ -1292,10 +1288,10 @@ protected function createSettingsFile($params) {
$result = file_put_contents($this->getSettingsPath(), $template);
if (!$result) {
register_error(_elgg_services()->translator->translate('install:error:writesettingphp'));
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/**
@@ -1308,22 +1304,22 @@ protected function connectToDatabase() {
if (!include_once($this->getSettingsPath())) {
register_error('Elgg could not load the settings file. It does not exist or there is a file permissions issue.');
- return FALSE;
+ return false;
}
if (!include_once(\Elgg\Application::elggDir()->getPath("engine/lib/database.php"))) {
register_error('Could not load database.php');
- return FALSE;
+ return false;
}
- try {
+ try {
_elgg_services()->db->setupConnections();
} catch (DatabaseException $e) {
register_error($e->getMessage());
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/**
@@ -1342,10 +1338,10 @@ protected function installDatabase() {
$msg = _elgg_services()->translator->translate('install:error:tables_exist');
}
register_error($msg);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/**
@@ -1355,20 +1351,20 @@ protected function installDatabase() {
/**
* Create the data directory if requested
*
- * @param array &$submissionVars Submitted vars
- * @param array $formVars Variables in the form
+ * @param array $submissionVars Submitted vars
+ * @param array $formVars Variables in the form
*
* @return bool
*/
protected function createDataDirectory(&$submissionVars, $formVars) {
// did the user have option of Elgg creating the data directory
if ($formVars['dataroot']['type'] != 'combo') {
- return TRUE;
+ return true;
}
// did the user select the option
if ($submissionVars['dataroot'] != 'dataroot-checkbox') {
- return TRUE;
+ return true;
}
$dir = sanitise_filepath($submissionVars['path']) . 'data';
@@ -1377,13 +1373,13 @@ protected function createDataDirectory(&$submissionVars, $formVars) {
if (!file_exists("$dir/.htaccess")) {
$htaccess = "Order Deny,Allow\nDeny from All\n";
if (!file_put_contents("$dir/.htaccess", $htaccess)) {
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/**
@@ -1399,62 +1395,62 @@ protected function validateSettingsVars($submissionVars, $formVars) {
foreach ($formVars as $field => $info) {
$submissionVars[$field] = trim($submissionVars[$field]);
- if ($info['required'] == TRUE && $submissionVars[$field] === '') {
+ if ($info['required'] == true && $submissionVars[$field] === '') {
$name = _elgg_services()->translator->translate("install:settings:label:$field");
- register_error(_elgg_services()->translator->translate('install:error:requiredfield', array($name)));
- return FALSE;
+ register_error(_elgg_services()->translator->translate('install:error:requiredfield', [$name]));
+ return false;
}
}
// check that data root is absolute path
if (stripos(PHP_OS, 'win') === 0) {
if (strpos($submissionVars['dataroot'], ':') !== 1) {
- $msg = _elgg_services()->translator->translate('install:error:relative_path', array($submissionVars['dataroot']));
+ $msg = _elgg_services()->translator->translate('install:error:relative_path', [$submissionVars['dataroot']]);
register_error($msg);
- return FALSE;
+ return false;
}
} else {
if (strpos($submissionVars['dataroot'], '/') !== 0) {
- $msg = _elgg_services()->translator->translate('install:error:relative_path', array($submissionVars['dataroot']));
+ $msg = _elgg_services()->translator->translate('install:error:relative_path', [$submissionVars['dataroot']]);
register_error($msg);
- return FALSE;
+ return false;
}
}
// check that data root exists
if (!file_exists($submissionVars['dataroot'])) {
- $msg = _elgg_services()->translator->translate('install:error:datadirectoryexists', array($submissionVars['dataroot']));
+ $msg = _elgg_services()->translator->translate('install:error:datadirectoryexists', [$submissionVars['dataroot']]);
register_error($msg);
- return FALSE;
+ return false;
}
// check that data root is writable
if (!is_writable($submissionVars['dataroot'])) {
- $msg = _elgg_services()->translator->translate('install:error:writedatadirectory', array($submissionVars['dataroot']));
+ $msg = _elgg_services()->translator->translate('install:error:writedatadirectory', [$submissionVars['dataroot']]);
register_error($msg);
- return FALSE;
+ return false;
}
if (!isset($this->CONFIG->data_dir_override) || !$this->CONFIG->data_dir_override) {
// check that data root is not subdirectory of Elgg root
if (stripos($submissionVars['dataroot'], $submissionVars['path']) === 0) {
- $msg = _elgg_services()->translator->translate('install:error:locationdatadirectory', array($submissionVars['dataroot']));
+ $msg = _elgg_services()->translator->translate('install:error:locationdatadirectory', [$submissionVars['dataroot']]);
register_error($msg);
- return FALSE;
+ return false;
}
}
// check that email address is email address
if ($submissionVars['siteemail'] && !is_email_address($submissionVars['siteemail'])) {
- $msg = _elgg_services()->translator->translate('install:error:emailaddress', array($submissionVars['siteemail']));
+ $msg = _elgg_services()->translator->translate('install:error:emailaddress', [$submissionVars['siteemail']]);
register_error($msg);
- return FALSE;
+ return false;
}
// @todo check that url is a url
// @note filter_var cannot be used because it doesn't work on international urls
- return TRUE;
+ return true;
}
/**
@@ -1480,7 +1476,7 @@ protected function saveSiteSettings($submissionVars) {
if (!$guid) {
register_error(_elgg_services()->translator->translate('install:error:createsite'));
- return FALSE;
+ return false;
}
// bootstrap site info
@@ -1502,8 +1498,8 @@ protected function saveSiteSettings($submissionVars) {
_elgg_services()->configTable->set('view', 'default', $site->getGUID());
_elgg_services()->configTable->set('language', 'en', $site->getGUID());
_elgg_services()->configTable->set('default_access', $submissionVars['siteaccess'], $site->getGUID());
- _elgg_services()->configTable->set('allow_registration', TRUE, $site->getGUID());
- _elgg_services()->configTable->set('walled_garden', FALSE, $site->getGUID());
+ _elgg_services()->configTable->set('allow_registration', true, $site->getGUID());
+ _elgg_services()->configTable->set('walled_garden', false, $site->getGUID());
_elgg_services()->configTable->set('allow_user_default_access', '', $site->getGUID());
_elgg_services()->configTable->set('default_limit', 10, $site->getGUID());
_elgg_services()->configTable->set('security_protect_upgrade', true, $site->getGUID());
@@ -1515,7 +1511,7 @@ protected function saveSiteSettings($submissionVars) {
$this->enablePlugins();
- return TRUE;
+ return true;
}
/**
@@ -1566,37 +1562,37 @@ protected function enablePlugins() {
protected function validateAdminVars($submissionVars, $formVars) {
foreach ($formVars as $field => $info) {
- if ($info['required'] == TRUE && !$submissionVars[$field]) {
+ if ($info['required'] == true && !$submissionVars[$field]) {
$name = _elgg_services()->translator->translate("install:admin:label:$field");
- register_error(_elgg_services()->translator->translate('install:error:requiredfield', array($name)));
- return FALSE;
+ register_error(_elgg_services()->translator->translate('install:error:requiredfield', [$name]));
+ return false;
}
}
if ($submissionVars['password1'] !== $submissionVars['password2']) {
register_error(_elgg_services()->translator->translate('install:admin:password:mismatch'));
- return FALSE;
+ return false;
}
if (trim($submissionVars['password1']) == "") {
register_error(_elgg_services()->translator->translate('install:admin:password:empty'));
- return FALSE;
+ return false;
}
$minLength = _elgg_services()->configTable->get('min_password_length');
if (strlen($submissionVars['password1']) < $minLength) {
register_error(_elgg_services()->translator->translate('install:admin:password:tooshort'));
- return FALSE;
+ return false;
}
// check that email address is email address
if ($submissionVars['email'] && !is_email_address($submissionVars['email'])) {
- $msg = _elgg_services()->translator->translate('install:error:emailaddress', array($submissionVars['email']));
+ $msg = _elgg_services()->translator->translate('install:error:emailaddress', [$submissionVars['email']]);
register_error($msg);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/**
@@ -1607,7 +1603,7 @@ protected function validateAdminVars($submissionVars, $formVars) {
*
* @return bool
*/
- protected function createAdminAccount($submissionVars, $login = FALSE) {
+ protected function createAdminAccount($submissionVars, $login = false) {
try {
$guid = register_user(
$submissionVars['username'],
@@ -1631,8 +1627,8 @@ protected function createAdminAccount($submissionVars, $login = FALSE) {
return false;
}
- elgg_set_ignore_access(TRUE);
- if ($user->makeAdmin() == FALSE) {
+ elgg_set_ignore_access(true);
+ if ($user->makeAdmin() == false) {
register_error(_elgg_services()->translator->translate('install:error:adminaccess'));
} else {
_elgg_services()->configTable->set('admin_registered', 1);
@@ -1640,7 +1636,7 @@ protected function createAdminAccount($submissionVars, $login = FALSE) {
elgg_set_ignore_access(false);
// add validation data to satisfy user validation plugins
- create_metadata($guid, 'validated', TRUE, '', 0, ACCESS_PUBLIC);
+ create_metadata($guid, 'validated', true, '', 0, ACCESS_PUBLIC);
create_metadata($guid, 'validated_method', 'admin_user', '', 0, ACCESS_PUBLIC);
if ($login) {
@@ -1656,11 +1652,11 @@ protected function createAdminAccount($submissionVars, $login = FALSE) {
$session = new ElggSession(new Symfony\Component\HttpFoundation\Session\Session($storage));
$session->setName('Elgg');
_elgg_services()->setValue('session', $session);
- if (login($user) == FALSE) {
+ if (login($user) == false) {
register_error(_elgg_services()->translator->translate('install:error:adminlogin'));
}
}
- return TRUE;
+ return true;
}
}
diff --git a/engine/classes/ElggMemcache.php b/engine/classes/ElggMemcache.php
index 3f6b5d2b180..97f3433107f 100644
--- a/engine/classes/ElggMemcache.php
+++ b/engine/classes/ElggMemcache.php
@@ -47,7 +47,7 @@ public function __construct($namespace = 'default', \Stash\Pool $pool = null, $t
}
// make sure memcache is reset
- _elgg_services()->events->registerHandler('cache:flush', 'system', array($this, 'clear'));
+ _elgg_services()->events->registerHandler('cache:flush', 'system', [$this, 'clear']);
}
/**
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php
index ea82ca4726c..8cf75289005 100644
--- a/engine/classes/ElggMenuBuilder.php
+++ b/engine/classes/ElggMenuBuilder.php
@@ -11,7 +11,7 @@ class ElggMenuBuilder {
/**
* @var \ElggMenuItem[]
*/
- protected $menu = array();
+ protected $menu = [];
protected $selected = null;
@@ -61,12 +61,12 @@ public function getSelected() {
*/
protected function selectFromContext() {
if (!isset($this->menu)) {
- $this->menu = array();
+ $this->menu = [];
return;
}
// get menu items for this context
- $selected_menu = array();
+ $selected_menu = [];
foreach ($this->menu as $menu_item) {
if (!is_object($menu_item)) {
_elgg_services()->logger->error("A non-object was passed to \ElggMenuBuilder");
@@ -82,14 +82,14 @@ protected function selectFromContext() {
/**
* Group the menu items into sections
- *
+ *
* @return void
*/
protected function setupSections() {
- $sectioned_menu = array();
+ $sectioned_menu = [];
foreach ($this->menu as $menu_item) {
if (!isset($sectioned_menu[$menu_item->getSection()])) {
- $sectioned_menu[$menu_item->getSection()] = array();
+ $sectioned_menu[$menu_item->getSection()] = [];
}
$sectioned_menu[$menu_item->getSection()][] = $menu_item;
}
@@ -103,12 +103,12 @@ protected function setupSections() {
* @return void
*/
protected function setupTrees() {
- $menu_tree = array();
+ $menu_tree = [];
foreach ($this->menu as $key => $section) {
- $parents = array();
- $children = array();
- $all_menu_items = array();
+ $parents = [];
+ $children = [];
+ $all_menu_items = [];
// divide base nodes from children
foreach ($section as $menu_item) {
@@ -124,7 +124,7 @@ protected function setupTrees() {
}
$all_menu_items[$menu_item_name] = $menu_item;
- }
+ }
if (empty($all_menu_items)) {
// empty sections can be skipped
@@ -145,7 +145,7 @@ protected function setupTrees() {
if (!array_key_exists($parent_name, $all_menu_items)) {
// orphaned child, inform authorities and skip to next item
- $message = _elgg_services()->translator->translate('ElggMenuBuilder:Trees:OrphanedChild', array($menu_item_name, $parent_name));
+ $message = _elgg_services()->translator->translate('ElggMenuBuilder:Trees:OrphanedChild', [$menu_item_name, $parent_name]);
_elgg_services()->logger->notice($message);
continue;
@@ -156,7 +156,7 @@ protected function setupTrees() {
$menu_item->setParent($all_menu_items[$parent_name]);
} else {
// menu item already existed in parents children, report the duplicate registration
- $message = _elgg_services()->translator->translate('ElggMenuBuilder:Trees:DuplicateChild', array($menu_item_name));
+ $message = _elgg_services()->translator->translate('ElggMenuBuilder:Trees:DuplicateChild', [$menu_item_name]);
_elgg_services()->logger->notice($message);
continue;
@@ -243,7 +243,7 @@ protected function sort($sort_by) {
// depth first traversal of tree
foreach ($section as $root) {
- $stack = array();
+ $stack = [];
array_push($stack, $root);
while (!empty($stack)) {
$node = array_pop($stack);
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 358bd4b3c5c..13637da89b7 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -17,12 +17,12 @@ class ElggMenuItem {
/**
* @var array Non-rendered data about the menu item
*/
- protected $data = array(
+ protected $data = [
// string Identifier of the menu
'name' => '',
// array Page contexts this menu item should appear on
- 'contexts' => array('all'),
+ 'contexts' => ['all'],
// string Menu section identifier
'section' => 'default',
@@ -40,20 +40,20 @@ class ElggMenuItem {
'parent' => null,
// array Array of children objects or empty array
- 'children' => array(),
+ 'children' => [],
// array An array of options for child menu of the parent item
- 'child_menu' => array(),
+ 'child_menu' => [],
// array Classes to apply to the li tag
- 'itemClass' => array(),
+ 'itemClass' => [],
// array Classes to apply to the anchor tag
- 'linkClass' => array(),
+ 'linkClass' => [],
// array AMD modules required by this menu item
- 'deps' => array()
- );
+ 'deps' => []
+ ];
/**
* @var string The menu display string (HTML)
@@ -226,7 +226,7 @@ public function getName() {
/**
* Set the display text of the menu item
- *
+ *
* @param string $text The display text as HTML
* @return void
*/
@@ -271,7 +271,7 @@ public function getHref() {
*/
public function setContext($contexts) {
if (is_string($contexts)) {
- $contexts = array($contexts);
+ $contexts = [$contexts];
}
$this->data['contexts'] = $contexts;
}
@@ -374,7 +374,7 @@ public function getConfirmText() {
*/
public function setLinkClass($class) {
if (!is_array($class)) {
- $this->data['linkClass'] = array($class);
+ $this->data['linkClass'] = [$class];
} else {
$this->data['linkClass'] = $class;
}
@@ -434,7 +434,7 @@ public function addDeps($modules) {
/**
* Set child menu options for a parent item
- *
+ *
* @param array $options Options
* @return void
*/
@@ -459,7 +459,7 @@ public function getChildMenuOptions() {
*/
public function setItemClass($class) {
if (!is_array($class)) {
- $this->data['itemClass'] = array($class);
+ $this->data['itemClass'] = [$class];
} else {
$this->data['itemClass'] = $class;
}
@@ -569,7 +569,7 @@ public function getParentName() {
/**
* Set the parent menu item
- *
+ *
* This is reserved for the \ElggMenuBuilder.
*
* @param \ElggMenuItem $parent The parent of this menu item
@@ -582,7 +582,7 @@ public function setParent($parent) {
/**
* Get the parent menu item
- *
+ *
* This is reserved for the \ElggMenuBuilder.
*
* @return \ElggMenuItem or null
@@ -594,7 +594,7 @@ public function getParent() {
/**
* Add a child menu item
- *
+ *
* This is reserved for the \ElggMenuBuilder.
*
* @param \ElggMenuItem $item A child menu item
@@ -607,7 +607,7 @@ public function addChild($item) {
/**
* Set the menu item's children
- *
+ *
* This is reserved for the \ElggMenuBuilder.
*
* @param ElggMenuItem[] $children Array of items
@@ -620,7 +620,7 @@ public function setChildren($children) {
/**
* Get the children menu items
- *
+ *
* This is reserved for the \ElggMenuBuilder.
*
* @return ElggMenuItem[]
@@ -632,7 +632,7 @@ public function getChildren() {
/**
* Sort the children
- *
+ *
* This is reserved for the \ElggMenuBuilder.
*
* @param string $sortFunction A function that is passed to usort()
@@ -648,7 +648,7 @@ public function sortChildren($sortFunction) {
/**
* Get all the values for this menu item. Useful for rendering.
- *
+ *
* @return array
* @since 1.9.0
*/
diff --git a/engine/classes/ElggMetadata.php b/engine/classes/ElggMetadata.php
index f9cd41792c2..2c7161994e9 100644
--- a/engine/classes/ElggMetadata.php
+++ b/engine/classes/ElggMetadata.php
@@ -41,7 +41,7 @@ public function __construct(\stdClass $row = null) {
$this->initializeAttributes();
if ($row) {
- foreach ((array)$row as $key => $value) {
+ foreach ((array) $row as $key => $value) {
$this->attributes[$key] = $value;
}
}
diff --git a/engine/classes/ElggObject.php b/engine/classes/ElggObject.php
index 16220a8eca0..eef8d2622fb 100644
--- a/engine/classes/ElggObject.php
+++ b/engine/classes/ElggObject.php
@@ -183,7 +183,7 @@ protected function prepareObject($object) {
$object = parent::prepareObject($object);
$object->title = $this->getDisplayName();
$object->description = $this->description;
- $object->tags = $this->tags ? $this->tags : array();
+ $object->tags = $this->tags ? $this->tags : [];
return $object;
}
diff --git a/engine/classes/ElggPAM.php b/engine/classes/ElggPAM.php
index 029db3b2e1c..bd6a879570f 100644
--- a/engine/classes/ElggPAM.php
+++ b/engine/classes/ElggPAM.php
@@ -18,12 +18,12 @@ class ElggPAM {
/**
* \ElggPAM constructor
- *
+ *
* @param string $policy PAM policy type: user, api, or plugin-defined policies
*/
public function __construct($policy) {
$this->policy = $policy;
- $this->messages = array('sufficient' => array(), 'required' => array());
+ $this->messages = ['sufficient' => [], 'required' => []];
}
/**
@@ -41,7 +41,7 @@ public function __construct($policy) {
* @param array $credentials Credentials array dependant on policy type
* @return bool
*/
- public function authenticate($credentials = array()) {
+ public function authenticate($credentials = []) {
global $_PAM_HANDLERS;
if (!isset($_PAM_HANDLERS[$this->policy]) ||
@@ -89,7 +89,7 @@ public function authenticate($credentials = array()) {
/**
* Get a failure message to display to user
- *
+ *
* @return string
*/
public function getFailureMessage() {
diff --git a/engine/classes/ElggPlugin.php b/engine/classes/ElggPlugin.php
index c6dc8053456..f60f26342f9 100644
--- a/engine/classes/ElggPlugin.php
+++ b/engine/classes/ElggPlugin.php
@@ -195,7 +195,7 @@ public function setID($id) {
public function getAvailableTextFiles() {
$filenames = $this->getPackage()->getTextFilenames();
- $files = array();
+ $files = [];
foreach ($filenames as $filename) {
if ($this->canReadFile($filename)) {
$files[$filename] = "$this->path/$filename";
@@ -371,12 +371,12 @@ public function setSetting($name, $value) {
}
// Hook to validate setting
- $value = elgg_trigger_plugin_hook('setting', 'plugin', array(
+ $value = elgg_trigger_plugin_hook('setting', 'plugin', [
'plugin_id' => $this->getID(),
'plugin' => $this,
'name' => $name,
'value' => $value,
- ), $value);
+ ], $value);
return $this->setPrivateSetting($name, $value);
}
@@ -446,7 +446,7 @@ public function getUserSetting($name, $user_guid = 0, $default = null) {
* @return array An array of key/value pairs.
*/
public function getAllUserSettings($user_guid = 0) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
if ($user_guid) {
$user = get_entity($user_guid);
@@ -472,7 +472,7 @@ public function getAllUserSettings($user_guid = 0) {
$private_settings = $this->getDatabase()->getData($q);
- $return = array();
+ $return = [];
if ($private_settings) {
foreach ($private_settings as $setting) {
@@ -496,7 +496,7 @@ public function getAllUserSettings($user_guid = 0) {
* @return mixed The new setting ID or false
*/
public function setUserSetting($name, $value, $user_guid = 0) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
if ($user_guid) {
$user = get_entity($user_guid);
@@ -510,13 +510,13 @@ public function setUserSetting($name, $value, $user_guid = 0) {
// Hook to validate setting
// note: this doesn't pass the namespaced name
- $value = _elgg_services()->hooks->trigger('usersetting', 'plugin', array(
+ $value = _elgg_services()->hooks->trigger('usersetting', 'plugin', [
'user' => $user,
'plugin' => $this,
'plugin_id' => $this->getID(),
'name' => $name,
'value' => $value
- ), $value);
+ ], $value);
// set the namespaced name.
$name = _elgg_namespace_plugin_private_setting('user_setting', $name, $this->getID());
@@ -532,7 +532,7 @@ public function setUserSetting($name, $value, $user_guid = 0) {
* @return bool
*/
public function unsetUserSetting($name, $user_guid = 0) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
if ($user_guid) {
$user = get_entity($user_guid);
@@ -604,12 +604,12 @@ public function unsetAllUsersSettings() {
*/
public function isValid() {
if (!$this->getID()) {
- $this->errorMsg = _elgg_services()->translator->translate('ElggPlugin:MissingID', array($this->guid));
+ $this->errorMsg = _elgg_services()->translator->translate('ElggPlugin:MissingID', [$this->guid]);
return false;
}
if (!$this->getPackage() instanceof \ElggPluginPackage) {
- $this->errorMsg = _elgg_services()->translator->translate('ElggPlugin:NoPluginPackagePackage', array($this->getID(), $this->guid));
+ $this->errorMsg = _elgg_services()->translator->translate('ElggPlugin:NoPluginPackagePackage', [$this->getID(), $this->guid]);
return false;
}
@@ -693,17 +693,16 @@ public function activate() {
// emit an event. returning false will make this not be activated.
// we need to do this after it's been fully activated
// or the deactivate will be confused.
- $params = array(
+ $params = [
'plugin_id' => $this->getID(),
'plugin_entity' => $this,
- );
+ ];
$return = _elgg_services()->events->trigger('activate', 'plugin', $params);
// if there are any on_enable functions, start the plugin now and run them
// Note: this will not run re-run the init hooks!
if ($return) {
-
$this->activateEntities();
if ($this->canReadFile('activate.php')) {
@@ -786,10 +785,10 @@ public function deactivate() {
}
// emit an event. returning false will cause this to not be deactivated.
- $params = array(
+ $params = [
'plugin_id' => $this->getID(),
'plugin_entity' => $this,
- );
+ ];
$return = _elgg_services()->events->trigger('deactivate', 'plugin', $params);
@@ -876,7 +875,7 @@ protected function includeFile($filename) {
if (!$this->canReadFile($filename)) {
$msg = _elgg_services()->translator->translate('ElggPlugin:Exception:CannotIncludeFile',
- array($filename, $this->getID(), $this->guid, $this->path));
+ [$filename, $this->getID(), $this->guid, $this->path]);
throw new \PluginException($msg);
}
@@ -884,7 +883,7 @@ protected function includeFile($filename) {
$ret = include $filepath;
} catch (Exception $e) {
$msg = _elgg_services()->translator->translate('ElggPlugin:Exception:IncludeFileThrew',
- array($filename, $this->getID(), $this->guid, $this->path));
+ [$filename, $this->getID(), $this->guid, $this->path]);
throw new \PluginException($msg, 0, $e);
}
@@ -1076,7 +1075,6 @@ protected function activateEntities() {
foreach ($spec as $entity) {
if (isset($entity['type'], $entity['subtype'], $entity['class'])) {
-
if (get_subtype_id($entity['type'], $entity['subtype'])) {
update_subtype($entity['type'], $entity['subtype'], $entity['class']);
} else {
diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php
index 4e63e9ede58..99ea9f84ae1 100644
--- a/engine/classes/ElggPluginManifest.php
+++ b/engine/classes/ElggPluginManifest.php
@@ -33,97 +33,97 @@ class ElggPluginManifest {
/**
* The expected structure of a plugins requires element
*/
- private $depsStructPlugin = array(
+ private $depsStructPlugin = [
'type' => '',
'name' => '',
'version' => '',
'comparison' => 'ge'
- );
+ ];
/**
* The expected structure of a priority element
*/
- private $depsStructPriority = array(
+ private $depsStructPriority = [
'type' => '',
'priority' => '',
'plugin' => ''
- );
+ ];
/*
* The expected structure of elgg_release requires element
*/
- private $depsStructElgg = array(
+ private $depsStructElgg = [
'type' => '',
'version' => '',
'comparison' => 'ge'
- );
+ ];
/**
* The expected structure of a requires php_version dependency element
*/
- private $depsStructPhpVersion = array(
+ private $depsStructPhpVersion = [
'type' => '',
'version' => '',
'comparison' => 'ge'
- );
+ ];
/**
* The expected structure of a requires php_ini dependency element
*/
- private $depsStructPhpIni = array(
+ private $depsStructPhpIni = [
'type' => '',
'name' => '',
'value' => '',
'comparison' => '='
- );
+ ];
/**
* The expected structure of a requires php_extension dependency element
*/
- private $depsStructPhpExtension = array(
+ private $depsStructPhpExtension = [
'type' => '',
'name' => '',
'version' => '',
'comparison' => '='
- );
+ ];
/**
* The expected structure of a conflicts depedency element
*/
- private $depsConflictsStruct = array(
+ private $depsConflictsStruct = [
'type' => '',
'name' => '',
'version' => '',
'comparison' => '='
- );
+ ];
/**
* The expected structure of a provides dependency element.
*/
- private $depsProvidesStruct = array(
+ private $depsProvidesStruct = [
'type' => '',
'name' => '',
'version' => ''
- );
+ ];
/**
* The expected structure of a screenshot element
*/
- private $screenshotStruct = array(
+ private $screenshotStruct = [
'description' => '',
'path' => ''
- );
+ ];
/**
* The expected structure of a contributor element
*/
- private $contributorStruct = array(
+ private $contributorStruct = [
'name' => '',
'email' => '',
'website' => '',
'username' => '',
'description' => '',
- );
+ ];
/**
* The API version of the manifest.
@@ -174,7 +174,7 @@ public function __construct($manifest, $plugin_id = null) {
if (!$manifest_obj) {
throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidManifest',
- array($this->getPluginID())));
+ [$this->getPluginID()]));
}
// set manifest api version
@@ -200,12 +200,12 @@ public function __construct($manifest, $plugin_id = null) {
$this->parser = new $parser_class_name($manifest_obj, $this);
} else {
throw new \PluginException(_elgg_services()->translator->translate('PluginException:NoAvailableParser',
- array($this->apiVersion, $this->getPluginID())));
+ [$this->apiVersion, $this->getPluginID()]));
}
if (!$this->parser->parse()) {
throw new \PluginException(_elgg_services()->translator->translate('PluginException:ParserError',
- array($this->apiVersion, $this->getPluginID())));
+ [$this->apiVersion, $this->getPluginID()]));
}
}
@@ -381,7 +381,7 @@ public function getWebsite() {
* @return array
*/
public function getCategories() {
- $bundled_plugins = array(
+ $bundled_plugins = [
'activity',
'blog',
'bookmarks',
@@ -419,12 +419,12 @@ public function getCategories() {
'twitter_api',
'uservalidationbyemail',
'web_services',
- );
+ ];
$cats = $this->parser->getAttribute('category');
if (!$cats) {
- $cats = array();
+ $cats = [];
}
if (in_array('bundled', $cats) && !in_array($this->getPluginID(), $bundled_plugins)) {
@@ -443,10 +443,10 @@ public function getScreenshots() {
$ss = $this->parser->getAttribute('screenshot');
if (!$ss) {
- $ss = array();
+ $ss = [];
}
- $normalized = array();
+ $normalized = [];
foreach ($ss as $s) {
$normalized[] = $this->buildStruct($this->screenshotStruct, $s);
}
@@ -463,10 +463,10 @@ public function getContributors() {
$ss = $this->parser->getAttribute('contributor');
if (!$ss) {
- $ss = array();
+ $ss = [];
}
- $normalized = array();
+ $normalized = [];
foreach ($ss as $s) {
$normalized[] = $this->buildStruct($this->contributorStruct, $s);
}
@@ -482,25 +482,25 @@ public function getContributors() {
public function getProvides() {
// normalize for 1.7
if ($this->getApiVersion() < 1.8) {
- $provides = array();
+ $provides = [];
} else {
$provides = $this->parser->getAttribute('provides');
}
if (!$provides) {
- $provides = array();
+ $provides = [];
}
// always provide ourself if we can
if ($this->pluginID) {
- $provides[] = array(
+ $provides[] = [
'type' => 'plugin',
'name' => $this->getPluginID(),
'version' => $this->getVersion()
- );
+ ];
}
- $normalized = array();
+ $normalized = [];
foreach ($provides as $provide) {
$normalized[] = $this->buildStruct($this->depsProvidesStruct, $provide);
}
@@ -517,10 +517,10 @@ public function getRequires() {
$reqs = $this->parser->getAttribute('requires');
if (!$reqs) {
- $reqs = array();
+ $reqs = [];
}
- $normalized = array();
+ $normalized = [];
foreach ($reqs as $req) {
$normalized[] = $this->normalizeDep($req);
}
@@ -537,10 +537,10 @@ public function getSuggests() {
$suggests = $this->parser->getAttribute('suggests');
if (!$suggests) {
- $suggests = array();
+ $suggests = [];
}
- $normalized = array();
+ $normalized = [];
foreach ($suggests as $suggest) {
$normalized[] = $this->normalizeDep($suggest);
}
@@ -650,16 +650,16 @@ private function normalizeDep($dep) {
public function getConflicts() {
// normalize for 1.7
if ($this->getApiVersion() < 1.8) {
- $conflicts = array();
+ $conflicts = [];
} else {
$conflicts = $this->parser->getAttribute('conflicts');
}
if (!$conflicts) {
- $conflicts = array();
+ $conflicts = [];
}
- $normalized = array();
+ $normalized = [];
foreach ($conflicts as $conflict) {
$normalized[] = $this->buildStruct($this->depsConflictsStruct, $conflict);
@@ -700,7 +700,7 @@ public function getActivateOnInstall() {
* @return array
*/
protected function buildStruct(array $struct, array $array) {
- $return = array();
+ $return = [];
foreach ($struct as $index => $default) {
$return[$index] = elgg_extract($index, $array, $default);
diff --git a/engine/classes/ElggPluginManifestParser18.php b/engine/classes/ElggPluginManifestParser18.php
index 5c88eacf9f5..0c016039280 100644
--- a/engine/classes/ElggPluginManifestParser18.php
+++ b/engine/classes/ElggPluginManifestParser18.php
@@ -12,7 +12,7 @@ class ElggPluginManifestParser18 extends \ElggPluginManifestParser {
*
* @var array
*/
- protected $validAttributes = array(
+ protected $validAttributes = [
'name',
'author',
'version',
@@ -33,16 +33,16 @@ class ElggPluginManifestParser18 extends \ElggPluginManifestParser {
'repository',
'bugtracker',
'donations',
- );
+ ];
/**
* Required attributes for a valid 1.8 manifest
*
* @var array
*/
- protected $requiredAttributes = array(
+ protected $requiredAttributes = [
'name', 'author', 'version', 'description', 'requires'
- );
+ ];
/**
* Parse a manifest object from 1.8 and later
@@ -52,7 +52,7 @@ class ElggPluginManifestParser18 extends \ElggPluginManifestParser {
* @throws PluginException
*/
public function parse() {
- $parsed = array();
+ $parsed = [];
foreach ($this->manifestObject->children as $element) {
switch ($element->name) {
// single elements
@@ -88,7 +88,7 @@ public function parse() {
return false;
}
- $info = array();
+ $info = [];
foreach ($element->children as $child_element) {
$info[$child_element->name] = $child_element->content;
}
@@ -102,7 +102,7 @@ public function parse() {
foreach ($this->requiredAttributes as $attr) {
if (!array_key_exists($attr, $parsed)) {
throw new \PluginException(_elgg_services()->translator->translate('PluginException:ParserErrorMissingRequiredAttribute',
- array($attr, $this->caller->getPluginID())));
+ [$attr, $this->caller->getPluginID()]));
}
}
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php
index 45616cc1df6..9101096d179 100644
--- a/engine/classes/ElggPluginPackage.php
+++ b/engine/classes/ElggPluginPackage.php
@@ -25,38 +25,38 @@ class ElggPluginPackage {
*
* @var array
*/
- private $requiredFiles = array(
+ private $requiredFiles = [
'manifest.xml'
- );
+ ];
/**
* The optional files that can be read and served through the markdown page handler
* @var array
*/
- private $textFiles = array(
+ private $textFiles = [
'README.txt', 'CHANGES.txt',
'INSTALL.txt', 'COPYRIGHT.txt', 'LICENSE.txt',
'README', 'README.md', 'README.markdown'
- );
+ ];
/**
* Valid types for provides.
*
* @var array
*/
- private $providesSupportedTypes = array(
+ private $providesSupportedTypes = [
'plugin', 'php_extension'
- );
+ ];
/**
* The type of requires/conflicts supported
*
* @var array
*/
- private $depsSupportedTypes = array(
+ private $depsSupportedTypes = [
'elgg_release', 'php_version', 'php_extension', 'php_ini', 'plugin', 'priority',
- );
+ ];
/**
* An invalid plugin error.
@@ -114,7 +114,7 @@ public function __construct($plugin, $validate = true) {
// this is a plugin id
// strict plugin names
if (preg_match('/[^a-z0-9\.\-_]/i', $plugin)) {
- throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidID', array($plugin)));
+ throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidID', [$plugin]));
}
$path = "{$plugin_path}$plugin/";
@@ -122,7 +122,7 @@ public function __construct($plugin, $validate = true) {
}
if (!is_dir($path)) {
- throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidPath', array($path)));
+ throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidPath', [$path]));
}
$this->path = $path;
@@ -131,9 +131,9 @@ public function __construct($plugin, $validate = true) {
if ($validate && !$this->isValid()) {
if ($this->errorMsg) {
throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidPlugin:Details',
- array($plugin, $this->errorMsg)));
+ [$plugin, $this->errorMsg]));
} else {
- throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidPlugin', array($plugin)));
+ throw new \PluginException(_elgg_services()->translator->translate('PluginException:InvalidPlugin', [$plugin]));
}
}
}
@@ -172,7 +172,7 @@ private function validate() {
if (!is_readable($this->path . $file)) {
$have_req_files = false;
$this->errorMsg =
- _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:MissingFile', array($file));
+ _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:MissingFile', [$file]);
return false;
}
}
@@ -237,7 +237,7 @@ private function isNamedCorrectly() {
$required_id = $manifest->getID();
if (!empty($required_id) && ($required_id !== $this->id)) {
$this->errorMsg =
- _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:InvalidId', array($required_id));
+ _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:InvalidId', [$required_id]);
return false;
}
}
@@ -270,17 +270,17 @@ private function hasSaneDependencies() {
// only valid provide types
if (!in_array($provide['type'], $this->providesSupportedTypes)) {
$this->errorMsg =
- _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:InvalidProvides', array($provide['type']));
+ _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:InvalidProvides', [$provide['type']]);
return false;
}
// doesn't conflict or require any of its provides
$name = $provide['name'];
- foreach (array('conflicts', 'requires') as $dep_type) {
+ foreach (['conflicts', 'requires'] as $dep_type) {
foreach (${$dep_type} as $dep) {
if (!in_array($dep['type'], $this->depsSupportedTypes)) {
$this->errorMsg =
- _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:InvalidDependency', array($dep['type']));
+ _elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:InvalidDependency', [$dep['type']]);
return false;
}
@@ -291,7 +291,7 @@ private function hasSaneDependencies() {
if ($version_compare) {
$this->errorMsg =
_elgg_services()->translator->translate('ElggPluginPackage:InvalidPlugin:CircularDep',
- array($dep['type'], $dep['name'], $this->id));
+ [$dep['type'], $dep['name'], $this->id]);
return false;
}
@@ -386,11 +386,11 @@ public function checkDependencies($full_report = false) {
$enabled_plugins = elgg_get_plugins('active');
$this_id = $this->getID();
- $report = array();
+ $report = [];
// first, check if any active plugin conflicts with us.
foreach ($enabled_plugins as $plugin) {
- $temp_conflicts = array();
+ $temp_conflicts = [];
$temp_manifest = $plugin->getManifest();
if ($temp_manifest instanceof \ElggPluginManifest) {
$temp_conflicts = $plugin->getManifest()->getConflicts();
@@ -413,18 +413,18 @@ public function checkDependencies($full_report = false) {
$this->errorMsg = _elgg_services()->translator->translate($key, [$link]);
return $result['status'];
} else {
- $report[] = array(
+ $report[] = [
'type' => 'conflicted',
'dep' => $conflict,
'status' => $result['status'],
'value' => $this->getManifest()->getVersion()
- );
+ ];
}
}
}
}
- $check_types = array('requires', 'conflicts');
+ $check_types = ['requires', 'conflicts'];
if ($full_report) {
// Note: $suggests is not unused. It's called dynamically
@@ -473,12 +473,12 @@ public function checkDependencies($full_report = false) {
return $result['status'];
} else {
// build report element and comment
- $report[] = array(
+ $report[] = [
'type' => $dep_type,
'dep' => $dep,
'status' => $result['status'],
'value' => $result['value']
- );
+ ];
}
}
}
@@ -489,12 +489,12 @@ public function checkDependencies($full_report = false) {
$provides = $this->getManifest()->getProvides();
foreach ($provides as $provide) {
- $report[] = array(
+ $report[] = [
'type' => 'provides',
'dep' => $provide,
'status' => true,
'value' => ''
- );
+ ];
}
return $report;
@@ -533,10 +533,10 @@ private function checkDepPriority(array $dep, array $plugins, $inverse = false)
// grab the \ElggPlugin using this package.
$plugin_package = elgg_get_plugin_from_id($this->getID());
if (!$plugin_package) {
- return array(
+ return [
'status' => true,
'value' => 'uninstalled'
- );
+ ];
}
$test_plugin = elgg_get_plugin_from_id($dep['plugin']);
@@ -544,10 +544,10 @@ private function checkDepPriority(array $dep, array $plugins, $inverse = false)
// If this isn't a plugin or the plugin isn't installed or active
// priority doesn't matter. Use requires to check if a plugin is active.
if (!$test_plugin || !$test_plugin->isActive()) {
- return array(
+ return [
'status' => true,
'value' => 'uninstalled'
- );
+ ];
}
$plugin_priority = $plugin_package->getPriority();
@@ -577,10 +577,10 @@ private function checkDepPriority(array $dep, array $plugins, $inverse = false)
$status = !$status;
}
- return array(
+ return [
'status' => $status,
'value' => $value
- );
+ ];
}
/**
@@ -598,10 +598,10 @@ private function checkDepElgg(array $dep, $elgg_version, $inverse = false) {
$status = !$status;
}
- return array(
+ return [
'status' => $status,
'value' => $elgg_version
- );
+ ];
}
/**
@@ -619,10 +619,10 @@ private function checkDepPhpVersion(array $dep, $inverse = false) {
$status = !$status;
}
- return array(
+ return [
'status' => $status,
'value' => $php_version
- );
+ ];
}
/**
@@ -671,10 +671,10 @@ private function checkDepPhpExtension(array $dep, $inverse = false) {
$status = !$status;
}
- return array(
+ return [
'status' => $status,
'value' => $ext_version
- );
+ ];
}
/**
@@ -704,10 +704,10 @@ private function checkDepPhpIni($dep, $inverse = false) {
$status = !$status;
}
- return array(
+ return [
'status' => $status,
'value' => $setting
- );
+ ];
}
/**
diff --git a/engine/classes/ElggPriorityList.php b/engine/classes/ElggPriorityList.php
index ba60e15b237..44d04c57f98 100644
--- a/engine/classes/ElggPriorityList.php
+++ b/engine/classes/ElggPriorityList.php
@@ -42,7 +42,7 @@
* $pl->add('Element -10', -10);
*
* $priority = $pl->getPriority('Element -5');
- *
+ *
* Or element lookups by priority.
* $element = $pl->getElement(-5);
*
@@ -100,14 +100,14 @@ class ElggPriorityList
*
* @var array
*/
- private $elements = array();
+ private $elements = [];
/**
* Create a new priority list.
*
* @param array $elements An optional array of priorities => element
*/
- public function __construct(array $elements = array()) {
+ public function __construct(array $elements = []) {
if ($elements) {
foreach ($elements as $priority => $element) {
$this->add($element, $priority);
@@ -203,7 +203,7 @@ public function getElements() {
*
* If no user function is provided the elements are sorted by priority registered.
*
- * The callback function should accept the array of elements as the first
+ * The callback function should accept the array of elements as the first
* argument and should return a sorted array.
*
* This function can be called multiple times.
@@ -257,7 +257,7 @@ public function getNextPriority($near = 0) {
/**
* Returns the priority of an element if it exists in the list.
- *
+ *
* @warning This can return 0 if the element's priority is 0.
*
* @param mixed $element The element to check for.
@@ -363,4 +363,4 @@ public function valid() {
public function count() {
return count($this->elements);
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/ElggRelationship.php b/engine/classes/ElggRelationship.php
index f40aaabe7d0..c467d5fe1e8 100644
--- a/engine/classes/ElggRelationship.php
+++ b/engine/classes/ElggRelationship.php
@@ -4,7 +4,7 @@
*
* @package Elgg.Core
* @subpackage Core
- *
+ *
* @property int $id The unique identifier (read-only)
* @property int $guid_one The GUID of the subject of the relationship
* @property string $relationship The type of the relationship (limit of 50 characters long)
@@ -24,11 +24,11 @@ class ElggRelationship extends \ElggData {
public function __construct(\stdClass $row) {
$this->initializeAttributes();
- foreach ((array)$row as $key => $value) {
+ foreach ((array) $row as $key => $value) {
$this->attributes[$key] = $value;
}
- $this->attributes['id'] = (int)$this->attributes['id'];
+ $this->attributes['id'] = (int) $this->attributes['id'];
}
/**
@@ -139,7 +139,7 @@ public function getURL() {
}
$type = $this->getType();
- $params = array('relationship' => $this);
+ $params = ['relationship' => $this];
$url = _elgg_services()->hooks->trigger('relationship:url', $type, $params, $url);
return elgg_normalize_url($url);
@@ -155,7 +155,7 @@ public function toObject() {
$object->relationship = $this->relationship;
$object->object_guid = $this->guid_two;
$object->time_created = date('c', $this->getTimeCreated());
- $params = array('relationship' => $this);
+ $params = ['relationship' => $this];
return _elgg_services()->hooks->trigger('to:object', 'relationship', $params, $object);
}
diff --git a/engine/classes/ElggRewriteTester.php b/engine/classes/ElggRewriteTester.php
index d3671a20435..ae3b1abcc0d 100644
--- a/engine/classes/ElggRewriteTester.php
+++ b/engine/classes/ElggRewriteTester.php
@@ -36,7 +36,7 @@ public function run($url, $path) {
$this->rewriteTestPassed = $this->runRewriteTest($url);
- if ($this->rewriteTestPassed == FALSE) {
+ if ($this->rewriteTestPassed == false) {
if ($this->webserver == 'apache' || $this->webserver == 'unknown') {
if ($this->createHtaccess($url, $path)) {
$this->rewriteTestPassed = $this->runRewriteTest($url);
@@ -54,9 +54,9 @@ public function run($url, $path) {
*/
public static function guessWebServer() {
$serverString = strtolower($_SERVER['SERVER_SOFTWARE']);
- $possibleServers = array('apache', 'nginx', 'lighttpd', 'iis');
+ $possibleServers = ['apache', 'nginx', 'lighttpd', 'iis'];
foreach ($possibleServers as $server) {
- if (strpos($serverString, $server) !== FALSE) {
+ if (strpos($serverString, $server) !== false) {
return $server;
}
}
@@ -68,7 +68,7 @@ public static function guessWebServer() {
*
* @param string $url Rewrite test URL
*
- * @return string|bool Subdirectory string with beginning and trailing slash or false if were unable to determine subdirectory
+ * @return string|bool Subdirectory string with beginning and trailing slash or false if were unable to determine subdirectory
* or pointing at root of domain already
*/
public function guessSubdirectory($url) {
@@ -98,12 +98,12 @@ public function runRewriteTest($url) {
/**
* Check whether the site homepage can be fetched via curl
- *
+ *
* @return boolean
*/
public function runLocalhostAccessTest() {
$url = _elgg_services()->config->getSiteUrl();
- return (bool)$this->fetchUrl($url);
+ return (bool) $this->fetchUrl($url);
}
/**
@@ -117,12 +117,12 @@ private function fetchUrl($url) {
$response = '';
if (ini_get('allow_url_fopen')) {
- $ctx = stream_context_create(array(
- 'http' => array(
+ $ctx = stream_context_create([
+ 'http' => [
'follow_location' => 0,
'timeout' => 5,
- ),
- ));
+ ],
+ ]);
$response = @file_get_contents($url, null, $ctx);
}
@@ -136,7 +136,7 @@ private function fetchUrl($url) {
curl_close($ch);
}
- return (string)$response;
+ return (string) $response;
}
/**
@@ -152,34 +152,34 @@ public function createHtaccess($url) {
if ($file->exists()) {
// check that this is the Elgg .htaccess
$data = $file->getContents();
- if ($data === FALSE) {
+ if ($data === false) {
// don't have permission to read the file
$this->htaccessIssue = 'read_permission';
- return FALSE;
+ return false;
}
- if (strpos($data, 'Elgg') === FALSE) {
+ if (strpos($data, 'Elgg') === false) {
$this->htaccessIssue = 'non_elgg_htaccess';
- return FALSE;
+ return false;
} else {
// check if this is an old Elgg htaccess
- if (strpos($data, 'RewriteRule ^rewrite.php$ install.php') == FALSE) {
+ if (strpos($data, 'RewriteRule ^rewrite.php$ install.php') == false) {
$this->htaccessIssue = 'old_elgg_htaccess';
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
}
if (!is_writable($root->getPath())) {
$this->htaccessIssue = 'write_permission';
- return FALSE;
+ return false;
}
// create the .htaccess file
$result = copy(\Elgg\Application::elggDir()->getPath("install/config/htaccess.dist"), $file->getPath());
if (!$result) {
$this->htaccessIssue = 'cannot_copy';
- return FALSE;
+ return false;
}
// does default RewriteBase work already?
@@ -194,7 +194,7 @@ public function createHtaccess($url) {
}
}
- return TRUE;
+ return true;
}
/**
@@ -206,20 +206,20 @@ public function createHtaccess($url) {
*/
protected function returnStatus($url) {
if ($this->rewriteTestPassed) {
- return array(
+ return [
'severity' => 'pass',
'message' => _elgg_services()->translator->translate('install:check:rewrite:success'),
- );
+ ];
}
- if ($this->serverSupportsRemoteRead == FALSE) {
- $msg = _elgg_services()->translator->translate('install:warning:rewrite:unknown', array($url));
- $msg .= elgg_view('install/js_rewrite_check', array('url' => $url));
+ if ($this->serverSupportsRemoteRead == false) {
+ $msg = _elgg_services()->translator->translate('install:warning:rewrite:unknown', [$url]);
+ $msg .= elgg_view('install/js_rewrite_check', ['url' => $url]);
- return array(
+ return [
'severity' => 'warning',
'message' => $msg,
- );
+ ];
}
if ($this->webserver == 'apache') {
@@ -227,33 +227,33 @@ protected function returnStatus($url) {
$msg = "$serverString\n\n";
if (!isset($this->htaccessIssue)) {
$msg .= _elgg_services()->translator->translate('install:error:rewrite:allowoverride');
- $msg .= elgg_view('install/js_rewrite_check', array('url' => $url));
+ $msg .= elgg_view('install/js_rewrite_check', ['url' => $url]);
- return array(
+ return [
'severity' => 'warning',
'message' => $msg,
- );
+ ];
}
$msg .= _elgg_services()->translator->translate("install:error:rewrite:htaccess:{$this->htaccessIssue}");
- return array(
+ return [
'severity' => 'warning',
'message' => $msg,
- );
+ ];
}
if ($this->webserver != 'unknown') {
$serverString = _elgg_services()->translator->translate("install:error:rewrite:{$this->webserver}");
$msg = "$serverString\n\n";
$msg .= _elgg_services()->translator->translate("install:error:rewrite:altserver");
- return array(
+ return [
'severity' => 'warning',
'message' => $msg,
- );
+ ];
}
- return array(
+ return [
'severity' => 'warning',
'message' => _elgg_services()->translator->translate('install:error:rewrite:unknown'),
- );
+ ];
}
-}
\ No newline at end of file
+}
diff --git a/engine/classes/ElggRiverItem.php b/engine/classes/ElggRiverItem.php
index aa5e9abd9cf..aa11405cd3e 100644
--- a/engine/classes/ElggRiverItem.php
+++ b/engine/classes/ElggRiverItem.php
@@ -5,7 +5,7 @@
*
* @package Elgg.Core
* @subpackage Core
- *
+ *
* @property-read int $id The unique identifier (read-only)
* @property-read int $subject_guid The GUID of the actor
* @property-read int $object_guid The GUID of the object
@@ -44,10 +44,10 @@ public function __construct($object) {
}
// the casting is to support typed serialization like json
- $int_types = array('id', 'subject_guid', 'object_guid', 'target_guid', 'annotation_id', 'access_id', 'posted');
+ $int_types = ['id', 'subject_guid', 'object_guid', 'target_guid', 'annotation_id', 'access_id', 'posted'];
foreach ($object as $key => $value) {
if (in_array($key, $int_types)) {
- $this->$key = (int)$value;
+ $this->$key = (int) $value;
} else {
$this->$key = $value;
}
@@ -56,7 +56,7 @@ public function __construct($object) {
/**
* Get the subject of this river item
- *
+ *
* @return \ElggEntity
*/
public function getSubjectEntity() {
@@ -83,7 +83,7 @@ public function getTargetEntity() {
/**
* Get the Annotation for this river item
- *
+ *
* @return \ElggAnnotation
*/
public function getAnnotation() {
@@ -101,16 +101,16 @@ public function getView() {
/**
* Get the time this activity was posted
- *
+ *
* @return int
*/
public function getTimePosted() {
- return (int)$this->posted;
+ return (int) $this->posted;
}
/**
* Get the type of the object
- *
+ *
* This is required for elgg_view_list_item(). All the other data types
* (entities, extenders, relationships) have a type/subtype.
*
@@ -122,7 +122,7 @@ public function getType() {
/**
* Get the subtype of the object
- *
+ *
* This is required for elgg_view_list_item().
*
* @return string 'item'
@@ -174,7 +174,7 @@ public function delete() {
/**
* Get a plain old object copy for public consumption
- *
+ *
* @return \stdClass
*/
public function toObject() {
@@ -187,7 +187,7 @@ public function toObject() {
$object->action = $this->action_type;
$object->time_posted = date('c', $this->getTimePosted());
$object->enabled = $this->enabled;
- $params = array('item' => $this);
+ $params = ['item' => $this];
return _elgg_services()->hooks->trigger('to:object', 'river_item', $params, $object);
}
diff --git a/engine/classes/ElggSession.php b/engine/classes/ElggSession.php
index f1aa320363f..16a684d42ef 100644
--- a/engine/classes/ElggSession.php
+++ b/engine/classes/ElggSession.php
@@ -228,7 +228,7 @@ public function isAdminLoggedIn() {
* @return bool
*/
public function isLoggedIn() {
- return (bool)$this->getLoggedInUser();
+ return (bool) $this->getLoggedInUser();
}
/**
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 9c0343e4601..a76d4f92579 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -138,7 +138,7 @@ protected function update() {
return false;
}
- $guid = (int)$this->guid;
+ $guid = (int) $this->guid;
$name = sanitize_string($this->name);
$description = sanitize_string($this->description);
$url = sanitize_string($this->url);
diff --git a/engine/classes/ElggStaticVariableCache.php b/engine/classes/ElggStaticVariableCache.php
index ecfc6691e4d..e2294ea2b78 100644
--- a/engine/classes/ElggStaticVariableCache.php
+++ b/engine/classes/ElggStaticVariableCache.php
@@ -88,9 +88,9 @@ public function clear() {
$namespace = $this->getNamespace();
if (!isset(\ElggStaticVariableCache::$__cache)) {
- \ElggStaticVariableCache::$__cache = array();
+ \ElggStaticVariableCache::$__cache = [];
}
- \ElggStaticVariableCache::$__cache[$namespace] = array();
+ \ElggStaticVariableCache::$__cache[$namespace] = [];
}
}
diff --git a/engine/classes/ElggUpgrade.php b/engine/classes/ElggUpgrade.php
index 5e4a110bf97..4e97614a2b4 100644
--- a/engine/classes/ElggUpgrade.php
+++ b/engine/classes/ElggUpgrade.php
@@ -20,12 +20,12 @@ class ElggUpgrade extends ElggObject {
use TimeUsing;
- private $requiredProperties = array(
+ private $requiredProperties = [
'id',
'title',
'description',
'class',
- );
+ ];
/**
* Do not use.
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index 6dda8336f49..73016616bbe 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -141,7 +141,7 @@ protected function update() {
return false;
}
- $guid = (int)$this->guid;
+ $guid = (int) $this->guid;
$name = sanitize_string($this->name);
$username = sanitize_string($this->username);
$password_hash = sanitize_string($this->password_hash);
@@ -202,7 +202,7 @@ public function __set($name, $value) {
case 'last_login':
case 'prev_last_login':
if ($value !== null) {
- $this->attributes[$name] = (int)$value;
+ $this->attributes[$name] = (int) $value;
} else {
$this->attributes[$name] = null;
}
@@ -329,12 +329,12 @@ public function addFriend($friend_guid, $create_river_item = false) {
}
if ($create_river_item) {
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/relationship/friend/create',
'action_type' => 'friend',
'subject_guid' => $this->guid,
'object_guid' => $friend_guid,
- ));
+ ]);
}
return true;
@@ -367,7 +367,7 @@ public function isFriend() {
* @return bool
*/
public function isFriendsWith($user_guid) {
- return (bool)check_entity_relationship($this->guid, "friend", $user_guid);
+ return (bool) check_entity_relationship($this->guid, "friend", $user_guid);
}
/**
@@ -378,7 +378,7 @@ public function isFriendsWith($user_guid) {
* @return bool
*/
public function isFriendOf($user_guid) {
- return (bool)check_entity_relationship($user_guid, "friend", $this->guid);
+ return (bool) check_entity_relationship($user_guid, "friend", $this->guid);
}
/**
@@ -519,7 +519,7 @@ public function setNotificationSetting($method, $enabled = true) {
* 'ajax' => false, // disabled
* ]
*
- *
+ *
* @return array
*/
public function getNotificationSettings() {
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php
index 7b1ce0a36e1..b86b87cb1e4 100644
--- a/engine/classes/ElggWidget.php
+++ b/engine/classes/ElggWidget.php
@@ -152,31 +152,33 @@ public function getTitle() {
* @since 1.8.0
*/
public function move($column, $rank) {
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'widget',
'container_guid' => $this->container_guid,
'limit' => false,
- 'private_setting_name_value_pairs' => array(
- array('name' => 'context', 'value' => $this->getContext()),
- array('name' => 'column', 'value' => $column)
- )
- );
+ 'private_setting_name_value_pairs' => [
+ ['name' => 'context', 'value' => $this->getContext()],
+ ['name' => 'column', 'value' => $column]
+ ]
+ ];
$widgets = elgg_get_entities_from_private_settings($options);
if (!$widgets) {
- $this->column = (int)$column;
+ $this->column = (int) $column;
$this->order = 0;
return;
}
- usort($widgets, function($a, $b) {return (int) $a->order > (int) $b->order;});
+ usort($widgets, function($a, $b) {return (int) $a->order > (int) $b->order;
+
+ });
// remove widgets from inactive plugins
$widget_types = elgg_get_widget_types([
'context' => $this->context,
'container' => $this->getContainerEntity(),
]);
- $inactive_widgets = array();
+ $inactive_widgets = [];
foreach ($widgets as $index => $widget) {
if (!array_key_exists($widget->handler, $widget_types)) {
$inactive_widgets[] = $widget;
@@ -258,10 +260,10 @@ public function saveSettings($params) {
// plugin hook handlers should return true to indicate the settings have
// been saved so that default code does not run
- $hook_params = array(
+ $hook_params = [
'widget' => $this,
'params' => $params
- );
+ ];
if (_elgg_services()->hooks->trigger('widget_settings', $this->handler, $hook_params, false) == true) {
return true;
}
diff --git a/engine/classes/ElggXMLElement.php b/engine/classes/ElggXMLElement.php
index c8e01b9ac86..113a24d9f19 100644
--- a/engine/classes/ElggXMLElement.php
+++ b/engine/classes/ElggXMLElement.php
@@ -13,7 +13,7 @@ class ElggXMLElement {
/**
* Creates an \ElggXMLParser from a string or existing SimpleXMLElement
- *
+ *
* @param string|SimpleXMLElement $xml The XML to parse
*/
public function __construct($xml) {
@@ -42,19 +42,19 @@ public function getName() {
public function getAttributes() {
//include namespace declarations as attributes
$xmlnsRaw = $this->_element->getNamespaces();
- $xmlns = array();
+ $xmlns = [];
foreach ($xmlnsRaw as $key => $val) {
$label = 'xmlns' . ($key ? ":$key" : $key);
$xmlns[$label] = $val;
}
//get attributes and merge with namespaces
$attrRaw = $this->_element->attributes();
- $attr = array();
+ $attr = [];
foreach ($attrRaw as $key => $val) {
$attr[$key] = $val;
}
$attr = array_merge((array) $xmlns, (array) $attr);
- $result = array();
+ $result = [];
foreach ($attr as $key => $val) {
$result[$key] = (string) $val;
}
@@ -73,7 +73,7 @@ public function getContent() {
*/
public function getChildren() {
$children = $this->_element->children();
- $result = array();
+ $result = [];
foreach ($children as $val) {
$result[] = new \ElggXMLElement($val);
}
@@ -83,7 +83,7 @@ public function getChildren() {
/**
* Override ->
- *
+ *
* @param string $name Property name
* @return mixed
*/
@@ -107,7 +107,7 @@ public function __get($name) {
/**
* Override isset
- *
+ *
* @param string $name Property name
* @return boolean
*/
diff --git a/engine/classes/IOException.php b/engine/classes/IOException.php
index 561e1f651d8..726c922d161 100644
--- a/engine/classes/IOException.php
+++ b/engine/classes/IOException.php
@@ -6,4 +6,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class IOException extends \Exception {}
+class IOException extends \Exception {
+}
diff --git a/engine/classes/IncompleteEntityException.php b/engine/classes/IncompleteEntityException.php
index cb61fc68cc4..c65ced5caf8 100644
--- a/engine/classes/IncompleteEntityException.php
+++ b/engine/classes/IncompleteEntityException.php
@@ -7,4 +7,5 @@
* @subpackage Exception
* @access private
*/
-class IncompleteEntityException extends \Exception {}
+class IncompleteEntityException extends \Exception {
+}
diff --git a/engine/classes/InstallationException.php b/engine/classes/InstallationException.php
index 05ab5893407..c7694f30d8a 100644
--- a/engine/classes/InstallationException.php
+++ b/engine/classes/InstallationException.php
@@ -6,4 +6,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class InstallationException extends \ConfigurationException {}
+class InstallationException extends \ConfigurationException {
+}
diff --git a/engine/classes/InvalidClassException.php b/engine/classes/InvalidClassException.php
index 5d298aa7c9b..110a0534bb8 100644
--- a/engine/classes/InvalidClassException.php
+++ b/engine/classes/InvalidClassException.php
@@ -6,4 +6,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class InvalidClassException extends \ClassException {}
+class InvalidClassException extends \ClassException {
+}
diff --git a/engine/classes/InvalidParameterException.php b/engine/classes/InvalidParameterException.php
index 601442113f7..307b468c32f 100644
--- a/engine/classes/InvalidParameterException.php
+++ b/engine/classes/InvalidParameterException.php
@@ -6,4 +6,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class InvalidParameterException extends \CallException {}
+class InvalidParameterException extends \CallException {
+}
diff --git a/engine/classes/LoginException.php b/engine/classes/LoginException.php
index efe576131b3..9824bb2ea27 100644
--- a/engine/classes/LoginException.php
+++ b/engine/classes/LoginException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exceptions.Stub
*/
-class LoginException extends \Exception {}
+class LoginException extends \Exception {
+}
diff --git a/engine/classes/NotificationException.php b/engine/classes/NotificationException.php
index db9d5ac5290..881f4abb272 100644
--- a/engine/classes/NotificationException.php
+++ b/engine/classes/NotificationException.php
@@ -5,4 +5,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class NotificationException extends \Exception {}
+class NotificationException extends \Exception {
+}
diff --git a/engine/classes/PluginException.php b/engine/classes/PluginException.php
index 31bce4d0b81..16f55ba4429 100644
--- a/engine/classes/PluginException.php
+++ b/engine/classes/PluginException.php
@@ -8,4 +8,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class PluginException extends \Exception {}
+class PluginException extends \Exception {
+}
diff --git a/engine/classes/RegistrationException.php b/engine/classes/RegistrationException.php
index 0fb42f14877..c5f6cf575af 100644
--- a/engine/classes/RegistrationException.php
+++ b/engine/classes/RegistrationException.php
@@ -6,4 +6,5 @@
* @package Elgg.Core
* @subpackage Exceptions
*/
-class RegistrationException extends \InstallationException {}
+class RegistrationException extends \InstallationException {
+}
diff --git a/engine/classes/SecurityException.php b/engine/classes/SecurityException.php
index 837d87875df..932c051e33d 100644
--- a/engine/classes/SecurityException.php
+++ b/engine/classes/SecurityException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class SecurityException extends \Exception {}
+class SecurityException extends \Exception {
+}
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 4f52355dd45..45111e98399 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -116,7 +116,7 @@ function get_access_array($user_guid = 0, $ignored = 0, $flush = false) {
*
* @return int default access id (see ACCESS defines in elgglib.php)
*/
-function get_default_access(ElggUser $user = null, array $input_params = array()) {
+function get_default_access(ElggUser $user = null, array $input_params = []) {
global $CONFIG;
// site default access
@@ -133,11 +133,11 @@ function get_default_access(ElggUser $user = null, array $input_params = array()
}
}
- $params = array(
+ $params = [
'user' => $user,
'default_access' => $default_access,
'input_params' => $input_params,
- );
+ ];
return _elgg_services()->hooks->trigger('default', 'access', $params, $default_access);
}
@@ -212,7 +212,7 @@ function access_get_show_hidden_status() {
* @return string
* @access private
*/
-function _elgg_get_access_where_sql(array $options = array()) {
+function _elgg_get_access_where_sql(array $options = []) {
return _elgg_services()->accessCollections->getWhereSql($options);
}
@@ -265,7 +265,7 @@ function has_access_to_entity($entity, $user = null) {
*
* @return array List of access permissions
*/
-function get_write_access_array($user_guid = 0, $ignored = 0, $flush = false, array $input_params = array()) {
+function get_write_access_array($user_guid = 0, $ignored = 0, $flush = false, array $input_params = []) {
return _elgg_services()->accessCollections->getWriteAccessArray($user_guid, $flush, $input_params);
}
@@ -443,7 +443,7 @@ function get_members_of_access_collection($collection_id, $guids_only = false, a
* @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
-function elgg_get_entities_from_access_id(array $options = array()) {
+function elgg_get_entities_from_access_id(array $options = []) {
// restrict the resultset to access collection provided
if (!isset($options['access_id'])) {
return false;
@@ -455,10 +455,10 @@ function elgg_get_entities_from_access_id(array $options = array()) {
if (is_array($options['wheres'])) {
$options['wheres'][] = $where;
} else {
- $options['wheres'] = array($options['wheres'], $where);
+ $options['wheres'] = [$options['wheres'], $where];
}
} else {
- $options['wheres'] = array($where);
+ $options['wheres'] = [$where];
}
// return entities with the desired options
@@ -475,7 +475,7 @@ function elgg_get_entities_from_access_id(array $options = array()) {
*
* @return string
*/
-function elgg_list_entities_from_access_id(array $options = array()) {
+function elgg_list_entities_from_access_id(array $options = []) {
return elgg_list_entities($options, 'elgg_get_entities_from_access_id');
}
diff --git a/engine/lib/actions.php b/engine/lib/actions.php
index e5fa9957725..fec6224e786 100644
--- a/engine/lib/actions.php
+++ b/engine/lib/actions.php
@@ -12,7 +12,7 @@
/**
* Handle a request for an action
- *
+ *
* @param array $segments URL segments that make up action name
*
* @return ResponseBuilder|null
@@ -148,7 +148,7 @@ function validate_action_token($visible_errors = true, $token = null, $ts = null
* This function verifies form input for security features (like a generated token),
* and forwards if they are invalid.
*
- * @param string $action The action being performed
+ * @param string $action The action being performed
*
* @return mixed True if valid or redirects.
* @access private
@@ -254,7 +254,7 @@ function elgg_is_xhr() {
* }
*
* where "system_messages" is all message registers at the point of forwarding
- *
+ *
* @internal registered for the 'forward', 'all' plugin hook
*
* @param string $hook
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 2772f219f9b..4dbb36bb96e 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -32,21 +32,21 @@
* @return mixed Array of admin users or false on failure. If a count, returns int.
* @since 1.8.0
*/
-function elgg_get_admins(array $options = array()) {
+function elgg_get_admins(array $options = []) {
global $CONFIG;
if (isset($options['joins'])) {
if (!is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
}
$options['joins'][] = "join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid";
} else {
- $options['joins'] = array("join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid");
+ $options['joins'] = ["join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid"];
}
if (isset($options['wheres'])) {
if (!is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
}
$options['wheres'][] = "u.admin = 'yes'";
} else {
@@ -156,7 +156,7 @@ function elgg_register_admin_menu_item($section, $menu_id, $parent_id = null, $p
$name = "$parent_id:$name";
}
- return elgg_register_menu_item('page', array(
+ return elgg_register_menu_item('page', [
'name' => $name,
'href' => $href,
'text' => elgg_echo("admin:$name"),
@@ -164,7 +164,7 @@ function elgg_register_admin_menu_item($section, $menu_id, $parent_id = null, $p
'parent_name' => $parent_id,
'priority' => $priority,
'section' => $section
- ));
+ ]);
}
/**
@@ -178,10 +178,10 @@ function elgg_register_admin_menu_item($section, $menu_id, $parent_id = null, $p
function _elgg_create_notice_of_pending_upgrade($event, $type, $object) {
if ($object instanceof \ElggUpgrade) {
// Link to the Upgrades section
- $link = elgg_view('output/url', array(
+ $link = elgg_view('output/url', [
'href' => 'admin/upgrades',
'text' => elgg_echo('admin:view_upgrades'),
- ));
+ ]);
$message = elgg_echo('admin:pending_upgrades');
@@ -208,12 +208,12 @@ function _elgg_admin_init() {
elgg_register_plugin_hook_handler('action', 'all', '_elgg_admin_maintenance_action_check', 600);
elgg_register_css('maintenance', elgg_get_simplecache_url('maintenance.css'));
- elgg_register_menu_item('topbar', array(
+ elgg_register_menu_item('topbar', [
'name' => 'maintenance_mode',
'href' => 'admin/administer_utilities/maintenance',
'text' => elgg_echo('admin:maintenance_mode:indicator_menu_item'),
'priority' => 900,
- ));
+ ]);
}
elgg_register_action('admin/user/ban', '', 'admin');
@@ -252,14 +252,14 @@ function _elgg_admin_init() {
// administer
// dashboard
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => 'dashboard',
'href' => 'admin/dashboard',
'text' => elgg_echo('admin:dashboard'),
'context' => 'admin',
'priority' => 10,
'section' => 'administer'
- ));
+ ]);
// statistics
elgg_register_admin_menu_item('administer', 'statistics', null, 20);
elgg_register_admin_menu_item('administer', 'overview', 'statistics');
@@ -278,24 +278,24 @@ function _elgg_admin_init() {
// configure
// upgrades
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => 'upgrades',
'href' => 'admin/upgrades',
'text' => elgg_echo('admin:upgrades'),
'context' => 'admin',
'priority' => 10,
'section' => 'configure'
- ));
+ ]);
// plugins
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => 'plugins',
'href' => 'admin/plugins',
'text' => elgg_echo('admin:plugins'),
'context' => 'admin',
'priority' => 75,
'section' => 'configure'
- ));
+ ]);
// settings
elgg_register_admin_menu_item('configure', 'appearance', null, 50);
@@ -320,13 +320,13 @@ function _elgg_admin_init() {
}
// widgets
- $widgets = array('online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel', 'cron_status');
+ $widgets = ['online_users', 'new_users', 'content_stats', 'banned_users', 'admin_welcome', 'control_panel', 'cron_status'];
foreach ($widgets as $widget) {
elgg_register_widget_type(
$widget,
elgg_echo("admin:widget:$widget"),
elgg_echo("admin:widget:$widget:help"),
- array('admin')
+ ['admin']
);
}
@@ -406,7 +406,7 @@ function _elgg_admin_header_menu($hook, $type, $return, $params) {
$return[] = \ElggMenuItem::factory([
'name' => 'admin_profile',
'href' => false,
- 'text' => elgg_echo('admin:loggedin', array($admin->name)),
+ 'text' => elgg_echo('admin:loggedin', [$admin->name]),
'priority' => 800,
]);
@@ -491,14 +491,14 @@ function _elgg_admin_add_plugin_settings_menu() {
$settings_view_old = 'settings/' . $plugin_id . '/edit';
$settings_view_new = 'plugins/' . $plugin_id . '/settings';
if (elgg_view_exists($settings_view_new) || elgg_view_exists($settings_view_old)) {
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => $plugin_id,
'href' => "admin/plugin_settings/$plugin_id",
'text' => $plugin->getManifest()->getName(),
'parent_name' => 'settings',
'context' => 'admin',
'section' => 'configure',
- ));
+ ]);
}
}
}
@@ -557,7 +557,7 @@ function _elgg_admin_page_handler($page) {
// default to dashboard
if (!isset($page[0]) || empty($page[0])) {
- $page = array('dashboard');
+ $page = ['dashboard'];
}
// was going to fix this in the page_handler() function but
@@ -566,13 +566,12 @@ function _elgg_admin_page_handler($page) {
array_pop($page);
}
- $vars = array('page' => $page);
+ $vars = ['page' => $page];
// special page for plugin settings since we create the form for them
if ($page[0] == 'plugin_settings') {
if (isset($page[1]) && (elgg_view_exists("settings/{$page[1]}/edit") ||
elgg_view_exists("plugins/{$page[1]}/settings"))) {
-
$view = 'admin/plugin_settings';
$plugin = elgg_get_plugin_from_id($page[1]);
$vars['plugin'] = $plugin;
@@ -595,7 +594,7 @@ function _elgg_admin_page_handler($page) {
$content = elgg_echo('admin:unknown_section');
}
- $body = elgg_view_layout('admin', array('content' => $content, 'title' => $title));
+ $body = elgg_view_layout('admin', ['content' => $content, 'title' => $title]);
echo elgg_view_page($title, $body, 'admin');
return true;
}
@@ -654,11 +653,11 @@ function _elgg_admin_maintenance_allow_url($current_url) {
}
// allow plugins to control access for specific URLs/paths
- $params = array(
+ $params = [
'current_path' => $current_path,
'current_url' => $current_url,
- );
- return (bool)elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
+ ];
+ return (bool) elgg_trigger_plugin_hook('maintenance:allow', 'url', $params, false);
}
/**
@@ -745,10 +744,10 @@ function _elgg_add_admin_widgets($event, $type, $user) {
}
// In the form column => array of handlers in order, top to bottom
- $adminWidgets = array(
- 1 => array('control_panel', 'admin_welcome'),
- 2 => array('online_users', 'new_users', 'content_stats'),
- );
+ $adminWidgets = [
+ 1 => ['control_panel', 'admin_welcome'],
+ 2 => ['online_users', 'new_users', 'content_stats'],
+ ];
foreach ($adminWidgets as $column => $handlers) {
foreach ($handlers as $position => $handler) {
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index eb7e087fd84..90abbe17165 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -110,7 +110,7 @@ function update_annotation($annotation_id, $name, $value, $value_type, $owner_gu
* @return \ElggAnnotation[]|mixed
* @since 1.8.0
*/
-function elgg_get_annotations(array $options = array()) {
+function elgg_get_annotations(array $options = []) {
return _elgg_services()->annotations->find($options);
}
@@ -124,11 +124,11 @@ function elgg_get_annotations(array $options = array()) {
* @since 1.8.0
*/
function elgg_list_annotations($options) {
- $defaults = array(
+ $defaults = [
'limit' => 25,
'offset' => (int) max(get_input('annoff', 0), 0),
'no_results' => '',
- );
+ ];
$options = array_merge($defaults, $options);
@@ -215,7 +215,7 @@ function elgg_enable_annotations(array $options) {
* @return mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
-function elgg_get_entities_from_annotations(array $options = array()) {
+function elgg_get_entities_from_annotations(array $options = []) {
return _elgg_services()->annotations->getEntities($options);
}
@@ -229,17 +229,17 @@ function elgg_get_entities_from_annotations(array $options = array()) {
*
* @return string
*/
-function elgg_list_entities_from_annotations($options = array()) {
+function elgg_list_entities_from_annotations($options = []) {
return elgg_list_entities($options, 'elgg_get_entities_from_annotations');
}
/**
* Get entities ordered by a mathematical calculation on annotation values
- *
+ *
* @tip Note that this function uses { @link elgg_get_annotations() } to return a list of entities ordered by a mathematical
- * calculation on annotation values, and { @link elgg_get_entities_from_annotations() } to return a count of entities
+ * calculation on annotation values, and { @link elgg_get_entities_from_annotations() } to return a count of entities
* if $options['count'] is set to a truthy value
- *
+ *
* @param array $options An options array:
* 'calculation' => The calculation to use. Must be a valid MySQL function.
* Defaults to sum. Result selected as 'annotation_calculation'.
@@ -256,9 +256,9 @@ function elgg_list_entities_from_annotations($options = array()) {
* 'metadata_names' => The name of metadata on the entity.
* 'metadata_values' => The value of metadata on the entitiy.
* 'callback' => Callback function to pass each row through.
- * @tip This function is different from other ege* functions,
+ * @tip This function is different from other ege* functions,
* as it uses a metastring-based getter function { @link elgg_get_annotations() },
- * therefore the callback function should be a derivative of { @link entity_row_to_elggstar() }
+ * therefore the callback function should be a derivative of { @link entity_row_to_elggstar() }
* and not of { @link row_to_annotation() }
*
* @return \ElggEntity[]|int An array or a count of entities
@@ -279,10 +279,10 @@ function elgg_get_entities_from_annotation_calculation($options) {
* @return string
*/
function elgg_list_entities_from_annotation_calculation($options) {
- $defaults = array(
+ $defaults = [
'calculation' => 'sum',
'order_by' => 'annotation_calculation desc'
- );
+ ];
$options = array_merge($defaults, $options);
return elgg_list_entities($options, 'elgg_get_entities_from_annotation_calculation');
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index 0b84f9fd1e6..239ab3530e8 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -185,7 +185,7 @@ function _elgg_rmdir($dir, $empty = false) {
_elgg_services()->logger->warn(__FUNCTION__ . ' called with empty $dir');
return true;
}
- $files = array_diff(scandir($dir), array('.', '..'));
+ $files = array_diff(scandir($dir), ['.', '..']);
foreach ($files as $file) {
if (is_dir("$dir/$file")) {
@@ -225,7 +225,7 @@ function elgg_flush_caches() {
/**
* Checks if /cache directory has been symlinked to views simplecache directory
- *
+ *
* @return bool
* @access private
*/
@@ -244,7 +244,7 @@ function _elgg_is_cache_symlinked() {
/**
* Symlinks /cache directory to views simplecache directory
- *
+ *
* @return bool
* @access private
*/
diff --git a/engine/lib/comments.php b/engine/lib/comments.php
index d9ada45ab09..983d646054b 100644
--- a/engine/lib/comments.php
+++ b/engine/lib/comments.php
@@ -45,7 +45,6 @@ function _elgg_comments_page_handler($segments) {
$page = elgg_extract(0, $segments);
switch ($page) {
-
case 'edit':
echo elgg_view_resource('comments/edit', [
'guid' => elgg_extract(1, $segments),
@@ -105,9 +104,9 @@ function _elgg_comment_redirect($comment_guid, $fallback_guid) {
'subtype' => 'comment',
'container_guid' => $container->guid,
'count' => true,
- 'wheres' => ["e.guid < " . (int)$comment->guid],
+ 'wheres' => ["e.guid < " . (int) $comment->guid],
]);
- $limit = (int)get_input('limit');
+ $limit = (int) get_input('limit');
if (!$limit) {
$limit = elgg_trigger_plugin_hook('config', 'comments_per_page', [], 25);
}
@@ -267,15 +266,15 @@ function _elgg_comments_access_sync($event, $type, $entity) {
// need to override access in case comments ended up with ACCESS_PRIVATE
// and to ensure write permissions
$ia = elgg_set_ignore_access(true);
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'comment',
'container_guid' => $entity->getGUID(),
- 'wheres' => array(
+ 'wheres' => [
"e.access_id != {$entity->access_id}"
- ),
+ ],
'limit' => 0,
- );
+ ];
$batch = new \ElggBatch('elgg_get_entities', $options, null, 25, false);
foreach ($batch as $comment) {
diff --git a/engine/lib/cron.php b/engine/lib/cron.php
index 48a6114860a..916c5c45f05 100644
--- a/engine/lib/cron.php
+++ b/engine/lib/cron.php
@@ -17,7 +17,7 @@ function _elgg_cron_init() {
elgg_register_plugin_hook_handler('cron', 'all', '_elgg_cron_monitor', 1000);
- elgg_set_config('elgg_cron_periods', array(
+ elgg_set_config('elgg_cron_periods', [
'minute',
'fiveminute',
'fifteenmin',
@@ -27,7 +27,7 @@ function _elgg_cron_init() {
'weekly',
'monthly',
'yearly',
- ));
+ ]);
elgg_register_admin_menu_item('administer', 'cron', 'statistics');
}
@@ -48,12 +48,12 @@ function _elgg_cron_init() {
*/
function _elgg_cron_run() {
$now = time();
- $params = array();
+ $params = [];
$params['time'] = $now;
$all_std_out = "";
- $periods = array(
+ $periods = [
'minute' => 60,
'fiveminute' => 300,
'fifteenmin' => 900,
@@ -63,7 +63,7 @@ function _elgg_cron_run() {
'weekly' => 604800,
'monthly' => 2628000,
'yearly' => 31536000,
- );
+ ];
foreach ($periods as $period => $interval) {
$key = "cron_latest:$period:ts";
@@ -120,7 +120,7 @@ function _elgg_cron_page_handler($page) {
_elgg_cron_run();
} else {
// Get a list of parameters
- $params = array();
+ $params = [];
$params['time'] = time();
// Data to return to
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index f2947057df9..7fa8450679b 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -37,7 +37,7 @@ function elgg_register_library($name, $location) {
$libraries = $config->get('libraries');
if ($libraries === null) {
- $libraries = array();
+ $libraries = [];
}
$libraries[$name] = $location;
$config->set('libraries', $libraries);
@@ -55,7 +55,7 @@ function elgg_register_library($name, $location) {
* @since 1.8.0
*/
function elgg_load_library($name) {
- static $loaded_libraries = array();
+ static $loaded_libraries = [];
if (in_array($name, $loaded_libraries)) {
return;
@@ -376,8 +376,7 @@ function elgg_get_loaded_external_files($type, $location) {
*
* @return array Filenames in $directory, in the form $directory/filename.
*/
-function elgg_get_file_list($directory, $exceptions = array(), $list = array(),
-$extensions = null) {
+function elgg_get_file_list($directory, $exceptions = [], $list = [], $extensions = null) {
$directory = sanitise_filepath($directory);
if ($handle = opendir($directory)) {
@@ -664,7 +663,7 @@ function elgg_trigger_after_event($event, $object_type, $object = null) {
*
* @see elgg_trigger_event
*/
-function elgg_trigger_deprecated_event($event, $object_type, $object = null, $message, $version) {
+function elgg_trigger_deprecated_event($event, $object_type, $object = null, $message = null, $version = null) {
return _elgg_services()->events->triggerDeprecated($event, $object_type, $object, $message, $version);
}
@@ -910,15 +909,15 @@ function _elgg_php_exception_handler($exception) {
}
if (elgg_is_admin_logged_in()) {
- $body = elgg_view("messages/exceptions/admin_exception", array(
+ $body = elgg_view("messages/exceptions/admin_exception", [
'object' => $exception,
'ts' => $timestamp
- ));
+ ]);
} else {
- $body = elgg_view("messages/exceptions/exception", array(
+ $body = elgg_view("messages/exceptions/exception", [
'object' => $exception,
'ts' => $timestamp
- ));
+ ]);
}
$response->setContent(elgg_view_page(elgg_echo('exception:title'), $body));
@@ -1011,12 +1010,12 @@ function _elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
* @since 1.7.0
*/
function elgg_log($message, $level = 'NOTICE') {
- static $levels = array(
+ static $levels = [
'INFO' => 200,
'NOTICE' => 250,
'WARNING' => 300,
'ERROR' => 400,
- );
+ ];
if (!isset($levels[$level])) {
throw new \InvalidArgumentException("Invalid \$level value");
@@ -1139,7 +1138,7 @@ function elgg_add_action_tokens_to_url($url, $html_encode = false) {
if (isset($components['query'])) {
$query = elgg_parse_str($components['query']);
} else {
- $query = array();
+ $query = [];
}
if (isset($query['__elgg_ts']) && isset($query['__elgg_token'])) {
@@ -1167,7 +1166,7 @@ function elgg_add_action_tokens_to_url($url, $html_encode = false) {
* @since 1.7.0
*/
function elgg_http_remove_url_query_element($url, $element) {
- return elgg_http_add_url_query_elements($url, array($element => null));
+ return elgg_http_add_url_query_elements($url, [$element => null]);
}
/**
@@ -1186,7 +1185,7 @@ function elgg_http_add_url_query_elements($url, array $elements) {
if (isset($url_array['query'])) {
$query = elgg_parse_str($url_array['query']);
} else {
- $query = array();
+ $query = [];
}
foreach ($elements as $k => $v) {
@@ -1224,7 +1223,7 @@ function elgg_http_add_url_query_elements($url, array $elements) {
* @return bool
* @since 1.8.0
*/
-function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset', 'limit')) {
+function elgg_http_url_is_identical($url1, $url2, $ignore_params = ['offset', 'limit']) {
$url1 = elgg_normalize_url($url1);
$url2 = elgg_normalize_url($url2);
@@ -1245,7 +1244,7 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset
}
// compare basic bits
- $parts = array('scheme', 'host', 'path');
+ $parts = ['scheme', 'host', 'path'];
foreach ($parts as $part) {
if ((isset($url1_info[$part]) && isset($url2_info[$part]))
@@ -1265,8 +1264,8 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset
}
// compare get params that might be out of order
- $url1_params = array();
- $url2_params = array();
+ $url1_params = [];
+ $url2_params = [];
if (isset($url1_info['query'])) {
if ($url1_info['query'] = html_entity_decode($url1_info['query'])) {
@@ -1407,10 +1406,9 @@ function elgg_extract_class(array $array, $existing = []) {
*
* @return bool
*/
-function elgg_sort_3d_array_by_value(&$array, $element, $sort_order = SORT_ASC,
-$sort_type = SORT_LOCALE_STRING) {
+function elgg_sort_3d_array_by_value(&$array, $element, $sort_order = SORT_ASC, $sort_type = SORT_LOCALE_STRING) {
- $sort = array();
+ $sort = [];
foreach ($array as $v) {
if (isset($v[$element])) {
@@ -1459,7 +1457,7 @@ function elgg_get_ini_setting_in_bytes($setting) {
// convert INI setting when shorthand notation is used
$last = strtolower($val[strlen($val) - 1]);
- switch($last) {
+ switch ($last) {
case 'g':
$val *= 1024;
// fallthrough intentional
@@ -1515,7 +1513,7 @@ function _elgg_normalize_plural_options_array($options, $singulars) {
} else {
// Test for array refs #2641
if (!is_array($options[$singular])) {
- $options[$plural] = array($options[$singular]);
+ $options[$plural] = [$options[$singular]];
} else {
$options[$plural] = $options[$singular];
}
@@ -1550,7 +1548,7 @@ function _elgg_shutdown_hook() {
_elgg_services()->logger->setDisplay(false);
elgg_trigger_event('shutdown', 'system');
- $time = (float)(microtime(true) - $GLOBALS['START_MICROTIME']);
+ $time = (float) (microtime(true) - $GLOBALS['START_MICROTIME']);
$uri = _elgg_services()->request->server->get('REQUEST_URI', 'CLI');
// demoted to NOTICE from DEBUG so javascript is not corrupted
elgg_log("Page {$uri} generated in $time seconds", 'INFO');
@@ -1603,7 +1601,7 @@ function _elgg_ajax_page_handler($segments) {
}
// pull out GET parameters through filter
- $vars = array();
+ $vars = [];
foreach (_elgg_services()->request->query->keys() as $name) {
$vars[$name] = get_input($name);
}
@@ -1633,7 +1631,7 @@ function _elgg_ajax_page_handler($segments) {
}
} else {
$action = implode('/', array_slice($segments, 1));
- $output = elgg_view_form($action, array(), $vars);
+ $output = elgg_view_form($action, [], $vars);
}
if ($content_type) {
@@ -1752,29 +1750,29 @@ function _elgg_is_valid_options_for_batch_operation($options, $type) {
}
// at least one of these is required.
- $required = array(
+ $required = [
// generic restraints
'guid', 'guids'
- );
+ ];
switch ($type) {
case 'metadata':
- $metadata_required = array(
+ $metadata_required = [
'metadata_owner_guid', 'metadata_owner_guids',
'metadata_name', 'metadata_names',
'metadata_value', 'metadata_values'
- );
+ ];
$required = array_merge($required, $metadata_required);
break;
case 'annotations':
case 'annotation':
- $annotations_required = array(
+ $annotations_required = [
'annotation_owner_guid', 'annotation_owner_guids',
'annotation_name', 'annotation_names',
'annotation_value', 'annotation_values'
- );
+ ];
$required = array_merge($required, $annotations_required);
break;
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 7d56f472e75..5b5567f7536 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -321,7 +321,7 @@ function elgg_enable_entity($guid, $recursive = true) {
* @see elgg_get_entities_from_annotations()
* @see elgg_list_entities()
*/
-function elgg_get_entities(array $options = array()) {
+function elgg_get_entities(array $options = []) {
return _elgg_services()->entityTable->getEntities($options);
}
@@ -388,21 +388,21 @@ function _elgg_get_entity_time_where_sql($table, $time_created_upper = null,
* @see elgg_get_entities()
* @see elgg_view_entity_list()
*/
-function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entities',
+function elgg_list_entities(array $options = [], $getter = 'elgg_get_entities',
$viewer = 'elgg_view_entity_list') {
elgg_register_rss_link();
$offset_key = isset($options['offset_key']) ? $options['offset_key'] : 'offset';
- $defaults = array(
+ $defaults = [
'offset' => (int) max(get_input($offset_key, 0), 0),
'limit' => (int) max(get_input('limit', elgg_get_config('default_limit')), 0),
'full_view' => false,
'list_type_toggle' => false,
'pagination' => true,
'no_results' => '',
- );
+ ];
$options = array_merge($defaults, $options);
@@ -413,7 +413,7 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
$options['count'] = false;
$entities = call_user_func($getter, $options);
} else {
- $entities = array();
+ $entities = [];
}
$options['count'] = $count;
@@ -453,7 +453,7 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
* @throws InvalidArgumentException
* @todo Does not support ordering by attributes or using an attribute pair shortcut like this ('title' => 'foo')
*/
-function elgg_get_entities_from_attributes(array $options = array()) {
+function elgg_get_entities_from_attributes(array $options = []) {
return _elgg_services()->entityTable->getEntitiesFromAttributes($options);
}
@@ -465,7 +465,7 @@ function elgg_get_entities_from_attributes(array $options = array()) {
* @access private
* @throws InvalidArgumentException
*/
-function _elgg_get_entity_attribute_where_sql(array $options = array()) {
+function _elgg_get_entity_attribute_where_sql(array $options = []) {
return _elgg_services()->entityTable->getEntityAttributeWhereSql($options);
}
@@ -486,7 +486,7 @@ function _elgg_get_entity_attribute_where_sql(array $options = array()) {
*
* @return array|false Either an array months as YYYYMM, or false on failure
*/
-function get_entity_dates($type = '', $subtype = '', $container_guid = 0, $ignored = 0, $order_by = 'time_created') {
+function get_entity_dates($type = '', $subtype = '', $container_guid = 0, $ignored = 0, $order_by = 'time_created') {
return _elgg_services()->entityTable->getDates($type, $subtype, $container_guid, $order_by);
}
@@ -513,11 +513,11 @@ function elgg_register_entity_type($type, $subtype = null) {
}
if (!isset($CONFIG->registered_entities)) {
- $CONFIG->registered_entities = array();
+ $CONFIG->registered_entities = [];
}
if (!isset($CONFIG->registered_entities[$type])) {
- $CONFIG->registered_entities[$type] = array();
+ $CONFIG->registered_entities[$type] = [];
}
if ($subtype) {
@@ -644,18 +644,18 @@ function is_registered_entity_type($type, $subtype = null) {
* @return string A viewable list of entities
* @since 1.7.0
*/
-function elgg_list_registered_entities(array $options = array()) {
+function elgg_list_registered_entities(array $options = []) {
elgg_register_rss_link();
- $defaults = array(
+ $defaults = [
'full_view' => false,
'allowed_types' => true,
'list_type_toggle' => false,
'pagination' => true,
'offset' => 0,
- 'types' => array(),
- 'type_subtype_pairs' => array(),
- );
+ 'types' => [],
+ 'type_subtype_pairs' => [],
+ ];
$options = array_merge($defaults, $options);
@@ -679,15 +679,15 @@ function elgg_list_registered_entities(array $options = array()) {
}
if (!empty($options['type_subtype_pairs'])) {
- $count = elgg_get_entities(array_merge(array('count' => true), $options));
+ $count = elgg_get_entities(array_merge(['count' => true], $options));
if ($count > 0) {
$entities = elgg_get_entities($options);
} else {
- $entities = array();
+ $entities = [];
}
} else {
$count = 0;
- $entities = array();
+ $entities = [];
}
$options['count'] = $count;
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index 9ba40ae42e6..407e9d369a2 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -20,7 +20,7 @@
function get_dir_size($dir, $total_size = 0) {
$handle = @opendir($dir);
while ($file = @readdir($handle)) {
- if (in_array($file, array('.', '..'))) {
+ if (in_array($file, ['.', '..'])) {
continue;
}
if (is_dir($dir . $file)) {
@@ -78,7 +78,7 @@ function get_uploaded_file($input_name) {
* @return bool
* @since 2.3
*/
-function elgg_save_resized_image($source, $destination = null, array $params = array()) {
+function elgg_save_resized_image($source, $destination = null, array $params = []) {
return _elgg_services()->imageService->resize($source, $destination, $params);
}
@@ -267,7 +267,7 @@ function delete_directory($directory) {
// loop through all files
while (($file = readdir($handle)) !== false) {
- if (in_array($file, array('.', '..'))) {
+ if (in_array($file, ['.', '..'])) {
continue;
}
@@ -320,7 +320,7 @@ function _elgg_clear_entity_files($entity) {
* @since 1.10
*/
function elgg_get_file_simple_type($mime_type) {
- $params = array('mime_type' => $mime_type);
+ $params = ['mime_type' => $mime_type];
return elgg_trigger_plugin_hook('simple_type', 'file', $params, 'general');
}
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 610f06ac2e9..31299b56934 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -19,7 +19,7 @@
function get_group_entity_as_row($guid) {
global $CONFIG;
- $guid = (int)$guid;
+ $guid = (int) $guid;
return get_data_row("SELECT * from {$CONFIG->dbprefix}groups_entity where guid=$guid");
}
@@ -40,7 +40,7 @@ function add_group_tool_option($name, $label, $default_on = true) {
global $CONFIG;
if (!isset($CONFIG->group_tool_options)) {
- $CONFIG->group_tool_options = array();
+ $CONFIG->group_tool_options = [];
}
$group_tool_option = new \stdClass;
diff --git a/engine/lib/input.php b/engine/lib/input.php
index dcf5b20f045..89aed617966 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -209,17 +209,17 @@ function input_livesearch_page_handler($page) {
$q = sanitise_string($q);
// replace mysql vars with escaped strings
- $q = str_replace(array('_', '%'), array('\_', '\%'), $q);
+ $q = str_replace(['_', '%'], ['\_', '\%'], $q);
$match_on = get_input('match_on', 'all');
if (!is_array($match_on)) {
- $match_on = array($match_on);
+ $match_on = [$match_on];
}
// all = users and groups
if (in_array('all', $match_on)) {
- $match_on = array('users', 'groups');
+ $match_on = ['users', 'groups'];
}
$owner_guid = ELGG_ENTITIES_ANY_VALUE;
@@ -230,42 +230,41 @@ function input_livesearch_page_handler($page) {
$limit = sanitise_int(get_input('limit', elgg_get_config('default_limit')));
// grab a list of entities and send them in json.
- $results = array();
+ $results = [];
foreach ($match_on as $match_type) {
switch ($match_type) {
case 'users':
- $options = array(
+ $options = [
'type' => 'user',
'limit' => $limit,
- 'joins' => array("JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
- 'wheres' => array(
+ 'joins' => ["JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"],
+ 'wheres' => [
"ue.banned = 'no'",
"(ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')"
- )
- );
+ ]
+ ];
$entities = elgg_get_entities($options);
if (!empty($entities)) {
foreach ($entities as $entity) {
-
if (in_array('groups', $match_on)) {
$value = $entity->guid;
} else {
$value = $entity->username;
}
- $output = elgg_view_list_item($entity, array(
+ $output = elgg_view_list_item($entity, [
'use_hover' => false,
'use_link' => false,
'class' => 'elgg-autocomplete-item',
'title' => $entity->name, // Default title would be a link
- ));
+ ]);
- $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ $icon = elgg_view_entity_icon($entity, 'tiny', [
'use_hover' => false,
- ));
+ ]);
- $result = array(
+ $result = [
'type' => 'user',
'name' => $entity->name,
'desc' => $entity->username,
@@ -274,11 +273,11 @@ function input_livesearch_page_handler($page) {
'value' => $value,
'icon' => $icon,
'url' => $entity->getURL(),
- 'html' => elgg_view('input/userpicker/item', array(
+ 'html' => elgg_view('input/userpicker/item', [
'entity' => $entity,
'input_name' => $input_name,
- )),
- );
+ ]),
+ ];
$results[$entity->name . rand(1, 100)] = $result;
}
}
@@ -290,32 +289,32 @@ function input_livesearch_page_handler($page) {
continue;
}
- $options = array(
+ $options = [
'type' => 'group',
'limit' => $limit,
'owner_guid' => $owner_guid,
- 'joins' => array("JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"),
- 'wheres' => array(
+ 'joins' => ["JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"],
+ 'wheres' => [
"(ge.name LIKE '$q%' OR ge.name LIKE '% $q%' OR ge.description LIKE '% $q%')"
- )
- );
+ ]
+ ];
$entities = elgg_get_entities($options);
if (!empty($entities)) {
foreach ($entities as $entity) {
- $output = elgg_view_list_item($entity, array(
+ $output = elgg_view_list_item($entity, [
'use_hover' => false,
'class' => 'elgg-autocomplete-item',
'full_view' => false,
'href' => false,
'title' => $entity->name, // Default title would be a link
- ));
+ ]);
- $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ $icon = elgg_view_entity_icon($entity, 'tiny', [
'use_hover' => false,
- ));
+ ]);
- $result = array(
+ $result = [
'type' => 'group',
'name' => $entity->name,
'desc' => strip_tags($entity->description),
@@ -324,7 +323,7 @@ function input_livesearch_page_handler($page) {
'value' => $entity->guid,
'icon' => $icon,
'url' => $entity->getURL(),
- );
+ ];
$results[$entity->name . rand(1, 100)] = $result;
}
@@ -332,34 +331,33 @@ function input_livesearch_page_handler($page) {
break;
case 'friends':
- $options = array(
+ $options = [
'type' => 'user',
'limit' => $limit,
'relationship' => 'friend',
'relationship_guid' => $user->getGUID(),
- 'joins' => array("JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
- 'wheres' => array(
+ 'joins' => ["JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"],
+ 'wheres' => [
"ue.banned = 'no'",
"(ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')"
- )
- );
+ ]
+ ];
$entities = elgg_get_entities_from_relationship($options);
if (!empty($entities)) {
foreach ($entities as $entity) {
-
- $output = elgg_view_list_item($entity, array(
+ $output = elgg_view_list_item($entity, [
'use_hover' => false,
'use_link' => false,
'class' => 'elgg-autocomplete-item',
'title' => $entity->name, // Default title would be a link
- ));
+ ]);
- $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ $icon = elgg_view_entity_icon($entity, 'tiny', [
'use_hover' => false,
- ));
+ ]);
- $result = array(
+ $result = [
'type' => 'user',
'name' => $entity->name,
'desc' => $entity->username,
@@ -368,11 +366,11 @@ function input_livesearch_page_handler($page) {
'value' => $entity->username,
'icon' => $icon,
'url' => $entity->getURL(),
- 'html' => elgg_view('input/userpicker/item', array(
+ 'html' => elgg_view('input/userpicker/item', [
'entity' => $entity,
'input_name' => $input_name,
- )),
- );
+ ]),
+ ];
$results[$entity->name . rand(1, 100)] = $result;
}
}
@@ -410,7 +408,7 @@ function input_livesearch_page_handler($page) {
function _elgg_htmlawed_filter_tags($hook, $type, $result, $params = null) {
$var = $result;
- $htmlawed_config = array(
+ $htmlawed_config = [
// seems to handle about everything we need.
'safe' => true,
@@ -424,11 +422,11 @@ function _elgg_htmlawed_filter_tags($hook, $type, $result, $params = null) {
'schemes' => '*:http,https,ftp,news,mailto,rtsp,teamspeak,gopher,mms,callto',
// apparent this doesn't work.
// 'style:color,cursor,text-align,font-size,font-weight,font-style,border,margin,padding,float'
- );
+ ];
// add nofollow to all links on output
if (!elgg_in_context('input')) {
- $htmlawed_config['anti_link_spam'] = array('/./', '');
+ $htmlawed_config['anti_link_spam'] = ['/./', ''];
}
$htmlawed_config = elgg_trigger_plugin_hook('config', 'htmlawed', null, $htmlawed_config);
@@ -471,15 +469,15 @@ function _elgg_htmlawed_tag_post_processor($element, $attributes = false) {
}
// this list should be coordinated with the WYSIWYG editor used (tinymce, ckeditor, etc.)
- $allowed_styles = array(
+ $allowed_styles = [
'color', 'cursor', 'text-align', 'vertical-align', 'font-size',
'font-weight', 'font-style', 'border', 'border-top', 'background-color',
'border-bottom', 'border-left', 'border-right',
'margin', 'margin-top', 'margin-bottom', 'margin-left',
'margin-right', 'padding', 'float', 'text-decoration'
- );
+ ];
- $params = array('tag' => $element);
+ $params = ['tag' => $element];
$allowed_styles = elgg_trigger_plugin_hook('allowed_styles', 'htmlawed', $params, $allowed_styles);
// must return something.
@@ -507,7 +505,6 @@ function _elgg_htmlawed_tag_post_processor($element, $attributes = false) {
$style_str = trim($style_str);
$string .= " style=\"$style_str\"";
}
-
} else {
$string .= " $attr=\"$value\"";
}
diff --git a/engine/lib/languages.php b/engine/lib/languages.php
index 1ab342f6607..57d7d95bb27 100644
--- a/engine/lib/languages.php
+++ b/engine/lib/languages.php
@@ -18,7 +18,7 @@
* @return string Either the translated string, the English string,
* or the original language string.
*/
-function elgg_echo($message_key, array $args = array(), $language = "") {
+function elgg_echo($message_key, array $args = [], $language = "") {
return _elgg_services()->translator->translate($message_key, $args, $language);
}
@@ -134,4 +134,5 @@ function elgg_language_key_exists($key, $language = 'en') {
return _elgg_services()->translator->languageKeyExists($key, $language);
}
-return function(\Elgg\EventsService $events) {};
+return function(\Elgg\EventsService $events) {
+};
diff --git a/engine/lib/memcache.php b/engine/lib/memcache.php
index e9d15d9f84b..bf6329d6306 100644
--- a/engine/lib/memcache.php
+++ b/engine/lib/memcache.php
@@ -38,7 +38,7 @@ function _elgg_invalidate_memcache_for_entity($entity_guid) {
* @access private
*/
function _elgg_get_memcache($namespace = 'default') {
- static $caches = array();
+ static $caches = [];
$cache_pool = _elgg_services()->memcacheStashPool;
if (!$cache_pool) {
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 4994d46f24b..146386d0f8d 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -161,7 +161,7 @@ function create_metadata_from_array($entity_guid, array $name_and_values, $value
* @return \ElggMetadata[]|mixed
* @since 1.8.0
*/
-function elgg_get_metadata(array $options = array()) {
+function elgg_get_metadata(array $options = []) {
return _elgg_services()->metadataTable->getAll($options);
}
@@ -271,7 +271,7 @@ function elgg_enable_metadata(array $options) {
* @return \ElggEntity[]|mixed If count, int. If not count, array. false on errors.
* @since 1.7.0
*/
-function elgg_get_entities_from_metadata(array $options = array()) {
+function elgg_get_entities_from_metadata(array $options = []) {
return _elgg_services()->metadataTable->getEntities($options);
}
@@ -328,7 +328,7 @@ function _elgg_get_entity_metadata_where_sql($e_table, $n_table, $names = null,
* @return array Array of strings
*/
function metadata_array_to_values($array) {
- $valuearray = array();
+ $valuearray = [];
if (is_array($array)) {
foreach ($array as $element) {
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php
index f9530bd022f..5d858b8bc2e 100644
--- a/engine/lib/metastrings.php
+++ b/engine/lib/metastrings.php
@@ -61,7 +61,7 @@ function _elgg_get_metastring_based_objects($options) {
return false;
}
- $defaults = array(
+ $defaults = [
// entities
'types' => ELGG_ENTITIES_ANY_VALUE,
'subtypes' => ELGG_ENTITIES_ANY_VALUE,
@@ -95,9 +95,9 @@ function _elgg_get_metastring_based_objects($options) {
'limit' => elgg_get_config('default_limit'),
'offset' => 0,
'count' => false,
- 'selects' => array(),
- 'wheres' => array(),
- 'joins' => array(),
+ 'selects' => [],
+ 'wheres' => [],
+ 'joins' => [],
'distinct' => true,
'preload_owners' => false,
@@ -106,7 +106,7 @@ function _elgg_get_metastring_based_objects($options) {
'batch' => false,
'batch_inc_offset' => true,
'batch_size' => 25,
- );
+ ];
$options = array_merge($defaults, $options);
@@ -131,13 +131,13 @@ function _elgg_get_metastring_based_objects($options) {
}
}
- $singulars = array(
+ $singulars = [
'type', 'subtype', 'type_subtype_pair',
'guid', 'owner_guid', 'container_guid',
'metastring_name', 'metastring_value',
'metastring_owner_guid', 'metastring_id',
'select', 'where', 'join'
- );
+ ];
$options = _elgg_normalize_plural_options_array($options, $singulars);
@@ -149,7 +149,7 @@ function _elgg_get_metastring_based_objects($options) {
// evaluate where clauses
if (!is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
}
$wheres = $options['wheres'];
@@ -187,15 +187,15 @@ function _elgg_get_metastring_based_objects($options) {
// evaluate join clauses
if (!is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
}
- $joins = array();
+ $joins = [];
$joins[] = "JOIN {$db_prefix}entities e ON n_table.entity_guid = e.guid";
// evaluate selects
if (!is_array($options['selects'])) {
- $options['selects'] = array($options['selects']);
+ $options['selects'] = [$options['selects']];
}
$selects = $options['selects'];
@@ -212,10 +212,10 @@ function _elgg_get_metastring_based_objects($options) {
$wheres = array_merge($wheres, $metastring_clauses['wheres']);
$joins = array_merge($joins, $metastring_clauses['joins']);
} else {
- $wheres[] = _elgg_get_access_where_sql(array(
+ $wheres[] = _elgg_get_access_where_sql([
'table_alias' => 'n_table',
'guid_column' => 'entity_guid',
- ));
+ ]);
}
$distinct = $options['distinct'] ? "DISTINCT " : "";
@@ -262,7 +262,7 @@ function _elgg_get_metastring_based_objects($options) {
}
// Add access controls
- $query .= _elgg_get_access_where_sql(array('table_alias' => 'e'));
+ $query .= _elgg_get_access_where_sql(['table_alias' => 'e']);
// reverse order by
if (isset($options['reverse_order_by']) && $options['reverse_order_by']) {
@@ -321,8 +321,7 @@ function _elgg_get_metastring_sql($table, $names = null, $values = null,
&& (!$values && $values !== 0)
&& !$ids
&& (!$pairs && $pairs !== 0)) {
-
- return array();
+ return [];
}
$db_prefix = elgg_get_config('dbprefix');
@@ -332,21 +331,21 @@ function _elgg_get_metastring_sql($table, $names = null, $values = null,
// only supported on values.
$binary = ($case_sensitive) ? ' BINARY ' : '';
- $return = array (
- 'joins' => array (),
- 'wheres' => array()
- );
+ $return = [
+ 'joins' => [],
+ 'wheres' => []
+ ];
- $wheres = array();
+ $wheres = [];
// get names wheres and joins
$names_where = '';
if ($names !== null) {
if (!is_array($names)) {
- $names = array($names);
+ $names = [$names];
}
- $sanitised_names = array();
+ $sanitised_names = [];
foreach ($names as $name) {
// normalise to 0.
if (!$name) {
@@ -364,10 +363,10 @@ function _elgg_get_metastring_sql($table, $names = null, $values = null,
$values_where = '';
if ($values !== null) {
if (!is_array($values)) {
- $values = array($values);
+ $values = [$values];
}
- $sanitised_values = array();
+ $sanitised_values = [];
foreach ($values as $value) {
// normalize to 0
if (!$value) {
@@ -383,7 +382,7 @@ function _elgg_get_metastring_sql($table, $names = null, $values = null,
if ($ids !== null) {
if (!is_array($ids)) {
- $ids = array($ids);
+ $ids = [$ids];
}
$ids_str = implode(',', $ids);
if ($ids_str) {
@@ -399,10 +398,10 @@ function _elgg_get_metastring_sql($table, $names = null, $values = null,
$wheres[] = $values_where;
}
- $wheres[] = _elgg_get_access_where_sql(array(
+ $wheres[] = _elgg_get_access_where_sql([
'table_alias' => $table,
'guid_column' => 'entity_guid',
- ));
+ ]);
if ($where = implode(' AND ', $wheres)) {
$return['wheres'][] = "($where)";
@@ -418,7 +417,7 @@ function _elgg_get_metastring_sql($table, $names = null, $values = null,
* @return array
* @access private
*/
-function _elgg_normalize_metastrings_options(array $options = array()) {
+function _elgg_normalize_metastrings_options(array $options = []) {
// support either metastrings_type or metastring_type
// because I've made this mistake many times and hunting it down is a pain...
@@ -428,10 +427,10 @@ function _elgg_normalize_metastrings_options(array $options = array()) {
$options['metastring_type'] = $type;
// support annotation_ and annotations_ because they're way too easy to confuse
- $prefixes = array('metadata_', 'annotation_', 'annotations_');
+ $prefixes = ['metadata_', 'annotation_', 'annotations_'];
// map the metadata_* options to metastring_* options
- $map = array(
+ $map = [
'names' => 'metastring_names',
'values' => 'metastring_values',
'case_sensitive' => 'metastring_case_sensitive',
@@ -440,10 +439,10 @@ function _elgg_normalize_metastrings_options(array $options = array()) {
'created_time_upper' => 'metastring_created_time_upper',
'calculation' => 'metastring_calculation',
'ids' => 'metastring_ids',
- );
+ ];
foreach ($prefixes as $prefix) {
- $singulars = array("{$prefix}name", "{$prefix}value", "{$prefix}owner_guid", "{$prefix}id");
+ $singulars = ["{$prefix}name", "{$prefix}value", "{$prefix}owner_guid", "{$prefix}id"];
$options = _elgg_normalize_plural_options_array($options, $singulars);
foreach ($map as $specific => $normalized) {
@@ -472,7 +471,7 @@ function _elgg_normalize_metastrings_options(array $options = array()) {
* @access private
*/
function _elgg_set_metastring_based_object_enabled_by_id($id, $enabled, $type) {
- $id = (int)$id;
+ $id = (int) $id;
$db_prefix = elgg_get_config('dbprefix');
$object = _elgg_get_metastring_based_object_from_id($id, $type);
@@ -549,15 +548,15 @@ function _elgg_batch_metastring_based_objects(array $options, $callback, $inc_of
* @access private
*/
function _elgg_get_metastring_based_object_from_id($id, $type) {
- $id = (int)$id;
+ $id = (int) $id;
if (!$id) {
return false;
}
- $options = array(
+ $options = [
'metastring_type' => $type,
'metastring_id' => $id,
- );
+ ];
$obj = _elgg_get_metastring_based_objects($options);
@@ -577,7 +576,7 @@ function _elgg_get_metastring_based_object_from_id($id, $type) {
* @access private
*/
function _elgg_delete_metastring_based_object_by_id($id, $type) {
- $id = (int)$id;
+ $id = (int) $id;
$db_prefix = elgg_get_config('dbprefix');
switch ($type) {
@@ -601,7 +600,7 @@ function _elgg_delete_metastring_based_object_by_id($id, $type) {
if ($obj) {
if ($obj->canEdit()) {
if (elgg_trigger_event('delete', $type, $obj)) {
- return (bool)delete_data("DELETE FROM $table WHERE id = :id", [
+ return (bool) delete_data("DELETE FROM $table WHERE id = :id", [
':id' => $id,
]);
}
@@ -621,7 +620,7 @@ function _elgg_delete_metastring_based_object_by_id($id, $type) {
* @access private
*/
function _elgg_entities_get_metastrings_options($type, $options) {
- $valid_types = array('metadata', 'annotation');
+ $valid_types = ['metadata', 'annotation'];
if (!in_array($type, $valid_types)) {
return false;
}
@@ -630,8 +629,8 @@ function _elgg_entities_get_metastrings_options($type, $options) {
// is plural (elgg_annotations) so rewrite for the table name.
$n_table = ($type == 'annotation') ? 'annotations' : $type;
- $singulars = array("{$type}_name", "{$type}_value",
- "{$type}_name_value_pair", "{$type}_owner_guid");
+ $singulars = ["{$type}_name", "{$type}_value",
+ "{$type}_name_value_pair", "{$type}_owner_guid"];
$options = _elgg_normalize_plural_options_array($options, $singulars);
$clauses = _elgg_get_entity_metadata_where_sql('e', $n_table, $options["{$type}_names"],
@@ -642,18 +641,18 @@ function _elgg_entities_get_metastrings_options($type, $options) {
if ($clauses) {
// merge wheres to pass to elgg_get_entities()
if (isset($options['wheres']) && !is_array($options['wheres'])) {
- $options['wheres'] = array($options['wheres']);
+ $options['wheres'] = [$options['wheres']];
} elseif (!isset($options['wheres'])) {
- $options['wheres'] = array();
+ $options['wheres'] = [];
}
$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
// merge joins to pass to elgg_get_entities()
if (isset($options['joins']) && !is_array($options['joins'])) {
- $options['joins'] = array($options['joins']);
+ $options['joins'] = [$options['joins']];
} elseif (!isset($options['joins'])) {
- $options['joins'] = array();
+ $options['joins'] = [];
}
$options['joins'] = array_merge($options['joins'], $clauses['joins']);
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index 139833570f3..0d6b1fd046b 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -109,7 +109,7 @@ function elgg_register_menu_item($menu_name, $menu_item) {
}
if (!isset($CONFIG->menus[$menu_name])) {
- $CONFIG->menus[$menu_name] = array();
+ $CONFIG->menus[$menu_name] = [];
}
$CONFIG->menus[$menu_name][] = $menu_item;
return true;
@@ -148,7 +148,7 @@ function elgg_unregister_menu_item($menu_name, $item_name) {
*
* @param string $menu_name The name of the menu
* @param string $item_name The unique identifier for this menu item
- *
+ *
* @return bool
* @since 1.8.0
*/
@@ -226,12 +226,12 @@ function elgg_register_title_button($handler = null, $name = 'add', $entity_type
return;
}
- elgg_register_menu_item('title', array(
+ elgg_register_menu_item('title', [
'name' => $name,
'href' => "$handler/$name/$owner->guid",
'text' => elgg_echo("$handler:$name"),
'link_class' => 'elgg-button elgg-button-action',
- ));
+ ]);
}
/**
@@ -248,8 +248,8 @@ function elgg_register_title_button($handler = null, $name = 'add', $entity_type
* @see elgg_get_breadcrumbs
*/
function elgg_push_breadcrumb($title, $link = null) {
- $breadcrumbs = (array)elgg_get_config('breadcrumbs');
- $breadcrumbs[] = array('title' => $title, 'link' => $link);
+ $breadcrumbs = (array) elgg_get_config('breadcrumbs');
+ $breadcrumbs[] = ['title' => $title, 'link' => $link];
elgg_set_config('breadcrumbs', $breadcrumbs);
}
@@ -260,10 +260,10 @@ function elgg_push_breadcrumb($title, $link = null) {
* @since 1.8.0
*/
function elgg_pop_breadcrumb() {
- $breadcrumbs = (array)elgg_get_config('breadcrumbs');
+ $breadcrumbs = (array) elgg_get_config('breadcrumbs');
if (empty($breadcrumbs)) {
- return array();
+ return [];
}
$popped = array_pop($breadcrumbs);
@@ -295,7 +295,7 @@ function elgg_pop_breadcrumb() {
function elgg_get_breadcrumbs(array $breadcrumbs = null) {
if (!isset($breadcrumbs)) {
// if no crumbs set, still allow hook to populate it
- $breadcrumbs = (array)elgg_get_config('breadcrumbs');
+ $breadcrumbs = (array) elgg_get_config('breadcrumbs');
}
if (!is_array($breadcrumbs)) {
@@ -303,9 +303,9 @@ function elgg_get_breadcrumbs(array $breadcrumbs = null) {
$breadcrumbs = [];
}
- $params = array(
+ $params = [
'breadcrumbs' => $breadcrumbs,
- );
+ ];
$params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
$params['segments'] = _elgg_services()->request->getUrlSegments();
@@ -348,7 +348,7 @@ function elgg_prepare_breadcrumbs($hook, $type, $breadcrumbs, $params) {
/**
* Returns default filter tabs (All, Mine, Friends) for the user
- *
+ *
* @param string $context Context to be used to prefix tab URLs
* @param string $selected Name of the selected tab
* @param ElggUser $user User who owns the layout (defaults to logged in user)
@@ -412,7 +412,7 @@ function _elgg_site_menu_setup($hook, $type, $return, $params) {
/* @var \ElggMenuItem[] $registered */
// set up featured menu items
- $featured = array();
+ $featured = [];
foreach ($featured_menu_names as $name) {
foreach ($registered as $index => $item) {
if ($item->getName() == $name) {
@@ -529,27 +529,27 @@ function _elgg_river_menu_setup($hook, $type, $return, $params) {
// add comment link but annotations cannot be commented on
if ($item->annotation_id == 0) {
if ($object->canComment()) {
- $options = array(
+ $options = [
'name' => 'comment',
'href' => "#comments-add-{$object->guid}-{$item->id}",
'text' => elgg_view_icon('speech-bubble'),
'title' => elgg_echo('comment:this'),
'rel' => 'toggle',
'priority' => 50,
- );
+ ];
$return[] = \ElggMenuItem::factory($options);
}
}
if ($item->canDelete()) {
- $options = array(
+ $options = [
'name' => 'delete',
'href' => elgg_add_action_tokens_to_url("action/river/delete?id={$item->id}"),
'text' => elgg_view_icon('delete'),
'title' => elgg_echo('river:delete'),
'confirm' => elgg_echo('deleteconfirm'),
'priority' => 200,
- );
+ ];
$return[] = \ElggMenuItem::factory($options);
}
}
@@ -572,13 +572,13 @@ function _elgg_entity_menu_setup($hook, $type, $return, $params) {
if ($entity->canEdit() && $handler) {
// edit link
- $options = array(
+ $options = [
'name' => 'edit',
'text' => elgg_echo('edit'),
'title' => elgg_echo('edit:this'),
'href' => "$handler/edit/{$entity->getGUID()}",
'priority' => 200,
- );
+ ];
$return[] = \ElggMenuItem::factory($options);
}
@@ -589,14 +589,14 @@ function _elgg_entity_menu_setup($hook, $type, $return, $params) {
} else {
$action = "action/entity/delete";
}
- $options = array(
+ $options = [
'name' => 'delete',
'text' => elgg_view_icon('delete'),
'title' => elgg_echo('delete:this'),
'href' => "$action?guid={$entity->getGUID()}",
'confirm' => elgg_echo('deleteconfirm'),
'priority' => 300,
- );
+ ];
$return[] = \ElggMenuItem::factory($options);
}
@@ -613,32 +613,32 @@ function _elgg_widget_menu_setup($hook, $type, $return, $params) {
/* @var \ElggWidget $widget */
$show_edit = elgg_extract('show_edit', $params, true);
- $collapse = array(
+ $collapse = [
'name' => 'collapse',
'text' => ' ',
'href' => "#elgg-widget-content-$widget->guid",
'link_class' => 'elgg-widget-collapse-button',
'rel' => 'toggle',
'priority' => 1,
- );
+ ];
$return[] = \ElggMenuItem::factory($collapse);
if ($widget->canEdit()) {
- $delete = array(
+ $delete = [
'name' => 'delete',
'text' => elgg_view_icon('delete-alt'),
- 'title' => elgg_echo('widget:delete', array($widget->getTitle())),
+ 'title' => elgg_echo('widget:delete', [$widget->getTitle()]),
'href' => "action/widgets/delete?widget_guid=$widget->guid",
'is_action' => true,
'link_class' => 'elgg-widget-delete-button',
'id' => "elgg-widget-delete-button-$widget->guid",
'data-elgg-widget-type' => $widget->handler,
'priority' => 900,
- );
+ ];
$return[] = \ElggMenuItem::factory($delete);
if ($show_edit) {
- $edit = array(
+ $edit = [
'name' => 'settings',
'text' => elgg_view_icon('settings-alt'),
'title' => elgg_echo('widget:edit'),
@@ -646,7 +646,7 @@ function _elgg_widget_menu_setup($hook, $type, $return, $params) {
'link_class' => "elgg-widget-edit-button",
'rel' => 'toggle',
'priority' => 800,
- );
+ ];
$return[] = \ElggMenuItem::factory($edit);
}
}
@@ -661,20 +661,20 @@ function _elgg_widget_menu_setup($hook, $type, $return, $params) {
function _elgg_login_menu_setup($hook, $type, $return, $params) {
if (elgg_get_config('allow_registration')) {
- $return[] = \ElggMenuItem::factory(array(
+ $return[] = \ElggMenuItem::factory([
'name' => 'register',
'href' => elgg_get_registration_url(),
'text' => elgg_echo('register'),
'link_class' => 'registration_link',
- ));
+ ]);
}
- $return[] = \ElggMenuItem::factory(array(
+ $return[] = \ElggMenuItem::factory([
'name' => 'forgotpassword',
'href' => 'forgotpassword',
'text' => elgg_echo('user:password:lost'),
'link_class' => 'forgot_link',
- ));
+ ]);
return $return;
}
@@ -725,13 +725,13 @@ function _elgg_nav_init() {
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', '_elgg_nav_public_pages');
- elgg_register_menu_item('footer', \ElggMenuItem::factory(array(
+ elgg_register_menu_item('footer', \ElggMenuItem::factory([
'name' => 'powered',
'text' => elgg_echo("elgg:powered"),
'href' => 'http://elgg.org',
'title' => 'Elgg ' . elgg_get_version(true),
'section' => 'meta',
- )));
+ ]));
elgg_register_ajax_view('navigation/menu/user_hover/contents');
diff --git a/engine/lib/notification.php b/engine/lib/notification.php
index dc25f58ba1f..073ce14da93 100644
--- a/engine/lib/notification.php
+++ b/engine/lib/notification.php
@@ -30,7 +30,7 @@
* 'send', 'notification:[method name]'. It receives the notification object
* of the namespace Elgg\Notifications;
- class Notification in the params array with the
+ class Notification in the params array with the
* key 'notification'. The callback should return a boolean to indicate whether
* the message was sent.
*
@@ -62,7 +62,7 @@ class Notification in the params array with the
* @return void
* @since 1.9
*/
-function elgg_register_notification_event($object_type, $object_subtype, array $actions = array()) {
+function elgg_register_notification_event($object_type, $object_subtype, array $actions = []) {
_elgg_services()->notifications->registerEvent($object_type, $object_subtype, $actions);
}
@@ -298,7 +298,7 @@ function _elgg_notifications_smtp_thread_headers($hook, $type, $returnvalue, $pa
return;
}
- $notificationParams = elgg_extract('params', $returnvalue, array());
+ $notificationParams = elgg_extract('params', $returnvalue, []);
/** @var \Elgg\Notifications\Notification */
$notification = elgg_extract('notification', $notificationParams);
@@ -327,7 +327,6 @@ function _elgg_notifications_smtp_thread_headers($hook, $type, $returnvalue, $pa
// let's just thread comments by default
if (($container instanceof \ElggEntity) && ($object instanceof \ElggComment)) {
-
$threadMessageId = "<{$urlPath}.entity.{$container->guid}@{$hostname}>";
$returnvalue['headers']['In-Reply-To'] = $threadMessageId;
$returnvalue['headers']['References'] = $threadMessageId;
@@ -376,27 +375,27 @@ function _elgg_notify_user($to, $from, $subject, $message, array $params = null,
// Sanitise
if (!is_array($to)) {
- $to = array((int) $to);
+ $to = [(int) $to];
}
$from = (int) $from;
//$subject = sanitise_string($subject);
// Get notification methods
if (($methods_override) && (!is_array($methods_override))) {
- $methods_override = array($methods_override);
+ $methods_override = [$methods_override];
}
- $result = array();
+ $result = [];
foreach ($to as $guid) {
// Results for a user are...
- $result[$guid] = array();
+ $result[$guid] = [];
if ($guid) { // Is the guid > 0?
// Are we overriding delivery?
$methods = $methods_override;
if (!$methods) {
$tmp = get_user_notification_settings($guid);
- $methods = array();
+ $methods = [];
// $tmp may be false. don't cast
if (is_object($tmp)) {
foreach ($tmp as $k => $v) {
@@ -411,7 +410,6 @@ function _elgg_notify_user($to, $from, $subject, $message, array $params = null,
if ($methods) {
// Deliver
foreach ($methods as $method) {
-
$handler = $notify_service->getDeprecatedHandler($method);
/* @var callable $handler */
if (!$handler || !is_callable($handler)) {
@@ -484,7 +482,7 @@ function _elgg_notify_user($to, $from, $subject, $message, array $params = null,
* @return array Compound array of each delivery user/delivery method's success or failure.
* @throws NotificationException
*/
-function notify_user($to, $from = 0, $subject = '', $message = '', array $params = array(), $methods_override = null) {
+function notify_user($to, $from = 0, $subject = '', $message = '', array $params = [], $methods_override = null) {
$params['subject'] = $subject;
$params['body'] = $message;
@@ -593,21 +591,21 @@ function elgg_send_email($from, $to, $subject, $body, array $params = null) {
throw new \NotificationException($msg);
}
- $headers = array(
+ $headers = [
"Content-Type" => "text/plain; charset=UTF-8; format=flowed",
"MIME-Version" => "1.0",
"Content-Transfer-Encoding" => "8bit",
- );
+ ];
// return true/false to stop elgg_send_email() from sending
- $mail_params = array(
+ $mail_params = [
'to' => $to,
'from' => $from,
'subject' => $subject,
'body' => $body,
'headers' => $headers,
'params' => $params,
- );
+ ];
// $mail_params is passed as both params and return value. The former is for backwards
// compatibility. The latter is so handlers can now alter the contents/headers of
diff --git a/engine/lib/output.php b/engine/lib/output.php
index bb1c17eeb4a..1d4ff43c41f 100644
--- a/engine/lib/output.php
+++ b/engine/lib/output.php
@@ -86,7 +86,7 @@ function elgg_format_bytes($size, $precision = 2) {
}
$base = log($size) / log(1024);
- $suffixes = array('B', 'kB', 'MB', 'GB', 'TB');
+ $suffixes = ['B', 'kB', 'MB', 'GB', 'TB'];
return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];
}
@@ -114,7 +114,7 @@ function elgg_format_bytes($size, $precision = 2) {
*
* @return string
*/
-function elgg_format_attributes(array $attrs = array()) {
+function elgg_format_attributes(array $attrs = []) {
if (!is_array($attrs) || empty($attrs)) {
return '';
}
@@ -193,7 +193,7 @@ function elgg_format_attributes(array $attrs = array()) {
* @throws InvalidArgumentException
* @since 1.9.0
*/
-function elgg_format_element($tag_name, array $attributes = array(), $text = '', array $options = array()) {
+function elgg_format_element($tag_name, array $attributes = [], $text = '', array $options = []) {
if (is_array($tag_name)) {
$args = $tag_name;
@@ -223,10 +223,10 @@ function elgg_format_element($tag_name, array $attributes = array(), $text = '',
$is_void = $options['is_void'];
} else {
// from http://www.w3.org/TR/html-markup/syntax.html#syntax-elements
- $is_void = in_array(strtolower($tag_name), array(
+ $is_void = in_array(strtolower($tag_name), [
'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem',
'meta', 'param', 'source', 'track', 'wbr'
- ));
+ ]);
}
if (!empty($options['encode_text'])) {
@@ -313,7 +313,7 @@ function elgg_normalize_url($url) {
function elgg_get_friendly_title($title) {
// return a URL friendly title to short circuit normal title formatting
- $params = array('title' => $title);
+ $params = ['title' => $title];
$result = elgg_trigger_plugin_hook('format', 'friendly:title', $params, null);
if ($result) {
return $result;
@@ -345,13 +345,13 @@ function elgg_get_friendly_time($time, $current_time = null) {
}
// return a time string to short circuit normal time formatting
- $params = array('time' => $time, 'current_time' => $current_time);
+ $params = ['time' => $time, 'current_time' => $current_time];
$result = elgg_trigger_plugin_hook('format', 'friendly:time', $params, null);
if ($result) {
return $result;
}
- $diff = abs((int)$current_time - (int)$time);
+ $diff = abs((int) $current_time - (int) $time);
$minute = 60;
$hour = $minute * 60;
@@ -376,10 +376,10 @@ function elgg_get_friendly_time($time, $current_time = null) {
$diff = 1;
}
- $future = ((int)$current_time - (int)$time < 0) ? ':future' : '';
+ $future = ((int) $current_time - (int) $time < 0) ? ':future' : '';
$singular = ($diff == 1) ? ':singular' : '';
- return elgg_echo("friendlytime{$future}{$granularity}{$singular}", array($diff));
+ return elgg_echo("friendlytime{$future}{$granularity}{$singular}", [$diff]);
}
/**
@@ -479,14 +479,14 @@ function elgg_strip_tags($string, $allowable_tags = null) {
*/
function elgg_html_decode($string) {
$string = str_replace(
- array('>', '<', '&', '"', '''),
- array('>', '<', '&', '"', '''),
+ ['>', '<', '&', '"', '''],
+ ['>', '<', '&', '"', '''],
$string
);
$string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8');
$string = str_replace(
- array('>', '<', '&', '"', '''),
- array('>', '<', '&', '"', '''),
+ ['>', '<', '&', '"', '''],
+ ['>', '<', '&', '"', '''],
$string
);
return $string;
diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php
index 2d47a5a74ee..d71a15089e4 100644
--- a/engine/lib/pagehandler.php
+++ b/engine/lib/pagehandler.php
@@ -141,11 +141,11 @@ function elgg_group_gatekeeper($forward = true, $group_guid = null) {
$forward_reason = 'member';
}
- $msg_keys = array(
+ $msg_keys = [
'non_member' => 'membershiprequired',
'logged_out' => 'loggedinrequired',
'no_access' => 'noaccess',
- );
+ ];
register_error(elgg_echo($msg_keys[$visibility->reasonHidden]));
forward($forward_url, $forward_reason);
}
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index 46dff05f900..0cb455f2d40 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -28,7 +28,7 @@ function elgg_get_page_owner_guid($guid = 0) {
}
if ($guid) {
- $page_owner_guid = (int)$guid;
+ $page_owner_guid = (int) $guid;
}
if (isset($page_owner_guid)) {
@@ -37,7 +37,7 @@ function elgg_get_page_owner_guid($guid = 0) {
// return guid of page owner entity
// Note: core registers default_page_owner_handler() to handle this hook.
- $guid = (int)elgg_trigger_plugin_hook('page_owner', 'system', null, 0);
+ $guid = (int) elgg_trigger_plugin_hook('page_owner', 'system', null, 0);
if ($guid) {
$page_owner_guid = $guid;
diff --git a/engine/lib/pam.php b/engine/lib/pam.php
index fb46eb286c2..69ed262f8a2 100644
--- a/engine/lib/pam.php
+++ b/engine/lib/pam.php
@@ -21,7 +21,7 @@
*/
global $_PAM_HANDLERS;
-$_PAM_HANDLERS = array();
+$_PAM_HANDLERS = [];
/**
* Register a PAM handler.
@@ -44,7 +44,7 @@ function register_pam_handler($handler, $importance = "sufficient", $policy = "u
// setup array for this type of pam if not already set
if (!isset($_PAM_HANDLERS[$policy])) {
- $_PAM_HANDLERS[$policy] = array();
+ $_PAM_HANDLERS[$policy] = [];
}
// @todo remove requirement that $handle be a global function
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 318c7cd5ee0..3ffaba05804 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -221,7 +221,7 @@ function _elgg_get_plugin_dependency_strings($dep) {
* @since 1.8.0
* @see \ElggPlugin::getAllUserSettings()
*/
-function elgg_get_all_plugin_user_settings($user_guid = 0, $plugin_id, $return_obj = false) {
+function elgg_get_all_plugin_user_settings($user_guid = 0, $plugin_id = null, $return_obj = false) {
return _elgg_services()->plugins->getAllUserSettings($user_guid, $plugin_id, $return_obj);
}
@@ -237,7 +237,7 @@ function elgg_get_all_plugin_user_settings($user_guid = 0, $plugin_id, $return_o
* @since 1.8.0
* @see \ElggPlugin::setUserSetting()
*/
-function elgg_set_plugin_user_setting($name, $value, $user_guid = 0, $plugin_id) {
+function elgg_set_plugin_user_setting($name, $value, $user_guid = 0, $plugin_id = null) {
return _elgg_services()->plugins->setUserSetting($name, $value, $user_guid, $plugin_id);
}
@@ -252,7 +252,7 @@ function elgg_set_plugin_user_setting($name, $value, $user_guid = 0, $plugin_id)
* @since 1.8.0
* @see \ElggPlugin::unsetUserSetting()
*/
-function elgg_unset_plugin_user_setting($name, $user_guid = 0, $plugin_id) {
+function elgg_unset_plugin_user_setting($name, $user_guid = 0, $plugin_id = null) {
return _elgg_services()->plugins->unsetUserSetting($name, $user_guid, $plugin_id);
}
@@ -268,7 +268,7 @@ function elgg_unset_plugin_user_setting($name, $user_guid = 0, $plugin_id) {
* @since 1.8.0
* @see \ElggPlugin::getUserSetting()
*/
-function elgg_get_plugin_user_setting($name, $user_guid = 0, $plugin_id, $default = null) {
+function elgg_get_plugin_user_setting($name, $user_guid = 0, $plugin_id = null, $default = null) {
return _elgg_services()->plugins->getUserSetting($name, $user_guid, $plugin_id, $default);
}
@@ -357,7 +357,7 @@ function elgg_unset_all_plugin_settings($plugin_id) {
* @return mixed int If count, int. If not count, array. false on errors.
* @since 1.8.0
*/
-function elgg_get_entities_from_plugin_user_settings(array $options = array()) {
+function elgg_get_entities_from_plugin_user_settings(array $options = []) {
return _elgg_services()->plugins->getEntitiesFromUserSettings($options);
}
@@ -397,8 +397,8 @@ function _elgg_plugins_init() {
* @see \Elgg\Database\Plugins::invalidateIsActiveCache
*/
$svc = _elgg_services()->plugins;
- elgg_register_event_handler('deactivate', 'plugin', array($svc, 'invalidateIsActiveCache'));
- elgg_register_event_handler('activate', 'plugin', array($svc, 'invalidateIsActiveCache'));
+ elgg_register_event_handler('deactivate', 'plugin', [$svc, 'invalidateIsActiveCache']);
+ elgg_register_event_handler('activate', 'plugin', [$svc, 'invalidateIsActiveCache']);
elgg_register_action("plugins/settings/save", '', 'admin');
elgg_register_action("plugins/usersettings/save");
diff --git a/engine/lib/private_settings.php b/engine/lib/private_settings.php
index eef19011c5d..3bf61d717ff 100644
--- a/engine/lib/private_settings.php
+++ b/engine/lib/private_settings.php
@@ -41,7 +41,7 @@
* @return mixed int If count, int. If not count, array. false on errors.
* @since 1.8.0
*/
-function elgg_get_entities_from_private_settings(array $options = array()) {
+function elgg_get_entities_from_private_settings(array $options = []) {
return _elgg_services()->privateSettings->getEntities($options);
}
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 7114efa9d02..3e702a9c93c 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -220,7 +220,7 @@ function elgg_get_entity_relationship_where_sql($column, $relationship = null,
*
* @return string The viewable list of entities
*/
-function elgg_list_entities_from_relationship(array $options = array()) {
+function elgg_list_entities_from_relationship(array $options = []) {
return elgg_list_entities($options, 'elgg_get_entities_from_relationship');
}
@@ -234,7 +234,7 @@ function elgg_list_entities_from_relationship(array $options = array()) {
* @return \ElggEntity[]|int|boolean If count, int. If not count, array. false on errors.
* @since 1.8.0
*/
-function elgg_get_entities_from_relationship_count(array $options = array()) {
+function elgg_get_entities_from_relationship_count(array $options = []) {
return _elgg_services()->relationshipsTable->getEntitiesFromCount($options);
}
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 1336b377e7e..03c42a779df 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -36,7 +36,7 @@
* @return int|ElggRiverItem|bool River ID/item or false on failure
* @since 1.9
*/
-function elgg_create_river_item(array $options = array()) {
+function elgg_create_river_item(array $options = []) {
$view = elgg_extract('view', $options);
// use default viewtype for when called from web services api
if (empty($view) || !(elgg_view_exists($view, 'default'))) {
@@ -80,7 +80,7 @@ function elgg_create_river_item(array $options = array()) {
$return_item = elgg_extract('return_item', $options, false);
- $values = array(
+ $values = [
'type' => $object->getType(),
'subtype' => $object->getSubtype(),
'action_type' => $action_type,
@@ -91,8 +91,8 @@ function elgg_create_river_item(array $options = array()) {
'target_guid' => $target_guid,
'annotation_id' => $annotation_id,
'posted' => $posted,
- );
- $col_types = array(
+ ];
+ $col_types = [
'type' => 'string',
'subtype' => 'string',
'action_type' => 'string',
@@ -103,7 +103,7 @@ function elgg_create_river_item(array $options = array()) {
'target_guid' => 'int',
'annotation_id' => 'int',
'posted' => 'int',
- );
+ ];
// return false to stop insert
$values = elgg_trigger_plugin_hook('creating', 'river', null, $values);
@@ -117,7 +117,7 @@ function elgg_create_river_item(array $options = array()) {
foreach ($values as $name => $value) {
$sql_columns[] = $name;
$sql_values[] = ":$name";
- $query_params[":$name"] = ($col_types[$name] === 'int') ? (int)$value : $value;
+ $query_params[":$name"] = ($col_types[$name] === 'int') ? (int) $value : $value;
}
$sql = "
INSERT INTO {$dbprefix}river (" . implode(',', $sql_columns) . ")
@@ -133,7 +133,7 @@ function elgg_create_river_item(array $options = array()) {
$object->updateLastAction($values['posted']);
$ia = elgg_set_ignore_access(true);
- $river_items = elgg_get_river(array('id' => $id));
+ $river_items = elgg_get_river(['id' => $id]);
elgg_set_ignore_access($ia);
if (!$river_items) {
@@ -194,10 +194,10 @@ function elgg_create_river_item(array $options = array()) {
* @return \ElggRiverItem[]|\Elgg\BatchResult|array|int
* @since 1.8.0
*/
-function elgg_get_river(array $options = array()) {
+function elgg_get_river(array $options = []) {
global $CONFIG;
- $defaults = array(
+ $defaults = [
'ids' => ELGG_ENTITIES_ANY_VALUE,
'subject_guids' => ELGG_ENTITIES_ANY_VALUE,
@@ -229,9 +229,9 @@ function elgg_get_river(array $options = array()) {
'order_by' => 'rv.posted desc',
'group_by' => ELGG_ENTITIES_ANY_VALUE,
- 'wheres' => array(),
- 'joins' => array(),
- );
+ 'wheres' => [],
+ 'joins' => [],
+ ];
if (isset($options['view']) || isset($options['views'])) {
$msg = __FUNCTION__ . ' does not support the "views" option, though you may specify values for'
@@ -251,7 +251,7 @@ function elgg_get_river(array $options = array()) {
return new \ElggBatch('elgg_get_river', $options, null, $batch_size, $batch_inc_offset);
}
- $singulars = array('id', 'subject_guid', 'object_guid', 'target_guid', 'annotation_id', 'action_type', 'type', 'subtype');
+ $singulars = ['id', 'subject_guid', 'object_guid', 'target_guid', 'annotation_id', 'action_type', 'type', 'subtype'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
$wheres = $options['wheres'];
@@ -280,7 +280,7 @@ function elgg_get_river(array $options = array()) {
$dbprefix = elgg_get_config('dbprefix');
// joins
- $joins = array();
+ $joins = [];
$joins[] = "JOIN {$dbprefix}entities oe ON rv.object_guid = oe.guid";
// LEFT JOIN is used because all river items do not necessarily have target
@@ -338,8 +338,8 @@ function elgg_get_river(array $options = array()) {
}
// Make sure that user has access to all the entities referenced by each river item
- $object_access_where = _elgg_get_access_where_sql(array('table_alias' => 'oe'));
- $target_access_where = _elgg_get_access_where_sql(array('table_alias' => 'te'));
+ $object_access_where = _elgg_get_access_where_sql(['table_alias' => 'oe']);
+ $target_access_where = _elgg_get_access_where_sql(['table_alias' => 'te']);
// We use LEFT JOIN with entities table but the WHERE clauses are used
// regardless if a JOIN is successfully made. The "te.guid IS NULL" is
@@ -367,7 +367,7 @@ function elgg_get_river(array $options = array()) {
return $river_items;
} else {
$total = get_data_row($query);
- return (int)$total->total;
+ return (int) $total->total;
}
}
@@ -379,7 +379,7 @@ function elgg_get_river(array $options = array()) {
*/
function _elgg_prefetch_river_entities(array $river_items) {
// prefetch objects, subjects and targets
- $guids = array();
+ $guids = [];
foreach ($river_items as $item) {
if ($item->subject_guid && !_elgg_services()->entityCache->get($item->subject_guid)) {
$guids[$item->subject_guid] = true;
@@ -395,15 +395,15 @@ function _elgg_prefetch_river_entities(array $river_items) {
// The entity cache only holds 256. We don't want to bump out any plugins.
$guids = array_slice($guids, 0, 200, true);
// return value unneeded, just priming cache
- elgg_get_entities(array(
+ elgg_get_entities([
'guids' => array_keys($guids),
'limit' => 0,
'distinct' => false,
- ));
+ ]);
}
// prefetch object containers, in case they were not in the targets
- $guids = array();
+ $guids = [];
foreach ($river_items as $item) {
$object = $item->getObjectEntity();
if ($object->container_guid && !_elgg_services()->entityCache->get($object->container_guid)) {
@@ -412,7 +412,7 @@ function _elgg_prefetch_river_entities(array $river_items) {
}
if ($guids) {
$guids = array_slice($guids, 0, 200, true);
- elgg_get_entities(array(
+ elgg_get_entities([
'guids' => array_keys($guids),
'limit' => 0,
'distinct' => false,
@@ -420,7 +420,7 @@ function _elgg_prefetch_river_entities(array $river_items) {
// Why specify? user containers are likely already loaded via the owners, and
// specifying groups allows ege() to auto-join the groups_entity table
'type' => 'group',
- ));
+ ]);
}
// Note: We've tried combining the above ege() calls into one (pulling containers at the same time).
@@ -438,16 +438,16 @@ function _elgg_prefetch_river_entities(array $river_items) {
* @return string
* @since 1.8.0
*/
-function elgg_list_river(array $options = array()) {
+function elgg_list_river(array $options = []) {
elgg_register_rss_link();
- $defaults = array(
+ $defaults = [
'offset' => (int) max(get_input('offset', 0), 0),
'limit' => (int) max(get_input('limit', max(20, elgg_get_config('default_limit'))), 0),
'pagination' => true,
'list_class' => 'elgg-list-river',
'no_results' => '',
- );
+ ];
$options = array_merge($defaults, $options);
@@ -463,7 +463,7 @@ function elgg_list_river(array $options = array()) {
$options['count'] = false;
$items = elgg_get_river($options);
} else {
- $items = array();
+ $items = [];
}
$options['count'] = $count;
@@ -510,15 +510,15 @@ function _elgg_get_river_type_subtype_where_sql($table, $types, $subtypes, $pair
return '';
}
- $wheres = array();
- $types_wheres = array();
- $subtypes_wheres = array();
+ $wheres = [];
+ $types_wheres = [];
+ $subtypes_wheres = [];
// if no pairs, use types and subtypes
if (!is_array($pairs)) {
if ($types) {
if (!is_array($types)) {
- $types = array($types);
+ $types = [$types];
}
foreach ($types as $type) {
$type = sanitise_string($type);
@@ -528,7 +528,7 @@ function _elgg_get_river_type_subtype_where_sql($table, $types, $subtypes, $pair
if ($subtypes) {
if (!is_array($subtypes)) {
- $subtypes = array($subtypes);
+ $subtypes = [$subtypes];
}
foreach ($subtypes as $subtype) {
$subtype = sanitise_string($subtype);
@@ -537,15 +537,14 @@ function _elgg_get_river_type_subtype_where_sql($table, $types, $subtypes, $pair
}
if (is_array($types_wheres) && count($types_wheres)) {
- $types_wheres = array(implode(' OR ', $types_wheres));
+ $types_wheres = [implode(' OR ', $types_wheres)];
}
if (is_array($subtypes_wheres) && count($subtypes_wheres)) {
- $subtypes_wheres = array('(' . implode(' OR ', $subtypes_wheres) . ')');
+ $subtypes_wheres = ['(' . implode(' OR ', $subtypes_wheres) . ')'];
}
- $wheres = array(implode(' AND ', array_merge($types_wheres, $subtypes_wheres)));
-
+ $wheres = [implode(' AND ', array_merge($types_wheres, $subtypes_wheres))];
} else {
// using type/subtype pairs
foreach ($pairs as $paired_type => $paired_subtypes) {
@@ -593,7 +592,7 @@ function _elgg_river_get_action_where_sql($types) {
}
// sanitize types array
- $types_sanitized = array();
+ $types_sanitized = [];
foreach ($types as $type) {
$types_sanitized[] = sanitise_string($type);
}
@@ -622,7 +621,7 @@ function _elgg_river_get_view_where_sql($views) {
}
// sanitize views array
- $views_sanitized = array();
+ $views_sanitized = [];
foreach ($views as $view) {
$views_sanitized[] = sanitise_string($view);
}
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index ed1311f047d..066708cbaa1 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -67,7 +67,7 @@ function elgg_is_admin_logged_in() {
*/
function elgg_is_admin_user($user_guid) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$current_user = elgg_get_logged_in_user_entity();
if ($current_user && $current_user->guid == $user_guid) {
@@ -108,7 +108,7 @@ function elgg_is_admin_user($user_guid) {
*/
function elgg_authenticate($username, $password) {
$pam = new \ElggPAM('user');
- $credentials = array('username' => $username, 'password' => $password);
+ $credentials = ['username' => $username, 'password' => $password];
$result = $pam->authenticate($credentials);
if (!$result) {
return $pam->getFailureMessage();
@@ -128,7 +128,7 @@ function elgg_authenticate($username, $password) {
* @throws LoginException
* @access private
*/
-function pam_auth_userpass(array $credentials = array()) {
+function pam_auth_userpass(array $credentials = []) {
if (!isset($credentials['username']) || !isset($credentials['password'])) {
return false;
@@ -167,11 +167,11 @@ function pam_auth_userpass(array $credentials = array()) {
* @return bool
*/
function log_login_failure($user_guid) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$user = get_entity($user_guid);
if (($user_guid) && ($user) && ($user instanceof \ElggUser)) {
- $fails = (int)$user->getPrivateSetting("login_failures");
+ $fails = (int) $user->getPrivateSetting("login_failures");
$fails++;
$user->setPrivateSetting("login_failures", $fails);
@@ -190,11 +190,11 @@ function log_login_failure($user_guid) {
* @return bool true on success (success = user has no logged failed attempts)
*/
function reset_login_failure_count($user_guid) {
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$user = get_entity($user_guid);
if (($user_guid) && ($user) && ($user instanceof \ElggUser)) {
- $fails = (int)$user->getPrivateSetting("login_failures");
+ $fails = (int) $user->getPrivateSetting("login_failures");
if ($fails) {
for ($n = 1; $n <= $fails; $n++) {
@@ -223,11 +223,11 @@ function reset_login_failure_count($user_guid) {
function check_rate_limit_exceeded($user_guid) {
// 5 failures in 5 minutes causes temporary block on logins
$limit = 5;
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$user = get_entity($user_guid);
if (($user_guid) && ($user) && ($user instanceof \ElggUser)) {
- $fails = (int)$user->getPrivateSetting("login_failures");
+ $fails = (int) $user->getPrivateSetting("login_failures");
if ($fails >= $limit) {
$cnt = 0;
$time = time();
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index f26e9efca2f..9478515f613 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -28,7 +28,7 @@ function elgg_get_site_entity() {
function get_site_entity_as_row($guid) {
global $CONFIG;
- $guid = (int)$guid;
+ $guid = (int) $guid;
return get_data_row("SELECT * FROM {$CONFIG->dbprefix}sites_entity WHERE guid = $guid");
}
diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php
index 0f59a3bc680..1c9f09ac890 100644
--- a/engine/lib/statistics.php
+++ b/engine/lib/statistics.php
@@ -20,21 +20,21 @@
function get_entity_statistics($owner_guid = 0) {
$owner_guid = (int) $owner_guid;
- $entity_stats = array();
+ $entity_stats = [];
- $grouped_entities = elgg_get_entities(array(
- 'selects' => array('COUNT(*) as cnt'),
+ $grouped_entities = elgg_get_entities([
+ 'selects' => ['COUNT(*) as cnt'],
'owner_guids' => ($owner_guid) ? : ELGG_ENTITIES_ANY_VALUE,
'group_by' => 'e.type, e.subtype',
'limit' => 0,
'order_by' => 'cnt DESC',
- ));
+ ]);
if (!empty($grouped_entities)) {
foreach ($grouped_entities as $entity) {
$type = $entity->getType();
if (!isset($entity_stats[$type]) || !is_array($entity_stats[$type])) {
- $entity_stats[$type] = array();
+ $entity_stats[$type] = [];
}
$subtype = $entity->getSubtype();
if (!$subtype) {
@@ -60,7 +60,7 @@ function get_number_users($show_deactivated = false) {
$access = "";
if (!$show_deactivated) {
- $access = "and " . _elgg_get_access_where_sql(array('table_alias' => ''));
+ $access = "and " . _elgg_get_access_where_sql(['table_alias' => '']);
}
$query = "SELECT count(*) as count
@@ -86,10 +86,10 @@ function get_number_users($show_deactivated = false) {
*
* @return string
*/
-function get_online_users(array $options = array()) {
- $options = array_merge(array(
+function get_online_users(array $options = []) {
+ $options = array_merge([
'seconds' => 600,
- ), $options);
+ ], $options);
return elgg_list_entities($options, 'find_active_users');
}
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php
index 469e7f5102d..2896bdbaa3b 100644
--- a/engine/lib/system_log.php
+++ b/engine/lib/system_log.php
@@ -39,7 +39,7 @@ function get_system_log($by_user = "", $event = "", $class = "", $type = "", $su
$by_user[$key] = (int) $val;
}
} else {
- $by_user = (int)$by_user;
+ $by_user = (int) $by_user;
}
$event = sanitise_string($event);
@@ -50,10 +50,10 @@ function get_system_log($by_user = "", $event = "", $class = "", $type = "", $su
if ($limit === null) {
$limit = elgg_get_config('default_limit');
}
- $limit = (int)$limit;
- $offset = (int)$offset;
+ $limit = (int) $limit;
+ $offset = (int) $offset;
- $where = array();
+ $where = [];
if ($by_user_orig !== "" && $by_user_orig !== false && $by_user_orig !== null) {
if (is_int($by_user)) {
@@ -124,7 +124,7 @@ function get_system_log($by_user = "", $event = "", $class = "", $type = "", $su
function get_log_entry($entry_id) {
global $CONFIG;
- $entry_id = (int)$entry_id;
+ $entry_id = (int) $entry_id;
return get_data_row("SELECT * from {$CONFIG->dbprefix}system_log where id=$entry_id");
}
@@ -152,11 +152,11 @@ function get_object_from_log_entry($entry) {
return false;
}
- $getters = array(
+ $getters = [
'ElggAnnotation' => 'elgg_get_annotation_from_id',
'ElggMetadata' => 'elgg_get_metadata_from_id',
'ElggRelationship' => 'get_relationship',
- );
+ ];
if (isset($getters[$class]) && is_callable($getters[$class])) {
$object = call_user_func($getters[$class], $id);
@@ -168,7 +168,6 @@ function get_object_from_log_entry($entry) {
$object = new $class($entry->object_id);
return $object;
} catch (Exception $e) {
-
}
}
@@ -194,7 +193,6 @@ function system_log($object, $event) {
static $cache_size = 0;
if ($object instanceof Loggable) {
-
/* @var \ElggEntity|\ElggExtender $object */
if (elgg_get_config('version') < 2012012000) {
// this is a site that doesn't have the ip_address column yet
@@ -203,12 +201,12 @@ function system_log($object, $event) {
// reset cache if it has grown too large
if (!is_array($log_cache) || $cache_size > 500) {
- $log_cache = array();
+ $log_cache = [];
$cache_size = 0;
}
// Has loggable interface, extract the necessary information and store
- $object_id = (int)$object->getSystemLogID();
+ $object_id = (int) $object->getSystemLogID();
$object_class = get_class($object);
$object_type = $object->getType();
$object_subtype = $object->getSubtype();
@@ -264,7 +262,7 @@ function system_log($object, $event) {
function archive_log($offset = 0) {
global $CONFIG;
- $offset = (int)$offset;
+ $offset = (int) $offset;
$now = time(); // Take a snapshot of now
$ts = $now - $offset;
@@ -319,7 +317,7 @@ function system_log_default_logger($event, $object_type, $object) {
*/
function system_log_listener($event, $object_type, $object) {
if (($object_type != 'systemlog') && ($event != 'log')) {
- elgg_trigger_event('log', 'systemlog', array('object' => $object, 'event' => $event));
+ elgg_trigger_event('log', 'systemlog', ['object' => $object, 'event' => $event]);
}
return true;
diff --git a/engine/lib/tags.php b/engine/lib/tags.php
index 33c470fc283..e1d5b4b9512 100644
--- a/engine/lib/tags.php
+++ b/engine/lib/tags.php
@@ -73,14 +73,14 @@ function string_to_tag_array($string) {
* otherwise, array of objects with ->tag and ->total values
* @since 1.7.1
*/
-function elgg_get_tags(array $options = array()) {
+function elgg_get_tags(array $options = []) {
global $CONFIG;
_elgg_check_unsupported_site_guid($options);
- $defaults = array(
+ $defaults = [
'threshold' => 1,
- 'tag_names' => array(),
+ 'tag_names' => [],
'limit' => elgg_get_config('default_limit'),
'types' => ELGG_ENTITIES_ANY_VALUE,
@@ -95,14 +95,14 @@ function elgg_get_tags(array $options = array()) {
'created_time_lower' => ELGG_ENTITIES_ANY_VALUE,
'created_time_upper' => ELGG_ENTITIES_ANY_VALUE,
- 'joins' => array(),
- 'wheres' => array(),
- );
+ 'joins' => [],
+ 'wheres' => [],
+ ];
$options = array_merge($defaults, $options);
- $singulars = array('type', 'subtype', 'owner_guid', 'container_guid', 'tag_name');
+ $singulars = ['type', 'subtype', 'owner_guid', 'container_guid', 'tag_name'];
$options = _elgg_normalize_plural_options_array($options, $singulars);
$registered_tags = elgg_get_registered_tag_metadata_names();
@@ -121,7 +121,7 @@ function elgg_get_tags(array $options = array()) {
// catch for tags that were spaces
$wheres[] = "md.value != ''";
- $sanitised_tags = array();
+ $sanitised_tags = [];
foreach ($options['tag_names'] as $tag) {
$sanitised_tags[] = '"' . sanitise_string($tag) . '"';
}
@@ -203,7 +203,7 @@ function elgg_get_tags(array $options = array()) {
*/
function elgg_register_tag_metadata_name($name) {
if (!isset($GLOBALS['_ELGG']->registered_tag_metadata_names)) {
- $GLOBALS['_ELGG']->registered_tag_metadata_names = array();
+ $GLOBALS['_ELGG']->registered_tag_metadata_names = [];
}
if (!in_array($name, $GLOBALS['_ELGG']->registered_tag_metadata_names)) {
@@ -220,7 +220,7 @@ function elgg_register_tag_metadata_name($name) {
* @since 1.7.0
*/
function elgg_get_registered_tag_metadata_names() {
- $names = (isset($GLOBALS['_ELGG']->registered_tag_metadata_names)) ? $GLOBALS['_ELGG']->registered_tag_metadata_names : array();
+ $names = (isset($GLOBALS['_ELGG']->registered_tag_metadata_names)) ? $GLOBALS['_ELGG']->registered_tag_metadata_names : [];
return $names;
}
diff --git a/engine/lib/upgrade.php b/engine/lib/upgrade.php
index bbae7884cf1..a7aefd83e5d 100644
--- a/engine/lib/upgrade.php
+++ b/engine/lib/upgrade.php
@@ -45,7 +45,7 @@ function elgg_get_upgrade_files($upgrade_path = null) {
return false;
}
- $upgrade_files = array();
+ $upgrade_files = [];
while ($upgrade_file = readdir($handle)) {
// make sure this is a well formed upgrade.
diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php
index e5ce60537a1..c1879f68e37 100644
--- a/engine/lib/user_settings.php
+++ b/engine/lib/user_settings.php
@@ -31,10 +31,10 @@ function _elgg_set_user_password() {
if ($user && $password) {
// let admin user change anyone's password without knowing it except his own.
if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) {
- $credentials = array(
+ $credentials = [
'username' => $user->username,
'password' => $current_password
- );
+ ];
try {
pam_auth_userpass($credentials);
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 9cd75a98a22..bb3f600ba93 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -205,13 +205,13 @@ function validate_username($username) {
}
if (strlen($username) < $CONFIG->minusername) {
- $msg = elgg_echo('registration:usernametooshort', array($CONFIG->minusername));
+ $msg = elgg_echo('registration:usernametooshort', [$CONFIG->minusername]);
throw new \RegistrationException($msg);
}
// username in the database has a limit of 128 characters
if (strlen($username) > 128) {
- $msg = elgg_echo('registration:usernametoolong', array(128));
+ $msg = elgg_echo('registration:usernametoolong', [128]);
throw new \RegistrationException($msg);
}
@@ -235,11 +235,11 @@ function validate_username($username) {
$blacklist2 = '\'/\\"*& ?#%^(){}[]~?<>;|¬`@+=';
$blacklist2 = elgg_trigger_plugin_hook('username:character_blacklist', 'user',
- array('blacklist' => $blacklist2), $blacklist2);
+ ['blacklist' => $blacklist2], $blacklist2);
for ($n = 0; $n < strlen($blacklist2); $n++) {
if (strpos($username, $blacklist2[$n]) !== false) {
- $msg = elgg_echo('registration:invalidchars', array($blacklist2[$n], $blacklist2));
+ $msg = elgg_echo('registration:invalidchars', [$blacklist2[$n], $blacklist2]);
$msg = htmlspecialchars($msg, ENT_QUOTES, 'UTF-8');
throw new \RegistrationException($msg);
}
@@ -247,7 +247,7 @@ function validate_username($username) {
$result = true;
return elgg_trigger_plugin_hook('registeruser:validate:username', 'all',
- array('username' => $username), $result);
+ ['username' => $username], $result);
}
/**
@@ -266,13 +266,13 @@ function validate_password($password) {
}
if (strlen($password) < $CONFIG->min_password_length) {
- $msg = elgg_echo('registration:passwordtooshort', array($CONFIG->min_password_length));
+ $msg = elgg_echo('registration:passwordtooshort', [$CONFIG->min_password_length]);
throw new \RegistrationException($msg);
}
$result = true;
return elgg_trigger_plugin_hook('registeruser:validate:password', 'all',
- array('password' => $password), $result);
+ ['password' => $password], $result);
}
/**
@@ -291,7 +291,7 @@ function validate_email_address($address) {
// Got here, so lets try a hook (defaulting to ok)
$result = true;
return elgg_trigger_plugin_hook('registeruser:validate:email', 'all',
- array('email' => $address), $result);
+ ['email' => $address], $result);
}
/**
@@ -516,7 +516,7 @@ function elgg_user_hover_menu($hook, $type, $return, $params) {
}
if (elgg_is_admin_logged_in()) {
- $actions = array();
+ $actions = [];
if (!$user->isBanned()) {
$actions[] = 'ban';
} else {
@@ -583,24 +583,24 @@ function elgg_users_setup_entity_menu($hook, $type, $return, $params) {
if ($entity->isBanned()) {
$banned = elgg_echo('banned');
- $options = array(
+ $options = [
'name' => 'banned',
'text' => "$banned ",
'href' => false,
'priority' => 0,
- );
- $return = array(\ElggMenuItem::factory($options));
+ ];
+ $return = [\ElggMenuItem::factory($options)];
} else {
- $return = array();
+ $return = [];
$location = $entity->location;
if (is_string($location) && $location !== '') {
$location = htmlspecialchars($location, ENT_QUOTES, 'UTF-8', false);
- $options = array(
+ $options = [
'name' => 'location',
'text' => "$location ",
'href' => false,
'priority' => 150,
- );
+ ];
$return[] = \ElggMenuItem::factory($options);
}
}
@@ -619,7 +619,7 @@ function elgg_users_setup_entity_menu($hook, $type, $return, $params) {
function elgg_profile_fields_setup() {
global $CONFIG;
- $profile_defaults = array (
+ $profile_defaults = [
'description' => 'longtext',
'briefdescription' => 'text',
'location' => 'location',
@@ -630,9 +630,9 @@ function elgg_profile_fields_setup() {
'mobile' => 'text',
'website' => 'url',
'twitter' => 'text',
- );
+ ];
- $loaded_defaults = array();
+ $loaded_defaults = [];
$fieldlist = elgg_get_config('profile_custom_fields');
if ($fieldlist || $fieldlist === '0') {
$fieldlistarray = explode(',', $fieldlist);
@@ -640,7 +640,7 @@ function elgg_profile_fields_setup() {
if ($translation = elgg_get_config("admin_defined_profile_{$listitem}")) {
$type = elgg_get_config("admin_defined_profile_type_{$listitem}");
$loaded_defaults["admin_defined_profile_{$listitem}"] = $type;
- add_translation(get_current_language(), array("profile:admin_defined_profile_{$listitem}" => $translation));
+ add_translation(get_current_language(), ["profile:admin_defined_profile_{$listitem}" => $translation]);
}
}
}
@@ -657,7 +657,7 @@ function elgg_profile_fields_setup() {
if ($type == 'tags' || $type == 'location' || $type == 'tag') {
elgg_register_tag_metadata_name($name);
// register a tag name translation
- add_translation(get_current_language(), array("tag_names:$name" => elgg_echo("profile:$name")));
+ add_translation(get_current_language(), ["tag_names:$name" => elgg_echo("profile:$name")]);
}
}
}
@@ -727,7 +727,7 @@ function _elgg_user_page_menu($hook, $type, $return, $params) {
'href' => "avatar/edit/{$owner->username}",
'text' => elgg_echo('avatar:edit'),
'section' => '1_profile',
- 'contexts' => array('settings'),
+ 'contexts' => ['settings'],
]);
$return[] = \ElggMenuItem::factory([
@@ -735,7 +735,7 @@ function _elgg_user_page_menu($hook, $type, $return, $params) {
'href' => "profile/{$owner->username}/edit",
'text' => elgg_echo('profile:edit'),
'section' => '1_profile',
- 'contexts' => array('settings'),
+ 'contexts' => ['settings'],
]);
return $return;
diff --git a/engine/lib/views.php b/engine/lib/views.php
index b8fedb7a921..5ead9007c7e 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -132,7 +132,7 @@ function _elgg_get_initial_viewtype() {
*/
function elgg_register_viewtype($viewtype) {
if (!isset($GLOBALS['_ELGG']->view_types) || !is_array($GLOBALS['_ELGG']->view_types)) {
- $GLOBALS['_ELGG']->view_types = array();
+ $GLOBALS['_ELGG']->view_types = [];
}
if (!in_array($viewtype, $GLOBALS['_ELGG']->view_types)) {
@@ -333,7 +333,7 @@ function elgg_list_views($viewtype = 'default') {
*
* @return string The parsed view
*/
-function elgg_view($view, $vars = array(), $ignore1 = false, $ignore2 = false, $viewtype = '') {
+function elgg_view($view, $vars = [], $ignore1 = false, $ignore2 = false, $viewtype = '') {
return _elgg_services()->views->renderView($view, $vars, $ignore1, $viewtype);
}
@@ -444,14 +444,14 @@ function elgg_prepend_css_urls($css, $path) {
* @return string The contents of the page
* @since 1.8
*/
-function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) {
+function elgg_view_page($title, $body, $page_shell = 'default', $vars = []) {
$timer = _elgg_services()->timer;
if (!$timer->hasEnded(['build page'])) {
$timer->end(['build page']);
}
$timer->begin([__FUNCTION__]);
- $params = array();
+ $params = [];
$params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
$params['segments'] = _elgg_services()->request->getUrlSegments();
array_shift($params['segments']);
@@ -466,9 +466,9 @@ function elgg_view_page($title, $body, $page_shell = 'default', $vars = array())
if (isset($messages['error'])) {
// always make sure error is the first type
- $errors = array(
+ $errors = [
'error' => $messages['error']
- );
+ ];
unset($messages['error']);
$messages = array_merge($errors, $messages);
@@ -537,10 +537,10 @@ function elgg_view_resource($name, array $vars = []) {
* @access private
*/
function _elgg_views_prepare_head($title) {
- $params = array(
- 'links' => array(),
- 'metas' => array(),
- );
+ $params = [
+ 'links' => [],
+ 'metas' => [],
+ ];
if (empty($title)) {
$params['title'] = elgg_get_config('sitename');
@@ -548,44 +548,44 @@ function _elgg_views_prepare_head($title) {
$params['title'] = $title . ' : ' . elgg_get_config('sitename');
}
- $params['metas']['content-type'] = array(
+ $params['metas']['content-type'] = [
'http-equiv' => 'Content-Type',
'content' => 'text/html; charset=utf-8',
- );
+ ];
- $params['metas']['description'] = array(
+ $params['metas']['description'] = [
'name' => 'description',
'content' => elgg_get_config('sitedescription')
- );
+ ];
// https://developer.chrome.com/multidevice/android/installtohomescreen
- $params['metas']['viewport'] = array(
+ $params['metas']['viewport'] = [
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0',
- );
- $params['metas']['mobile-web-app-capable'] = array(
+ ];
+ $params['metas']['mobile-web-app-capable'] = [
'name' => 'mobile-web-app-capable',
'content' => 'yes',
- );
- $params['metas']['apple-mobile-web-app-capable'] = array(
+ ];
+ $params['metas']['apple-mobile-web-app-capable'] = [
'name' => 'apple-mobile-web-app-capable',
'content' => 'yes',
- );
+ ];
// RSS feed link
if (_elgg_has_rss_link()) {
$url = current_page_url();
- if (substr_count($url,'?')) {
+ if (substr_count($url, '?')) {
$url .= "&view=rss";
} else {
$url .= "?view=rss";
}
- $params['links']['rss'] = array(
+ $params['links']['rss'] = [
'rel' => 'alternative',
'type' => 'application/rss+xml',
'title' => 'RSS',
'href' => $url,
- );
+ ];
}
return $params;
@@ -610,46 +610,46 @@ function _elgg_views_prepare_head($title) {
*/
function _elgg_views_prepare_favicon_links($hook, $type, $head_params, $params) {
- $head_params['links']['apple-touch-icon'] = array(
+ $head_params['links']['apple-touch-icon'] = [
'rel' => 'apple-touch-icon',
'href' => elgg_get_simplecache_url('graphics/favicon-128.png'),
- );
+ ];
// favicons
- $head_params['links']['icon-ico'] = array(
+ $head_params['links']['icon-ico'] = [
'rel' => 'icon',
'href' => elgg_get_simplecache_url('graphics/favicon.ico'),
- );
- $head_params['links']['icon-vector'] = array(
+ ];
+ $head_params['links']['icon-vector'] = [
'rel' => 'icon',
'sizes' => '16x16 32x32 48x48 64x64 128x128',
'type' => 'image/svg+xml',
'href' => elgg_get_simplecache_url('graphics/favicon.svg'),
- );
- $head_params['links']['icon-16'] = array(
+ ];
+ $head_params['links']['icon-16'] = [
'rel' => 'icon',
'sizes' => '16x16',
'type' => 'image/png',
'href' => elgg_get_simplecache_url('graphics/favicon-16.png'),
- );
- $head_params['links']['icon-32'] = array(
+ ];
+ $head_params['links']['icon-32'] = [
'rel' => 'icon',
'sizes' => '32x32',
'type' => 'image/png',
'href' => elgg_get_simplecache_url('graphics/favicon-32.png'),
- );
- $head_params['links']['icon-64'] = array(
+ ];
+ $head_params['links']['icon-64'] = [
'rel' => 'icon',
'sizes' => '64x64',
'type' => 'image/png',
'href' => elgg_get_simplecache_url('graphics/favicon-64.png'),
- );
- $head_params['links']['icon-128'] = array(
+ ];
+ $head_params['links']['icon-128'] = [
'rel' => 'icon',
'sizes' => '128x128',
'type' => 'image/png',
'href' => elgg_get_simplecache_url('graphics/favicon-128.png'),
- );
+ ];
return $head_params;
}
@@ -682,7 +682,7 @@ function _elgg_views_prepare_favicon_links($hook, $type, $head_params, $params)
* based on the current route.
* @return string
*/
-function elgg_view_layout($layout_name, $vars = array()) {
+function elgg_view_layout($layout_name, $vars = []) {
$timer = _elgg_services()->timer;
if (!$timer->hasEnded(['build page'])) {
$timer->end(['build page']);
@@ -834,14 +834,13 @@ function _elgg_normalize_content_layout_vars(array $vars = []) {
* @return string
* @since 1.8.0
*/
-function elgg_view_menu($menu, array $vars = array()) {
+function elgg_view_menu($menu, array $vars = []) {
$menu_view = elgg_extract('menu_view', $vars);
unset($vars['menu_view']);
if (is_string($menu)) {
$menu = _elgg_services()->menus->getMenu($menu, $vars);
-
} elseif ($menu instanceof UnpreparedMenu) {
$menu = _elgg_services()->menus->prepareMenu($menu);
}
@@ -874,7 +873,7 @@ function elgg_view_menu($menu, array $vars = array()) {
* @return string
* @since 1.9.0
*/
-function elgg_view_menu_item(\ElggMenuItem $item, array $vars = array()) {
+function elgg_view_menu_item(\ElggMenuItem $item, array $vars = []) {
if (!isset($vars['class'])) {
$vars['class'] = 'elgg-menu-content';
}
@@ -892,7 +891,7 @@ function elgg_view_menu_item(\ElggMenuItem $item, array $vars = array()) {
if (preg_match('~<[a-z]~', $text)) {
return $text;
} else {
- return elgg_format_element('span', array('class' => 'elgg-non-link'), $text);
+ return elgg_format_element('span', ['class' => 'elgg-non-link'], $text);
}
}
@@ -932,7 +931,7 @@ function elgg_view_menu_item(\ElggMenuItem $item, array $vars = array()) {
* @return string HTML to display or false
* @todo The annotation hook might be better as a generic plugin hook to append content.
*/
-function elgg_view_entity(\ElggEntity $entity, array $vars = array(), $bypass = false, $debug = false) {
+function elgg_view_entity(\ElggEntity $entity, array $vars = [], $bypass = false, $debug = false) {
// No point continuing if entity is null
if (!$entity || !($entity instanceof \ElggEntity)) {
@@ -941,9 +940,9 @@ function elgg_view_entity(\ElggEntity $entity, array $vars = array(), $bypass =
elgg_register_rss_link();
- $defaults = array(
+ $defaults = [
'full_view' => true,
- );
+ ];
$vars = array_merge($defaults, $vars);
@@ -955,11 +954,11 @@ function elgg_view_entity(\ElggEntity $entity, array $vars = array(), $bypass =
$entity_subtype = 'default';
}
- $entity_views = array(
+ $entity_views = [
elgg_extract('item_view', $vars, ''),
"$entity_type/$entity_subtype",
"$entity_type/default",
- );
+ ];
$contents = '';
foreach ($entity_views as $view) {
@@ -995,7 +994,7 @@ function elgg_view_entity(\ElggEntity $entity, array $vars = array(), $bypass =
*
* @return string HTML to display or false
*/
-function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = array()) {
+function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = []) {
// No point continuing if entity is null
if (!$entity || !($entity instanceof \ElggEntity)) {
@@ -1046,12 +1045,12 @@ function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = ar
*
* @return string/false Rendered annotation
*/
-function elgg_view_annotation(\ElggAnnotation $annotation, array $vars = array(), $bypass = false, $debug = false) {
+function elgg_view_annotation(\ElggAnnotation $annotation, array $vars = [], $bypass = false, $debug = false) {
elgg_register_rss_link();
- $defaults = array(
+ $defaults = [
'full_view' => true,
- );
+ ];
$vars = array_merge($defaults, $vars);
$vars['annotation'] = $annotation;
@@ -1061,11 +1060,11 @@ function elgg_view_annotation(\ElggAnnotation $annotation, array $vars = array()
return false;
}
- $annotation_views = array(
+ $annotation_views = [
elgg_extract('item_view', $vars, ''),
"annotation/$name",
"annotation/default",
- );
+ ];
$contents = '';
foreach ($annotation_views as $view) {
@@ -1107,13 +1106,13 @@ function elgg_view_annotation(\ElggAnnotation $annotation, array $vars = array()
*
* @return string The rendered list of entities
*/
-function elgg_view_entity_list($entities, array $vars = array()) {
- $offset = (int)get_input('offset', 0);
+function elgg_view_entity_list($entities, array $vars = []) {
+ $offset = (int) get_input('offset', 0);
// list type can be passed as request parameter
$list_type = get_input('list_type', 'list');
- $defaults = array(
+ $defaults = [
'items' => $entities,
'list_class' => 'elgg-list-entity',
'full_view' => true,
@@ -1122,7 +1121,7 @@ function elgg_view_entity_list($entities, array $vars = array()) {
'list_type_toggle' => false,
'offset' => $offset,
'limit' => null,
- );
+ ];
$vars = array_merge($defaults, $vars);
@@ -1158,15 +1157,15 @@ function elgg_view_entity_list($entities, array $vars = array()) {
* @return string The list of annotations
* @access private
*/
-function elgg_view_annotation_list($annotations, array $vars = array()) {
- $defaults = array(
+function elgg_view_annotation_list($annotations, array $vars = []) {
+ $defaults = [
'items' => $annotations,
'offset' => null,
'limit' => null,
'list_class' => 'elgg-list-annotation elgg-annotation-list', // @todo remove elgg-annotation-list in Elgg 1.9
'full_view' => true,
'offset_key' => 'annoff',
- );
+ ];
$vars = array_merge($defaults, $vars);
@@ -1200,10 +1199,10 @@ function elgg_view_entity_annotations(\ElggEntity $entity, $full_view = true) {
$entity_type = $entity->getType();
$annotations = elgg_trigger_plugin_hook('entity:annotate', $entity_type,
- array(
+ [
'entity' => $entity,
'full_view' => $full_view,
- )
+ ]
);
return $annotations;
@@ -1219,7 +1218,7 @@ function elgg_view_entity_annotations(\ElggEntity $entity, $full_view = true) {
*
* @return string The HTML (etc)
*/
-function elgg_view_title($title, array $vars = array()) {
+function elgg_view_title($title, array $vars = []) {
$vars['title'] = $title;
return elgg_view('page/elements/title', $vars);
@@ -1256,7 +1255,7 @@ function elgg_view_friendly_time($time) {
*
* @return string|false Rendered comments or false on failure
*/
-function elgg_view_comments($entity, $add_comment = true, array $vars = array()) {
+function elgg_view_comments($entity, $add_comment = true, array $vars = []) {
if (!($entity instanceof \ElggEntity)) {
return false;
}
@@ -1288,7 +1287,7 @@ function elgg_view_comments($entity, $add_comment = true, array $vars = array())
* @return string
* @since 1.8.0
*/
-function elgg_view_image_block($image, $body, $vars = array()) {
+function elgg_view_image_block($image, $body, $vars = []) {
$vars['image'] = $image;
$vars['body'] = $body;
return elgg_view('page/components/image_block', $vars);
@@ -1309,7 +1308,7 @@ function elgg_view_image_block($image, $body, $vars = array()) {
* @return string
* @since 1.8.0
*/
-function elgg_view_module($type, $title, $body, array $vars = array()) {
+function elgg_view_module($type, $title, $body, array $vars = []) {
$vars['type'] = $type;
$vars['title'] = $title;
$vars['body'] = $body;
@@ -1324,7 +1323,7 @@ function elgg_view_module($type, $title, $body, array $vars = array()) {
* 'item_view' Alternative view to render the item
* @return string returns empty string if could not be rendered
*/
-function elgg_view_river_item($item, array $vars = array()) {
+function elgg_view_river_item($item, array $vars = []) {
if (!($item instanceof \ElggRiverItem)) {
return '';
}
@@ -1354,10 +1353,10 @@ function elgg_view_river_item($item, array $vars = array()) {
$vars['item'] = $item;
- $river_views = array(
+ $river_views = [
elgg_extract('item_view', $vars, ''),
"river/item",
- );
+ ];
$contents = '';
foreach ($river_views as $view) {
@@ -1404,7 +1403,7 @@ function elgg_view_river_item($item, array $vars = array()) {
*
* @return string The complete form
*/
-function elgg_view_form($action, $form_vars = array(), $body_vars = array()) {
+function elgg_view_form($action, $form_vars = [], $body_vars = []) {
return _elgg_services()->forms->render($action, $form_vars, $body_vars);
}
@@ -1444,7 +1443,7 @@ function elgg_get_form_footer() {
* @since 2.1
* @deprecated 2.3 Use elgg_view_field()
*/
-function elgg_view_input($input_type, array $vars = array()) {
+function elgg_view_input($input_type, array $vars = []) {
elgg_deprecated_notice(__FUNCTION__ . '() is deprecated. Use elgg_view_field()', '2.3');
@@ -1588,7 +1587,7 @@ function elgg_view_field(array $params = []) {
* @return string
* @since 1.7.1
*/
-function elgg_view_tagcloud(array $options = array()) {
+function elgg_view_tagcloud(array $options = []) {
$type = $subtype = '';
if (isset($options['type'])) {
@@ -1599,11 +1598,11 @@ function elgg_view_tagcloud(array $options = array()) {
}
$tag_data = elgg_get_tags($options);
- return elgg_view("output/tagcloud", array(
+ return elgg_view("output/tagcloud", [
'value' => $tag_data,
'type' => $type,
'subtype' => $subtype,
- ));
+ ]);
}
/**
@@ -1618,7 +1617,7 @@ function elgg_view_tagcloud(array $options = array()) {
* @since 1.8.0
* @access private
*/
-function elgg_view_list_item($item, array $vars = array()) {
+function elgg_view_list_item($item, array $vars = []) {
if ($item instanceof \ElggEntity) {
return elgg_view_entity($item, $vars);
@@ -1649,13 +1648,13 @@ function elgg_view_list_item($item, array $vars = array()) {
* @return string The html for displaying an icon
* @throws InvalidArgumentException
*/
-function elgg_view_icon($name, $vars = array()) {
+function elgg_view_icon($name, $vars = []) {
if (empty($vars)) {
- $vars = array();
+ $vars = [];
}
if (is_string($vars)) {
- $vars = array('class' => $vars);
+ $vars = ['class' => $vars];
}
if (!is_array($vars)) {
@@ -1663,11 +1662,11 @@ function elgg_view_icon($name, $vars = array()) {
}
if (!array_key_exists('class', $vars)) {
- $vars['class'] = array();
+ $vars['class'] = [];
}
if (!is_array($vars['class'])) {
- $vars['class'] = array($vars['class']);
+ $vars['class'] = [$vars['class']];
}
$vars['class'][] = "elgg-icon-$name";
@@ -1704,7 +1703,7 @@ function _elgg_has_rss_link() {
elgg_deprecated_notice('Do not set the global $autofeed. Use elgg_register_rss_link()', '2.1');
return $GLOBALS['autofeed'];
}
- return (bool)_elgg_services()->config->getVolatile('_elgg_autofeed');
+ return (bool) _elgg_services()->config->getVolatile('_elgg_autofeed');
}
/**
@@ -1922,14 +1921,14 @@ function elgg_views_boot() {
// set default icon sizes - can be overridden in settings.php or with plugin
if (!isset($CONFIG->icon_sizes)) {
- $icon_sizes = array(
- 'topbar' => array('w' => 16, 'h' => 16, 'square' => true, 'upscale' => true),
- 'tiny' => array('w' => 25, 'h' => 25, 'square' => true, 'upscale' => true),
- 'small' => array('w' => 40, 'h' => 40, 'square' => true, 'upscale' => true),
- 'medium' => array('w' => 100, 'h' => 100, 'square' => true, 'upscale' => true),
- 'large' => array('w' => 200, 'h' => 200, 'square' => false, 'upscale' => false),
- 'master' => array('w' => 550, 'h' => 550, 'square' => false, 'upscale' => false),
- );
+ $icon_sizes = [
+ 'topbar' => ['w' => 16, 'h' => 16, 'square' => true, 'upscale' => true],
+ 'tiny' => ['w' => 25, 'h' => 25, 'square' => true, 'upscale' => true],
+ 'small' => ['w' => 40, 'h' => 40, 'square' => true, 'upscale' => true],
+ 'medium' => ['w' => 100, 'h' => 100, 'square' => true, 'upscale' => true],
+ 'large' => ['w' => 200, 'h' => 200, 'square' => false, 'upscale' => false],
+ 'master' => ['w' => 550, 'h' => 550, 'square' => false, 'upscale' => false],
+ ];
elgg_set_config('icon_sizes', $icon_sizes);
}
@@ -1959,13 +1958,13 @@ function _elgg_get_js_site_data() {
}
return [
- 'elgg.data' => (object)elgg_trigger_plugin_hook('elgg.data', 'site', null, []),
+ 'elgg.data' => (object) elgg_trigger_plugin_hook('elgg.data', 'site', null, []),
'elgg.version' => elgg_get_version(),
'elgg.release' => elgg_get_version(true),
'elgg.config.wwwroot' => elgg_get_site_url(),
// refresh token 3 times during its lifetime (in microseconds 1000 * 1/3)
- 'elgg.security.interval' => (int)_elgg_services()->actions->getActionTokenTimeout() * 333,
+ 'elgg.security.interval' => (int) _elgg_services()->actions->getActionTokenTimeout() * 333,
'elgg.config.language' => $language,
];
}
@@ -1983,24 +1982,24 @@ function _elgg_get_js_page_data() {
$data = [];
}
- $elgg = array(
- 'config' => array(
+ $elgg = [
+ 'config' => [
'lastcache' => (int) elgg_get_config('lastcache'),
'viewtype' => elgg_get_viewtype(),
'simplecache_enabled' => (int) elgg_is_simplecache_enabled(),
- ),
- 'security' => array(
- 'token' => array(
+ ],
+ 'security' => [
+ 'token' => [
'__elgg_ts' => $ts = time(),
'__elgg_token' => generate_action_token($ts),
- ),
- ),
- 'session' => array(
+ ],
+ ],
+ 'session' => [
'user' => null,
'token' => _elgg_services()->session->get('__elgg_session'),
- ),
+ ],
'_data' => (object) $data,
- );
+ ];
if (elgg_get_config('elgg_load_sync_code')) {
$elgg['config']['load_sync_code'] = true;
@@ -2049,7 +2048,7 @@ function _elgg_view_under_viewtype($view, $vars, $viewtype) {
/**
* Set lightbox config
- *
+ *
* @param string $hook "elgg.data"
* @param string $type "site"
* @param array $return Data
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index 9d5df51f17f..2cc62841ee8 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -243,7 +243,7 @@ function _elgg_widgets_init() {
*/
function _elgg_default_widgets_init() {
global $CONFIG;
- $default_widgets = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, array());
+ $default_widgets = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, []);
$CONFIG->default_widget_info = $default_widgets;
@@ -254,7 +254,7 @@ function _elgg_default_widgets_init() {
elgg_register_plugin_hook_handler('container_permissions_check', 'object', '_elgg_default_widgets_permissions_override');
// only register the callback once per event
- $events = array();
+ $events = [];
foreach ($default_widgets as $info) {
if (!is_array($info)) {
continue;
@@ -300,21 +300,20 @@ function _elgg_create_default_widgets($event, $type, $entity) {
foreach ($default_widget_info as $info) {
if ($info['entity_type'] == $type) {
if ($info['entity_subtype'] == ELGG_ENTITIES_ANY_VALUE || $info['entity_subtype'] == $subtype) {
-
// need to be able to access everything
$old_ia = elgg_set_ignore_access(true);
elgg_push_context('create_default_widgets');
// pull in by widget context with widget owners as the site
// not using elgg_get_widgets() because it sorts by columns and we don't care right now.
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'widget',
'owner_guid' => elgg_get_site_entity()->guid,
'private_setting_name' => 'context',
'private_setting_value' => $info['widget_context'],
'limit' => 0
- );
+ ];
$widgets = elgg_get_entities_from_private_settings($options);
/* @var \ElggWidget[] $widgets */
diff --git a/install/cli/sample_installer.php b/install/cli/sample_installer.php
index 2e6172734cc..97a9beed873 100644
--- a/install/cli/sample_installer.php
+++ b/install/cli/sample_installer.php
@@ -8,7 +8,7 @@
$enabled = false;
// none of the following may be empty
-$params = array(
+$params = [
// database parameters
'dbuser' => '',
'dbpassword' => '',
@@ -25,7 +25,7 @@
'email' => '',
'username' => '',
'password' => '',
-);
+];
// Do not edit below this line. //////////////////////////////
@@ -47,7 +47,7 @@
$installer = new ElggInstaller();
// install and create the .htaccess file
-$installer->batchInstall($params, TRUE);
+$installer->batchInstall($params, true);
// at this point installation has completed (otherwise an exception halted execution).
// try to rewrite the script to disable it.
diff --git a/install/cli/travis_installer.php b/install/cli/travis_installer.php
index ebc817593e0..a08b39376f6 100644
--- a/install/cli/travis_installer.php
+++ b/install/cli/travis_installer.php
@@ -22,7 +22,7 @@
$installer = new ElggInstaller();
// none of the following may be empty
-$params = array(
+$params = [
// database parameters
'dbuser' => 'root',
'dbpassword' => 'password',
@@ -46,10 +46,10 @@
// timezone
'timezone' => 'UTC'
-);
+];
// install and create the .htaccess file
-$installer->batchInstall($params, TRUE);
+$installer->batchInstall($params, true);
// at this point installation has completed (otherwise an exception halted execution).
echo "Elgg CLI install successful. wwwroot: " . elgg_get_config('wwwroot') . "\n";
diff --git a/install/css/install.css b/install/css/install.css
index d561c8a12b6..d3ec41c393c 100644
--- a/install/css/install.css
+++ b/install/css/install.css
@@ -318,4 +318,4 @@ select {
width: 100%;
padding: .25em .5em;
margin: 1.5em 0 .5em 0;
-}
\ No newline at end of file
+}
diff --git a/install/js/install.js b/install/js/install.js
index 6fa1a8e5f49..6a8cf601869 100644
--- a/install/js/install.js
+++ b/install/js/install.js
@@ -40,3 +40,4 @@ elgg.installer.rewriteTest = function(url, success_msg, nextURL) {
}
});
};
+
diff --git a/install/languages/ca.php b/install/languages/ca.php
index 73c8b82eda7..d3d5cb51ede 100644
--- a/install/languages/ca.php
+++ b/install/languages/ca.php
@@ -1,5 +1,5 @@
'Elgg Install',
'install:welcome' => 'Welcome',
'install:requirements' => 'Requirements check',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => 'The rewrite rules test failed. You need to configure your web server with Elgg\'s rewrite rules and try again.',
'install:error:rewrite:unknown' => 'Oof. We couldn\'t figure out what kind of web server is running on your server and it failed the rewrite rules. We cannot offer any specific advice. Please check the troubleshooting link.',
'install:warning:rewrite:unknown' => 'Your server does not support automatic testing of the rewrite rules and your browser does not support checking via JavaScript. You can continue the installation, but you may experience problems with your site. You can manually test the rewrite rules by clicking this link: test . You will see the word success if the rules are working.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'An unrecoverable error has occurred and has been logged. If you are the site administrator check your settings file, otherwise contact the site administrator with the following information:',
'DatabaseException:WrongCredentials' => "Elgg couldn't connect to the database using the given credentials. Check the settings file.",
-);
+];
diff --git a/install/languages/cmn.php b/install/languages/cmn.php
index cf463a8f3c9..951b07b114f 100644
--- a/install/languages/cmn.php
+++ b/install/languages/cmn.php
@@ -1,5 +1,5 @@
'Elgg 安裝',
'install:welcome' => '歡迎',
'install:requirements' => '需求檢查',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => '改寫規則測試失敗。您需要組配網頁伺服器與 Elgg 的改寫規則並再次嘗試。',
'install:error:rewrite:unknown' => '哎呀,我們無法認出在主機中運行什麼樣的網頁伺服器,而它的改寫規則失敗。我們無法提供任何特定的建言。請看看疑難排解鏈結。',
'install:warning:rewrite:unknown' => '您的伺服器不支援自動的改寫規則測試,而您的瀏覽器不支援經由 JavaScript 的檢查。您可以繼續進行安裝,但是也許會遇到一些站臺問題。您可以藉由按下這個鏈結,來手動測試 改寫規則。如果規則發生作用,您將會看到成功的字樣。',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => '發生了無法回復的錯誤,並且已經記錄下來。如果您是站臺管理者,請檢查您的設定檔案;否則請聯絡站臺管理者,並附上以下資訊:',
'DatabaseException:WrongCredentials' => "Elgg 無法利用給定的憑據與資料庫連線。請檢查設定檔案。",
-);
+];
diff --git a/install/languages/de.php b/install/languages/de.php
index 4d691232458..c17a59cbb4a 100644
--- a/install/languages/de.php
+++ b/install/languages/de.php
@@ -1,5 +1,5 @@
'Elgg-Installation',
'install:welcome' => 'Wilkommen',
'install:requirements' => 'Überprüfung der Systemvoraussetzungen',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => 'Der Test der Rewrite-Regeln ist fehlgeschlagen. Du mußt die Rewrite-Regeln von Elgg selbst zur Konfiguration Deines Webservers hinzufügen und es dann wieder versuchen.',
'install:error:rewrite:unknown' => 'Uups. Es war nicht möglich festzustellen, welches Webserver-Programm auf Deinem Server verwendet wird. Darüber hinaus ist der Test der Rewrite-Regeln von Elgg fehlgeschlagen. Es ist leider nicht möglich, spezifischere Hinweise zu den Ursachen des Problems zu geben. Bitte folge dem Link zu Hinweisen bei Installationsproblemen.',
'install:warning:rewrite:unknown' => 'Dein Server unterstützt die automatische Prüfung von Rewrite-Regeln nicht und Dein Browser unterstützt es nicht, mit Hilfe von Javascript die Rewrite-Regeln auf Funktionsfähigkeit zu überprüfen. Du kannst die Installation fortsetzen, aber es kann sein, das Deine Community-Seite nicht einwandfrei funktionieren wird. Du kannst die Überprüfung der Rewrite-Regeln selbst durchführen, indem Du diesem Link folgst: Test . Du wirst die Meldung \'success\' bekommen, wenn die Rewrite-Regeln funktionieren.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'Es ist ein nicht behebbarer Fehler aufgetreten. Der Fehler wurde protokolliert. Wenn Du der Seitenadministrator bist, prüfe bitte die Konfiguration in settings.php. Andernfalls leite bitte leite folgende Informationen an den Seitenadministrator weiter:',
'DatabaseException:WrongCredentials' => "Elgg konnte mit den gegebenen Verbindungsparametern keine Verbindung zur Datenbank herstellen. Bitte prüfe die Konfiguration in settings.php.",
-);
+];
diff --git a/install/languages/en.php b/install/languages/en.php
index a072d7dcfb0..8afd48369b3 100644
--- a/install/languages/en.php
+++ b/install/languages/en.php
@@ -1,5 +1,5 @@
'Elgg Install',
'install:welcome' => 'Welcome',
'install:requirements' => 'Requirements check',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => 'The rewrite rules test failed. You need to configure your web server with Elgg\'s rewrite rules and try again.',
'install:error:rewrite:unknown' => 'Oof. We couldn\'t figure out what kind of web server is running on your server and it failed the rewrite rules. We cannot offer any specific advice. Please check the troubleshooting link.',
'install:warning:rewrite:unknown' => 'Your server does not support automatic testing of the rewrite rules and your browser does not support checking via JavaScript. You can continue the installation, but you may experience problems with your site. You can manually test the rewrite rules by clicking this link: test . You will see the word success if the rules are working.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'An unrecoverable error has occurred and has been logged. If you are the site administrator check your settings file, otherwise contact the site administrator with the following information:',
'DatabaseException:WrongCredentials' => "Elgg couldn't connect to the database using the given credentials. Check the settings file.",
-);
+];
diff --git a/install/languages/es.php b/install/languages/es.php
index f0faf07265b..237277718a3 100644
--- a/install/languages/es.php
+++ b/install/languages/es.php
@@ -1,5 +1,5 @@
'Instalación de Elgg',
'install:welcome' => 'Bienvenido!',
'install:requirements' => 'Verificación de requerimientos',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => 'La prueba de la reescritura de reglas ha fallado. Debe configurar su servidor web con reescritura de reglas e intentar nuevamente.',
'install:error:rewrite:unknown' => 'Oof. No podemos saber qué tipo de servidor web se encuentra ejecutando y falló la reescritura de reglas. No podemos ofrecer ninguna ayuda específica. Por favor verifique el enlace de solución de problemas.',
'install:warning:rewrite:unknown' => 'Su servidor no soporta la prueba automática de reescritura de reglas. Puede continuar con la instalación, pero puede experimentar problemas con el sitio. Puede probar manualmente las reescritura de reglas accediento a este enlace: pruebas . Observará la palabra success si la ejecución ha sido exitosa.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'An unrecoverable error has occurred and has been logged. If you are the site administrator check your settings file, otherwise contact the site administrator with the following information:',
'DatabaseException:WrongCredentials' => "Elgg no puede conectar con la base de datos, usando los credenciales. Consulte en el archivo 'settings'.",
-);
+];
diff --git a/install/languages/fi.php b/install/languages/fi.php
index 47ae7cb1a1a..5a9edf7f087 100644
--- a/install/languages/fi.php
+++ b/install/languages/fi.php
@@ -1,5 +1,5 @@
'Elggin asennus',
'install:welcome' => 'Tervetuloa',
'install:requirements' => 'Vaatimusten tarkistaminen',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => 'Polkujen uudelleenohjauksen testaaminen epäonnistui. Sinun pitää konfiguroida palvelimellesi Elggin vaatimat uudelleenohjaukseen liittyvät säännöt.',
'install:error:rewrite:unknown' => 'Polkujen uudelleenohjauksen testaaminen epäonnistui. Emme saaneet selvitettyä käyttämääsi web-palvelinta, joten emme pysty tarjoamaan ratkaisua ongelmaan. Voit yrittää etsiä apua sivun alalaidasta löytyvien linkkien kautta.',
'install:warning:rewrite:unknown' => 'Palvelimesi ei tue polkujen uudelleenohjaamisen automaattista testaamista, ja selaimesi ei tue sen testaamista JavaScriptin avulla. You can continue the installation, but you may experience problems with your site. Voit testata uudelleenohjausta tästä linkistä: Testaa .',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'Tapahtui virhe. Jos olet sivuston ylläpitäjä, tarkista asetustiedosto. Muussa tapauksessa ota yhteys sivuston ylläpitoon, ja toimita oheiset tiedot:',
'DatabaseException:WrongCredentials' => "Elgg ei saanut yhteyttä tietokantaan. Tarkista asetustiedosto.",
-);
+];
diff --git a/install/languages/fr.php b/install/languages/fr.php
index d4ef8fa99bc..efe57d5ce69 100644
--- a/install/languages/fr.php
+++ b/install/languages/fr.php
@@ -1,5 +1,5 @@
'Installation d\'Elgg',
'install:welcome' => 'Bienvenue',
'install:requirements' => 'Vérification des pré-requis',
@@ -154,8 +154,8 @@
'install:error:rewrite:altserver' => 'Le test des règles de réécriture a échoué. Vous devez configurer votre serveur web avec les règles de réécriture d\'Elgg et réessayer.',
'install:error:rewrite:unknown' => 'Euh... Nous ne pouvons pas comprendre quel type de serveur Web est utilisé sur votre serveur et cela a fait échouer la mise en place des règles de réécriture. Nous ne pouvons pas vous donner de conseil particulier dans ce cas. Veuillez SVP vérifier le lien de dépannage.',
'install:warning:rewrite:unknown' => 'Votre serveur ne supporte pas le test automatique des règles de réécriture. Vous pouvez continuer l\'installation, mais il est possible que vous rencontriez des problèmes avec votre site. Vous pouvez tester manuellement les règles de réécriture en cliquant sur ce lien : test . Vous verrez le mot "succès" si les redirections fonctionnent.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'Une erreur irrécupérable s\'est produite et a été enregistrée. Si vous êtes l\'administrateur du site, vérifiez le fichier de configuration, sinon, veuillez SVP contacter l\'administrateur du site en fournissant les informations suivantes : ',
'DatabaseException:WrongCredentials' => "Elgg n'a pas pu se connecter à la base de données en utilisant les données fournies. Vérifiez le fichier de configuration. ",
-);
+];
diff --git a/install/languages/gl.php b/install/languages/gl.php
index 41ba2760826..d1f4b9979db 100644
--- a/install/languages/gl.php
+++ b/install/languages/gl.php
@@ -1,5 +1,5 @@
'Instalación de Elgg',
'install:welcome' => 'Benvida',
'install:requirements' => 'Comprobación de requisitos',
@@ -155,8 +155,8 @@
'install:error:rewrite:altserver' => 'Non se pasou a proba das regras de reescritura. Ten que configurar o servidor web coas regras de reescritura de Elgg e intentalo de novo',
'install:error:rewrite:unknown' => 'Uf. Non foi posíbel determinar o tipo de servidor web que está a usar, e non pasou a proba das regras de reescritura. Non podemos aconsellalo sobre como solucionar o seu problema específico. Bótelle unha ollada á ligazón sobre solución de problemas.',
'install:warning:rewrite:unknown' => 'O servidor non permite probar automaticamente as regras de reescritura, e o navegador non permite probalas mediante JavaScript. Pode continuar a instalación, pero pode que ao rematar o sitio lle dea problemas. Para probar manualmente as regras de reescritura, siga esta ligazón: probar . Se as regras funcionan, aparecerá a palabra «success».',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'Produciuse un erro do que non é posíbel recuperarse, e quedou rexistrado. Se vostede é o administrador do sistema, comprobe que a información do ficheiro de configuración é correcta. En caso contrario, póñase en contacto co administrador e facilítelle a seguinte información:',
'DatabaseException:WrongCredentials' => "Elgg non puido conectar coa base de datos mediante o nome de usuario e contrasinal facilitados. Revise o ficheiro de configuración.",
-);
+];
diff --git a/install/languages/ja.php b/install/languages/ja.php
index beb54dacdcc..f8e81a6ffe4 100644
--- a/install/languages/ja.php
+++ b/install/languages/ja.php
@@ -1,5 +1,5 @@
'Elgg インストール',
'install:welcome' => 'こんにちは、ようこそ',
'install:requirements' => '必要条件の確認',
@@ -152,8 +152,8 @@
'install:error:rewrite:altserver' => 'リライトルールがのテストに失敗しました。Elggリライトルールでwebサーバを設定してもう一度テストをこころみてください。',
'install:error:rewrite:unknown' => 'あなたのサーバで起動されているwebサーバを特定することができませんでした。リライトルールにも失敗したようです。残念ですがアドバイスも出来そうにありません。問題解決リンクをチェックしてみてください。',
'install:warning:rewrite:unknown' => 'あなたのサーバはリライトルールの自動テストをサポートしていないようです。その上、あなたのご使用のブラウザはJavaScriptでのチェッキングをサポートしていません。インストールを続行できますが、問題が発生することがあるかもしれません。次のリンクをクリックすれば、リライトルールを手動でテストすることができます:テスト 。テストがうまく行けば success(成功)の文字が表示されるはずです。',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => '対応できないエラーが発生しそれをログに記録しました。あなたがサイトの管理者の方でしたら、ファイルをチェックしてみてください。そうでないならサイトの管理者に次の情報をお知らせください。:',
'DatabaseException:WrongCredentials' => "Elgg は与えられた証明では接続出来ませんでした。設定ファイルをチェックしてみてください。",
-);
+];
diff --git a/install/languages/nl.php b/install/languages/nl.php
index aa06fd4c9c5..bbffc01d57a 100644
--- a/install/languages/nl.php
+++ b/install/languages/nl.php
@@ -1,5 +1,5 @@
'Elgg installatie',
'install:welcome' => 'Welkom',
'install:requirements' => 'Nakijken van de vereisten',
@@ -152,8 +152,8 @@
'install:error:rewrite:altserver' => 'De rewrite rules test is mislukt. Je moet de webserver configureren met de juiste rewrite rules en het opnieuw proberen.',
'install:error:rewrite:unknown' => 'Oef. We kunnen niet bepalen welke webserver op je site draait en de rewrite rules test is gefaald. We kunnen je geen specifiek advies geven om het op te lossen. Check de troubleshooting link voor meer informatie.',
'install:warning:rewrite:unknown' => 'Je server ondersteunt niet het automatisch testen van de rewrite rules en je browser ondersteunt niet de controle via JavaScript. Je kunt de installatie vervolgen, maar je kunt problemen met je site ervaren. Je kunt de rewrite rules handmatig testen via deze link: test . Je zult het woord success zien als het werkt.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'Er is een onherstelbare fout opgetreden en gelogd. Indien je de beheerder bent, controleer je settings bestand. Ben je geen beheerder, neem dan contact op met een sitebeheerder met de volgende informatie:',
'DatabaseException:WrongCredentials' => "Elgg kan met deze instellingen niet met de database verbinden. Controleer het settings bestand.",
-);
+];
diff --git a/install/languages/pt_BR.php b/install/languages/pt_BR.php
index 840bde8829b..95370832ca3 100644
--- a/install/languages/pt_BR.php
+++ b/install/languages/pt_BR.php
@@ -1,5 +1,5 @@
'Instalação do Elgg',
'install:welcome' => 'Bem-vindo',
'install:requirements' => 'Verificando requisitos',
@@ -11,10 +11,10 @@
'install:next' => 'Proximo',
'install:refresh' => 'Atualiza',
- 'install:welcome:instructions' => "A instalacao do Elgg possui 6 fases simples e ler esta mensagem de boas vindas e o primeiro passo!
-
-Se você ainda não fez, leia através da instalação as instrucoes incluidas com Elgg (ou clique no link de instrucoes no final da pagina).
-
+ 'install:welcome:instructions' => "A instalacao do Elgg possui 6 fases simples e ler esta mensagem de boas vindas e o primeiro passo!
+
+Se você ainda não fez, leia através da instalação as instrucoes incluidas com Elgg (ou clique no link de instrucoes no final da pagina).
+
Se você está pronto para prosseguir, clique no botão PROXIMO.",
'install:requirements:instructions:success' => "Seu servidor passou na verificacao de requisitos.",
'install:requirements:instructions:failure' => "Seu servidor falhou na verificacao de requisitos. Depois que voce corrigir as situacoes apontadas abaixo, atualize a pagina. Verifique os links de solucao de problemas (troubleshooting links) no final da pagina se voce necessitar de ajuda adicional.",
@@ -25,10 +25,10 @@
'install:require:settings' => 'Arquivos de configuração',
'install:require:database' => 'Banco de dados',
- 'install:check:root' => 'Seu servidor web nao possui permissao para criar o arquivo .htaccess no diretorio raiz do Elgg. Voce tem duas opcoes:
-
- 1. Altere as permissoes do diretorio raiz
-
+ 'install:check:root' => 'Seu servidor web nao possui permissao para criar o arquivo .htaccess no diretorio raiz do Elgg. Voce tem duas opcoes:
+
+ 1. Altere as permissoes do diretorio raiz
+
2. Copie o arquivo htaccess_dist para \'.htaccess',
'install:check:php:version' => 'O Elgg necessita que esteja instalado o PHP %s ou superior. Este servidor esta usando a versao %s.',
@@ -143,7 +143,7 @@
'install:error:rewrite:nginx' => 'Nos achamos que seu servidor está funcionando em um servidor Nginx (Nginx web server) .',
'install:error:rewrite:lighttpd' => 'Nos achamos que seu servidor está funcionando em um servidor Lighttpd (Lighttpd web server) .',
'install:error:rewrite:iis' => 'Nos achamos que seu servidor está funcionando em um servidor IIS (IIS web server) .',
- 'install:error:rewrite:allowoverride' => "O teste de escrita falhou e a causa mais provavel foi que AllowOverride nao esta definida para todos diretorios do Elgg. Isto previne o Apache de processar o arquivo .htaccess que contem as regras de redirecionamento (rewrite rules).
+ 'install:error:rewrite:allowoverride' => "O teste de escrita falhou e a causa mais provavel foi que AllowOverride nao esta definida para todos diretorios do Elgg. Isto previne o Apache de processar o arquivo .htaccess que contem as regras de redirecionamento (rewrite rules).
\n\nUm causa menos provavel seria se o Apache foi configurado com um alias para seu diretorio Elgg e voce precisa definir o RewriteBase no seu .htaccess . Existem instrucoes complementares no arquivo .htaccess no seu diretorio do Elgg.",
'install:error:rewrite:htaccess:write_permission' => 'Seu servidor web nao possui permissao para criar o arquivo .htaccess no diretorio do Elgg. Voce precisa copiar manualmente o arquivo htaccess_dist para .htaccess ou alterar as permissoes no diretorio.',
'install:error:rewrite:htaccess:read_permission' => 'Existe um arquivo .htaccess no diretorio do Elgg, mas seu servidor web nao possui permissao para ler este arquivo.',
@@ -153,8 +153,8 @@
'install:error:rewrite:altserver' => 'O teste com as regras de redirecionamento (rewrite rules) falhou. Voce precisa configurar seu servidor web com as regras de escrita do Elgg e tentar novamente.',
'install:error:rewrite:unknown' => 'Não foi possivel identificar qual o tipo de servidor web esta funcionando no seu servidor e ocorreu uma falha com as regras de redirecionamento (rewrite rules). Não nos é possivel fornecer qualquer tipo de conselho. Por favor verifique o link de solução de problemas (troubleshooting link) .',
'install:warning:rewrite:unknown' => 'Seu servidor nao suporta testes automaticos das regras de redirecionamento (rewrite rules). Você pode continuar a instalação. Contudo voce pode ter problemas com seu site. Voce pode realizar os testes manualmente com as regras de escrita clicando neste link: teste . Voce visualizará a palavra SUCESSO se as regras estiverem funcionando.',
-
+
// Bring over some error messages you might see in setup
'exception:contact_admin' => 'Um erro irrecuperavel ocorreu e foi registrado. se voce for o administrador do site verifique seus arquivos de configuracoes, ou entre em contato com o administrador do site com as seguintes informacoes:',
'DatabaseException:WrongCredentials' => "Elgg nao pode se conectar ao banco de dados usando as credenciais informadas. Verifique seu arquivo de configuracoes.",
-);
+];
diff --git a/mod/activity/views/default/resources/river.php b/mod/activity/views/default/resources/river.php
index 92b5b0e3bcc..cfa0716a1ab 100644
--- a/mod/activity/views/default/resources/river.php
+++ b/mod/activity/views/default/resources/river.php
@@ -3,10 +3,10 @@
* Main activity stream list page
*/
-$options = array(
+$options = [
'distinct' => false,
'no_results' => elgg_echo('river:none'),
-);
+];
$page_type = preg_replace('[\W]', '', elgg_extract('page_type', $vars, 'all'));
$type = preg_replace('[\W]', '', get_input('type', 'all'));
@@ -38,7 +38,7 @@
forward('');
}
elgg_set_page_owner_guid($subject->guid);
- $title = elgg_echo('river:owner', array(htmlspecialchars($subject->name, ENT_QUOTES, 'UTF-8', false)));
+ $title = elgg_echo('river:owner', [htmlspecialchars($subject->name, ENT_QUOTES, 'UTF-8', false)]);
$page_filter = 'subject';
$options['subject_guid'] = $subject->guid;
break;
@@ -58,7 +58,7 @@
$activity = elgg_list_river($options);
-$content = elgg_view('core/river/filter', array('selector' => $selector));
+$content = elgg_view('core/river/filter', ['selector' => $selector]);
$sidebar = elgg_view('core/river/sidebar');
diff --git a/mod/blog/actions/blog/auto_save_revision.php b/mod/blog/actions/blog/auto_save_revision.php
index 240aaf24b84..d157afdb426 100644
--- a/mod/blog/actions/blog/auto_save_revision.php
+++ b/mod/blog/actions/blog/auto_save_revision.php
@@ -17,10 +17,9 @@
}
// store errors to pass along
-$error = FALSE;
+$error = false;
if ($title && $description) {
-
if ($guid) {
$entity = get_entity($guid);
if (elgg_instanceof($entity, 'object', 'blog') && $entity->canEdit()) {
@@ -41,7 +40,7 @@
// mark this as a brand new post so we can work out the
// river / revision logic in the real save action.
- $blog->new_post = TRUE;
+ $blog->new_post = true;
if (!$blog->save()) {
$error = elgg_echo('blog:error:cannot_save');
@@ -54,14 +53,14 @@
// we have to delete everything or the times are wrong.
// don't save if nothing changed
- $auto_save_annotations = $blog->getAnnotations(array(
+ $auto_save_annotations = $blog->getAnnotations([
'annotation_name' => 'blog_auto_save',
'limit' => 1,
- ));
+ ]);
if ($auto_save_annotations) {
$auto_save = $auto_save_annotations[0];
} else {
- $auto_save = FALSE;
+ $auto_save = false;
}
if (!$auto_save) {
@@ -83,11 +82,11 @@
}
if ($error) {
- $json = array('success' => FALSE, 'message' => $error);
+ $json = ['success' => false, 'message' => $error];
echo json_encode($json);
} else {
$msg = elgg_echo('blog:message:saved');
- $json = array('success' => TRUE, 'message' => $msg, 'guid' => $blog->getGUID());
+ $json = ['success' => true, 'message' => $msg, 'guid' => $blog->getGUID()];
echo json_encode($json);
}
exit;
diff --git a/mod/blog/actions/blog/delete.php b/mod/blog/actions/blog/delete.php
index ca4eb8a7fbf..017144eb65b 100644
--- a/mod/blog/actions/blog/delete.php
+++ b/mod/blog/actions/blog/delete.php
@@ -24,4 +24,4 @@
register_error(elgg_echo('blog:error:post_not_found'));
}
-forward(REFERER);
\ No newline at end of file
+forward(REFERER);
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index 11141ff43f3..2ad80ad1a23 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -15,10 +15,10 @@
elgg_make_sticky_form('blog');
// save or preview
-$save = (bool)get_input('save');
+$save = (bool) get_input('save');
// store errors to pass along
-$error = FALSE;
+$error = false;
$error_forward_url = REFERER;
$user = elgg_get_logged_in_user_entity();
@@ -40,14 +40,14 @@
} else {
$blog = new ElggBlog();
$blog->subtype = 'blog';
- $new_post = TRUE;
+ $new_post = true;
}
// set the previous status for the hooks to update the time_created and river entries
$old_status = $blog->status;
// set defaults and required values.
-$values = array(
+$values = [
'title' => '',
'description' => '',
'status' => 'draft',
@@ -55,11 +55,11 @@
'comments_on' => 'On',
'excerpt' => '',
'tags' => '',
- 'container_guid' => (int)get_input('container_guid'),
-);
+ 'container_guid' => (int) get_input('container_guid'),
+];
// fail if a required entity isn't set
-$required = array('title', 'description');
+$required = ['title', 'description'];
// load from POST and do sanity and access checking
foreach ($values as $name => $default) {
@@ -150,12 +150,12 @@
// add to river if changing status or published, regardless of new post
// because we remove it for drafts.
if (($new_post || $old_status == 'draft') && $status == 'published') {
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/blog/create',
'action_type' => 'create',
'subject_guid' => $blog->owner_guid,
'object_guid' => $blog->getGUID(),
- ));
+ ]);
elgg_trigger_event('publish', 'object', $blog);
@@ -165,10 +165,10 @@
$blog->save();
}
} elseif ($old_status == 'published' && $status == 'draft') {
- _elgg_delete_river(array(
+ _elgg_delete_river([
'object_guid' => $blog->guid,
'action_type' => 'create',
- ));
+ ]);
}
if ($blog->status == 'published' || $save == false) {
diff --git a/mod/blog/classes/ElggBlog.php b/mod/blog/classes/ElggBlog.php
index 17e37cacaba..884a0cda313 100644
--- a/mod/blog/classes/ElggBlog.php
+++ b/mod/blog/classes/ElggBlog.php
@@ -57,4 +57,4 @@ public function getExcerpt($length = 250) {
}
}
-}
\ No newline at end of file
+}
diff --git a/mod/blog/languages/ca.php b/mod/blog/languages/ca.php
index fde088568dc..f5232ae683d 100644
--- a/mod/blog/languages/ca.php
+++ b/mod/blog/languages/ca.php
@@ -1,5 +1,5 @@
'Blocs',
'blog:blogs' => 'Blocs',
'blog:revisions' => 'Revisions',
@@ -64,4 +64,4 @@
'blog:moreblogs' => 'Més entrades',
'blog:numbertodisplay' => 'Nombre d\'entrades del bloc a mostrar',
'blog:noblogs' => 'No hi ha entrades del bloc'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/da.php b/mod/blog/languages/da.php
index 27b89c57c9e..bebd25f3e7e 100644
--- a/mod/blog/languages/da.php
+++ b/mod/blog/languages/da.php
@@ -1,5 +1,5 @@
'Blogs',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Revision',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Flere blogindlæg',
'blog:numbertodisplay' => 'Antal af blogindlæg, der skal vises',
'blog:noblogs' => 'Ingen blogindlæg'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/de.php b/mod/blog/languages/de.php
index a73fe7b35fa..4631893d8f4 100644
--- a/mod/blog/languages/de.php
+++ b/mod/blog/languages/de.php
@@ -1,5 +1,5 @@
'Blogs',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Revisionen',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Weitere Blog-Einträge',
'blog:numbertodisplay' => 'Anzahl der anzuzeigenden Blog-Einträge',
'blog:noblogs' => 'Keine Blog-Einträge vorhanden.'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/el.php b/mod/blog/languages/el.php
index fff184dc6c6..810e743c35b 100644
--- a/mod/blog/languages/el.php
+++ b/mod/blog/languages/el.php
@@ -1,5 +1,5 @@
'Ιστολόγια',
'blog:blogs' => 'Ιστολόγια',
'blog:revisions' => 'Αναθεωρήσεις',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Περισσότερες αναρτήσεις',
'blog:numbertodisplay' => 'Αριθμός αναρτήσεων για εμφάνιση',
'blog:noblogs' => 'Δεν υπάρχουν αναρτήσεις'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php
index ca57ad91468..97ccd28c030 100644
--- a/mod/blog/languages/en.php
+++ b/mod/blog/languages/en.php
@@ -1,5 +1,5 @@
'Blogs',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Revisions',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'More blog posts',
'blog:numbertodisplay' => 'Number of blog posts to display',
'blog:noblogs' => 'No blog posts',
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/es.php b/mod/blog/languages/es.php
index 64f7efe9b62..bfbe57241a2 100644
--- a/mod/blog/languages/es.php
+++ b/mod/blog/languages/es.php
@@ -1,5 +1,5 @@
'Blogs',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Revisiones',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Más entradas',
'blog:numbertodisplay' => 'Número de entradas a mostrar',
'blog:noblogs' => 'No hay entradas'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/eu_es.php b/mod/blog/languages/eu_es.php
index a23757e6c1b..7d89c01dd3b 100644
--- a/mod/blog/languages/eu_es.php
+++ b/mod/blog/languages/eu_es.php
@@ -1,5 +1,5 @@
'Blogak',
'blog:blogs' => 'Blogak',
'blog:revisions' => 'Berrikuspenak',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Blog bidalketa gehiago',
'blog:numbertodisplay' => 'Erakusteko blog bidalketa kopurua',
'blog:noblogs' => 'Ez dago blog bidalketarik'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/fi.php b/mod/blog/languages/fi.php
index d09b8090488..32d555a4c1b 100644
--- a/mod/blog/languages/fi.php
+++ b/mod/blog/languages/fi.php
@@ -1,5 +1,5 @@
'Blogit',
'blog:blogs' => 'Blogit',
'blog:revisions' => 'Versiot',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Lisää blogiviestejä',
'blog:numbertodisplay' => 'Näytettävien kohteiden määrä',
'blog:noblogs' => 'Ei blogiviestejä'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/fr.php b/mod/blog/languages/fr.php
index 89b4ed0af55..011fa61a93b 100644
--- a/mod/blog/languages/fr.php
+++ b/mod/blog/languages/fr.php
@@ -1,5 +1,5 @@
'Blogs',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Révisions',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Plus d\'articles de blog',
'blog:numbertodisplay' => 'Nombre d\'articles de blog à afficher',
'blog:noblogs' => 'Aucun article de blog'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/gl.php b/mod/blog/languages/gl.php
index 11a511f82f4..d917334d449 100644
--- a/mod/blog/languages/gl.php
+++ b/mod/blog/languages/gl.php
@@ -1,5 +1,5 @@
'Bitácoras',
'blog:blogs' => 'Bitácoras',
'blog:revisions' => 'Revisións',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Máis artigos',
'blog:numbertodisplay' => 'Número de artigos para mostrar.',
'blog:noblogs' => 'Non hai artigos.'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/it.php b/mod/blog/languages/it.php
index bb868d3a782..e2b128438d0 100644
--- a/mod/blog/languages/it.php
+++ b/mod/blog/languages/it.php
@@ -1,5 +1,5 @@
'Blog',
'blog:blogs' => 'Blog',
'blog:revisions' => 'Revisioni',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Altri articoli',
'blog:numbertodisplay' => 'Numero di articoli da visualizzare',
'blog:noblogs' => 'Nessun articolo'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/ja.php b/mod/blog/languages/ja.php
index f78c6a7f2dc..9ca3f617e4d 100644
--- a/mod/blog/languages/ja.php
+++ b/mod/blog/languages/ja.php
@@ -1,5 +1,5 @@
'ブログ',
'blog:blogs' => 'ブログ',
'blog:revisions' => '変更履歴',
@@ -63,4 +63,4 @@
'blog:moreblogs' => '別のブログ記事',
'blog:numbertodisplay' => 'ブログ記事の表示件数',
'blog:noblogs' => 'ブログ記事は一つもありません'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/ko.php b/mod/blog/languages/ko.php
index 2221c7bea13..ba2edc28b55 100644
--- a/mod/blog/languages/ko.php
+++ b/mod/blog/languages/ko.php
@@ -1,5 +1,5 @@
'블로그',
'blog:blogs' => '블로그',
'blog:revisions' => '개정',
@@ -64,4 +64,4 @@
'blog:moreblogs' => '블로그글 더보기',
'blog:numbertodisplay' => '출력할 블로그글의 수',
'blog:noblogs' => '블로그글이 없습니다.'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/nl.php b/mod/blog/languages/nl.php
index 2fe7a724128..08782df074b 100644
--- a/mod/blog/languages/nl.php
+++ b/mod/blog/languages/nl.php
@@ -1,5 +1,5 @@
'Blog',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Revisies',
@@ -70,4 +70,4 @@
'blog:moreblogs' => 'Meer blogberichten',
'blog:numbertodisplay' => 'Aantal blogberichten om te tonen:',
'blog:noblogs' => 'Geen blogs'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/pl.php b/mod/blog/languages/pl.php
index 6f32c577f23..50ddd1ba632 100644
--- a/mod/blog/languages/pl.php
+++ b/mod/blog/languages/pl.php
@@ -1,5 +1,5 @@
'Blogi',
'blog:blogs' => 'Blogi',
'blog:revisions' => 'Wersje',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Więcej wpisów na blogu',
'blog:numbertodisplay' => 'Ilość wyświetlanych wpisów',
'blog:noblogs' => 'Brak wpisów na blogu'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/pt_br.php b/mod/blog/languages/pt_br.php
index 6b2a733efba..3b28c14320c 100644
--- a/mod/blog/languages/pt_br.php
+++ b/mod/blog/languages/pt_br.php
@@ -1,5 +1,5 @@
'Blogs',
'blog:blogs' => 'Blogs',
'blog:revisions' => 'Revisões',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Mais postagens do blog',
'blog:numbertodisplay' => 'Número de postagens para exibir',
'blog:noblogs' => 'Não existem postagens do blog'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/ro_ro.php b/mod/blog/languages/ro_ro.php
index 2372cec9128..2ed1f885592 100644
--- a/mod/blog/languages/ro_ro.php
+++ b/mod/blog/languages/ro_ro.php
@@ -1,5 +1,5 @@
'Bloguri',
'blog:blogs' => 'Bloguri',
'blog:revisions' => 'Revizii',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Mai multe postări de blog',
'blog:numbertodisplay' => 'Numărul de postări de blog pentru afișare',
'blog:noblogs' => 'Nu există postări de blog'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/ru.php b/mod/blog/languages/ru.php
index 39af8dfd385..2a2fe9f140e 100644
--- a/mod/blog/languages/ru.php
+++ b/mod/blog/languages/ru.php
@@ -1,5 +1,5 @@
'Блог',
'blog:blogs' => 'Блоги',
'blog:revisions' => 'Редакции',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Показать больше постов',
'blog:numbertodisplay' => 'Число отображаемых постов',
'blog:noblogs' => 'Нет постов'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/sr.php b/mod/blog/languages/sr.php
index 91d366219d3..8c093a221dc 100644
--- a/mod/blog/languages/sr.php
+++ b/mod/blog/languages/sr.php
@@ -1,5 +1,5 @@
'Блогови',
'blog:blogs' => 'Блогови',
'blog:revisions' => 'Ревизије',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Више блог чланака',
'blog:numbertodisplay' => 'Број блог чланака за приказ',
'blog:noblogs' => 'Нема блог чланака.'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/sr_latin.php b/mod/blog/languages/sr_latin.php
index c6c76d9f0c4..10142e6af44 100644
--- a/mod/blog/languages/sr_latin.php
+++ b/mod/blog/languages/sr_latin.php
@@ -1,5 +1,5 @@
'Blogovi',
'blog:blogs' => 'Blogovi',
'blog:revisions' => 'Revizije',
@@ -61,4 +61,4 @@
'blog:moreblogs' => 'Još blog postova',
'blog:numbertodisplay' => 'Broj članaka za prikaz',
'blog:noblogs' => 'Nema blog postova'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/tr.php b/mod/blog/languages/tr.php
index 8d70b52e6a8..e6214fb47e7 100644
--- a/mod/blog/languages/tr.php
+++ b/mod/blog/languages/tr.php
@@ -1,5 +1,5 @@
'Bloglar',
'blog:blogs' => 'Bloglar',
'blog:revisions' => 'Düzeltmeler',
@@ -63,4 +63,4 @@
'blog:moreblogs' => 'Daha fazla blog gönderisi',
'blog:numbertodisplay' => 'Gösterilecek blog gönderisi sayısı',
'blog:noblogs' => 'Blog gönderisi yok'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/languages/zh_hans.php b/mod/blog/languages/zh_hans.php
index ead49ae4dbf..8c5e65bb763 100644
--- a/mod/blog/languages/zh_hans.php
+++ b/mod/blog/languages/zh_hans.php
@@ -1,5 +1,5 @@
'博客',
'blog:blogs' => '博客',
'blog:revisions' => '修订',
@@ -63,4 +63,4 @@
'blog:moreblogs' => '更多博文',
'blog:numbertodisplay' => '要显示的博文数',
'blog:noblogs' => '没有博文'
-);
\ No newline at end of file
+];
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 63226384b51..02916fafdfb 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -11,20 +11,20 @@
* @param int $container_guid The GUID of the page owner or NULL for all blogs
* @return array
*/
-function blog_get_page_content_list($container_guid = NULL) {
+function blog_get_page_content_list($container_guid = null) {
- $return = array();
+ $return = [];
$return['filter_context'] = $container_guid ? 'mine' : 'all';
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'blog',
'full_view' => false,
'no_results' => elgg_echo('blog:none'),
'preload_owners' => true,
'distinct' => false,
- );
+ ];
$current_user = elgg_get_logged_in_user_entity();
@@ -34,11 +34,11 @@ function blog_get_page_content_list($container_guid = NULL) {
$container = get_entity($container_guid);
if ($container instanceof ElggGroup) {
- $options['container_guid'] = $container_guid;
+ $options['container_guid'] = $container_guid;
} else {
$options['owner_guid'] = $container_guid;
}
- $return['title'] = elgg_echo('blog:title:user_blogs', array($container->name));
+ $return['title'] = elgg_echo('blog:title:user_blogs', [$container->name]);
$crumbs_title = $container->name;
elgg_push_breadcrumb($crumbs_title);
@@ -89,21 +89,21 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
elgg_push_breadcrumb(elgg_echo('blog:archives'));
if ($lower) {
- $lower = (int)$lower;
+ $lower = (int) $lower;
}
if ($upper) {
- $upper = (int)$upper;
+ $upper = (int) $upper;
}
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'blog',
'full_view' => false,
'no_results' => elgg_echo('blog:none'),
'preload_owners' => true,
'distinct' => false,
- );
+ ];
if ($owner instanceof ElggGroup) {
$options['container_guid'] = $owner_guid;
@@ -121,38 +121,38 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
$content = elgg_list_entities($options);
- $title = elgg_echo('date:month:' . date('m', $lower), array(date('Y', $lower)));
+ $title = elgg_echo('date:month:' . date('m', $lower), [date('Y', $lower)]);
- return array(
+ return [
'content' => $content,
'title' => $title,
'filter' => '',
- );
+ ];
}
/**
* Get page components to edit/create a blog post.
*
- * @param string $page 'edit' or 'new'
- * @param int $guid GUID of blog post or container
- * @param int $revision Annotation id for revision to edit (optional)
+ * @param string $page 'edit' or 'new'
+ * @param int $guid GUID of blog post or container
+ * @param int $revision Annotation id for revision to edit (optional)
* @return array
*/
-function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) {
+function blog_get_page_content_edit($page, $guid = 0, $revision = null) {
elgg_require_js('elgg/blog/save_draft');
- $return = array(
+ $return = [
'filter' => '',
- );
+ ];
- $vars = array();
+ $vars = [];
$vars['id'] = 'blog-post-edit';
$vars['class'] = 'elgg-form-alt';
$sidebar = '';
if ($page == 'edit') {
- $blog = get_entity((int)$guid);
+ $blog = get_entity((int) $guid);
$title = elgg_echo('blog:edit');
@@ -162,7 +162,7 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) {
$title .= ": \"$blog->title\"";
if ($revision) {
- $revision = elgg_get_annotation_from_id((int)$revision);
+ $revision = elgg_get_annotation_from_id((int) $revision);
$vars['revision'] = $revision;
$title .= ' ' . elgg_echo('blog:edit_revision_notice');
@@ -207,21 +207,21 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) {
* @param ElggAnnotation $revision
* @return array
*/
-function blog_prepare_form_vars($post = NULL, $revision = NULL) {
+function blog_prepare_form_vars($post = null, $revision = null) {
// input names => defaults
- $values = array(
- 'title' => NULL,
- 'description' => NULL,
+ $values = [
+ 'title' => null,
+ 'description' => null,
'status' => 'published',
'access_id' => ACCESS_DEFAULT,
'comments_on' => 'On',
- 'excerpt' => NULL,
- 'tags' => NULL,
- 'container_guid' => NULL,
- 'guid' => NULL,
+ 'excerpt' => null,
+ 'tags' => null,
+ 'container_guid' => null,
+ 'guid' => null,
'draft_warning' => '',
- );
+ ];
if ($post) {
foreach (array_keys($values) as $field) {
@@ -256,10 +256,10 @@ function blog_prepare_form_vars($post = NULL, $revision = NULL) {
// display a notice if there's an autosaved annotation
// and we're not editing it.
- $auto_save_annotations = $post->getAnnotations(array(
+ $auto_save_annotations = $post->getAnnotations([
'annotation_name' => 'blog_auto_save',
'limit' => 1,
- ));
+ ]);
if ($auto_save_annotations) {
$auto_save = $auto_save_annotations[0];
} else {
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 1ed958a57b8..c9dce691879 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -38,7 +38,7 @@ function blog_init() {
elgg_register_plugin_hook_handler('entity:url', 'object', 'blog_set_url');
// notifications
- elgg_register_notification_event('object', 'blog', array('publish'));
+ elgg_register_notification_event('object', 'blog', ['publish']);
elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:blog', 'blog_prepare_notification');
// add blog link to owner block
@@ -175,7 +175,6 @@ function blog_owner_block_menu($hook, $type, $return, $params) {
'text' => elgg_echo('blog'),
'href' => "blog/owner/{$entity->username}",
]);
-
} elseif ($entity instanceof ElggGroup) {
if ($entity->blog_enable != 'no') {
$return[] = ElggMenuItem::factory([
@@ -242,7 +241,7 @@ function blog_archive_menu_setup($hook, $type, $return, $params) {
$years = [];
foreach ($dates as $date) {
- $timestamplow = mktime(0, 0, 0, substr($date,4,2) , 1, substr($date, 0, 4));
+ $timestamplow = mktime(0, 0, 0, substr($date, 4, 2), 1, substr($date, 0, 4));
$timestamphigh = mktime(0, 0, 0, ((int) substr($date, 4, 2)) + 1, 1, substr($date, 0, 4));
$year = substr($date, 0, 4);
@@ -287,14 +286,14 @@ function blog_prepare_notification($hook, $type, $notification, $params) {
$language = $params['language'];
$method = $params['method'];
- $notification->subject = elgg_echo('blog:notify:subject', array($entity->title), $language);
- $notification->body = elgg_echo('blog:notify:body', array(
+ $notification->subject = elgg_echo('blog:notify:subject', [$entity->title], $language);
+ $notification->body = elgg_echo('blog:notify:body', [
$owner->name,
$entity->title,
$entity->getExcerpt(),
$entity->getURL()
- ), $language);
- $notification->summary = elgg_echo('blog:notify:summary', array($entity->title), $language);
+ ], $language);
+ $notification->summary = elgg_echo('blog:notify:summary', [$entity->title], $language);
$notification->url = $entity->getURL();
return $notification;
diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php
index bd73002b469..7cad01ec485 100644
--- a/mod/blog/views/default/blog/group_module.php
+++ b/mod/blog/views/default/blog/group_module.php
@@ -9,14 +9,14 @@
return true;
}
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => "blog/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
-));
+]);
elgg_push_context('widgets');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'blog',
'container_guid' => elgg_get_page_owner_guid(),
@@ -25,19 +25,19 @@
'pagination' => false,
'no_results' => elgg_echo('blog:none'),
'distinct' => false,
-);
+];
$content = elgg_list_entities($options);
elgg_pop_context();
-$new_link = elgg_view('output/url', array(
+$new_link = elgg_view('output/url', [
'href' => "blog/add/$group->guid",
'text' => elgg_echo('blog:write'),
'is_trusted' => true,
-));
+]);
-echo elgg_view('groups/profile/module', array(
+echo elgg_view('groups/profile/module', [
'title' => elgg_echo('blog:group'),
'content' => $content,
'all_link' => $all_link,
'add_link' => $new_link,
-));
+]);
diff --git a/mod/blog/views/default/blog/sidebar.php b/mod/blog/views/default/blog/sidebar.php
index 124934f61d9..27b7fd717c2 100644
--- a/mod/blog/views/default/blog/sidebar.php
+++ b/mod/blog/views/default/blog/sidebar.php
@@ -9,10 +9,10 @@
// fetch & display latest comments
if ($page != 'friends') {
- echo elgg_view('page/elements/comments_block', array(
+ echo elgg_view('page/elements/comments_block', [
'subtypes' => 'blog',
'container_guid' => elgg_get_page_owner_guid(),
- ));
+ ]);
}
if (in_array($page, ['owner', 'group', 'archive'])) {
@@ -20,8 +20,8 @@
}
if ($page != 'friends') {
- echo elgg_view('page/elements/tagcloud_block', array(
+ echo elgg_view('page/elements/tagcloud_block', [
'subtypes' => 'blog',
'container_guid' => elgg_get_page_owner_guid(),
- ));
+ ]);
}
diff --git a/mod/blog/views/default/blog/sidebar/revisions.php b/mod/blog/views/default/blog/sidebar/revisions.php
index 323b7068e44..943fe4ae589 100644
--- a/mod/blog/views/default/blog/sidebar/revisions.php
+++ b/mod/blog/views/default/blog/sidebar/revisions.php
@@ -6,7 +6,7 @@
*/
//If editing a post, show the previous revisions and drafts.
-$blog = elgg_extract('entity', $vars, FALSE);
+$blog = elgg_extract('entity', $vars, false);
if (!elgg_instanceof($blog, 'object', 'blog')) {
return;
@@ -17,7 +17,7 @@
}
$owner = $blog->getOwnerEntity();
-$revisions = array();
+$revisions = [];
$auto_save_annotations = $blog->getAnnotations([
'annotation_name' => 'blog_auto_save',
@@ -65,11 +65,11 @@
$revision_lang = elgg_echo('blog:revision') . " $n";
}
- $load = elgg_view('output/url', array(
+ $load = elgg_view('output/url', [
'href' => "$load_base_url/$revision->id",
'text' => $revision_lang,
'is_trusted' => true,
- ));
+ ]);
$revisions_list .= elgg_format_element('li', ['class' => 'auto-saved'], "$load: $time");
diff --git a/mod/blog/views/default/elgg/blog/save_draft.js b/mod/blog/views/default/elgg/blog/save_draft.js
index 01800d7393b..fe8865056c3 100644
--- a/mod/blog/views/default/elgg/blog/save_draft.js
+++ b/mod/blog/views/default/elgg/blog/save_draft.js
@@ -66,4 +66,4 @@ define(function(require) {
return {
saveDraft: saveDraft
};
-});
\ No newline at end of file
+});
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 732c8e3e6d7..bbe7d5b6fb2 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -5,11 +5,11 @@
* @package Blog
*/
-$full = elgg_extract('full_view', $vars, FALSE);
-$blog = elgg_extract('entity', $vars, FALSE);
+$full = elgg_extract('full_view', $vars, false);
+$blog = elgg_extract('entity', $vars, false);
if (!$blog) {
- return TRUE;
+ return true;
}
$owner = $blog->getOwnerEntity();
@@ -29,11 +29,11 @@
//only display if there are commments
if ($comments_count != 0) {
$text = elgg_echo("comments") . " ($comments_count)";
- $comments_link = elgg_view('output/url', array(
+ $comments_link = elgg_view('output/url', [
'href' => $blog->getURL() . '#comments',
'text' => $text,
'is_trusted' => true,
- ));
+ ]);
} else {
$comments_link = '';
}
@@ -46,27 +46,26 @@
$metadata = '';
if (!elgg_in_context('widgets')) {
// only show entity menu outside of widgets
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $vars['entity'],
'handler' => 'blog',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
if ($full) {
-
- $body = elgg_view('output/longtext', array(
+ $body = elgg_view('output/longtext', [
'value' => $blog->description,
'class' => 'blog-post',
- ));
+ ]);
- $params = array(
+ $params = [
'entity' => $blog,
'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
- );
+ ];
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
@@ -78,25 +77,23 @@
}
}
- echo elgg_view('object/elements/full', array(
+ echo elgg_view('object/elements/full', [
'entity' => $blog,
'summary' => $summary,
'icon' => $owner_icon,
'body' => $body,
'responses' => $responses,
- ));
-
+ ]);
} else {
// brief view
- $params = array(
+ $params = [
'entity' => $blog,
'metadata' => $metadata,
'subtitle' => $subtitle,
'content' => $excerpt,
'icon' => $owner_icon,
- );
+ ];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
-
}
diff --git a/mod/blog/views/default/resources/blog/group.php b/mod/blog/views/default/resources/blog/group.php
index 6b36b53c969..b67aa67bb47 100644
--- a/mod/blog/views/default/resources/blog/group.php
+++ b/mod/blog/views/default/resources/blog/group.php
@@ -22,4 +22,4 @@
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($params['title'], $body);
\ No newline at end of file
+echo elgg_view_page($params['title'], $body);
diff --git a/mod/blog/views/default/resources/blog/view.php b/mod/blog/views/default/resources/blog/view.php
index a8454df0e08..26900c33b9d 100644
--- a/mod/blog/views/default/resources/blog/view.php
+++ b/mod/blog/views/default/resources/blog/view.php
@@ -32,7 +32,7 @@
'show_responses' => true,
]);
-$params['sidebar'] = elgg_view('blog/sidebar', array('page' => $page_type));
+$params['sidebar'] = elgg_view('blog/sidebar', ['page' => $page_type]);
$body = elgg_view_layout('content', $params);
diff --git a/mod/bookmarks/actions/bookmarks/save.php b/mod/bookmarks/actions/bookmarks/save.php
index 6a011a2e997..41cf4ce1fc3 100644
--- a/mod/bookmarks/actions/bookmarks/save.php
+++ b/mod/bookmarks/actions/bookmarks/save.php
@@ -46,7 +46,7 @@
if ($guid == 0) {
$bookmark = new ElggObject;
$bookmark->subtype = "bookmarks";
- $bookmark->container_guid = (int)get_input('container_guid', elgg_get_logged_in_user_guid());
+ $bookmark->container_guid = (int) get_input('container_guid', elgg_get_logged_in_user_guid());
$new = true;
} else {
$bookmark = get_entity($guid);
@@ -65,19 +65,18 @@
$bookmark->tags = $tagarray;
if ($bookmark->save()) {
-
elgg_clear_sticky_form('bookmarks');
system_message(elgg_echo('bookmarks:save:success'));
//add to river only if new
if ($new) {
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/bookmarks/create',
'action_type' => 'create',
'subject_guid' => elgg_get_logged_in_user_guid(),
'object_guid' => $bookmark->getGUID(),
- ));
+ ]);
}
forward($bookmark->getURL());
diff --git a/mod/bookmarks/languages/ca.php b/mod/bookmarks/languages/ca.php
index 463d1eb17af..6ae48351b64 100644
--- a/mod/bookmarks/languages/ca.php
+++ b/mod/bookmarks/languages/ca.php
@@ -1,5 +1,5 @@
"L'enllaç és invàlid i no es pot guardar.",
'bookmarks:delete:failed' => "No es pot esborrar l'adreça d'interés. Siusplau, torna-ho a provar.",
'bookmarks:unknown_bookmark' => 'No es pot trobar l\'enllaç especificat.',
-);
+];
diff --git a/mod/bookmarks/languages/da.php b/mod/bookmarks/languages/da.php
index 894eaa38ed3..2c36c0532ee 100644
--- a/mod/bookmarks/languages/da.php
+++ b/mod/bookmarks/languages/da.php
@@ -1,5 +1,5 @@
"The address of the bookmark is invalid and could not be saved.",
'bookmarks:delete:failed' => "Bogmærket kunne ikke slettes, prøv venligst igen.",
'bookmarks:unknown_bookmark' => 'Kan ikke finde det specifikke bogmærke',
-);
+];
diff --git a/mod/bookmarks/languages/de.php b/mod/bookmarks/languages/de.php
index 7220c342415..39f9d476cd7 100644
--- a/mod/bookmarks/languages/de.php
+++ b/mod/bookmarks/languages/de.php
@@ -1,5 +1,5 @@
"Die Adresse des Lesezeichens ist ungültig und kann nicht gespeichert werden.",
'bookmarks:delete:failed' => "Das Lesezeichen konnte nicht gelöscht werden. Versuche es bitte noch einmal.",
'bookmarks:unknown_bookmark' => 'Das ausgewählte Lesezeichen ist nicht auffindbar.',
-);
+];
diff --git a/mod/bookmarks/languages/el.php b/mod/bookmarks/languages/el.php
index 0d0db255293..c0415275842 100644
--- a/mod/bookmarks/languages/el.php
+++ b/mod/bookmarks/languages/el.php
@@ -1,5 +1,5 @@
"Η διεύθυνση του σελιδοδείκτη δεν είναι έγκυρη και δεν μπορεί να αποθηκευτεί.",
'bookmarks:delete:failed' => "Αδύνατη η διαγραφή του συνδέσμου. Παρακαλώ δοκιμάστε ξανά.",
'bookmarks:unknown_bookmark' => 'Αδύνατη η εύρεση του συνδέσμου',
-);
+];
diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php
index 3c068e1aad5..b22d9cbedb9 100644
--- a/mod/bookmarks/languages/en.php
+++ b/mod/bookmarks/languages/en.php
@@ -1,5 +1,5 @@
"The address of the bookmark is invalid and could not be saved.",
'bookmarks:delete:failed' => "Your bookmark could not be deleted. Please try again.",
'bookmarks:unknown_bookmark' => 'Cannot find specified bookmark',
-);
+];
diff --git a/mod/bookmarks/languages/es.php b/mod/bookmarks/languages/es.php
index 116570992a3..382a333ca2a 100644
--- a/mod/bookmarks/languages/es.php
+++ b/mod/bookmarks/languages/es.php
@@ -1,5 +1,5 @@
"La dirección es inválida y no pudo ser guardada.",
'bookmarks:delete:failed' => "El marcador no pudo ser borrado. Intenta de nuevo.",
'bookmarks:unknown_bookmark' => 'No se puede encontrar el marcador requerido',
-);
+];
diff --git a/mod/bookmarks/languages/eu_es.php b/mod/bookmarks/languages/eu_es.php
index de6ef3c60aa..ac5bd794d9b 100644
--- a/mod/bookmarks/languages/eu_es.php
+++ b/mod/bookmarks/languages/eu_es.php
@@ -1,5 +1,5 @@
"Laster-markaren helbidea ez da egokia eta ezin da gorde.",
'bookmarks:delete:failed' => "Ezin da zure laster-marka ezabatu. Saiatu berriro mesedez.",
'bookmarks:unknown_bookmark' => 'Ezin da zehaztutako laster-marka aurkitu',
-);
+];
diff --git a/mod/bookmarks/languages/fi.php b/mod/bookmarks/languages/fi.php
index 6668687fc1d..7dc5fbd8238 100644
--- a/mod/bookmarks/languages/fi.php
+++ b/mod/bookmarks/languages/fi.php
@@ -1,5 +1,5 @@
"Kirjanmerkin osoite oli virheellinen, joten sitä ei voitu tallentaa.",
'bookmarks:delete:failed' => "Kirjanmerkin poistaminen epäonnistui. Yritä uudelleen.",
'bookmarks:unknown_bookmark' => 'Kirjanmerkkiä ei löytynyt',
-);
+];
diff --git a/mod/bookmarks/languages/fr.php b/mod/bookmarks/languages/fr.php
index 36b2ad7a5df..043e0dd29fc 100644
--- a/mod/bookmarks/languages/fr.php
+++ b/mod/bookmarks/languages/fr.php
@@ -1,5 +1,5 @@
"L’adresse du signet est invalide et ne peut donc pas être enregistrée.",
'bookmarks:delete:failed' => "Votre signet n'a pas pu être supprimé. Merci de réessayer.",
'bookmarks:unknown_bookmark' => 'Impossible de trouver le signet spécifié',
-);
+];
diff --git a/mod/bookmarks/languages/gl.php b/mod/bookmarks/languages/gl.php
index bc503b86404..fe79bc2c869 100644
--- a/mod/bookmarks/languages/gl.php
+++ b/mod/bookmarks/languages/gl.php
@@ -1,5 +1,5 @@
"O enderezo do marcador non é válido e non foi posíbel gardalo.",
'bookmarks:delete:failed' => "Non foi posíbel eliminar o marcador. Inténteo de novo",
'bookmarks:unknown_bookmark' => 'Non é posíbel atopar o marcador indicado',
-);
+];
diff --git a/mod/bookmarks/languages/it.php b/mod/bookmarks/languages/it.php
index f6bea528810..1f994ea9852 100644
--- a/mod/bookmarks/languages/it.php
+++ b/mod/bookmarks/languages/it.php
@@ -1,5 +1,5 @@
"L'indirizzo del segnalibro non è valido e non può essere salvato.",
'bookmarks:delete:failed' => "Il tuo segnalibro non può essere eliminato. Riprova.",
'bookmarks:unknown_bookmark' => 'Impossibile trovare il segnalibro specificato.',
-);
+];
diff --git a/mod/bookmarks/languages/ja.php b/mod/bookmarks/languages/ja.php
index a85a23d409c..e12975f2722 100644
--- a/mod/bookmarks/languages/ja.php
+++ b/mod/bookmarks/languages/ja.php
@@ -1,5 +1,5 @@
"このブックマークのアドレスはどこか間違っていますので、保存することはできませんでした。",
'bookmarks:delete:failed' => "ブックマークから削除できませんでした。もう一度試してみてください。",
'bookmarks:unknown_bookmark' => 'お探しのブックマークを見つけることができません。',
-);
+];
diff --git a/mod/bookmarks/languages/ko.php b/mod/bookmarks/languages/ko.php
index 47d3a49a1bf..8fb0db5db29 100644
--- a/mod/bookmarks/languages/ko.php
+++ b/mod/bookmarks/languages/ko.php
@@ -1,5 +1,5 @@
"책갈피의 주소가 잘못되어 저장할 수 없습니다.",
'bookmarks:delete:failed' => "책갈피를 삭제할 수 없습니다. 다시 시도해 보세요.",
'bookmarks:unknown_bookmark' => '해당하는 책갈피를 찾을 수 없습니다.',
-);
+];
diff --git a/mod/bookmarks/languages/nl.php b/mod/bookmarks/languages/nl.php
index 8f0f285ed6c..cae51ff0be9 100644
--- a/mod/bookmarks/languages/nl.php
+++ b/mod/bookmarks/languages/nl.php
@@ -1,5 +1,5 @@
"Het adres van de favoriet is ongeldig en kon niet worden opgeslagen.",
'bookmarks:delete:failed' => "Je favoriet kon niet worden verwijderd. Probeer het nogmaals.",
'bookmarks:unknown_bookmark' => 'Kan deze favoriet niet vinden',
-);
+];
diff --git a/mod/bookmarks/languages/pl.php b/mod/bookmarks/languages/pl.php
index 4f5d85a660c..7b70ca88102 100644
--- a/mod/bookmarks/languages/pl.php
+++ b/mod/bookmarks/languages/pl.php
@@ -1,5 +1,5 @@
"Adres zakładki jest niepoprawny i nie mógł zostać zapisany.",
'bookmarks:delete:failed' => "Twoja zakładka nie mogła być skasowana. Spróbuj ponownie.",
'bookmarks:unknown_bookmark' => 'Nie można znaleźć wskazanej zakładki.',
-);
+];
diff --git a/mod/bookmarks/languages/pt_br.php b/mod/bookmarks/languages/pt_br.php
index b95c63adbad..6074c0fd092 100644
--- a/mod/bookmarks/languages/pt_br.php
+++ b/mod/bookmarks/languages/pt_br.php
@@ -1,5 +1,5 @@
"O endereço do favorito é inválido e não pode ser salvo.",
'bookmarks:delete:failed' => "Este hiperlink favorito não pode ser apagado. Por favor, tente novamente.",
'bookmarks:unknown_bookmark' => 'Não foi possível encontrar favorito específico',
-);
+];
diff --git a/mod/bookmarks/languages/ro_ro.php b/mod/bookmarks/languages/ro_ro.php
index 4f5bb7c6709..5111ec3ba2c 100644
--- a/mod/bookmarks/languages/ro_ro.php
+++ b/mod/bookmarks/languages/ro_ro.php
@@ -1,5 +1,5 @@
"Adresa marcajului este invalidă și nu s-a putut salva.",
'bookmarks:delete:failed' => "Marcajul tău nu s-a putut șterge. Te rugăm să reîncerci.",
'bookmarks:unknown_bookmark' => 'Nu s-a putut găsi marcajul specificat',
-);
+];
diff --git a/mod/bookmarks/languages/ru.php b/mod/bookmarks/languages/ru.php
index 104b8ba642b..fc4de9ab5b7 100644
--- a/mod/bookmarks/languages/ru.php
+++ b/mod/bookmarks/languages/ru.php
@@ -1,5 +1,5 @@
"Адрес закладки не корректный - она не будет сохранена.",
'bookmarks:delete:failed' => "Простите, Ваша закладка не может быть удалена. Попробуйте снова.",
'bookmarks:unknown_bookmark' => 'Не могу найти указанную закладку',
-);
+];
diff --git a/mod/bookmarks/languages/zh_hans.php b/mod/bookmarks/languages/zh_hans.php
index eae862435c5..1e70a586d79 100644
--- a/mod/bookmarks/languages/zh_hans.php
+++ b/mod/bookmarks/languages/zh_hans.php
@@ -1,5 +1,5 @@
"书签的地址无效,无法保存。",
'bookmarks:delete:failed' => "书签无法删除。请重试。",
'bookmarks:unknown_bookmark' => '无法找到特定的书签。',
-);
+];
diff --git a/mod/bookmarks/lib/bookmarks.php b/mod/bookmarks/lib/bookmarks.php
index 7513e58d799..dfa96022280 100644
--- a/mod/bookmarks/lib/bookmarks.php
+++ b/mod/bookmarks/lib/bookmarks.php
@@ -13,7 +13,7 @@
*/
function bookmarks_prepare_form_vars($bookmark = null) {
// input names => defaults
- $values = array(
+ $values = [
'title' => get_input('title', ''), // bookmarklet support
'address' => get_input('address', ''),
'description' => '',
@@ -22,7 +22,7 @@ function bookmarks_prepare_form_vars($bookmark = null) {
'container_guid' => elgg_get_page_owner_guid(),
'guid' => null,
'entity' => $bookmark,
- );
+ ];
if ($bookmark) {
foreach (array_keys($values) as $field) {
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index d75a2ce9f1b..f2f52605938 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -34,18 +34,18 @@ function bookmarks_init() {
$user_guid = elgg_get_logged_in_user_guid();
$address = urlencode(current_page_url());
- elgg_register_menu_item('extras', array(
+ elgg_register_menu_item('extras', [
'name' => 'bookmark',
'text' => elgg_echo('bookmarks:this'),
'icon' => 'push-pin-alt',
'href' => "bookmarks/add/$user_guid?address=$address",
'title' => elgg_echo('bookmarks:this'),
'rel' => 'nofollow',
- ));
+ ]);
}
// Register for notifications
- elgg_register_notification_event('object', 'bookmarks', array('create'));
+ elgg_register_notification_event('object', 'bookmarks', ['create']);
elgg_register_plugin_hook_handler('prepare', 'notification:create:object:bookmarks', 'bookmarks_prepare_notification');
// Register bookmarks view for ecml parsing
@@ -197,15 +197,15 @@ function bookmarks_prepare_notification($hook, $type, $notification, $params) {
$descr = $entity->description;
$title = $entity->title;
- $notification->subject = elgg_echo('bookmarks:notify:subject', array($title), $language);
- $notification->body = elgg_echo('bookmarks:notify:body', array(
+ $notification->subject = elgg_echo('bookmarks:notify:subject', [$title], $language);
+ $notification->body = elgg_echo('bookmarks:notify:body', [
$owner->name,
$title,
$entity->address,
$descr,
$entity->getURL()
- ), $language);
- $notification->summary = elgg_echo('bookmarks:notify:summary', array($entity->title), $language);
+ ], $language);
+ $notification->summary = elgg_echo('bookmarks:notify:summary', [$entity->title], $language);
$notification->url = $entity->getURL();
return $notification;
}
diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
index 0906b4a13ca..af5fb63bcaf 100644
--- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php
+++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
@@ -8,7 +8,7 @@
$page_owner = elgg_get_page_owner_entity();
if ($page_owner instanceof ElggGroup) {
- $title = elgg_echo("bookmarks:this:group", array($page_owner->name));
+ $title = elgg_echo("bookmarks:this:group", [$page_owner->name]);
} else {
$title = elgg_echo("bookmarks:this");
}
@@ -20,10 +20,10 @@
}
$url = elgg_get_site_url();
-$img = elgg_view('output/img', array(
+$img = elgg_view('output/img', [
'src' => elgg_get_simplecache_url('bookmarks/bookmarklet.gif'),
'alt' => $title,
-));
+]);
$bookmarklet = ""
. $img . " ";
diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php
index d6a0d52a5f0..e2bf518e302 100644
--- a/mod/bookmarks/views/default/bookmarks/group_module.php
+++ b/mod/bookmarks/views/default/bookmarks/group_module.php
@@ -11,14 +11,14 @@
return true;
}
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => "bookmarks/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
-));
+]);
elgg_push_context('widgets');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'bookmarks',
'container_guid' => elgg_get_page_owner_guid(),
@@ -27,19 +27,19 @@
'pagination' => false,
'no_results' => elgg_echo('bookmarks:none'),
'distinct' => false,
-);
+];
$content = elgg_list_entities($options);
elgg_pop_context();
-$new_link = elgg_view('output/url', array(
+$new_link = elgg_view('output/url', [
'href' => "bookmarks/add/$group->guid",
'text' => elgg_echo('bookmarks:add'),
'is_trusted' => true,
-));
+]);
-echo elgg_view('groups/profile/module', array(
+echo elgg_view('groups/profile/module', [
'title' => elgg_echo('bookmarks:group'),
'content' => $content,
'all_link' => $all_link,
'add_link' => $new_link,
-));
+]);
diff --git a/mod/bookmarks/views/default/bookmarks/sidebar.php b/mod/bookmarks/views/default/bookmarks/sidebar.php
index 2c210a0a22f..98e0d52bb98 100644
--- a/mod/bookmarks/views/default/bookmarks/sidebar.php
+++ b/mod/bookmarks/views/default/bookmarks/sidebar.php
@@ -3,12 +3,12 @@
* Bookmarks sidebar
*/
-echo elgg_view('page/elements/comments_block', array(
+echo elgg_view('page/elements/comments_block', [
'subtypes' => 'bookmarks',
'container_guid' => elgg_get_page_owner_guid(),
-));
+]);
-echo elgg_view('page/elements/tagcloud_block', array(
+echo elgg_view('page/elements/tagcloud_block', [
'subtypes' => 'bookmarks',
'container_guid' => elgg_get_page_owner_guid(),
-));
+]);
diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php
index 23742741da5..20509ac499a 100644
--- a/mod/bookmarks/views/default/object/bookmarks.php
+++ b/mod/bookmarks/views/default/object/bookmarks.php
@@ -5,8 +5,8 @@
* @package ElggBookmarks
*/
-$full = elgg_extract('full_view', $vars, FALSE);
-$bookmark = elgg_extract('entity', $vars, FALSE);
+$full = elgg_extract('full_view', $vars, false);
+$bookmark = elgg_extract('entity', $vars, false);
if (!$bookmark) {
return;
@@ -16,8 +16,8 @@
$owner_icon = elgg_view_entity_icon($owner, 'tiny');
$categories = elgg_view('output/categories', $vars);
-$link = elgg_view('output/url', array('href' => $bookmark->address));
-$description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl'));
+$link = elgg_view('output/url', ['href' => $bookmark->address]);
+$description = elgg_view('output/longtext', ['value' => $bookmark->description, 'class' => 'pbl']);
$by_line = elgg_view('object/elements/imprint', $vars);
@@ -25,11 +25,11 @@
//only display if there are commments
if ($comments_count != 0) {
$text = elgg_echo("comments") . " ($comments_count)";
- $comments_link = elgg_view('output/url', array(
+ $comments_link = elgg_view('output/url', [
'href' => $bookmark->getURL() . '#comments',
'text' => $text,
'is_trusted' => true,
- ));
+ ]);
} else {
$comments_link = '';
}
@@ -39,22 +39,21 @@
$metadata = '';
if (!elgg_in_context('widgets') && !elgg_in_context('gallery')) {
// only show entity menu outside of widgets and gallery view
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $vars['entity'],
'handler' => 'bookmarks',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
if ($full && !elgg_in_context('gallery')) {
-
- $params = array(
+ $params = [
'entity' => $bookmark,
'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
- );
+ ];
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
@@ -70,14 +69,13 @@
if (elgg_extract('show_responses', $vars, false)) {
$responses = elgg_view_comments($bookmark);
}
- echo elgg_view('object/elements/full', array(
+ echo elgg_view('object/elements/full', [
'entity' => $bookmark,
'icon' => $owner_icon,
'summary' => $summary,
'body' => $body,
'responses' => $responses,
- ));
-
+ ]);
} elseif (elgg_in_context('gallery')) {
echo <<
@@ -103,21 +101,20 @@
}
}
- $link = elgg_view('output/url', array(
+ $link = elgg_view('output/url', [
'href' => $bookmark->address,
'text' => $display_text,
- ));
+ ]);
$content = elgg_view_icon('push-pin-alt') . "$link{$excerpt}";
- $params = array(
+ $params = [
'entity' => $bookmark,
'metadata' => $metadata,
'subtitle' => $subtitle,
'content' => $content,
'icon' => $owner_icon,
- );
+ ];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
-
}
diff --git a/mod/bookmarks/views/default/resources/bookmarks/add.php b/mod/bookmarks/views/default/resources/bookmarks/add.php
index 1da5ad6039f..5db088df50d 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/add.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/add.php
@@ -12,12 +12,12 @@
elgg_push_breadcrumb($title);
$vars = bookmarks_prepare_form_vars();
-$content = elgg_view_form('bookmarks/save', array(), $vars);
+$content = elgg_view_form('bookmarks/save', [], $vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
-));
+]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/resources/bookmarks/all.php b/mod/bookmarks/views/default/resources/bookmarks/all.php
index d19580ee9c5..abb922cf30f 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/all.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/all.php
@@ -10,7 +10,7 @@
elgg_register_title_button('bookmarks', 'add', 'object', 'bookmarks');
-$content = elgg_list_entities(array(
+$content = elgg_list_entities([
'type' => 'object',
'subtype' => 'bookmarks',
'full_view' => false,
@@ -19,15 +19,15 @@
'preload_owners' => true,
'preload_containers' => true,
'distinct' => false,
-));
+]);
$title = elgg_echo('bookmarks:everyone');
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => 'all',
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('bookmarks/sidebar'),
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/resources/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/resources/bookmarks/bookmarklet.php
index 0c8cc5f4be3..50b5628d286 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/bookmarklet.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/bookmarklet.php
@@ -27,10 +27,10 @@
$content = elgg_view("bookmarks/bookmarklet");
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => false
-));
+]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/resources/bookmarks/edit.php b/mod/bookmarks/views/default/resources/bookmarks/edit.php
index b325e3d5e3f..c62b5a2f402 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/edit.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/edit.php
@@ -20,12 +20,12 @@
elgg_push_breadcrumb($title);
$vars = bookmarks_prepare_form_vars($bookmark);
-$content = elgg_view_form('bookmarks/save', array(), $vars);
+$content = elgg_view_form('bookmarks/save', [], $vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
-));
+]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/resources/bookmarks/friends.php b/mod/bookmarks/views/default/resources/bookmarks/friends.php
index 10ba6cf8f3b..e04cd7b32e4 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/friends.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/friends.php
@@ -17,7 +17,7 @@
$title = elgg_echo('bookmarks:friends');
-$content = elgg_list_entities_from_relationship(array(
+$content = elgg_list_entities_from_relationship([
'type' => 'object',
'subtype' => 'bookmarks',
'full_view' => false,
@@ -27,13 +27,13 @@
'no_results' => elgg_echo('bookmarks:none'),
'preload_owners' => true,
'preload_containers' => true,
-));
+]);
-$params = array(
+$params = [
'filter_context' => 'friends',
'content' => $content,
'title' => $title,
-);
+];
$body = elgg_view_layout('content', $params);
diff --git a/mod/bookmarks/views/default/resources/bookmarks/owner.php b/mod/bookmarks/views/default/resources/bookmarks/owner.php
index b7ec82b8e71..d69f1b7ea2c 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/owner.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/owner.php
@@ -33,19 +33,19 @@
$content .= elgg_list_entities($options);
-$title = elgg_echo('bookmarks:owner', array($page_owner->name));
+$title = elgg_echo('bookmarks:owner', [$page_owner->name]);
$filter_context = '';
if ($page_owner->getGUID() == elgg_get_logged_in_user_guid()) {
$filter_context = 'mine';
}
-$vars = array(
+$vars = [
'filter_context' => $filter_context,
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('bookmarks/sidebar'),
-);
+];
// don't show filter if out of filter context
if ($page_owner instanceof ElggGroup) {
@@ -54,4 +54,4 @@
$body = elgg_view_layout('content', $vars);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/resources/bookmarks/view.php b/mod/bookmarks/views/default/resources/bookmarks/view.php
index cb34f82e301..6a3856de91e 100644
--- a/mod/bookmarks/views/default/resources/bookmarks/view.php
+++ b/mod/bookmarks/views/default/resources/bookmarks/view.php
@@ -32,10 +32,10 @@
'show_responses' => true,
]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php
index 62447be4d30..2186c5a7f63 100644
--- a/mod/bookmarks/views/default/river/object/bookmarks/create.php
+++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php
@@ -11,8 +11,8 @@
$object = $item->getObjectEntity();
$excerpt = elgg_get_excerpt($object->description);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => $excerpt,
- 'attachments' => elgg_view('output/url', array('href' => $object->address)),
-));
+ 'attachments' => elgg_view('output/url', ['href' => $object->address]),
+]);
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php
index beaa480f08e..1e90a6fe5a1 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/content.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php
@@ -15,22 +15,22 @@
]);
if (empty($content)) {
- echo elgg_echo('bookmarks:none');
- return;
+ echo elgg_echo('bookmarks:none');
+ return;
}
echo $content;
$owner = $widget->getOwnerEntity();
if ($owner instanceof ElggGroup) {
- $url = "bookmarks/group/{$owner->guid}/all";
+ $url = "bookmarks/group/{$owner->guid}/all";
} else {
- $url = "bookmarks/owner/{$owner->username}";
+ $url = "bookmarks/owner/{$owner->username}";
}
$more_link = elgg_view('output/url', [
- 'href' => $url,
- 'text' => elgg_echo('more'),
- 'is_trusted' => true,
+ 'href' => $url,
+ 'text' => elgg_echo('more'),
+ 'is_trusted' => true,
]);
echo "$more_link
";
diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php
index 1abda471058..8e30e7c7d68 100644
--- a/mod/bookmarks/views/rss/object/bookmarks.php
+++ b/mod/bookmarks/views/rss/object/bookmarks.php
@@ -15,7 +15,7 @@
$pubdate = date('r', $vars['entity']->getTimeCreated());
$url_text = elgg_echo('bookmarks:address');
-$link = elgg_view('output/url', array('href' => $vars['entity']->address));
+$link = elgg_view('output/url', ['href' => $vars['entity']->address]);
$description = $vars['entity']->description . "$url_text: $link
";
$creator = elgg_view('page/components/creator', $vars);
diff --git a/mod/ckeditor/languages/ca.php b/mod/ckeditor/languages/ca.php
index ee091ae287c..25e363b9f44 100644
--- a/mod/ckeditor/languages/ca.php
+++ b/mod/ckeditor/languages/ca.php
@@ -1,6 +1,6 @@
"Edita HTML",
'ckeditor:visual' => "Editor visual",
'ckeditor:blockimagepaste' => "No es permet enganxar una imatge directament",
-);
+];
diff --git a/mod/ckeditor/languages/da.php b/mod/ckeditor/languages/da.php
index e4300efadb6..91e0aaf963e 100644
--- a/mod/ckeditor/languages/da.php
+++ b/mod/ckeditor/languages/da.php
@@ -1,5 +1,5 @@
"Ændre HTML",
'ckeditor:visual' => "Visuel redigering",
-);
+];
diff --git a/mod/ckeditor/languages/de.php b/mod/ckeditor/languages/de.php
index 8b77d930eaa..33d5a775fc5 100644
--- a/mod/ckeditor/languages/de.php
+++ b/mod/ckeditor/languages/de.php
@@ -1,6 +1,6 @@
"Editor deaktivieren",
'ckeditor:visual' => "Editor aktivieren",
'ckeditor:blockimagepaste' => "Direktes Einfügen von Bildern ist nicht erlaubt.",
-);
+];
diff --git a/mod/ckeditor/languages/el.php b/mod/ckeditor/languages/el.php
index d6957a83666..4be633f6e54 100644
--- a/mod/ckeditor/languages/el.php
+++ b/mod/ckeditor/languages/el.php
@@ -1,6 +1,6 @@
"Επεξεργασία κώδικα HML",
'ckeditor:visual' => "Οπτική επεξεργασία",
'ckeditor:blockimagepaste' => "Δεν επιτρέπεται η απευθείας επικόλληση εικόνων",
-);
+];
diff --git a/mod/ckeditor/languages/en.php b/mod/ckeditor/languages/en.php
index 83379edb556..0e175bfa983 100644
--- a/mod/ckeditor/languages/en.php
+++ b/mod/ckeditor/languages/en.php
@@ -1,6 +1,6 @@
"Edit HTML",
'ckeditor:visual' => "Visual editor",
'ckeditor:blockimagepaste' => "Direct image paste is not allowed.",
-);
+];
diff --git a/mod/ckeditor/languages/es.php b/mod/ckeditor/languages/es.php
index e499fa6a4ef..651ed847449 100644
--- a/mod/ckeditor/languages/es.php
+++ b/mod/ckeditor/languages/es.php
@@ -1,6 +1,6 @@
"Editar HTML",
'ckeditor:visual' => "Editor Visual",
'ckeditor:blockimagepaste' => "No se permite pegar imágenes directamente.",
-);
+];
diff --git a/mod/ckeditor/languages/eu_es.php b/mod/ckeditor/languages/eu_es.php
index 60583544e84..4fc44dd4808 100644
--- a/mod/ckeditor/languages/eu_es.php
+++ b/mod/ckeditor/languages/eu_es.php
@@ -1,6 +1,6 @@
"HTML edizioa",
'ckeditor:visual' => "Edizio bisuala",
'ckeditor:blockimagepaste' => "Irudia zuzenean itsastea ez dago baimenduta.",
-);
+];
diff --git a/mod/ckeditor/languages/fa.php b/mod/ckeditor/languages/fa.php
index 4c6400f1cea..1305b74e090 100644
--- a/mod/ckeditor/languages/fa.php
+++ b/mod/ckeditor/languages/fa.php
@@ -1,5 +1,5 @@
"ویرایش htm",
'ckeditor:visual' => "ویرایشگر بصری",
-);
+];
diff --git a/mod/ckeditor/languages/fi.php b/mod/ckeditor/languages/fi.php
index 364052d93cc..c407aa40615 100644
--- a/mod/ckeditor/languages/fi.php
+++ b/mod/ckeditor/languages/fi.php
@@ -1,6 +1,6 @@
"Muokkaa HTML:ää",
'ckeditor:visual' => "Näytä editori",
'ckeditor:blockimagepaste' => "Kuvien suora liittäminen on estetty.",
-);
+];
diff --git a/mod/ckeditor/languages/fr.php b/mod/ckeditor/languages/fr.php
index 9fa370eb861..e2583e76aa8 100644
--- a/mod/ckeditor/languages/fr.php
+++ b/mod/ckeditor/languages/fr.php
@@ -1,6 +1,6 @@
"Éditer le HTML",
'ckeditor:visual' => "Éditeur visuel",
'ckeditor:blockimagepaste' => "Il n'est pas permis de coller directement une image.",
-);
+];
diff --git a/mod/ckeditor/languages/gl.php b/mod/ckeditor/languages/gl.php
index 0e9dc015026..675a3671188 100644
--- a/mod/ckeditor/languages/gl.php
+++ b/mod/ckeditor/languages/gl.php
@@ -1,6 +1,6 @@
"Editor de HTML",
'ckeditor:visual' => "Editor visual",
'ckeditor:blockimagepaste' => "Non se permite pergar imaxes directamente.",
-);
+];
diff --git a/mod/ckeditor/languages/it.php b/mod/ckeditor/languages/it.php
index b92405dce9b..8526e18eac4 100644
--- a/mod/ckeditor/languages/it.php
+++ b/mod/ckeditor/languages/it.php
@@ -1,6 +1,6 @@
"Modifica HTML",
'ckeditor:visual' => "Interfaccia di modifica",
'ckeditor:blockimagepaste' => "Incollare le immagini non è permesso.",
-);
+];
diff --git a/mod/ckeditor/languages/ja.php b/mod/ckeditor/languages/ja.php
index a326087ac04..8546635e800 100644
--- a/mod/ckeditor/languages/ja.php
+++ b/mod/ckeditor/languages/ja.php
@@ -1,6 +1,6 @@
"HTMLを編集",
'ckeditor:visual' => "ビジュアルエディタ",
'ckeditor:blockimagepaste' => "画像の直接ペーストはできません。",
-);
+];
diff --git a/mod/ckeditor/languages/ko.php b/mod/ckeditor/languages/ko.php
index b86e9688500..a9894f7fb6c 100644
--- a/mod/ckeditor/languages/ko.php
+++ b/mod/ckeditor/languages/ko.php
@@ -1,5 +1,5 @@
"HTML 수정",
'ckeditor:visual' => "위지윅 편집기",
-);
+];
diff --git a/mod/ckeditor/languages/nl.php b/mod/ckeditor/languages/nl.php
index e15b8f70f6c..3db8d045ab9 100644
--- a/mod/ckeditor/languages/nl.php
+++ b/mod/ckeditor/languages/nl.php
@@ -1,6 +1,6 @@
"Bewerk HTML",
'ckeditor:visual' => "Visuele editor",
'ckeditor:blockimagepaste' => "Direct plakken van afbeeldingen is niet toegestaan.",
-);
+];
diff --git a/mod/ckeditor/languages/pl.php b/mod/ckeditor/languages/pl.php
index 55e11d9c7d5..bebdc2d1e88 100644
--- a/mod/ckeditor/languages/pl.php
+++ b/mod/ckeditor/languages/pl.php
@@ -1,6 +1,6 @@
"Edytuj HTML",
'ckeditor:visual' => "Edytor graficzny",
'ckeditor:blockimagepaste' => "Bezpośrednie wstawianie obrazów jest zablokowane.",
-);
+];
diff --git a/mod/ckeditor/languages/pt_br.php b/mod/ckeditor/languages/pt_br.php
index c05fd606f0b..7a2f915d8c5 100644
--- a/mod/ckeditor/languages/pt_br.php
+++ b/mod/ckeditor/languages/pt_br.php
@@ -1,6 +1,6 @@
"Editar HTML",
'ckeditor:visual' => "Editor visual",
'ckeditor:blockimagepaste' => "Não é permitida colagem de fotos.",
-);
+];
diff --git a/mod/ckeditor/languages/ro_ro.php b/mod/ckeditor/languages/ro_ro.php
index f37168241f8..54389928731 100644
--- a/mod/ckeditor/languages/ro_ro.php
+++ b/mod/ckeditor/languages/ro_ro.php
@@ -1,6 +1,6 @@
"Editează HTML",
'ckeditor:visual' => "Editor vizual",
'ckeditor:blockimagepaste' => "Lipirea directă de imagine nu este permisă.",
-);
+];
diff --git a/mod/ckeditor/languages/ru.php b/mod/ckeditor/languages/ru.php
index cf54789d5bd..27228aa6947 100644
--- a/mod/ckeditor/languages/ru.php
+++ b/mod/ckeditor/languages/ru.php
@@ -1,6 +1,6 @@
"Редактировать HTML",
'ckeditor:visual' => "Визуальный редактор",
'ckeditor:blockimagepaste' => "Редактор не поддерживает вставку изображений напрямую",
-);
+];
diff --git a/mod/ckeditor/languages/zh_hans.php b/mod/ckeditor/languages/zh_hans.php
index 39abaaa7931..29f2c29cbb8 100644
--- a/mod/ckeditor/languages/zh_hans.php
+++ b/mod/ckeditor/languages/zh_hans.php
@@ -1,6 +1,6 @@
"编辑HTML",
'ckeditor:visual' => "可视化编辑器",
'ckeditor:blockimagepaste' => "不允许直接粘贴图片",
-);
+];
diff --git a/mod/ckeditor/start.php b/mod/ckeditor/start.php
index 33d65ecae79..21616cf1e23 100644
--- a/mod/ckeditor/start.php
+++ b/mod/ckeditor/start.php
@@ -14,14 +14,14 @@ function ckeditor_init() {
elgg_extend_view('elgg/wysiwyg.css', 'elements/reset.css', 100);
elgg_extend_view('elgg/wysiwyg.css', 'elements/typography.css', 100);
- elgg_define_js('ckeditor', array(
+ elgg_define_js('ckeditor', [
'deps' => ['elgg/ckeditor/set-basepath'],
'exports' => 'CKEDITOR',
- ));
- elgg_define_js('jquery.ckeditor', array(
- 'deps' => array('jquery', 'ckeditor'),
+ ]);
+ elgg_define_js('jquery.ckeditor', [
+ 'deps' => ['jquery', 'ckeditor'],
'exports' => 'jQuery.fn.ckeditor',
- ));
+ ]);
// need to set basepath early
elgg_extend_view('elgg.js', 'elgg/ckeditor/set-basepath.js');
@@ -39,12 +39,12 @@ function ckeditor_longtext_menu($hook, $type, $items, $vars) {
return;
}
- $items[] = ElggMenuItem::factory(array(
+ $items[] = ElggMenuItem::factory([
'name' => 'ckeditor_toggler',
'link_class' => 'ckeditor-toggle-editor elgg-longtext-control hidden',
'href' => "#{$id}",
'text' => elgg_echo('ckeditor:html'),
- ));
+ ]);
return $items;
}
diff --git a/mod/ckeditor/views/default/ckeditor.css b/mod/ckeditor/views/default/ckeditor.css
index 6ecfffcd177..647b30a87fd 100644
--- a/mod/ckeditor/views/default/ckeditor.css
+++ b/mod/ckeditor/views/default/ckeditor.css
@@ -4,13 +4,13 @@
clear: right;
}
-.cke.cke_chrome {
+.cke.cke_chrome {
box-shadow: none;
border-color: #CCC;
}
.cke .cke_top,
-.cke .cke_bottom {
+.cke .cke_bottom {
background: transparent;
border-color: #CCC;
}
@@ -32,3 +32,4 @@
.cke_button {
background: none !important;
}
+
diff --git a/mod/ckeditor/views/default/elgg/ckeditor.js b/mod/ckeditor/views/default/elgg/ckeditor.js
index f4995145be8..3467242d3b2 100644
--- a/mod/ckeditor/views/default/elgg/ckeditor.js
+++ b/mod/ckeditor/views/default/elgg/ckeditor.js
@@ -7,7 +7,7 @@
*
*
* Modify the config by creating a boot module and handling the [config, ckeditor] hook.
- *
+ *
* @module elgg/ckeditor
*/
define(function (require) {
@@ -21,7 +21,7 @@ define(function (require) {
var elggCKEditor = {
bind: function (selector, editor_config) {
- var default_config = 'elgg/ckeditor/config';
+ var default_config = 'elgg/ckeditor/config';
if (typeof editor_config === undefined) {
editor_config = default_config;
@@ -226,3 +226,4 @@ define(function (require) {
return elggCKEditor;
});
+
diff --git a/mod/ckeditor/views/default/elgg/ckeditor/blockimagepaste.js b/mod/ckeditor/views/default/elgg/ckeditor/blockimagepaste.js
index 4274e84da86..3a6f9430958 100644
--- a/mod/ckeditor/views/default/elgg/ckeditor/blockimagepaste.js
+++ b/mod/ckeditor/views/default/elgg/ckeditor/blockimagepaste.js
@@ -1,43 +1,43 @@
// originaly copied from http://www.isummation.com/blog/block-drag-drop-image-or-direct-image-paste-into-ckeditor-using-firefox/
CKEDITOR.plugins.add( 'blockimagepaste', {
- init : function(editor) {
-
- function replaceImgText(html) {
- var ret = html.replace( / ]*src="data:image\/(bmp|dds|gif|jpg|jpeg|png|psd|pspimage|tga|thm|tif|tiff|yuv|ai|eps|ps|svg);base64,.*?"[^>]*>/gi, function( img ){
- alert(elgg.echo('ckeditor:blockimagepaste'));
- return '';
- });
- return ret;
- }
+ init : function(editor) {
+
+ function replaceImgText(html) {
+ var ret = html.replace( / ]*src="data:image\/(bmp|dds|gif|jpg|jpeg|png|psd|pspimage|tga|thm|tif|tiff|yuv|ai|eps|ps|svg);base64,.*?"[^>]*>/gi, function( img ){
+ alert(elgg.echo('ckeditor:blockimagepaste'));
+ return '';
+ });
+ return ret;
+ }
- function chkImg() {
- // don't execute code if the editor is readOnly
- if (editor.readOnly) {
- return;
- }
+ function chkImg() {
+ // don't execute code if the editor is readOnly
+ if (editor.readOnly) {
+ return;
+ }
- setTimeout(function() {
- editor.document.$.body.innerHTML = replaceImgText(editor.document.$.body.innerHTML);
- }, 100);
- }
+ setTimeout(function() {
+ editor.document.$.body.innerHTML = replaceImgText(editor.document.$.body.innerHTML);
+ }, 100);
+ }
- editor.on('contentDom', function() {
- // For Firefox
- editor.document.on('drop', chkImg);
- // For IE
- editor.document.getBody().on('drop', chkImg);
- });
+ editor.on('contentDom', function() {
+ // For Firefox
+ editor.document.on('drop', chkImg);
+ // For IE
+ editor.document.getBody().on('drop', chkImg);
+ });
- editor.on('paste', function(e) {
+ editor.on('paste', function(e) {
- var html = e.data.dataValue;
- if (!html) {
- return;
- }
+ var html = e.data.dataValue;
+ if (!html) {
+ return;
+ }
- e.data.dataValue = replaceImgText(html);
- });
-
- } //Init
-});
\ No newline at end of file
+ e.data.dataValue = replaceImgText(html);
+ });
+
+ } //Init
+});
diff --git a/mod/ckeditor/views/default/elgg/ckeditor/config.js b/mod/ckeditor/views/default/elgg/ckeditor/config.js
index 410b00232c2..4b316699ac2 100644
--- a/mod/ckeditor/views/default/elgg/ckeditor/config.js
+++ b/mod/ckeditor/views/default/elgg/ckeditor/config.js
@@ -22,3 +22,4 @@ define(function(require) {
stylesSet: false, //no additional styles.js
});
});
+
diff --git a/mod/ckeditor/views/default/elgg/ckeditor/config/simple.js b/mod/ckeditor/views/default/elgg/ckeditor/config/simple.js
index 8620099fb86..e308b645e7c 100644
--- a/mod/ckeditor/views/default/elgg/ckeditor/config/simple.js
+++ b/mod/ckeditor/views/default/elgg/ckeditor/config/simple.js
@@ -22,3 +22,4 @@ define(function(require) {
stylesSet: false, //no additional styles.js
});
});
+
diff --git a/mod/ckeditor/views/default/elgg/ckeditor/set-basepath.js b/mod/ckeditor/views/default/elgg/ckeditor/set-basepath.js
index 1eaa1c14cc5..98b834d2f30 100644
--- a/mod/ckeditor/views/default/elgg/ckeditor/set-basepath.js
+++ b/mod/ckeditor/views/default/elgg/ckeditor/set-basepath.js
@@ -6,3 +6,4 @@ define('elgg/ckeditor/set-basepath', function (require) {
// This global variable must be set before the editor script loading.
CKEDITOR_BASEPATH = elgg.get_simplecache_url('ckeditor/');
});
+
diff --git a/mod/ckeditor/views/default/elgg/wysiwyg.css b/mod/ckeditor/views/default/elgg/wysiwyg.css
index 6046187e663..ad4807bd579 100644
--- a/mod/ckeditor/views/default/elgg/wysiwyg.css
+++ b/mod/ckeditor/views/default/elgg/wysiwyg.css
@@ -36,3 +36,4 @@ img {
max-width: 100%;
height: auto;
}
+
diff --git a/mod/custom_index/languages/ca.php b/mod/custom_index/languages/ca.php
index 598f6c7a9ba..9c501faaf4a 100644
--- a/mod/custom_index/languages/ca.php
+++ b/mod/custom_index/languages/ca.php
@@ -1,8 +1,8 @@
"Darreres dreceres",
'custom:groups' => "Darrers grups",
'custom:files' => "Darrers fitxers",
'custom:blogs' => "Darreres entrades",
'custom:members' => "Darrers membres",
-);
+];
diff --git a/mod/custom_index/languages/cmn.php b/mod/custom_index/languages/cmn.php
index e9b8d7e1708..c04f0efbdde 100644
--- a/mod/custom_index/languages/cmn.php
+++ b/mod/custom_index/languages/cmn.php
@@ -1,8 +1,8 @@
"新進書籤",
'custom:groups' => "新進群組",
'custom:files' => "新進檔案",
'custom:blogs' => "新進部落格貼文",
'custom:members' => "新進成員",
-);
+];
diff --git a/mod/custom_index/languages/da.php b/mod/custom_index/languages/da.php
index 439ea1edafa..625d5fbeaf0 100644
--- a/mod/custom_index/languages/da.php
+++ b/mod/custom_index/languages/da.php
@@ -1,8 +1,8 @@
"Seneste bogmærker",
'custom:groups' => "Seneste grupper",
'custom:files' => "Seneste filer",
'custom:blogs' => "Seneste blogindlæg",
'custom:members' => "Seneste medlemmer",
-);
+];
diff --git a/mod/custom_index/languages/de.php b/mod/custom_index/languages/de.php
index 4de97389808..b91998db408 100644
--- a/mod/custom_index/languages/de.php
+++ b/mod/custom_index/languages/de.php
@@ -1,8 +1,8 @@
"Neueste Lesezeichen",
'custom:groups' => "Neueste Gruppen",
'custom:files' => "Neueste Dateien",
'custom:blogs' => "Neueste Blog-Einträge",
'custom:members' => "Neueste Mitglieder",
-);
+];
diff --git a/mod/custom_index/languages/en.php b/mod/custom_index/languages/en.php
index 7494d22433b..0bfd1b43742 100644
--- a/mod/custom_index/languages/en.php
+++ b/mod/custom_index/languages/en.php
@@ -1,8 +1,8 @@
"Latest bookmarks",
'custom:groups' => "Latest groups",
'custom:files' => "Latest files",
'custom:blogs' => "Latest blog posts",
'custom:members' => "Newest members",
-);
+];
diff --git a/mod/custom_index/languages/es.php b/mod/custom_index/languages/es.php
index 3aa16fac5b0..197614e23c7 100644
--- a/mod/custom_index/languages/es.php
+++ b/mod/custom_index/languages/es.php
@@ -1,8 +1,8 @@
"Los últimos marcadores",
'custom:groups' => "últimos grupos",
'custom:files' => "últimos archivos",
'custom:blogs' => "últimos blogs",
'custom:members' => "Nuevos miembros",
-);
+];
diff --git a/mod/custom_index/languages/eu_es.php b/mod/custom_index/languages/eu_es.php
index 127f6f83a4e..bdecc42e539 100644
--- a/mod/custom_index/languages/eu_es.php
+++ b/mod/custom_index/languages/eu_es.php
@@ -1,8 +1,8 @@
"Azken laster-markak",
'custom:groups' => "Azken taldeak",
'custom:files' => "Azken fitxategiak",
'custom:blogs' => "Blogeko azken bidalketak",
'custom:members' => "Kide berrienak",
-);
+];
diff --git a/mod/custom_index/languages/fi.php b/mod/custom_index/languages/fi.php
index 081d5750703..d2ca2e0785b 100644
--- a/mod/custom_index/languages/fi.php
+++ b/mod/custom_index/languages/fi.php
@@ -1,8 +1,8 @@
"Viimeisimmät kirjanmerkit",
'custom:groups' => "Viimeisimmät ryhmät",
'custom:files' => "Viimeisimmät tiedostot",
'custom:blogs' => "Viimeisimmät blogit",
'custom:members' => "Uusimmat jäsenet",
-);
+];
diff --git a/mod/custom_index/languages/fr.php b/mod/custom_index/languages/fr.php
index 097e482f954..2e19a39aa61 100644
--- a/mod/custom_index/languages/fr.php
+++ b/mod/custom_index/languages/fr.php
@@ -1,8 +1,8 @@
"Derniers signets ajoutés",
'custom:groups' => "Derniers groupes créés",
'custom:files' => "Derniers fichiers publiés",
'custom:blogs' => "Derniers articles de blog publiés",
'custom:members' => "Nouveaux membres",
-);
+];
diff --git a/mod/custom_index/languages/gl.php b/mod/custom_index/languages/gl.php
index 72de2eba57a..b585443a850 100644
--- a/mod/custom_index/languages/gl.php
+++ b/mod/custom_index/languages/gl.php
@@ -1,8 +1,8 @@
"Últimos marcadores",
'custom:groups' => "Últimos grupos",
'custom:files' => "Últimos ficheiros",
'custom:blogs' => "Últimos artigos",
'custom:members' => "Últimos membros",
-);
+];
diff --git a/mod/custom_index/languages/it.php b/mod/custom_index/languages/it.php
index a61e632fca8..889b6bd75aa 100644
--- a/mod/custom_index/languages/it.php
+++ b/mod/custom_index/languages/it.php
@@ -1,8 +1,8 @@
"Ultimi segnalibri",
'custom:groups' => "Ultimi gruppi",
'custom:files' => "Ultimi file",
'custom:blogs' => "Ultimi articoli blog",
'custom:members' => "Ultimi membri",
-);
+];
diff --git a/mod/custom_index/languages/ja.php b/mod/custom_index/languages/ja.php
index 2c542fb5b81..8a4f59d360a 100644
--- a/mod/custom_index/languages/ja.php
+++ b/mod/custom_index/languages/ja.php
@@ -1,8 +1,8 @@
"新着ブックマーク",
'custom:groups' => "新着グループ",
'custom:files' => "新着ファイル",
'custom:blogs' => "新着ブログ記事",
'custom:members' => "最近の参加メンバー",
-);
+];
diff --git a/mod/custom_index/languages/ko.php b/mod/custom_index/languages/ko.php
index b24764024fc..a5cfb1b8519 100644
--- a/mod/custom_index/languages/ko.php
+++ b/mod/custom_index/languages/ko.php
@@ -1,8 +1,8 @@
"최신 책갈피",
'custom:groups' => "최신 모둠",
'custom:files' => "최신 파일",
'custom:blogs' => "최신 블로그글",
'custom:members' => "최신 회원",
-);
+];
diff --git a/mod/custom_index/languages/nl.php b/mod/custom_index/languages/nl.php
index f068f90f846..fa4d3ff8d9a 100644
--- a/mod/custom_index/languages/nl.php
+++ b/mod/custom_index/languages/nl.php
@@ -1,8 +1,8 @@
"Laatste favorieten",
'custom:groups' => "Laatste groepen",
'custom:files' => "Laatste bestanden",
'custom:blogs' => "Laatste blogberichten",
'custom:members' => "Nieuwste leden",
-);
+];
diff --git a/mod/custom_index/languages/pl.php b/mod/custom_index/languages/pl.php
index 83d7712a471..e9c3c34db66 100644
--- a/mod/custom_index/languages/pl.php
+++ b/mod/custom_index/languages/pl.php
@@ -1,8 +1,8 @@
"Najnowsze zakładki",
'custom:groups' => "Najnowsze grupy",
'custom:files' => "Najnowsze pliki",
'custom:blogs' => "Najnowsze wpisy na blogu",
'custom:members' => "Najnowsi użytkownicy",
-);
+];
diff --git a/mod/custom_index/languages/pt_br.php b/mod/custom_index/languages/pt_br.php
index a892f3bf239..fb9f0db51cd 100644
--- a/mod/custom_index/languages/pt_br.php
+++ b/mod/custom_index/languages/pt_br.php
@@ -1,8 +1,8 @@
"Marcadores mais recentes",
'custom:groups' => "Grupos mais recentes",
'custom:files' => "Arquivos mais recentes",
'custom:blogs' => "Postagens mais recentes",
'custom:members' => " Membros mais recentes",
-);
+];
diff --git a/mod/custom_index/languages/ro_ro.php b/mod/custom_index/languages/ro_ro.php
index cb2b140442b..0a10712ccbf 100644
--- a/mod/custom_index/languages/ro_ro.php
+++ b/mod/custom_index/languages/ro_ro.php
@@ -1,8 +1,8 @@
"Ultimele marcaje",
'custom:groups' => "Ultimele grupuri",
'custom:files' => "Ultimele fișiere",
'custom:blogs' => "Ultimele postări de blog",
'custom:members' => "Cei mai noi membri",
-);
+];
diff --git a/mod/custom_index/languages/ru.php b/mod/custom_index/languages/ru.php
index 42a710ac452..10a81e81777 100644
--- a/mod/custom_index/languages/ru.php
+++ b/mod/custom_index/languages/ru.php
@@ -1,8 +1,8 @@
"Новые закладки",
'custom:groups' => "Новые группы",
'custom:files' => "Новые файлы",
'custom:blogs' => "Новые посты в блогах",
'custom:members' => "Новые пользователи",
-);
+];
diff --git a/mod/custom_index/languages/sr.php b/mod/custom_index/languages/sr.php
index 1e85beb4ad4..45c9badb5be 100644
--- a/mod/custom_index/languages/sr.php
+++ b/mod/custom_index/languages/sr.php
@@ -1,8 +1,8 @@
"Најновији линкови",
'custom:groups' => "Најновије групе",
'custom:files' => "Најновији фајлови",
'custom:blogs' => "Најновији блог чланци",
'custom:members' => "Најновији чланови",
-);
+];
diff --git a/mod/custom_index/languages/tr.php b/mod/custom_index/languages/tr.php
index 4ca19d509ef..b5b288bd230 100644
--- a/mod/custom_index/languages/tr.php
+++ b/mod/custom_index/languages/tr.php
@@ -1,8 +1,8 @@
"En yeni yer imleri",
'custom:groups' => "En yeni gruplar",
'custom:files' => "En yeni dosyalar",
'custom:blogs' => "En yeni blog gönderileri",
'custom:members' => "Yeni üyeler",
-);
+];
diff --git a/mod/custom_index/languages/zh_hans.php b/mod/custom_index/languages/zh_hans.php
index 2c574eacef4..0ad9e2aba0c 100644
--- a/mod/custom_index/languages/zh_hans.php
+++ b/mod/custom_index/languages/zh_hans.php
@@ -1,8 +1,8 @@
"最新的书签",
'custom:groups' => "最新的群组",
'custom:files' => "最新的文件",
'custom:blogs' => "最新的博文",
'custom:members' => "最新的会员",
-);
+];
diff --git a/mod/custom_index/views/default/custom_index/content.php b/mod/custom_index/views/default/custom_index/content.php
index f7e4cb0a7a0..88af6b6489d 100644
--- a/mod/custom_index/views/default/custom_index/content.php
+++ b/mod/custom_index/views/default/custom_index/content.php
@@ -1,12 +1,12 @@
'elgg-module-highlight');
+$mod_params = ['class' => 'elgg-module-highlight'];
?>
diff --git a/mod/custom_index/views/default/resources/index.css b/mod/custom_index/views/default/resources/index.css
index 557ba8feed4..5ed52405900 100644
--- a/mod/custom_index/views/default/resources/index.css
+++ b/mod/custom_index/views/default/resources/index.css
@@ -21,4 +21,4 @@
.custom-index-col2 > .elgg-inner {
padding: 0;
}
-}
\ No newline at end of file
+}
diff --git a/mod/custom_index/views/default/resources/index.php b/mod/custom_index/views/default/resources/index.php
index f0eae309062..80a3c4e9fbd 100644
--- a/mod/custom_index/views/default/resources/index.php
+++ b/mod/custom_index/views/default/resources/index.php
@@ -13,13 +13,13 @@
elgg_push_context('widgets');
-$list_params = array(
+$list_params = [
'type' => 'object',
'limit' => 4,
'full_view' => false,
'list_type_toggle' => false,
'pagination' => false,
-);
+];
//grab the latest 4 blog posts
$list_params['subtype'] = 'blog';
@@ -34,7 +34,7 @@
$files = elgg_list_entities($list_params);
//get the newest members who have an avatar
-$newest_members = elgg_list_entities_from_metadata(array(
+$newest_members = elgg_list_entities_from_metadata([
'metadata_names' => 'icontime',
'type' => 'user',
'limit' => 10,
@@ -43,7 +43,7 @@
'list_type' => 'gallery',
'gallery_class' => 'elgg-gallery-users',
'size' => 'small',
-));
+]);
//newest groups
$list_params['type'] = 'group';
@@ -56,14 +56,14 @@
elgg_pop_context();
// lay out the content
-$vars = array(
+$vars = [
'blogs' => $blogs,
'bookmarks' => $bookmarks,
'files' => $files,
'groups' => $groups,
'login' => $login,
'members' => $newest_members,
-);
+];
$body = elgg_view('custom_index/content', $vars);
diff --git a/mod/dashboard/start.php b/mod/dashboard/start.php
index 3c529d58e08..2c97b5c8814 100644
--- a/mod/dashboard/start.php
+++ b/mod/dashboard/start.php
@@ -11,13 +11,13 @@ function dashboard_init() {
elgg_extend_view('elgg.css', 'dashboard/css');
if (elgg_is_logged_in()) {
- elgg_register_menu_item('topbar', array(
+ elgg_register_menu_item('topbar', [
'name' => 'dashboard',
'href' => 'dashboard',
'text' => elgg_echo('dashboard'),
'priority' => 100,
'section' => 'alt',
- ));
+ ]);
}
elgg_register_plugin_hook_handler('get_list', 'default_widgets', 'dashboard_default_widgets');
@@ -42,7 +42,7 @@ function dashboard_page_handler() {
* @return array
*/
function dashboard_default_widgets($hook, $type, $return, $params) {
- $return[] = array(
+ $return[] = [
'name' => elgg_echo('dashboard'),
'widget_context' => 'dashboard',
'widget_columns' => 3,
@@ -50,7 +50,7 @@ function dashboard_default_widgets($hook, $type, $return, $params) {
'event' => 'create',
'entity_type' => 'user',
'entity_subtype' => ELGG_ENTITIES_ANY_VALUE,
- );
+ ];
return $return;
-}
\ No newline at end of file
+}
diff --git a/mod/dashboard/views/default/dashboard/css.php b/mod/dashboard/views/default/dashboard/css.php
index fee27d68d2e..71c99c3ddeb 100644
--- a/mod/dashboard/views/default/dashboard/css.php
+++ b/mod/dashboard/views/default/dashboard/css.php
@@ -13,4 +13,4 @@
#dashboard-info {
margin: 0 0 15px;
}
-}
\ No newline at end of file
+}
diff --git a/mod/dashboard/views/default/resources/dashboard.php b/mod/dashboard/views/default/resources/dashboard.php
index 624af2a270c..2631c7eae3d 100644
--- a/mod/dashboard/views/default/resources/dashboard.php
+++ b/mod/dashboard/views/default/resources/dashboard.php
@@ -20,4 +20,4 @@
'content' => $content,
]);
-echo elgg_view_page(elgg_echo('dashboard'), $body);
\ No newline at end of file
+echo elgg_view_page(elgg_echo('dashboard'), $body);
diff --git a/mod/developers/actions/developers/ajax_demo.php b/mod/developers/actions/developers/ajax_demo.php
index ecd5f4a544a..4a2627b96aa 100644
--- a/mod/developers/actions/developers/ajax_demo.php
+++ b/mod/developers/actions/developers/ajax_demo.php
@@ -17,8 +17,8 @@ function developers_ajax_demo_alter($hook, $type, Elgg\Services\AjaxResponse $v,
elgg_ajax_gatekeeper();
-$arg1 = (int)get_input('arg1');
-$arg2 = (int)get_input('arg2');
+$arg1 = (int) get_input('arg1');
+$arg2 = (int) get_input('arg2');
system_message('Hello from action');
diff --git a/mod/developers/classes/ElggLogCache.php b/mod/developers/classes/ElggLogCache.php
index 5bd4bce28ec..0abb4703f16 100644
--- a/mod/developers/classes/ElggLogCache.php
+++ b/mod/developers/classes/ElggLogCache.php
@@ -8,12 +8,12 @@ class ElggLogCache {
protected $cache;
public function __construct() {
- $this->cache = array();
+ $this->cache = [];
}
/**
* Insert into cache
- *
+ *
* @param mixed $data The log data to cache
*/
public function insert($data) {
@@ -22,10 +22,10 @@ public function insert($data) {
/**
* Insert into cache from plugin hook
- *
+ *
* @param string $hook
* @param string $type
- * @param bool $result
+ * @param bool $result
* @param array $params Must have the data at $params['msg']
*/
public function insertDump($hook, $type, $result, $params) {
diff --git a/mod/developers/languages/ca.php b/mod/developers/languages/ca.php
index b65f562c276..4b45f9f0793 100644
--- a/mod/developers/languages/ca.php
+++ b/mod/developers/languages/ca.php
@@ -1,5 +1,5 @@
'Eines',
'admin:develop_tools:sandbox' => 'Proves del tema',
@@ -79,4 +79,4 @@
// status messages
'developers:settings:success' => 'Configuracions desades',
-);
+];
diff --git a/mod/developers/languages/da.php b/mod/developers/languages/da.php
index 136f0d292cb..b84afcbb12e 100644
--- a/mod/developers/languages/da.php
+++ b/mod/developers/languages/da.php
@@ -1,5 +1,5 @@
'Værktøjer',
'admin:develop_tools:sandbox' => 'Tema Sandkasse',
@@ -63,4 +63,4 @@
// status messages
'developers:settings:success' => 'Indstillinger gemt',
-);
+];
diff --git a/mod/developers/languages/de.php b/mod/developers/languages/de.php
index dbb741c959b..7ddaace09f3 100644
--- a/mod/developers/languages/de.php
+++ b/mod/developers/languages/de.php
@@ -1,5 +1,5 @@
'Entwickler-Werkzeuge',
'admin:develop_tools:sandbox' => 'Theme-Sandbox',
@@ -90,4 +90,4 @@
'developers:settings:success' => 'Einstellungen gespeichert und Caches zurückgesetzt.',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php
index 747244149c9..1b43a289977 100644
--- a/mod/developers/languages/en.php
+++ b/mod/developers/languages/en.php
@@ -1,5 +1,5 @@
'Tools',
'admin:develop_tools:sandbox' => 'Theme Sandbox',
@@ -101,4 +101,4 @@
'developers:settings:success' => 'Settings saved and caches flushed',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/es.php b/mod/developers/languages/es.php
index 7c261ba59a7..f9d8e099689 100644
--- a/mod/developers/languages/es.php
+++ b/mod/developers/languages/es.php
@@ -1,5 +1,5 @@
'Herramientas',
'admin:develop_tools:sandbox' => 'Sanbox del Tema',
@@ -79,4 +79,4 @@
// status messages
'developers:settings:success' => 'Configuraciones almacenadas',
-);
+];
diff --git a/mod/developers/languages/eu_es.php b/mod/developers/languages/eu_es.php
index cbf13d511ba..32dd3a57174 100644
--- a/mod/developers/languages/eu_es.php
+++ b/mod/developers/languages/eu_es.php
@@ -1,5 +1,5 @@
'Tresnak',
'admin:develop_tools:sandbox' => 'Sandbox gaia',
@@ -79,4 +79,4 @@
// status messages
'developers:settings:success' => 'Ezarpenak gordeta',
-);
+];
diff --git a/mod/developers/languages/fi.php b/mod/developers/languages/fi.php
index 08a07269fc9..6b1da4104b2 100644
--- a/mod/developers/languages/fi.php
+++ b/mod/developers/languages/fi.php
@@ -1,5 +1,5 @@
'Työkalut',
'admin:develop_tools:sandbox' => 'Teemojen kehittäminen',
@@ -86,4 +86,4 @@
'developers:settings:success' => 'Asetukset tallennettu',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/fr.php b/mod/developers/languages/fr.php
index 7d345c781ad..829721c77de 100644
--- a/mod/developers/languages/fr.php
+++ b/mod/developers/languages/fr.php
@@ -1,5 +1,5 @@
'Outils',
'admin:develop_tools:sandbox' => 'Bac à sable du thème',
@@ -90,4 +90,4 @@
'developers:settings:success' => 'Paramètres enregistrés et caches vidés',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/gl.php b/mod/developers/languages/gl.php
index 19ddc6de970..fc6dbc91991 100644
--- a/mod/developers/languages/gl.php
+++ b/mod/developers/languages/gl.php
@@ -1,5 +1,5 @@
'Ferramentas',
'admin:develop_tools:sandbox' => 'Zona de probas de temas',
@@ -86,4 +86,4 @@
'developers:settings:success' => 'Gardouse a configuración.',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/it.php b/mod/developers/languages/it.php
index 1f97557487b..b805d1c49c8 100644
--- a/mod/developers/languages/it.php
+++ b/mod/developers/languages/it.php
@@ -1,5 +1,5 @@
'Strumenti',
'admin:develop_tools:sandbox' => 'Sandbox per i temi',
@@ -86,4 +86,4 @@
'developers:settings:success' => 'Impostazioni salvate e cache rinfrescata',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/ja.php b/mod/developers/languages/ja.php
index 30ab979bd35..871685366ed 100644
--- a/mod/developers/languages/ja.php
+++ b/mod/developers/languages/ja.php
@@ -1,5 +1,5 @@
'ツール',
'admin:develop_tools:sandbox' => 'テーマの見本',
@@ -89,4 +89,4 @@
'developers:settings:success' => '設定を保存しました',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/ko.php b/mod/developers/languages/ko.php
index b936ce72f73..da8ac9e7ed3 100644
--- a/mod/developers/languages/ko.php
+++ b/mod/developers/languages/ko.php
@@ -1,5 +1,5 @@
'도구',
'admin:develop_tools:sandbox' => '테마 모래상자',
@@ -63,4 +63,4 @@
// status messages
'developers:settings:success' => '설정 저장됨.',
-);
+];
diff --git a/mod/developers/languages/nl.php b/mod/developers/languages/nl.php
index 653c9dbf1ed..8d14346ff54 100644
--- a/mod/developers/languages/nl.php
+++ b/mod/developers/languages/nl.php
@@ -1,5 +1,5 @@
'Tools',
'admin:develop_tools:sandbox' => 'Theme Sandbox',
@@ -89,4 +89,4 @@
'developers:settings:success' => 'Instellingen opgeslagen',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/languages/pl.php b/mod/developers/languages/pl.php
index 530878bf46b..be8077d9a3d 100644
--- a/mod/developers/languages/pl.php
+++ b/mod/developers/languages/pl.php
@@ -1,5 +1,5 @@
'Narzędzia',
'admin:develop_tools:sandbox' => 'Piaskownica szablonu',
@@ -79,4 +79,4 @@
// status messages
'developers:settings:success' => 'Ustawienia zostały zapisane',
-);
+];
diff --git a/mod/developers/languages/pt_br.php b/mod/developers/languages/pt_br.php
index 8034f4a28b9..18a3f3995a9 100644
--- a/mod/developers/languages/pt_br.php
+++ b/mod/developers/languages/pt_br.php
@@ -1,5 +1,5 @@
'Ferramentas',
'admin:develop_tools:sandbox' => 'Temas',
@@ -78,4 +78,4 @@
// status messages
'developers:settings:success' => 'Configurações salvas',
-);
+];
diff --git a/mod/developers/languages/ru.php b/mod/developers/languages/ru.php
index a82dc21c5a9..6b8650bce14 100644
--- a/mod/developers/languages/ru.php
+++ b/mod/developers/languages/ru.php
@@ -1,5 +1,5 @@
'Инструменты',
'admin:develop_tools:sandbox' => 'Песочница Темы',
@@ -63,4 +63,4 @@
// status messages
'developers:settings:success' => 'Настройки сохранены',
-);
+];
diff --git a/mod/developers/languages/zh_hans.php b/mod/developers/languages/zh_hans.php
index 869d82c23e5..535919bfd2d 100644
--- a/mod/developers/languages/zh_hans.php
+++ b/mod/developers/languages/zh_hans.php
@@ -1,5 +1,5 @@
'工具',
'admin:develop_tools:sandbox' => '主题测试盒',
@@ -86,4 +86,4 @@
'developers:settings:success' => '设置已保存,缓存已更新。',
'developers:amd' => 'AMD',
-);
+];
diff --git a/mod/developers/start.php b/mod/developers/start.php
index 3ed6d3df908..4a1e8330852 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -32,7 +32,7 @@ function developers_init() {
function developers_process_settings() {
$settings = elgg_get_plugin_from_id('developers')->getAllSettings();
- ini_set('display_errors', (int)!empty($settings['display_errors']));
+ ini_set('display_errors', (int) !empty($settings['display_errors']));
if (!empty($settings['screen_log'])) {
// don't show in action/simplecache
@@ -40,7 +40,7 @@ function developers_process_settings() {
if (!preg_match('~^(cache|action)/~', $path)) {
$cache = new ElggLogCache();
elgg_set_config('log_cache', $cache);
- elgg_register_plugin_hook_handler('debug', 'log', array($cache, 'insertDump'));
+ elgg_register_plugin_hook_handler('debug', 'log', [$cache, 'insertDump']);
elgg_register_plugin_hook_handler('view_vars', 'page/elements/html', function($hook, $type, $vars, $params) {
$vars['body'] .= elgg_view('developers/log');
return $vars;
@@ -193,17 +193,17 @@ function developers_wrap_views($hook, $type, $result, $params) {
return;
}
- $excluded_bases = array('resources', 'input', 'output', 'embed', 'icon', 'json', 'xml');
+ $excluded_bases = ['resources', 'input', 'output', 'embed', 'icon', 'json', 'xml'];
- $excluded_views = array(
+ $excluded_views = [
'page/default',
'page/admin',
'page/elements/head',
- );
+ ];
$view = $params['view'];
- $view_hierarchy = explode('/',$view);
+ $view_hierarchy = explode('/', $view);
if (in_array($view_hierarchy[0], $excluded_bases)) {
return;
}
@@ -260,12 +260,12 @@ function developers_log_events($name, $type) {
$function = $stack[$index]['file'];
}
- $msg = elgg_echo('developers:event_log_msg', array(
+ $msg = elgg_echo('developers:event_log_msg', [
$event_type,
$name,
$type,
$function,
- ));
+ ]);
elgg_dump($msg, false);
unset($stack);
@@ -299,7 +299,7 @@ function developers_ajax_demo_controller() {
* @return array
*/
function developers_get_inspect_options() {
- $options = array(
+ $options = [
'Actions' => elgg_echo('developers:inspect:actions'),
'Events' => elgg_echo('developers:inspect:events'),
'Menus' => elgg_echo('developers:inspect:menus'),
@@ -307,7 +307,7 @@ function developers_get_inspect_options() {
'Simple Cache' => elgg_echo('developers:inspect:simplecache'),
'Views' => elgg_echo('developers:inspect:views'),
'Widgets' => elgg_echo('developers:inspect:widgets'),
- );
+ ];
if (elgg_is_active_plugin('web_services')) {
$options['Web Services'] = elgg_echo('developers:inspect:webservices');
diff --git a/mod/developers/views/default/admin/develop_tools/entity_explorer.php b/mod/developers/views/default/admin/develop_tools/entity_explorer.php
index 7c21a7cc29b..b237f5bd5d4 100644
--- a/mod/developers/views/default/admin/develop_tools/entity_explorer.php
+++ b/mod/developers/views/default/admin/develop_tools/entity_explorer.php
@@ -39,4 +39,4 @@
'href' => 'action/developers/entity_explorer_delete?guid=' . $entity->guid . '&type=entity&key=' . $entity->guid,
'confirm' => true,
'class' => 'elgg-button elgg-button-submit',
-]);
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/admin/develop_tools/entity_explorer/attributes.php b/mod/developers/views/default/admin/develop_tools/entity_explorer/attributes.php
index 28e9d05c0a5..cf0454aa049 100644
--- a/mod/developers/views/default/admin/develop_tools/entity_explorer/attributes.php
+++ b/mod/developers/views/default/admin/develop_tools/entity_explorer/attributes.php
@@ -18,7 +18,6 @@
$entity_info = '';
foreach ($entity_rows as $entity_row) {
-
$value = elgg_view('output/text', ['value' => $entity->$entity_row]);
$entity_info .= '';
diff --git a/mod/developers/views/default/admin/develop_tools/entity_explorer/private_settings.php b/mod/developers/views/default/admin/develop_tools/entity_explorer/private_settings.php
index 16a116dc305..e640cf978e2 100644
--- a/mod/developers/views/default/admin/develop_tools/entity_explorer/private_settings.php
+++ b/mod/developers/views/default/admin/develop_tools/entity_explorer/private_settings.php
@@ -12,7 +12,6 @@
$private_settings_info .= ' ';
foreach ($private_settings as $key => $value) {
-
$key_val = elgg_view('output/text', ['value' => $key]);
$value = elgg_view('output/text', ['value' => $value]);
diff --git a/mod/developers/views/default/admin/develop_tools/inspect.php b/mod/developers/views/default/admin/develop_tools/inspect.php
index b53aff56879..f25303f5d30 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect.php
@@ -24,17 +24,17 @@
}
$data = $inspector->getViews($viewtype);
- $page = elgg_view($view_name, array(
+ $page = elgg_view($view_name, [
"data" => $data,
"viewtypes" => $viewtypes,
"viewtype" => $viewtype,
- ));
+ ]);
break;
default:
$data = $inspector->$method();
- $page = elgg_view($view_name, array(
+ $page = elgg_view($view_name, [
"data" => $data,
- ));
+ ]);
break;
}
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/events.php b/mod/developers/views/default/admin/develop_tools/inspect/events.php
index a5fba2ecc58..b54bc7aef57 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/events.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/events.php
@@ -38,4 +38,4 @@
}
}
-echo "
";
\ No newline at end of file
+echo "";
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/menus.php b/mod/developers/views/default/admin/develop_tools/inspect/menus.php
index 3cb7f6c6c10..c5fcbf1e4bb 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/menus.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/menus.php
@@ -7,7 +7,6 @@
}
foreach ($data as $key => $arr) {
-
$menu = "";
foreach ($arr as $subkey => $value) {
@@ -25,5 +24,4 @@
$menu .= "
";
echo elgg_view_module("inline", $key, $menu);
-
}
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/pluginhooks.php b/mod/developers/views/default/admin/develop_tools/inspect/pluginhooks.php
index 660348fa598..2cb5863562f 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/pluginhooks.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/pluginhooks.php
@@ -1,6 +1,6 @@
elgg_extract("data", $vars),
'header' => elgg_echo('developers:inspect:pluginhooks'),
-));
+]);
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/simplecache.php b/mod/developers/views/default/admin/develop_tools/inspect/simplecache.php
index fecf7a0ed2a..3775f0b6b9f 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/simplecache.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/simplecache.php
@@ -13,9 +13,9 @@
foreach ($data as $view => $arr) {
echo "";
- echo elgg_view('admin/develop_tools/inspect/views/view_link', array(
+ echo elgg_view('admin/develop_tools/inspect/views/view_link', [
'view' => $view,
- ));
+ ]);
echo " ";
}
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/views.php b/mod/developers/views/default/admin/develop_tools/inspect/views.php
index dcccfb44947..af266c1cb6b 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/views.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/views.php
@@ -8,7 +8,7 @@
$views = elgg_extract('views', $data);
$global_hooks = elgg_extract('global_hooks', $data);
$filtered_views = elgg_extract('filtered_views', $data);
-$input_filtered_views = (array)elgg_extract('input_filtered_views', $data);
+$input_filtered_views = (array) elgg_extract('input_filtered_views', $data);
$root = elgg_get_root_path();
$strip = function ($file) use ($root) {
@@ -26,16 +26,16 @@
if ($type !== "default") {
$href .= "&type={$type}";
}
- elgg_register_menu_item('developers_inspect_viewtype', array(
+ elgg_register_menu_item('developers_inspect_viewtype', [
'name' => $type,
'text' => $type,
'href' => $href,
- ));
+ ]);
}
-echo elgg_view_menu('developers_inspect_viewtype', array(
+echo elgg_view_menu('developers_inspect_viewtype', [
'class' => 'elgg-tabs mbm',
-));
+]);
if ($global_hooks) {
array_walk($global_hooks, function (&$hook) {
@@ -69,7 +69,7 @@
$rowspan += 1;
$id = "z" . md5("view_vars, $view");
$link = "view_vars, $view ";
- $col2 = elgg_echo('developers:inspect:views:input_filtered', array($link));
+ $col2 = elgg_echo('developers:inspect:views:input_filtered', [$link]);
$extra_rows .= " $col2 ";
}
@@ -78,7 +78,7 @@
$rowspan += 1;
$id = "z" . md5("view, $view");
$link = "view, $view ";
- $col2 = elgg_echo('developers:inspect:views:filtered', array($link));
+ $col2 = elgg_echo('developers:inspect:views:filtered', [$link]);
$extra_rows .= " $col2 ";
}
@@ -98,10 +98,10 @@
} elseif ($priority != 500) {
$href = $make_id($component->view);
echo "$priority ";
- $link = elgg_view('admin/develop_tools/inspect/views/view_link', array(
+ $link = elgg_view('admin/develop_tools/inspect/views/view_link', [
'view' => $component->view,
'text' => $file,
- ));
+ ]);
echo "$link ";
} else {
echo "$priority ";
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/views/view_link.php b/mod/developers/views/default/admin/develop_tools/inspect/views/view_link.php
index 80cbedb0151..2619cbd0efd 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/views/view_link.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/views/view_link.php
@@ -10,12 +10,12 @@
if (get_input('inspect_type')) {
// don't lose the viewtype
- $href = elgg_http_add_url_query_elements($href, array(
+ $href = elgg_http_add_url_query_elements($href, [
'type' => get_input('type')
- ));
+ ]);
}
-echo elgg_view('output/url', array(
+echo elgg_view('output/url', [
'href' => $href,
'text' => $text,
-));
+]);
diff --git a/mod/developers/views/default/admin/develop_tools/inspect/widgets.php b/mod/developers/views/default/admin/develop_tools/inspect/widgets.php
index c6f160f82c1..50266568d07 100644
--- a/mod/developers/views/default/admin/develop_tools/inspect/widgets.php
+++ b/mod/developers/views/default/admin/develop_tools/inspect/widgets.php
@@ -15,10 +15,10 @@
foreach ($data as $name => $arr) {
$view = "widgets/$name/content";
- $link = elgg_view('admin/develop_tools/inspect/views/view_link', array(
+ $link = elgg_view('admin/develop_tools/inspect/views/view_link', [
'view' => $view,
'text' => $name,
- ));
+ ]);
echo "";
echo "$link ";
diff --git a/mod/developers/views/default/admin/develop_tools/sandbox.php b/mod/developers/views/default/admin/develop_tools/sandbox.php
index 701004cbd75..c7086e1bb14 100644
--- a/mod/developers/views/default/admin/develop_tools/sandbox.php
+++ b/mod/developers/views/default/admin/develop_tools/sandbox.php
@@ -5,4 +5,4 @@
$url = elgg_get_site_url() . 'theme_sandbox/intro';
?>
-
\ No newline at end of file
+
diff --git a/mod/developers/views/default/admin/develop_tools/unit_tests.php b/mod/developers/views/default/admin/develop_tools/unit_tests.php
index 81658e88b66..1d7b03e5a37 100644
--- a/mod/developers/views/default/admin/develop_tools/unit_tests.php
+++ b/mod/developers/views/default/admin/develop_tools/unit_tests.php
@@ -1,17 +1,17 @@
' . elgg_echo('developers:unit_tests:description') . '';
echo '' . elgg_echo('developers:unit_tests:warning') . '
';
// create a button to run tests
-$params = array(
+$params = [
'text' => elgg_echo('developers:unit_tests:run'),
'href' => 'engine/tests/suite.php',
'class' => 'elgg-button elgg-button-submit',
'is_trusted' => true,
-);
+];
echo '' . elgg_view('output/url', $params) . '
';
diff --git a/mod/developers/views/default/admin/developers/settings.php b/mod/developers/views/default/admin/developers/settings.php
index f1f4a081f4a..1e71893722d 100644
--- a/mod/developers/views/default/admin/developers/settings.php
+++ b/mod/developers/views/default/admin/developers/settings.php
@@ -3,84 +3,84 @@
* Developer settings
*/
-$data = array(
- 'simple_cache' => array(
+$data = [
+ 'simple_cache' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_config('simplecache_enabled') == 1,
'readonly' => $GLOBALS['_ELGG']->simplecache_enabled_in_settings,
- ),
+ ],
- 'system_cache' => array(
+ 'system_cache' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_is_system_cache_enabled(),
'readonly' => false,
- ),
+ ],
- 'display_errors' => array(
+ 'display_errors' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('display_errors', 'developers') == 1,
'readonly' => false,
- ),
+ ],
- 'debug_level' => array(
+ 'debug_level' => [
'type' => 'dropdown',
'value' => elgg_get_config('debug'),
- 'options_values' => array(
+ 'options_values' => [
false => elgg_echo('developers:debug:off'),
'ERROR' => elgg_echo('developers:debug:error'),
'WARNING' => elgg_echo('developers:debug:warning'),
'NOTICE' => elgg_echo('developers:debug:notice'),
'INFO' => elgg_echo('developers:debug:info'),
- ),
+ ],
'readonly' => false,
- ),
+ ],
- 'screen_log' => array(
+ 'screen_log' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('screen_log', 'developers') == 1,
'readonly' => false,
- ),
+ ],
- 'show_strings' => array(
+ 'show_strings' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('show_strings', 'developers') == 1,
'readonly' => false,
- ),
+ ],
- 'show_modules' => array(
+ 'show_modules' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('show_modules', 'developers') == 1,
'readonly' => false,
- ),
+ ],
- 'wrap_views' => array(
+ 'wrap_views' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('wrap_views', 'developers') == 1,
'readonly' => false,
- ),
+ ],
- 'log_events' => array(
+ 'log_events' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('log_events', 'developers') == 1,
'readonly' => false,
- ),
+ ],
- 'show_gear' => array(
+ 'show_gear' => [
'type' => 'checkbox',
'value' => 1,
'checked' => elgg_get_plugin_setting('show_gear', 'developers') == 1,
'readonly' => false,
- ),
-);
+ ],
+];
-$form_vars = array('id' => 'developer-settings-form', 'class' => 'elgg-form-settings');
-$body_vars = array('data' => $data);
+$form_vars = ['id' => 'developer-settings-form', 'class' => 'elgg-form-settings'];
+$body_vars = ['data' => $data];
echo elgg_view_form('developers/settings', $form_vars, $body_vars);
diff --git a/mod/developers/views/default/developers/ajax.php b/mod/developers/views/default/developers/ajax.php
index 3008868e6b7..deb3f8024b9 100644
--- a/mod/developers/views/default/developers/ajax.php
+++ b/mod/developers/views/default/developers/ajax.php
@@ -12,8 +12,8 @@
]);
echo '';
-echo elgg_view_module('aside', 'Lightbox Test', $ipsum, array(
+echo elgg_view_module('aside', 'Lightbox Test', $ipsum, [
'id' => 'elgg-lightbox-test',
'footer' => $resize_button,
-));
+]);
echo '
';
diff --git a/mod/developers/views/default/developers/ajax_demo.js b/mod/developers/views/default/developers/ajax_demo.js
index ab29c364dce..4b3994b7c66 100644
--- a/mod/developers/views/default/developers/ajax_demo.js
+++ b/mod/developers/views/default/developers/ajax_demo.js
@@ -91,4 +91,4 @@ define(function(require) {
alert('Success!');
});
-});
\ No newline at end of file
+});
diff --git a/mod/developers/views/default/developers/css.php b/mod/developers/views/default/developers/css.php
index 281baf6d983..b3b0452831e 100644
--- a/mod/developers/views/default/developers/css.php
+++ b/mod/developers/views/default/developers/css.php
@@ -72,4 +72,4 @@
.developers-gear-popup #developer-settings-form .elgg-foot {
margin-top: 15px;
margin-bottom: 0;
-}
\ No newline at end of file
+}
diff --git a/mod/developers/views/default/developers/ipsum.php b/mod/developers/views/default/developers/ipsum.php
index dd9bb278f2f..a73534c8a8b 100644
--- a/mod/developers/views/default/developers/ipsum.php
+++ b/mod/developers/views/default/developers/ipsum.php
@@ -4,4 +4,4 @@
*/
?>
Sed scelerisque sagittis lorem. Phasellus sodales.
-Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.
\ No newline at end of file
+Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus.
diff --git a/mod/developers/views/default/developers/log.php b/mod/developers/views/default/developers/log.php
index ee604e685c2..32e856e8cc4 100644
--- a/mod/developers/views/default/developers/log.php
+++ b/mod/developers/views/default/developers/log.php
@@ -9,7 +9,7 @@
// stop collecting messages
elgg_unregister_plugin_hook_handler('debug', 'log', [$cache, 'insertDump']);
-$pres = array();
+$pres = [];
if ($items) {
foreach ($items as $item) {
$pres[] = '' . print_r($item, true) . ' ';
diff --git a/mod/developers/views/default/elgg/dev/amd_monitor.js b/mod/developers/views/default/elgg/dev/amd_monitor.js
index 9e664b442cd..fe94edfa281 100644
--- a/mod/developers/views/default/elgg/dev/amd_monitor.js
+++ b/mod/developers/views/default/elgg/dev/amd_monitor.js
@@ -27,3 +27,4 @@
update();
});
}();
+
diff --git a/mod/developers/views/default/elgg/dev/gear.js b/mod/developers/views/default/elgg/dev/gear.js
index a6d17ebb248..f26365cbb4b 100644
--- a/mod/developers/views/default/elgg/dev/gear.js
+++ b/mod/developers/views/default/elgg/dev/gear.js
@@ -51,3 +51,4 @@ define(function (require) {
spinner.start();
});
});
+
diff --git a/mod/developers/views/default/elgg/dev/theme_sandbox.js b/mod/developers/views/default/elgg/dev/theme_sandbox.js
index 5fc0f0b286c..e8af9c954cb 100644
--- a/mod/developers/views/default/elgg/dev/theme_sandbox.js
+++ b/mod/developers/views/default/elgg/dev/theme_sandbox.js
@@ -16,3 +16,4 @@ define(function (require) {
elgg.register_error('Elgg Error Message');
});
});
+
diff --git a/mod/developers/views/default/forms/developers/entity_explorer.php b/mod/developers/views/default/forms/developers/entity_explorer.php
index ccacbc9de3b..975c43c4b13 100644
--- a/mod/developers/views/default/forms/developers/entity_explorer.php
+++ b/mod/developers/views/default/forms/developers/entity_explorer.php
@@ -11,4 +11,4 @@
'value' => elgg_echo('submit'),
]);
-elgg_set_form_footer($footer);
\ No newline at end of file
+elgg_set_form_footer($footer);
diff --git a/mod/developers/views/default/forms/developers/settings.php b/mod/developers/views/default/forms/developers/settings.php
index f9f9f8b20d3..927ecaf0385 100644
--- a/mod/developers/views/default/forms/developers/settings.php
+++ b/mod/developers/views/default/forms/developers/settings.php
@@ -17,21 +17,21 @@
echo '';
if ($info['type'] == 'checkbox') {
echo $label;
- echo elgg_view("input/checkbox", array(
+ echo elgg_view("input/checkbox", [
'name' => $name,
'value' => $info['value'],
'checked' => $info['checked'],
'class' => $class,
- ));
+ ]);
echo ' ' . elgg_echo("developers:label:$name", $echo_vars) . '';
} else {
echo $label . elgg_echo("developers:label:$name") . ' ';
- echo elgg_view("input/{$info['type']}", array(
+ echo elgg_view("input/{$info['type']}", [
'name' => $name,
'value' => $info['value'],
'options_values' => $info['options_values'],
'class' => $class,
- ));
+ ]);
echo '';
}
echo '
' . elgg_echo("developers:help:$name") . ' ';
@@ -42,5 +42,5 @@
}
echo '';
diff --git a/mod/developers/views/default/page/layouts/theme_sandbox.php b/mod/developers/views/default/page/layouts/theme_sandbox.php
index 72b9fe23dbe..22ad878739f 100644
--- a/mod/developers/views/default/page/layouts/theme_sandbox.php
+++ b/mod/developers/views/default/page/layouts/theme_sandbox.php
@@ -6,10 +6,10 @@
* @uses $vars['content']
*/
-$title = elgg_view_title($vars['title'], array('class' => 'theme-sandbox-page-heading'));
+$title = elgg_view_title($vars['title'], ['class' => 'theme-sandbox-page-heading']);
$content = elgg_extract('content', $vars);
-$sidebar_menu = elgg_view_menu('theme_sandbox', array('sort_by' => 'name'));
+$sidebar_menu = elgg_view_menu('theme_sandbox', ['sort_by' => 'name']);
$sidebar = elgg_view_module('theme-sandbox-nav', 'Sections', $sidebar_menu);
echo << $vars['sysmessages']));
+$messages = elgg_view('page/elements/messages', ['object' => $vars['sysmessages']]);
$content = elgg_view('page/elements/body', $vars);
-$title_link = elgg_view('output/url', array(
+$title_link = elgg_view('output/url', [
'text' => 'Theme Sandbox',
'href' => 'theme_preview/intro',
'is_trusted' => true,
-));
+]);
$header = "
$title_link ";
if (get_input("site_menu", false)) {
@@ -45,4 +45,4 @@
$head = elgg_view('page/elements/head', $vars);
-echo elgg_view("page/elements/html", array("head" => $head, "body" => $body));
+echo elgg_view("page/elements/html", ["head" => $head, "body" => $body]);
diff --git a/mod/developers/views/default/resources/theme_sandbox.php b/mod/developers/views/default/resources/theme_sandbox.php
index ca00ff2e60c..3531cbc14b3 100644
--- a/mod/developers/views/default/resources/theme_sandbox.php
+++ b/mod/developers/views/default/resources/theme_sandbox.php
@@ -3,7 +3,7 @@
$page = elgg_extract('page', $vars);
elgg_load_css('dev.theme_sandbox');
-$pages = array(
+$pages = [
'buttons',
'components',
'forms',
@@ -14,14 +14,14 @@
'modules',
'navigation',
'typography',
-);
+];
foreach ($pages as $page_name) {
- elgg_register_menu_item('theme_sandbox', array(
+ elgg_register_menu_item('theme_sandbox', [
'name' => $page_name,
'text' => elgg_echo("theme_sandbox:$page_name"),
'href' => "theme_sandbox/$page_name",
- ));
+ ]);
}
elgg_require_js('elgg/dev/theme_sandbox');
@@ -29,9 +29,9 @@
$title = elgg_echo("theme_sandbox:{$page}");
$body = elgg_view("theme_sandbox/{$page}");
-$layout = elgg_view_layout('theme_sandbox', array(
+$layout = elgg_view_layout('theme_sandbox', [
'title' => $title,
'content' => $body,
-));
+]);
echo elgg_view_page("Theme Sandbox : $title", $layout, 'theme_sandbox');
diff --git a/mod/developers/views/default/theme_sandbox.css b/mod/developers/views/default/theme_sandbox.css
index c2422efa75d..4f8819ee222 100644
--- a/mod/developers/views/default/theme_sandbox.css
+++ b/mod/developers/views/default/theme_sandbox.css
@@ -149,4 +149,4 @@
/* specific to core theme for site navigation menu */
.elgg-body > .elgg-page-header > .elgg-inner > .elgg-menu-site-default {
position: static;
-}
\ No newline at end of file
+}
diff --git a/mod/developers/views/default/theme_sandbox/components.php b/mod/developers/views/default/theme_sandbox/components.php
index 1d98302c8af..70d6f5ed77d 100644
--- a/mod/developers/views/default/theme_sandbox/components.php
+++ b/mod/developers/views/default/theme_sandbox/components.php
@@ -18,10 +18,10 @@
$body = elgg_view('theme_sandbox/components/full_listing');
echo elgg_view_module('theme-sandbox-demo', 'Full Listing (object/elements/full)', $body);
-$body = elgg_view('theme_sandbox/components/table', array('class' => 'elgg-table'));
+$body = elgg_view('theme_sandbox/components/table', ['class' => 'elgg-table']);
echo elgg_view_module('theme-sandbox-demo', 'Table (.elgg-table)', $body);
-$body = elgg_view('theme_sandbox/components/table', array('class' => 'elgg-table-alt'));
+$body = elgg_view('theme_sandbox/components/table', ['class' => 'elgg-table-alt']);
echo elgg_view_module('theme-sandbox-demo', 'Table Alternate (.elgg-table-alt)', $body);
$body = elgg_view('theme_sandbox/components/tags');
diff --git a/mod/developers/views/default/theme_sandbox/components/full_listing.php b/mod/developers/views/default/theme_sandbox/components/full_listing.php
index 28b5cf92329..124ac9cdea6 100644
--- a/mod/developers/views/default/theme_sandbox/components/full_listing.php
+++ b/mod/developers/views/default/theme_sandbox/components/full_listing.php
@@ -28,4 +28,4 @@
'value' => $object->description,
]),
'class' => 'theme-sandbox-full-listing',
-]);
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/theme_sandbox/components/list.php b/mod/developers/views/default/theme_sandbox/components/list.php
index f68d25b0621..60ca8dc7bc0 100644
--- a/mod/developers/views/default/theme_sandbox/components/list.php
+++ b/mod/developers/views/default/theme_sandbox/components/list.php
@@ -21,4 +21,4 @@
$obj4->title = "Object 4";
$obj4->description = $ipsum;
-echo elgg_view('page/components/list', array('items' => array($obj1, $obj2, $obj3, $obj4)));
+echo elgg_view('page/components/list', ['items' => [$obj1, $obj2, $obj3, $obj4]]);
diff --git a/mod/developers/views/default/theme_sandbox/components/summary_listing.php b/mod/developers/views/default/theme_sandbox/components/summary_listing.php
index f490bf3638f..26571510ae3 100644
--- a/mod/developers/views/default/theme_sandbox/components/summary_listing.php
+++ b/mod/developers/views/default/theme_sandbox/components/summary_listing.php
@@ -20,4 +20,4 @@
]),
'content' => elgg_get_excerpt($object->description),
'icon' => $icon,
-]);
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/theme_sandbox/components/table.php b/mod/developers/views/default/theme_sandbox/components/table.php
index 7d619dcea45..634c8d6a70f 100644
--- a/mod/developers/views/default/theme_sandbox/components/table.php
+++ b/mod/developers/views/default/theme_sandbox/components/table.php
@@ -1,12 +1,12 @@
column 1 column 2 ";
- for ($i = 1; $i < 5; $i++) {
- echo '';
- for ($j = 1; $j < 3; $j++) {
- echo "value $j ";
- }
- echo ' ';
+for ($i = 1; $i < 5; $i++) {
+ echo '';
+ for ($j = 1; $j < 3; $j++) {
+ echo "value $j ";
}
+ echo ' ';
+}
?>
-
\ No newline at end of file
+
diff --git a/mod/developers/views/default/theme_sandbox/components/tags.php b/mod/developers/views/default/theme_sandbox/components/tags.php
index 04df9511a5c..d8a54314251 100644
--- a/mod/developers/views/default/theme_sandbox/components/tags.php
+++ b/mod/developers/views/default/theme_sandbox/components/tags.php
@@ -1,5 +1,5 @@
array('one', 'two', 'three', 'four', 'cinco'),
-));
+echo elgg_view('output/tags', [
+ 'value' => ['one', 'two', 'three', 'four', 'cinco'],
+]);
diff --git a/mod/developers/views/default/theme_sandbox/forms.php b/mod/developers/views/default/theme_sandbox/forms.php
index 0620bf2ea7d..6ce92fcf574 100644
--- a/mod/developers/views/default/theme_sandbox/forms.php
+++ b/mod/developers/views/default/theme_sandbox/forms.php
@@ -4,7 +4,7 @@
Fieldset Legend
'text',
'required' => true,
'name' => 'f1',
@@ -12,28 +12,28 @@
'value' => 'input text',
'#label' => 'Text input (.elgg-input-text):',
'#help' => 'This is how help text looks',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'password',
'name' => 'f2',
'id' => 'f2',
'value' => 'password',
'#label' => 'Password input (.elgg-input-password):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'radio',
'name' => 'f3',
'id' => 'f3',
- 'options' => array(
+ 'options' => [
'a (.elgg-input-radio)' => 1,
'b (.elgg-input-radio)' => 2
- ),
+ ],
'#label' => 'Radio input (.elgg-input-radios):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'checkbox',
'name' => 'f4s',
'id' => 'f4s',
@@ -42,9 +42,9 @@
'required' => true,
'label' => 'a (.elgg-input-checkbox)',
'#help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox (only label)',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'checkbox',
'name' => 'f4s',
'id' => 'f4s',
@@ -53,8 +53,8 @@
'required' => true,
'#label' => 'a (.elgg-input-checkbox)',
'#help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox (only #label)',
- ));
- echo elgg_view_field(array(
+ ]);
+ echo elgg_view_field([
'#type' => 'checkbox',
'name' => 'f4s1',
'id' => 'f4s1',
@@ -64,9 +64,9 @@
'required' => true,
'#label' => 'a (.elgg-input-checkbox) with switch style',
'#help' => 'Single checkbox .elgg-input-checkbox ',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'checkbox',
'name' => 'f4s2',
'id' => 'f4s2',
@@ -76,9 +76,9 @@
'#label' => 'a (.elgg-input-checkbox) - Field label',
'label' => 'a (.elgg-input-checkbox) - Input label',
'#help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox (label and #label)',
- ));
+ ]);
- echo elgg_view_input('checkbox', array(
+ echo elgg_view_input('checkbox', [
'name' => 'f4s3',
'id' => 'f4s3',
'value' => 1,
@@ -86,187 +86,187 @@
'required' => true,
'label' => 'a (.elgg-input-checkbox)',
'help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox using elgg_view_input',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'checkboxes',
'name' => 'f4',
'id' => 'f4',
- 'options' => array(
+ 'options' => [
'a (.elgg-input-checkbox)' => 1,
'b (.elgg-input-checkbox)' => 2
- ),
+ ],
'#label' => 'Checkboxes input (.elgg-input-checkboxes):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'checkboxes',
'name' => 'f4a',
'id' => 'f4a',
'switch' => true,
- 'options' => array(
+ 'options' => [
'a (.elgg-input-checkbox)' => 1,
'b (.elgg-input-checkbox)' => 2
- ),
+ ],
'#label' => 'Checkboxes input (.elgg-input-checkboxes) with switch style:',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'select',
'name' => 'f5',
'id' => 'f5',
- 'options' => array(
+ 'options' => [
'option 1',
'option 2',
[
'text' => 'disabled',
'disabled' => true,
- ],
- ),
+ ],
+ ],
'#label' => 'Select input (dropdown) (.elgg-input-dropdown) with a disabled option:',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'select',
'name' => 'f51[]',
'id' => 'f51',
- 'options_values' => array('value 1' => 'option 1', 'value 2' => 'option 2', 'value 3' => 'option 3'),
+ 'options_values' => ['value 1' => 'option 1', 'value 2' => 'option 2', 'value 3' => 'option 3'],
'multiple' => true,
'#label' => 'Select input (multiselect) (.elgg-input-dropdown):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'access',
'name' => 'f6',
'id' => 'f6',
'value' => ACCESS_PUBLIC,
'#label' => 'Access input (.elgg-input-access):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'file',
'name' => 'f7',
'id' => 'f7',
'#label' => 'File input (.elgg-input-file):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'url',
'name' => 'f8',
'id' => 'f8',
'value' => 'http://elgg.org/',
'#label' => 'URL input (.elgg-input-url):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'tags',
'name' => 'f9',
'id' => 'f9',
'value' => 'one, two, three',
'#label' => 'Tags input (.elgg-input-tags):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'email',
'name' => 'f10',
'id' => 'f10',
'value' => 'noone@elgg.org',
'#label' => 'Email input (.elgg-input-email):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'autocomplete',
'name' => 'f11',
'id' => 'f11',
- 'match_on' => array('groups', 'friends'),
+ 'match_on' => ['groups', 'friends'],
'#label' => 'Autocomplete input (.elgg-input-autocomplete):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'date',
'name' => 'f12',
'id' => 'f12',
'value' => '2012-12-31',
'#label' => 'Date input (.elgg-input-date):',
- ));
+ ]);
$year = date('Y');
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'date',
'name' => 'f12-custom',
'id' => 'f12-custom',
'value' => "$year/02/01",
'timestamp' => true,
- 'datepicker_options' => array(
+ 'datepicker_options' => [
'dateFormat' => 'yy/mm/dd',
'changeMonth' => false,
'changeYear' => false,
'minDate' => "$year/01/15",
'maxDate' => "$year/02/15",
- ),
+ ],
'#label' => 'Date input (.elgg-input-date) with custom options:',
'#help' => 'Select a date from 15 Jan to 15 Feb',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'userpicker',
'name' => 'f13',
'id' => 'f13',
'#label' => 'User picker input (.elgg-user-picker):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'userpicker',
'name' => 'f16',
'id' => 'f16',
'limit' => 1,
'#label' => 'User picker input (with max 1 results) (.elgg-user-picker):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'plaintext',
'name' => 'f15',
'id' => 'f15',
'value' => $ipsum,
'#label' => 'Plain textarea input (.elgg-input-plaintext):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'longtext',
'name' => 'f14',
'id' => 'f14',
'value' => $ipsum,
'#label' => 'Long textarea input (.elgg-input-longtext):',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'longtext',
'name' => 'f14a',
'id' => 'f14a',
'value' => $ipsum,
'editor' => false,
'#label' => 'Long textarea input (.elgg-input-longtext) with a disabled editor:',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'longtext',
'name' => 'f14b',
'id' => 'f14b',
'value' => $ipsum,
'visual' => false,
'#label' => 'Long textarea input (.elgg-input-longtext) without a visual editor activated by default:',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'longtext',
'name' => 'f14c',
'id' => 'f14c',
'value' => $ipsum,
'editor_type' => 'simple',
'#label' => 'Long textarea input (.elgg-input-longtext) with the editor_type configured as "simple":',
- ));
+ ]);
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'number',
'name' => 'f15',
'id' => 'f15',
@@ -275,16 +275,16 @@
'step' => 1,
'#label' => 'Number input (.elgg-input-number) with custom options:',
'#help' => 'Enter an integer number larger than zero',
- ));
+ ]);
$dt = new \DateTime(null, new \DateTimeZone('UTC'));
- $hour_options = array();
+ $hour_options = [];
$hour_options_ts = range(0, 24 * 60 * 60, 900); // step of 15 minutes
foreach ($hour_options_ts as $ts) {
$hour_options[$ts] = $dt->setTimestamp($ts)->format('g:ia');
}
- echo elgg_view_field(array(
+ echo elgg_view_field([
'#type' => 'fieldset',
'name' => 'f16',
'legend' => 'Fieldset with a legend',
@@ -293,7 +293,7 @@
'#type' => 'text',
'#label' => 'Text field',
'required' => true,
- ],
+ ],
[
'#type' => 'fieldset',
'#label' => 'Date and time fieldset',
@@ -304,15 +304,15 @@
'value' => time(),
'timestamp' => true,
'#label' => 'Date',
- ],
+ ],
[
'#type' => 'select',
'#label' => 'Time',
'options' => $hour_options,
- ],
+ ],
+ ],
],
- ],
- [
+ [
'#type' => 'fieldset',
'#label' => 'Nested fieldset',
'#help' => 'Fieldset with horizontal alignment of fields',
@@ -329,17 +329,17 @@
'text' => 'Download',
'icon' => 'download',
'class' => 'elgg-button-action',
- ],
+ ],
[
'#type' => 'button',
'type' => 'reset',
'text' => 'Cancel',
'icon' => 'remove',
- ],
+ ],
+ ],
],
- ],
]
- ));
+ ]);
?>
diff --git a/mod/developers/views/default/theme_sandbox/grid.php b/mod/developers/views/default/theme_sandbox/grid.php
index b43c32ddf32..afa0fcaa466 100644
--- a/mod/developers/views/default/theme_sandbox/grid.php
+++ b/mod/developers/views/default/theme_sandbox/grid.php
@@ -6,32 +6,32 @@
$filler = "
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\n";
// build list of units (denominators are keys, values are arrays of nominators)
-$units = array(1 => array(1),);
+$units = [1 => [1],];
// keep map to avoid duplicates. keys are rounded to thousands (avoid float issues)
-$percentages = array(
- '100' => array(1, 1),
-);
+$percentages = [
+ '100' => [1, 1],
+];
for ($den = 2; $den <= 6; $den++) {
for ($num = 1; $num < $den; $num++) {
// avoid duplicates
- $rounded_percentage = (string)round($num / $den, 3);
+ $rounded_percentage = (string) round($num / $den, 3);
if ($num > 1 && isset($percentages[$rounded_percentage])) {
continue;
}
- $percentages[$rounded_percentage] = array($num, $den);
+ $percentages[$rounded_percentage] = [$num, $den];
$units[$den][] = $num;
}
}
// build rows
-$rows = array();
+$rows = [];
$total = 0;
for ($den = 1; $den <= count($units); $den++) {
// may take multiple rows to use up available units
while ($units[$den]) {
- $row = array();
+ $row = [];
$nom = array_shift($units[$den]);
$row[] = "$nom/$den";
$total += $nom;
@@ -53,9 +53,9 @@
6 Column Grid
-
+
- ', $class);
?>
diff --git a/mod/developers/views/default/theme_sandbox/icons/avatars.php b/mod/developers/views/default/theme_sandbox/icons/avatars.php
index e3e7fd707a6..6efb889fd5f 100644
--- a/mod/developers/views/default/theme_sandbox/icons/avatars.php
+++ b/mod/developers/views/default/theme_sandbox/icons/avatars.php
@@ -2,35 +2,35 @@
$user = new ElggUser();
$group = new ElggGroup();
- $sizes = array('large', 'medium', 'small', 'tiny');
+ $sizes = ['large', 'medium', 'small', 'tiny'];
?>
$size";
- }
+ foreach ($sizes as $size) {
+ echo "$size ";
+ }
?>
User
';
- echo elgg_view_entity_icon($user, $size, array('use_hover' => false));
- echo '';
- }
+ foreach ($sizes as $size) {
+ echo '';
+ echo elgg_view_entity_icon($user, $size, ['use_hover' => false]);
+ echo ' ';
+ }
?>
Group
';
- echo elgg_view_entity_icon($group, $size, array('use_hover' => false));
- echo '';
- }
+ foreach ($sizes as $size) {
+ echo '';
+ echo elgg_view_entity_icon($group, $size, ['use_hover' => false]);
+ echo ' ';
+ }
?>
diff --git a/mod/developers/views/default/theme_sandbox/icons/loader.php b/mod/developers/views/default/theme_sandbox/icons/loader.php
index f31a2ce94f5..e93328e34ee 100644
--- a/mod/developers/views/default/theme_sandbox/icons/loader.php
+++ b/mod/developers/views/default/theme_sandbox/icons/loader.php
@@ -1 +1 @@
- false));
\ No newline at end of file
+ false]);
diff --git a/mod/developers/views/default/theme_sandbox/icons/sprites.php b/mod/developers/views/default/theme_sandbox/icons/sprites.php
index e53d0a341e1..f4647b214e0 100644
--- a/mod/developers/views/default/theme_sandbox/icons/sprites.php
+++ b/mod/developers/views/default/theme_sandbox/icons/sprites.php
@@ -1,5 +1,5 @@
-
@@ -95,8 +95,8 @@
" . elgg_view_icon($icon) . "";
- }
+foreach ($icons as $icon) {
+ echo "" . elgg_view_icon($icon) . " ";
+}
?>
-
\ No newline at end of file
+
diff --git a/mod/developers/views/default/theme_sandbox/intro.php b/mod/developers/views/default/theme_sandbox/intro.php
index 1a77bc51a04..32d28354242 100644
--- a/mod/developers/views/default/theme_sandbox/intro.php
+++ b/mod/developers/views/default/theme_sandbox/intro.php
@@ -15,16 +15,16 @@
$system_cache = elgg_is_system_cache_enabled();
if ($simple_cache || $system_cache) {
- $advanced = elgg_view('output/url', array(
+ $advanced = elgg_view('output/url', [
'text' => 'Advanced Settings',
'href' => 'admin/settings/advanced',
'is_trusted' => true
- ));
- $developers = elgg_view('output/url', array(
+ ]);
+ $developers = elgg_view('output/url', [
'text' => 'Developers\' Plugin Settings',
'href' => 'admin/developers/settings',
'is_trusted' => true
- ));
+ ]);
$body = "Caches are enabled. Changes you make to CSS and views might not appear. It is
always recommended to disable caches while developing themes and plugins. To
@@ -35,11 +35,11 @@
?>
elgg_echo('theme_sandbox:breakout'),
'href' => current_page_url(),
'target' => '_parent',
'is_trusted' => true,
- ));
+ ]);
?>
diff --git a/mod/developers/views/default/theme_sandbox/javascript/lightbox.js b/mod/developers/views/default/theme_sandbox/javascript/lightbox.js
index 493d0975996..8d549c2cd3c 100644
--- a/mod/developers/views/default/theme_sandbox/javascript/lightbox.js
+++ b/mod/developers/views/default/theme_sandbox/javascript/lightbox.js
@@ -16,4 +16,4 @@ define(function(require) {
lightbox.resize();
});
-});
\ No newline at end of file
+});
diff --git a/mod/developers/views/default/theme_sandbox/javascript/lightbox.php b/mod/developers/views/default/theme_sandbox/javascript/lightbox.php
index 828df349f4b..7e43dacad80 100644
--- a/mod/developers/views/default/theme_sandbox/javascript/lightbox.php
+++ b/mod/developers/views/default/theme_sandbox/javascript/lightbox.php
@@ -1,12 +1,12 @@
'Open lightbox',
'href' => "ajax/view/developers/ajax",
'class' => 'elgg-lightbox'
-));
+]);
-echo elgg_view('output/url', array(
+echo elgg_view('output/url', [
'text' => 'Open iframe lightbox',
'href' => 'https://elgg.org',
'class' => 'elgg-lightbox-iframe mll',
@@ -14,13 +14,13 @@
'width' => '80%',
'height' => '80%',
]),
-));
+]);
-echo elgg_view('output/url', array(
+echo elgg_view('output/url', [
'text' => 'Open inline HTML lightbox',
'href' => '#lightbox-inline',
'class' => 'elgg-lightbox-inline mll',
-));
+]);
elgg_require_js('theme_sandbox/javascript/lightbox');
@@ -31,24 +31,24 @@
'object',
'subtypes' => 'file',
'metadata_name_value_paris' => [
'name' => 'simpletype',
'value' => 'image',
],
- ));
+ ]);
if (!$files) {
return;
}
-echo elgg_view('output/url', array(
+echo elgg_view('output/url', [
'text' => 'Open photo lightbox',
'href' => elgg_get_download_url($files[0]),
'class' => 'elgg-lightbox-photo mll',
-));
+]);
?>
elgg_view('output/img', array(
+ echo elgg_view('output/url', [
+ 'text' => elgg_view('output/img', [
'src' => $file->getIconURL('small'),
'alt' => $file->getDisplayName(),
- )),
+ ]),
'href' => $file->getIconURL('large'),
'rel' => 'lightbox-gallery',
- ));
+ ]);
?>
'Popup content',
'href' => "#elgg-popup-test",
'rel' => 'popup',
- ));
+ ]);
echo $link;
-echo elgg_view_module('popup', 'Popup Test', $ipsum, array(
+echo elgg_view_module('popup', 'Popup Test', $ipsum, [
'id' => 'elgg-popup-test',
'class' => 'hidden theme-sandbox-content-thin',
-));
+]);
-$button = elgg_format_element(array(
+$button = elgg_format_element([
'#tag_name' => 'button',
'class' => 'elgg-button elgg-button-submit mll',
'rel' => 'popup',
'data-href' => "#elgg-popup-test2",
- 'data-position' => json_encode(array(
+ 'data-position' => json_encode([
'my' => 'left top',
'at' => 'left bottom',
- )),
+ ]),
'#text' => 'Load content in a popup',
-));
+]);
echo $button;
-echo elgg_format_element(array(
+echo elgg_format_element([
'#tag_name' => 'div',
'id' => 'elgg-popup-test2',
'class' => 'hidden theme-sandbox-content-thin elgg-module-popup',
-));
+]);
elgg_require_js('theme_sandbox/javascript/popup');
diff --git a/mod/developers/views/default/theme_sandbox/javascript/system_messages.php b/mod/developers/views/default/theme_sandbox/javascript/system_messages.php
index f141b86500b..04dda6441aa 100644
--- a/mod/developers/views/default/theme_sandbox/javascript/system_messages.php
+++ b/mod/developers/views/default/theme_sandbox/javascript/system_messages.php
@@ -1,23 +1,23 @@
'Show system message (system_message())',
'is_trusted' => true,
'href' => '#',
'id' => 'developers-system-message',
// 'onclick' => "elgg.system_message('Elgg System Message');"
-));
+]);
-$error = elgg_view('output/url', array(
+$error = elgg_view('output/url', [
'text' => 'Show error message (register_error())',
'is_trusted' => true,
'href' => '#',
'id' => 'developers-error-message',
-));
+]);
?>
\ No newline at end of file
+
diff --git a/mod/developers/views/default/theme_sandbox/javascript/toggle.php b/mod/developers/views/default/theme_sandbox/javascript/toggle.php
index 2c8dca84de1..395f22d58a9 100644
--- a/mod/developers/views/default/theme_sandbox/javascript/toggle.php
+++ b/mod/developers/views/default/theme_sandbox/javascript/toggle.php
@@ -2,14 +2,14 @@
$ipsum = elgg_view('developers/ipsum');
-$link = elgg_view('output/url', array(
+$link = elgg_view('output/url', [
'text' => 'Toggle content',
'href' => "#elgg-toggle-test",
'rel' => 'toggle',
-));
+]);
echo $link;
-echo elgg_view_module('featured', 'Toggle Test', $ipsum, array(
+echo elgg_view_module('featured', 'Toggle Test', $ipsum, [
'id' => 'elgg-toggle-test',
'class' => 'hidden theme-sandbox-content-thin mtm',
-));
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/theme_sandbox/javascript/user_hover_menu.php b/mod/developers/views/default/theme_sandbox/javascript/user_hover_menu.php
index 45331b6e0c2..dd62304b7cb 100644
--- a/mod/developers/views/default/theme_sandbox/javascript/user_hover_menu.php
+++ b/mod/developers/views/default/theme_sandbox/javascript/user_hover_menu.php
@@ -4,11 +4,11 @@
echo elgg_view_entity_icon($me);
// show another user if available
-$users = elgg_get_entities(array(
+$users = elgg_get_entities([
'type' => 'user',
- 'wheres' => array("guid != {$me->getGUID()}"),
+ 'wheres' => ["guid != {$me->getGUID()}"],
'limit' => 1
-));
+]);
if (is_array($users) && count($users) > 0) {
echo elgg_view_entity_icon($users[0]);
diff --git a/mod/developers/views/default/theme_sandbox/layouts/one_column.php b/mod/developers/views/default/theme_sandbox/layouts/one_column.php
index 2fea3266c40..55d0711a85c 100644
--- a/mod/developers/views/default/theme_sandbox/layouts/one_column.php
+++ b/mod/developers/views/default/theme_sandbox/layouts/one_column.php
@@ -4,7 +4,7 @@
$page_url = current_page_url();
-echo elgg_view_layout('default', array(
+echo elgg_view_layout('default', [
'sidebar' => false,
'title' => 'Layout without sidebars',
'content' => "
Layout content : $ipsum",
@@ -20,4 +20,4 @@
],
],
'filter_value' => get_input('filter', 'tab1'),
-));
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/theme_sandbox/layouts/one_sidebar.php b/mod/developers/views/default/theme_sandbox/layouts/one_sidebar.php
index 5dd91f12b52..8ff0fb39638 100644
--- a/mod/developers/views/default/theme_sandbox/layouts/one_sidebar.php
+++ b/mod/developers/views/default/theme_sandbox/layouts/one_sidebar.php
@@ -4,7 +4,7 @@
$page_url = current_page_url();
-echo elgg_view_layout('default', array(
+echo elgg_view_layout('default', [
'sidebar' => "
Primary sidebar : $ipsum",
'title' => 'Layout with one sidebar',
'content' => "
Layout content : $ipsum",
@@ -20,4 +20,4 @@
],
],
'filter_value' => get_input('filter', 'tab1'),
-));
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/theme_sandbox/layouts/two_sidebar.php b/mod/developers/views/default/theme_sandbox/layouts/two_sidebar.php
index 1292e65d002..cd7a1932f77 100644
--- a/mod/developers/views/default/theme_sandbox/layouts/two_sidebar.php
+++ b/mod/developers/views/default/theme_sandbox/layouts/two_sidebar.php
@@ -4,7 +4,7 @@
$page_url = current_page_url();
-echo elgg_view_layout('default', array(
+echo elgg_view_layout('default', [
'sidebar' => "
Primary sidebar : $ipsum",
'sidebar_alt' => "
Secondary sidebar : $ipsum",
'title' => 'Layout with two sidebars',
@@ -21,4 +21,4 @@
],
],
'filter_value' => get_input('filter', 'tab1'),
-));
\ No newline at end of file
+]);
diff --git a/mod/developers/views/default/theme_sandbox/modules/modules.php b/mod/developers/views/default/theme_sandbox/modules/modules.php
index 04f5917b426..b14d8060798 100644
--- a/mod/developers/views/default/theme_sandbox/modules/modules.php
+++ b/mod/developers/views/default/theme_sandbox/modules/modules.php
@@ -1,4 +1,4 @@
-
-
\ No newline at end of file
+
diff --git a/mod/developers/views/default/theme_sandbox/modules/widgets.php b/mod/developers/views/default/theme_sandbox/modules/widgets.php
index c212a3fa557..63c45408578 100644
--- a/mod/developers/views/default/theme_sandbox/modules/widgets.php
+++ b/mod/developers/views/default/theme_sandbox/modules/widgets.php
@@ -22,17 +22,17 @@ function css_permissions_override() {
handler = 'friends';
$obj->title = "Widget $i";
$w[] = $obj;
}
-$column1 = array($w[0], $w[1]);
-$column2 = array($w[2], $w[3]);
-$column3 = array($w[4], $w[5]);
-$widgets = array(1 => $column1, 2 => $column2, 3 => $column3);
+$column1 = [$w[0], $w[1]];
+$column2 = [$w[2], $w[3]];
+$column3 = [$w[4], $w[5]];
+$widgets = [1 => $column1, 2 => $column2, 3 => $column3];
$num_columns = 3;
echo '
diff --git a/mod/developers/views/default/theme_sandbox/navigation/filter.php b/mod/developers/views/default/theme_sandbox/navigation/filter.php
index 70cd31d2a59..81df7bdb7bb 100644
--- a/mod/developers/views/default/theme_sandbox/navigation/filter.php
+++ b/mod/developers/views/default/theme_sandbox/navigation/filter.php
@@ -1,8 +1,8 @@
- $i,
@@ -31,7 +31,7 @@
?>
-
-
\ No newline at end of file
+
diff --git a/mod/developers/views/default/theme_sandbox/navigation/pagination.php b/mod/developers/views/default/theme_sandbox/navigation/pagination.php
index fc9758b39bb..fd2a05183a9 100644
--- a/mod/developers/views/default/theme_sandbox/navigation/pagination.php
+++ b/mod/developers/views/default/theme_sandbox/navigation/pagination.php
@@ -1,8 +1,8 @@
1000,
'limit' => elgg_get_config('default_limit'),
'offset' => 230,
-);
+];
-echo elgg_view('navigation/pagination', $params);
\ No newline at end of file
+echo elgg_view('navigation/pagination', $params);
diff --git a/mod/developers/views/default/theme_sandbox/navigation/require.js b/mod/developers/views/default/theme_sandbox/navigation/require.js
index 45e8b458fe9..a5bc5c3e939 100644
--- a/mod/developers/views/default/theme_sandbox/navigation/require.js
+++ b/mod/developers/views/default/theme_sandbox/navigation/require.js
@@ -6,4 +6,4 @@ define(function(require) {
e.preventDefault();
alert('Thank you for trying me');
});
-});
\ No newline at end of file
+});
diff --git a/mod/developers/views/default/theme_sandbox/navigation/require.php b/mod/developers/views/default/theme_sandbox/navigation/require.php
index ed2c62750ae..dc8ed1c0580 100644
--- a/mod/developers/views/default/theme_sandbox/navigation/require.php
+++ b/mod/developers/views/default/theme_sandbox/navigation/require.php
@@ -7,9 +7,9 @@
'deps' => ['theme_sandbox/navigation/require'],
]);
-$params = array();
-$params['menu'] = array();
-$params['menu']['default'] = array();
+$params = [];
+$params['menu'] = [];
+$params['menu']['default'] = [];
$params['menu']['default'][] = $item;
$params['name'] = 'require';
$params['class'] = 'elgg-menu-hz';
@@ -17,7 +17,7 @@
?>
-
-
\ No newline at end of file
+
diff --git a/mod/developers/views/default/theme_sandbox/navigation/site.php b/mod/developers/views/default/theme_sandbox/navigation/site.php
index 4b048b71be9..ae8cc0a9f5e 100644
--- a/mod/developers/views/default/theme_sandbox/navigation/site.php
+++ b/mod/developers/views/default/theme_sandbox/navigation/site.php
@@ -1,8 +1,8 @@
- array(
- array('title' => 'First', 'url' => "#"),
- array('title' => 'Second', 'url' => "#", 'selected' => true),
- array('title' => 'Third', 'url' => "#", 'icon' => 'question'),
- )
-);
+$params = [
+ 'tabs' => [
+ ['title' => 'First', 'url' => "#"],
+ ['title' => 'Second', 'url' => "#", 'selected' => true],
+ ['title' => 'Third', 'url' => "#", 'icon' => 'question'],
+ ]
+];
-echo elgg_view('navigation/tabs', $params);
\ No newline at end of file
+echo elgg_view('navigation/tabs', $params);
diff --git a/mod/developers/views/default/theme_sandbox/typography.php b/mod/developers/views/default/theme_sandbox/typography.php
index 6a99ec3e053..ce012fd07ed 100644
--- a/mod/developers/views/default/theme_sandbox/typography.php
+++ b/mod/developers/views/default/theme_sandbox/typography.php
@@ -9,4 +9,4 @@
echo elgg_view_module('theme-sandbox-demo', "Paragraph", elgg_view('theme_sandbox/typography/paragraph'));
-echo elgg_view_module('theme-sandbox-demo', "Misc", elgg_view('theme_sandbox/typography/misc'));
\ No newline at end of file
+echo elgg_view_module('theme-sandbox-demo', "Misc", elgg_view('theme_sandbox/typography/misc'));
diff --git a/mod/diagnostics/actions/diagnostics/download.php b/mod/diagnostics/actions/diagnostics/download.php
index 97775c92ea3..697bc4ae512 100644
--- a/mod/diagnostics/actions/diagnostics/download.php
+++ b/mod/diagnostics/actions/diagnostics/download.php
@@ -5,7 +5,7 @@
* @package ElggDiagnostics
*/
-$output = elgg_echo('diagnostics:header', array(date('r'), elgg_get_logged_in_user_entity()->name));
+$output = elgg_echo('diagnostics:header', [date('r'), elgg_get_logged_in_user_entity()->name]);
$output = elgg_trigger_plugin_hook('diagnostics:report', 'system', null, $output);
header("Cache-Control: public");
diff --git a/mod/diagnostics/languages/ca.php b/mod/diagnostics/languages/ca.php
index b3a5fe9824d..43f32c54aec 100644
--- a/mod/diagnostics/languages/ca.php
+++ b/mod/diagnostics/languages/ca.php
@@ -1,5 +1,5 @@
'Diagnòstic del sistema',
'diagnostics' => 'Diagnòstic del sistema',
'diagnostics:report' => 'Informe del diagnòstic',
@@ -25,4 +25,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/cmn.php b/mod/diagnostics/languages/cmn.php
index ff73bf10e24..f23c5e60072 100644
--- a/mod/diagnostics/languages/cmn.php
+++ b/mod/diagnostics/languages/cmn.php
@@ -1,5 +1,5 @@
'系統診斷',
'diagnostics' => '系統診斷',
'diagnostics:report' => '診斷報告',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/da.php b/mod/diagnostics/languages/da.php
index a691d1101c8..cceb953e9b5 100644
--- a/mod/diagnostics/languages/da.php
+++ b/mod/diagnostics/languages/da.php
@@ -1,36 +1,36 @@
'System Diagnostics',
'diagnostics' => 'System diagnostik',
'diagnostics:report' => 'Diagnostik rapport',
'diagnostics:description' => 'Den følgende diagnostik rapport er anvendelig til at diagnosticere ethvert problem med Elgg, og skal vedhæftes alle bugrapporter.',
- 'diagnostics:header' => '========================================================================
-Elgg Diagnostic Report
-Generated %s by %s
- ========================================================================
-
+ 'diagnostics:header' => '========================================================================
+Elgg Diagnostic Report
+Generated %s by %s
+ ========================================================================
+
',
- 'diagnostics:report:basic' => '
-Elgg Release %s, version %s
-
+ 'diagnostics:report:basic' => '
+Elgg Release %s, version %s
+
------------------------------------------------------------------------',
- 'diagnostics:report:php' => '
-PHP info:
-%s
+ 'diagnostics:report:php' => '
+PHP info:
+%s
------------------------------------------------------------------------',
- 'diagnostics:report:plugins' => '
-Installed plugins and details:
-
-%s
+ 'diagnostics:report:plugins' => '
+Installed plugins and details:
+
+%s
------------------------------------------------------------------------',
- 'diagnostics:report:md5' => '
-Installed files and checksums:
-
-%s
+ 'diagnostics:report:md5' => '
+Installed files and checksums:
+
+%s
------------------------------------------------------------------------',
- 'diagnostics:report:globals' => '
-Global variables:
-
-%s
+ 'diagnostics:report:globals' => '
+Global variables:
+
+%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/de.php b/mod/diagnostics/languages/de.php
index ebb99b9a8af..6aac1d643d3 100644
--- a/mod/diagnostics/languages/de.php
+++ b/mod/diagnostics/languages/de.php
@@ -1,5 +1,5 @@
'Systemüberprüfung',
'diagnostics' => 'Systemüberprüfung',
'diagnostics:report' => 'Report',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/en.php b/mod/diagnostics/languages/en.php
index dc2c7c2a2ff..7385734cada 100644
--- a/mod/diagnostics/languages/en.php
+++ b/mod/diagnostics/languages/en.php
@@ -1,5 +1,5 @@
'System Diagnostics',
'diagnostics' => 'System diagnostics',
'diagnostics:report' => 'Diagnostics Report',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/es.php b/mod/diagnostics/languages/es.php
index 993450ac4df..670bb9ce67f 100644
--- a/mod/diagnostics/languages/es.php
+++ b/mod/diagnostics/languages/es.php
@@ -1,5 +1,5 @@
'Diagnostico del sistema',
'diagnostics' => 'Diagnósticos',
'diagnostics:report' => 'Reporte de Diagnósticos',
@@ -33,4 +33,4 @@
%s
-------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/eu_es.php b/mod/diagnostics/languages/eu_es.php
index 14f17a96ce1..f4edc1795ba 100644
--- a/mod/diagnostics/languages/eu_es.php
+++ b/mod/diagnostics/languages/eu_es.php
@@ -1,5 +1,5 @@
'Sistemako diagnostikoak',
'diagnostics' => 'Sistemako diagnostikoak',
'diagnostics:report' => 'Diagnostikoen txostenak',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/fi.php b/mod/diagnostics/languages/fi.php
index 9e82f2d24ba..e4f03bdf5d7 100644
--- a/mod/diagnostics/languages/fi.php
+++ b/mod/diagnostics/languages/fi.php
@@ -1,5 +1,5 @@
'Järjestelmän diagnostiikka',
'diagnostics' => 'Järjestelmän diagnostiikka',
'diagnostics:report' => 'Raportti',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/fr.php b/mod/diagnostics/languages/fr.php
index 7f99083f8b3..0be8a1815bb 100644
--- a/mod/diagnostics/languages/fr.php
+++ b/mod/diagnostics/languages/fr.php
@@ -1,5 +1,5 @@
'Diagnostics du système',
'diagnostics' => 'Diagnostics du système',
'diagnostics:report' => 'Rapport de Diagnostic',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/gl.php b/mod/diagnostics/languages/gl.php
index deec523f9fe..41d6b77d73d 100644
--- a/mod/diagnostics/languages/gl.php
+++ b/mod/diagnostics/languages/gl.php
@@ -1,5 +1,5 @@
'Diagnósticos do sistema',
'diagnostics' => 'Diagnósticos do sistema',
'diagnostics:report' => 'Informe de diagnósticos',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/it.php b/mod/diagnostics/languages/it.php
index ef27b122a69..557624e7db6 100644
--- a/mod/diagnostics/languages/it.php
+++ b/mod/diagnostics/languages/it.php
@@ -1,5 +1,5 @@
'Diagnostica di sistema',
'diagnostics' => 'Diagnostica di sistema',
'diagnostics:report' => 'Rapporto di diagnostica',
@@ -34,4 +34,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/ja.php b/mod/diagnostics/languages/ja.php
index 4fc952b8f3f..f0bd6be0e4b 100644
--- a/mod/diagnostics/languages/ja.php
+++ b/mod/diagnostics/languages/ja.php
@@ -1,5 +1,5 @@
'システム診断',
'diagnostics' => 'システム診断',
'diagnostics:report' => '診断報告書',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/ko.php b/mod/diagnostics/languages/ko.php
index 42097b1d12c..7998f908e32 100644
--- a/mod/diagnostics/languages/ko.php
+++ b/mod/diagnostics/languages/ko.php
@@ -1,5 +1,5 @@
'시스템 진단',
'diagnostics' => '시스템 진단',
'diagnostics:report' => '진단 보고서',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/nl.php b/mod/diagnostics/languages/nl.php
index 07c06e2c3fe..ae7734df4e1 100644
--- a/mod/diagnostics/languages/nl.php
+++ b/mod/diagnostics/languages/nl.php
@@ -1,5 +1,5 @@
'Systeemdiagnose',
'diagnostics' => 'Systeemdiagnose',
'diagnostics:report' => 'Diagnostisch rapport',
@@ -32,4 +32,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/pl.php b/mod/diagnostics/languages/pl.php
index 8252b6245d0..cc8ebda8351 100644
--- a/mod/diagnostics/languages/pl.php
+++ b/mod/diagnostics/languages/pl.php
@@ -1,5 +1,5 @@
'Diagnostyka systemu',
'diagnostics' => 'Diagnostyka systemu',
'diagnostics:report' => 'Raport diagnostyczny',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/pt_br.php b/mod/diagnostics/languages/pt_br.php
index 0c234133d1c..5b280462732 100644
--- a/mod/diagnostics/languages/pt_br.php
+++ b/mod/diagnostics/languages/pt_br.php
@@ -1,31 +1,31 @@
'Diagnóstico do sistema',
'diagnostics' => 'Diagnóstico do sistema',
'diagnostics:report' => 'Relatório do diagnóstico',
'diagnostics:description' => 'O relatório de diagnóstico é útil para diagnosticar qualquer problema com o Elgg, e deve ser adicionado em qualquer relatório de erro que você fizer.',
- 'diagnostics:header' => '========================================================================
-Relatório de Diagnóstico do Elgg
-%s gerado por %s
-========================================================================
-
+ 'diagnostics:header' => '========================================================================
+Relatório de Diagnóstico do Elgg
+%s gerado por %s
+========================================================================
+
',
- 'diagnostics:report:basic' => 'Elgg Release %s, versão %s
-
+ 'diagnostics:report:basic' => 'Elgg Release %s, versão %s
+
------------------------------------------------------------------------',
- 'diagnostics:report:php' => 'Informação sobre o PHP:
-%s
+ 'diagnostics:report:php' => 'Informação sobre o PHP:
+%s
------------------------------------------------------------------------',
- 'diagnostics:report:plugins' => 'Dispositivos instalados e detalhes:
-
-%s
+ 'diagnostics:report:plugins' => 'Dispositivos instalados e detalhes:
+
+%s
------------------------------------------------------------------------',
- 'diagnostics:report:md5' => 'Arquivos instalados e checksums:
-
-%s
+ 'diagnostics:report:md5' => 'Arquivos instalados e checksums:
+
+%s
------------------------------------------------------------------------',
- 'diagnostics:report:globals' => 'Variáveis globais:
-
-%s
+ 'diagnostics:report:globals' => 'Variáveis globais:
+
+%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/languages/ru.php b/mod/diagnostics/languages/ru.php
index b2fddeaf9f0..b134dc47087 100644
--- a/mod/diagnostics/languages/ru.php
+++ b/mod/diagnostics/languages/ru.php
@@ -1,5 +1,5 @@
'Диагностика системы',
'diagnostics' => 'Диагностика системы',
'diagnostics:report' => 'Диагностические отчеты',
@@ -33,4 +33,4 @@
%s
------------------------------------------------------------------------',
-);
\ No newline at end of file
+];
diff --git a/mod/diagnostics/start.php b/mod/diagnostics/start.php
index 1cd0622488b..6b36ab990e2 100644
--- a/mod/diagnostics/start.php
+++ b/mod/diagnostics/start.php
@@ -27,7 +27,7 @@ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params) {
$version = elgg_get_version();
$release = elgg_get_version(true);
- $returnvalue .= elgg_echo('diagnostics:report:basic', array($release, $version));
+ $returnvalue .= elgg_echo('diagnostics:report:basic', [$release, $version]);
return $returnvalue;
}
@@ -48,10 +48,10 @@ function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params) {
* Recursively list through a directory tree producing a hash of all installed files
*
* @param starting dir $dir
- * @param buffer $buffer
+ * @param buffer $buffer
*/
function diagnostics_md5_dir($dir) {
- $extensions_allowed = array('.php', '.js', '.css');
+ $extensions_allowed = ['.php', '.js', '.css'];
$buffer = "";
@@ -80,7 +80,7 @@ function diagnostics_md5_dir($dir) {
function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params) {
$base_dir = elgg_get_root_path();
- $returnvalue .= elgg_echo('diagnostics:report:md5', array(diagnostics_md5_dir($base_dir)));
+ $returnvalue .= elgg_echo('diagnostics:report:md5', [diagnostics_md5_dir($base_dir)]);
return $returnvalue;
}
@@ -94,22 +94,21 @@ function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params) {
ob_start();
phpinfo();
- $phpinfo = array('phpinfo' => array());
+ $phpinfo = ['phpinfo' => []];
if (preg_match_all('#(?:)|(?: (.*?)\s* (?:(.*?)\s* (?:(.*?)\s* )?)? )#s', ob_get_clean(), $matches, PREG_SET_ORDER)) {
-
foreach ($matches as $match) {
if (strlen($match[1])) {
- $phpinfo[$match[1]] = array();
- } else if(isset($match[3])) {
- $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
+ $phpinfo[$match[1]] = [];
+ } else if (isset($match[3])) {
+ $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? [$match[3], $match[4]] : $match[3];
} else {
$phpinfo[end(array_keys($phpinfo))][] = $match[2];
}
}
}
- $returnvalue .= elgg_echo('diagnostics:report:php', array(print_r($phpinfo, true)));
+ $returnvalue .= elgg_echo('diagnostics:report:php', [print_r($phpinfo, true)]);
return $returnvalue;
}
@@ -122,7 +121,7 @@ function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params) {
function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params) {
$output = str_replace(elgg_get_config('dbpass'), '<>', print_r($GLOBALS, true));
- $returnvalue .= elgg_echo('diagnostics:report:globals', array($output));
+ $returnvalue .= elgg_echo('diagnostics:report:globals', [$output]);
return $returnvalue;
}
diff --git a/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php b/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php
index d2e77735ab4..0e5d9620ddc 100644
--- a/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php
+++ b/mod/diagnostics/views/default/admin/administer_utilities/diagnostics.php
@@ -5,13 +5,13 @@
$diagnostics_title = elgg_echo('diagnostics:report');
$diagnostics = '' . elgg_echo('diagnostics:description') .'
';
-$params = array(
+$params = [
'text' => elgg_echo('download'),
'href' => 'action/diagnostics/download',
'class' => 'elgg-button elgg-button-submit',
'is_action' => true,
'is_trusted' => true,
-);
+];
$diagnostics .= '' . elgg_view('output/url', $params) . '
';
-echo elgg_view_module('inline', $diagnostics_title, $diagnostics, array('class' => 'elgg-form-settings'));
+echo elgg_view_module('inline', $diagnostics_title, $diagnostics, ['class' => 'elgg-form-settings']);
diff --git a/mod/discussions/actions/discussion/reply/save.php b/mod/discussions/actions/discussion/reply/save.php
index 9d6415a6009..2c1d841d218 100644
--- a/mod/discussions/actions/discussion/reply/save.php
+++ b/mod/discussions/actions/discussion/reply/save.php
@@ -63,13 +63,13 @@
forward(REFERER);
}
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/discussion_reply/create',
'action_type' => 'reply',
'subject_guid' => $user->guid,
'object_guid' => $reply->guid,
'target_guid' => $topic->guid,
- ));
+ ]);
system_message(elgg_echo('discussion:post:success'));
}
diff --git a/mod/discussions/actions/discussion/save.php b/mod/discussions/actions/discussion/save.php
index 785778b187a..6063f13d01b 100644
--- a/mod/discussions/actions/discussion/save.php
+++ b/mod/discussions/actions/discussion/save.php
@@ -67,13 +67,13 @@
if ($new_topic) {
system_message(elgg_echo('discussion:topic:created'));
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/discussion/create',
'action_type' => 'create',
'subject_guid' => elgg_get_logged_in_user_guid(),
'object_guid' => $topic->guid,
'target_guid' => $container_guid,
- ));
+ ]);
} else {
system_message(elgg_echo('discussion:topic:updated'));
}
diff --git a/mod/discussions/languages/de.php b/mod/discussions/languages/de.php
index 2330a64d3c4..a3de770aa8e 100644
--- a/mod/discussions/languages/de.php
+++ b/mod/discussions/languages/de.php
@@ -1,6 +1,6 @@
'Diskussionen',
'discussion:add' => 'Neue Diskussion hinzufügen',
'discussion:latest' => 'Neueste Diskussionen',
@@ -96,4 +96,4 @@
'discussion:reply:edited' => "Die Änderung wurde gespeichert.",
'discussion:reply:error' => "Beim Speichern der Änderung ist ein Problem aufgetreten.",
-);
+];
diff --git a/mod/discussions/languages/en.php b/mod/discussions/languages/en.php
index 957eb1a8b48..9d29edf29e1 100644
--- a/mod/discussions/languages/en.php
+++ b/mod/discussions/languages/en.php
@@ -1,6 +1,6 @@
'Discussions',
'discussion:add' => 'Add discussion topic',
'discussion:latest' => 'Latest discussions',
@@ -96,4 +96,4 @@
'discussion:reply:edited' => "You have successfully edited the forum post.",
'discussion:reply:error' => "There was a problem editing the forum post.",
-);
+];
diff --git a/mod/discussions/languages/fi.php b/mod/discussions/languages/fi.php
index d888f8b65e6..154251d4dab 100644
--- a/mod/discussions/languages/fi.php
+++ b/mod/discussions/languages/fi.php
@@ -1,6 +1,6 @@
'Keskustelut',
'discussion:add' => 'Lisää uusi keskustelu',
'discussion:latest' => 'Uusimmat keskustelut',
@@ -96,4 +96,4 @@
'discussion:reply:edited' => "Vastaus tallennettu",
'discussion:reply:error' => "Vastauksen tallentaminen epäonnistui",
-);
+];
diff --git a/mod/discussions/languages/fr.php b/mod/discussions/languages/fr.php
index e796867a05f..1c68498fbbb 100644
--- a/mod/discussions/languages/fr.php
+++ b/mod/discussions/languages/fr.php
@@ -1,6 +1,6 @@
'Discussions',
'discussion:add' => 'Ajouter un sujet de discussion',
'discussion:latest' => 'Dernières discussions',
@@ -96,4 +96,4 @@
'discussion:reply:edited' => "Vous avez bien modifié cette discussion.",
'discussion:reply:error' => "Il y a eu un problème lors de la modification de la discussion.",
-);
+];
diff --git a/mod/discussions/languages/it.php b/mod/discussions/languages/it.php
index 14d8c444af7..d114581293b 100644
--- a/mod/discussions/languages/it.php
+++ b/mod/discussions/languages/it.php
@@ -1,6 +1,6 @@
'Forum',
'discussion:add' => 'Aggiungi argomento',
'discussion:latest' => 'Ultimi argomenti',
@@ -98,4 +98,4 @@
'discussion:reply:edited' => "Hai modificato con successo il post",
'discussion:reply:error' => "Problema durante la modifica del post",
-);
+];
diff --git a/mod/discussions/languages/ja.php b/mod/discussions/languages/ja.php
index bfced350502..b921838d373 100644
--- a/mod/discussions/languages/ja.php
+++ b/mod/discussions/languages/ja.php
@@ -1,6 +1,6 @@
'会議室',
'discussion:add' => '議題を追加',
'discussion:latest' => '最新の話題',
@@ -96,4 +96,4 @@
'discussion:reply:edited' => "投稿を編集しました。",
'discussion:reply:error' => "投稿を編集する際に問題が発生しました。",
-);
+];
diff --git a/mod/discussions/languages/nl.php b/mod/discussions/languages/nl.php
index c14ce54aad8..1b44c533cb2 100644
--- a/mod/discussions/languages/nl.php
+++ b/mod/discussions/languages/nl.php
@@ -1,6 +1,6 @@
'Discussies',
'discussion:add' => 'Nieuw discussieonderwerp',
'discussion:latest' => 'Laatste discussies',
@@ -100,4 +100,4 @@
'discussion:reply:edited' => "Je hebt de reactie succesvol bewerkt.",
'discussion:reply:error' => "Er was een probleem tijdens het bewerken van de reactie.",
-);
+];
diff --git a/mod/discussions/start.php b/mod/discussions/start.php
index 0f6b616655b..9a66fd8863e 100644
--- a/mod/discussions/start.php
+++ b/mod/discussions/start.php
@@ -173,9 +173,9 @@ function discussion_redirect_to_reply($reply_guid, $fallback_guid) {
'subtype' => $reply->getSubtype(),
'container_guid' => $topic->guid,
'count' => true,
- 'wheres' => ["e.guid < " . (int)$reply->guid],
+ 'wheres' => ["e.guid < " . (int) $reply->guid],
]);
- $limit = (int)get_input('limit', 0);
+ $limit = (int) get_input('limit', 0);
if (!$limit) {
$limit = _elgg_services()->config->get('default_limit');
}
@@ -285,15 +285,15 @@ function discussion_add_to_river_menu($hook, $type, $return, $params) {
if (elgg_instanceof($object, 'object', 'discussion')) {
/* @var $object ElggObject */
if ($object->canWriteToContainer(0, 'object', 'discussion_reply')) {
- $options = array(
+ $options = [
'name' => 'reply',
'href' => "#discussion-reply-{$object->guid}",
'text' => elgg_view_icon('speech-bubble'),
'title' => elgg_echo('reply:this'),
'rel' => 'toggle',
'priority' => 50,
- );
- $return[] = ElggMenuItem::factory($options);
+ ];
+ $return[] = ElggMenuItem::factory($options);
}
} else if (elgg_instanceof($object, 'object', 'discussion_reply')) {
/* @var $object ElggDiscussionReply */
@@ -327,14 +327,14 @@ function discussion_prepare_notification($hook, $type, $notification, $params) {
$descr = $entity->description;
$title = $entity->title;
- $notification->subject = elgg_echo('discussion:topic:notify:subject', array($title), $language);
- $notification->body = elgg_echo('discussion:topic:notify:body', array(
+ $notification->subject = elgg_echo('discussion:topic:notify:subject', [$title], $language);
+ $notification->body = elgg_echo('discussion:topic:notify:body', [
$owner->name,
$title,
$descr,
$entity->getURL()
- ), $language);
- $notification->summary = elgg_echo('discussion:topic:notify:summary', array($entity->title), $language);
+ ], $language);
+ $notification->summary = elgg_echo('discussion:topic:notify:summary', [$entity->title], $language);
$notification->url = $entity->getURL();
return $notification;
}
@@ -354,14 +354,14 @@ function discussion_prepare_reply_notification($hook, $type, $notification, $par
$poster = $reply->getOwnerEntity();
$language = elgg_extract('language', $params);
- $notification->subject = elgg_echo('discussion:reply:notify:subject', array($topic->title), $language);
- $notification->body = elgg_echo('discussion:reply:notify:body', array(
+ $notification->subject = elgg_echo('discussion:reply:notify:subject', [$topic->title], $language);
+ $notification->body = elgg_echo('discussion:reply:notify:body', [
$poster->name,
$topic->title,
$reply->description,
$reply->getURL(),
- ), $language);
- $notification->summary = elgg_echo('discussion:reply:notify:summary', array($topic->title), $language);
+ ], $language);
+ $notification->summary = elgg_echo('discussion:reply:notify:summary', [$topic->title], $language);
$notification->url = $reply->getURL();
return $notification;
@@ -509,12 +509,12 @@ function discussion_update_reply_access_ids($event, $type, $object) {
}
$ia = elgg_set_ignore_access(true);
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'discussion_reply',
'container_guid' => $object->getGUID(),
'limit' => 0,
- );
+ ];
$batch = new ElggBatch('elgg_get_entities', $options);
foreach ($batch as $reply) {
if ($reply->access_id == $object->access_id) {
@@ -561,21 +561,21 @@ function discussion_reply_menu_setup($hook, $type, $return, $params) {
// Allow discussion topic owner, group owner and admins to edit and delete
if ($reply->canEdit() && !elgg_in_context('activity')) {
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'edit',
'text' => elgg_echo('edit'),
'href' => "discussion/reply/edit/{$reply->guid}",
'priority' => 150,
- ));
+ ]);
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'delete',
'text' => elgg_view_icon('delete'),
'href' => "action/discussion/reply/delete?guid={$reply->guid}",
'priority' => 150,
'is_action' => true,
'confirm' => elgg_echo('deleteconfirm'),
- ));
+ ]);
} else {
// Edit and delete links can be removed from all other users
$remove[] = 'edit';
@@ -612,10 +612,10 @@ function discussion_search_discussion($hook, $type, $value, $params) {
}
unset($params["subtype"]);
- $params["subtypes"] = array("discussion", "discussion_reply");
+ $params["subtypes"] = ["discussion", "discussion_reply"];
// trigger the 'normal' object search as it can handle the added options
- return elgg_trigger_plugin_hook('search', 'object', $params, array());
+ return elgg_trigger_plugin_hook('search', 'object', $params, []);
}
/**
@@ -624,9 +624,9 @@ function discussion_search_discussion($hook, $type, $value, $params) {
* @param ElggObject $topic Topic object if editing
* @return array
*/
-function discussion_prepare_form_vars($topic = NULL) {
+function discussion_prepare_form_vars($topic = null) {
// input names => defaults
- $values = array(
+ $values = [
'title' => '',
'description' => '',
'status' => '',
@@ -635,7 +635,7 @@ function discussion_prepare_form_vars($topic = NULL) {
'container_guid' => elgg_get_page_owner_guid(),
'guid' => null,
'topic' => $topic,
- );
+ ];
if ($topic) {
foreach (array_keys($values) as $field) {
@@ -679,4 +679,4 @@ function discussion_setup_groups_filter_tabs($hook, $type, $return, $params) {
]);
return $return;
-}
\ No newline at end of file
+}
diff --git a/mod/discussions/views/default/ajax/discussion/reply/edit.php b/mod/discussions/views/default/ajax/discussion/reply/edit.php
index eac56cb5157..d6ca9a3e89b 100644
--- a/mod/discussions/views/default/ajax/discussion/reply/edit.php
+++ b/mod/discussions/views/default/ajax/discussion/reply/edit.php
@@ -11,12 +11,12 @@
return false;
}
-$form_vars = array(
+$form_vars = [
'class' => ($hidden ? 'hidden ' : '') . 'mvl',
'id' => "edit-discussion-reply-{$guid}",
-);
-$body_vars = array(
+];
+$body_vars = [
'entity' => $reply,
'inline' => true,
-);
-echo elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
\ No newline at end of file
+];
+echo elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
diff --git a/mod/discussions/views/default/discussion/closed.php b/mod/discussions/views/default/discussion/closed.php
index ff4267ec668..bbd15a43c04 100644
--- a/mod/discussions/views/default/discussion/closed.php
+++ b/mod/discussions/views/default/discussion/closed.php
@@ -5,4 +5,4 @@
echo "";
echo "
" . elgg_echo("discussion:topic:closed:title") . " ";
echo "
" . elgg_echo("discussion:topic:closed:desc") . "
";
-echo "
";
\ No newline at end of file
+echo "";
diff --git a/mod/discussions/views/default/discussion/discussion.js b/mod/discussions/views/default/discussion/discussion.js
index 846a36831e9..c602d6e5e0c 100644
--- a/mod/discussions/views/default/discussion/discussion.js
+++ b/mod/discussions/views/default/discussion/discussion.js
@@ -99,7 +99,7 @@ elgg.discussion.Reply.prototype = {
/**
* Initialize discussion reply inline editing
- *
+ *
* @return void
*/
elgg.discussion.init = function() {
@@ -117,4 +117,4 @@ elgg.discussion.init = function() {
});
};
-elgg.register_hook_handler('init', 'system', elgg.discussion.init);
\ No newline at end of file
+elgg.register_hook_handler('init', 'system', elgg.discussion.init);
diff --git a/mod/discussions/views/default/discussion/group_module.php b/mod/discussions/views/default/discussion/group_module.php
index bb80a228bc3..05977aa3747 100644
--- a/mod/discussions/views/default/discussion/group_module.php
+++ b/mod/discussions/views/default/discussion/group_module.php
@@ -11,14 +11,14 @@
$group = $vars['entity'];
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => "discussion/owner/$group->guid",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
-));
+]);
elgg_push_context('widgets');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'discussion',
'container_guid' => $group->getGUID(),
@@ -26,19 +26,19 @@
'full_view' => false,
'pagination' => false,
'no_results' => elgg_echo('discussion:none'),
-);
+];
$content = elgg_list_entities($options);
elgg_pop_context();
-$new_link = elgg_view('output/url', array(
+$new_link = elgg_view('output/url', [
'href' => "discussion/add/" . $group->getGUID(),
'text' => elgg_echo('discussion:addtopic'),
'is_trusted' => true,
-));
+]);
-echo elgg_view('groups/profile/module', array(
+echo elgg_view('groups/profile/module', [
'title' => elgg_echo('discussion:group'),
'content' => $content,
'all_link' => $all_link,
'add_link' => $new_link,
-));
\ No newline at end of file
+]);
diff --git a/mod/discussions/views/default/discussion/listing/all.php b/mod/discussions/views/default/discussion/listing/all.php
index 8246c89ef85..6a3df300c25 100644
--- a/mod/discussions/views/default/discussion/listing/all.php
+++ b/mod/discussions/views/default/discussion/listing/all.php
@@ -5,7 +5,7 @@
*
* @uses $vars['container_type'] Container type filter to apply
*/
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'discussion',
'order_by' => 'e.last_action desc',
@@ -14,7 +14,7 @@
'no_results' => elgg_echo('discussion:none'),
'preload_owners' => true,
'preload_containers' => true,
-);
+];
$container_type = elgg_extract('container_type', $vars);
if ($container_type) {
diff --git a/mod/discussions/views/default/discussion/replies.php b/mod/discussions/views/default/discussion/replies.php
index be062bc8eb1..bbf2f363ff9 100644
--- a/mod/discussions/views/default/discussion/replies.php
+++ b/mod/discussions/views/default/discussion/replies.php
@@ -17,17 +17,17 @@
$show_add_form = $topic->canWriteToContainer(0, 'object', 'discussion_reply');
}
-$replies = elgg_list_entities(array(
+$replies = elgg_list_entities([
'type' => 'object',
'subtype' => 'discussion_reply',
'container_guid' => $topic->guid,
'reverse_order_by' => true,
'distinct' => false,
'url_fragment' => 'group-replies',
-));
+]);
if ($show_add_form) {
- $form_vars = array('class' => 'mtm');
+ $form_vars = ['class' => 'mtm'];
$replies .= elgg_view_form('discussion/reply/save', $form_vars, $vars);
}
?>
diff --git a/mod/discussions/views/default/elgg/discussion.js b/mod/discussions/views/default/elgg/discussion.js
index cf1001de6f3..1e440086cee 100644
--- a/mod/discussions/views/default/elgg/discussion.js
+++ b/mod/discussions/views/default/elgg/discussion.js
@@ -130,3 +130,4 @@ define(function (require) {
*/
elgg.discussion.Reply = Reply;
});
+
diff --git a/mod/discussions/views/default/forms/discussion/reply/save.php b/mod/discussions/views/default/forms/discussion/reply/save.php
index 1e302eb17a2..3bf7c49a2ce 100644
--- a/mod/discussions/views/default/forms/discussion/reply/save.php
+++ b/mod/discussions/views/default/forms/discussion/reply/save.php
@@ -65,4 +65,4 @@
'align' => 'horizontal',
]);
-elgg_set_form_footer($footer);
\ No newline at end of file
+elgg_set_form_footer($footer);
diff --git a/mod/discussions/views/default/forms/discussion/save.php b/mod/discussions/views/default/forms/discussion/save.php
index 5f27de59be5..8d0b3782f86 100644
--- a/mod/discussions/views/default/forms/discussion/save.php
+++ b/mod/discussions/views/default/forms/discussion/save.php
@@ -38,10 +38,10 @@
'#type' => 'select',
'name' => 'status',
'value' => $status,
- 'options_values' => array(
+ 'options_values' => [
'open' => elgg_echo('status:open'),
'closed' => elgg_echo('status:closed'),
- ),
+ ],
'#label' => elgg_echo('discussion:topic:status'),
],
[
@@ -73,4 +73,4 @@
'#type' => 'submit',
'value' => elgg_echo('save'),
]);
-elgg_set_form_footer($footer);
\ No newline at end of file
+elgg_set_form_footer($footer);
diff --git a/mod/discussions/views/default/groups/listing/discussion.php b/mod/discussions/views/default/groups/listing/discussion.php
index 7335bcbfe2a..79639d32048 100644
--- a/mod/discussions/views/default/groups/listing/discussion.php
+++ b/mod/discussions/views/default/groups/listing/discussion.php
@@ -6,4 +6,4 @@
*/
echo elgg_view('discussion/listing/all', [
'container_type' => 'group',
-]);
\ No newline at end of file
+]);
diff --git a/mod/discussions/views/default/object/discussion.php b/mod/discussions/views/default/object/discussion.php
index c97d722a634..0a31db6939e 100644
--- a/mod/discussions/views/default/object/discussion.php
+++ b/mod/discussions/views/default/object/discussion.php
@@ -3,8 +3,8 @@
* Forum topic entity view
*/
-$full = elgg_extract('full_view', $vars, FALSE);
-$topic = elgg_extract('entity', $vars, FALSE);
+$full = elgg_extract('full_view', $vars, false);
+$topic = elgg_extract('entity', $vars, false);
if (!$topic) {
return;
@@ -28,22 +28,22 @@
$replies_link = '';
$reply_text = '';
-$num_replies = elgg_get_entities(array(
+$num_replies = elgg_get_entities([
'type' => 'object',
'subtype' => 'discussion_reply',
'container_guid' => $topic->getGUID(),
'count' => true,
'distinct' => false,
-));
+]);
if ($num_replies != 0) {
- $last_reply = elgg_get_entities(array(
+ $last_reply = elgg_get_entities([
'type' => 'object',
'subtype' => 'discussion_reply',
'container_guid' => $topic->getGUID(),
'limit' => 1,
'distinct' => false,
- ));
+ ]);
if (isset($last_reply[0])) {
$last_reply = $last_reply[0];
}
@@ -58,76 +58,74 @@
'is_trusted' => true,
]);
- $replies_link = elgg_view('output/url', array(
+ $replies_link = elgg_view('output/url', [
'href' => $topic->getURL() . '#group-replies',
'text' => elgg_echo('discussion:replies') . " ($num_replies)",
'is_trusted' => true,
- ));
+ ]);
}
// do not show the metadata and controls in widget view
$metadata = '';
if (!elgg_in_context('widgets')) {
// only show entity menu outside of widgets
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $vars['entity'],
'handler' => 'discussion',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
if ($full) {
$subtitle = "$by_line $replies_link";
- $params = array(
+ $params = [
'entity' => $topic,
'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
- );
+ ];
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
- $body = elgg_view('output/longtext', array(
+ $body = elgg_view('output/longtext', [
'value' => $topic->description,
'class' => 'clearfix',
- ));
+ ]);
$responses = '';
if (elgg_extract('show_responses', $vars)) {
- $params = array(
+ $params = [
'topic' => $topic,
'show_add_form' => $topic->canWriteToContainer(0, 'object', 'discussion_reply'),
- );
+ ];
$responses = elgg_view('discussion/replies', $params);
if ($topic->status == 'closed') {
$responses .= elgg_view('discussion/closed');
}
}
- echo elgg_view('object/elements/full', array(
+ echo elgg_view('object/elements/full', [
'entity' => $topic,
'icon' => $poster_icon,
'summary' => $summary,
'body' => $body,
'responses' => $responses,
- ));
-
+ ]);
} else {
// brief view
$subtitle = "$by_line $replies_link $reply_text ";
- $params = array(
+ $params = [
'entity' => $topic,
'metadata' => $metadata,
'subtitle' => $subtitle,
'tags' => $tags,
'content' => $excerpt,
'icon' => $poster_icon,
- );
+ ];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
-
}
diff --git a/mod/discussions/views/default/object/discussion_reply.php b/mod/discussions/views/default/object/discussion_reply.php
index 1ed8df9f455..dc26f2864ed 100644
--- a/mod/discussions/views/default/object/discussion_reply.php
+++ b/mod/discussions/views/default/object/discussion_reply.php
@@ -13,36 +13,36 @@
$metadata = '';
if (!elgg_in_context('widgets')) {
// only show entity menu outside of widgets
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $vars['entity'],
'handler' => 'discussion_reply',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
if (elgg_in_context('activity')) {
$content = '';
- $content .= elgg_view('output/text', array(
+ $content .= elgg_view('output/text', [
'value' => elgg_get_excerpt($reply->description)
- ));
+ ]);
$content .= '
';
} else {
- $content = elgg_view('output/longtext', array(
+ $content = elgg_view('output/longtext', [
'value' => $reply->description,
'class' => 'elgg-inner',
'data-role' => 'discussion-reply-text',
- ));
+ ]);
}
$subtitle = elgg_view('object/elements/imprint', ['entity' => $reply]);
-$params = array(
+$params = [
'entity' => $reply,
'metadata' => $metadata,
'subtitle' => $subtitle,
'content' => $content,
'icon' => elgg_view_entity_icon($reply->getOwnerEntity(), 'tiny'),
-);
+];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
diff --git a/mod/discussions/views/default/resources/discussion/add.php b/mod/discussions/views/default/resources/discussion/add.php
index 5fe1b9641f3..ac76c18fcab 100644
--- a/mod/discussions/views/default/resources/discussion/add.php
+++ b/mod/discussions/views/default/resources/discussion/add.php
@@ -21,14 +21,14 @@
elgg_push_breadcrumb($title);
$body_vars = discussion_prepare_form_vars();
-$content = elgg_view_form('discussion/save', array(), $body_vars);
+$content = elgg_view_form('discussion/save', [], $body_vars);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('discussion/sidebar/edit'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/discussions/views/default/resources/discussion/all.php b/mod/discussions/views/default/resources/discussion/all.php
index d385fd674cd..27c75fd237e 100644
--- a/mod/discussions/views/default/resources/discussion/all.php
+++ b/mod/discussions/views/default/resources/discussion/all.php
@@ -7,12 +7,12 @@
$title = elgg_echo('discussion:latest');
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('discussion/sidebar'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/discussions/views/default/resources/discussion/edit.php b/mod/discussions/views/default/resources/discussion/edit.php
index 1ece5caaa00..f8b09611567 100644
--- a/mod/discussions/views/default/resources/discussion/edit.php
+++ b/mod/discussions/views/default/resources/discussion/edit.php
@@ -17,14 +17,14 @@
elgg_push_breadcrumb($title);
$body_vars = discussion_prepare_form_vars($topic);
-$content = elgg_view_form('discussion/save', array(), $body_vars);
+$content = elgg_view_form('discussion/save', [], $body_vars);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('discussion/sidebar/edit'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/discussions/views/default/resources/discussion/group.php b/mod/discussions/views/default/resources/discussion/group.php
index 64da4042e06..3876408d892 100644
--- a/mod/discussions/views/default/resources/discussion/group.php
+++ b/mod/discussions/views/default/resources/discussion/group.php
@@ -19,7 +19,7 @@
$title = elgg_echo('item:object:discussion');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'discussion',
'limit' => max(20, elgg_get_config('default_limit')),
@@ -28,16 +28,16 @@
'full_view' => false,
'no_results' => elgg_echo('discussion:none'),
'preload_owners' => true,
-);
+];
$content = elgg_list_entities($options);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('discussion/sidebar'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/discussions/views/default/resources/discussion/owner.php b/mod/discussions/views/default/resources/discussion/owner.php
index 333370dafed..13bf39a5971 100644
--- a/mod/discussions/views/default/resources/discussion/owner.php
+++ b/mod/discussions/views/default/resources/discussion/owner.php
@@ -21,7 +21,7 @@
$title = elgg_echo('item:object:discussion');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'discussion',
'limit' => max(20, elgg_get_config('default_limit')),
@@ -29,7 +29,7 @@
'full_view' => false,
'no_results' => elgg_echo('discussion:none'),
'preload_owners' => true,
-);
+];
if ($target instanceof ElggUser) {
// Display all discussions started by the user regardless of
@@ -41,13 +41,13 @@
$content = elgg_list_entities($options);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('discussion/sidebar'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/discussions/views/default/resources/discussion/reply/edit.php b/mod/discussions/views/default/resources/discussion/reply/edit.php
index a79241f4707..71a50a5695c 100644
--- a/mod/discussions/views/default/resources/discussion/reply/edit.php
+++ b/mod/discussions/views/default/resources/discussion/reply/edit.php
@@ -25,19 +25,19 @@
elgg_push_breadcrumb($topic->title, $topic->getURL());
elgg_push_breadcrumb($title);
-$params = array(
+$params = [
'guid' => $reply->guid,
'hidden' => false,
-);
+];
$content = elgg_view('ajax/discussion/reply/edit', $params);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('discussion/sidebar/edit'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
diff --git a/mod/discussions/views/default/resources/discussion/view.php b/mod/discussions/views/default/resources/discussion/view.php
index 3166806a161..0a1b423e654 100644
--- a/mod/discussions/views/default/resources/discussion/view.php
+++ b/mod/discussions/views/default/resources/discussion/view.php
@@ -30,12 +30,12 @@
'show_responses' => true,
]);
-$params = array(
+$params = [
'content' => $content,
'title' => $topic->title,
'sidebar' => elgg_view('discussion/sidebar'),
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
echo elgg_view_page($topic->title, $body);
diff --git a/mod/discussions/views/default/resources/elements/discussion_replies.php b/mod/discussions/views/default/resources/elements/discussion_replies.php
index bd46f793240..1144b7a88ea 100644
--- a/mod/discussions/views/default/resources/elements/discussion_replies.php
+++ b/mod/discussions/views/default/resources/elements/discussion_replies.php
@@ -11,13 +11,13 @@
return;
}
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'discussion_reply',
'container_guid' => $topic->guid,
'count' => true,
'distinct' => false,
-);
+];
$count = elgg_get_entities($options);
@@ -33,22 +33,22 @@
// these comments with the latest at the bottom.
$replies = array_reverse($replies);
- echo elgg_view_entity_list($replies, array('list_class' => 'elgg-river-comments'));
+ echo elgg_view_entity_list($replies, ['list_class' => 'elgg-river-comments']);
if ($count > 3) {
$more_count = $count - 3;
- $params = array(
+ $params = [
'href' => $topic->getURL(),
- 'text' => elgg_echo('river:comments:more', array($more_count)),
+ 'text' => elgg_echo('river:comments:more', [$more_count]),
'is_trusted' => true,
- );
+ ];
$link = elgg_view('output/url', $params);
echo "$link
";
}
}
if ($topic->canWriteToContainer(0, 'object', 'discussion_reply')) {
- $form_vars = array('id' => "discussion-reply-{$topic->guid}", 'class' => 'hidden');
- $body_vars = array('topic' => $topic, 'inline' => true);
+ $form_vars = ['id' => "discussion-reply-{$topic->guid}", 'class' => 'hidden'];
+ $body_vars = ['topic' => $topic, 'inline' => true];
echo elgg_view_form('discussion/reply/save', $form_vars, $body_vars);
}
diff --git a/mod/discussions/views/default/river/elements/discussion_replies.php b/mod/discussions/views/default/river/elements/discussion_replies.php
index 293955feb75..9f2d1e9315c 100644
--- a/mod/discussions/views/default/river/elements/discussion_replies.php
+++ b/mod/discussions/views/default/river/elements/discussion_replies.php
@@ -5,4 +5,4 @@
* @uses ElggObject $vars['topic'] Object with subtype "discussion"
*/
-echo elgg_view('resources/elements/discussion_replies', $vars);
\ No newline at end of file
+echo elgg_view('resources/elements/discussion_replies', $vars);
diff --git a/mod/discussions/views/default/river/object/discussion/create.php b/mod/discussions/views/default/river/object/discussion/create.php
index b42f20a3976..ed4ad745027 100644
--- a/mod/discussions/views/default/river/object/discussion/create.php
+++ b/mod/discussions/views/default/river/object/discussion/create.php
@@ -10,10 +10,10 @@
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-$responses = elgg_view('river/elements/discussion_replies', array('topic' => $object));
+$responses = elgg_view('river/elements/discussion_replies', ['topic' => $object]);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => $excerpt,
'responses' => $responses,
-));
+]);
diff --git a/mod/discussions/views/default/river/object/discussion_reply/create.php b/mod/discussions/views/default/river/object/discussion_reply/create.php
index f63aff7b37c..27827fcab69 100644
--- a/mod/discussions/views/default/river/object/discussion_reply/create.php
+++ b/mod/discussions/views/default/river/object/discussion_reply/create.php
@@ -10,31 +10,31 @@
$subject = $item->getSubjectEntity();
$target = $item->getTargetEntity();
-$subject_link = elgg_view('output/url', array(
+$subject_link = elgg_view('output/url', [
'href' => $subject->getURL(),
'text' => $subject->name,
'class' => 'elgg-river-subject',
'is_trusted' => true,
-));
+]);
-$target_link = elgg_view('output/url', array(
+$target_link = elgg_view('output/url', [
'href' => $target->getURL(),
'text' => $target->getDisplayName(),
'class' => 'elgg-river-target',
'is_trusted' => true,
-));
+]);
-$reply_link = elgg_view('output/url', array(
+$reply_link = elgg_view('output/url', [
'href' => $reply->getURL(),
'text' => elgg_echo('river:reply:view'),
'class' => 'elgg-river-target',
'is_trusted' => true,
-));
+]);
-$summary = elgg_echo('river:reply:object:discussion', array($subject_link, $target_link));
+$summary = elgg_echo('river:reply:object:discussion', [$subject_link, $target_link]);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => elgg_get_excerpt($reply->description). ' ' .$reply_link,
'summary' => $summary,
-));
+]);
diff --git a/mod/discussions/views/default/search/object/discussion_reply/entity.php b/mod/discussions/views/default/search/object/discussion_reply/entity.php
index 80337ad5864..bdebafa89fc 100644
--- a/mod/discussions/views/default/search/object/discussion_reply/entity.php
+++ b/mod/discussions/views/default/search/object/discussion_reply/entity.php
@@ -1,69 +1,69 @@
-getURL())
- * - search_time (defaults to entity->time_updated or entity->time_created)
- *
- * @uses $vars['entity'] Entity returned in a search
- */
-
-$entity = $vars['entity'];
-if (empty($entity) || !elgg_instanceof($entity, 'object', 'discussion_reply')) {
- return;
-}
-
-$topic = $entity->getContainerEntity();
-if (empty($topic) || !elgg_instanceof($topic, 'object', 'discussion')) {
- return;
-}
-
-$icon = $entity->getVolatileData('search_icon');
-if (!$icon) {
- // display the entity's owner by default if available.
- // @todo allow an option to switch to displaying the entity's icon instead.
- $type = $entity->getType();
- if ($type == 'user' || $type == 'group') {
- $icon = elgg_view_entity_icon($entity, 'tiny');
- } elseif ($owner = $entity->getOwnerEntity()) {
- $icon = elgg_view_entity_icon($owner, 'tiny');
- } else {
- // display a generic icon if no owner, though there will probably be
- // other problems if the owner can't be found.
- $icon = elgg_view_entity_icon($entity, 'tiny');
- }
-}
-
-$title = $entity->getVolatileData('search_matched_title');
-$description = $entity->getVolatileData('search_matched_description');
-$extra_info = $entity->getVolatileData('search_matched_extra');
-$url = $entity->getVolatileData('search_url');
-
-if (!$title) {
- $title = elgg_echo('discussion:search:title', array($topic->title));
-}
-
-if (!$url) {
- $url = $topic->getURL();
-}
-
-$title = "$title ";
-$time = $entity->getVolatileData('search_time');
-if (!$time) {
- $tc = $entity->time_created;
- $tu = $entity->time_updated;
- $time = elgg_view_friendly_time(($tu > $tc) ? $tu : $tc);
-}
-
-$body = "$title
$description";
-if ($extra_info) {
- $body .= "$extra_info
";
-}
-$body .= "$time
";
-
-echo elgg_view_image_block($icon, $body);
+getURL())
+ * - search_time (defaults to entity->time_updated or entity->time_created)
+ *
+ * @uses $vars['entity'] Entity returned in a search
+ */
+
+$entity = $vars['entity'];
+if (empty($entity) || !elgg_instanceof($entity, 'object', 'discussion_reply')) {
+ return;
+}
+
+$topic = $entity->getContainerEntity();
+if (empty($topic) || !elgg_instanceof($topic, 'object', 'discussion')) {
+ return;
+}
+
+$icon = $entity->getVolatileData('search_icon');
+if (!$icon) {
+ // display the entity's owner by default if available.
+ // @todo allow an option to switch to displaying the entity's icon instead.
+ $type = $entity->getType();
+ if ($type == 'user' || $type == 'group') {
+ $icon = elgg_view_entity_icon($entity, 'tiny');
+ } elseif ($owner = $entity->getOwnerEntity()) {
+ $icon = elgg_view_entity_icon($owner, 'tiny');
+ } else {
+ // display a generic icon if no owner, though there will probably be
+ // other problems if the owner can't be found.
+ $icon = elgg_view_entity_icon($entity, 'tiny');
+ }
+}
+
+$title = $entity->getVolatileData('search_matched_title');
+$description = $entity->getVolatileData('search_matched_description');
+$extra_info = $entity->getVolatileData('search_matched_extra');
+$url = $entity->getVolatileData('search_url');
+
+if (!$title) {
+ $title = elgg_echo('discussion:search:title', [$topic->title]);
+}
+
+if (!$url) {
+ $url = $topic->getURL();
+}
+
+$title = "$title ";
+$time = $entity->getVolatileData('search_time');
+if (!$time) {
+ $tc = $entity->time_created;
+ $tu = $entity->time_updated;
+ $time = elgg_view_friendly_time(($tu > $tc) ? $tu : $tc);
+}
+
+$body = "$title
$description";
+if ($extra_info) {
+ $body .= "$extra_info
";
+}
+$body .= "$time
";
+
+echo elgg_view_image_block($icon, $body);
diff --git a/mod/discussions/views/rss/discussion/replies.php b/mod/discussions/views/rss/discussion/replies.php
index a0d262fa71e..e4f646909b1 100644
--- a/mod/discussions/views/rss/discussion/replies.php
+++ b/mod/discussions/views/rss/discussion/replies.php
@@ -5,10 +5,10 @@
* @uses $vars['entity'] ElggEntity
*/
-$options = array(
+$options = [
'container_guid' => $vars['topic']->getGUID(),
'type' => 'object',
'subtype' => 'discussion_reply',
'distinct' => false,
-);
+];
echo elgg_list_entities($options);
diff --git a/mod/embed/languages/ca.php b/mod/embed/languages/ca.php
index 034b8696678..39790dde42d 100644
--- a/mod/embed/languages/ca.php
+++ b/mod/embed/languages/ca.php
@@ -1,5 +1,5 @@
'Incrustat',
'embed:media' => 'Contingut incrustat',
'embed:instructions' => 'Prem a qualsevol fitxer per incrustar-lo al teu contingut.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'No s\'ha trobat res.',
'embed:no_sections' => 'No s\'han trobat extensions suportades. Consulta-ho amb l\'administrador del lloc per a que habiliti una extensió amb suport per incrustar recursos.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/cmn.php b/mod/embed/languages/cmn.php
index 29c3d7ce52a..3d6fe513262 100644
--- a/mod/embed/languages/cmn.php
+++ b/mod/embed/languages/cmn.php
@@ -1,5 +1,5 @@
'內嵌',
'embed:media' => '內嵌內容',
'embed:instructions' => '在任何檔案上按一下以將它內嵌到您的內容。',
@@ -11,4 +11,4 @@
'embed:no_section_content' => '找不到任何項目。',
'embed:no_sections' => '找不到任何支援的內嵌外掛程式。請向站臺管理者要求啟用具內嵌支援的外掛程式。',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/da.php b/mod/embed/languages/da.php
index b2be94e157f..41b2efb8910 100644
--- a/mod/embed/languages/da.php
+++ b/mod/embed/languages/da.php
@@ -1,5 +1,5 @@
'Embed',
'embed:media' => 'Embed indhold',
'embed:instructions' => 'Klik på en fil for at embedde den i dit indhold.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Ingen emner fundet.',
'embed:no_sections' => 'No supported embed plugins found. Ask the site administrator to enabled a plugin with embed support.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/de.php b/mod/embed/languages/de.php
index 0039f850d4f..422422694b5 100644
--- a/mod/embed/languages/de.php
+++ b/mod/embed/languages/de.php
@@ -1,5 +1,5 @@
'Einbetten',
'embed:media' => 'Inhalt einbetten',
'embed:instructions' => 'Klicke eine verfügbare Datei an, um sie in Deinen Eintrag einzubetten.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Keine Datei zum Einbetten vorhanden.',
'embed:no_sections' => 'Es wurden keine Plugins gefunden, die das Einbetten von Inhalten unterstützen. Bitte den Admin der Community-Seite ein solches Plugin (oder auch entsprechend den Anforderungen ggf. mehrere) zu aktivieren.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/en.php b/mod/embed/languages/en.php
index 0fef4cf677b..ae2743dd1a2 100644
--- a/mod/embed/languages/en.php
+++ b/mod/embed/languages/en.php
@@ -1,5 +1,5 @@
'Embed',
'embed:media' => 'Embed content',
'embed:instructions' => 'Click on any file to embed it into your content.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'No items found.',
'embed:no_sections' => 'No supported embed plugins found. Ask the site administrator to enabled a plugin with embed support.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/es.php b/mod/embed/languages/es.php
index bef08579c4e..c20c4893ceb 100644
--- a/mod/embed/languages/es.php
+++ b/mod/embed/languages/es.php
@@ -1,5 +1,5 @@
'Incrustado',
'embed:media' => 'Contenido incrustado',
'embed:instructions' => 'Click en cualquier archivo paraincrustar en el contenido.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'No hay elementos encontrados.',
'embed:no_sections' => 'No se han encontrado plugins de contenido incrustado admitido. Pregunte al administrador del sitio para habilitar un plugin con el soporte de contenido incrustado apropiado.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/eu_es.php b/mod/embed/languages/eu_es.php
index bbeaa69c210..6887bf1545e 100644
--- a/mod/embed/languages/eu_es.php
+++ b/mod/embed/languages/eu_es.php
@@ -1,5 +1,5 @@
'Kapsulaketa',
'embed:media' => 'Kapsulatutako edukia',
'embed:instructions' => 'Klikatu edozein fitxategitan zure edukian kapsulatzeko.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Ez da elementurik aurkitu.',
'embed:no_sections' => 'Ez da aurkitu kapsulaketarekin bateragarria den pluginik. Administratzaileari galdetu kapsulaketarekin bateragarria den plugin bat gaitzeko.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/fi.php b/mod/embed/languages/fi.php
index 6c173342812..1574de8182d 100644
--- a/mod/embed/languages/fi.php
+++ b/mod/embed/languages/fi.php
@@ -1,5 +1,5 @@
'Upota',
'embed:media' => 'Upota sisältöä',
'embed:instructions' => 'Valitse tiedosto upottaaksesi sen osaksi sisältöä.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Kohteita ei löytynyt.',
'embed:no_sections' => 'Upottamista tukevia liitännäisiä ei löytynyt. Pyydä sivuston ylläpitäjää ottamaan käyttöön liitännäisiä, jotka tukevat upottamista.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/fr.php b/mod/embed/languages/fr.php
index 7a78de42f3f..d0ba2c9a425 100644
--- a/mod/embed/languages/fr.php
+++ b/mod/embed/languages/fr.php
@@ -1,5 +1,5 @@
'Intégrer un contenu',
'embed:media' => 'Intégrer un média',
'embed:instructions' => 'Cliquez sur l\'élément de votre choix pour l\'intégrer dans le contenu.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Aucun élément trouvé.',
'embed:no_sections' => 'Aucun plugin gérant l\'intégration de fichier média n\'a été trouvé. Demandez à l\'administrateur du site d\'activer un plugin qui gère l\'intégration de fichier média.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/gl.php b/mod/embed/languages/gl.php
index 12b00335451..c66109edbdb 100644
--- a/mod/embed/languages/gl.php
+++ b/mod/embed/languages/gl.php
@@ -1,5 +1,5 @@
'Incrustar',
'embed:media' => 'Incrustar o contido',
'embed:instructions' => 'Prema calquera ficheiro para incrustalo no seu contido.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Non se atopou ningún elemento',
'embed:no_sections' => 'Non se atopou ningún complemento de incrustación compatíbel. Solicítelle ao administrador que active un complemento compatíbel con incrustacións.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/it.php b/mod/embed/languages/it.php
index 340cc3088bb..f990aeca5b6 100644
--- a/mod/embed/languages/it.php
+++ b/mod/embed/languages/it.php
@@ -1,5 +1,5 @@
'Incorpora',
'embed:media' => 'Incorpora contenuto',
'embed:instructions' => 'Clicca su qualsiasi file per incorporarlo nel tuo contenuto',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Nessun elemento trovato',
'embed:no_sections' => 'Non abbiamo trovato alcun plugin supportato per l\'incorporamento. Chiedi all\'amministratore del sito di abilitare un plugin che supporti l\'incorporamento.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/ja.php b/mod/embed/languages/ja.php
index e2fb5fcd55c..5df6553b7c2 100644
--- a/mod/embed/languages/ja.php
+++ b/mod/embed/languages/ja.php
@@ -1,5 +1,5 @@
'埋め込み',
'embed:media' => '埋め込むコンテント',
'embed:instructions' => 'コンテントに埋め込むファイルをクリックしてください。',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'アイテムが見つかりませんでした',
'embed:no_sections' => 'サポートされている埋め込みプラグインが見つかりませんでした。埋め込みサポート済みのプラグインが利用できるかどうか、サイト管理者にお問い合わせください。',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/ko.php b/mod/embed/languages/ko.php
index 1616d96be97..591c1a49d6a 100644
--- a/mod/embed/languages/ko.php
+++ b/mod/embed/languages/ko.php
@@ -1,5 +1,5 @@
'끼워넣기',
'embed:media' => '내용을 끼워넣습니다',
'embed:instructions' => '당신의 글에 끼워넣을 파일을 누르세요',
@@ -11,4 +11,4 @@
'embed:no_section_content' => '항목이 없습니다.',
'embed:no_sections' => '지원되는 끼워넣기 플러긴을 찾을 수 없었습니다. 관리자에게 해당 기능을 활성화해달라고 요구하세요.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/nl.php b/mod/embed/languages/nl.php
index 14c6397b4fd..8fc811de666 100644
--- a/mod/embed/languages/nl.php
+++ b/mod/embed/languages/nl.php
@@ -1,5 +1,5 @@
'Toevoegen',
'embed:media' => 'Bijlage toevoegen',
'embed:instructions' => 'Klik op een bestand om het aan je content toe te voegen.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Geen items gevonden',
'embed:no_sections' => 'Er is geen plugin geactiveerd die het mogelijk maakt om bijlagen toe te voegen. Je kunt aan de sitebeheerder vragen om dit wel mogelijk te maken.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/pl.php b/mod/embed/languages/pl.php
index c1224c892bb..7fdabdaa788 100644
--- a/mod/embed/languages/pl.php
+++ b/mod/embed/languages/pl.php
@@ -1,5 +1,5 @@
'Osadź',
'embed:media' => 'Osadź treść',
'embed:instructions' => 'Kliknij na dowolnym pliku aby osadzić go w treści.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Nie znaleziono elementów.',
'embed:no_sections' => 'Nie znaleziono wspieranych wtyczek osadzających. Zapytaj administratora o wtyczki wspierające osadzanie.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/pt_br.php b/mod/embed/languages/pt_br.php
index 17cf92ea022..36aa50c344b 100644
--- a/mod/embed/languages/pt_br.php
+++ b/mod/embed/languages/pt_br.php
@@ -1,5 +1,5 @@
'Incorporar',
'embed:media' => 'Incorporar mídia',
'embed:instructions' => 'Clique em qualquer arquivo para incorporá-lo ao conteúdo.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Nenhum item encontrado.',
'embed:no_sections' => 'Nenhum plugin de suporte a incorporação foi encontrado. Procure o administrador do site para habilitar o suporte necessário.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/ru.php b/mod/embed/languages/ru.php
index 32e15ffc22b..3ae35eef3fb 100644
--- a/mod/embed/languages/ru.php
+++ b/mod/embed/languages/ru.php
@@ -1,5 +1,5 @@
'Медиа',
'embed:media' => 'Вставить',
'embed:instructions' => 'Для вставки нажмите на файл',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Не найдено.',
'embed:no_sections' => 'Нет возможности загрузить файлы. Ваш администратор должен активировать файловый плагин.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/tr.php b/mod/embed/languages/tr.php
index 46405752f1e..431ae4a2450 100644
--- a/mod/embed/languages/tr.php
+++ b/mod/embed/languages/tr.php
@@ -1,5 +1,5 @@
'Göm',
'embed:media' => 'İçeriği göm',
'embed:instructions' => 'İçeriğinize eklemek için herhangi bir dosyaya tıklayın.',
@@ -11,4 +11,4 @@
'embed:no_section_content' => 'Öğe bulunamadı.',
'embed:no_sections' => 'Desteklenen gömme eklentisi bulunamadı. Gömme desteği sunan bir eklenti etkinleştirmesi için site yöneticisiyle bağlantı kurun.',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/languages/zh_hans.php b/mod/embed/languages/zh_hans.php
index 4d2dad0c403..7907067da54 100644
--- a/mod/embed/languages/zh_hans.php
+++ b/mod/embed/languages/zh_hans.php
@@ -1,5 +1,5 @@
'嵌入',
'embed:media' => '嵌入内容',
'embed:instructions' => '点击任意文件以嵌入到你的内容中',
@@ -11,4 +11,4 @@
'embed:no_section_content' => '无项目',
'embed:no_sections' => '无支持的嵌入插件。请联系管理员启用支持嵌入的插件。',
-);
\ No newline at end of file
+];
diff --git a/mod/embed/start.php b/mod/embed/start.php
index 6e0016430be..341736e7555 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -31,8 +31,8 @@ function embed_init() {
*
* @param string $hook
* @param string $type
- * @param array $items
- * @param array $vars
+ * @param array $items
+ * @param array $vars
* @return array
*/
function embed_longtext_menu($hook, $type, $items, $vars) {
@@ -60,7 +60,7 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
]);
}
- $items[] = ElggMenuItem::factory(array(
+ $items[] = ElggMenuItem::factory([
'name' => 'embed',
'href' => 'javascript:',
'data-colorbox-opts' => json_encode([
@@ -71,7 +71,7 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$id} elgg-lightbox",
'deps' => ['elgg/embed'],
'priority' => 10,
- ));
+ ]);
return $items;
}
@@ -81,8 +81,8 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
*
* @param string $hook
* @param string $type
- * @param array $items
- * @param array $vars
+ * @param array $items
+ * @param array $vars
*/
function embed_select_tab($hook, $type, $items, $vars) {
@@ -111,7 +111,7 @@ function embed_page_handler($page) {
elgg_ajax_gatekeeper();
- $container_guid = (int)get_input('container_guid');
+ $container_guid = (int) get_input('container_guid');
if ($container_guid) {
$container = get_entity($container_guid);
@@ -136,12 +136,12 @@ function embed_page_handler($page) {
* @param array $vars Display parameters
* @return string
*/
-function embed_list_items($entities, $vars = array()) {
+function embed_list_items($entities, $vars = []) {
- $defaults = array(
+ $defaults = [
'items' => $entities,
'list_class' => 'elgg-list-entity',
- );
+ ];
$vars = array_merge($defaults, $vars);
@@ -154,9 +154,9 @@ function embed_list_items($entities, $vars = array()) {
* @param array $options
* @return array
*/
-function embed_get_list_options($options = array()) {
+function embed_get_list_options($options = []) {
- $container_guids = array(elgg_get_logged_in_user_guid());
+ $container_guids = [elgg_get_logged_in_user_guid()];
if (elgg_get_page_owner_guid()) {
$page_owner_guid = elgg_get_page_owner_guid();
if ($page_owner_guid != elgg_get_logged_in_user_guid()) {
@@ -164,11 +164,11 @@ function embed_get_list_options($options = array()) {
}
}
- $defaults = array(
+ $defaults = [
'limit' => 6,
'container_guids' => $container_guids,
'item_class' => 'embed-item',
- );
+ ];
$options = array_merge($defaults, $options);
@@ -178,7 +178,7 @@ function embed_get_list_options($options = array()) {
/**
* Substitutes thumbnail's inline URL with a permanent URL
* Registered with a very late priority of 1000 to ensure we replace all previous values
- *
+ *
* @param string $hook "entity:icon:url"
* @param string $type "object"
* @param string $return URL
diff --git a/mod/embed/views/default/elgg/embed.js b/mod/embed/views/default/elgg/embed.js
index f7503a19036..fce3013c034 100644
--- a/mod/embed/views/default/elgg/embed.js
+++ b/mod/embed/views/default/elgg/embed.js
@@ -118,9 +118,7 @@ define(function (require) {
$('.embed-throbber').hide();
$('.embed-wrapper .elgg-form-file-upload').show();
}
- }
-
- // ie 7 and 8 have a null response because of the use of an iFrame
+ } // ie 7 and 8 have a null response because of the use of an iFrame
// so just show the list after upload.
// http://jquery.malsup.com/form/#file-upload claims you can wrap JSON
// in a textarea, but a quick test didn't work, and that is fairly
@@ -179,3 +177,4 @@ define(function (require) {
return embed;
});
+
diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php
index 86400f7178d..86d5f01c77b 100644
--- a/mod/embed/views/default/embed/css.php
+++ b/mod/embed/views/default/embed/css.php
@@ -1,7 +1,7 @@
diff --git a/mod/embed/views/default/embed/item.php b/mod/embed/views/default/embed/item.php
index 596ce51ada3..fb619b73ec8 100644
--- a/mod/embed/views/default/embed/item.php
+++ b/mod/embed/views/default/embed/item.php
@@ -22,13 +22,13 @@
'show_links' => false,
]);
-$image = elgg_view_entity_icon($entity, 'small', array('link_class' => 'embed-insert'));
+$image = elgg_view_entity_icon($entity, 'small', ['link_class' => 'embed-insert']);
-$params = array(
+$params = [
'title' => $title,
'entity' => $entity,
'subtitle' => $subtitle,
- 'tags' => FALSE,
+ 'tags' => false,
'icon' => $image,
-);
+];
echo elgg_view('object/elements/summary', $params);
diff --git a/mod/embed/views/default/embed/layout.php b/mod/embed/views/default/embed/layout.php
index b8f8b26b352..e4842c97503 100644
--- a/mod/embed/views/default/embed/layout.php
+++ b/mod/embed/views/default/embed/layout.php
@@ -5,9 +5,9 @@
$title = elgg_view_title(elgg_echo('embed:media'));
-$menu = elgg_view_menu('embed', array(
+$menu = elgg_view_menu('embed', [
'sort_by' => 'priority'
-));
+]);
$selected = elgg_get_config('embed_tab');
if ($selected->getData('view')) {
@@ -23,14 +23,14 @@
}
}
-$tab .= elgg_view('graphics/ajax_loader', array(
+$tab .= elgg_view('graphics/ajax_loader', [
'class' => 'embed-throbber mtl',
-));
+]);
-$container_info = elgg_view('input/hidden', array(
+$container_info = elgg_view('input/hidden', [
'name' => 'embed_container_guid',
'value' => elgg_get_page_owner_guid(),
-));
+]);
echo <<
diff --git a/mod/embed/views/default/embed/list.php b/mod/embed/views/default/embed/list.php
index 00afaf99dce..2a73acb67fd 100644
--- a/mod/embed/views/default/embed/list.php
+++ b/mod/embed/views/default/embed/list.php
@@ -21,4 +21,4 @@
}
$vars['item_view'] = 'embed/item';
-echo elgg_view('page/components/list', $vars);
\ No newline at end of file
+echo elgg_view('page/components/list', $vars);
diff --git a/mod/embed/views/default/navigation/menu/embed.php b/mod/embed/views/default/navigation/menu/embed.php
index bca673f592c..842721666b9 100644
--- a/mod/embed/views/default/navigation/menu/embed.php
+++ b/mod/embed/views/default/navigation/menu/embed.php
@@ -5,14 +5,14 @@
* @uses $vars['menu']['default']
*/
-$tabs = array();
+$tabs = [];
foreach ($vars['menu']['default'] as $menu_item) {
- $tabs[] = array(
+ $tabs[] = [
'title' => $menu_item->getText(),
'url' => 'embed/tab/' . $menu_item->getName(),
'link_class' => 'embed-section',
'selected' => $menu_item->getSelected(),
- );
+ ];
}
-echo elgg_view('navigation/tabs', array('tabs' => $tabs));
+echo elgg_view('navigation/tabs', ['tabs' => $tabs]);
diff --git a/mod/externalpages/languages/ca.php b/mod/externalpages/languages/ca.php
index 107fb0fef56..3b13847914c 100644
--- a/mod/externalpages/languages/ca.php
+++ b/mod/externalpages/languages/ca.php
@@ -1,5 +1,5 @@
"S'ha enviat correctament la pàgina",
'expages:error' => "Ui, torna-ho a provar o posa't en contacte l'administrador/a de la xarxa.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/cmn.php b/mod/externalpages/languages/cmn.php
index cc7eedd9e4f..7f7c6f1c517 100644
--- a/mod/externalpages/languages/cmn.php
+++ b/mod/externalpages/languages/cmn.php
@@ -1,5 +1,5 @@
"您的頁面已成功更新。",
'expages:error' => "無法儲存這個頁面。",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/da.php b/mod/externalpages/languages/da.php
index f906f843f7e..81f572e2f24 100644
--- a/mod/externalpages/languages/da.php
+++ b/mod/externalpages/languages/da.php
@@ -1,5 +1,5 @@
"Din side blev opdateret.",
'expages:error' => "Kunne ikke gemme denne side.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/de.php b/mod/externalpages/languages/de.php
index 081512b543a..3188d0beeff 100644
--- a/mod/externalpages/languages/de.php
+++ b/mod/externalpages/languages/de.php
@@ -1,5 +1,5 @@
"Dein Seiten-Eintrag wurde gespeichert.",
'expages:error' => "Beim Speichern der Seite ist ein Fehler aufgetreten.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/en.php b/mod/externalpages/languages/en.php
index b8dbaca8e0f..58a7aeb2f97 100644
--- a/mod/externalpages/languages/en.php
+++ b/mod/externalpages/languages/en.php
@@ -1,5 +1,5 @@
"Your page was successfully updated.",
'expages:error' => "Unable to save this page.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/es.php b/mod/externalpages/languages/es.php
index 0f4a299f76a..d24edaa5705 100644
--- a/mod/externalpages/languages/es.php
+++ b/mod/externalpages/languages/es.php
@@ -1,5 +1,5 @@
"La página ha sido guardada correctamente.",
'expages:error' => "No se pudo guardar la página.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/eu_es.php b/mod/externalpages/languages/eu_es.php
index 59e498e9cb9..fdc1d40f4c9 100644
--- a/mod/externalpages/languages/eu_es.php
+++ b/mod/externalpages/languages/eu_es.php
@@ -1,5 +1,5 @@
"Zure orrialdea arrakastaz eguneratu da.",
'expages:error' => "Ezinezkoa da orrialdea gordetzea.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/fi.php b/mod/externalpages/languages/fi.php
index c61044f0885..30c39f2553a 100644
--- a/mod/externalpages/languages/fi.php
+++ b/mod/externalpages/languages/fi.php
@@ -1,5 +1,5 @@
"Sivu päivitetty.",
'expages:error' => "Sivun tallentaminen epäonnistui.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/fr.php b/mod/externalpages/languages/fr.php
index 4e523afa58e..0ea3711450a 100644
--- a/mod/externalpages/languages/fr.php
+++ b/mod/externalpages/languages/fr.php
@@ -1,5 +1,5 @@
"La page externe a bien été mise à jour.",
'expages:error' => "Impossible d'enregistrer cette page.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/gl.php b/mod/externalpages/languages/gl.php
index 6a0ee5c85af..3941275680a 100644
--- a/mod/externalpages/languages/gl.php
+++ b/mod/externalpages/languages/gl.php
@@ -1,5 +1,5 @@
"Actualizouse a páxina.",
'expages:error' => "Non é posíbel gardar a páxina.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/it.php b/mod/externalpages/languages/it.php
index 7a7b3e52b37..43aee8e89b9 100644
--- a/mod/externalpages/languages/it.php
+++ b/mod/externalpages/languages/it.php
@@ -1,5 +1,5 @@
"La tua pagina è stata aggiornata con successo.",
'expages:error' => "Non è possibile salvare questa pagina.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/ja.php b/mod/externalpages/languages/ja.php
index 99f68037e41..5c51ed87bab 100644
--- a/mod/externalpages/languages/ja.php
+++ b/mod/externalpages/languages/ja.php
@@ -1,5 +1,5 @@
"ページを更新しました。",
'expages:error' => "このページを保存できませんでした。",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/ko.php b/mod/externalpages/languages/ko.php
index f1cdce8795f..9ab5c0fda67 100644
--- a/mod/externalpages/languages/ko.php
+++ b/mod/externalpages/languages/ko.php
@@ -1,5 +1,5 @@
"페이지가 성공적으로 갱신되었습니다.",
'expages:error' => "이 페이지를 저장할 수 없슴.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/nl.php b/mod/externalpages/languages/nl.php
index c95761a4a76..c5786038832 100644
--- a/mod/externalpages/languages/nl.php
+++ b/mod/externalpages/languages/nl.php
@@ -1,5 +1,5 @@
"Je pagina is succesvol bijgewerkt.",
'expages:error' => "De pagina kon niet worden opgeslagen.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/pl.php b/mod/externalpages/languages/pl.php
index da600c8cfd8..2d683ebd6ee 100644
--- a/mod/externalpages/languages/pl.php
+++ b/mod/externalpages/languages/pl.php
@@ -1,5 +1,5 @@
"Twoja strona została pomyślnie zaktualizowana.",
'expages:error' => "Nie można zapisać tej strony.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/pt_br.php b/mod/externalpages/languages/pt_br.php
index 91232de44ee..6b39533160a 100644
--- a/mod/externalpages/languages/pt_br.php
+++ b/mod/externalpages/languages/pt_br.php
@@ -1,5 +1,5 @@
"Sua página foi enviada com sucesso.",
'expages:error' => "Ocorreu um erro, por favor tente novamente e se o problema persistir contate o administrador",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/ru.php b/mod/externalpages/languages/ru.php
index 494235de38f..8a7dc95136f 100644
--- a/mod/externalpages/languages/ru.php
+++ b/mod/externalpages/languages/ru.php
@@ -1,5 +1,5 @@
"Страница успешно сохранена.",
'expages:error' => "Ошибка при сохранении.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/sr.php b/mod/externalpages/languages/sr.php
index 2c7c48612d7..7d39ada3089 100644
--- a/mod/externalpages/languages/sr.php
+++ b/mod/externalpages/languages/sr.php
@@ -1,5 +1,5 @@
"Страна је успешно сачувана.",
'expages:error' => "Страна није сачувана.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/languages/tr.php b/mod/externalpages/languages/tr.php
index 4977c8471ae..21ebb9eed64 100644
--- a/mod/externalpages/languages/tr.php
+++ b/mod/externalpages/languages/tr.php
@@ -1,5 +1,5 @@
"Sayfa başarılı şekilde kaydedildi.",
'expages:error' => "Bu sayfa kaydedilemiyor.",
-);
\ No newline at end of file
+];
diff --git a/mod/externalpages/start.php b/mod/externalpages/start.php
index 338288d6491..da81722cd44 100644
--- a/mod/externalpages/start.php
+++ b/mod/externalpages/start.php
@@ -29,8 +29,8 @@ function expages_init() {
* Extend the public pages range
*
*/
-function expages_public($hook, $handler, $return, $params){
- $pages = array('about', 'terms', 'privacy');
+function expages_public($hook, $handler, $return, $params) {
+ $pages = ['about', 'terms', 'privacy'];
return array_merge($pages, $return);
}
@@ -38,7 +38,7 @@ function expages_public($hook, $handler, $return, $params){
* Setup the links to site pages
*/
function expages_setup_footer_menu() {
- $pages = array('about', 'terms', 'privacy');
+ $pages = ['about', 'terms', 'privacy'];
foreach ($pages as $page) {
$url = "$page";
$wg_item = new ElggMenuItem($page, elgg_echo("expages:$page"), $url);
@@ -78,12 +78,12 @@ function expages_page_handler($page, $handler) {
]);
if (elgg_is_admin_logged_in()) {
- elgg_register_menu_item('title', array(
+ elgg_register_menu_item('title', [
'name' => 'edit',
'text' => elgg_echo('edit'),
'href' => "admin/appearance/expages?type=$type",
'link_class' => 'elgg-button elgg-button-action',
- ));
+ ]);
}
$shell = 'default';
@@ -113,14 +113,14 @@ function expages_page_handler($page, $handler) {
function expages_menu_register_hook($hook, $type, $return, $params) {
$type = elgg_extract('type', $params);
- $pages = array('about', 'terms', 'privacy');
+ $pages = ['about', 'terms', 'privacy'];
foreach ($pages as $page) {
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => $page,
'text' => elgg_echo("expages:$page"),
'href' => "admin/appearance/expages?type=$page",
'selected' => $page === $type,
- ));
+ ]);
}
return $return;
}
diff --git a/mod/externalpages/views/default/admin/appearance/expages.php b/mod/externalpages/views/default/admin/appearance/expages.php
index 6a5a521a55a..b5d62bbf44d 100644
--- a/mod/externalpages/views/default/admin/appearance/expages.php
+++ b/mod/externalpages/views/default/admin/appearance/expages.php
@@ -5,6 +5,6 @@
$type = get_input('type', 'about');
-echo elgg_view('expages/menu', array('type' => $type));
+echo elgg_view('expages/menu', ['type' => $type]);
-echo elgg_view_form('expages/edit', array('class' => 'elgg-form-settings'), array('type' => $type));
+echo elgg_view_form('expages/edit', ['class' => 'elgg-form-settings'], ['type' => $type]);
diff --git a/mod/externalpages/views/default/forms/expages/edit.php b/mod/externalpages/views/default/forms/expages/edit.php
index e7bea9cac42..50b6dd73781 100644
--- a/mod/externalpages/views/default/forms/expages/edit.php
+++ b/mod/externalpages/views/default/forms/expages/edit.php
@@ -1,19 +1,19 @@
'object',
'subtype' => $type,
'limit' => 1,
-));
+]);
if ($page_contents) {
$description = $page_contents[0]->description;
@@ -24,28 +24,28 @@
}
// set the required form variables
-$input_area = elgg_view('input/longtext', array(
+$input_area = elgg_view('input/longtext', [
'name' => 'expagescontent',
'value' => $description,
-));
-$submit_input = elgg_view('input/submit', array(
+]);
+$submit_input = elgg_view('input/submit', [
'name' => 'submit',
'value' => elgg_echo('save'),
-));
-$view_page = elgg_view('output/url', array(
+]);
+$view_page = elgg_view('output/url', [
'text' => elgg_echo('expages:edit:viewpage'),
'href' => $type,
'target' => '_blank',
'class' => 'elgg-button elgg-button-action float-alt',
-));
-$hidden_type = elgg_view('input/hidden', array(
+]);
+$hidden_type = elgg_view('input/hidden', [
'name' => 'content_type',
'value' => $type,
-));
-$hidden_guid = elgg_view('input/hidden', array(
+]);
+$hidden_guid = elgg_view('input/hidden', [
'name' => 'guid',
'value' => $guid,
-));
+]);
$external_page_title = elgg_echo("expages:$type");
diff --git a/mod/file/actions/file/delete.php b/mod/file/actions/file/delete.php
index 4a5ad58779c..1f44d5f7857 100644
--- a/mod/file/actions/file/delete.php
+++ b/mod/file/actions/file/delete.php
@@ -1,7 +1,7 @@
tags = string_to_tag_array($tags);
if ($uploaded_file && $uploaded_file->isValid()) {
-
if ($file->acceptUploadedFile($uploaded_file)) {
$guid = $file->save();
}
@@ -82,7 +81,7 @@
if (isset($reset_icon_urls)) {
// we touch the thumbs because we want new URLs from \Elgg\FileService\File::getURL
- $thumbnails = array($file->thumbnail, $file->smallthumb, $file->largethumb);
+ $thumbnails = [$file->thumbnail, $file->smallthumb, $file->largethumb];
foreach ($thumbnails as $thumbnail) {
$thumbfile = new ElggFile();
$thumbfile->owner_guid = $file->owner_guid;
@@ -104,12 +103,12 @@
if ($guid) {
$message = elgg_echo("file:saved");
system_message($message);
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/file/create',
'action_type' => 'create',
'subject_guid' => elgg_get_logged_in_user_guid(),
'object_guid' => $file->guid,
- ));
+ ]);
} else {
// failed to save file object - nothing we can do about this
$error = elgg_echo("file:uploadfailed");
@@ -122,7 +121,6 @@
} else {
forward("file/owner/$container->username");
}
-
} else {
if ($guid) {
system_message(elgg_echo("file:saved"));
diff --git a/mod/file/languages/da.php b/mod/file/languages/da.php
index dccd7dccd1b..449f1cb470c 100644
--- a/mod/file/languages/da.php
+++ b/mod/file/languages/da.php
@@ -1,5 +1,5 @@
"Du har ikke tilladelse ti at ændre denne fil",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Du skal vælge en fil",
-);
+];
diff --git a/mod/file/languages/de.php b/mod/file/languages/de.php
index a1882796fd1..8b06278cf1c 100644
--- a/mod/file/languages/de.php
+++ b/mod/file/languages/de.php
@@ -1,5 +1,5 @@
"Du hast keine Berechtigung, um diesen Datei-Eintrag zu ändern.",
'file:cannotload' => "Beim Hochladen dieser Datei ist ein Fehler aufgetreten.",
'file:nofile' => "Du mußt eine Datei auswählen.",
-);
+];
diff --git a/mod/file/languages/en.php b/mod/file/languages/en.php
index cef5cb98af6..b1dbab8732c 100644
--- a/mod/file/languages/en.php
+++ b/mod/file/languages/en.php
@@ -1,5 +1,5 @@
"You do not have permissions to change this file",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "You must select a file",
-);
+];
diff --git a/mod/file/languages/es.php b/mod/file/languages/es.php
index 5ba462492e3..5beffcdb7de 100644
--- a/mod/file/languages/es.php
+++ b/mod/file/languages/es.php
@@ -1,5 +1,5 @@
"No tienes permisos para modficar este archivo",
'file:cannotload' => "Ha habido un error subiendo el archivo",
'file:nofile' => "Debes seleccionar un archivo",
-);
+];
diff --git a/mod/file/languages/eu_es.php b/mod/file/languages/eu_es.php
index cc8c7d86496..0b1cb0db1a7 100644
--- a/mod/file/languages/eu_es.php
+++ b/mod/file/languages/eu_es.php
@@ -1,5 +1,5 @@
"Ez duzu baimenik fitxategi hau aldatzeko",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Fitxategi bat aukeratu behar duzu",
-);
+];
diff --git a/mod/file/languages/fi.php b/mod/file/languages/fi.php
index ca5fd47cdbe..db24390f576 100644
--- a/mod/file/languages/fi.php
+++ b/mod/file/languages/fi.php
@@ -1,5 +1,5 @@
"Sinulla ei ole oikeuksia tämän tiedoston muuttamiseen",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Sinun pitää valita tiedosto",
-);
+];
diff --git a/mod/file/languages/fr.php b/mod/file/languages/fr.php
index f8537adad70..86ba01ac325 100644
--- a/mod/file/languages/fr.php
+++ b/mod/file/languages/fr.php
@@ -1,5 +1,5 @@
"Vous n'avez pas la permission de modifier ce fichier",
'file:cannotload' => "Une erreur s'est produite lors de l'envoi du fichier",
'file:nofile' => "Vous devez sélectionner un fichier",
-);
+];
diff --git a/mod/file/languages/gl.php b/mod/file/languages/gl.php
index a35a3d8a7b4..12cca3acb13 100644
--- a/mod/file/languages/gl.php
+++ b/mod/file/languages/gl.php
@@ -1,5 +1,5 @@
"Non ten permisos para cambiar o ficheiro.",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Debe seleccionar un ficheiro.",
-);
+];
diff --git a/mod/file/languages/it.php b/mod/file/languages/it.php
index 3dde53cac96..0587074a043 100644
--- a/mod/file/languages/it.php
+++ b/mod/file/languages/it.php
@@ -1,5 +1,5 @@
"Non hai il permesso di modificare questo file",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Devi selezionare un file",
-);
+];
diff --git a/mod/file/languages/ja.php b/mod/file/languages/ja.php
index f101dd360e9..c56223bdc99 100644
--- a/mod/file/languages/ja.php
+++ b/mod/file/languages/ja.php
@@ -1,5 +1,5 @@
"あなたには、このファイルを変更する権限がありません。",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "ファイルを選択して下さい。",
-);
+];
diff --git a/mod/file/languages/ko.php b/mod/file/languages/ko.php
index 4829509b68d..b16e02dd14c 100644
--- a/mod/file/languages/ko.php
+++ b/mod/file/languages/ko.php
@@ -1,5 +1,5 @@
"이 파일을 변경할 권한이 없습니다.",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "파일을 선택해야합니다.",
-);
+];
diff --git a/mod/file/languages/nl.php b/mod/file/languages/nl.php
index 4b8a85b9beb..25be6fe7f65 100644
--- a/mod/file/languages/nl.php
+++ b/mod/file/languages/nl.php
@@ -1,5 +1,5 @@
"Je hebt onvoldoende rechten om dit bestand aan te passen",
'file:cannotload' => "Er was een fout tijdens het uploaden van het bestand",
'file:nofile' => "Selecteer een bestand",
-);
+];
diff --git a/mod/file/languages/pl.php b/mod/file/languages/pl.php
index d085b0ef0d7..60b71b38094 100644
--- a/mod/file/languages/pl.php
+++ b/mod/file/languages/pl.php
@@ -1,5 +1,5 @@
"Nie masz uprawnień do modyfikacji tego pliku",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Musisz wskazać plik",
-);
+];
diff --git a/mod/file/languages/pt_br.php b/mod/file/languages/pt_br.php
index e16e0ac0eae..68d0ece5cf9 100644
--- a/mod/file/languages/pt_br.php
+++ b/mod/file/languages/pt_br.php
@@ -1,5 +1,5 @@
"Você não possui permissão para editar este arquivo",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Você deve selecionar um arquivo",
-);
+];
diff --git a/mod/file/languages/ru.php b/mod/file/languages/ru.php
index 6021ba5b742..441afcbe360 100644
--- a/mod/file/languages/ru.php
+++ b/mod/file/languages/ru.php
@@ -1,5 +1,5 @@
"У Вас нет прав для изменения этого файла.",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Вам нужно выбрать файл",
-);
+];
diff --git a/mod/file/languages/sr.php b/mod/file/languages/sr.php
index f5d3b96d837..71e5b28a289 100644
--- a/mod/file/languages/sr.php
+++ b/mod/file/languages/sr.php
@@ -1,5 +1,5 @@
"Немте дозволе да мењате овај фајл",
'file:cannotload' => "There was an error uploading the file",
'file:nofile' => "Морате да означите фајл",
-);
+];
diff --git a/mod/file/languages/zh_hans.php b/mod/file/languages/zh_hans.php
index 9dcd171f4fd..dcb24a215e3 100644
--- a/mod/file/languages/zh_hans.php
+++ b/mod/file/languages/zh_hans.php
@@ -1,5 +1,5 @@
"你没有权限修改这个文件",
'file:cannotload' => "上传文件存在错误",
'file:nofile' => "你必须选择一个文件",
-);
+];
diff --git a/mod/file/lib/file.php b/mod/file/lib/file.php
index 5d9e420b366..10bb16b9132 100644
--- a/mod/file/lib/file.php
+++ b/mod/file/lib/file.php
@@ -14,7 +14,7 @@
function file_prepare_form_vars($file = null) {
// input names => defaults
- $values = array(
+ $values = [
'title' => '',
'description' => '',
'access_id' => ACCESS_DEFAULT,
@@ -22,7 +22,7 @@ function file_prepare_form_vars($file = null) {
'container_guid' => elgg_get_page_owner_guid(),
'guid' => null,
'entity' => $file,
- );
+ ];
if ($file) {
foreach (array_keys($values) as $field) {
diff --git a/mod/file/start.php b/mod/file/start.php
index 24cc828e6c4..10f15795f24 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -36,7 +36,7 @@ function file_init() {
elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'file_set_icon_url');
// Register for notifications
- elgg_register_notification_event('object', 'file', array('create'));
+ elgg_register_notification_event('object', 'file', ['create']);
elgg_register_plugin_hook_handler('prepare', 'notification:create:object:file', 'file_prepare_notification');
// add the group files tool option
@@ -50,27 +50,27 @@ function file_init() {
elgg_register_event_handler('delete', 'object', 'file_handle_object_delete', 999);
// embed support
- $item = ElggMenuItem::factory(array(
+ $item = ElggMenuItem::factory([
'name' => 'file',
'text' => elgg_echo('file'),
'priority' => 10,
- 'data' => array(
- 'options' => array(
+ 'data' => [
+ 'options' => [
'type' => 'object',
'subtype' => 'file',
- ),
- ),
- ));
+ ],
+ ],
+ ]);
elgg_register_menu_item('embed', $item);
- $item = ElggMenuItem::factory(array(
+ $item = ElggMenuItem::factory([
'name' => 'file_upload',
'text' => elgg_echo('file:upload'),
'priority' => 100,
- 'data' => array(
+ 'data' => [
'view' => 'embed/file_upload/content',
- ),
- ));
+ ],
+ ]);
elgg_register_menu_item('embed', $item);
@@ -169,13 +169,13 @@ function file_register_toggle() {
}
- elgg_register_menu_item('extras', array(
+ elgg_register_menu_item('extras', [
'name' => 'file_list',
'text' => $icon,
'href' => $url,
'title' => elgg_echo("file:list:$list_type"),
'priority' => 1000,
- ));
+ ]);
}
/**
@@ -197,14 +197,14 @@ function file_prepare_notification($hook, $type, $notification, $params) {
$descr = $entity->description;
$title = $entity->title;
- $notification->subject = elgg_echo('file:notify:subject', array($entity->title), $language);
- $notification->body = elgg_echo('file:notify:body', array(
+ $notification->subject = elgg_echo('file:notify:subject', [$entity->title], $language);
+ $notification->body = elgg_echo('file:notify:body', [
$owner->name,
$title,
$descr,
$entity->getURL()
- ), $language);
- $notification->summary = elgg_echo('file:notify:summary', array($entity->title), $language);
+ ], $language);
+ $notification->summary = elgg_echo('file:notify:summary', [$entity->title], $language);
$notification->url = $entity->getURL();
return $notification;
}
@@ -244,9 +244,9 @@ function file_get_type_cloud($container_guid = "", $friends = false) {
if ($friends && $container) {
// tags interface does not support pulling tags on friends' content so
// we need to grab all friends
- $friend_entities = $container->getFriends(array('limit' => 0));
+ $friend_entities = $container->getFriends(['limit' => 0]);
if ($friend_entities) {
- $friend_guids = array();
+ $friend_guids = [];
foreach ($friend_entities as $friend) {
$friend_guids[] = $friend->getGUID();
}
@@ -255,39 +255,39 @@ function file_get_type_cloud($container_guid = "", $friends = false) {
}
elgg_register_tag_metadata_name('simpletype');
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'file',
'container_guids' => $container_guids,
'threshold' => 0,
'limit' => 10,
- 'tag_names' => array('simpletype')
- );
+ 'tag_names' => ['simpletype']
+ ];
$types = elgg_get_tags($options);
if ($types) {
$all = new stdClass;
$all->tag = 'all';
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => 'file:all',
'text' => elgg_echo('all'),
'href' => file_type_cloud_get_url($all, $friends),
- ));
+ ]);
foreach ($types as $type) {
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => "file:$type->tag",
'text' => elgg_echo("file:type:$type->tag"),
'href' => file_type_cloud_get_url($type, $friends),
- ));
+ ]);
}
}
// returning the view is needed for BC
- $params = array(
+ $params = [
'friends' => $friends,
'types' => $types,
- );
+ ];
return elgg_view('file/typecloud', $params);
}
@@ -353,7 +353,7 @@ function file_set_icon_url($hook, $type, $url, $params) {
return $thumb_url;
}
- $mapping = array(
+ $mapping = [
'application/excel' => 'excel',
'application/msword' => 'word',
'application/ogg' => 'music',
@@ -375,7 +375,7 @@ function file_set_icon_url($hook, $type, $url, $params) {
'audio' => 'music',
'text' => 'text',
'video' => 'video',
- );
+ ];
$mime = $file->getMimeType();
if ($mime) {
@@ -465,10 +465,10 @@ function file_set_custom_icon_sizes($hook, $type, $return, $params) {
/**
* Set custom file thumbnail location
*
- * @param string $hook "entity:icon:file"
- * @param string $type "object"
- * @param \ElggIcon $icon Icon file
- * @param array $params Hook params
+ * @param string $hook "entity:icon:file"
+ * @param string $type "object"
+ * @param \ElggIcon $icon Icon file
+ * @param array $params Hook params
* @return \ElggIcon
*/
function file_set_icon_file($hook, $type, $icon, $params) {
diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php
index 8b630c828ca..43e0115a819 100644
--- a/mod/file/views/default/embed/file_upload/content.php
+++ b/mod/file/views/default/embed/file_upload/content.php
@@ -3,15 +3,15 @@
* Upload a file through the embed interface
*/
-$form_vars = array(
+$form_vars = [
'enctype' => 'multipart/form-data',
'class' => 'elgg-form-embed',
-);
-$body_vars = array('container_guid' => elgg_get_page_owner_guid());
+];
+$body_vars = ['container_guid' => elgg_get_page_owner_guid()];
echo elgg_view_form('file/upload', $form_vars, $body_vars);
// the tab we want to be forwarded to after upload is complete
-echo elgg_view('input/hidden', array(
+echo elgg_view('input/hidden', [
'name' => 'embed_forward',
'value' => 'file',
-));
\ No newline at end of file
+]);
diff --git a/mod/file/views/default/file/css.php b/mod/file/views/default/file/css.php
index 844b0dd0499..6d8736a6f6c 100644
--- a/mod/file/views/default/file/css.php
+++ b/mod/file/views/default/file/css.php
@@ -1,7 +1,7 @@
diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php
index ec7c68caeea..aabfe8048ed 100644
--- a/mod/file/views/default/file/group_module.php
+++ b/mod/file/views/default/file/group_module.php
@@ -9,14 +9,14 @@
return true;
}
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => "file/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
-));
+]);
elgg_push_context('widgets');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'file',
'container_guid' => elgg_get_page_owner_guid(),
@@ -25,19 +25,19 @@
'pagination' => false,
'no_results' => elgg_echo('file:none'),
'distinct' => false,
-);
+];
$content = elgg_list_entities($options);
elgg_pop_context();
-$new_link = elgg_view('output/url', array(
+$new_link = elgg_view('output/url', [
'href' => "file/add/$group->guid",
'text' => elgg_echo('file:add'),
'is_trusted' => true,
-));
+]);
-echo elgg_view('groups/profile/module', array(
+echo elgg_view('groups/profile/module', [
'title' => elgg_echo('file:group'),
'content' => $content,
'all_link' => $all_link,
'add_link' => $new_link,
-));
+]);
diff --git a/mod/file/views/default/file/sidebar.php b/mod/file/views/default/file/sidebar.php
index 6e46dd3c184..a9b2e240a59 100644
--- a/mod/file/views/default/file/sidebar.php
+++ b/mod/file/views/default/file/sidebar.php
@@ -3,12 +3,12 @@
* File sidebar
*/
-echo elgg_view('page/elements/comments_block', array(
+echo elgg_view('page/elements/comments_block', [
'subtypes' => 'file',
'container_guid' => elgg_get_page_owner_guid(),
-));
+]);
-echo elgg_view('page/elements/tagcloud_block', array(
+echo elgg_view('page/elements/tagcloud_block', [
'subtypes' => 'file',
'container_guid' => elgg_get_page_owner_guid(),
-));
+]);
diff --git a/mod/file/views/default/file/theme_sandbox/icons/files.php b/mod/file/views/default/file/theme_sandbox/icons/files.php
index 879c5e5beb4..46769f8c245 100644
--- a/mod/file/views/default/file/theme_sandbox/icons/files.php
+++ b/mod/file/views/default/file/theme_sandbox/icons/files.php
@@ -2,7 +2,7 @@
$file = new ElggFile();
-$mapping = array(
+$mapping = [
'general' => 'general',
'application' => 'application',
'audio' => 'music',
@@ -16,9 +16,9 @@
'application/vnd.oasis.opendocument.text' => 'openoffice',
'application/zip' => 'archive',
'text/v-card' => 'vcard',
-);
+];
-$sizes = array('large', 'medium', 'small', 'tiny');
+$sizes = ['large', 'medium', 'small', 'tiny'];
?>
diff --git a/mod/file/views/default/forms/file/upload.php b/mod/file/views/default/forms/file/upload.php
index 30e13248b61..128b77d2128 100644
--- a/mod/file/views/default/forms/file/upload.php
+++ b/mod/file/views/default/forms/file/upload.php
@@ -31,7 +31,7 @@
// Determine the correct value
$max_upload = $upload_max_filesize > $post_max_size ? $post_max_size : $upload_max_filesize;
-$upload_limit = elgg_echo('file:upload_limit', array(elgg_format_bytes($max_upload)));
+$upload_limit = elgg_echo('file:upload_limit', [elgg_format_bytes($max_upload)]);
$categories_field = $vars;
$categories_field['#type'] = 'categories';
@@ -94,4 +94,4 @@
'#type' => 'submit',
'value' => elgg_echo('save'),
]);
-elgg_set_form_footer($footer);
\ No newline at end of file
+elgg_set_form_footer($footer);
diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php
index 09767b0189c..0bd1180d11a 100644
--- a/mod/file/views/default/icon/object/file.php
+++ b/mod/file/views/default/icon/object/file.php
@@ -49,15 +49,15 @@
'src' => $entity->getIconURL($size),
]);
if ($url) {
- $params = array(
+ $params = [
'href' => $url,
'text' => $img,
'is_trusted' => true,
- );
+ ];
if (isset($vars['link_class'])) {
$params['class'] = $vars['link_class'];
}
echo elgg_view('output/url', $params);
} else {
echo $img;
-}
\ No newline at end of file
+}
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 0d3774e41ba..7e2a8c92107 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -5,11 +5,11 @@
* @package ElggFile
*/
-$full = elgg_extract('full_view', $vars, FALSE);
-$file = elgg_extract('entity', $vars, FALSE);
+$full = elgg_extract('full_view', $vars, false);
+$file = elgg_extract('entity', $vars, false);
if (!$file) {
- return TRUE;
+ return true;
}
$owner = $file->getOwnerEntity();
@@ -21,11 +21,11 @@
//only display if there are commments
if ($comments_count != 0) {
$text = elgg_echo("comments") . " ($comments_count)";
- $comments_link = elgg_view('output/url', array(
+ $comments_link = elgg_view('output/url', [
'href' => $file->getURL() . '#comments',
'text' => $text,
'is_trusted' => true,
- ));
+ ]);
} else {
$comments_link = '';
}
@@ -35,17 +35,17 @@
$metadata = '';
if (!elgg_in_context('widgets') && !elgg_in_context('gallery')) {
// only show entity menu outside of widgets and gallery view
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $vars['entity'],
'handler' => 'file',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
if ($full && !elgg_in_context('gallery')) {
$mime = $file->getMimeType();
- $base_type = substr($mime, 0, strpos($mime,'/'));
+ $base_type = substr($mime, 0, strpos($mime, '/'));
$extra = '';
if (elgg_view_exists("file/specialcontent/$mime")) {
@@ -54,16 +54,16 @@
$extra = elgg_view("file/specialcontent/$base_type/default", $vars);
}
- $params = array(
+ $params = [
'entity' => $file,
'title' => false,
'metadata' => $metadata,
'subtitle' => $subtitle,
- );
+ ];
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
- $body = elgg_view('output/longtext', array('value' => $file->description));
+ $body = elgg_view('output/longtext', ['value' => $file->description]);
$owner_icon = elgg_view_entity_icon($owner, 'small');
@@ -72,15 +72,14 @@
$responses = elgg_view_comments($file);
}
- echo elgg_view('object/elements/full', array(
+ echo elgg_view('object/elements/full', [
'entity' => $file,
'icon' => $owner_icon,
'summary' => $summary,
'body' => $body,
'attachments' => $extra,
'responses' => $responses,
- ));
-
+ ]);
} elseif (elgg_in_context('gallery')) {
echo '';
echo "
" . $file->title . " ";
@@ -93,14 +92,13 @@
$file_icon = elgg_view_entity_icon($file, 'small');
- $params = array(
+ $params = [
'entity' => $file,
'metadata' => $metadata,
'subtitle' => $subtitle,
'content' => $excerpt,
'icon' => $file_icon,
- );
+ ];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
-
}
diff --git a/mod/file/views/default/resources/file/all.php b/mod/file/views/default/resources/file/all.php
index 01d86c92a72..3ac57bd0f18 100644
--- a/mod/file/views/default/resources/file/all.php
+++ b/mod/file/views/default/resources/file/all.php
@@ -11,7 +11,7 @@
$title = elgg_echo('file:all');
-$content = elgg_list_entities(array(
+$content = elgg_list_entities([
'type' => 'object',
'subtype' => 'file',
'full_view' => false,
@@ -19,16 +19,16 @@
'preload_owners' => true,
'preload_containers' => true,
'distinct' => false,
-));
+]);
$sidebar = file_get_type_cloud();
$sidebar .= elgg_view('file/sidebar');
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => 'all',
'content' => $content,
'title' => $title,
'sidebar' => $sidebar,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/resources/file/edit.php b/mod/file/views/default/resources/file/edit.php
index 917e8b5f624..8250d643ccc 100644
--- a/mod/file/views/default/resources/file/edit.php
+++ b/mod/file/views/default/resources/file/edit.php
@@ -29,15 +29,15 @@
elgg_set_page_owner_guid($file->getContainerGUID());
-$form_vars = array('enctype' => 'multipart/form-data');
+$form_vars = ['enctype' => 'multipart/form-data'];
$body_vars = file_prepare_form_vars($file);
$content = elgg_view_form('file/upload', $form_vars, $body_vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/resources/file/friends.php b/mod/file/views/default/resources/file/friends.php
index a3babd71db3..27265ff3735 100644
--- a/mod/file/views/default/resources/file/friends.php
+++ b/mod/file/views/default/resources/file/friends.php
@@ -18,7 +18,7 @@
$title = elgg_echo("file:friends");
-$content = elgg_list_entities_from_relationship(array(
+$content = elgg_list_entities_from_relationship([
'type' => 'object',
'subtype' => 'file',
'full_view' => false,
@@ -28,15 +28,15 @@
'no_results' => elgg_echo("file:none"),
'preload_owners' => true,
'preload_containers' => true,
-));
+]);
$sidebar = file_get_type_cloud($owner->guid, true);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => 'friends',
'content' => $content,
'title' => $title,
'sidebar' => $sidebar,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/resources/file/owner.php b/mod/file/views/default/resources/file/owner.php
index 7aeba12fa42..ce2fe26f567 100644
--- a/mod/file/views/default/resources/file/owner.php
+++ b/mod/file/views/default/resources/file/owner.php
@@ -18,7 +18,7 @@
elgg_register_title_button('file', 'add', 'object', 'file');
-$params = array();
+$params = [];
if ($owner->guid == elgg_get_logged_in_user_guid()) {
// user looking at own files
@@ -32,7 +32,7 @@
$params['filter'] = '';
}
-$title = elgg_echo("file:user", array($owner->name));
+$title = elgg_echo("file:user", [$owner->name]);
// List files
$options = [
diff --git a/mod/file/views/default/resources/file/search.php b/mod/file/views/default/resources/file/search.php
index a7bb4c3de8b..cd0ee7c76bb 100644
--- a/mod/file/views/default/resources/file/search.php
+++ b/mod/file/views/default/resources/file/search.php
@@ -24,7 +24,7 @@
// avoid reflected XSS attacks by only allowing alnum characters
$file_type = preg_replace('[\W]', '', get_input('tag'));
$listtype = get_input('listtype');
-$friends = (bool)get_input('friends', false);
+$friends = (bool) get_input('friends', false);
// breadcrumbs
elgg_push_breadcrumb(elgg_echo('file'), "file/all");
@@ -51,7 +51,7 @@
} else {
$friend_string = $friends ? elgg_echo('file:title:friends') : '';
$type_string = elgg_echo("file:type:$file_type");
- $title = elgg_echo('file:list:title', array($owner->name, $friend_string, $type_string));
+ $title = elgg_echo('file:list:title', [$owner->name, $friend_string, $type_string]);
}
@@ -62,19 +62,19 @@
$limit = 12;
}
-$params = array(
+$params = [
'type' => 'object',
'subtype' => 'file',
'limit' => $limit,
'full_view' => false,
'preload_owners' => true,
-);
+];
if ($owner instanceof ElggUser) {
if ($friends) {
$params['relationship'] = 'friend';
$params['relationship_guid'] = $user->guid;
- $params['relationship_join_on'] = 'owner_guid';
+ $params['relationship_join_on'] = 'owner_guid';
} else {
$params['owner_guid'] = $page_owner_guid;
}
@@ -89,11 +89,11 @@
$content = elgg_list_entities_from_relationship($params);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
'sidebar' => $sidebar,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/resources/file/upload.php b/mod/file/views/default/resources/file/upload.php
index 2bcf693be66..b638940ac2e 100644
--- a/mod/file/views/default/resources/file/upload.php
+++ b/mod/file/views/default/resources/file/upload.php
@@ -24,14 +24,14 @@
elgg_push_breadcrumb($title);
// create form
-$form_vars = array('enctype' => 'multipart/form-data');
+$form_vars = ['enctype' => 'multipart/form-data'];
$body_vars = file_prepare_form_vars();
$content = elgg_view_form('file/upload', $form_vars, $body_vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/resources/file/view.php b/mod/file/views/default/resources/file/view.php
index c2b947ee559..14177681015 100644
--- a/mod/file/views/default/resources/file/view.php
+++ b/mod/file/views/default/resources/file/view.php
@@ -33,17 +33,17 @@
'show_responses' => true,
]);
-elgg_register_menu_item('title', array(
+elgg_register_menu_item('title', [
'name' => 'download',
'text' => elgg_echo('download'),
'href' => elgg_get_download_url($file),
'link_class' => 'elgg-button elgg-button-action',
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/file/views/default/river/object/file/create.php b/mod/file/views/default/river/object/file/create.php
index c0e079d9c1b..f873aa5a1d0 100644
--- a/mod/file/views/default/river/object/file/create.php
+++ b/mod/file/views/default/river/object/file/create.php
@@ -10,7 +10,7 @@
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => $excerpt,
-));
\ No newline at end of file
+]);
diff --git a/mod/friends/elgg-plugin.php b/mod/friends/elgg-plugin.php
index c40947f1bc5..a38bf42c157 100644
--- a/mod/friends/elgg-plugin.php
+++ b/mod/friends/elgg-plugin.php
@@ -15,4 +15,4 @@
],
],
];
-
\ No newline at end of file
+
diff --git a/mod/friends/start.php b/mod/friends/start.php
index e47d008341d..eacdcf253a0 100644
--- a/mod/friends/start.php
+++ b/mod/friends/start.php
@@ -32,21 +32,21 @@ function _elgg_friends_setup_user_hover_menu($hook, $type, $return, $params) {
$isFriend = $user->isFriend();
// Always emit both to make it super easy to toggle with ajax
- $return[] = \ElggMenuItem::factory(array(
+ $return[] = \ElggMenuItem::factory([
'name' => 'remove_friend',
'href' => elgg_add_action_tokens_to_url("action/friends/remove?friend={$user->guid}"),
'text' => elgg_echo('friend:remove'),
'section' => 'action',
'item_class' => $isFriend ? '' : 'hidden',
- ));
+ ]);
- $return[] = \ElggMenuItem::factory(array(
+ $return[] = \ElggMenuItem::factory([
'name' => 'add_friend',
'href' => elgg_add_action_tokens_to_url("action/friends/add?friend={$user->guid}"),
'text' => elgg_echo('friend:add'),
'section' => 'action',
'item_class' => $isFriend ? 'hidden' : '',
- ));
+ ]);
}
}
@@ -142,14 +142,14 @@ function _elgg_friends_page_menu($hook, $type, $return, $params) {
'name' => 'friends',
'text' => elgg_echo('friends'),
'href' => 'friends/' . $owner->username,
- 'contexts' => array('friends'),
+ 'contexts' => ['friends'],
]);
$return[] = \ElggMenuItem::factory([
'name' => 'friends:of',
'text' => elgg_echo('friends:of'),
'href' => 'friendsof/' . $owner->username,
- 'contexts' => array('friends'),
+ 'contexts' => ['friends'],
]);
return $return;
@@ -177,15 +177,15 @@ function _elgg_send_friend_notification($event, $type, $object) {
/* @var ElggUser $user_two */
// Notification subject
- $subject = elgg_echo('friend:newfriend:subject', array(
+ $subject = elgg_echo('friend:newfriend:subject', [
$user_one->name
- ), $user_two->language);
+ ], $user_two->language);
// Notification body
- $body = elgg_echo("friend:newfriend:body", array(
+ $body = elgg_echo("friend:newfriend:body", [
$user_one->name,
$user_one->getURL()
- ), $user_two->language);
+ ], $user_two->language);
// Notification params
$params = [
diff --git a/mod/friends_collections/actions/friends/collections/edit.php b/mod/friends_collections/actions/friends/collections/edit.php
index fd02e8b3ee8..50e538184f7 100644
--- a/mod/friends_collections/actions/friends/collections/edit.php
+++ b/mod/friends_collections/actions/friends/collections/edit.php
@@ -46,4 +46,4 @@
return elgg_ok_response($data, $msg, $collection->getURL());
} else {
return elgg_error_response(elgg_echo('friends:collections:edit:fail'));
-}
\ No newline at end of file
+}
diff --git a/mod/friends_collections/actions/friends/collections/remove_member.php b/mod/friends_collections/actions/friends/collections/remove_member.php
index dff8c5ef954..74483f3a4bf 100644
--- a/mod/friends_collections/actions/friends/collections/remove_member.php
+++ b/mod/friends_collections/actions/friends/collections/remove_member.php
@@ -18,4 +18,4 @@
return elgg_ok_response($data, elgg_echo('friends:collections:remove_member:success'));
} else {
return elgg_error_response(elgg_echo('friends:collections:remove_member:fail'));
-}
\ No newline at end of file
+}
diff --git a/mod/friends_collections/classes/Elgg/Friends/Collections/UrlHandler.php b/mod/friends_collections/classes/Elgg/Friends/Collections/UrlHandler.php
index 59b00d280dc..25c0a857db0 100644
--- a/mod/friends_collections/classes/Elgg/Friends/Collections/UrlHandler.php
+++ b/mod/friends_collections/classes/Elgg/Friends/Collections/UrlHandler.php
@@ -7,7 +7,7 @@ class UrlHandler {
/**
* Rewrite access collection URL
* @elgg_plugin_hook access_collection:url access_collection
- *
+ *
* @param \Elgg\Hook $hook Hook
* @return string
*/
diff --git a/mod/friends_collections/elgg-plugin.php b/mod/friends_collections/elgg-plugin.php
index 3eaa994337e..19bb08187cb 100644
--- a/mod/friends_collections/elgg-plugin.php
+++ b/mod/friends_collections/elgg-plugin.php
@@ -7,4 +7,4 @@
'friends/collections/remove_member' => [],
],
];
-
\ No newline at end of file
+
diff --git a/mod/friends_collections/languages/en.php b/mod/friends_collections/languages/en.php
index 33c44cde77d..0ba765941e3 100644
--- a/mod/friends_collections/languages/en.php
+++ b/mod/friends_collections/languages/en.php
@@ -28,4 +28,4 @@
'friends:collections:remove_member:success' => 'Member was successfully removed from the collection',
'friends:collections:remove_member:fail' => 'Member could not be removed from the collection',
-];
\ No newline at end of file
+];
diff --git a/mod/friends_collections/views/default/collections/collections.css b/mod/friends_collections/views/default/collections/collections.css
index cf63d9c1b34..fa9bf5811cd 100644
--- a/mod/friends_collections/views/default/collections/collections.css
+++ b/mod/friends_collections/views/default/collections/collections.css
@@ -1,3 +1,3 @@
.elgg-list-access-collections > li {
padding: 10px;
-}
\ No newline at end of file
+}
diff --git a/mod/friends_collections/views/default/collections/listing/owner.php b/mod/friends_collections/views/default/collections/listing/owner.php
index 0f907a74a50..f370ad69800 100644
--- a/mod/friends_collections/views/default/collections/listing/owner.php
+++ b/mod/friends_collections/views/default/collections/listing/owner.php
@@ -20,4 +20,4 @@
'list_class' => 'elgg-list-access-collections',
'pagination' => false,
'no_results' => elgg_echo('friends:collections:no_results'),
-]);
\ No newline at end of file
+]);
diff --git a/mod/friends_collections/views/default/resources/friends/collections/add.php b/mod/friends_collections/views/default/resources/friends/collections/add.php
index e25a02311a4..c651654e666 100644
--- a/mod/friends_collections/views/default/resources/friends/collections/add.php
+++ b/mod/friends_collections/views/default/resources/friends/collections/add.php
@@ -34,9 +34,9 @@
$content = elgg_view_form($form_name, [], $form_vars);
-$body = elgg_view_layout('one_sidebar', array(
- 'title' => $title,
+$body = elgg_view_layout('one_sidebar', [
+ 'title' => $title,
'content' => $content
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/friends_collections/views/default/resources/friends/collections/edit.php b/mod/friends_collections/views/default/resources/friends/collections/edit.php
index a43a66e88d7..6dad00887be 100644
--- a/mod/friends_collections/views/default/resources/friends/collections/edit.php
+++ b/mod/friends_collections/views/default/resources/friends/collections/edit.php
@@ -40,9 +40,9 @@
$content = elgg_view_form($form_name, [], $form_vars);
-$body = elgg_view_layout('one_sidebar', array(
- 'title' => $title,
+$body = elgg_view_layout('one_sidebar', [
+ 'title' => $title,
'content' => $content
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/friends_collections/views/default/resources/friends/collections/owner.php b/mod/friends_collections/views/default/resources/friends/collections/owner.php
index 3a1f7a78127..1204cea7ef9 100644
--- a/mod/friends_collections/views/default/resources/friends/collections/owner.php
+++ b/mod/friends_collections/views/default/resources/friends/collections/owner.php
@@ -38,9 +38,9 @@
'entity' => $user,
]);
-$body = elgg_view_layout('one_sidebar', array(
+$body = elgg_view_layout('one_sidebar', [
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/friends_collections/views/default/resources/friends/collections/view.php b/mod/friends_collections/views/default/resources/friends/collections/view.php
index e018abcd8bc..dfff03fb923 100644
--- a/mod/friends_collections/views/default/resources/friends/collections/view.php
+++ b/mod/friends_collections/views/default/resources/friends/collections/view.php
@@ -32,9 +32,9 @@
'item' => $collection,
]);
-$body = elgg_view_layout('one_sidebar', array(
- 'title' => $title,
+$body = elgg_view_layout('one_sidebar', [
+ 'title' => $title,
'content' => $content
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/garbagecollector/languages/ca.php b/mod/garbagecollector/languages/ca.php
index bda11e03498..7d5200421c5 100644
--- a/mod/garbagecollector/languages/ca.php
+++ b/mod/garbagecollector/languages/ca.php
@@ -1,5 +1,5 @@
'Cada quan s\'ha d\'executar la neteja d\'escombraries de l\'Elgg?',
'garbagecollector:weekly' => 'Un cop a la setmana',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Netejant els vincles sense metastrings.',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/cmn.php b/mod/garbagecollector/languages/cmn.php
index 31d5616cf3f..69fdf753205 100644
--- a/mod/garbagecollector/languages/cmn.php
+++ b/mod/garbagecollector/languages/cmn.php
@@ -1,5 +1,5 @@
'Elgg 記憶空間回收器應該要多久運行一次?',
'garbagecollector:weekly' => '一週一次',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "確定",
'garbagecollector:gc:metastrings' => '清理掉未鏈結的中繼字串:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/da.php b/mod/garbagecollector/languages/da.php
index 387d0e7a6d5..4867a7b5ec4 100644
--- a/mod/garbagecollector/languages/da.php
+++ b/mod/garbagecollector/languages/da.php
@@ -1,5 +1,5 @@
'Hvor ofte skal Elgg opsamle skrald?',
'garbagecollector:weekly' => 'En gang om ugen',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Rydder op i uforbundne metastrenge: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/de.php b/mod/garbagecollector/languages/de.php
index 11d34c3ef59..99277b0066f 100644
--- a/mod/garbagecollector/languages/de.php
+++ b/mod/garbagecollector/languages/de.php
@@ -1,5 +1,5 @@
'Wie oft soll der Garbage Collector ausgeführt werden?',
'garbagecollector:weekly' => 'Einmal pro Woche',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Entfernen nicht-verlinkter Metastrings: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/en.php b/mod/garbagecollector/languages/en.php
index 2d058a497d9..016ae5a9ca4 100644
--- a/mod/garbagecollector/languages/en.php
+++ b/mod/garbagecollector/languages/en.php
@@ -1,5 +1,5 @@
'How often should the Elgg garbage collector run?',
'garbagecollector:weekly' => 'Once a week',
@@ -12,4 +12,4 @@
'garbagecollector:error' => "ERROR",
'garbagecollector:ok' => "OK",
-);
+];
diff --git a/mod/garbagecollector/languages/es.php b/mod/garbagecollector/languages/es.php
index 1479fd7f629..b366bc1c81d 100644
--- a/mod/garbagecollector/languages/es.php
+++ b/mod/garbagecollector/languages/es.php
@@ -1,5 +1,5 @@
'¿Con qué frecuencia se debe ejecutar el recolector de basura Elgg? ',
'garbagecollector:weekly' => 'Semanalmente',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Limpiando metastrings desvinculados: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/eu_es.php b/mod/garbagecollector/languages/eu_es.php
index 1a5b9cadcfa..eddd94a0de7 100644
--- a/mod/garbagecollector/languages/eu_es.php
+++ b/mod/garbagecollector/languages/eu_es.php
@@ -1,5 +1,5 @@
'Zenbat bider exekutatu behar du Ellg-ek zabor-biltzailea?',
'garbagecollector:weekly' => 'Astean behin',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Desestekatutako metakateen garbiketa:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/fi.php b/mod/garbagecollector/languages/fi.php
index 4c4e1841dc3..f9ee77b72db 100644
--- a/mod/garbagecollector/languages/fi.php
+++ b/mod/garbagecollector/languages/fi.php
@@ -1,5 +1,5 @@
'Kuinka usein siivoustoiminto ajetaan?',
'garbagecollector:weekly' => 'Kerran viikossa',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Poistetaan turhat merkkijonot metatiedoista: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/fr.php b/mod/garbagecollector/languages/fr.php
index 4c0405c1d11..732786e0805 100644
--- a/mod/garbagecollector/languages/fr.php
+++ b/mod/garbagecollector/languages/fr.php
@@ -1,5 +1,5 @@
'A quelle fréquence souhaitez-vous faire tourner le ramasse-miettes ?',
'garbagecollector:weekly' => 'Une fois par semaine',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Nettoyage des chaînes meta (metastrings) non liées: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/gl.php b/mod/garbagecollector/languages/gl.php
index 644d0ce80ce..aa6eaa75590 100644
--- a/mod/garbagecollector/languages/gl.php
+++ b/mod/garbagecollector/languages/gl.php
@@ -1,5 +1,5 @@
'Con que frecuencia debería executarse o recolledor do lixo de Elgg?',
'garbagecollector:weekly' => 'Cada semana',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "Si",
'garbagecollector:gc:metastrings' => 'Limpando cadeas de metadatos desligadas:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/it.php b/mod/garbagecollector/languages/it.php
index dc94f8902e0..f724e37bef0 100644
--- a/mod/garbagecollector/languages/it.php
+++ b/mod/garbagecollector/languages/it.php
@@ -1,5 +1,5 @@
'Quanto spesso Elgg dovrebbe raccogliere ed eliminare la "spazzatura"?',
'garbagecollector:weekly' => 'Una volta alla settimana',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Pulendo metastring non linkate:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/ja.php b/mod/garbagecollector/languages/ja.php
index ee4501df487..01dd22ae44c 100644
--- a/mod/garbagecollector/languages/ja.php
+++ b/mod/garbagecollector/languages/ja.php
@@ -1,5 +1,5 @@
'ガベージコレクションをする頻度',
'garbagecollector:weekly' => '1週間に1回',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'どこからもリンクされていないメタ文字を削除中',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/ko.php b/mod/garbagecollector/languages/ko.php
index af6bb51df6c..51238efaf86 100644
--- a/mod/garbagecollector/languages/ko.php
+++ b/mod/garbagecollector/languages/ko.php
@@ -1,5 +1,5 @@
'Elgg 쓰레기 처리기를 얼마나 자주 실행할까요?',
'garbagecollector:weekly' => '매주',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "좋음",
'garbagecollector:gc:metastrings' => '연결되지 않은 중간문자열을 삭제하는 중입니다.',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/nl.php b/mod/garbagecollector/languages/nl.php
index 9bc0b1a090a..c172aad7af5 100644
--- a/mod/garbagecollector/languages/nl.php
+++ b/mod/garbagecollector/languages/nl.php
@@ -1,5 +1,5 @@
'Hoe vaak wil je dat Elgg de garbage collector draait?',
'garbagecollector:weekly' => 'Eens per week',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Opruimen van niet-gelinkte metastrings:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/pl.php b/mod/garbagecollector/languages/pl.php
index 5ad69f7ee91..b0cd9a88531 100644
--- a/mod/garbagecollector/languages/pl.php
+++ b/mod/garbagecollector/languages/pl.php
@@ -1,5 +1,5 @@
'Jak często uruchamiać oczyszczanie w Elgg?',
'garbagecollector:weekly' => 'Raz na tydzień',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Oczyszczam nie połączone znaczniki metastrings:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/pt_br.php b/mod/garbagecollector/languages/pt_br.php
index fd55cdb8a8a..63db689c669 100644
--- a/mod/garbagecollector/languages/pt_br.php
+++ b/mod/garbagecollector/languages/pt_br.php
@@ -1,5 +1,5 @@
'Com que frequência o coletor de lixo do Elgg deve ser executado?',
'garbagecollector:weekly' => 'Semanalmente',
@@ -7,7 +7,7 @@
'garbagecollector:yearly' => 'Anualmente',
'garbagecollector' => "Coletor de Lixo",
- 'garbagecollector:done' => "FEITO
+ 'garbagecollector:done' => "FEITO
",
'garbagecollector:optimize' => "Otimizando %s ",
@@ -15,4 +15,4 @@
'garbagecollector:ok' => "OK ",
'garbagecollector:gc:metastrings' => 'Limpando \'metastrings\' desconexas: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/ru.php b/mod/garbagecollector/languages/ru.php
index 2c1fb0b3d81..ec12f132a60 100644
--- a/mod/garbagecollector/languages/ru.php
+++ b/mod/garbagecollector/languages/ru.php
@@ -1,5 +1,5 @@
'Как часто Вы хотите запускать Elgg-мусорщика?',
'garbagecollector:weekly' => 'Раз в неделю',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => 'Очищаем несвязанные метастроки: ',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/languages/zh_hans.php b/mod/garbagecollector/languages/zh_hans.php
index d29f42e5f0b..a7a96a6e748 100644
--- a/mod/garbagecollector/languages/zh_hans.php
+++ b/mod/garbagecollector/languages/zh_hans.php
@@ -1,5 +1,5 @@
'垃圾收集工作多长时间执行一次?',
'garbagecollector:weekly' => '每周一次',
@@ -14,4 +14,4 @@
'garbagecollector:ok' => "OK",
'garbagecollector:gc:metastrings' => '清除未连接的 meta 字串:',
-);
\ No newline at end of file
+];
diff --git a/mod/garbagecollector/start.php b/mod/garbagecollector/start.php
index 315a9ec105c..70ca57c4328 100644
--- a/mod/garbagecollector/start.php
+++ b/mod/garbagecollector/start.php
@@ -33,13 +33,13 @@ function garbagecollector_cron($hook, $entity_type, $returnvalue, $params) {
// Now, because we are nice, trigger a plugin hook to let other plugins do some GC
$rv = true;
- $period = elgg_get_plugin_setting('period','garbagecollector');
- elgg_trigger_plugin_hook('gc', 'system', array('period' => $period));
+ $period = elgg_get_plugin_setting('period', 'garbagecollector');
+ elgg_trigger_plugin_hook('gc', 'system', ['period' => $period]);
// Now we optimize all tables
$tables = garbagecollector_get_tables();
foreach ($tables as $table) {
- echo elgg_echo('garbagecollector:optimize', array($table));
+ echo elgg_echo('garbagecollector:optimize', [$table]);
if (garbagecollector_optimize_table($table) !== false) {
echo elgg_echo('garbagecollector:ok');
@@ -68,7 +68,7 @@ function garbagecollector_get_tables() {
$table_prefix = elgg_get_config('dbprefix');
$result = get_data("SHOW TABLES LIKE '$table_prefix%'");
- $tables = array();
+ $tables = [];
if (is_array($result) && !empty($result)) {
foreach ($result as $row) {
$row = (array) $row;
@@ -102,12 +102,12 @@ function garbagecollector_optimize_table($table) {
function garbagecollector_entities() {
$dbprefix = elgg_get_config('dbprefix');
- $tables = array(
+ $tables = [
'site' => 'sites_entity',
'object' => 'objects_entity',
'group' => 'groups_entity',
'user' => 'users_entity',
- );
+ ];
foreach ($tables as $type => $table) {
delete_data("DELETE FROM {$dbprefix}{$table}
diff --git a/mod/garbagecollector/views/default/plugins/garbagecollector/settings.php b/mod/garbagecollector/views/default/plugins/garbagecollector/settings.php
index e11d1a535c0..3603b81b8ae 100644
--- a/mod/garbagecollector/views/default/plugins/garbagecollector/settings.php
+++ b/mod/garbagecollector/views/default/plugins/garbagecollector/settings.php
@@ -15,14 +15,14 @@
'params[period]',
- 'options_values' => array(
+ 'options_values' => [
'weekly' => elgg_echo('garbagecollector:weekly'),
'monthly' => elgg_echo('garbagecollector:monthly'),
'yearly' => elgg_echo('garbagecollector:yearly'),
- ),
+ ],
'value' => $period
- ));
+ ]);
?>
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index 06ab05d0bbd..d55aba99274 100644
--- a/mod/groups/actions/groups/edit.php
+++ b/mod/groups/actions/groups/edit.php
@@ -11,7 +11,7 @@
elgg_make_sticky_form('groups');
// Get group fields
-$input = array();
+$input = [];
foreach (elgg_get_config('group') as $shortname => $valuetype) {
$value = get_input($shortname);
@@ -115,7 +115,7 @@
$group->membership = $is_public_membership ? ACCESS_PUBLIC : ACCESS_PRIVATE;
}
-$group->setContentAccessMode((string)get_input('content_access_mode'));
+$group->setContentAccessMode((string) get_input('content_access_mode'));
if ($is_new_group) {
$group->access_id = ACCESS_PUBLIC;
@@ -124,7 +124,7 @@
$old_owner_guid = $is_new_group ? 0 : $group->owner_guid;
$value = get_input('owner_guid');
-$new_owner_guid = ($value === null) ? $old_owner_guid : (int)$value;
+$new_owner_guid = ($value === null) ? $old_owner_guid : (int) $value;
if (!$is_new_group && $new_owner_guid && $new_owner_guid != $old_owner_guid) {
// verify new owner is member and old owner/admin is logged in
@@ -154,7 +154,7 @@
if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
$value = get_input('vis');
if ($is_new_group || $value !== null) {
- $visibility = (int)$value;
+ $visibility = (int) $value;
if ($visibility == ACCESS_PRIVATE) {
// Make this group visible only to group members. We need to use
@@ -179,17 +179,16 @@
// group creator needs to be member of new group and river entry created
if ($is_new_group) {
-
// @todo this should not be necessary...
elgg_set_page_owner_guid($group->guid);
$group->join($user);
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/group/create',
'action_type' => 'create',
'subject_guid' => $user->guid,
'object_guid' => $group->guid,
- ));
+ ]);
}
$group->saveIconFromUploadedFile('icon');
diff --git a/mod/groups/actions/groups/featured.php b/mod/groups/actions/groups/featured.php
index a3f3ccca546..9edd92b1904 100644
--- a/mod/groups/actions/groups/featured.php
+++ b/mod/groups/actions/groups/featured.php
@@ -1,4 +1,4 @@
-featured_group = "yes";
- system_message(elgg_echo('groups:featuredon', array($group->name)));
+ system_message(elgg_echo('groups:featuredon', [$group->name]));
} else {
$group->deleteMetadata('featured_group');
- system_message(elgg_echo('groups:unfeatured', array($group->name)));
+ system_message(elgg_echo('groups:unfeatured', [$group->name]));
}
forward(REFERER);
diff --git a/mod/groups/actions/groups/membership/add.php b/mod/groups/actions/groups/membership/add.php
index 321823cc133..640b71ad8e3 100644
--- a/mod/groups/actions/groups/membership/add.php
+++ b/mod/groups/actions/groups/membership/add.php
@@ -8,13 +8,13 @@
$user_guid = get_input('user_guid');
if (!is_array($user_guid)) {
- $user_guid = array($user_guid);
+ $user_guid = [$user_guid];
}
$group_guid = get_input('group_guid');
$group = get_entity($group_guid);
/* @var ElggGroup $group */
-$errors = array();
+$errors = [];
if (sizeof($user_guid)) {
foreach ($user_guid as $u_guid) {
$user = get_user($u_guid);
@@ -22,14 +22,13 @@
if ($user && elgg_instanceof($group, 'group') && $group->canEdit()) {
if (!$group->isMember($user)) {
if (groups_join_group($group, $user)) {
+ $subject = elgg_echo('groups:welcome:subject', [$group->name], $user->language);
- $subject = elgg_echo('groups:welcome:subject', array($group->name), $user->language);
-
- $body = elgg_echo('groups:welcome:body', array(
+ $body = elgg_echo('groups:welcome:body', [
$user->name,
$group->name,
$group->getURL(),
- ), $user->language);
+ ], $user->language);
$params = [
'action' => 'add_membership',
@@ -41,13 +40,11 @@
notify_user($user->getGUID(), $group->owner_guid, $subject, $body, $params);
system_message(elgg_echo('groups:addedtogroup'));
+ } else {
+ $errors[] = elgg_echo('groups:error:addedtogroup', [$user->name]);
}
- else {
- $errors[] = elgg_echo('groups:error:addedtogroup', array($user->name));
- }
- }
- else {
- $errors[] = elgg_echo('groups:add:alreadymember', array($user->name));
+ } else {
+ $errors[] = elgg_echo('groups:add:alreadymember', [$user->name]);
// if an invitation is still pending clear it up, we don't need it
remove_entity_relationship($group->guid, 'invited', $user->guid);
diff --git a/mod/groups/actions/groups/membership/invite.php b/mod/groups/actions/groups/membership/invite.php
index 96b385ec839..90976a1d2ac 100644
--- a/mod/groups/actions/groups/membership/invite.php
+++ b/mod/groups/actions/groups/membership/invite.php
@@ -9,7 +9,7 @@
$user_guids = get_input('user_guid');
if (!is_array($user_guids)) {
- $user_guids = array($user_guids);
+ $user_guids = [$user_guids];
}
$group_guid = get_input('group_guid');
$group = get_entity($group_guid);
@@ -36,17 +36,17 @@
$url = elgg_normalize_url("groups/invitations/$user->username");
- $subject = elgg_echo('groups:invite:subject', array(
+ $subject = elgg_echo('groups:invite:subject', [
$user->name,
$group->name
- ), $user->language);
+ ], $user->language);
- $body = elgg_echo('groups:invite:body', array(
+ $body = elgg_echo('groups:invite:body', [
$user->name,
$logged_in_user->name,
$group->name,
$url,
- ), $user->language);
+ ], $user->language);
$params = [
'action' => 'invite',
diff --git a/mod/groups/actions/groups/membership/join.php b/mod/groups/actions/groups/membership/join.php
index e55bb76e81e..e4da4f01e7b 100644
--- a/mod/groups/actions/groups/membership/join.php
+++ b/mod/groups/actions/groups/membership/join.php
@@ -21,7 +21,6 @@
elgg_set_ignore_access($ia);
if ($user && ($group instanceof ElggGroup)) {
-
// join or request
$join = false;
if ($group->isPublicMembership() || $group->canEdit($user->guid)) {
@@ -50,18 +49,18 @@
$url = elgg_normalize_url("groups/requests/$group->guid");
- $subject = elgg_echo('groups:request:subject', array(
+ $subject = elgg_echo('groups:request:subject', [
$user->name,
$group->name,
- ), $owner->language);
+ ], $owner->language);
- $body = elgg_echo('groups:request:body', array(
+ $body = elgg_echo('groups:request:body', [
$group->getOwnerEntity()->name,
$user->name,
$group->name,
$user->getURL(),
$url,
- ), $owner->language);
+ ], $owner->language);
$params = [
'action' => 'membership_request',
diff --git a/mod/groups/actions/groups/membership/leave.php b/mod/groups/actions/groups/membership/leave.php
index 7058ca953ca..ced3e3d6ba0 100644
--- a/mod/groups/actions/groups/membership/leave.php
+++ b/mod/groups/actions/groups/membership/leave.php
@@ -8,7 +8,7 @@
$user_guid = get_input('user_guid');
$group_guid = get_input('group_guid');
-$user = NULL;
+$user = null;
if (!$user_guid) {
$user = elgg_get_logged_in_user_entity();
} else {
diff --git a/mod/groups/actions/groups/membership/remove.php b/mod/groups/actions/groups/membership/remove.php
index cb3278f1f0b..906e7f32488 100644
--- a/mod/groups/actions/groups/membership/remove.php
+++ b/mod/groups/actions/groups/membership/remove.php
@@ -17,7 +17,7 @@
// Don't allow removing group owner
if ($group->getOwnerGUID() != $user->getGUID()) {
if ($group->leave($user)) {
- system_message(elgg_echo("groups:removed", array($user->name)));
+ system_message(elgg_echo("groups:removed", [$user->name]));
} else {
register_error(elgg_echo("groups:cantremove"));
}
diff --git a/mod/groups/elgg-plugin.php b/mod/groups/elgg-plugin.php
index 5c8f35e0d38..02dfa54beb1 100644
--- a/mod/groups/elgg-plugin.php
+++ b/mod/groups/elgg-plugin.php
@@ -47,4 +47,4 @@
],
],
];
-
\ No newline at end of file
+
diff --git a/mod/groups/languages/da.php b/mod/groups/languages/da.php
index dff5c6c3459..5df0ccf128e 100644
--- a/mod/groups/languages/da.php
+++ b/mod/groups/languages/da.php
@@ -1,5 +1,5 @@
"Startet af %s",
'groups:joinrequest:remove:check' => 'Er du sikker på, at du vil fjerne denne anmodning om tilmelding?',
'groups:invite:remove:check' => 'Er du sikker på, at du vil fjerne denne invitation?',
- 'groups:invite:body' => "Hej %s,
-
-%s inviterede dig til at være med i '%s' gruppen, klik herunder for at bekræfte:
-
+ 'groups:invite:body' => "Hej %s,
+
+%s inviterede dig til at være med i '%s' gruppen, klik herunder for at bekræfte:
+
%s",
'groups:welcome:subject' => "Velkommen til %s gruppen!",
- 'groups:welcome:body' => "Hej %s!
-
-Du er nu medlem af '%s' gruppen! Klik herunder for at begynde med at skrive!
-
+ 'groups:welcome:body' => "Hej %s!
+
+Du er nu medlem af '%s' gruppen! Klik herunder for at begynde med at skrive!
+
%s",
'groups:request:subject' => "%s har ønsket at blive medlem af %s",
- 'groups:request:body' => "Hej %s,
-
-%s har bedt om at måtte være med i '%s' gruppen, klik nedenfor for at se deres profil:
-
-%s
-
-eller klik nedenfor for at se gruppens anmodningsliste:
-
+ 'groups:request:body' => "Hej %s,
+
+%s har bedt om at måtte være med i '%s' gruppen, klik nedenfor for at se deres profil:
+
+%s
+
+eller klik nedenfor for at se gruppens anmodningsliste:
+
%s",
/**
@@ -209,4 +209,4 @@
* ecml
*/
'groups:ecml:groupprofile' => 'Gruppeprofiler',
-);
+];
diff --git a/mod/groups/languages/de.php b/mod/groups/languages/de.php
index d3e7d30c15f..c4458b64955 100644
--- a/mod/groups/languages/de.php
+++ b/mod/groups/languages/de.php
@@ -1,5 +1,5 @@
'Gruppen-Profile',
-);
+];
diff --git a/mod/groups/languages/el.php b/mod/groups/languages/el.php
index 9f9e419e84b..e657bc1bf02 100644
--- a/mod/groups/languages/el.php
+++ b/mod/groups/languages/el.php
@@ -1,5 +1,5 @@
'Προφίλ ομάδας',
-);
+];
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index c242f79b0c8..f9ce5274046 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -1,5 +1,5 @@
'Perfiles de los grupos',
-);
+];
diff --git a/mod/groups/languages/eu_es.php b/mod/groups/languages/eu_es.php
index 76a7a71e4b5..e8db2f9e0c4 100644
--- a/mod/groups/languages/eu_es.php
+++ b/mod/groups/languages/eu_es.php
@@ -1,5 +1,5 @@
'Taldeko profilak',
-);
+];
diff --git a/mod/groups/languages/fi.php b/mod/groups/languages/fi.php
index b4241bce0f3..d14192c0cf5 100644
--- a/mod/groups/languages/fi.php
+++ b/mod/groups/languages/fi.php
@@ -1,5 +1,5 @@
'Ryhmät',
-);
+];
diff --git a/mod/groups/languages/fr.php b/mod/groups/languages/fr.php
index 58de8c4ecd1..f1f6e5ab7e0 100644
--- a/mod/groups/languages/fr.php
+++ b/mod/groups/languages/fr.php
@@ -1,5 +1,5 @@
'Profils de groupe',
-);
+];
diff --git a/mod/groups/languages/gl.php b/mod/groups/languages/gl.php
index 6196021d078..6dc2ded5a51 100644
--- a/mod/groups/languages/gl.php
+++ b/mod/groups/languages/gl.php
@@ -1,5 +1,5 @@
'Perfís do grupo',
-);
+];
diff --git a/mod/groups/languages/it.php b/mod/groups/languages/it.php
index b11faf03147..7dc71076f31 100644
--- a/mod/groups/languages/it.php
+++ b/mod/groups/languages/it.php
@@ -1,5 +1,5 @@
'Profili del gruppo',
-);
+];
diff --git a/mod/groups/languages/ja.php b/mod/groups/languages/ja.php
index 0e0ec84c6ca..4c62cb99a7d 100644
--- a/mod/groups/languages/ja.php
+++ b/mod/groups/languages/ja.php
@@ -1,5 +1,5 @@
'グループプロフィール',
-);
+];
diff --git a/mod/groups/languages/nl.php b/mod/groups/languages/nl.php
index ae018c9ec2d..5470966a7f8 100644
--- a/mod/groups/languages/nl.php
+++ b/mod/groups/languages/nl.php
@@ -1,5 +1,5 @@
'Groepsprofielen',
-);
+];
diff --git a/mod/groups/languages/pl.php b/mod/groups/languages/pl.php
index d8551fcc353..bdd0258192a 100644
--- a/mod/groups/languages/pl.php
+++ b/mod/groups/languages/pl.php
@@ -1,5 +1,5 @@
"Rozpoczął %s",
'groups:joinrequest:remove:check' => 'Czy na pewno chcesz usunąć tą prośbę o członkostwo?',
'groups:invite:remove:check' => 'Czy na pewno chcesz usunąć to zaproszenie?',
- 'groups:invite:body' => "Cześć %s,
-
-Zostałeś zaproszony do '% s' grupy, kliknij przycisk poniżej aby potwierdzić:
-
+ 'groups:invite:body' => "Cześć %s,
+
+Zostałeś zaproszony do '% s' grupy, kliknij przycisk poniżej aby potwierdzić:
+
%s",
'groups:welcome:subject' => "Witamy w %s !",
- 'groups:welcome:body' => "Cześć %s!
-
-Jesteś już członkiem grupy \"% s\"! Kliknij poniżej aby rozpocząć postowanie!
-
+ 'groups:welcome:body' => "Cześć %s!
+
+Jesteś już członkiem grupy \"% s\"! Kliknij poniżej aby rozpocząć postowanie!
+
%s",
'groups:request:subject' => "%s wystąpił z prośbą o dołączenie do %s",
- 'groups:request:body' => "Cześć %s,
-
-%s wystąpił z wnioskiem o dołączenie do grupy '%s' , kliknij poniżej aby zobaczyć profil:
-
-%s
-
-lub kliknij poniżej aby potwierdzić prośbę:
-
+ 'groups:request:body' => "Cześć %s,
+
+%s wystąpił z wnioskiem o dołączenie do grupy '%s' , kliknij poniżej aby zobaczyć profil:
+
+%s
+
+lub kliknij poniżej aby potwierdzić prośbę:
+
%s",
/**
@@ -209,4 +209,4 @@
* ecml
*/
'groups:ecml:groupprofile' => 'Profile grupy',
-);
+];
diff --git a/mod/groups/languages/pt_br.php b/mod/groups/languages/pt_br.php
index 528366ba400..163db8697a7 100644
--- a/mod/groups/languages/pt_br.php
+++ b/mod/groups/languages/pt_br.php
@@ -1,5 +1,5 @@
"Iniciado por %s",
'groups:joinrequest:remove:check' => 'Você tem certeza de que deseja apagar esta solicitação de participação?',
'groups:invite:remove:check' => 'Você tem certeza de que deseja apagar este convite de participação?',
- 'groups:invite:body' => "Olá %s,
-
-%s convidou você para participar da Comunidade '%s', clique abaixo para confirmar:
-
+ 'groups:invite:body' => "Olá %s,
+
+%s convidou você para participar da Comunidade '%s', clique abaixo para confirmar:
+
%s",
'groups:welcome:subject' => "Seja bem-vindo na Comunidade %s!",
- 'groups:welcome:body' => "Olá %s!
-
-Agora você é membro da Comunidade '%s'! Clique abaixo para começar a enviar mensagens!
-
+ 'groups:welcome:body' => "Olá %s!
+
+Agora você é membro da Comunidade '%s'! Clique abaixo para começar a enviar mensagens!
+
%s",
'groups:request:subject' => "%s solicitou a participação na Comunidade %s",
- 'groups:request:body' => "Olá %s,
-
-%s solicitou a participação na Comunidade '%s', clique abaixo para ver seu perfil:
-
-%s
-
-ou clique abaixo para aceitar o pedido:
-
+ 'groups:request:body' => "Olá %s,
+
+%s solicitou a participação na Comunidade '%s', clique abaixo para ver seu perfil:
+
+%s
+
+ou clique abaixo para aceitar o pedido:
+
%s",
/**
@@ -209,4 +209,4 @@
* ecml
*/
'groups:ecml:groupprofile' => 'Perfis da Comunidade',
-);
+];
diff --git a/mod/groups/languages/ru.php b/mod/groups/languages/ru.php
index 94d64eb211e..23348f032a5 100644
--- a/mod/groups/languages/ru.php
+++ b/mod/groups/languages/ru.php
@@ -1,5 +1,5 @@
'Профили группы',
-);
+];
diff --git a/mod/groups/languages/sr.php b/mod/groups/languages/sr.php
index 0056095213b..f272871dc9c 100644
--- a/mod/groups/languages/sr.php
+++ b/mod/groups/languages/sr.php
@@ -1,5 +1,5 @@
'Профили групе',
-);
+];
diff --git a/mod/groups/languages/zh_hans.php b/mod/groups/languages/zh_hans.php
index 65ddbb9e955..117084a6c43 100644
--- a/mod/groups/languages/zh_hans.php
+++ b/mod/groups/languages/zh_hans.php
@@ -1,5 +1,5 @@
'圈子资料',
-);
+];
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 273e02d9e54..8fd68ec72c8 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -31,7 +31,7 @@ function groups_register_profile_buttons($group) {
* @return array
*/
function groups_prepare_form_vars($group = null) {
- $values = array(
+ $values = [
'name' => '',
'membership' => ACCESS_PUBLIC,
'vis' => ACCESS_PUBLIC,
@@ -39,7 +39,7 @@ function groups_prepare_form_vars($group = null) {
'entity' => null,
'owner_guid' => elgg_get_logged_in_user_guid(),
'content_access_mode' => ElggGroup::CONTENT_ACCESS_MODE_UNRESTRICTED
- );
+ ];
// handle customizable profile fields
$fields = elgg_get_config('group');
diff --git a/mod/groups/start.php b/mod/groups/start.php
index a59284b671b..97260f05438 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -111,11 +111,11 @@ function groups_init() {
*/
function groups_fields_setup() {
- $profile_defaults = array(
+ $profile_defaults = [
'description' => 'longtext',
'briefdescription' => 'text',
'interests' => 'tags',
- );
+ ];
$profile_defaults = elgg_trigger_plugin_hook('profile:fields', 'group', null, $profile_defaults);
@@ -128,7 +128,7 @@ function groups_fields_setup() {
// only shows up in search but why not just set this in en.php as doing it here
// means you cannot override it in a plugin
- add_translation(get_current_language(), array("tag_names:$name" => elgg_echo("groups:$name")));
+ add_translation(get_current_language(), ["tag_names:$name" => elgg_echo("groups:$name")]);
}
}
}
@@ -162,18 +162,18 @@ function _groups_page_menu_group_profile($hook, $type, $return, $params) {
return;
}
- $count = elgg_get_entities_from_relationship(array(
+ $count = elgg_get_entities_from_relationship([
'type' => 'user',
'relationship' => 'membership_request',
'relationship_guid' => $page_owner->guid,
'inverse_relationship' => true,
'count' => true,
- ));
+ ]);
$text = elgg_echo('groups:membershiprequests');
$title = $text;
if ($count) {
- $title = elgg_echo('groups:membershiprequests:pending', array($count));
+ $title = elgg_echo('groups:membershiprequests:pending', [$count]);
}
$return[] = \ElggMenuItem::factory([
@@ -241,7 +241,7 @@ function _groups_page_menu($hook, $type, $return, $params) {
$text = elgg_echo('groups:invitations');
$title = $text;
if ($invitation_count) {
- $title = elgg_echo('groups:invitations:pending', array($invitation_count));
+ $title = elgg_echo('groups:invitations:pending', [$invitation_count]);
}
$return[] = \ElggMenuItem::factory([
@@ -367,7 +367,7 @@ function groups_entity_menu_setup($hook, $type, $return, $params) {
/* @var ElggMenuItem $item */
foreach ($return as $index => $item) {
- if (in_array($item->getName(), array('likes', 'unlike', 'edit', 'delete'))) {
+ if (in_array($item->getName(), ['likes', 'unlike', 'edit', 'delete'])) {
unset($return[$index]);
}
}
@@ -379,46 +379,46 @@ function groups_entity_menu_setup($hook, $type, $return, $params) {
$mem = elgg_echo("groups:closed");
}
- $options = array(
+ $options = [
'name' => 'membership',
'text' => $mem,
'href' => false,
'priority' => 100,
- );
+ ];
$return[] = ElggMenuItem::factory($options);
// number of members
- $num_members = $entity->getMembers(array('count' => true));
+ $num_members = $entity->getMembers(['count' => true]);
$members_string = elgg_echo('groups:member');
- $options = array(
+ $options = [
'name' => 'members',
'text' => $num_members . ' ' . $members_string,
'href' => false,
'priority' => 200,
- );
+ ];
$return[] = ElggMenuItem::factory($options);
// feature link
if (elgg_is_admin_logged_in()) {
$isFeatured = $entity->featured_group == "yes";
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'feature',
'text' => elgg_echo("groups:makefeatured"),
'href' => elgg_add_action_tokens_to_url("action/groups/featured?group_guid={$entity->guid}&action_type=feature"),
'priority' => 300,
'item_class' => $isFeatured ? 'hidden' : '',
'deps' => 'groups/navigation',
- ));
+ ]);
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'unfeature',
'text' => elgg_echo("groups:makeunfeatured"),
'href' => elgg_add_action_tokens_to_url("action/groups/featured?group_guid={$entity->guid}&action_type=unfeature"),
'priority' => 300,
'item_class' => $isFeatured ? '' : 'hidden',
'deps' => 'groups/navigation',
- ));
+ ]);
}
return $return;
@@ -547,9 +547,9 @@ function groups_write_acl_plugin_hook($hook, $entity_type, $returnvalue, $params
}
// check group content access rules
- $allowed_access = array(
+ $allowed_access = [
ACCESS_PRIVATE
- );
+ ];
if ($page_owner->getContentAccessMode() !== ElggGroup::CONTENT_ACCESS_MODE_MEMBERS_ONLY) {
$allowed_access[] = ACCESS_LOGGED_IN;
@@ -563,7 +563,7 @@ function groups_write_acl_plugin_hook($hook, $entity_type, $returnvalue, $params
}
// add write access to the group
- $returnvalue[$page_owner->group_acl] = elgg_echo('groups:acl', array($page_owner->name));
+ $returnvalue[$page_owner->group_acl] = elgg_echo('groups:acl', [$page_owner->name]);
return $returnvalue;
}
@@ -641,16 +641,16 @@ function groups_access_default_override($hook, $type, $access) {
*
* @return mixed ElggGroups or guids depending on $return_guids, or count
*/
-function groups_get_invited_groups($user_guid, $return_guids = false, $options = array()) {
+function groups_get_invited_groups($user_guid, $return_guids = false, $options = []) {
$ia = elgg_set_ignore_access(true);
- $defaults = array(
+ $defaults = [
'relationship' => 'invited',
'relationship_guid' => (int) $user_guid,
'inverse_relationship' => true,
'limit' => 0,
- );
+ ];
$options = array_merge($defaults, $options);
$groups = elgg_get_entities_from_relationship($options);
@@ -658,7 +658,7 @@ function groups_get_invited_groups($user_guid, $return_guids = false, $options =
elgg_set_ignore_access($ia);
if ($return_guids) {
- $guids = array();
+ $guids = [];
foreach ($groups as $group) {
$guids[] = $group->getGUID();
}
@@ -679,7 +679,7 @@ function groups_get_invited_groups($user_guid, $return_guids = false, $options =
function groups_join_group($group, $user) {
// access ignore so user can be added to access collection of invisible group
- $ia = elgg_set_ignore_access(TRUE);
+ $ia = elgg_set_ignore_access(true);
$result = $group->join($user);
elgg_set_ignore_access($ia);
@@ -691,12 +691,12 @@ function groups_join_group($group, $user) {
remove_entity_relationship($group->guid, 'invited', $user->guid);
remove_entity_relationship($user->guid, 'membership_request', $group->guid);
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/relationship/member/create',
'action_type' => 'join',
'subject_guid' => $user->guid,
'object_guid' => $group->guid,
- ));
+ ]);
return true;
}
@@ -712,12 +712,12 @@ function groups_join_group($group, $user) {
* @return array
*/
function group_access_options($group) {
- $access_array = array(
+ $access_array = [
ACCESS_PRIVATE => 'private',
ACCESS_LOGGED_IN => 'logged in users',
ACCESS_PUBLIC => 'public',
- $group->group_acl => elgg_echo('groups:acl', array($group->name)),
- );
+ $group->group_acl => elgg_echo('groups:acl', [$group->name]),
+ ];
return $access_array;
}
@@ -728,10 +728,10 @@ function activity_profile_menu($hook, $entity_type, $return_value, $params) {
return;
}
- $return_value[] = array(
+ $return_value[] = [
'text' => elgg_echo('groups:activity'),
'href' => "groups/activity/{$params['owner']->guid}"
- );
+ ];
return $return_value;
}
@@ -787,33 +787,33 @@ function groups_invitationrequest_menu_setup($hook, $type, $menu, $params) {
return $menu;
}
- $accept_url = elgg_http_add_url_query_elements('action/groups/join', array(
+ $accept_url = elgg_http_add_url_query_elements('action/groups/join', [
'user_guid' => $user->guid,
'group_guid' => $group->guid,
- ));
+ ]);
- $menu[] = \ElggMenuItem::factory(array(
+ $menu[] = \ElggMenuItem::factory([
'name' => 'accept',
'href' => $accept_url,
'is_action' => true,
'text' => elgg_echo('accept'),
'link_class' => 'elgg-button elgg-button-submit',
'is_trusted' => true,
- ));
+ ]);
- $delete_url = elgg_http_add_url_query_elements('action/groups/killinvitation', array(
+ $delete_url = elgg_http_add_url_query_elements('action/groups/killinvitation', [
'user_guid' => $user->guid,
'group_guid' => $group->guid,
- ));
+ ]);
- $menu[] = \ElggMenuItem::factory(array(
+ $menu[] = \ElggMenuItem::factory([
'name' => 'delete',
'href' => $delete_url,
'is_action' => true,
'confirm' => elgg_echo('groups:invite:remove:check'),
'text' => elgg_echo('delete'),
'link_class' => 'elgg-button elgg-button-delete mlm',
- ));
+ ]);
return $menu;
}
@@ -895,13 +895,13 @@ function groups_prepare_profile_buttons($hook, $type, $items, $params) {
}
foreach ($actions as $action => $url) {
- $items[] = ElggMenuItem::factory(array(
+ $items[] = ElggMenuItem::factory([
'name' => $action,
'href' => elgg_normalize_url($url),
'text' => elgg_echo($action),
'is_action' => 0 === strpos($url, 'action'),
'link_class' => 'elgg-button elgg-button-action',
- ));
+ ]);
}
return $items;
@@ -934,7 +934,6 @@ function groups_default_page_owner_handler($hook, $type, $return, $params) {
$page = array_shift($segments);
switch ($page) {
-
case 'add' :
$guid = array_shift($segments);
if (!$guid) {
diff --git a/mod/groups/views/default/elgg/groups/edit.js b/mod/groups/views/default/elgg/groups/edit.js
index 4f687eda4a2..b25420c91a8 100644
--- a/mod/groups/views/default/elgg/groups/edit.js
+++ b/mod/groups/views/default/elgg/groups/edit.js
@@ -11,7 +11,7 @@ define(function(require) {
* Content access field gets disabled in the group edit form when
* group is made visible only to members. When the visibility is
* made less restrictive, the field is enabled again.
- *
+ *
* @param {Object} event
*/
var toggleContentAccessMode = function(event) {
@@ -32,3 +32,4 @@ define(function(require) {
toggleContentAccessMode: toggleContentAccessMode
};
});
+
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
index ee4ac8fd1fe..6dac1537822 100644
--- a/mod/groups/views/default/forms/groups/edit.php
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -22,10 +22,10 @@
// display the save button and some additional form data
if ($entity) {
- echo elgg_view("input/hidden", array(
+ echo elgg_view("input/hidden", [
"name" => "group_guid",
"value" => $entity->getGUID(),
- ));
+ ]);
}
$footer = elgg_view_field([
@@ -35,12 +35,12 @@
if ($entity) {
$delete_url = "action/groups/delete?guid=" . $entity->getGUID();
- $footer .= elgg_view("output/url", array(
+ $footer .= elgg_view("output/url", [
"text" => elgg_echo("groups:delete"),
"href" => $delete_url,
"confirm" => elgg_echo("groups:deletewarning"),
"class" => "elgg-button elgg-button-delete float-alt",
- ));
+ ]);
}
elgg_set_form_footer($footer);
diff --git a/mod/groups/views/default/forms/groups/invite.php b/mod/groups/views/default/forms/groups/invite.php
index 3976e468055..a5d05f0dfdd 100644
--- a/mod/groups/views/default/forms/groups/invite.php
+++ b/mod/groups/views/default/forms/groups/invite.php
@@ -23,8 +23,8 @@
echo elgg_view_field([
'#type' => 'friendspicker',
- 'entities' => $friends,
- 'name' => 'user_guid',
+ 'entities' => $friends,
+ 'name' => 'user_guid',
'highlight' => 'all',
]);
diff --git a/mod/groups/views/default/forms/groups/search.php b/mod/groups/views/default/forms/groups/search.php
index b3cd17eebaf..63027f26fb3 100644
--- a/mod/groups/views/default/forms/groups/search.php
+++ b/mod/groups/views/default/forms/groups/search.php
@@ -14,13 +14,13 @@
'#type' => 'text',
'name' => 'q',
'required' => true,
- 'class' => 'elgg-input-search',
+ 'class' => 'elgg-input-search',
]);
echo elgg_view_field([
'#type' => 'hidden',
'name' => 'container_guid',
- 'value' => $group->guid,
+ 'value' => $group->guid,
]);
$footer = elgg_view_field([
diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php
index 6ea98ee4a27..13e98410d67 100644
--- a/mod/groups/views/default/group/default.php
+++ b/mod/groups/views/default/group/default.php
@@ -15,23 +15,23 @@
$metadata = '';
if (!elgg_in_context('owner_block') && !elgg_in_context('widgets')) {
// only show entity menu outside of widgets and owner block
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $group,
'handler' => 'groups',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
if ($vars['full_view']) {
echo elgg_view('groups/profile/summary', $vars);
} else {
// brief view
- $params = array(
+ $params = [
'entity' => $group,
'metadata' => $metadata,
'subtitle' => $group->briefdescription,
- );
+ ];
$params = $params + $vars;
$list_body = elgg_view('group/elements/summary', $params);
diff --git a/mod/groups/views/default/group/format/invitationrequest.php b/mod/groups/views/default/group/format/invitationrequest.php
index 10e231896ed..6f3327b9b61 100644
--- a/mod/groups/views/default/group/format/invitationrequest.php
+++ b/mod/groups/views/default/group/format/invitationrequest.php
@@ -16,17 +16,17 @@
}
$icon = elgg_view_entity_icon($group, 'small');
-$menu = elgg_view_menu('invitationrequest', array(
+$menu = elgg_view_menu('invitationrequest', [
'entity' => $group,
'user' => $user,
'order_by' => 'priority',
'class' => 'elgg-menu-hz float-alt',
-));
+]);
-$summary = elgg_view('group/elements/summary', array(
+$summary = elgg_view('group/elements/summary', [
'entity' => $group,
'subtitle' => $group->briefdescription,
'metadata' => $menu,
-));
+]);
echo elgg_view_image_block($icon, $summary);
diff --git a/mod/groups/views/default/groups/css.php b/mod/groups/views/default/groups/css.php
index 4e4ca7cd82c..b3c795857a6 100644
--- a/mod/groups/views/default/groups/css.php
+++ b/mod/groups/views/default/groups/css.php
@@ -73,4 +73,4 @@
#groups-tools > li:last-child {
margin-bottom: 0;
}
-}
\ No newline at end of file
+}
diff --git a/mod/groups/views/default/groups/edit.php b/mod/groups/views/default/groups/edit.php
index 5579ad54a91..43aae1eed97 100644
--- a/mod/groups/views/default/groups/edit.php
+++ b/mod/groups/views/default/groups/edit.php
@@ -7,9 +7,9 @@
$entity = elgg_extract('entity', $vars, null);
-$form_vars = array(
+$form_vars = [
'enctype' => 'multipart/form-data',
'class' => 'elgg-form-alt',
-);
+];
echo elgg_view_form('groups/edit', $form_vars, groups_prepare_form_vars($entity));
diff --git a/mod/groups/views/default/groups/edit/access.php b/mod/groups/views/default/groups/edit/access.php
index 8cfa745e9b2..52da55382a6 100644
--- a/mod/groups/views/default/groups/edit/access.php
+++ b/mod/groups/views/default/groups/edit/access.php
@@ -76,7 +76,7 @@
}
}
-echo elgg_view_field($access_mode_params);
+echo elgg_view_field($access_mode_params);
if ($entity && ($owner_guid == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in())) {
$members = [];
@@ -114,4 +114,4 @@
}
echo elgg_view_field($owner_guid_options);
-}
\ No newline at end of file
+}
diff --git a/mod/groups/views/default/groups/edit/profile.php b/mod/groups/views/default/groups/edit/profile.php
index 8f39194b294..f585755f0cf 100644
--- a/mod/groups/views/default/groups/edit/profile.php
+++ b/mod/groups/views/default/groups/edit/profile.php
@@ -1,42 +1,41 @@
- 'file',
- '#label' => elgg_echo('groups:icon'),
- 'name' => 'icon',
-]);
-
-echo elgg_view_field([
- '#type' => 'text',
- '#label' => elgg_echo('groups:name'),
- 'required' => true,
- 'name' => 'name',
- 'value' => $name,
-]);
-
-// show the configured group profile fields
-foreach ($group_profile_fields as $shortname => $valtype) {
-
- $options = [
- '#type' => $valtype,
- 'name' => $shortname,
- 'value' => elgg_extract($shortname, $vars),
- ];
-
- if ($valtype !== 'hidden') {
- $options['#label'] = elgg_echo("groups:{$shortname}");
- }
-
- echo elgg_view_field($options);
-}
+ 'file',
+ '#label' => elgg_echo('groups:icon'),
+ 'name' => 'icon',
+]);
+
+echo elgg_view_field([
+ '#type' => 'text',
+ '#label' => elgg_echo('groups:name'),
+ 'required' => true,
+ 'name' => 'name',
+ 'value' => $name,
+]);
+
+// show the configured group profile fields
+foreach ($group_profile_fields as $shortname => $valtype) {
+ $options = [
+ '#type' => $valtype,
+ 'name' => $shortname,
+ 'value' => elgg_extract($shortname, $vars),
+ ];
+
+ if ($valtype !== 'hidden') {
+ $options['#label'] = elgg_echo("groups:{$shortname}");
+ }
+
+ echo elgg_view_field($options);
+}
diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php
index 88b468c9989..19bf1e5c59b 100644
--- a/mod/groups/views/default/groups/invitationrequests.php
+++ b/mod/groups/views/default/groups/invitationrequests.php
@@ -12,11 +12,11 @@
$user = elgg_get_page_owner_entity();
$vars['limit'] = get_input('limit', elgg_get_config('default_limit'));
$vars['offset'] = get_input('offset', 0);
- $vars['count'] = groups_get_invited_groups($user->guid, false, array('count' => true));
- $invitations = groups_get_invited_groups($user->guid, false, array(
+ $vars['count'] = groups_get_invited_groups($user->guid, false, ['count' => true]);
+ $invitations = groups_get_invited_groups($user->guid, false, [
'limit' => $limit,
'offset' => $offset
- ));
+ ]);
}
$vars['items'] = $invitations;
diff --git a/mod/groups/views/default/groups/listing/alpha.php b/mod/groups/views/default/groups/listing/alpha.php
index 5554310d8bc..91654f1141e 100644
--- a/mod/groups/views/default/groups/listing/alpha.php
+++ b/mod/groups/views/default/groups/listing/alpha.php
@@ -4,11 +4,11 @@
* Renders a list of groups ordered alphabetically
*/
$dbprefix = elgg_get_config('dbprefix');
-echo elgg_list_entities(array(
+echo elgg_list_entities([
'type' => 'group',
'joins' => ["JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"],
'order_by' => 'ge.name',
'full_view' => false,
'no_results' => elgg_echo('groups:none'),
'distinct' => false,
-));
+]);
diff --git a/mod/groups/views/default/groups/listing/featured.php b/mod/groups/views/default/groups/listing/featured.php
index cca7705a0dc..096f2a42fe9 100644
--- a/mod/groups/views/default/groups/listing/featured.php
+++ b/mod/groups/views/default/groups/listing/featured.php
@@ -3,10 +3,10 @@
/**
* Renders a list of featured groups
*/
-echo elgg_list_entities_from_metadata(array(
+echo elgg_list_entities_from_metadata([
'type' => 'group',
'metadata_name' => 'featured_group',
'metadata_value' => 'yes',
'full_view' => false,
'no_results' => elgg_echo('groups:nofeatured'),
-));
+]);
diff --git a/mod/groups/views/default/groups/listing/newest.php b/mod/groups/views/default/groups/listing/newest.php
index 07931ff3bc3..71d10cbcc34 100644
--- a/mod/groups/views/default/groups/listing/newest.php
+++ b/mod/groups/views/default/groups/listing/newest.php
@@ -3,9 +3,9 @@
/**
* Renders a list of groups by creation date
*/
-echo elgg_list_entities(array(
+echo elgg_list_entities([
'type' => 'group',
'full_view' => false,
'no_results' => elgg_echo('groups:none'),
'distinct' => false,
-));
+]);
diff --git a/mod/groups/views/default/groups/listing/popular.php b/mod/groups/views/default/groups/listing/popular.php
index 24f6d228d25..57a4d5d574b 100644
--- a/mod/groups/views/default/groups/listing/popular.php
+++ b/mod/groups/views/default/groups/listing/popular.php
@@ -3,10 +3,10 @@
/**
* Renders a list of groups with most members
*/
-echo elgg_list_entities_from_relationship_count(array(
+echo elgg_list_entities_from_relationship_count([
'type' => 'group',
'relationship' => 'member',
'inverse_relationship' => false,
'full_view' => false,
'no_results' => elgg_echo('groups:none'),
-));
+]);
diff --git a/mod/groups/views/default/groups/membershiprequests.php b/mod/groups/views/default/groups/membershiprequests.php
index 181d29bbd34..1842c9550e6 100644
--- a/mod/groups/views/default/groups/membershiprequests.php
+++ b/mod/groups/views/default/groups/membershiprequests.php
@@ -9,36 +9,36 @@
if (!empty($vars['requests']) && is_array($vars['requests'])) {
echo '';
foreach ($vars['requests'] as $user) {
- $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => 'true'));
+ $icon = elgg_view_entity_icon($user, 'tiny', ['use_hover' => 'true']);
- $user_title = elgg_view('output/url', array(
+ $user_title = elgg_view('output/url', [
'href' => $user->getURL(),
'text' => $user->name,
'is_trusted' => true,
- ));
+ ]);
$url = "action/groups/addtogroup?user_guid={$user->guid}&group_guid={$vars['entity']->guid}";
$url = elgg_add_action_tokens_to_url($url);
- $accept_button = elgg_view('output/url', array(
+ $accept_button = elgg_view('output/url', [
'href' => $url,
'text' => elgg_echo('accept'),
'class' => 'elgg-button elgg-button-submit',
'is_trusted' => true,
- ));
+ ]);
$url = 'action/groups/killrequest?user_guid=' . $user->guid . '&group_guid=' . $vars['entity']->guid;
- $delete_button = elgg_view('output/url', array(
+ $delete_button = elgg_view('output/url', [
'href' => $url,
'confirm' => elgg_echo('groups:joinrequest:remove:check'),
'text' => elgg_echo('delete'),
'class' => 'elgg-button elgg-button-delete mlm',
- ));
+ ]);
$body = "$user_title ";
$alt = $accept_button . $delete_button;
echo '';
- echo elgg_view_image_block($icon, $body, array('image_alt' => $alt));
+ echo elgg_view_image_block($icon, $body, ['image_alt' => $alt]);
echo ' ';
}
echo ' ';
diff --git a/mod/groups/views/default/groups/navigation.js b/mod/groups/views/default/groups/navigation.js
index 6cfeca66eb6..42947671189 100644
--- a/mod/groups/views/default/groups/navigation.js
+++ b/mod/groups/views/default/groups/navigation.js
@@ -2,4 +2,4 @@ define(function(require) {
var elgg = require('elgg');
require('elgg/init');
elgg.ui.registerTogglableMenuItems('feature', 'unfeature');
-});
\ No newline at end of file
+});
diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php
index f5c7c07ce24..59a2af85c51 100644
--- a/mod/groups/views/default/groups/profile/activity_module.php
+++ b/mod/groups/views/default/groups/profile/activity_module.php
@@ -3,7 +3,7 @@
* Groups latest activity
*
* @todo add people joining group to activity
- *
+ *
* @package Groups
*/
@@ -16,30 +16,30 @@
return;
}
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => "groups/activity/$group->guid",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
-));
+]);
elgg_push_context('widgets');
$db_prefix = elgg_get_config('dbprefix');
-$content = elgg_list_river(array(
+$content = elgg_list_river([
'limit' => 4,
'pagination' => false,
- 'joins' => array(
+ 'joins' => [
"JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid",
"LEFT JOIN {$db_prefix}entities e2 ON e2.guid = rv.target_guid",
- ),
- 'wheres' => array(
+ ],
+ 'wheres' => [
"(e1.container_guid = $group->guid OR e2.container_guid = $group->guid)",
- ),
+ ],
'no_results' => elgg_echo('groups:activity:none'),
-));
+]);
elgg_pop_context();
-echo elgg_view('groups/profile/module', array(
+echo elgg_view('groups/profile/module', [
'title' => elgg_echo('groups:activity'),
'content' => $content,
'all_link' => $all_link,
-));
+]);
diff --git a/mod/groups/views/default/groups/profile/closed_membership.php b/mod/groups/views/default/groups/profile/closed_membership.php
index 574b2cce744..b8310e50b6f 100644
--- a/mod/groups/views/default/groups/profile/closed_membership.php
+++ b/mod/groups/views/default/groups/profile/closed_membership.php
@@ -1,7 +1,7 @@
$group->$key);
+ $options = ['value' => $group->$key];
if ($valtype == 'tags') {
$options['tag_names'] = $key;
}
diff --git a/mod/groups/views/default/groups/profile/module.php b/mod/groups/views/default/groups/profile/module.php
index 9d0b182665a..302d6d4e0e9 100644
--- a/mod/groups/views/default/groups/profile/module.php
+++ b/mod/groups/views/default/groups/profile/module.php
@@ -18,8 +18,8 @@
}
echo '';
-echo elgg_view_module('info', '', $vars['content'], array(
+echo elgg_view_module('info', '', $vars['content'], [
'header' => $header,
'class' => 'elgg-module-group',
-));
+]);
echo ' ';
diff --git a/mod/groups/views/default/groups/profile/summary.php b/mod/groups/views/default/groups/profile/summary.php
index acf4d231b2a..0a2fa56ae18 100644
--- a/mod/groups/views/default/groups/profile/summary.php
+++ b/mod/groups/views/default/groups/profile/summary.php
@@ -27,27 +27,27 @@
'',
'width' => '',
'height' => '',
- ));
+ ]);
?>
:
$owner->name,
'value' => $owner->getURL(),
'is_trusted' => true,
- ));
+ ]);
?>
getMembers(array('count' => true));
+ $num_members = $group->getMembers(['count' => true]);
echo elgg_echo('groups:members') . ": " . $num_members;
?>
diff --git a/mod/groups/views/default/groups/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php
index e680919b423..ce997fc8a70 100644
--- a/mod/groups/views/default/groups/profile/widgets.php
+++ b/mod/groups/views/default/groups/profile/widgets.php
@@ -1,9 +1,9 @@
';
diff --git a/mod/groups/views/default/groups/sidebar/featured.php b/mod/groups/views/default/groups/sidebar/featured.php
index 26db2a1b7b3..2223ea14c2e 100644
--- a/mod/groups/views/default/groups/sidebar/featured.php
+++ b/mod/groups/views/default/groups/sidebar/featured.php
@@ -7,12 +7,12 @@
elgg_push_context('widgets');
-$content = elgg_list_entities_from_metadata(array(
+$content = elgg_list_entities_from_metadata([
'metadata_name' => 'featured_group',
'metadata_value' => 'yes',
'type' => 'group',
'pagination' => false,
-));
+]);
elgg_pop_context();
diff --git a/mod/groups/views/default/groups/sidebar/find.php b/mod/groups/views/default/groups/sidebar/find.php
index c12f22d244b..b81a789b003 100644
--- a/mod/groups/views/default/groups/sidebar/find.php
+++ b/mod/groups/views/default/groups/sidebar/find.php
@@ -5,10 +5,10 @@
* @package ElggGroups
*/
-$body = elgg_view_form('groups/find', array(
+$body = elgg_view_form('groups/find', [
'action' => 'groups/search',
'method' => 'get',
'disable_security' => true,
-));
+]);
echo elgg_view_module('aside', elgg_echo('groups:searchtag'), $body);
diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php
index 60ec6653a19..10211455355 100644
--- a/mod/groups/views/default/groups/sidebar/members.php
+++ b/mod/groups/views/default/groups/sidebar/members.php
@@ -10,13 +10,13 @@
$limit = elgg_extract('limit', $vars, 14);
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => 'groups/members/' . $vars['entity']->guid,
'text' => elgg_echo('groups:members:more'),
'is_trusted' => true,
-));
+]);
-$body = elgg_list_entities_from_relationship(array(
+$body = elgg_list_entities_from_relationship([
'relationship' => 'member',
'relationship_guid' => $vars['entity']->guid,
'inverse_relationship' => true,
@@ -26,7 +26,7 @@
'pagination' => false,
'list_type' => 'gallery',
'gallery_class' => 'elgg-gallery-users',
-));
+]);
$body .= "
$all_link
";
diff --git a/mod/groups/views/default/groups/sidebar/my_status.php b/mod/groups/views/default/groups/sidebar/my_status.php
index 3e3cb9f21fc..c3c83888bfd 100644
--- a/mod/groups/views/default/groups/sidebar/my_status.php
+++ b/mod/groups/views/default/groups/sidebar/my_status.php
@@ -20,41 +20,41 @@
$is_owner = $group->getOwnerEntity() == $user;
if ($is_owner) {
- elgg_register_menu_item('groups:my_status', array(
+ elgg_register_menu_item('groups:my_status', [
'name' => 'membership_status',
'text' => '
' . elgg_echo('groups:my_status:group_owner') . ' ',
'href' => false
- ));
+ ]);
} elseif ($is_member) {
- elgg_register_menu_item('groups:my_status', array(
+ elgg_register_menu_item('groups:my_status', [
'name' => 'membership_status',
'text' => '
' . elgg_echo('groups:my_status:group_member') . ' ',
'href' => false
- ));
+ ]);
} else {
- elgg_register_menu_item('groups:my_status', array(
+ elgg_register_menu_item('groups:my_status', [
'name' => 'membership_status',
'text' => elgg_echo('groups:join'),
'href' => "/action/groups/join?group_guid={$group->getGUID()}",
'is_action' => true
- ));
+ ]);
}
// notification info
if (elgg_is_active_plugin('notifications') && $is_member) {
if ($subscribed) {
- elgg_register_menu_item('groups:my_status', array(
+ elgg_register_menu_item('groups:my_status', [
'name' => 'subscription_status',
'text' => elgg_echo('groups:subscribed'),
'href' => "notifications/group/$user->username",
'is_action' => true
- ));
+ ]);
} else {
- elgg_register_menu_item('groups:my_status', array(
+ elgg_register_menu_item('groups:my_status', [
'name' => 'subscription_status',
'text' => elgg_echo('groups:unsubscribed'),
'href' => "notifications/group/$user->username"
- ));
+ ]);
}
}
diff --git a/mod/groups/views/default/groups/sidebar/search.php b/mod/groups/views/default/groups/sidebar/search.php
index 4665fa12ac9..01975e28164 100644
--- a/mod/groups/views/default/groups/sidebar/search.php
+++ b/mod/groups/views/default/groups/sidebar/search.php
@@ -3,10 +3,10 @@
* Search for content in this group
*/
-$body = elgg_view_form('groups/search', array(
+$body = elgg_view_form('groups/search', [
'action' => 'search',
'method' => 'get',
'disable_security' => true,
-), $vars);
+], $vars);
echo elgg_view_module('aside', elgg_echo('groups:search_in_group'), $body);
diff --git a/mod/groups/views/default/resources/groups/activity.php b/mod/groups/views/default/resources/groups/activity.php
index 8f0a0291dfd..69cdffefe88 100644
--- a/mod/groups/views/default/resources/groups/activity.php
+++ b/mod/groups/views/default/resources/groups/activity.php
@@ -21,16 +21,16 @@
$db_prefix = elgg_get_config('dbprefix');
-$options = array(
- 'joins' => array(
+$options = [
+ 'joins' => [
"JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid",
"LEFT JOIN {$db_prefix}entities e2 ON e2.guid = rv.target_guid",
- ),
- 'wheres' => array(
+ ],
+ 'wheres' => [
"(e1.container_guid = $group->guid OR e2.container_guid = $group->guid)",
- ),
+ ],
'no_results' => elgg_echo('groups:activity:none'),
-);
+];
$type = preg_replace('[\W]', '', get_input('type', 'all'));
$subtype = preg_replace('[\W]', '', get_input('subtype', ''));
@@ -47,7 +47,7 @@
}
}
-$content = elgg_view('core/river/filter', array('selector' => $selector));
+$content = elgg_view('core/river/filter', ['selector' => $selector]);
$content .= elgg_list_river($options);
$body = elgg_view_layout('content', [
diff --git a/mod/groups/views/default/resources/groups/add.php b/mod/groups/views/default/resources/groups/add.php
index b7836381f7e..afa6b6c51fb 100644
--- a/mod/groups/views/default/resources/groups/add.php
+++ b/mod/groups/views/default/resources/groups/add.php
@@ -19,4 +19,4 @@
'filter' => '',
]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/all.php b/mod/groups/views/default/resources/groups/all.php
index 8c7d573db3a..2c6846c737b 100644
--- a/mod/groups/views/default/resources/groups/all.php
+++ b/mod/groups/views/default/resources/groups/all.php
@@ -28,4 +28,4 @@
'filter_value' => $selected_tab,
]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/edit.php b/mod/groups/views/default/resources/groups/edit.php
index f7f8414a068..d94c9d67522 100644
--- a/mod/groups/views/default/resources/groups/edit.php
+++ b/mod/groups/views/default/resources/groups/edit.php
@@ -12,16 +12,16 @@
elgg_set_page_owner_guid($group->getGUID());
elgg_push_breadcrumb($group->name, $group->getURL());
elgg_push_breadcrumb($title);
- $content = elgg_view("groups/edit", array('entity' => $group));
+ $content = elgg_view("groups/edit", ['entity' => $group]);
} else {
$content = elgg_echo('groups:noaccess');
}
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/invitations.php b/mod/groups/views/default/resources/groups/invitations.php
index 9e98515d7b0..677546f722d 100644
--- a/mod/groups/views/default/resources/groups/invitations.php
+++ b/mod/groups/views/default/resources/groups/invitations.php
@@ -21,11 +21,11 @@
$content = elgg_view('groups/invitationrequests');
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/invite.php b/mod/groups/views/default/resources/groups/invite.php
index 6d3295ae855..9ec15ba72de 100644
--- a/mod/groups/views/default/resources/groups/invite.php
+++ b/mod/groups/views/default/resources/groups/invite.php
@@ -13,21 +13,21 @@
forward(REFERER);
}
-$content = elgg_view_form('groups/invite', array(
+$content = elgg_view_form('groups/invite', [
'id' => 'invite_to_group',
'class' => 'elgg-form-alt mtm',
-), array(
+], [
'entity' => $group,
-));
+]);
elgg_push_breadcrumb($group->name, $group->getURL());
elgg_push_breadcrumb(elgg_echo('groups:invite'));
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/member.php b/mod/groups/views/default/resources/groups/member.php
index 625d42cfc70..0a64383dc57 100644
--- a/mod/groups/views/default/resources/groups/member.php
+++ b/mod/groups/views/default/resources/groups/member.php
@@ -14,7 +14,7 @@
if ($page_owner->guid == elgg_get_logged_in_user_guid()) {
$title = elgg_echo('groups:yours');
} else {
- $title = elgg_echo('groups:user', array($page_owner->name));
+ $title = elgg_echo('groups:user', [$page_owner->name]);
}
elgg_push_breadcrumb($title);
@@ -24,22 +24,22 @@
$dbprefix = elgg_get_config('dbprefix');
-$content = elgg_list_entities_from_relationship(array(
+$content = elgg_list_entities_from_relationship([
'type' => 'group',
'relationship' => 'member',
'relationship_guid' => elgg_get_page_owner_guid(),
'inverse_relationship' => false,
'full_view' => false,
- 'joins' => array("JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"),
+ 'joins' => ["JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"],
'order_by' => 'ge.name ASC',
'no_results' => elgg_echo('groups:none'),
-));
+]);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/members.php b/mod/groups/views/default/resources/groups/members.php
index 4ae8292bd21..77e681f2af6 100644
--- a/mod/groups/views/default/resources/groups/members.php
+++ b/mod/groups/views/default/resources/groups/members.php
@@ -29,12 +29,12 @@
default:
$db_prefix = elgg_get_config('dbprefix');
- $options['joins'] = array("JOIN {$db_prefix}users_entity u ON e.guid=u.guid");
+ $options['joins'] = ["JOIN {$db_prefix}users_entity u ON e.guid=u.guid"];
$options['order_by'] = 'u.name ASC';
break;
}
-$title = elgg_echo('groups:members:title', array($group->name));
+$title = elgg_echo('groups:members:title', [$group->name]);
$tabs = elgg_view_menu('groups_members', [
'entity' => $group,
@@ -44,11 +44,11 @@
$content = elgg_list_entities_from_relationship($options);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => $tabs,
-);
+];
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/owner.php b/mod/groups/views/default/resources/groups/owner.php
index a455e07a02a..34ab10c3b78 100644
--- a/mod/groups/views/default/resources/groups/owner.php
+++ b/mod/groups/views/default/resources/groups/owner.php
@@ -5,7 +5,7 @@
if ($page_owner->guid == elgg_get_logged_in_user_guid()) {
$title = elgg_echo('groups:owned');
} else {
- $title = elgg_echo('groups:owned:user', array($page_owner->name));
+ $title = elgg_echo('groups:owned:user', [$page_owner->name]);
}
elgg_push_breadcrumb($title);
@@ -14,21 +14,21 @@
}
$dbprefix = elgg_get_config('dbprefix');
-$content = elgg_list_entities(array(
+$content = elgg_list_entities([
'type' => 'group',
'owner_guid' => elgg_get_page_owner_guid(),
- 'joins' => array("JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"),
+ 'joins' => ["JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"],
'order_by' => 'ge.name ASC',
'full_view' => false,
'no_results' => elgg_echo('groups:none'),
'distinct' => false,
-));
+]);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/profile.php b/mod/groups/views/default/resources/groups/profile.php
index 356885a8216..f8f3c00ba9d 100644
--- a/mod/groups/views/default/resources/groups/profile.php
+++ b/mod/groups/views/default/resources/groups/profile.php
@@ -14,14 +14,14 @@
groups_register_profile_buttons($group);
-$content = elgg_view('groups/profile/layout', array('entity' => $group));
+$content = elgg_view('groups/profile/layout', ['entity' => $group]);
$sidebar = '';
if (elgg_group_gatekeeper(false)) {
if (elgg_is_active_plugin('search')) {
- $sidebar .= elgg_view('groups/sidebar/search', array('entity' => $group));
+ $sidebar .= elgg_view('groups/sidebar/search', ['entity' => $group]);
}
- $sidebar .= elgg_view('groups/sidebar/members', array('entity' => $group));
+ $sidebar .= elgg_view('groups/sidebar/members', ['entity' => $group]);
$subscribed = false;
if (elgg_is_active_plugin('notifications')) {
@@ -37,17 +37,17 @@
}
}
- $sidebar .= elgg_view('groups/sidebar/my_status', array(
+ $sidebar .= elgg_view('groups/sidebar/my_status', [
'entity' => $group,
'subscribed' => $subscribed
- ));
+ ]);
}
-$params = array(
+$params = [
'content' => $content,
'sidebar' => $sidebar,
'title' => $group->name,
-);
+];
$body = elgg_view_layout('one_sidebar', $params);
-echo elgg_view_page($group->name, $body);
\ No newline at end of file
+echo elgg_view_page($group->name, $body);
diff --git a/mod/groups/views/default/resources/groups/requests.php b/mod/groups/views/default/resources/groups/requests.php
index d872676a1ad..f780f0ff680 100644
--- a/mod/groups/views/default/resources/groups/requests.php
+++ b/mod/groups/views/default/resources/groups/requests.php
@@ -16,23 +16,23 @@
elgg_push_breadcrumb($group->name, $group->getURL());
elgg_push_breadcrumb($title);
-$requests = elgg_get_entities_from_relationship(array(
+$requests = elgg_get_entities_from_relationship([
'type' => 'user',
'relationship' => 'membership_request',
'relationship_guid' => $guid,
'inverse_relationship' => true,
'limit' => 0,
-));
-$content = elgg_view('groups/membershiprequests', array(
+]);
+$content = elgg_view('groups/membershiprequests', [
'requests' => $requests,
'entity' => $group,
-));
+]);
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
'filter' => '',
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/resources/groups/search.php b/mod/groups/views/default/resources/groups/search.php
index 73f5a1b0aa8..b9278376671 100644
--- a/mod/groups/views/default/resources/groups/search.php
+++ b/mod/groups/views/default/resources/groups/search.php
@@ -4,27 +4,27 @@
$tag = get_input("tag");
$display_query = _elgg_get_display_query($tag);
-$title = elgg_echo('groups:search:title', array($display_query));
+$title = elgg_echo('groups:search:title', [$display_query]);
// groups plugin saves tags as "interests" - see groups_fields_setup() in start.php
-$params = array(
+$params = [
'metadata_name' => 'interests',
'metadata_value' => $tag,
'type' => 'group',
'full_view' => false,
'no_results' => elgg_echo('groups:search:none'),
-);
+];
$content = elgg_list_entities_from_metadata($params);
$sidebar = elgg_view('groups/sidebar/find');
$sidebar .= elgg_view('groups/sidebar/featured');
-$params = array(
+$params = [
'content' => $content,
'sidebar' => $sidebar,
'filter' => false,
'title' => $title,
-);
+];
$body = elgg_view_layout('content', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/groups/views/default/river/group/create.php b/mod/groups/views/default/river/group/create.php
index d20f2b418c0..4afdbf31f0b 100644
--- a/mod/groups/views/default/river/group/create.php
+++ b/mod/groups/views/default/river/group/create.php
@@ -10,7 +10,7 @@
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => $excerpt,
-));
\ No newline at end of file
+]);
diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php
index 0afd87e4be3..a0e81572adf 100644
--- a/mod/groups/views/default/river/relationship/member/create.php
+++ b/mod/groups/views/default/river/relationship/member/create.php
@@ -3,6 +3,6 @@
* Group join river view.
*/
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $vars['item'],
-));
+]);
diff --git a/mod/groups/views/json/groups/profile/layout.php b/mod/groups/views/json/groups/profile/layout.php
index 63a6c647211..733dfde214e 100644
--- a/mod/groups/views/json/groups/profile/layout.php
+++ b/mod/groups/views/json/groups/profile/layout.php
@@ -1,7 +1,7 @@
'object',
'subtypes' => $entities['object'],
'container_guid' => $vars['entity']->getGUID(),
- ));
+ ]);
}
diff --git a/mod/invitefriends/actions/invitefriends/invite.php b/mod/invitefriends/actions/invitefriends/invite.php
index 0a9547e7d55..78d99da2e46 100644
--- a/mod/invitefriends/actions/invitefriends/invite.php
+++ b/mod/invitefriends/actions/invitefriends/invite.php
@@ -31,11 +31,10 @@
$current_user = elgg_get_logged_in_user_entity();
$error = false;
-$bad_emails = array();
-$already_members = array();
+$bad_emails = [];
+$already_members = [];
$sent_total = 0;
foreach ($emails as $email) {
-
$email = trim($email);
if (empty($email)) {
continue;
@@ -54,33 +53,33 @@
continue;
}
- $link = elgg_get_registration_url(array(
+ $link = elgg_get_registration_url([
'friend_guid' => $current_user->guid,
'invitecode' => generate_invite_code($current_user->username),
- ));
+ ]);
- $message = elgg_echo('invitefriends:email', array(
+ $message = elgg_echo('invitefriends:email', [
$site->name,
$current_user->name,
$emailmessage,
$link,
- ));
+ ]);
- $subject = elgg_echo('invitefriends:subject', array($site->getDisplayName()));
+ $subject = elgg_echo('invitefriends:subject', [$site->getDisplayName()]);
elgg_send_email($from, $email, $subject, $message);
$sent_total++;
}
if ($error) {
- register_error(elgg_echo('invitefriends:invitations_sent', array($sent_total)));
+ register_error(elgg_echo('invitefriends:invitations_sent', [$sent_total]));
if (count($bad_emails) > 0) {
- register_error(elgg_echo('invitefriends:email_error', array(implode(', ', $bad_emails))));
+ register_error(elgg_echo('invitefriends:email_error', [implode(', ', $bad_emails)]));
}
if (count($already_members) > 0) {
- register_error(elgg_echo('invitefriends:already_members', array(implode(', ', $already_members))));
+ register_error(elgg_echo('invitefriends:already_members', [implode(', ', $already_members)]));
}
return elgg_error_response();
diff --git a/mod/invitefriends/languages/de.php b/mod/invitefriends/languages/de.php
index 855f6d7ea61..5752bd58f93 100644
--- a/mod/invitefriends/languages/de.php
+++ b/mod/invitefriends/languages/de.php
@@ -1,5 +1,5 @@
'Freunde einladen',
@@ -30,4 +30,4 @@
Nachdem Du einen Account auf der Community-Seite erstellt hast, wirst das Mitglied, das Dich eingeladen hat, automatisch in Deine Freundesliste aufgenommen.',
-);
+];
diff --git a/mod/invitefriends/languages/en.php b/mod/invitefriends/languages/en.php
index f2106a7f985..ab1c9fca5aa 100644
--- a/mod/invitefriends/languages/en.php
+++ b/mod/invitefriends/languages/en.php
@@ -1,5 +1,5 @@
'Invite friends',
@@ -30,4 +30,4 @@
You will automatically add them as a friend when you create your account.',
-);
+];
diff --git a/mod/invitefriends/languages/es.php b/mod/invitefriends/languages/es.php
index fef24203868..4888c0ef6a7 100644
--- a/mod/invitefriends/languages/es.php
+++ b/mod/invitefriends/languages/es.php
@@ -1,5 +1,5 @@
'Invitar amigos',
@@ -30,4 +30,4 @@
Tu seras automáticamente agregado como amigo al crear tu cuenta.',
-);
+];
diff --git a/mod/invitefriends/languages/eu_es.php b/mod/invitefriends/languages/eu_es.php
index 07cc558fafb..30de85928fc 100644
--- a/mod/invitefriends/languages/eu_es.php
+++ b/mod/invitefriends/languages/eu_es.php
@@ -1,5 +1,5 @@
'Lagunak gonbidatu',
@@ -30,4 +30,4 @@
Automatikoki gehituko zara bertara lagun bezala zure kontua sortzen duzunean.',
-);
+];
diff --git a/mod/invitefriends/languages/fi.php b/mod/invitefriends/languages/fi.php
index 015269a51f4..fa8b7602bf5 100644
--- a/mod/invitefriends/languages/fi.php
+++ b/mod/invitefriends/languages/fi.php
@@ -1,5 +1,5 @@
'Kutsu kavereita',
@@ -30,4 +30,4 @@
Tulette automaattisesti toistenne kavereiksi luodessasi käyttäjätilisi.',
-);
+];
diff --git a/mod/invitefriends/languages/fr.php b/mod/invitefriends/languages/fr.php
index d772524ebec..b795ee3bf8e 100644
--- a/mod/invitefriends/languages/fr.php
+++ b/mod/invitefriends/languages/fr.php
@@ -1,5 +1,5 @@
'Inviter des contacts',
@@ -29,4 +29,4 @@
Vous serez automatiquement ajouté(e) comme contact lorsque vous créez votre compte via ce lien.',
-);
+];
diff --git a/mod/invitefriends/languages/gl.php b/mod/invitefriends/languages/gl.php
index dfb61bb0b9c..910288e4fbb 100644
--- a/mod/invitefriends/languages/gl.php
+++ b/mod/invitefriends/languages/gl.php
@@ -1,5 +1,5 @@
'Invitar amigos',
@@ -30,4 +30,4 @@
Cando cree a súa conta, a persoa que lle enviou a invitación convertirase automaticamente no seu contacto.',
-);
+];
diff --git a/mod/invitefriends/languages/it.php b/mod/invitefriends/languages/it.php
index c4664a43a0d..f2e1fe5b3a4 100644
--- a/mod/invitefriends/languages/it.php
+++ b/mod/invitefriends/languages/it.php
@@ -1,5 +1,5 @@
'Invita i tuoi amici',
@@ -30,4 +30,4 @@
Chi ti ha invitato, verrà automaticamente aggiunto come tuo amico quando creerai il tuo account.',
-);
+];
diff --git a/mod/invitefriends/languages/ja.php b/mod/invitefriends/languages/ja.php
index 49c013c9ede..386ea69a6bd 100644
--- a/mod/invitefriends/languages/ja.php
+++ b/mod/invitefriends/languages/ja.php
@@ -1,5 +1,5 @@
'友達を招待する',
@@ -34,4 +34,4 @@
アカウントを作成すると自動的に友達として登録されます。',
-);
+];
diff --git a/mod/invitefriends/languages/ko.php b/mod/invitefriends/languages/ko.php
index 94973a98821..72b562ee744 100644
--- a/mod/invitefriends/languages/ko.php
+++ b/mod/invitefriends/languages/ko.php
@@ -1,5 +1,5 @@
'친구 초대',
@@ -30,4 +30,4 @@
가입하면 자동으로 친구로 등록됩니다.',
-);
+];
diff --git a/mod/invitefriends/languages/nl.php b/mod/invitefriends/languages/nl.php
index 9553fb780f1..88f7c9a0ae2 100644
--- a/mod/invitefriends/languages/nl.php
+++ b/mod/invitefriends/languages/nl.php
@@ -1,5 +1,5 @@
'Vrienden uitnodigen',
@@ -36,4 +36,4 @@
Dit is een automatisch aangemaakt bericht. Je kunt hier niet op antwoorden.',
-);
+];
diff --git a/mod/invitefriends/languages/pl.php b/mod/invitefriends/languages/pl.php
index 7239bd585a4..e9da112e30f 100644
--- a/mod/invitefriends/languages/pl.php
+++ b/mod/invitefriends/languages/pl.php
@@ -1,5 +1,5 @@
'Zaproś znajomych',
@@ -30,4 +30,4 @@
Zapraszający zostanie automatycznie dodany do Twoich znajomych gdy już utworzysz konto.',
-);
+];
diff --git a/mod/invitefriends/languages/pt_br.php b/mod/invitefriends/languages/pt_br.php
index ff198d68358..bf7ae5e6180 100644
--- a/mod/invitefriends/languages/pt_br.php
+++ b/mod/invitefriends/languages/pt_br.php
@@ -1,5 +1,5 @@
'Convidar amigos',
@@ -16,19 +16,19 @@
'invitefriends:already_members' => 'Os seguintes já são participantes: %s.',
'invitefriends:noemails' => 'Nenhum endereço de email foi adicionado.',
- 'invitefriends:message:default' => 'Ola,
-
+ 'invitefriends:message:default' => 'Ola,
+
Eu desejo convidar você para participar da minha rede aqui em %s.',
- 'invitefriends:email' => '
-Você foi convidado a participar em %s por %s. Eles incluiram a seguinte mensagem:
-
-%s
-
-Para participar, click no seguinte endereço:
-
-%s
-
+ 'invitefriends:email' => '
+Você foi convidado a participar em %s por %s. Eles incluiram a seguinte mensagem:
+
+%s
+
+Para participar, click no seguinte endereço:
+
+%s
+
Você os adicionará automaticamente como amgios quando você criar sua conta.',
-);
+];
diff --git a/mod/invitefriends/languages/ru.php b/mod/invitefriends/languages/ru.php
index 8ecf957cbe6..9246964c5c8 100644
--- a/mod/invitefriends/languages/ru.php
+++ b/mod/invitefriends/languages/ru.php
@@ -1,5 +1,5 @@
'Пригласить друзей',
@@ -32,4 +32,4 @@
После регистрации Вы будете автоматически добавлены в друзья пригласившего Вас пользователя.",',
-);
+];
diff --git a/mod/invitefriends/languages/zh_hans.php b/mod/invitefriends/languages/zh_hans.php
index afef625b2a8..2e3e1d33683 100644
--- a/mod/invitefriends/languages/zh_hans.php
+++ b/mod/invitefriends/languages/zh_hans.php
@@ -1,5 +1,5 @@
'邀请朋友',
@@ -30,4 +30,4 @@
您注册成功后将自动与他(她)成为好友。',
-);
+];
diff --git a/mod/legacy_urls/languages/ca.php b/mod/legacy_urls/languages/ca.php
index cdfd8d507d2..cdfa60b06d0 100644
--- a/mod/legacy_urls/languages/ca.php
+++ b/mod/legacy_urls/languages/ca.php
@@ -1,9 +1,9 @@
'Aquesta pàgina s\'ha mogut a %s. Actualitzeu la vostra adreça d\'interès o informeu sobre l\'enllaç que us ha portat fins aquí.',
'legacy_urls:instructions' => 'Selecciona un mètode per utilitzar les URLs preexistents',
'legacy_urls:immediate' => 'Ves immediatament a la nova URL',
'legacy_urls:immediate_error' => 'Ves immediatament a la nova URL i mostra un missatge d\'error',
'legacy_urls:landing' => 'Mostra una pàgina amb l\'enllaç a la nova URL',
-);
+];
diff --git a/mod/legacy_urls/languages/cmn.php b/mod/legacy_urls/languages/cmn.php
index 4ece0169499..f2a70c8e839 100644
--- a/mod/legacy_urls/languages/cmn.php
+++ b/mod/legacy_urls/languages/cmn.php
@@ -1,9 +1,9 @@
'This page has moved to %s. Please update your bookmark or report the link that led here.',
'legacy_urls:instructions' => 'Select method for handling legacy URLs',
'legacy_urls:immediate' => 'Immediately forward to the new URL',
'legacy_urls:immediate_error' => 'Immediately forward to the new URL and display an error message',
'legacy_urls:landing' => 'Display a page with a link to the the new URL',
-);
+];
diff --git a/mod/legacy_urls/languages/de.php b/mod/legacy_urls/languages/de.php
index 6899f7f2b84..2e40c6b6efb 100644
--- a/mod/legacy_urls/languages/de.php
+++ b/mod/legacy_urls/languages/de.php
@@ -1,9 +1,9 @@
'Diese Seite ist nun unter %s verfügbar. Bitte aktualisiere Dein Lesezeichen oder melde dem Seitenadminitrator den Link, der Dich hierher geleitet hat.',
'legacy_urls:instructions' => 'Lege fest, wie Legacy-URLs (URLs voriger Elgg-Versionen, die sich in Elgg 1.9 geändert haben) behandelt werden sollen',
'legacy_urls:immediate' => 'Leite sofort zur neuen URL weiter',
'legacy_urls:immediate_error' => 'Leite sofort zur neuen URL weiter und gib eine Fehlermeldung aus',
'legacy_urls:landing' => 'Zeige eine Seite mit einer Fehlermeldung und einem Link zur neuen URL an',
-);
+];
diff --git a/mod/legacy_urls/languages/en.php b/mod/legacy_urls/languages/en.php
index 4ece0169499..f2a70c8e839 100644
--- a/mod/legacy_urls/languages/en.php
+++ b/mod/legacy_urls/languages/en.php
@@ -1,9 +1,9 @@
'This page has moved to %s. Please update your bookmark or report the link that led here.',
'legacy_urls:instructions' => 'Select method for handling legacy URLs',
'legacy_urls:immediate' => 'Immediately forward to the new URL',
'legacy_urls:immediate_error' => 'Immediately forward to the new URL and display an error message',
'legacy_urls:landing' => 'Display a page with a link to the the new URL',
-);
+];
diff --git a/mod/legacy_urls/languages/es.php b/mod/legacy_urls/languages/es.php
index 6d6235e26e1..47f01d84cbf 100644
--- a/mod/legacy_urls/languages/es.php
+++ b/mod/legacy_urls/languages/es.php
@@ -1,9 +1,9 @@
'Esta página ha sido movida a %s. Por favor actualiza tu marcador o reporta el link que te llevo aquí.',
'legacy_urls:instructions' => 'Selecciona un método para manejar URLs antiguas',
'legacy_urls:immediate' => 'Inmediatamente redireccionar al nuevo URL',
'legacy_urls:immediate_error' => 'Inmediatamente redireccionar al nuevo URL y mostrar un mensaje de error',
'legacy_urls:landing' => 'Mostrar una página con un link al nuevo URL',
-);
+];
diff --git a/mod/legacy_urls/languages/eu_es.php b/mod/legacy_urls/languages/eu_es.php
index 5ad92c6d7a1..958b35b9edb 100644
--- a/mod/legacy_urls/languages/eu_es.php
+++ b/mod/legacy_urls/languages/eu_es.php
@@ -1,9 +1,9 @@
'Orri hau %s-ra mugitua izan da. Mesedez eguneratu zure laster-marka edo ohartarazi hona ekarri zaituen esteka.',
'legacy_urls:instructions' => 'URL legatuak maneiatzeko metodo bat aukeratu',
'legacy_urls:immediate' => 'URL berrira zuzenean bidali',
'legacy_urls:immediate_error' => 'URL berrira zuzenean bidali eta errore mezua erakutsi',
'legacy_urls:landing' => 'URL berrirako orrialdea estekarekin erakutsi',
-);
+];
diff --git a/mod/legacy_urls/languages/fi.php b/mod/legacy_urls/languages/fi.php
index 784118dbf08..b8d4ec46be0 100644
--- a/mod/legacy_urls/languages/fi.php
+++ b/mod/legacy_urls/languages/fi.php
@@ -1,9 +1,9 @@
'Tämä sivu on siirretty osoitteeseen %s. Päivitä kirjanmerkkisi tai ilmoita vanhentunut linkki sivun omistajalle.',
'legacy_urls:instructions' => 'Vanhentuneiden osoitteiden käsittely',
'legacy_urls:immediate' => 'Ohjaa suoraan uuteen osoitteeseen',
'legacy_urls:immediate_error' => 'Ohjaa uuteen osoitteeseen ja näytä virheilmoitus',
'legacy_urls:landing' => 'Näytä sivu, jossa on linkki uuteen osoitteeseen',
-);
+];
diff --git a/mod/legacy_urls/languages/fr.php b/mod/legacy_urls/languages/fr.php
index 9a2d2d38545..4e750f383a9 100644
--- a/mod/legacy_urls/languages/fr.php
+++ b/mod/legacy_urls/languages/fr.php
@@ -1,9 +1,9 @@
'Cette page a été déplacée vers %s. Veuillez SVP mettre à jour votre signet et nous signaler le lien qui vous a conduit ici.',
'legacy_urls:instructions' => 'Sélectionnez une méthode pour la gestion des URL pré-existantes',
'legacy_urls:immediate' => 'Transférer immédiatement vers la nouvelle URL',
'legacy_urls:immediate_error' => 'Transférer immédiatement vers la nouvelle URL et afficher un message d\'erreur',
'legacy_urls:landing' => 'Afficher une page avec un lien vers la nouvelle URL',
-);
+];
diff --git a/mod/legacy_urls/languages/gl.php b/mod/legacy_urls/languages/gl.php
index e29168d3efe..26ed485e679 100644
--- a/mod/legacy_urls/languages/gl.php
+++ b/mod/legacy_urls/languages/gl.php
@@ -1,9 +1,9 @@
'A páxina moveuse a %s. Actualice o seu marcador ou informe de que a ligazón que o levou ata aquí está obsoleta.',
'legacy_urls:instructions' => 'Seleccione o método co que xestionar os enderezos URL obsoletos.',
'legacy_urls:immediate' => 'Redirixir inmediatamente ao novo URL',
'legacy_urls:immediate_error' => 'Redirixir inmediatamente ao novo URL e mostrar unha mensaxe de erro',
'legacy_urls:landing' => 'Mostrar unha páxina cunha ligazón ao novo URL',
-);
+];
diff --git a/mod/legacy_urls/languages/it.php b/mod/legacy_urls/languages/it.php
index 929c1936e1c..4ec24e773b2 100644
--- a/mod/legacy_urls/languages/it.php
+++ b/mod/legacy_urls/languages/it.php
@@ -1,9 +1,9 @@
'Pagina spostata su %s. Per favore aggiorna i tuoi segnalibri oppure facci sapere qual è il link che ti ha portato qui, grazie.',
'legacy_urls:instructions' => 'Seleziona il metodo per gestire i link ereditati',
'legacy_urls:immediate' => 'Inoltra immediatamente al nuovo indirizzo',
'legacy_urls:immediate_error' => 'Inoltra immediatamente al nuovo indirizzo e visualizza un messaggio di errore',
'legacy_urls:landing' => 'Visualizza una pagina con un link al nuovo indirizzo',
-);
+];
diff --git a/mod/legacy_urls/languages/ja.php b/mod/legacy_urls/languages/ja.php
index 524c74d4160..3a4a8a40782 100644
--- a/mod/legacy_urls/languages/ja.php
+++ b/mod/legacy_urls/languages/ja.php
@@ -1,9 +1,9 @@
'このページは %s に移動しました。 あなたのブックマークを更新するかリンクを報告してください。',
'legacy_urls:instructions' => 'レガシーURLsの取り扱い方法を選択してください。',
'legacy_urls:immediate' => '新しいURLへ直ちにフォワードする',
'legacy_urls:immediate_error' => '新しいURLへ直ちにフォワードしてエラーメッセージを表示する',
'legacy_urls:landing' => '新しいURLへのリンクを記載したページを表示する',
-);
+];
diff --git a/mod/legacy_urls/languages/ko.php b/mod/legacy_urls/languages/ko.php
index 8729da9bf9c..0f82dcb9684 100644
--- a/mod/legacy_urls/languages/ko.php
+++ b/mod/legacy_urls/languages/ko.php
@@ -1,9 +1,9 @@
'이 페이지는 %s 로 이동되었습니다. 책갈피를 갱신하거나 이곳으로 연결된 링크를 신고해주세요.',
'legacy_urls:instructions' => '기본 주소를 다룰 방법을 선택하세요',
'legacy_urls:immediate' => '새 주소로 바로 보냄',
'legacy_urls:immediate_error' => '새 주소로 바로 보내고 오류 표시',
'legacy_urls:landing' => '새 주소로의 링크와 페이지를 표시',
-);
+];
diff --git a/mod/legacy_urls/languages/nl.php b/mod/legacy_urls/languages/nl.php
index 4fe457f8992..986a886edd6 100644
--- a/mod/legacy_urls/languages/nl.php
+++ b/mod/legacy_urls/languages/nl.php
@@ -1,9 +1,9 @@
'Deze pagina is verplaatst naar %s. Pas je favoriet/bladwijzer aan! Je kunt ook de link waar je vandaan kwam melden.',
'legacy_urls:instructions' => 'Selecteer de methode hoe je verkeerde URL\'s wilt behandelen:',
'legacy_urls:immediate' => 'Stuur direct door naar de nieuwe URL',
'legacy_urls:immediate_error' => 'Stuur direct door naar de nieuwe URL en toon een foutmelding',
'legacy_urls:landing' => 'Toon een pagina met de link naar de nieuwe URL',
-);
+];
diff --git a/mod/legacy_urls/languages/pl.php b/mod/legacy_urls/languages/pl.php
index e431da3f0cf..fc869cfa26a 100644
--- a/mod/legacy_urls/languages/pl.php
+++ b/mod/legacy_urls/languages/pl.php
@@ -1,9 +1,9 @@
'Ta strona została przeniesiona pod adres %s. Proszę zaktualizować odnośnik lub zgłosić niepoprawny.',
'legacy_urls:instructions' => 'Wybierz politykę obsługi przestarzałych URLi',
'legacy_urls:immediate' => 'Natychmiast przekieruj do nowego URLa',
'legacy_urls:immediate_error' => 'Natychmiast przekieruj do nowego URLa i wyświetl komunikat błędu',
'legacy_urls:landing' => 'Wyświetl stronę z odnośnikiem do nowego URLa',
-);
+];
diff --git a/mod/legacy_urls/languages/pt_br.php b/mod/legacy_urls/languages/pt_br.php
index 9ac44d0d0da..7727dd5f0a9 100644
--- a/mod/legacy_urls/languages/pt_br.php
+++ b/mod/legacy_urls/languages/pt_br.php
@@ -1,9 +1,9 @@
'Esta página foi removida para %s. Por favor, atualize seus favoritos ou informar o link que o direcionou até aqui.',
'legacy_urls:instructions' => 'Escolha um método para lidar com URLs legados (legacy URLs)',
'legacy_urls:immediate' => 'Redirecione imediatamente à nova URL',
'legacy_urls:immediate_error' => 'Redirecione imediatamente à nova URL e apresente uma mensagem de erro',
'legacy_urls:landing' => 'Apresente uma página com um link para o novo URL',
-);
+];
diff --git a/mod/legacy_urls/languages/ru.php b/mod/legacy_urls/languages/ru.php
index 1f5058c2bd6..144f4bd1b88 100644
--- a/mod/legacy_urls/languages/ru.php
+++ b/mod/legacy_urls/languages/ru.php
@@ -1,9 +1,9 @@
'Страница переехала на адрес %s. Пожалуйста обновите ваши закладки или сообщите об ошибке в ссылке ведущей сюда.',
'legacy_urls:instructions' => 'Выберите метод для обработки устаревших URL',
'legacy_urls:immediate' => 'Немедленно перенаправлять на новый URL',
'legacy_urls:immediate_error' => 'Немедленно перенаправлять на новый URL и показывать сообщение ошибки',
'legacy_urls:landing' => 'Показывать страницу со ссылкой на новый URL',
-);
+];
diff --git a/mod/legacy_urls/start.php b/mod/legacy_urls/start.php
index 36835abaffb..41ec4946458 100644
--- a/mod/legacy_urls/start.php
+++ b/mod/legacy_urls/start.php
@@ -43,8 +43,8 @@ function legacy_urls_redirect($url) {
switch ($method) {
case 'landing':
- $content = elgg_view('legacy_urls/message', array('url' => $url));
- $body = elgg_view_layout('error', array('content' => $content));
+ $content = elgg_view('legacy_urls/message', ['url' => $url]);
+ $body = elgg_view_layout('error', ['content' => $content]);
echo elgg_view_page('', $body, 'error');
return true;
break;
@@ -68,8 +68,8 @@ function legacy_urls_redirect($url) {
* @param array $query_vars Additional query parameters in associate array
* @return string
*/
-function legacy_urls_prepare_url($url, array $query_vars = array()) {
- $params = array();
+function legacy_urls_prepare_url($url, array $query_vars = []) {
+ $params = [];
// Elgg munges the request in htaccess rules so cannot use $_GET
$query = parse_url(_elgg_services()->request->server->get('REQUEST_URI'), PHP_URL_QUERY);
if ($query) {
@@ -95,7 +95,7 @@ function legacy_urls_prepare_url($url, array $query_vars = array()) {
*/
function legacy_urls_tag_handler($segments) {
$tag = $segments[0];
- $url = legacy_urls_prepare_url('search', array('q' => $tag));
+ $url = legacy_urls_prepare_url('search', ['q' => $tag]);
return legacy_urls_redirect($url);
}
@@ -387,7 +387,7 @@ function legacy_urls_messageboard_forward($hook, $type, $result) {
$page = array_pad($page, 4, "");
// if the first part is a username, forward to new format
- $new_section_one = array('owner', 'add', 'group');
+ $new_section_one = ['owner', 'add', 'group'];
if (isset($page[0]) && !in_array($page[0], $new_section_one) && get_user_by_username($page[0])) {
$url = "messageboard/owner/{$page[0]}";
legacy_urls_redirect(legacy_urls_prepare_url($url));
diff --git a/mod/legacy_urls/views/default/legacy_urls/message.php b/mod/legacy_urls/views/default/legacy_urls/message.php
index ce87307395f..eb0581fb90e 100644
--- a/mod/legacy_urls/views/default/legacy_urls/message.php
+++ b/mod/legacy_urls/views/default/legacy_urls/message.php
@@ -1,14 +1,14 @@
elgg_normalize_url($vars['url']),
'href' => $vars['url'],
-));
-$message = elgg_echo('legacy_urls:message', array($link));
+]);
+$message = elgg_echo('legacy_urls:message', [$link]);
echo "
$message ";
diff --git a/mod/legacy_urls/views/default/plugins/legacy_urls/settings.php b/mod/legacy_urls/views/default/plugins/legacy_urls/settings.php
index e977117f7da..48f081d89d4 100644
--- a/mod/legacy_urls/views/default/plugins/legacy_urls/settings.php
+++ b/mod/legacy_urls/views/default/plugins/legacy_urls/settings.php
@@ -1,7 +1,7 @@
'params[redirect_method]',
'value' => $vars['entity']->redirect_method,
- 'options' => array(
+ 'options' => [
elgg_echo('legacy_urls:immediate') => 'immediate',
elgg_echo('legacy_urls:immediate_error') => 'immediate_error',
elgg_echo('legacy_urls:landing') => 'landing',
- )
-));
+ ]
+]);
echo <<
diff --git a/mod/likes/actions/likes/add.php b/mod/likes/actions/likes/add.php
index c8eacf7f3b5..f512394185f 100644
--- a/mod/likes/actions/likes/add.php
+++ b/mod/likes/actions/likes/add.php
@@ -52,30 +52,30 @@
$site = elgg_get_site_entity();
// summary for site_notifications
- $summary = elgg_echo('likes:notifications:subject', array(
+ $summary = elgg_echo('likes:notifications:subject', [
$user->name,
$title_str
- ),
+ ],
$owner->language
);
// prevent long subjects in mail
$title_str = elgg_get_excerpt($title_str, 80);
- $subject = elgg_echo('likes:notifications:subject', array(
+ $subject = elgg_echo('likes:notifications:subject', [
$user->name,
$title_str
- ),
+ ],
$owner->language
);
- $body = elgg_echo('likes:notifications:body', array(
+ $body = elgg_echo('likes:notifications:body', [
$owner->name,
$user->name,
$title_str,
$site->name,
$entity->getURL(),
$user->getURL()
- ),
+ ],
$owner->language
);
@@ -84,12 +84,12 @@
$user->guid,
$subject,
$body,
- array(
+ [
'action' => 'create',
'object' => $annotation,
'summary' => $summary,
'url' => $entity->getURL(),
- )
+ ]
);
}
@@ -98,9 +98,9 @@
if (elgg_is_xhr()) {
$num_of_likes = likes_count($entity);
if ($num_of_likes == 1) {
- $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
+ $likes_string = elgg_echo('likes:userlikedthis', [$num_of_likes]);
} else {
- $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
+ $likes_string = elgg_echo('likes:userslikedthis', [$num_of_likes]);
}
echo json_encode([
'text' => $likes_string,
diff --git a/mod/likes/actions/likes/delete.php b/mod/likes/actions/likes/delete.php
index 2f276c5fd31..521f1f1dc11 100644
--- a/mod/likes/actions/likes/delete.php
+++ b/mod/likes/actions/likes/delete.php
@@ -7,17 +7,17 @@
// Support deleting by id in case we're deleting another user's likes
$id = (int) get_input('id');
-$like = NULL;
+$like = null;
if ($id) {
$like = elgg_get_annotation_from_id($id);
}
if (!$like) {
- $likes = elgg_get_annotations(array(
+ $likes = elgg_get_annotations([
'guid' => (int) get_input('guid'),
'annotation_owner_guid' => elgg_get_logged_in_user_guid(),
'annotation_name' => 'likes',
- ));
+ ]);
$like = $likes[0];
}
@@ -29,9 +29,9 @@
if ($entity && elgg_is_xhr()) {
$num_of_likes = likes_count($entity);
if ($num_of_likes == 1) {
- $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
+ $likes_string = elgg_echo('likes:userlikedthis', [$num_of_likes]);
} else {
- $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
+ $likes_string = elgg_echo('likes:userslikedthis', [$num_of_likes]);
}
echo json_encode([
'text' => $likes_string,
diff --git a/mod/likes/classes/Elgg/Likes/DataService.php b/mod/likes/classes/Elgg/Likes/DataService.php
index 9b8ebf99980..c9e27fc6d14 100644
--- a/mod/likes/classes/Elgg/Likes/DataService.php
+++ b/mod/likes/classes/Elgg/Likes/DataService.php
@@ -10,19 +10,19 @@ class DataService {
/**
* @var array [GUID => boolean]
*/
- protected $current_user_likes = array();
+ protected $current_user_likes = [];
/**
* @var array [GUID => int]
*/
- protected $num_likes = array();
+ protected $num_likes = [];
/**
* @param int $guid
* @param int $num
*/
public function setNumLikes($guid, $num) {
- $this->num_likes[$guid] = (int)$num;
+ $this->num_likes[$guid] = (int) $num;
}
/**
@@ -30,7 +30,7 @@ public function setNumLikes($guid, $num) {
* @param bool $is_liked
*/
public function setLikedByCurrentUser($guid, $is_liked) {
- $this->current_user_likes[$guid] = (bool)$is_liked;
+ $this->current_user_likes[$guid] = (bool) $is_liked;
}
/**
diff --git a/mod/likes/classes/Elgg/Likes/Preloader.php b/mod/likes/classes/Elgg/Likes/Preloader.php
index cbac40f9c56..651eb7b1c20 100644
--- a/mod/likes/classes/Elgg/Likes/Preloader.php
+++ b/mod/likes/classes/Elgg/Likes/Preloader.php
@@ -35,13 +35,13 @@ public function preloadForList(array $items) {
* @param int[] $guids
*/
protected function preloadCountsFromQuery(array $guids) {
- $count_rows = elgg_get_annotations(array(
+ $count_rows = elgg_get_annotations([
'annotation_names' => 'likes',
'guids' => $guids,
- 'selects' => array('e.guid', 'COUNT(*) AS cnt'),
+ 'selects' => ['e.guid', 'COUNT(*) AS cnt'],
'group_by' => 'e.guid',
'callback' => false,
- ));
+ ]);
foreach ($guids as $guid) {
$this->data->setNumLikes($guid, 0);
}
@@ -55,12 +55,12 @@ protected function preloadCountsFromQuery(array $guids) {
* @return int[]
*/
protected function preloadCountsFromHook(array $entities) {
- $guids_not_loaded = array();
+ $guids_not_loaded = [];
foreach ($entities as $entity) {
// BC with likes_count(). If this hook is used this preloader may not be of much help.
$type = $entity->getType();
- $params = array('entity' => $entity);
+ $params = ['entity' => $entity];
$num_likes = elgg_trigger_plugin_hook('likes:count', $type, $params, false);
if ($num_likes) {
@@ -82,12 +82,12 @@ protected function preloadCurrentUserLikes(array $guids) {
return;
}
- $annotation_rows = elgg_get_annotations(array(
+ $annotation_rows = elgg_get_annotations([
'annotation_names' => 'likes',
'annotation_owner_guids' => $owner_guid,
'guids' => $guids,
'callback' => false,
- ));
+ ]);
foreach ($guids as $guid) {
$this->data->setLikedByCurrentUser($guid, false);
@@ -102,7 +102,7 @@ protected function preloadCurrentUserLikes(array $guids) {
* @return int[]
*/
protected function getGuidsToPreload(array $items) {
- $guids = array();
+ $guids = [];
foreach ($items as $item) {
// TODO remove duplication of @link likes_river_menu_setup()
@@ -115,7 +115,7 @@ protected function getGuidsToPreload(array $items) {
$type = $item->type;
$subtype = $item->subtype;
- $likable = (bool)elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
+ $likable = (bool) elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
if (!$likable) {
continue;
}
@@ -128,10 +128,9 @@ protected function getGuidsToPreload(array $items) {
$guids[$item->object_guid] = true;
}
} elseif ($item instanceof \ElggEntity) {
-
$type = $item->type;
$subtype = $item->getSubtype();
- $likable = (bool)elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
+ $likable = (bool) elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
if ($likable) {
$guids[$item->guid] = true;
}
@@ -148,8 +147,8 @@ protected function getGuidsToPreload(array $items) {
*/
protected function getEntities(array $guids) {
// most objects are already preloaded
- $entities = array();
- $fetch_guids = array();
+ $entities = [];
+ $fetch_guids = [];
foreach ($guids as $guid) {
$entity = _elgg_services()->entityCache->get($guid);
@@ -160,9 +159,9 @@ protected function getEntities(array $guids) {
}
}
if ($fetch_guids) {
- $fetched = elgg_get_entities(array(
+ $fetched = elgg_get_entities([
'guids' => $fetch_guids,
- ));
+ ]);
array_splice($entities, count($entities), 0, $fetched);
}
return $entities;
diff --git a/mod/likes/languages/ca.php b/mod/likes/languages/ca.php
index 8d3d15997a5..1d73c7a1145 100644
--- a/mod/likes/languages/ca.php
+++ b/mod/likes/languages/ca.php
@@ -1,5 +1,5 @@
'li agrada això',
'likes:deleted' => 'El teu "m\'agrada" s\'ha eliminat',
'likes:see' => 'Mira a qui li agrada',
@@ -35,4 +35,4 @@
Gràcies,
%4$s',
-);
+];
diff --git a/mod/likes/languages/cmn.php b/mod/likes/languages/cmn.php
index 8e6ba7c220b..9954fb75b83 100644
--- a/mod/likes/languages/cmn.php
+++ b/mod/likes/languages/cmn.php
@@ -1,5 +1,5 @@
'稱讚這個項目',
'likes:deleted' => '您的稱讚已移除',
'likes:see' => '看看誰稱讚這個項目',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/da.php b/mod/likes/languages/da.php
index 6649606b6b7..4fd6131bfb5 100644
--- a/mod/likes/languages/da.php
+++ b/mod/likes/languages/da.php
@@ -1,5 +1,5 @@
'synes godt om dette',
'likes:deleted' => 'Din tilkendegivelse "synes godt om" er blevet fjernet',
'likes:see' => 'Se hvem der synes godt om dette',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/de.php b/mod/likes/languages/de.php
index 6d7595a1f07..1462cd165fb 100644
--- a/mod/likes/languages/de.php
+++ b/mod/likes/languages/de.php
@@ -1,5 +1,5 @@
'gefällt das',
'likes:deleted' => 'Dein "Gefällt mir" wurde entfernt.',
'likes:see' => 'Nachschauen, wem das gefällt',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/en.php b/mod/likes/languages/en.php
index ff99b76b241..1ff223dce5f 100644
--- a/mod/likes/languages/en.php
+++ b/mod/likes/languages/en.php
@@ -1,5 +1,5 @@
'liked this',
'likes:deleted' => 'Your like has been removed',
'likes:see' => 'See who liked this',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/es.php b/mod/likes/languages/es.php
index 7ab16fda57e..27c656fa195 100644
--- a/mod/likes/languages/es.php
+++ b/mod/likes/languages/es.php
@@ -1,5 +1,5 @@
'le gusta esto',
'likes:deleted' => 'Tu Like ha sido removido',
'likes:see' => 'Ver a quienes les gusta esto',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/eu_es.php b/mod/likes/languages/eu_es.php
index b46a0ec6296..3a9bcb518dd 100644
--- a/mod/likes/languages/eu_es.php
+++ b/mod/likes/languages/eu_es.php
@@ -1,5 +1,5 @@
'hau gustoko',
'likes:deleted' => 'Zure gustokoa kendu da',
'likes:see' => 'Nork gustoko duen ikusi',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/fi.php b/mod/likes/languages/fi.php
index 5134381abed..a3e6939a70e 100644
--- a/mod/likes/languages/fi.php
+++ b/mod/likes/languages/fi.php
@@ -1,5 +1,5 @@
'tykkää tästä',
'likes:deleted' => 'Tykkäys poistettu',
'likes:see' => 'Katso, ketkä tykkäsivät tästä',
@@ -34,4 +34,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/fr.php b/mod/likes/languages/fr.php
index f2abc94d4bb..da3e37bf2df 100644
--- a/mod/likes/languages/fr.php
+++ b/mod/likes/languages/fr.php
@@ -1,5 +1,5 @@
'aime',
'likes:deleted' => 'Votre appréciation a été retirée',
'likes:see' => 'Voir les membres qui aiment',
@@ -35,4 +35,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/gl.php b/mod/likes/languages/gl.php
index 396812fd208..58357c74c1d 100644
--- a/mod/likes/languages/gl.php
+++ b/mod/likes/languages/gl.php
@@ -1,5 +1,5 @@
'gusta disto',
'likes:deleted' => 'Eliminouse o seu «gústame».',
'likes:see' => 'Ver a quen lle gusta isto',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/it.php b/mod/likes/languages/it.php
index b5e6f7ca3a8..d002985a2dc 100644
--- a/mod/likes/languages/it.php
+++ b/mod/likes/languages/it.php
@@ -1,5 +1,5 @@
'piace questo',
'likes:deleted' => 'Il tuo "mi piace" è stato rimosso',
'likes:see' => 'Guarda a chi piace',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/ja.php b/mod/likes/languages/ja.php
index 5bac0a0095a..29ec04a79f8 100644
--- a/mod/likes/languages/ja.php
+++ b/mod/likes/languages/ja.php
@@ -1,5 +1,5 @@
'「like」にしました',
'likes:deleted' => 'あなたの「like」を削除しました',
'likes:see' => '「like」を押した人',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/ko.php b/mod/likes/languages/ko.php
index 6ad0f5c6ab9..91742726b9c 100644
--- a/mod/likes/languages/ko.php
+++ b/mod/likes/languages/ko.php
@@ -1,5 +1,5 @@
'이것에 공감합니다',
'likes:deleted' => '공감을 제거하였습니다.',
'likes:see' => '누가 이것을 공감하는지 봅니다.',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/nl.php b/mod/likes/languages/nl.php
index d3a097dd945..44a1796cd1e 100644
--- a/mod/likes/languages/nl.php
+++ b/mod/likes/languages/nl.php
@@ -1,5 +1,5 @@
'vindt dit leuk',
'likes:deleted' => 'Je vindt dit niet meer leuk',
'likes:see' => 'Bekijk wie dit leuk vindt',
@@ -38,4 +38,4 @@
Dit is een automatisch aangemaakt bericht. Je kunt hier niet op antwoorden.
',
-);
+];
diff --git a/mod/likes/languages/pl.php b/mod/likes/languages/pl.php
index 8dcc0c0baa0..fbfcbffba9c 100644
--- a/mod/likes/languages/pl.php
+++ b/mod/likes/languages/pl.php
@@ -1,5 +1,5 @@
'polubił to',
'likes:deleted' => 'Przestałeś to lubić',
'likes:see' => 'Zobacz kto to lubi',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/pt_br.php b/mod/likes/languages/pt_br.php
index c3137cb193a..844c8ccc52e 100644
--- a/mod/likes/languages/pt_br.php
+++ b/mod/likes/languages/pt_br.php
@@ -1,5 +1,5 @@
'Curtiu isso',
'likes:deleted' => 'Sua curtida foi removida',
'likes:see' => 'Veja quem curtiu isso',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/ru.php b/mod/likes/languages/ru.php
index 607c2ddd7fc..572ae4a9cfc 100644
--- a/mod/likes/languages/ru.php
+++ b/mod/likes/languages/ru.php
@@ -1,5 +1,5 @@
'Одобряю',
'likes:deleted' => 'Ваш отзыв удалён',
'likes:see' => 'Посмотреть кто это одобрил',
@@ -36,4 +36,4 @@
%4$s
',
-);
+];
diff --git a/mod/likes/languages/zh_hans.php b/mod/likes/languages/zh_hans.php
index cfe2d2c09a8..380cd9fcb2f 100644
--- a/mod/likes/languages/zh_hans.php
+++ b/mod/likes/languages/zh_hans.php
@@ -1,5 +1,5 @@
'赞这个',
'likes:deleted' => '你的点赞已经移除',
'likes:see' => '看看谁赞过这个',
@@ -35,4 +35,4 @@
多谢,
%4$s',
-);
+];
diff --git a/mod/likes/start.php b/mod/likes/start.php
index 3360a8f19cb..e1b1e498640 100644
--- a/mod/likes/start.php
+++ b/mod/likes/start.php
@@ -77,7 +77,7 @@ function likes_permissions_check_annotate($hook, $type, $return, $params) {
$type = $entity->type;
$subtype = $entity->getSubtype();
- return (bool)elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
+ return (bool) elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
}
/**
@@ -95,7 +95,7 @@ function likes_entity_menu_setup($hook, $type, $return, $params) {
$type = $entity->type;
$subtype = $entity->getSubtype();
- $likable = (bool)elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
+ $likable = (bool) elgg_trigger_plugin_hook('likes:is_likable', "$type:$subtype", [], false);
if (!$likable) {
return $return;
}
@@ -104,7 +104,7 @@ function likes_entity_menu_setup($hook, $type, $return, $params) {
$hasLiked = \Elgg\Likes\DataService::instance()->currentUserLikesEntity($entity->guid);
// Always register both. That makes it super easy to toggle with javascript
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'likes',
'href' => elgg_add_action_tokens_to_url("/action/likes/add?guid={$entity->guid}"),
'text' => elgg_view_icon('thumbs-up'),
@@ -112,8 +112,8 @@ function likes_entity_menu_setup($hook, $type, $return, $params) {
'item_class' => $hasLiked ? 'hidden' : '',
'priority' => 1000,
'deps' => ['elgg/likes'],
- ));
- $return[] = ElggMenuItem::factory(array(
+ ]);
+ $return[] = ElggMenuItem::factory([
'name' => 'unlike',
'href' => elgg_add_action_tokens_to_url("/action/likes/delete?guid={$entity->guid}"),
'text' => elgg_view_icon('thumbs-up-alt'),
@@ -121,19 +121,19 @@ function likes_entity_menu_setup($hook, $type, $return, $params) {
'item_class' => $hasLiked ? '' : 'hidden',
'priority' => 1000,
'deps' => ['elgg/likes'],
- ));
+ ]);
}
// likes count
- $count = elgg_view('likes/count', array('entity' => $entity));
+ $count = elgg_view('likes/count', ['entity' => $entity]);
if ($count) {
- $options = array(
+ $options = [
'name' => 'likes_count',
'text' => $count,
'href' => false,
'priority' => 1001,
'deps' => ['elgg/likes'],
- );
+ ];
$return[] = ElggMenuItem::factory($options);
}
@@ -168,7 +168,7 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
$hasLiked = \Elgg\Likes\DataService::instance()->currentUserLikesEntity($object->guid);
// Always register both. That makes it super easy to toggle with javascript
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'likes',
'href' => elgg_add_action_tokens_to_url("/action/likes/add?guid={$object->guid}"),
'text' => elgg_view_icon('thumbs-up'),
@@ -176,8 +176,8 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
'item_class' => $hasLiked ? 'hidden' : '',
'priority' => 100,
'deps' => ['elgg/likes'],
- ));
- $return[] = ElggMenuItem::factory(array(
+ ]);
+ $return[] = ElggMenuItem::factory([
'name' => 'unlike',
'href' => elgg_add_action_tokens_to_url("/action/likes/delete?guid={$object->guid}"),
'text' => elgg_view_icon('thumbs-up-alt'),
@@ -185,18 +185,18 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
'item_class' => $hasLiked ? '' : 'hidden',
'priority' => 100,
'deps' => ['elgg/likes'],
- ));
+ ]);
// likes count
- $count = elgg_view('likes/count', array('entity' => $object));
+ $count = elgg_view('likes/count', ['entity' => $object]);
if ($count) {
- $return[] = ElggMenuItem::factory(array(
+ $return[] = ElggMenuItem::factory([
'name' => 'likes_count',
'text' => $count,
'href' => false,
'priority' => 101,
'deps' => ['elgg/likes'],
- ));
+ ]);
}
return $return;
@@ -211,7 +211,7 @@ function likes_river_menu_setup($hook, $type, $return, $params) {
*/
function likes_count(ElggEntity $entity) {
$type = $entity->getType();
- $params = array('entity' => $entity);
+ $params = ['entity' => $entity];
$number = elgg_trigger_plugin_hook('likes:count', $type, $params, false);
if ($number) {
diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php
index a142cdcfdcc..cb981eaec8e 100644
--- a/mod/likes/views/default/annotation/likes.php
+++ b/mod/likes/views/default/annotation/likes.php
@@ -17,12 +17,12 @@
return true;
}
-$user_icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => false));
-$user_link = elgg_view('output/url', array(
+$user_icon = elgg_view_entity_icon($user, 'tiny', ['use_hover' => false]);
+$user_link = elgg_view('output/url', [
'href' => $user->getURL(),
'text' => $user->name,
'is_trusted' => true,
-));
+]);
$likes_string = elgg_echo('likes:this');
@@ -30,12 +30,12 @@
$delete_button = '';
if ($like->canEdit()) {
- $delete_button = elgg_view("output/url",array(
- 'href' => "action/likes/delete?id={$like->id}",
- 'text' => elgg_view_icon('delete', 'float-alt'),
- 'confirm' => elgg_echo('likes:delete:confirm'),
- 'encode_text' => false,
- ));
+ $delete_button = elgg_view("output/url", [
+ 'href' => "action/likes/delete?id={$like->id}",
+ 'text' => elgg_view_icon('delete', 'float-alt'),
+ 'confirm' => elgg_echo('likes:delete:confirm'),
+ 'encode_text' => false,
+ ]);
}
$body = <<canAnnotate(0, 'likes')) {
if (!elgg_annotation_exists($guid, 'likes')) {
$url = elgg_get_site_url() . "action/likes/add?guid={$guid}";
- $params = array(
+ $params = [
'href' => $url,
'text' => elgg_view_icon('thumbs-up'),
'title' => elgg_echo('likes:likethis'),
'is_action' => true,
'is_trusted' => true,
- );
+ ];
$likes_button = elgg_view('output/url', $params);
} else {
$url = elgg_get_site_url() . "action/likes/delete?guid={$guid}";
- $params = array(
+ $params = [
'href' => $url,
'text' => elgg_view_icon('thumbs-up-alt'),
'title' => elgg_echo('likes:remove'),
'is_action' => true,
'is_trusted' => true,
- );
+ ];
$likes_button = elgg_view('output/url', $params);
}
diff --git a/mod/likes/views/default/likes/count.php b/mod/likes/views/default/likes/count.php
index a45f90b8d26..2bf9f65c019 100644
--- a/mod/likes/views/default/likes/count.php
+++ b/mod/likes/views/default/likes/count.php
@@ -10,9 +10,9 @@
// display the number of likes
if ($num_of_likes == 1) {
- $likes_string = elgg_echo('likes:userlikedthis', array($num_of_likes));
+ $likes_string = elgg_echo('likes:userlikedthis', [$num_of_likes]);
} else {
- $likes_string = elgg_echo('likes:userslikedthis', array($num_of_likes));
+ $likes_string = elgg_echo('likes:userslikedthis', [$num_of_likes]);
}
$class = 'elgg-lightbox elgg-non-link';
@@ -20,7 +20,7 @@
$class .= ' hidden';
}
-$params = array(
+$params = [
'text' => $likes_string,
'title' => elgg_echo('likes:see'),
'class' => $class,
@@ -30,5 +30,5 @@
'maxHeight' => '85%',
'href' => elgg_normalize_url("ajax/view/likes/popup?guid=$guid")
]),
-);
+];
echo elgg_view('output/url', $params);
diff --git a/mod/likes/views/default/likes/popup.php b/mod/likes/views/default/likes/popup.php
index 2f3ab2b1fb0..39b0403c112 100644
--- a/mod/likes/views/default/likes/popup.php
+++ b/mod/likes/views/default/likes/popup.php
@@ -7,12 +7,12 @@
return;
}
-$list = elgg_list_annotations(array(
+$list = elgg_list_annotations([
'guid' => $guid,
'annotation_name' => 'likes',
'limit' => 99,
'preload_owners' => true,
'pagination' => false,
-));
+]);
echo elgg_format_element('div', ['class' => 'elgg-likes-popup'], $list);
diff --git a/mod/logbrowser/languages/ca.php b/mod/logbrowser/languages/ca.php
index 00a47626afc..b57ef2d5da1 100644
--- a/mod/logbrowser/languages/ca.php
+++ b/mod/logbrowser/languages/ca.php
@@ -1,5 +1,5 @@
'Log browser',
'logbrowser' => 'Log browser',
'logbrowser:browse' => 'Browse system log',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Object type',
'logbrowser:object:guid' => 'Object GUID',
'logbrowser:action' => 'Action',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/cmn.php b/mod/logbrowser/languages/cmn.php
index 31d051bd9e3..c63afacd36e 100644
--- a/mod/logbrowser/languages/cmn.php
+++ b/mod/logbrowser/languages/cmn.php
@@ -1,5 +1,5 @@
'記錄檔瀏覽器',
'logbrowser' => '記錄檔瀏覽器',
'logbrowser:browse' => '瀏覽系統日誌',
@@ -17,4 +17,4 @@
'logbrowser:object' => '物件類型',
'logbrowser:object:guid' => '物件 GUID',
'logbrowser:action' => '動作',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/da.php b/mod/logbrowser/languages/da.php
index bef865ae8c8..49de7227916 100644
--- a/mod/logbrowser/languages/da.php
+++ b/mod/logbrowser/languages/da.php
@@ -1,5 +1,5 @@
'Log browser',
'logbrowser' => 'Log browser',
'logbrowser:browse' => 'Gennemse system log',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Object type',
'logbrowser:object:guid' => 'Object GUID',
'logbrowser:action' => 'Action',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/de.php b/mod/logbrowser/languages/de.php
index 245841cedc9..833d024d1b8 100644
--- a/mod/logbrowser/languages/de.php
+++ b/mod/logbrowser/languages/de.php
@@ -1,5 +1,5 @@
'Logdatei-Browser',
'logbrowser' => 'Logdatei-Browser',
'logbrowser:browse' => 'Systemlog-Datei durchsuchen',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Objekt-Typ',
'logbrowser:object:guid' => 'Objekt-GUID',
'logbrowser:action' => 'Aktion',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/en.php b/mod/logbrowser/languages/en.php
index 00a47626afc..b57ef2d5da1 100644
--- a/mod/logbrowser/languages/en.php
+++ b/mod/logbrowser/languages/en.php
@@ -1,5 +1,5 @@
'Log browser',
'logbrowser' => 'Log browser',
'logbrowser:browse' => 'Browse system log',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Object type',
'logbrowser:object:guid' => 'Object GUID',
'logbrowser:action' => 'Action',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/es.php b/mod/logbrowser/languages/es.php
index 5f668373f3f..44246a27110 100644
--- a/mod/logbrowser/languages/es.php
+++ b/mod/logbrowser/languages/es.php
@@ -1,5 +1,5 @@
'Navegador de registros',
'logbrowser' => 'Navegador de registros',
'logbrowser:browse' => 'Navegar por los registros del sistema',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Tipo de objeto',
'logbrowser:object:guid' => 'GUID de objeto',
'logbrowser:action' => 'Acción',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/eu_es.php b/mod/logbrowser/languages/eu_es.php
index 5dd84fc14be..753934d79e8 100644
--- a/mod/logbrowser/languages/eu_es.php
+++ b/mod/logbrowser/languages/eu_es.php
@@ -1,5 +1,5 @@
'Log arakatzailea',
'logbrowser' => 'Log arakatzailea',
'logbrowser:browse' => 'Log arakatzaile sistema',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Objektu mota',
'logbrowser:object:guid' => 'Objektu GUID',
'logbrowser:action' => 'Akzioa',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/fi.php b/mod/logbrowser/languages/fi.php
index eab1ef1dddc..7813d7da58b 100644
--- a/mod/logbrowser/languages/fi.php
+++ b/mod/logbrowser/languages/fi.php
@@ -1,5 +1,5 @@
'Lokiselain',
'logbrowser' => 'Lokiselain',
'logbrowser:browse' => 'Selaa järjestelmän lokia',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Kohteen tyyppi',
'logbrowser:object:guid' => 'Kohteen GUID',
'logbrowser:action' => 'Toiminto',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/fr.php b/mod/logbrowser/languages/fr.php
index e977016a842..d0d394a637c 100644
--- a/mod/logbrowser/languages/fr.php
+++ b/mod/logbrowser/languages/fr.php
@@ -1,5 +1,5 @@
'Visualiseur de journal',
'logbrowser' => 'Visualiseur de journal',
'logbrowser:browse' => 'Visualiser les journaux système',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Type d\'objet',
'logbrowser:object:guid' => 'GUID de l\'objet',
'logbrowser:action' => 'Action',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/gl.php b/mod/logbrowser/languages/gl.php
index 413b184c9f3..0fb8c8b5df9 100644
--- a/mod/logbrowser/languages/gl.php
+++ b/mod/logbrowser/languages/gl.php
@@ -1,5 +1,5 @@
'Navegador do rexistro',
'logbrowser' => 'Navegador do rexistr',
'logbrowser:browse' => 'Navegar polo rexistro do sistema',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Tipo de obxecto',
'logbrowser:object:guid' => 'GUID do obxecto',
'logbrowser:action' => 'Acción',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/it.php b/mod/logbrowser/languages/it.php
index 1184cd2b3db..50c68eddc39 100644
--- a/mod/logbrowser/languages/it.php
+++ b/mod/logbrowser/languages/it.php
@@ -1,5 +1,5 @@
'Log browser',
'logbrowser' => 'Navigatore di Resoconti',
'logbrowser:browse' => 'Naviga il sistema dei resoconti',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Object type',
'logbrowser:object:guid' => 'Object GUID',
'logbrowser:action' => 'Action',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/ja.php b/mod/logbrowser/languages/ja.php
index 662ac3d3b3f..c133b513675 100644
--- a/mod/logbrowser/languages/ja.php
+++ b/mod/logbrowser/languages/ja.php
@@ -1,5 +1,5 @@
'ログブラウザ',
'logbrowser' => 'ログブラウザ',
'logbrowser:browse' => 'システムログの閲覧',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Object type',
'logbrowser:object:guid' => 'Object GUID',
'logbrowser:action' => 'Action',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/ko.php b/mod/logbrowser/languages/ko.php
index 74a2e94a4f3..4b68512c9c4 100644
--- a/mod/logbrowser/languages/ko.php
+++ b/mod/logbrowser/languages/ko.php
@@ -1,5 +1,5 @@
'로그 표시기',
'logbrowser' => '로그 표시기',
'logbrowser:browse' => '시스템로그 표시',
@@ -17,4 +17,4 @@
'logbrowser:object' => '객체 종류',
'logbrowser:object:guid' => '객체 GUID',
'logbrowser:action' => '행동',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/nl.php b/mod/logbrowser/languages/nl.php
index a83f5eb4181..034006d08f2 100644
--- a/mod/logbrowser/languages/nl.php
+++ b/mod/logbrowser/languages/nl.php
@@ -1,5 +1,5 @@
'Logbrowser',
'logbrowser' => 'Logbrowser',
'logbrowser:browse' => 'Bekijk systeem-logboek',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Objecttype',
'logbrowser:object:guid' => 'Object GUID',
'logbrowser:action' => 'Actie',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/pl.php b/mod/logbrowser/languages/pl.php
index 9e6a4bd59dc..4373b54f04a 100644
--- a/mod/logbrowser/languages/pl.php
+++ b/mod/logbrowser/languages/pl.php
@@ -1,5 +1,5 @@
'Przeglądarka plików rejestrowych',
'logbrowser' => 'Przeglądarka plików rejestrowych',
'logbrowser:browse' => 'Przeglądaj systemowe pliki rejestrowe',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Rodzaj obiektu',
'logbrowser:object:guid' => 'GUID obiektu',
'logbrowser:action' => 'Działanie',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/pt_br.php b/mod/logbrowser/languages/pt_br.php
index 787fcb2f0b0..6b985460c1c 100644
--- a/mod/logbrowser/languages/pt_br.php
+++ b/mod/logbrowser/languages/pt_br.php
@@ -1,5 +1,5 @@
'Navegador de registros (logs)',
'logbrowser' => 'navegador de registros (logs)',
'logbrowser:browse' => 'navegar nos logs do sistema',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Tipo de Objeto',
'logbrowser:object:guid' => 'Identificador (GUID) do objeto',
'logbrowser:action' => 'Ação',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/languages/ru.php b/mod/logbrowser/languages/ru.php
index 5f58b93d8c5..8b2d1c4b8b2 100644
--- a/mod/logbrowser/languages/ru.php
+++ b/mod/logbrowser/languages/ru.php
@@ -1,5 +1,5 @@
'Журнал логов',
'logbrowser' => 'Журнал логов',
'logbrowser:browse' => 'Смотреть системные логи',
@@ -17,4 +17,4 @@
'logbrowser:object' => 'Типо объекта',
'logbrowser:object:guid' => 'GUID объекта',
'logbrowser:action' => 'Действие',
-);
\ No newline at end of file
+];
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index 22659877bbd..8b8e023a156 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -1,7 +1,7 @@
$timeupper,
'timelower' => $timelower,
'ip_address' => $ip_address,
'username' => $search_username,
-));
+]);
// Get log entries
-$log = get_system_log($user_guid, "", "", "","", $limit, $offset, false, $timeupper, $timelower,
+$log = get_system_log($user_guid, "", "", "", "", $limit, $offset, false, $timeupper, $timelower,
0, $ip_address);
-$count = get_system_log($user_guid, "", "", "","", $limit, $offset, true, $timeupper, $timelower,
+$count = get_system_log($user_guid, "", "", "", "", $limit, $offset, true, $timeupper, $timelower,
0, $ip_address);
// if user does not exist, we have no results
@@ -62,13 +62,13 @@
$count = 0;
}
-$table = elgg_view('logbrowser/table', array('log_entries' => $log));
+$table = elgg_view('logbrowser/table', ['log_entries' => $log]);
-$nav = elgg_view('navigation/pagination',array(
+$nav = elgg_view('navigation/pagination', [
'offset' => $offset,
'count' => $count,
'limit' => $limit,
-));
+]);
// display admin body
$body = <<<__HTML
diff --git a/mod/logbrowser/views/default/forms/logbrowser/refine.php b/mod/logbrowser/views/default/forms/logbrowser/refine.php
index 3d081c9c262..b92cec8f065 100644
--- a/mod/logbrowser/views/default/forms/logbrowser/refine.php
+++ b/mod/logbrowser/views/default/forms/logbrowser/refine.php
@@ -23,32 +23,32 @@
$username = elgg_extract('username', $vars);
$form = "
" . elgg_echo('logbrowser:user');
-$form .= elgg_view('input/text', array(
+$form .= elgg_view('input/text', [
'name' => 'search_username',
'value' => $username,
-)) . "
";
+]) . "
";
$form .= "" . elgg_echo('logbrowser:ip_address');
-$form .= elgg_view('input/text', array(
+$form .= elgg_view('input/text', [
'name' => 'ip_address',
'value' => $ip_address,
-)) . "
";
+]) . "";
$form .= "" . elgg_echo('logbrowser:starttime');
-$form .= elgg_view('input/text', array(
+$form .= elgg_view('input/text', [
'name' => 'timelower',
'value' => $lowerval,
-)) . "
";
+]) . "";
$form .= "" . elgg_echo('logbrowser:endtime');
-$form .= elgg_view('input/text', array(
+$form .= elgg_view('input/text', [
'name' => 'timeupper',
'value' => $upperval,
-)) . "
";
+]) . "";
$form .= '';
echo $form;
diff --git a/mod/logbrowser/views/default/logbrowser/refine.php b/mod/logbrowser/views/default/logbrowser/refine.php
index 08c7ae718c8..3c8e7927390 100644
--- a/mod/logbrowser/views/default/logbrowser/refine.php
+++ b/mod/logbrowser/views/default/logbrowser/refine.php
@@ -28,5 +28,5 @@
$module = elgg_view_module('inline', elgg_echo('logbrowser:search'), $form, $module_options);
?>
-
+
diff --git a/mod/logbrowser/views/default/logbrowser/table.php b/mod/logbrowser/views/default/logbrowser/table.php
index 45132ce49fd..5e2f0c4b1a4 100644
--- a/mod/logbrowser/views/default/logbrowser/table.php
+++ b/mod/logbrowser/views/default/logbrowser/table.php
@@ -20,67 +20,67 @@
ip_address) {
- $ip_address = $entry->ip_address;
- } else {
- $ip_address = ' ';
- }
+foreach ($log_entries as $entry) {
+ if ($entry->ip_address) {
+ $ip_address = $entry->ip_address;
+ } else {
+ $ip_address = ' ';
+ }
- $user = get_entity($entry->performed_by_guid);
- if ($user) {
- $user_link = elgg_view('output/url', array(
- 'href' => $user->getURL(),
- 'text' => $user->name,
- 'is_trusted' => true,
- ));
- $user_guid_link = elgg_view('output/url', array(
- 'href' => "admin/administer_utilities/logbrowser?user_guid={$user->guid}",
- 'text' => $user->getGUID(),
- 'is_trusted' => true,
- ));
- } else {
- $user_guid_link = $user_link = ' ';
- }
+ $user = get_entity($entry->performed_by_guid);
+ if ($user) {
+ $user_link = elgg_view('output/url', [
+ 'href' => $user->getURL(),
+ 'text' => $user->name,
+ 'is_trusted' => true,
+ ]);
+ $user_guid_link = elgg_view('output/url', [
+ 'href' => "admin/administer_utilities/logbrowser?user_guid={$user->guid}",
+ 'text' => $user->getGUID(),
+ 'is_trusted' => true,
+ ]);
+ } else {
+ $user_guid_link = $user_link = ' ';
+ }
- $object = get_object_from_log_entry($entry);
- if (is_callable(array($object, 'getURL'))) {
- $object_link = elgg_view('output/url', array(
- 'href' => $object->getURL(),
- 'text' => $entry->object_class,
- 'is_trusted' => true,
- ));
- } else {
- $object_link = $entry->object_class;
- }
+ $object = get_object_from_log_entry($entry);
+ if (is_callable([$object, 'getURL'])) {
+ $object_link = elgg_view('output/url', [
+ 'href' => $object->getURL(),
+ 'text' => $entry->object_class,
+ 'is_trusted' => true,
+ ]);
+ } else {
+ $object_link = $entry->object_class;
+ }
?>
- >
-
- time_created); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- object_id; ?>
-
-
- event); ?>
-
-
+>
+
+ time_created); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ object_id; ?>
+
+
+ event); ?>
+
+
'monthly',
],
];
-
\ No newline at end of file
+
diff --git a/mod/logrotate/languages/de.php b/mod/logrotate/languages/de.php
index 3c55a54e550..edaeb35d1cd 100644
--- a/mod/logrotate/languages/de.php
+++ b/mod/logrotate/languages/de.php
@@ -1,5 +1,5 @@
'Wie oft sollen die Einträge im Systemlog archiviert werden?',
'logrotate:logrotated' => "Die alten Einträge im Log wurden archiviert.\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Das Log wurde gelöscht.\n",
'logrotate:lognotdeleted' => "Es wurden keine Logs gelöscht.\n",
-);
+];
diff --git a/mod/logrotate/languages/en.php b/mod/logrotate/languages/en.php
index 2235e183bcf..e6eac0021e1 100644
--- a/mod/logrotate/languages/en.php
+++ b/mod/logrotate/languages/en.php
@@ -1,5 +1,5 @@
'How often should the system log be archived?',
'logrotate:logrotated' => "Log rotated\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Log deleted\n",
'logrotate:lognotdeleted' => "No logs deleted\n",
-);
+];
diff --git a/mod/logrotate/languages/es.php b/mod/logrotate/languages/es.php
index 6f21e5a5e06..ebb3d063e81 100644
--- a/mod/logrotate/languages/es.php
+++ b/mod/logrotate/languages/es.php
@@ -1,5 +1,5 @@
'¿Qué frecuencioa deseas para rotar los registros?',
'logrotate:logrotated' => "Registro rotado\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Registro borrado\n",
'logrotate:lognotdeleted' => "Ningún log fue eliminado",
-);
+];
diff --git a/mod/logrotate/languages/eu_es.php b/mod/logrotate/languages/eu_es.php
index 19350a0a249..e2ccf16da73 100644
--- a/mod/logrotate/languages/eu_es.php
+++ b/mod/logrotate/languages/eu_es.php
@@ -1,5 +1,5 @@
'Zenbat bider nahi duzu sistemaren loga artxibatua izatea?',
'logrotate:logrotated' => "Loga biratuta\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Ezabatutako loga\n",
'logrotate:lognotdeleted' => "Ez dago ezabatutako logik\n",
-);
+];
diff --git a/mod/logrotate/languages/fi.php b/mod/logrotate/languages/fi.php
index dbc58bd81c1..4c3a6a497ec 100644
--- a/mod/logrotate/languages/fi.php
+++ b/mod/logrotate/languages/fi.php
@@ -1,5 +1,5 @@
'Kuinka usein järjestelmän loki tulisi arkistoida?',
'logrotate:logrotated' => "Loki arkistoitu\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Loki poistettu\n",
'logrotate:lognotdeleted' => "Lokeja ei poistettu\n",
-);
+];
diff --git a/mod/logrotate/languages/fr.php b/mod/logrotate/languages/fr.php
index 4dbc5382d73..9369b109f95 100644
--- a/mod/logrotate/languages/fr.php
+++ b/mod/logrotate/languages/fr.php
@@ -1,5 +1,5 @@
'A quelle fréquence souhaitez-vous archiver les logs du système ?',
'logrotate:logrotated' => "Rotation du log effectuée\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Fichier journal (fichier log) supprimé\n",
'logrotate:lognotdeleted' => "Aucun fichier journal (fichier log) n'a été supprimé\n",
-);
+];
diff --git a/mod/logrotate/languages/gl.php b/mod/logrotate/languages/gl.php
index 7c89a4d4177..80a8fd9fa6b 100644
--- a/mod/logrotate/languages/gl.php
+++ b/mod/logrotate/languages/gl.php
@@ -1,5 +1,5 @@
'Con que frecuencia debe arquivarse o rexistro do sistema?',
'logrotate:logrotated' => "Rotouse o rexistro\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Eliminouse o rexistro.\n",
'logrotate:lognotdeleted' => "Non se eliminou ningún rexistro.\n",
-);
+];
diff --git a/mod/logrotate/languages/it.php b/mod/logrotate/languages/it.php
index a69605a3e06..0034668aa60 100644
--- a/mod/logrotate/languages/it.php
+++ b/mod/logrotate/languages/it.php
@@ -1,5 +1,5 @@
'Quanto di frequente devono essere archiviati i log di sistema?',
'logrotate:logrotated' => "Log ruotati\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Log eliminato\n",
'logrotate:lognotdeleted' => "Nessun log eliminato\n",
-);
+];
diff --git a/mod/logrotate/languages/ja.php b/mod/logrotate/languages/ja.php
index 0067992350a..462b79508e9 100644
--- a/mod/logrotate/languages/ja.php
+++ b/mod/logrotate/languages/ja.php
@@ -1,5 +1,5 @@
'システムログを保管する頻度',
'logrotate:logrotated' => "ログをローテートしました\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "ログを削除しました\n",
'logrotate:lognotdeleted' => "削除したログはありません\n",
-);
+];
diff --git a/mod/logrotate/languages/ko.php b/mod/logrotate/languages/ko.php
index 34022586af2..79ad8c74fcb 100644
--- a/mod/logrotate/languages/ko.php
+++ b/mod/logrotate/languages/ko.php
@@ -1,5 +1,5 @@
'얼마나 자주 시스템 로그를 보관하겠습니까?',
'logrotate:logrotated' => "로그 순환됨\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "로그 삭제됨\n",
'logrotate:lognotdeleted' => "삭제된 로그가 없슴\n",
-);
+];
diff --git a/mod/logrotate/languages/nl.php b/mod/logrotate/languages/nl.php
index b408f1f76df..06ffc2804bc 100644
--- a/mod/logrotate/languages/nl.php
+++ b/mod/logrotate/languages/nl.php
@@ -1,5 +1,5 @@
'Hoe vaak moet het systeemlogboek worden gearchiveerd?',
'logrotate:logrotated' => "Logboek gearchiveerd",
@@ -15,4 +15,4 @@
'logrotate:logdeleted' => "Log verwijderd
",
'logrotate:lognotdeleted' => "Fout tijdens het verwijderen van de log",
-);
+];
diff --git a/mod/logrotate/languages/pl.php b/mod/logrotate/languages/pl.php
index 35ee91742cf..0f32189a711 100644
--- a/mod/logrotate/languages/pl.php
+++ b/mod/logrotate/languages/pl.php
@@ -1,5 +1,5 @@
'Jak często logi systemowe powinny być archiwizowane?',
'logrotate:logrotated' => "Rotacja logów",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Plik rejestrowy usunięty\n",
'logrotate:lognotdeleted' => "Nie usunięto żadnych logów\n",
-);
+];
diff --git a/mod/logrotate/languages/pt_br.php b/mod/logrotate/languages/pt_br.php
index 3b49ac77555..70bb4be9d19 100644
--- a/mod/logrotate/languages/pt_br.php
+++ b/mod/logrotate/languages/pt_br.php
@@ -1,10 +1,10 @@
'Com que frequência deve o sistema arquivar o \'log\' ?',
- 'logrotate:logrotated' => "Log arquivado
+ 'logrotate:logrotated' => "Log arquivado
",
- 'logrotate:lognotrotated' => "Erro ao arquivar o log
+ 'logrotate:lognotrotated' => "Erro ao arquivar o log
",
'logrotate:delete' => 'Apague os arquivos de registros mais antigos que',
@@ -16,4 +16,4 @@
'logrotate:logdeleted' => "Log apagado",
'logrotate:lognotdeleted' => "Erro ao apagar o log",
-);
+];
diff --git a/mod/logrotate/languages/ru.php b/mod/logrotate/languages/ru.php
index 0e132490c52..4801af45175 100644
--- a/mod/logrotate/languages/ru.php
+++ b/mod/logrotate/languages/ru.php
@@ -1,5 +1,5 @@
'Как часто архивировать лог?',
'logrotate:logrotated' => "Лог прокручен\n",
@@ -14,4 +14,4 @@
'logrotate:logdeleted' => "Журнал удален\n",
'logrotate:lognotdeleted' => "Ошибка при удалении\n",
-);
+];
diff --git a/mod/logrotate/start.php b/mod/logrotate/start.php
index 7f2a1dcd8d9..17a6a85de23 100755
--- a/mod/logrotate/start.php
+++ b/mod/logrotate/start.php
@@ -93,7 +93,7 @@ function log_browser_delete_log($time_of_delete) {
$results = get_data("SHOW TABLES like '{$dbprefix}system_log_%'");
if ($results) {
foreach ($results as $result) {
- $data = (array)$result;
+ $data = (array) $result;
$table_name = array_shift($data);
// extract log table rotation time
$log_time = str_replace("{$dbprefix}system_log_", '', $table_name);
diff --git a/mod/members/languages/da.php b/mod/members/languages/da.php
index baf6f0b650d..2bf74fb726c 100644
--- a/mod/members/languages/da.php
+++ b/mod/members/languages/da.php
@@ -1,5 +1,5 @@
'Online',
'members:search' => 'Sæg medlemmer',
'members:title:search' => 'Brugere ved navn %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Mest populære medlemmer',
'members:title:online' => 'Online medlemmer',
'members:list:popular:none' => 'Ingen medlemmer er uden venner',
-);
+];
diff --git a/mod/members/languages/de.php b/mod/members/languages/de.php
index d476b8b432a..2532ff6882d 100644
--- a/mod/members/languages/de.php
+++ b/mod/members/languages/de.php
@@ -1,5 +1,5 @@
'Im Moment aktiv',
'members:search' => 'Mitgliedersuche',
'members:title:search' => 'Mitgliedersuche nach %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Gerade aktive Mitglieder',
'members:title:alpha' => 'Alle Mitglieder',
'members:list:popular:none' => 'Es gibt keine Mitglieder, die bereits Freunde haben.',
-);
+];
diff --git a/mod/members/languages/en.php b/mod/members/languages/en.php
index 4eed0e78427..a408553d281 100644
--- a/mod/members/languages/en.php
+++ b/mod/members/languages/en.php
@@ -1,5 +1,5 @@
'Online',
'members:search' => 'Search members',
'members:title:search' => 'Member search for %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Online members',
'members:title:alpha' => 'All members',
'members:list:popular:none' => 'No members have any friends.',
-);
+];
diff --git a/mod/members/languages/es.php b/mod/members/languages/es.php
index e1e5307f088..e4021844156 100644
--- a/mod/members/languages/es.php
+++ b/mod/members/languages/es.php
@@ -1,5 +1,5 @@
'En linea',
'members:search' => 'Buscar miembros',
'members:title:search' => 'Búsqueda de miembros por %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Miembros en línea',
'members:title:alpha' => 'Todos los miembros',
'members:list:popular:none' => 'Ningún miembro tiene amigos',
-);
+];
diff --git a/mod/members/languages/eu_es.php b/mod/members/languages/eu_es.php
index 6088b7740e8..03f743d2433 100644
--- a/mod/members/languages/eu_es.php
+++ b/mod/members/languages/eu_es.php
@@ -1,5 +1,5 @@
'Linean',
'members:search' => 'Kideak bilatu',
'members:title:search' => '%s-erako kide bilaketa',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Kide ospetsuenak',
'members:title:online' => 'Linean dauden kideak',
'members:list:popular:none' => 'Kide batek ere ez du lagunik.',
-);
+];
diff --git a/mod/members/languages/fa.php b/mod/members/languages/fa.php
index 340bba364c6..664b5c32d47 100644
--- a/mod/members/languages/fa.php
+++ b/mod/members/languages/fa.php
@@ -1,5 +1,5 @@
'انلاین',
'members:search' => 'جستجوی کاربران',
'members:title:search' => 'جستجو در بین کاربران برای %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'بیشترین کاربران محبوب',
'members:title:online' => 'کاربران انلاین',
'members:list:popular:none' => 'هیچ کاربری دوست شما نیست',
-);
+];
diff --git a/mod/members/languages/fi.php b/mod/members/languages/fi.php
index 1f309dc4690..42698ac4a71 100644
--- a/mod/members/languages/fi.php
+++ b/mod/members/languages/fi.php
@@ -1,5 +1,5 @@
'Kirjautuneet',
'members:search' => 'Etsi jäseniä',
'members:title:search' => 'Jäsenhaun tulokset hakusanalle "%s"',
@@ -9,4 +9,4 @@
'members:title:online' => 'Kirjautuneet',
'members:title:alpha' => 'Kaikki jäsenet',
'members:list:popular:none' => 'Kenelläkään jäsenellä ei ole vielä ystäviä.',
-);
+];
diff --git a/mod/members/languages/fr.php b/mod/members/languages/fr.php
index 59ad9e4875e..bdd03de251d 100644
--- a/mod/members/languages/fr.php
+++ b/mod/members/languages/fr.php
@@ -1,5 +1,5 @@
'En ligne',
'members:search' => 'Rechercher des membres',
'members:title:search' => 'Recherche de membres pour %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Membres en ligne',
'members:title:alpha' => 'Tous les membres',
'members:list:popular:none' => 'Aucun membre n\'a de contact.',
-);
+];
diff --git a/mod/members/languages/gl.php b/mod/members/languages/gl.php
index edb77a02ad8..918f9da1986 100644
--- a/mod/members/languages/gl.php
+++ b/mod/members/languages/gl.php
@@ -1,5 +1,5 @@
'Conectados',
'members:search' => 'Buscar membros',
'members:title:search' => 'Buscar membros que coincidan con %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Membros máis populares',
'members:title:online' => 'Membros conectados',
'members:list:popular:none' => 'Ningún dos membros ten contactos.',
-);
+];
diff --git a/mod/members/languages/it.php b/mod/members/languages/it.php
index 0438003ed30..3971363a56f 100644
--- a/mod/members/languages/it.php
+++ b/mod/members/languages/it.php
@@ -1,5 +1,5 @@
'Online',
'members:search' => 'Cerca membri',
'members:title:search' => 'Ricerca membri per %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Membri online',
'members:title:alpha' => 'Tutti i membri',
'members:list:popular:none' => 'Nessun membro ha nessun amico',
-);
+];
diff --git a/mod/members/languages/ja.php b/mod/members/languages/ja.php
index 0f42e208092..b8d99e7ab4d 100644
--- a/mod/members/languages/ja.php
+++ b/mod/members/languages/ja.php
@@ -1,5 +1,5 @@
'オンライン',
'members:search' => 'メンバを検索',
'members:title:search' => 'メンバを検索: %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'オンライン中',
'members:title:alpha' => '全メンバ',
'members:list:popular:none' => '友達がいるメンバが居ません',
-);
+];
diff --git a/mod/members/languages/ko.php b/mod/members/languages/ko.php
index 8bfdcc5dcf5..6e1b14b9908 100644
--- a/mod/members/languages/ko.php
+++ b/mod/members/languages/ko.php
@@ -1,5 +1,5 @@
'접속중',
'members:search' => '회원검색',
'members:title:search' => ' %s 로 회원 검색',
@@ -8,4 +8,4 @@
'members:title:popular' => '인기 회원',
'members:title:online' => '접속중인 회원',
'members:list:popular:none' => '친구가 없는 회원이 없습니다.',
-);
+];
diff --git a/mod/members/languages/nl.php b/mod/members/languages/nl.php
index 7646c259241..c4f9899cee0 100644
--- a/mod/members/languages/nl.php
+++ b/mod/members/languages/nl.php
@@ -1,5 +1,5 @@
'Online',
'members:search' => 'Zoek leden',
'members:title:search' => 'Zoekopdracht voor %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Leden die online zijn',
'members:title:alpha' => 'Alle leden',
'members:list:popular:none' => 'Geen leden met vrienden.',
-);
+];
diff --git a/mod/members/languages/pl.php b/mod/members/languages/pl.php
index 332fd958a97..e9324882db7 100644
--- a/mod/members/languages/pl.php
+++ b/mod/members/languages/pl.php
@@ -1,5 +1,5 @@
'On-line',
'members:search' => 'Wyszukaj członków',
'members:title:search' => 'Wyszukiwanie użytkowników %s',
@@ -9,4 +9,4 @@
'members:title:online' => 'Członkowie on-line',
'members:title:alpha' => 'Wszyscy członkowie',
'members:list:popular:none' => 'Żadni członkowie nie mają jeszcze znajomych.',
-);
+];
diff --git a/mod/members/languages/pt_br.php b/mod/members/languages/pt_br.php
index 35ed976d139..5ef6480599b 100644
--- a/mod/members/languages/pt_br.php
+++ b/mod/members/languages/pt_br.php
@@ -1,5 +1,5 @@
'Online ',
'members:search' => 'Pesquise participantes',
'members:title:search' => 'Pesquise participantes para %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Participantes mais populares',
'members:title:online' => 'Participantes online',
'members:list:popular:none' => 'Nenhum membro tem nenhum amigo.',
-);
+];
diff --git a/mod/members/languages/ro_ro.php b/mod/members/languages/ro_ro.php
index 6ff6a306da2..24742fb9471 100644
--- a/mod/members/languages/ro_ro.php
+++ b/mod/members/languages/ro_ro.php
@@ -1,5 +1,5 @@
'Online',
'members:search' => 'Căutare participanți',
'members:title:search' => 'Căutare participanți %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Cei mai activi participanți',
'members:title:online' => 'Participanți online',
'members:list:popular:none' => 'Nu există prieteni membri',
-);
+];
diff --git a/mod/members/languages/ru.php b/mod/members/languages/ru.php
index 492621eb97a..c4cad189735 100644
--- a/mod/members/languages/ru.php
+++ b/mod/members/languages/ru.php
@@ -1,5 +1,5 @@
'Онлайн',
'members:search' => 'Найти пользователей',
'members:title:search' => 'Поиск пользователя %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Популярные',
'members:title:online' => 'Онлайн',
'members:list:popular:none' => 'Пользователи не имеют друзей.',
-);
+];
diff --git a/mod/members/languages/sr.php b/mod/members/languages/sr.php
index f4923e35339..9936f76e855 100644
--- a/mod/members/languages/sr.php
+++ b/mod/members/languages/sr.php
@@ -1,5 +1,5 @@
'Онлајн',
'members:search' => 'Претражи чланове',
'members:title:search' => 'Чретрага члана за %s',
@@ -8,4 +8,4 @@
'members:title:popular' => 'Најпопуларнији чланови',
'members:title:online' => 'Онлајн чланови',
'members:list:popular:none' => 'Нема чланова без иједног пријатеља',
-);
+];
diff --git a/mod/members/languages/zh_hans.php b/mod/members/languages/zh_hans.php
index b0743f694b4..08cb28ce14c 100644
--- a/mod/members/languages/zh_hans.php
+++ b/mod/members/languages/zh_hans.php
@@ -1,5 +1,5 @@
'在线',
'members:search' => '搜索成员',
'members:title:search' => '成员搜索 %s',
@@ -9,4 +9,4 @@
'members:title:online' => '在线的成员',
'members:title:alpha' => '全部成员',
'members:list:popular:none' => '没有成员有好友。',
-);
+];
diff --git a/mod/members/start.php b/mod/members/start.php
index 151fb2ab674..d2e4c40fb35 100644
--- a/mod/members/start.php
+++ b/mod/members/start.php
@@ -18,7 +18,7 @@ function members_init() {
$item = new ElggMenuItem('members', elgg_echo('members'), 'members');
elgg_register_menu_item('site', $item);
- $list_types = array('newest', 'alpha', 'popular', 'online');
+ $list_types = ['newest', 'alpha', 'popular', 'online'];
foreach ($list_types as $type) {
elgg_register_plugin_hook_handler('members:list', $type, "members_list_$type");
@@ -111,10 +111,10 @@ function members_list_alpha($hook, $type, $returnvalue, $params) {
* @return array
*/
function members_nav_popular($hook, $type, $returnvalue, $params) {
- $returnvalue['popular'] = array(
+ $returnvalue['popular'] = [
'title' => elgg_echo('sort:popular'),
'url' => "members/popular",
- );
+ ];
return $returnvalue;
}
@@ -128,10 +128,10 @@ function members_nav_popular($hook, $type, $returnvalue, $params) {
* @return array
*/
function members_nav_newest($hook, $type, $returnvalue, $params) {
- $returnvalue['newest'] = array(
+ $returnvalue['newest'] = [
'title' => elgg_echo('sort:newest'),
'url' => "members/newest",
- );
+ ];
return $returnvalue;
}
@@ -145,10 +145,10 @@ function members_nav_newest($hook, $type, $returnvalue, $params) {
* @return array
*/
function members_nav_online($hook, $type, $returnvalue, $params) {
- $returnvalue['online'] = array(
+ $returnvalue['online'] = [
'title' => elgg_echo('members:label:online'),
'url' => "members/online",
- );
+ ];
return $returnvalue;
}
@@ -162,10 +162,10 @@ function members_nav_online($hook, $type, $returnvalue, $params) {
* @return array
*/
function members_nav_alpha($hook, $type, $returnvalue, $params) {
- $returnvalue['alpha'] = array(
+ $returnvalue['alpha'] = [
'title' => elgg_echo('sort:alpha'),
'url' => "members/alpha",
- );
+ ];
return $returnvalue;
}
diff --git a/mod/members/views/default/forms/members/search.php b/mod/members/views/default/forms/members/search.php
index a8aec4d8a61..d3c0bd325fd 100644
--- a/mod/members/views/default/forms/members/search.php
+++ b/mod/members/views/default/forms/members/search.php
@@ -1,12 +1,12 @@
'member_query',
'class' => 'mbm',
'required' => true,
-);
+];
echo elgg_view('input/text', $params);
-echo elgg_view('input/submit', array('value' => elgg_echo('search')));
+echo elgg_view('input/submit', ['value' => elgg_echo('search')]);
-echo "" . elgg_echo('members:total', array(get_number_users())) . "
";
\ No newline at end of file
+echo "" . elgg_echo('members:total', [get_number_users()]) . "
";
diff --git a/mod/members/views/default/members/sidebar.php b/mod/members/views/default/members/sidebar.php
index c496099120f..5177c90c484 100644
--- a/mod/members/views/default/members/sidebar.php
+++ b/mod/members/views/default/members/sidebar.php
@@ -4,11 +4,11 @@
*/
// Tag search
-$params = array(
+$params = [
'method' => 'get',
'action' => 'members/search',
'disable_security' => true,
-);
+];
$body = elgg_view_form('members/search', $params);
diff --git a/mod/members/views/default/resources/members/index.php b/mod/members/views/default/resources/members/index.php
index 42bf5f64806..0c779b7c1a5 100644
--- a/mod/members/views/default/resources/members/index.php
+++ b/mod/members/views/default/resources/members/index.php
@@ -6,16 +6,16 @@
// The URL segment after members/
$page = elgg_extract('page', $vars);
-$tabs = elgg_trigger_plugin_hook('members:config', 'tabs', null, array());
+$tabs = elgg_trigger_plugin_hook('members:config', 'tabs', null, []);
foreach ($tabs as $type => $values) {
$tabs[$type]['selected'] = ($page == $type);
}
-$filter = elgg_view('navigation/tabs', array('tabs' => $tabs));
+$filter = elgg_view('navigation/tabs', ['tabs' => $tabs]);
-$params = array(
- 'options' => array('type' => 'user', 'full_view' => false),
-);
+$params = [
+ 'options' => ['type' => 'user', 'full_view' => false],
+];
$content = elgg_trigger_plugin_hook('members:list', $page, $params, null);
if ($content === null) {
@@ -24,12 +24,12 @@
$title = elgg_echo("members:title:{$page}");
-$params = array(
+$params = [
'content' => $content,
'sidebar' => elgg_view('members/sidebar'),
'title' => $title,
'filter' => $filter,
-);
+];
$body = elgg_view_layout('content', $params);
diff --git a/mod/members/views/default/resources/members/search.php b/mod/members/views/default/resources/members/search.php
index d7ed31766a9..2b2b641f8a2 100644
--- a/mod/members/views/default/resources/members/search.php
+++ b/mod/members/views/default/resources/members/search.php
@@ -14,36 +14,36 @@
$offset = (int) get_input('offset', 0);
$display_query = _elgg_get_display_query($query);
-$title = elgg_echo('members:title:search', array($display_query));
+$title = elgg_echo('members:title:search', [$display_query]);
-$options = array();
+$options = [];
$options['query'] = $query;
$options['type'] = "user";
$options['offset'] = $offset;
$options['limit'] = $limit;
-$results = elgg_trigger_plugin_hook('search', 'user', $options, array());
+$results = elgg_trigger_plugin_hook('search', 'user', $options, []);
$count = $results['count'];
$users = $results['entities'];
if (!empty($users)) {
- $content = elgg_view_entity_list($users, array(
+ $content = elgg_view_entity_list($users, [
'count' => $count,
'offset' => $offset,
'limit' => $limit,
'full_view' => false,
'list_type_toggle' => false,
'pagination' => true,
- ));
+ ]);
} else {
$content = elgg_echo("notfound");
}
-$params = array(
+$params = [
'title' => $title,
'content' => $content,
'sidebar' => elgg_view('members/sidebar'),
-);
+];
$body = elgg_view_layout('one_sidebar', $params);
diff --git a/mod/messageboard/actions/messageboard/add.php b/mod/messageboard/actions/messageboard/add.php
index 18ed6550e27..3fcab56c1c7 100644
--- a/mod/messageboard/actions/messageboard/add.php
+++ b/mod/messageboard/actions/messageboard/add.php
@@ -28,4 +28,4 @@
]);
return elgg_ok_response($output, elgg_echo('messageboard:posted'));
-
\ No newline at end of file
+
diff --git a/mod/messageboard/languages/ca.php b/mod/messageboard/languages/ca.php
index 9895e53ad90..f99e9ea3ede 100644
--- a/mod/messageboard/languages/ca.php
+++ b/mod/messageboard/languages/ca.php
@@ -1,6 +1,6 @@
'Tens un nou comentari a la safata',
- 'messageboard:email:body' => "%s t'ha deixat aquest comentari:
-
-
-%s
-
-
-Per a veure els comentaris de la teva safata de missatges, prem en aquest vincle:
-
-%s
-
-Per a consultar el perfil de %s, prem en aquest altre:
-
-%s
-
+ 'messageboard:email:body' => "%s t'ha deixat aquest comentari:
+
+
+%s
+
+
+Per a veure els comentaris de la teva safata de missatges, prem en aquest vincle:
+
+%s
+
+Per a consultar el perfil de %s, prem en aquest altre:
+
+%s
+
Siusplau, no responguis aquest correu electrònic, recorda que és el sistema qui te l'ha enviat per art de màgia. Si tens algun problema o comentari sobre la xarxa, posa't en contacte amb les/les administrador/es.",
/**
@@ -67,4 +67,4 @@
'messageboard:failure' => "Error xungo, el sistema no en té ni idea de què està passant. Torna-ho a provar o posa't en contacte amb els/les administradors/es.",
-);
+];
diff --git a/mod/messageboard/languages/cmn.php b/mod/messageboard/languages/cmn.php
index 8247a17c235..2ca292e4b7b 100644
--- a/mod/messageboard/languages/cmn.php
+++ b/mod/messageboard/languages/cmn.php
@@ -1,6 +1,6 @@
"加入您的留言時發生了非預期的錯誤。請再試一次。",
-);
+];
diff --git a/mod/messageboard/languages/da.php b/mod/messageboard/languages/da.php
index 6dfa304d1b2..ae561570474 100644
--- a/mod/messageboard/languages/da.php
+++ b/mod/messageboard/languages/da.php
@@ -1,6 +1,6 @@
'Du har en ny kommentar på opslagstavlen!',
- 'messageboard:email:body' => "Du har en ny kommentar på opslagstavle fra %s. Der står:
-
-%s
-
-For at se din opslagstavles kommentarer, klik her:
-
-%s
-
-For at se %s's profil, klik her:
-
-%s
-
+ 'messageboard:email:body' => "Du har en ny kommentar på opslagstavle fra %s. Der står:
+
+%s
+
+For at se din opslagstavles kommentarer, klik her:
+
+%s
+
+For at se %s's profil, klik her:
+
+%s
+
Du kan ikke svare på denne mail.",
/**
@@ -65,4 +65,4 @@
'messageboard:failure' => "En uventet fejl skete under tilføjelsen af din besked. Prøv venligst igen.",
-);
+];
diff --git a/mod/messageboard/languages/de.php b/mod/messageboard/languages/de.php
index b08b9c97c6a..8079e2454d8 100644
--- a/mod/messageboard/languages/de.php
+++ b/mod/messageboard/languages/de.php
@@ -1,6 +1,6 @@
"Beim Speichern Deiner Nachricht ist ein unerwarteter Fehler aufgetreten. Bitte versuche es noch einmal.",
-);
+];
diff --git a/mod/messageboard/languages/el.php b/mod/messageboard/languages/el.php
index 906d6d1440b..e58c603e363 100644
--- a/mod/messageboard/languages/el.php
+++ b/mod/messageboard/languages/el.php
@@ -1,6 +1,6 @@
"Παρουσιάστηκε μη αναμενόμενο σφάλμα κατά την προσθήκη του μηνύματος σας. Παρακαλούμε δοκιμάστε ξανά.",
-);
+];
diff --git a/mod/messageboard/languages/en.php b/mod/messageboard/languages/en.php
index 56348961bac..16abf92623c 100644
--- a/mod/messageboard/languages/en.php
+++ b/mod/messageboard/languages/en.php
@@ -1,6 +1,6 @@
"An unexpected error occurred when adding your message. Please try again.",
-);
+];
diff --git a/mod/messageboard/languages/es.php b/mod/messageboard/languages/es.php
index b21d6ed01d1..08ffc1989a7 100644
--- a/mod/messageboard/languages/es.php
+++ b/mod/messageboard/languages/es.php
@@ -1,6 +1,6 @@
"Ocurrió un error desconocido al guardar el mensaje. Intenta de nuevo.",
-);
+];
diff --git a/mod/messageboard/languages/eu_es.php b/mod/messageboard/languages/eu_es.php
index 136659650cb..00ff3f0d67a 100644
--- a/mod/messageboard/languages/eu_es.php
+++ b/mod/messageboard/languages/eu_es.php
@@ -1,6 +1,6 @@
"Ustekabeko errore bat gertatu da zure mezua gehitzean. Mesedez saiatu berriz.",
-);
+];
diff --git a/mod/messageboard/languages/fi.php b/mod/messageboard/languages/fi.php
index 79eb2221267..176794ad060 100644
--- a/mod/messageboard/languages/fi.php
+++ b/mod/messageboard/languages/fi.php
@@ -1,6 +1,6 @@
"Viestin tallentamisessa tapahtui odottamaton virhe. Yritä uudelleen.",
-);
+];
diff --git a/mod/messageboard/languages/fr.php b/mod/messageboard/languages/fr.php
index 6320ccac68e..c9df65b9bf8 100644
--- a/mod/messageboard/languages/fr.php
+++ b/mod/messageboard/languages/fr.php
@@ -1,6 +1,6 @@
"Une erreur imprévue s'est produite lors de l'ajout de votre message. Veuillez réessayer.",
-);
+];
diff --git a/mod/messageboard/languages/gl.php b/mod/messageboard/languages/gl.php
index f90ddb3e9ba..be63d2e3663 100644
--- a/mod/messageboard/languages/gl.php
+++ b/mod/messageboard/languages/gl.php
@@ -1,6 +1,6 @@
"Non foi posíbel engadir a mensaxe, produciuse un erro inesperado. Inténteo de novo.",
-);
+];
diff --git a/mod/messageboard/languages/it.php b/mod/messageboard/languages/it.php
index 6654bd1ecbb..7fe5fa0cf03 100644
--- a/mod/messageboard/languages/it.php
+++ b/mod/messageboard/languages/it.php
@@ -1,6 +1,6 @@
"Si è verificato un errore imprevisto aggiungendo il tuo messaggio. Per favore riprova.",
-);
+];
diff --git a/mod/messageboard/languages/ja.php b/mod/messageboard/languages/ja.php
index 4e351dbee27..fbc4a8cb710 100644
--- a/mod/messageboard/languages/ja.php
+++ b/mod/messageboard/languages/ja.php
@@ -1,6 +1,6 @@
"書き込みの際に何からのエラーが発生しました。もう一度お試しください。",
-);
+];
diff --git a/mod/messageboard/languages/nl.php b/mod/messageboard/languages/nl.php
index ede46bcf964..045b30a1a65 100644
--- a/mod/messageboard/languages/nl.php
+++ b/mod/messageboard/languages/nl.php
@@ -1,6 +1,6 @@
"Er is een fout opgetreden tijdens het toevoegen van je bericht. Probeer het nogmaals.",
-);
+];
diff --git a/mod/messageboard/languages/pl.php b/mod/messageboard/languages/pl.php
index 73e83bdbee1..cc7feeeca0a 100644
--- a/mod/messageboard/languages/pl.php
+++ b/mod/messageboard/languages/pl.php
@@ -1,6 +1,6 @@
"Wystąpił nieoczekiwany błąd podczas dodawania wiadomości. Proszę spróbować ponownie.",
-);
+];
diff --git a/mod/messageboard/languages/pt_br.php b/mod/messageboard/languages/pt_br.php
index eec9e36f76f..cd2e62b3a23 100644
--- a/mod/messageboard/languages/pt_br.php
+++ b/mod/messageboard/languages/pt_br.php
@@ -1,6 +1,6 @@
'Você adicionou um novo comentário no quadro de mensagens!',
- 'messageboard:email:body' => "Você possui um novo comentário de %s no quadro de mensagens. Ele diz:
-
-
-%s
-
-
-Para ver os comentários de seu quadro de mensagens, clique aqui:
-
- %s
-
-Para ver o perfil de %s, clique aqui:
-
- %s
-
+ 'messageboard:email:body' => "Você possui um novo comentário de %s no quadro de mensagens. Ele diz:
+
+
+%s
+
+
+Para ver os comentários de seu quadro de mensagens, clique aqui:
+
+ %s
+
+Para ver o perfil de %s, clique aqui:
+
+ %s
+
Por favor, não responda este email.",
/**
@@ -67,4 +67,4 @@
'messageboard:failure' => "Ocorreu um erro ao adicionar a mensagem. Por favor, tente novamente.",
-);
+];
diff --git a/mod/messageboard/languages/ru.php b/mod/messageboard/languages/ru.php
index 75dde992352..62361de930f 100644
--- a/mod/messageboard/languages/ru.php
+++ b/mod/messageboard/languages/ru.php
@@ -1,6 +1,6 @@
'У Вас есть новая запись на стене.',
- 'messageboard:email:body' => "У Вас есть новая запись на стене от %s. Она гласит:
-
-
-%s
-
-
-Чтобы посмотреть записи на Вашей стене, нажмите здесь:
-
- %s
-
-Чтобы посмотреть польфиль %s, кликните здесь:
-
- %s
-
+ 'messageboard:email:body' => "У Вас есть новая запись на стене от %s. Она гласит:
+
+
+%s
+
+
+Чтобы посмотреть записи на Вашей стене, нажмите здесь:
+
+ %s
+
+Чтобы посмотреть польфиль %s, кликните здесь:
+
+ %s
+
Это письмо составлено роботом. Пожалуйста, не отвечайте на него.",
/**
@@ -67,4 +67,4 @@
'messageboard:failure' => "Простите, при размещении записи произошла ошибка. Попробуйте снова.",
-);
+];
diff --git a/mod/messageboard/start.php b/mod/messageboard/start.php
index 94c86f0d61d..67ffeb5d5a6 100644
--- a/mod/messageboard/start.php
+++ b/mod/messageboard/start.php
@@ -65,10 +65,10 @@ function messageboard_page_handler($page) {
/**
* Add messageboard post
*
- * @param ElggUser $poster User posting the message
- * @param ElggUser $owner User who owns the message board
- * @param string $message The posted message
- * @param int $access_id Access level (see defines in elgglib.php)
+ * @param ElggUser $poster User posting the message
+ * @param ElggUser $owner User who owns the message board
+ * @param string $message The posted message
+ * @param int $access_id Access level (see defines in elgglib.php)
* @return bool
*/
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC) {
@@ -78,28 +78,27 @@ function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
return false;
}
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/messageboard/create',
'action_type' => 'messageboard',
'subject_guid' => $poster->guid,
'object_guid' => $owner->guid,
'access_id' => $access_id,
'annotation_id' => $result_id,
- ));
+ ]);
// Send notification only if poster isn't the owner
if ($poster->guid != $owner->guid) {
-
- $subject = elgg_echo('messageboard:email:subject', array(), $owner->language);
+ $subject = elgg_echo('messageboard:email:subject', [], $owner->language);
$url = elgg_get_site_url() . "messageboard/owner/" . $owner->username;
- $body = elgg_echo('messageboard:email:body', array(
+ $body = elgg_echo('messageboard:email:body', [
$poster->name,
$message,
$url,
$poster->name,
$poster->getURL()
- ), $owner->language);
+ ], $owner->language);
$params = [
'action' => 'create',
@@ -126,9 +125,9 @@ function messageboard_annotation_menu_setup($hook, $type, $return, $params) {
return;
}
- $url = elgg_http_add_url_query_elements('action/messageboard/delete', array(
+ $url = elgg_http_add_url_query_elements('action/messageboard/delete', [
'annotation_id' => $annotation->id,
- ));
+ ]);
$return[] = ElggMenuItem::factory([
'name' => 'delete',
diff --git a/mod/messageboard/views/default/elgg/messageboard.js b/mod/messageboard/views/default/elgg/messageboard.js
index 3a35018a754..cd6d361c679 100644
--- a/mod/messageboard/views/default/elgg/messageboard.js
+++ b/mod/messageboard/views/default/elgg/messageboard.js
@@ -59,4 +59,4 @@ define(function (require) {
};
elgg.register_hook_handler('init', 'system', MB.init);
-});
\ No newline at end of file
+});
diff --git a/mod/messageboard/views/default/resources/messageboard/owner.php b/mod/messageboard/views/default/resources/messageboard/owner.php
index 38efc938759..91fd365a1ab 100644
--- a/mod/messageboard/views/default/resources/messageboard/owner.php
+++ b/mod/messageboard/views/default/resources/messageboard/owner.php
@@ -15,16 +15,16 @@
elgg_push_breadcrumb($page_owner->name, $page_owner->getURL());
-$options = array(
+$options = [
'annotations_name' => 'messageboard',
'guid' => $page_owner_guid,
'reverse_order_by' => true,
'preload_owners' => true,
-);
+];
if ($history_user) {
$options['annotations_owner_guid'] = $history_user->getGUID();
- $title = elgg_echo('messageboard:owner_history', array($history_user->name, $page_owner->name));
+ $title = elgg_echo('messageboard:owner_history', [$history_user->name, $page_owner->name]);
if ($page_owner instanceof ElggGroup) {
$mb_url = "messageboard/group/$page_owner->guid/all";
@@ -32,7 +32,7 @@
$mb_url = "messageboard/owner/$page_owner->username";
}
} else {
- $title = elgg_echo('messageboard:owner', array($page_owner->name));
+ $title = elgg_echo('messageboard:owner', [$page_owner->name]);
$mb_url = '';
}
@@ -48,12 +48,12 @@
$content = elgg_echo('messageboard:none');
}
-$vars = array(
+$vars = [
'filter' => false,
'content' => $content,
'title' => $title,
'reverse_order_by' => true
-);
+];
$body = elgg_view_layout('content', $vars);
diff --git a/mod/messageboard/views/default/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php
index 16fd8102dd8..25182d2fc1c 100644
--- a/mod/messageboard/views/default/river/object/messageboard/create.php
+++ b/mod/messageboard/views/default/river/object/messageboard/create.php
@@ -1,15 +1,15 @@
-getAnnotation();
-$excerpt = elgg_get_excerpt($messageboard->value);
-
-echo elgg_view('river/elements/layout', array(
- 'item' => $item,
- 'message' => $excerpt,
-));
+getAnnotation();
+$excerpt = elgg_get_excerpt($messageboard->value);
+
+echo elgg_view('river/elements/layout', [
+ 'item' => $item,
+ 'message' => $excerpt,
+]);
diff --git a/mod/messages/actions/messages/process.php b/mod/messages/actions/messages/process.php
index b34f8b62f76..4a723db84f2 100644
--- a/mod/messages/actions/messages/process.php
+++ b/mod/messages/actions/messages/process.php
@@ -3,7 +3,7 @@
* Process a set of messages
*/
-$message_guids = get_input('message_id', array());
+$message_guids = get_input('message_id', []);
if (!$message_guids) {
register_error(elgg_echo('messages:error:messages_not_selected'));
diff --git a/mod/messages/actions/messages/send.php b/mod/messages/actions/messages/send.php
index f63fd4d3244..1549cb42748 100644
--- a/mod/messages/actions/messages/send.php
+++ b/mod/messages/actions/messages/send.php
@@ -8,7 +8,7 @@
$subject = strip_tags(get_input('subject'));
$body = get_input('body');
$recipients = (array) get_input('recipients');
-$original_msg_guid = (int)get_input('original_guid');
+$original_msg_guid = (int) get_input('original_guid');
elgg_make_sticky_form('messages');
diff --git a/mod/messages/languages/da.php b/mod/messages/languages/da.php
index 1f1aec70c3e..70bcc2d569d 100644
--- a/mod/messages/languages/da.php
+++ b/mod/messages/languages/da.php
@@ -1,5 +1,5 @@
'Slettet bruger',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/de.php b/mod/messages/languages/de.php
index 6e1d3c4250f..5112e2eb7d0 100644
--- a/mod/messages/languages/de.php
+++ b/mod/messages/languages/de.php
@@ -1,5 +1,5 @@
'Ehemaliges Mitglied',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/en.php b/mod/messages/languages/en.php
index 98282c0a560..c7adbb6ea54 100644
--- a/mod/messages/languages/en.php
+++ b/mod/messages/languages/en.php
@@ -1,5 +1,5 @@
'Deleted user',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/es.php b/mod/messages/languages/es.php
index c247eddb600..5b0fc7050d6 100644
--- a/mod/messages/languages/es.php
+++ b/mod/messages/languages/es.php
@@ -1,5 +1,5 @@
'Usuario borrado',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/eu_es.php b/mod/messages/languages/eu_es.php
index e16bdd6327e..07618653008 100644
--- a/mod/messages/languages/eu_es.php
+++ b/mod/messages/languages/eu_es.php
@@ -1,5 +1,5 @@
'Ezabatutako erabiltzailea',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/fi.php b/mod/messages/languages/fi.php
index 2e9bfddda13..da855894c19 100644
--- a/mod/messages/languages/fi.php
+++ b/mod/messages/languages/fi.php
@@ -1,5 +1,5 @@
'Poistettu käyttäjä',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/fr.php b/mod/messages/languages/fr.php
index 567469aeb35..569a24bf446 100644
--- a/mod/messages/languages/fr.php
+++ b/mod/messages/languages/fr.php
@@ -1,5 +1,5 @@
'Utilisateur effacé',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/gl.php b/mod/messages/languages/gl.php
index 206ef7c2df8..2760013bfca 100644
--- a/mod/messages/languages/gl.php
+++ b/mod/messages/languages/gl.php
@@ -1,5 +1,5 @@
'Usuario eliminado.',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/it.php b/mod/messages/languages/it.php
index 50d4a162360..f576662a710 100644
--- a/mod/messages/languages/it.php
+++ b/mod/messages/languages/it.php
@@ -1,5 +1,5 @@
'Utente cancellato',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/ja.php b/mod/messages/languages/ja.php
index f35dd9ec480..52c352e99d6 100644
--- a/mod/messages/languages/ja.php
+++ b/mod/messages/languages/ja.php
@@ -1,5 +1,5 @@
'削除されたユーザ',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/ko.php b/mod/messages/languages/ko.php
index 246375110ed..445d6d415f7 100644
--- a/mod/messages/languages/ko.php
+++ b/mod/messages/languages/ko.php
@@ -1,5 +1,5 @@
'삭제된 사용자',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/nl.php b/mod/messages/languages/nl.php
index 7fa28d718a0..e0c5889649e 100644
--- a/mod/messages/languages/nl.php
+++ b/mod/messages/languages/nl.php
@@ -1,5 +1,5 @@
'Verwijderde gebruiker',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/pl.php b/mod/messages/languages/pl.php
index 2f89890c869..a87abdb5ffc 100644
--- a/mod/messages/languages/pl.php
+++ b/mod/messages/languages/pl.php
@@ -1,5 +1,5 @@
'Usunięty użytkownik',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/pt_br.php b/mod/messages/languages/pt_br.php
index 27d2b5bc365..211dd5cb4d5 100644
--- a/mod/messages/languages/pt_br.php
+++ b/mod/messages/languages/pt_br.php
@@ -1,5 +1,5 @@
'Você possui uma nova mensagem!',
- 'messages:email:body' => "Você possui uma nova mensagem de %s. Ela diz:
-
-
-%s
-
-
-Para ver sua mensagem, clique aqui:
-
- %s
-
-Para enviar uma mensagem para %s, clique aqui:
-
- %s
-
+ 'messages:email:body' => "Você possui uma nova mensagem de %s. Ela diz:
+
+
+%s
+
+
+Para ver sua mensagem, clique aqui:
+
+ %s
+
+Para enviar uma mensagem para %s, clique aqui:
+
+ %s
+
Não responda este email.",
/**
@@ -82,4 +82,4 @@
'messages:deleted_sender' => 'Usuário apagado',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/languages/ru.php b/mod/messages/languages/ru.php
index 71d7082a29c..e18685b4b07 100644
--- a/mod/messages/languages/ru.php
+++ b/mod/messages/languages/ru.php
@@ -1,5 +1,5 @@
'Пользователя не существует.',
-);
\ No newline at end of file
+];
diff --git a/mod/messages/lib/messages.php b/mod/messages/lib/messages.php
index 6a245aa8735..34ced5f5ae2 100644
--- a/mod/messages/lib/messages.php
+++ b/mod/messages/lib/messages.php
@@ -12,18 +12,18 @@
*/
function messages_prepare_form_vars($recipient_guid = 0) {
- $recipients = array();
+ $recipients = [];
$recipient = get_user($recipient_guid);
if (!empty($recipient)) {
$recipients[] = $recipient->getGUID();
}
// input names => defaults
- $values = array(
+ $values = [
'subject' => '',
'body' => '',
'recipients' => $recipients,
- );
+ ];
if (elgg_is_sticky_form('messages')) {
foreach (array_keys($values) as $field) {
diff --git a/mod/messages/start.php b/mod/messages/start.php
index d6c69ae7874..46755342f0d 100644
--- a/mod/messages/start.php
+++ b/mod/messages/start.php
@@ -16,19 +16,19 @@ function messages_init() {
// add page menu items
if (elgg_is_logged_in()) {
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => 'messages:inbox',
'text' => elgg_echo('messages:inbox'),
'href' => "messages/inbox/" . elgg_get_logged_in_user_entity()->username,
'context' => 'messages',
- ));
+ ]);
- elgg_register_menu_item('page', array(
+ elgg_register_menu_item('page', [
'name' => 'messages:sentmessages',
'text' => elgg_echo('messages:sentmessages'),
'href' => "messages/sent/" . elgg_get_logged_in_user_entity()->username,
'context' => 'messages',
- ));
+ ]);
}
// Extend system CSS with our own styles, which are defined in the messages/css view
@@ -141,7 +141,7 @@ function messages_register_topbar($hook, $type, $items, $params) {
$num_messages = (int) messages_count_unread();
if ($num_messages) {
- $title .= " (" . elgg_echo("messages:unreadcount", array($num_messages)) . ")";
+ $title .= " (" . elgg_echo("messages:unreadcount", [$num_messages]) . ")";
}
$items[] = ElggMenuItem::factory([
@@ -311,14 +311,14 @@ function messages_send($subject, $body, $recipient_guid, $sender_guid = 0, $orig
$recipient = get_user($recipient_guid);
$sender = get_user($sender_guid);
- $subject = elgg_echo('messages:email:subject', array(), $recipient->language);
- $body = elgg_echo('messages:email:body', array(
+ $subject = elgg_echo('messages:email:subject', [], $recipient->language);
+ $body = elgg_echo('messages:email:body', [
$sender->name,
$message_contents,
elgg_get_site_url() . "messages/inbox/" . $recipient->username,
$sender->name,
elgg_get_site_url() . "messages/compose?send_to=" . $sender_guid
- ),
+ ],
$recipient->language
);
@@ -429,13 +429,13 @@ function messages_purge($event, $type, $user) {
access_show_hidden_entities(true);
$ia = elgg_set_ignore_access(true);
- $options = array(
+ $options = [
'type' => 'object',
'subtype' => 'messages',
'metadata_name' => 'fromId',
'metadata_value' => $user->getGUID(),
'limit' => 0,
- );
+ ];
$batch = new ElggBatch('elgg_get_entities_from_metadata', $options);
foreach ($batch as $e) {
$e->delete();
diff --git a/mod/messages/views/default/object/messages.php b/mod/messages/views/default/object/messages.php
index 3d70e26bd4f..8ceda8395c9 100644
--- a/mod/messages/views/default/object/messages.php
+++ b/mod/messages/views/default/object/messages.php
@@ -18,11 +18,11 @@
$user = get_user($message->fromId);
if ($user) {
$icon = elgg_view_entity_icon($user, 'tiny');
- $user_link = elgg_view('output/url', array(
+ $user_link = elgg_view('output/url', [
'href' => "messages/compose?send_to=$user->guid",
'text' => $user->name,
'is_trusted' => true,
- ));
+ ]);
} else {
$icon = '';
$user_link = elgg_echo('messages:deleted_sender');
@@ -33,18 +33,17 @@
} else {
$class = 'message unread';
}
-
} else {
// sent
$user = get_user($message->toId);
if ($user) {
$icon = elgg_view_entity_icon($user, 'tiny');
- $user_link = elgg_view('output/url', array(
+ $user_link = elgg_view('output/url', [
'href' => "messages/compose?send_to=$user->guid",
- 'text' => elgg_echo('messages:to_user', array($user->name)),
+ 'text' => elgg_echo('messages:to_user', [$user->name]),
'is_trusted' => true,
- ));
+ ]);
} else {
$icon = '';
$user_link = elgg_echo('messages:deleted_sender');
@@ -55,18 +54,18 @@
$timestamp = elgg_view_friendly_time($message->time_created);
-$subject_info = elgg_view('output/url', array(
+$subject_info = elgg_view('output/url', [
'href' => $message->getURL(),
'text' => $message->title,
'is_trusted' => true,
-));
+]);
-$delete_link = elgg_view("output/url", array(
+$delete_link = elgg_view("output/url", [
'href' => "action/messages/delete?guid=" . $message->getGUID() . "&full=$full",
'text' => elgg_view_icon('delete', 'float-alt'),
'confirm' => elgg_echo('deleteconfirm'),
'encode_text' => false,
- ));
+ ]);
$body = <<$user_link
@@ -76,23 +75,22 @@
HTML;
if ($full) {
- echo elgg_view_image_block($icon, $body, array('class' => $class));
- echo elgg_view('output/longtext', array('value' => $message->description));
+ echo elgg_view_image_block($icon, $body, ['class' => $class]);
+ echo elgg_view('output/longtext', ['value' => $message->description]);
} else {
-
- $body .= elgg_view("output/longtext", array("value" => elgg_get_excerpt($message->description), "class" => "elgg-subtext clearfloat"));
+ $body .= elgg_view("output/longtext", ["value" => elgg_get_excerpt($message->description), "class" => "elgg-subtext clearfloat"]);
if ($bulk_actions) {
- $checkbox = elgg_view('input/checkbox', array(
+ $checkbox = elgg_view('input/checkbox', [
'name' => 'message_id[]',
'value' => $message->guid,
'default' => false
- ));
+ ]);
- $entity_listing = elgg_view_image_block($icon, $body, array('class' => $class));
+ $entity_listing = elgg_view_image_block($icon, $body, ['class' => $class]);
echo elgg_view_image_block($checkbox, $entity_listing);
} else {
- echo elgg_view_image_block($icon, $body, array('class' => $class));
+ echo elgg_view_image_block($icon, $body, ['class' => $class]);
}
-}
\ No newline at end of file
+}
diff --git a/mod/messages/views/default/resources/messages/inbox.php b/mod/messages/views/default/resources/messages/inbox.php
index c66e64683ff..581a5320838 100644
--- a/mod/messages/views/default/resources/messages/inbox.php
+++ b/mod/messages/views/default/resources/messages/inbox.php
@@ -16,10 +16,10 @@
if (!$page_owner || !$page_owner->canEdit()) {
$guid = 0;
- if($page_owner){
+ if ($page_owner) {
$guid = $page_owner->getGUID();
}
- register_error(elgg_echo("pageownerunavailable", array($guid)));
+ register_error(elgg_echo("pageownerunavailable", [$guid]));
forward();
}
@@ -27,9 +27,9 @@
elgg_register_title_button('messages', 'add', 'object', 'messages');
-$title = elgg_echo('messages:user', array($page_owner->name));
+$title = elgg_echo('messages:user', [$page_owner->name]);
-$list = elgg_list_entities_from_metadata(array(
+$list = elgg_list_entities_from_metadata([
'type' => 'object',
'subtype' => 'messages',
'metadata_name' => 'toId',
@@ -38,18 +38,18 @@
'full_view' => false,
'preload_owners' => true,
'bulk_actions' => true
-));
+]);
-$body_vars = array(
+$body_vars = [
'folder' => 'inbox',
'list' => $list,
-);
-$content = elgg_view_form('messages/process', array(), $body_vars);
+];
+$content = elgg_view_form('messages/process', [], $body_vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => elgg_echo('messages:inbox'),
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/messages/views/default/resources/messages/read.php b/mod/messages/views/default/resources/messages/read.php
index 496aa238a42..09e14d8117f 100644
--- a/mod/messages/views/default/resources/messages/read.php
+++ b/mod/messages/views/default/resources/messages/read.php
@@ -30,32 +30,32 @@
}
elgg_push_breadcrumb($title);
-$content = elgg_view_entity($message, array('full_view' => true));
+$content = elgg_view_entity($message, ['full_view' => true]);
if ($inbox) {
- $form_params = array(
+ $form_params = [
'id' => 'messages-reply-form',
'class' => 'hidden mtl',
'action' => 'action/messages/send',
- );
- $body_params = array('message' => $message);
+ ];
+ $body_params = ['message' => $message];
$content .= elgg_view_form('messages/reply', $form_params, $body_params);
$from_user = get_user($message->fromId);
if ((elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) && $from_user) {
- elgg_register_menu_item('title', array(
+ elgg_register_menu_item('title', [
'name' => 'reply',
'href' => '#messages-reply-form',
'text' => elgg_echo('reply'),
'link_class' => 'elgg-button elgg-button-action',
'rel' => 'toggle',
- ));
+ ]);
}
}
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/messages/views/default/resources/messages/send.php b/mod/messages/views/default/resources/messages/send.php
index 2a154d5c1b1..a09b208cea1 100644
--- a/mod/messages/views/default/resources/messages/send.php
+++ b/mod/messages/views/default/resources/messages/send.php
@@ -14,13 +14,13 @@
elgg_push_breadcrumb($title);
-$params = messages_prepare_form_vars((int)get_input('send_to'));
-$content = elgg_view_form('messages/send', array(), $params);
+$params = messages_prepare_form_vars((int) get_input('send_to'));
+$content = elgg_view_form('messages/send', [], $params);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/messages/views/default/resources/messages/sent.php b/mod/messages/views/default/resources/messages/sent.php
index 27aa32005da..5f7758aaa73 100644
--- a/mod/messages/views/default/resources/messages/sent.php
+++ b/mod/messages/views/default/resources/messages/sent.php
@@ -18,10 +18,10 @@
if (!$page_owner || !$page_owner->canEdit()) {
$guid = 0;
- if($page_owner){
+ if ($page_owner) {
$guid = $page_owner->getGUID();
}
- register_error(elgg_echo("pageownerunavailable", array($guid)));
+ register_error(elgg_echo("pageownerunavailable", [$guid]));
forward();
}
@@ -29,9 +29,9 @@
elgg_register_title_button('messages', 'add', 'object', 'messages');
-$title = elgg_echo('messages:sentmessages', array($page_owner->name));
+$title = elgg_echo('messages:sentmessages', [$page_owner->name]);
-$list = elgg_list_entities_from_metadata(array(
+$list = elgg_list_entities_from_metadata([
'type' => 'object',
'subtype' => 'messages',
'metadata_name' => 'fromId',
@@ -39,18 +39,18 @@
'owner_guid' => elgg_get_page_owner_guid(),
'full_view' => false,
'bulk_actions' => true
-));
+]);
-$body_vars = array(
+$body_vars = [
'folder' => 'sent',
'list' => $list,
-);
-$content = elgg_view_form('messages/process', array(), $body_vars);
+];
+$content = elgg_view_form('messages/process', [], $body_vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $content,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/notifications/languages/ca.php b/mod/notifications/languages/ca.php
index 06afc4aaffd..6bfe359a1ca 100644
--- a/mod/notifications/languages/ca.php
+++ b/mod/notifications/languages/ca.php
@@ -1,6 +1,6 @@
'Totes les teves amistats',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'La teva configuració de notificacions s\'ha desat correctament.',
-);
+];
diff --git a/mod/notifications/languages/cmn.php b/mod/notifications/languages/cmn.php
index f3a207ddbbd..ad5890076b3 100644
--- a/mod/notifications/languages/cmn.php
+++ b/mod/notifications/languages/cmn.php
@@ -1,6 +1,6 @@
'所有朋友',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => '您的通知設定值已儲存。',
-);
+];
diff --git a/mod/notifications/languages/da.php b/mod/notifications/languages/da.php
index b2844899c32..0be825d2112 100644
--- a/mod/notifications/languages/da.php
+++ b/mod/notifications/languages/da.php
@@ -1,6 +1,6 @@
'Alle venner',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Dine indstillinger for beskeder er blevet gemt.',
-);
+];
diff --git a/mod/notifications/languages/de.php b/mod/notifications/languages/de.php
index 989bc3a2633..6a81dc74584 100644
--- a/mod/notifications/languages/de.php
+++ b/mod/notifications/languages/de.php
@@ -1,6 +1,6 @@
'Alle Freunde',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Deine Benachrichtigungseinstellungen wurden gespeichert.',
-);
+];
diff --git a/mod/notifications/languages/el.php b/mod/notifications/languages/el.php
index 29e42f9d2c0..c6e08c6f744 100644
--- a/mod/notifications/languages/el.php
+++ b/mod/notifications/languages/el.php
@@ -1,6 +1,6 @@
'Όλοι οι φίλοι',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Οι ρυθμίσεις ειδοποιήσεων αποθηκεύτηκαν με επιτυχία.',
-);
+];
diff --git a/mod/notifications/languages/en.php b/mod/notifications/languages/en.php
index 5a8933a45ab..83cfb5a315b 100644
--- a/mod/notifications/languages/en.php
+++ b/mod/notifications/languages/en.php
@@ -1,6 +1,6 @@
'All friends',
@@ -23,4 +23,4 @@
'notifications:subscriptions:no_results' => 'There are no subscription records yet',
-);
+];
diff --git a/mod/notifications/languages/es.php b/mod/notifications/languages/es.php
index a6818496ad2..44c8ccb496e 100644
--- a/mod/notifications/languages/es.php
+++ b/mod/notifications/languages/es.php
@@ -1,6 +1,6 @@
'Todos los amigos',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Tu configuración de notificaciones ha sido guardada.',
-);
+];
diff --git a/mod/notifications/languages/eu_es.php b/mod/notifications/languages/eu_es.php
index dc783625f35..ea0d20817ac 100644
--- a/mod/notifications/languages/eu_es.php
+++ b/mod/notifications/languages/eu_es.php
@@ -1,6 +1,6 @@
'Lagun guztiak',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Zure jakinarazpen ezarpenak gorde egin dira.',
-);
+];
diff --git a/mod/notifications/languages/fi.php b/mod/notifications/languages/fi.php
index 56c351e7e10..e09a13d9d5a 100644
--- a/mod/notifications/languages/fi.php
+++ b/mod/notifications/languages/fi.php
@@ -1,6 +1,6 @@
'Kaikki ystävät',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Ilmoitusasetukset tallennettu.',
-);
+];
diff --git a/mod/notifications/languages/fr.php b/mod/notifications/languages/fr.php
index 9cc0fc1d10f..e01ed966bbd 100644
--- a/mod/notifications/languages/fr.php
+++ b/mod/notifications/languages/fr.php
@@ -1,6 +1,6 @@
'Tous les contacts',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Vos paramètres de notifications ont bien été enregistrés.',
-);
+];
diff --git a/mod/notifications/languages/gl.php b/mod/notifications/languages/gl.php
index ca3d31eb3c0..563fd144633 100644
--- a/mod/notifications/languages/gl.php
+++ b/mod/notifications/languages/gl.php
@@ -1,6 +1,6 @@
'Todos os contactos',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Gardouse a configuración de notificación.',
-);
+];
diff --git a/mod/notifications/languages/it.php b/mod/notifications/languages/it.php
index d7315f15ba5..ed99ac4ba29 100644
--- a/mod/notifications/languages/it.php
+++ b/mod/notifications/languages/it.php
@@ -1,6 +1,6 @@
'Tutti gli amici',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Le tue impostazioni di notifica sono state salvate.',
-);
+];
diff --git a/mod/notifications/languages/ja.php b/mod/notifications/languages/ja.php
index 01c97c90193..6cdb5b7f96e 100644
--- a/mod/notifications/languages/ja.php
+++ b/mod/notifications/languages/ja.php
@@ -1,6 +1,6 @@
'全ての友達',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => '通知設定を保存しました。',
-);
+];
diff --git a/mod/notifications/languages/ko.php b/mod/notifications/languages/ko.php
index 0356ce4aebe..0c7acfb9213 100644
--- a/mod/notifications/languages/ko.php
+++ b/mod/notifications/languages/ko.php
@@ -1,6 +1,6 @@
'모든 친구',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => '알림 설정이 저장되었습니다.',
-);
+];
diff --git a/mod/notifications/languages/nl.php b/mod/notifications/languages/nl.php
index 60969b5fa5c..c797d525d4b 100644
--- a/mod/notifications/languages/nl.php
+++ b/mod/notifications/languages/nl.php
@@ -1,6 +1,6 @@
'Alle vrienden',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Je notificatie-instellingen zijn opgeslagen.',
-);
+];
diff --git a/mod/notifications/languages/pl.php b/mod/notifications/languages/pl.php
index 4be0e840bfc..419024a208d 100644
--- a/mod/notifications/languages/pl.php
+++ b/mod/notifications/languages/pl.php
@@ -1,6 +1,6 @@
'Wszyscy znajomi',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Twoje ustawienia powiadomień zostały zapisane.',
-);
+];
diff --git a/mod/notifications/languages/pt_br.php b/mod/notifications/languages/pt_br.php
index d50575dd484..85735bc97aa 100644
--- a/mod/notifications/languages/pt_br.php
+++ b/mod/notifications/languages/pt_br.php
@@ -1,6 +1,6 @@
'Todos os amigos',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Suas configurações de notificação foram salvas com sucesso.',
-);
+];
diff --git a/mod/notifications/languages/ru.php b/mod/notifications/languages/ru.php
index d7d90e676a0..2a8faac2c43 100644
--- a/mod/notifications/languages/ru.php
+++ b/mod/notifications/languages/ru.php
@@ -1,6 +1,6 @@
'Все друзья',
@@ -21,4 +21,4 @@
'notifications:subscriptions:success' => 'Сохранено.',
-);
+];
diff --git a/mod/notifications/start.php b/mod/notifications/start.php
index 61ba68939dd..9239583112a 100644
--- a/mod/notifications/start.php
+++ b/mod/notifications/start.php
@@ -9,7 +9,7 @@
function notifications_plugin_init() {
- elgg_extend_view('elgg.css','notifications.css');
+ elgg_extend_view('elgg.css', 'notifications.css');
elgg_register_page_handler('notifications', 'notifications_page_handler');
@@ -127,7 +127,7 @@ function notifications_relationship_remove($event, $object_type, $relationship)
}
$methods = array_keys(_elgg_services()->notifications->getMethodsAsDeprecatedGlobal());
- foreach($methods as $method) {
+ foreach ($methods as $method) {
elgg_remove_subscription($relationship->guid_one, $method, $relationship->guid_two);
}
}
@@ -159,7 +159,7 @@ function notifications_update_friend_notify($event, $object_type, $relationship)
$collections_preferences = $user->$metaname;
if ($collections_preferences) {
if (!empty($collections_preferences) && !is_array($collections_preferences)) {
- $collections_preferences = array($collections_preferences);
+ $collections_preferences = [$collections_preferences];
}
if (is_array($collections_preferences)) {
// -1 means all friends is on - should be a define
@@ -202,7 +202,7 @@ function notifications_update_collection_notify($event, $object_type, $returnval
continue;
}
if (!is_array($collections_preferences)) {
- $collections_preferences = array($collections_preferences);
+ $collections_preferences = [$collections_preferences];
}
if (in_array(-1, $collections_preferences)) {
// if "all friends" notify is on, we don't change any notifications
@@ -233,4 +233,4 @@ function notifications_update_collection_notify($event, $object_type, $returnval
function notifications_register_tests($hook, $type, $tests) {
$tests[] = __DIR__ . '/tests/ElggNotificationsPluginUnitTest.php';
return $tests;
-}
\ No newline at end of file
+}
diff --git a/mod/notifications/views/default/notifications.css b/mod/notifications/views/default/notifications.css
index c0578c9adb1..3ba6d4aa4de 100644
--- a/mod/notifications/views/default/notifications.css
+++ b/mod/notifications/views/default/notifications.css
@@ -17,14 +17,14 @@
.elgg-subscription-description,
.elgg-subscription-methods {
- display: table-cell;
- width: 50%;
- vertical-align: middle;
- padding: 10px;
+ display: table-cell;
+ width: 50%;
+ vertical-align: middle;
+ padding: 10px;
border-bottom: 1px solid #DCDCDC;
}
.elgg-list .elgg-subscription-description,
.elgg-list .elgg-subscription-methods {
border-bottom: none;
-}
\ No newline at end of file
+}
diff --git a/mod/notifications/views/default/notifications/groups.php b/mod/notifications/views/default/notifications/groups.php
index e9670437b1a..d7326569174 100644
--- a/mod/notifications/views/default/notifications/groups.php
+++ b/mod/notifications/views/default/notifications/groups.php
@@ -10,4 +10,4 @@
echo elgg_view_module('info', $title, $body, [
'class' => 'elgg-subscription-module',
-]);
\ No newline at end of file
+]);
diff --git a/mod/notifications/views/default/notifications/settings/collections.php b/mod/notifications/views/default/notifications/settings/collections.php
index 0891af8288e..76793ed19a7 100644
--- a/mod/notifications/views/default/notifications/settings/collections.php
+++ b/mod/notifications/views/default/notifications/settings/collections.php
@@ -1,7 +1,7 @@
'elgg-subscription-methods',
]);
?>
-
\ No newline at end of file
+
diff --git a/mod/notifications/views/default/notifications/subscriptions/groups.php b/mod/notifications/views/default/notifications/subscriptions/groups.php
index 913cfaa95c2..eb5d47ce9ab 100644
--- a/mod/notifications/views/default/notifications/subscriptions/groups.php
+++ b/mod/notifications/views/default/notifications/subscriptions/groups.php
@@ -13,16 +13,16 @@
// the user is subscribed to
$dbprefix = elgg_get_config('dbprefix');
$options = [
- 'selects' => array('GROUP_CONCAT(ers.relationship) as relationships'),
+ 'selects' => ['GROUP_CONCAT(ers.relationship) as relationships'],
'types' => 'group',
- 'joins' => array(
+ 'joins' => [
"JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid",
"JOIN {$dbprefix}entity_relationships ers
ON e.guid = ers.guid_two AND ers.guid_one = $user->guid",
- ),
- 'wheres' => array(
+ ],
+ 'wheres' => [
"ers.relationship = 'member' OR ers.relationship LIKE 'notify%'"
- ),
+ ],
'group_by' => 'e.guid',
'order_by' => 'ge.name',
'offset_key' => 'subscriptions_groups',
@@ -32,4 +32,4 @@
'limit' => max(20, elgg_get_config('default_limit')),
];
-echo elgg_list_entities($options);
\ No newline at end of file
+echo elgg_list_entities($options);
diff --git a/mod/notifications/views/default/notifications/subscriptions/users.php b/mod/notifications/views/default/notifications/subscriptions/users.php
index d923b4442ae..167a63cb32d 100644
--- a/mod/notifications/views/default/notifications/subscriptions/users.php
+++ b/mod/notifications/views/default/notifications/subscriptions/users.php
@@ -2,7 +2,7 @@
/**
* Friends preferences
- *
+ *
* @uses $vars['user'] Subscriber
*/
$user = elgg_extract('user', $vars);
@@ -13,16 +13,16 @@
// Returns a list of all friends, as well as anyone else who the user is subscribed to
$dbprefix = elgg_get_config('dbprefix');
$options = [
- 'selects' => array('GROUP_CONCAT(ers.relationship) as relationships'),
+ 'selects' => ['GROUP_CONCAT(ers.relationship) as relationships'],
'types' => 'user',
- 'joins' => array(
+ 'joins' => [
"JOIN {$dbprefix}users_entity ue ON ue.guid = e.guid",
"JOIN {$dbprefix}entity_relationships ers
ON e.guid = ers.guid_two AND ers.guid_one = $user->guid",
- ),
- 'wheres' => array(
+ ],
+ 'wheres' => [
"ers.relationship = 'friend' OR ers.relationship LIKE 'notify%'"
- ),
+ ],
'order_by' => 'ue.name',
'group_by' => 'e.guid',
'offset_key' => 'subscriptions_users',
diff --git a/mod/pages/actions/pages/delete.php b/mod/pages/actions/pages/delete.php
index d197b91700f..89b38396521 100644
--- a/mod/pages/actions/pages/delete.php
+++ b/mod/pages/actions/pages/delete.php
@@ -30,7 +30,7 @@
]);
$db_prefix = elgg_get_config('dbprefix');
-$subtype_id = (int)get_subtype_id('object', 'page_top');
+$subtype_id = (int) get_subtype_id('object', 'page_top');
foreach ($children as $child) {
if ($parent) {
@@ -39,7 +39,7 @@
}
// If no parent, we need to transform $child to a page_top
- $child_guid = (int)$child->guid;
+ $child_guid = (int) $child->guid;
update_data("
UPDATE {$db_prefix}entities
@@ -47,10 +47,10 @@
WHERE guid = $child_guid
");
- elgg_delete_metadata(array(
+ elgg_delete_metadata([
'guid' => $child_guid,
'metadata_name' => 'parent_guid',
- ));
+ ]);
_elgg_invalidate_cache_for_entity($child_guid);
_elgg_invalidate_memcache_for_entity($child_guid);
diff --git a/mod/pages/actions/pages/edit.php b/mod/pages/actions/pages/edit.php
index cc595ae3f73..e1446ad2672 100644
--- a/mod/pages/actions/pages/edit.php
+++ b/mod/pages/actions/pages/edit.php
@@ -6,7 +6,7 @@
*/
$variables = elgg_get_config('pages');
-$input = array();
+$input = [];
foreach ($variables as $name => $type) {
if ($name == 'title') {
$input[$name] = htmlspecialchars(get_input($name, '', false), ENT_QUOTES, 'UTF-8');
@@ -19,9 +19,9 @@
}
// Get guids
-$page_guid = (int)get_input('page_guid');
-$container_guid = (int)get_input('container_guid');
-$parent_guid = (int)get_input('parent_guid');
+$page_guid = (int) get_input('page_guid');
+$container_guid = (int) get_input('container_guid');
+$parent_guid = (int) get_input('parent_guid');
elgg_make_sticky_form('page');
@@ -108,12 +108,12 @@
system_message(elgg_echo('pages:saved'));
if ($new_page) {
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/page/create',
'action_type' => 'create',
'subject_guid' => elgg_get_logged_in_user_guid(),
'object_guid' => $page->guid,
- ));
+ ]);
}
forward($page->getURL());
diff --git a/mod/pages/languages/da.php b/mod/pages/languages/da.php
index 90d9bf810de..c3324f9bb18 100644
--- a/mod/pages/languages/da.php
+++ b/mod/pages/languages/da.php
@@ -1,5 +1,5 @@
"Opret en underside",
'pages:backtoparent' => "Tilbage til '%s'",
-);
+];
diff --git a/mod/pages/languages/de.php b/mod/pages/languages/de.php
index 11df8a8ad94..268bb03849f 100644
--- a/mod/pages/languages/de.php
+++ b/mod/pages/languages/de.php
@@ -1,5 +1,5 @@
"Eine Unter-Coop-Seite erstellen",
'pages:backtoparent' => "Zurück zu '%s'",
-);
+];
diff --git a/mod/pages/languages/el.php b/mod/pages/languages/el.php
index 920048705b6..7a5679d34fb 100644
--- a/mod/pages/languages/el.php
+++ b/mod/pages/languages/el.php
@@ -1,5 +1,5 @@
"Δημιουργία υποσελίδας",
'pages:backtoparent' => "Επιστροφή σε '%s'",
-);
+];
diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php
index efc92d7d5d6..91648ae9260 100644
--- a/mod/pages/languages/en.php
+++ b/mod/pages/languages/en.php
@@ -1,5 +1,5 @@
"Create a sub-page",
'pages:backtoparent' => "Back to '%s'",
-);
+];
diff --git a/mod/pages/languages/es.php b/mod/pages/languages/es.php
index 2f33d480861..710227d248c 100644
--- a/mod/pages/languages/es.php
+++ b/mod/pages/languages/es.php
@@ -1,5 +1,5 @@
"Crear una subpágina",
'pages:backtoparent' => "Regresar a '%s'",
-);
+];
diff --git a/mod/pages/languages/eu_es.php b/mod/pages/languages/eu_es.php
index bdd59bf8dbf..e0d6ebedcfc 100644
--- a/mod/pages/languages/eu_es.php
+++ b/mod/pages/languages/eu_es.php
@@ -1,5 +1,5 @@
"Azpi-orria bat sortu",
'pages:backtoparent' => "'%s'-ra bueltatu",
-);
+];
diff --git a/mod/pages/languages/fi.php b/mod/pages/languages/fi.php
index 30686cdc17c..b9613366c77 100644
--- a/mod/pages/languages/fi.php
+++ b/mod/pages/languages/fi.php
@@ -1,5 +1,5 @@
"Luo alasivu",
'pages:backtoparent' => "Takaisin sivulle '%s'",
-);
+];
diff --git a/mod/pages/languages/fr.php b/mod/pages/languages/fr.php
index 39bad718f70..955df7f0fbe 100644
--- a/mod/pages/languages/fr.php
+++ b/mod/pages/languages/fr.php
@@ -1,5 +1,5 @@
"Créer une sous-page",
'pages:backtoparent' => "Retour à \"%s\"",
-);
+];
diff --git a/mod/pages/languages/gl.php b/mod/pages/languages/gl.php
index fd3f29773a7..fc50ce340f5 100644
--- a/mod/pages/languages/gl.php
+++ b/mod/pages/languages/gl.php
@@ -1,5 +1,5 @@
"Crear unha subpáxina",
'pages:backtoparent' => "Volver a «%s»",
-);
+];
diff --git a/mod/pages/languages/it.php b/mod/pages/languages/it.php
index 491a4d20890..86af609cc5a 100644
--- a/mod/pages/languages/it.php
+++ b/mod/pages/languages/it.php
@@ -1,5 +1,5 @@
"Crea una sotto-pagina",
'pages:backtoparent' => "Torna a '%s'",
-);
+];
diff --git a/mod/pages/languages/ja.php b/mod/pages/languages/ja.php
index 666f4b039f4..a6b988c5835 100644
--- a/mod/pages/languages/ja.php
+++ b/mod/pages/languages/ja.php
@@ -1,5 +1,5 @@
"子ページを作成",
'pages:backtoparent' => "「 %s 」にもどる",
-);
+];
diff --git a/mod/pages/languages/ko.php b/mod/pages/languages/ko.php
index da2262f22cb..312c4a0a5ac 100644
--- a/mod/pages/languages/ko.php
+++ b/mod/pages/languages/ko.php
@@ -1,5 +1,5 @@
"하위 페이지 만들기",
'pages:backtoparent' => "'%s'로 돌아감",
-);
+];
diff --git a/mod/pages/languages/nl.php b/mod/pages/languages/nl.php
index 4e4ce6728ce..b803cd3676d 100644
--- a/mod/pages/languages/nl.php
+++ b/mod/pages/languages/nl.php
@@ -1,5 +1,5 @@
"Maak een subpagina",
'pages:backtoparent' => "Terug naar '%s'",
-);
+];
diff --git a/mod/pages/languages/pl.php b/mod/pages/languages/pl.php
index 6b91a313429..626c6c0b123 100644
--- a/mod/pages/languages/pl.php
+++ b/mod/pages/languages/pl.php
@@ -1,5 +1,5 @@
"Utwórz podstronę",
'pages:backtoparent' => "Wróć do '%s'",
-);
+];
diff --git a/mod/pages/languages/pt_br.php b/mod/pages/languages/pt_br.php
index 3af26e8f3aa..be80e94312b 100644
--- a/mod/pages/languages/pt_br.php
+++ b/mod/pages/languages/pt_br.php
@@ -1,5 +1,5 @@
"Criar uma sub-página colaborativa (wiki)",
'pages:backtoparent' => "Voltar para '%s'",
-);
+];
diff --git a/mod/pages/languages/ru.php b/mod/pages/languages/ru.php
index a663937e55f..f6366ce2547 100644
--- a/mod/pages/languages/ru.php
+++ b/mod/pages/languages/ru.php
@@ -1,5 +1,5 @@
"Создать дочерний документ",
'pages:backtoparent' => "Назад к '%s'",
-);
+];
diff --git a/mod/pages/languages/sr.php b/mod/pages/languages/sr.php
index c696b1e9392..ecaa797d798 100644
--- a/mod/pages/languages/sr.php
+++ b/mod/pages/languages/sr.php
@@ -1,5 +1,5 @@
"Направи под-страну",
'pages:backtoparent' => "Назад на '%s'",
-);
+];
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php
index bd8de37e40f..1f2802ffd66 100644
--- a/mod/pages/lib/pages.php
+++ b/mod/pages/lib/pages.php
@@ -14,7 +14,7 @@
function pages_prepare_form_vars($page = null, $parent_guid = 0, $revision = null) {
// input names => defaults
- $values = array(
+ $values = [
'title' => '',
'description' => '',
'access_id' => ACCESS_DEFAULT,
@@ -24,7 +24,7 @@ function pages_prepare_form_vars($page = null, $parent_guid = 0, $revision = nul
'guid' => null,
'entity' => $page,
'parent_guid' => $parent_guid,
- );
+ ];
if ($page) {
foreach (array_keys($values) as $field) {
@@ -58,7 +58,7 @@ function pages_prepare_form_vars($page = null, $parent_guid = 0, $revision = nul
*/
function pages_prepare_parent_breadcrumbs($page) {
if ($page && $page->parent_guid) {
- $parents = array();
+ $parents = [];
$parent = get_entity($page->parent_guid);
while ($parent) {
array_push($parents, $parent);
@@ -83,47 +83,47 @@ function pages_get_navigation_tree($container) {
return;
}
- $top_pages = new ElggBatch('elgg_get_entities', array(
+ $top_pages = new ElggBatch('elgg_get_entities', [
'type' => 'object',
'subtype' => 'page_top',
'container_guid' => $container->getGUID(),
'limit' => false,
- ));
+ ]);
/* @var ElggBatch $top_pages Batch of top level pages */
- $tree = array();
- $depths = array();
+ $tree = [];
+ $depths = [];
foreach ($top_pages as $page) {
- $tree[] = array(
+ $tree[] = [
'guid' => $page->getGUID(),
'title' => $page->title,
'url' => $page->getURL(),
'depth' => 0,
- );
+ ];
$depths[$page->guid] = 0;
- $stack = array();
+ $stack = [];
array_push($stack, $page);
while (count($stack) > 0) {
$parent = array_pop($stack);
- $children = new ElggBatch('elgg_get_entities_from_metadata', array(
+ $children = new ElggBatch('elgg_get_entities_from_metadata', [
'type' => 'object',
'subtype' => 'page',
'metadata_name' => 'parent_guid',
'metadata_value' => $parent->getGUID(),
'limit' => false,
- ));
+ ]);
foreach ($children as $child) {
- $tree[] = array(
+ $tree[] = [
'guid' => $child->getGUID(),
'title' => $child->title,
'url' => $child->getURL(),
'parent_guid' => $parent->getGUID(),
'depth' => $depths[$parent->guid] + 1,
- );
+ ];
$depths[$child->guid] = $depths[$parent->guid] + 1;
array_push($stack, $child);
}
@@ -141,12 +141,12 @@ function pages_register_navigation_tree($container) {
$pages = pages_get_navigation_tree($container);
if ($pages) {
foreach ($pages as $page) {
- elgg_register_menu_item('pages_nav', array(
+ elgg_register_menu_item('pages_nav', [
'name' => $page['guid'],
'text' => $page['title'],
'href' => $page['url'],
'parent_name' => elgg_extract('parent_guid', $page),
- ));
+ ]);
}
}
}
diff --git a/mod/pages/start.php b/mod/pages/start.php
index d7b402a10e6..680b3f7a8db 100644
--- a/mod/pages/start.php
+++ b/mod/pages/start.php
@@ -30,11 +30,11 @@ function pages_init() {
// Extend the main css view
elgg_extend_view('elgg.css', 'pages/css');
- elgg_define_js('jquery.treeview', array(
+ elgg_define_js('jquery.treeview', [
'src' => '/mod/pages/vendors/jquery-treeview/jquery.treeview.min.js',
'exports' => 'jQuery.fn.treeview',
- 'deps' => array('jquery'),
- ));
+ 'deps' => ['jquery'],
+ ]);
$css_url = 'mod/pages/vendors/jquery-treeview/jquery.treeview.css';
elgg_register_css('jquery.treeview', $css_url);
@@ -52,14 +52,14 @@ function pages_init() {
// Language short codes must be of the form "pages:key"
// where key is the array key below
- elgg_set_config('pages', array(
+ elgg_set_config('pages', [
'title' => 'text',
'description' => 'longtext',
'tags' => 'tags',
'parent_guid' => 'parent',
'access_id' => 'access',
'write_access_id' => 'access',
- ));
+ ]);
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'pages_owner_block_menu');
@@ -259,12 +259,12 @@ function pages_entity_menu_setup($hook, $type, $return, $params) {
}
}
- $options = array(
+ $options = [
'name' => 'history',
'text' => elgg_echo('pages:history'),
'href' => "pages/history/$entity->guid",
'priority' => 150,
- );
+ ];
$return[] = ElggMenuItem::factory($options);
return $return;
@@ -289,14 +289,14 @@ function pages_prepare_notification($hook, $type, $notification, $params) {
$descr = $entity->description;
$title = $entity->title;
- $notification->subject = elgg_echo('pages:notify:subject', array($title), $language);
- $notification->body = elgg_echo('pages:notify:body', array(
+ $notification->subject = elgg_echo('pages:notify:subject', [$title], $language);
+ $notification->body = elgg_echo('pages:notify:body', [
$owner->name,
$title,
$descr,
$entity->getURL(),
- ), $language);
- $notification->summary = elgg_echo('pages:notify:summary', array($entity->title), $language);
+ ], $language);
+ $notification->summary = elgg_echo('pages:notify:summary', [$entity->title], $language);
$notification->url = $entity->getURL();
return $notification;
}
@@ -417,7 +417,7 @@ function pages_ecml_views_hook($hook, $entity_type, $return_value, $params) {
* @access private
*/
function pages_is_page($value) {
- return ($value instanceof ElggObject) && in_array($value->getSubtype(), array('page', 'page_top'));
+ return ($value instanceof ElggObject) && in_array($value->getSubtype(), ['page', 'page_top']);
}
/**
@@ -432,7 +432,7 @@ function pages_is_page($value) {
*/
function pages_write_access_options_hook($hook, $type, $return_value, $params) {
if (empty($params['input_params']['entity_subtype'])
- || !in_array($params['input_params']['entity_subtype'], array('page', 'page_top'))) {
+ || !in_array($params['input_params']['entity_subtype'], ['page', 'page_top'])) {
return null;
}
@@ -498,8 +498,8 @@ function pages_search_pages($hook, $type, $value, $params) {
}
unset($params["subtype"]);
- $params["subtypes"] = array("page_top", "page");
+ $params["subtypes"] = ["page_top", "page"];
// trigger the 'normal' object search as it can handle the added options
- return elgg_trigger_plugin_hook('search', 'object', $params, array());
+ return elgg_trigger_plugin_hook('search', 'object', $params, []);
}
diff --git a/mod/pages/views/default/annotation/page.php b/mod/pages/views/default/annotation/page.php
index daa2ba35bcb..47feb0a96d3 100644
--- a/mod/pages/views/default/annotation/page.php
+++ b/mod/pages/views/default/annotation/page.php
@@ -11,31 +11,31 @@
return;
}
-$icon = elgg_view("pages/icon", array(
+$icon = elgg_view("pages/icon", [
'annotation' => $annotation,
'size' => 'small',
-));
+]);
$owner_guid = $annotation->owner_guid;
$owner = get_entity($owner_guid);
if (!$owner) {
return;
}
-$owner_link = elgg_view('output/url', array(
+$owner_link = elgg_view('output/url', [
'href' => $owner->getURL(),
'text' => $owner->name,
'is_trusted' => true,
-));
+]);
$date = elgg_view_friendly_time($annotation->time_created);
-$title_link = elgg_view('output/url', array(
+$title_link = elgg_view('output/url', [
'href' => $annotation->getURL(),
'text' => $page->title,
'is_trusted' => true,
-));
+]);
-$subtitle = elgg_echo('pages:revision:subtitle', array($date, $owner_link));
+$subtitle = elgg_echo('pages:revision:subtitle', [$date, $owner_link]);
$body = <<< HTML
$title_link
@@ -45,11 +45,11 @@
$menu = '';
if (!elgg_in_context('widgets')) {
// only show annotation menu outside of widgets
- $menu = elgg_view_menu('annotation', array(
+ $menu = elgg_view_menu('annotation', [
'annotation' => $annotation,
'sort_by' => 'priority',
'class' => 'elgg-menu-hz float-alt',
- ));
+ ]);
}
$body = <<
HTML;
-echo elgg_view_image_block($icon, $body);
\ No newline at end of file
+echo elgg_view_image_block($icon, $body);
diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php
index 5947091ded3..fed5bee6b73 100644
--- a/mod/pages/views/default/forms/pages/edit.php
+++ b/mod/pages/views/default/forms/pages/edit.php
@@ -34,15 +34,15 @@
';
- }
+ if ($type != 'longtext') {
+ echo '
';
+ }
- $view_vars = array(
+ $view_vars = [
'name' => $name,
'value' => $vars[$name],
'entity' => ($name == 'parent_guid') ? $vars['entity'] : null,
- );
+ ];
if ($input_view === 'input/access') {
$view_vars['entity'] = $entity;
$view_vars['entity_type'] = 'object';
@@ -73,22 +73,22 @@
echo '';
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index a90a63cefef..810c7b1fc36 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -10,12 +10,12 @@
*/
-$full = elgg_extract('full_view', $vars, FALSE);
-$page = elgg_extract('entity', $vars, FALSE);
-$revision = elgg_extract('revision', $vars, FALSE);
+$full = elgg_extract('full_view', $vars, false);
+$page = elgg_extract('entity', $vars, false);
+$revision = elgg_extract('revision', $vars, false);
if (!$page) {
- return TRUE;
+ return true;
}
// pages used to use Public for write access
@@ -28,11 +28,11 @@
if ($revision) {
$annotation = $revision;
} else {
- $annotation = $page->getAnnotations(array(
+ $annotation = $page->getAnnotations([
'annotation_name' => 'page',
'limit' => 1,
'reverse_order_by' => true,
- ));
+ ]);
if ($annotation) {
$annotation = $annotation[0];
} else {
@@ -41,7 +41,7 @@
}
}
-$page_icon = elgg_view('pages/icon', array('annotation' => $annotation, 'size' => 'small'));
+$page_icon = elgg_view('pages/icon', ['annotation' => $annotation, 'size' => 'small']);
$editor_text = elgg_view('object/elements/imprint', $vars);
$categories = elgg_view('output/categories', $vars);
@@ -50,11 +50,11 @@
//only display if there are commments
if ($comments_count != 0 && !$revision) {
$text = elgg_echo("comments") . " ($comments_count)";
- $comments_link = elgg_view('output/url', array(
+ $comments_link = elgg_view('output/url', [
'href' => $page->getURL() . '#comments',
'text' => $text,
'is_trusted' => true,
- ));
+ ]);
} else {
$comments_link = '';
}
@@ -66,31 +66,31 @@
if (!elgg_in_context('widgets')) {
// If we're looking at a revision, display annotation menu
if ($revision) {
- $metadata = elgg_view_menu('annotation', array(
+ $metadata = elgg_view_menu('annotation', [
'annotation' => $annotation,
'sort_by' => 'priority',
'class' => 'elgg-menu-hz float-alt',
- ));
+ ]);
} else {
// Regular entity menu
- $metadata = elgg_view_menu('entity', array(
+ $metadata = elgg_view_menu('entity', [
'entity' => $vars['entity'],
'handler' => 'pages',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
}
if ($full) {
- $body = elgg_view('output/longtext', array('value' => $annotation->value));
+ $body = elgg_view('output/longtext', ['value' => $annotation->value]);
- $params = array(
+ $params = [
'entity' => $page,
'metadata' => $metadata,
'title' => false,
'subtitle' => $subtitle,
- );
+ ];
$params = $params + $vars;
$summary = elgg_view('object/elements/summary', $params);
@@ -100,27 +100,25 @@
$responses = elgg_view_comments($page);
}
- echo elgg_view('object/elements/full', array(
+ echo elgg_view('object/elements/full', [
'entity' => $page,
'icon' => $page_icon,
'summary' => $summary,
'body' => $body,
'responses' => $responses,
- ));
-
+ ]);
} else {
// brief view
$excerpt = elgg_get_excerpt($page->description);
- $params = array(
+ $params = [
'entity' => $page,
'metadata' => $metadata,
'subtitle' => $subtitle,
'content' => $excerpt,
'icon' => $page_icon,
- );
+ ];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
-
}
diff --git a/mod/pages/views/default/pages/group_module.php b/mod/pages/views/default/pages/group_module.php
index 642aa0c6269..fd7a79e1bfd 100644
--- a/mod/pages/views/default/pages/group_module.php
+++ b/mod/pages/views/default/pages/group_module.php
@@ -12,15 +12,15 @@
return true;
}
-$all_link = elgg_view('output/url', array(
+$all_link = elgg_view('output/url', [
'href' => "pages/group/$group->guid/all",
'text' => elgg_echo('link:view:all'),
'is_trusted' => true,
-));
+]);
elgg_push_context('widgets');
-$options = array(
+$options = [
'type' => 'object',
'subtype' => 'page_top',
'container_guid' => elgg_get_page_owner_guid(),
@@ -28,19 +28,19 @@
'full_view' => false,
'pagination' => false,
'no_results' => elgg_echo('pages:none'),
-);
+];
$content = elgg_list_entities($options);
elgg_pop_context();
-$new_link = elgg_view('output/url', array(
+$new_link = elgg_view('output/url', [
'href' => "pages/add/$group->guid",
'text' => elgg_echo('pages:add'),
'is_trusted' => true,
-));
+]);
-echo elgg_view('groups/profile/module', array(
+echo elgg_view('groups/profile/module', [
'title' => elgg_echo('pages:group'),
'content' => $content,
'all_link' => $all_link,
'add_link' => $new_link,
-));
+]);
diff --git a/mod/pages/views/default/pages/icon.php b/mod/pages/views/default/pages/icon.php
index cba034ec40d..bec2578df0e 100644
--- a/mod/pages/views/default/pages/icon.php
+++ b/mod/pages/views/default/pages/icon.php
@@ -14,7 +14,7 @@
$entity = get_entity($annotation->entity_guid);
// Get size
-if (!in_array($vars['size'], array('small', 'medium', 'large', 'tiny', 'master', 'topbar'))) {
+if (!in_array($vars['size'], ['small', 'medium', 'large', 'tiny', 'master', 'topbar'])) {
$vars['size'] = "medium";
}
diff --git a/mod/pages/views/default/pages/input/parent.php b/mod/pages/views/default/pages/input/parent.php
index c5ee3c3fb73..d76e82bf7ab 100644
--- a/mod/pages/views/default/pages/input/parent.php
+++ b/mod/pages/views/default/pages/input/parent.php
@@ -17,7 +17,7 @@
}
$pages = pages_get_navigation_tree($container);
-$options = array();
+$options = [];
foreach ($pages as $page) {
$spacing = "";
@@ -27,10 +27,10 @@
$options[$page['guid']] = "$spacing " . $page['title'];
}
-$defaults = array(
+$defaults = [
'class' => 'elgg-pages-input-parent-picker',
'options_values' => $options,
-);
+];
$vars = array_merge($defaults, $vars);
diff --git a/mod/pages/views/default/pages/sidebar.php b/mod/pages/views/default/pages/sidebar.php
index a67863d5f2c..551870d2c62 100644
--- a/mod/pages/views/default/pages/sidebar.php
+++ b/mod/pages/views/default/pages/sidebar.php
@@ -3,12 +3,12 @@
* Pages sidebar
*/
-echo elgg_view('page/elements/comments_block', array(
- 'subtypes' => array('page', 'page_top'),
+echo elgg_view('page/elements/comments_block', [
+ 'subtypes' => ['page', 'page_top'],
'container_guid' => elgg_get_page_owner_guid(),
-));
+]);
-echo elgg_view('page/elements/tagcloud_block', array(
- 'subtypes' => array('page', 'page_top'),
+echo elgg_view('page/elements/tagcloud_block', [
+ 'subtypes' => ['page', 'page_top'],
'container_guid' => elgg_get_page_owner_guid(),
-));
\ No newline at end of file
+]);
diff --git a/mod/pages/views/default/pages/sidebar/history.php b/mod/pages/views/default/pages/sidebar/history.php
index 5dff41c346b..a0dc8c4b551 100644
--- a/mod/pages/views/default/pages/sidebar/history.php
+++ b/mod/pages/views/default/pages/sidebar/history.php
@@ -8,14 +8,14 @@
$title = elgg_echo('pages:history');
if ($vars['page']) {
- $options = array(
+ $options = [
'guid' => $vars['page']->guid,
'annotation_name' => 'page',
'limit' => max(20, elgg_get_config('default_limit')),
'reverse_order_by' => true
- );
+ ];
elgg_push_context('widgets');
$content = elgg_list_annotations($options);
}
-echo elgg_view_module('aside', $title, $content);
\ No newline at end of file
+echo elgg_view_module('aside', $title, $content);
diff --git a/mod/pages/views/default/pages/sidebar/navigation.php b/mod/pages/views/default/pages/sidebar/navigation.php
index e0e6d47bbf9..89d4f492042 100644
--- a/mod/pages/views/default/pages/sidebar/navigation.php
+++ b/mod/pages/views/default/pages/sidebar/navigation.php
@@ -18,7 +18,7 @@
pages_register_navigation_tree(elgg_get_page_owner_entity());
-$content = elgg_view_menu('pages_nav', array('class' => 'pages-nav'));
+$content = elgg_view_menu('pages_nav', ['class' => 'pages-nav']);
if (!$content) {
$content = '
' . elgg_echo('pages:none') . '
';
}
diff --git a/mod/pages/views/default/resources/pages/all.php b/mod/pages/views/default/resources/pages/all.php
index 9468fa354d8..2260e7e27c0 100644
--- a/mod/pages/views/default/resources/pages/all.php
+++ b/mod/pages/views/default/resources/pages/all.php
@@ -12,20 +12,20 @@
elgg_register_title_button('pages', 'add', 'object', 'page_top');
-$content = elgg_list_entities(array(
+$content = elgg_list_entities([
'type' => 'object',
'subtype' => 'page_top',
'full_view' => false,
'no_results' => elgg_echo('pages:none'),
'preload_owners' => true,
'preload_containers' => true,
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => 'all',
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('pages/sidebar'),
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/pages/views/default/resources/pages/edit.php b/mod/pages/views/default/resources/pages/edit.php
index 55c57da39d5..733420693b3 100644
--- a/mod/pages/views/default/resources/pages/edit.php
+++ b/mod/pages/views/default/resources/pages/edit.php
@@ -7,7 +7,7 @@
elgg_gatekeeper();
-$page_guid = (int)elgg_extract('guid', $vars);
+$page_guid = (int) elgg_extract('guid', $vars);
$page = get_entity($page_guid);
if (!pages_is_page($page)) {
register_error(elgg_echo('noaccess'));
@@ -28,18 +28,17 @@
$title = elgg_echo("pages:edit");
if ($page->canEdit()) {
-
$vars = pages_prepare_form_vars($page, $page->parent_guid);
- $content = elgg_view_form('pages/edit', array(), $vars);
+ $content = elgg_view_form('pages/edit', [], $vars);
} else {
$content = elgg_echo("pages:noaccess");
}
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/pages/views/default/resources/pages/friends.php b/mod/pages/views/default/resources/pages/friends.php
index 8239a4b891e..457239df6dc 100644
--- a/mod/pages/views/default/resources/pages/friends.php
+++ b/mod/pages/views/default/resources/pages/friends.php
@@ -17,7 +17,7 @@
$title = elgg_echo('pages:friends');
-$content = elgg_list_entities_from_relationship(array(
+$content = elgg_list_entities_from_relationship([
'type' => 'object',
'subtype' => 'page_top',
'full_view' => false,
@@ -27,13 +27,13 @@
'no_results' => elgg_echo('pages:none'),
'preload_owners' => true,
'preload_containers' => true,
-));
+]);
-$params = array(
+$params = [
'filter_context' => 'friends',
'content' => $content,
'title' => $title,
-);
+];
$body = elgg_view_layout('content', $params);
diff --git a/mod/pages/views/default/resources/pages/history.php b/mod/pages/views/default/resources/pages/history.php
index d252d05c0d2..fbd7727143a 100644
--- a/mod/pages/views/default/resources/pages/history.php
+++ b/mod/pages/views/default/resources/pages/history.php
@@ -30,18 +30,18 @@
$title = $page->title . ": " . elgg_echo('pages:history');
-$content = elgg_list_annotations(array(
+$content = elgg_list_annotations([
'guid' => $page_guid,
'annotation_name' => 'page',
'limit' => max(20, elgg_get_config('default_limit')),
'order_by' => "n_table.time_created desc",
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
- 'sidebar' => elgg_view('pages/sidebar/navigation', array('page' => $page)),
-));
+ 'sidebar' => elgg_view('pages/sidebar/navigation', ['page' => $page]),
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/pages/views/default/resources/pages/new.php b/mod/pages/views/default/resources/pages/new.php
index 2e58bf44587..9e9a015e873 100644
--- a/mod/pages/views/default/resources/pages/new.php
+++ b/mod/pages/views/default/resources/pages/new.php
@@ -26,12 +26,12 @@
elgg_push_breadcrumb($title);
$vars = pages_prepare_form_vars(null, $parent_guid);
-$content = elgg_view_form('pages/edit', array(), $vars);
+$content = elgg_view_form('pages/edit', [], $vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/pages/views/default/resources/pages/owner.php b/mod/pages/views/default/resources/pages/owner.php
index 41ffd288836..94bd7db6ecf 100644
--- a/mod/pages/views/default/resources/pages/owner.php
+++ b/mod/pages/views/default/resources/pages/owner.php
@@ -13,20 +13,20 @@
// access check for closed groups
elgg_group_gatekeeper();
-$title = elgg_echo('pages:owner', array($owner->name));
+$title = elgg_echo('pages:owner', [$owner->name]);
elgg_push_breadcrumb($owner->name);
elgg_register_title_button('pages', 'add', 'object', 'page_top');
-$content = elgg_list_entities(array(
+$content = elgg_list_entities([
'type' => 'object',
'subtype' => 'page_top',
'container_guid' => elgg_get_page_owner_guid(),
'full_view' => false,
'no_results' => elgg_echo('pages:none'),
'preload_owners' => true,
-));
+]);
$filter_context = '';
if (elgg_get_page_owner_guid() == elgg_get_logged_in_user_guid()) {
@@ -36,12 +36,12 @@
$sidebar = elgg_view('pages/sidebar/navigation');
$sidebar .= elgg_view('pages/sidebar');
-$params = array(
+$params = [
'filter_context' => $filter_context,
'content' => $content,
'title' => $title,
'sidebar' => $sidebar,
-);
+];
if (elgg_instanceof($owner, 'group')) {
$params['filter'] = '';
diff --git a/mod/pages/views/default/resources/pages/revision.php b/mod/pages/views/default/resources/pages/revision.php
index 096c27c4552..6f914482b48 100644
--- a/mod/pages/views/default/resources/pages/revision.php
+++ b/mod/pages/views/default/resources/pages/revision.php
@@ -36,19 +36,19 @@
elgg_push_breadcrumb($page->title, $page->getURL());
elgg_push_breadcrumb(elgg_echo('pages:revision'));
-$content = elgg_view('object/page_top', array(
+$content = elgg_view('object/page_top', [
'entity' => $page,
'revision' => $annotation,
'full_view' => true,
-));
+]);
-$sidebar = elgg_view('pages/sidebar/history', array('page' => $page));
+$sidebar = elgg_view('pages/sidebar/history', ['page' => $page]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
'sidebar' => $sidebar,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/pages/views/default/resources/pages/view.php b/mod/pages/views/default/resources/pages/view.php
index e3a692210ff..829d1135de0 100644
--- a/mod/pages/views/default/resources/pages/view.php
+++ b/mod/pages/views/default/resources/pages/view.php
@@ -41,19 +41,19 @@
// can add subpage if can edit this page and write to container (such as a group)
if ($page->canEdit() && $container->canWriteToContainer(0, 'object', 'page')) {
$url = "pages/add/$page->guid";
- elgg_register_menu_item('title', array(
+ elgg_register_menu_item('title', [
'name' => 'subpage',
'href' => $url,
'text' => elgg_echo('pages:newchild'),
'link_class' => 'elgg-button elgg-button-action',
- ));
+ ]);
}
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => '',
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('pages/sidebar/navigation'),
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php
index 27585c1a911..a3064d2d705 100644
--- a/mod/pages/views/default/river/object/page/create.php
+++ b/mod/pages/views/default/river/object/page/create.php
@@ -10,7 +10,7 @@
$excerpt = strip_tags($object->description);
$excerpt = elgg_get_excerpt($excerpt);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => $excerpt,
-));
\ No newline at end of file
+]);
diff --git a/mod/pages/views/default/river/object/page_top/create.php b/mod/pages/views/default/river/object/page_top/create.php
index b89eed195bc..9b7821b68d6 100644
--- a/mod/pages/views/default/river/object/page_top/create.php
+++ b/mod/pages/views/default/river/object/page_top/create.php
@@ -5,4 +5,4 @@
* @package ElggPages
*/
-echo elgg_view('river/object/page/create', $vars);
\ No newline at end of file
+echo elgg_view('river/object/page/create', $vars);
diff --git a/mod/pages/views/rss/annotation/page.php b/mod/pages/views/rss/annotation/page.php
index e0f021e7667..5978b4c22ff 100644
--- a/mod/pages/views/rss/annotation/page.php
+++ b/mod/pages/views/rss/annotation/page.php
@@ -13,9 +13,9 @@
$pubdate = date('r', $revision->getTimeCreated());
$permalink = $revision->getURL();
-$title = elgg_echo('pages:revision:subtitle', array('', $poster_name));
+$title = elgg_echo('pages:revision:subtitle', ['', $poster_name]);
-$creator = elgg_view('page/components/creator', array('entity' => $revision));
+$creator = elgg_view('page/components/creator', ['entity' => $revision]);
$extensions = elgg_view('pages/extensions/item', $vars);
$item = <<<__HTML
diff --git a/mod/profile/languages/ca.php b/mod/profile/languages/ca.php
index f0ec95ea066..7423490ff55 100644
--- a/mod/profile/languages/ca.php
+++ b/mod/profile/languages/ca.php
@@ -1,6 +1,6 @@
'Perfil',
'profile:notfound' => 'Ep!, no trobem aquest perfil',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/cmn.php b/mod/profile/languages/cmn.php
index bd734297013..a550a88f2f8 100644
--- a/mod/profile/languages/cmn.php
+++ b/mod/profile/languages/cmn.php
@@ -1,6 +1,6 @@
'側寫',
'profile:notfound' => '抱歉。我們找不到要求的側寫。',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/da.php b/mod/profile/languages/da.php
index df130b97eea..86cffd86072 100644
--- a/mod/profile/languages/da.php
+++ b/mod/profile/languages/da.php
@@ -1,6 +1,6 @@
'Profil',
'profile:notfound' => 'Beklager, vi kunne ikke finde den ønskede profil.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/de.php b/mod/profile/languages/de.php
index cb137c54944..4d5fb8e5489 100644
--- a/mod/profile/languages/de.php
+++ b/mod/profile/languages/de.php
@@ -1,6 +1,6 @@
'Profil',
'profile:notfound' => 'Entschuldigung, wir konnten das gesuchte Profil nicht finden.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/el.php b/mod/profile/languages/el.php
index 22963a77afa..c3e9d16a68e 100644
--- a/mod/profile/languages/el.php
+++ b/mod/profile/languages/el.php
@@ -1,6 +1,6 @@
'Προφίλ',
'profile:notfound' => 'Δεν βρέθηκε το προφίλ που ζητήσατε.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/en.php b/mod/profile/languages/en.php
index b91d730248f..607ab60a995 100644
--- a/mod/profile/languages/en.php
+++ b/mod/profile/languages/en.php
@@ -1,6 +1,6 @@
'Profile',
'profile:notfound' => 'Sorry. We could not find the requested profile.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/es.php b/mod/profile/languages/es.php
index fd5a8a283da..30883580ce8 100644
--- a/mod/profile/languages/es.php
+++ b/mod/profile/languages/es.php
@@ -1,6 +1,6 @@
'Perfil',
'profile:notfound' => 'No se puede encontrar el perfil solicitado.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/eu_es.php b/mod/profile/languages/eu_es.php
index e623b12029f..8ef8fb61d28 100644
--- a/mod/profile/languages/eu_es.php
+++ b/mod/profile/languages/eu_es.php
@@ -1,6 +1,6 @@
'Profila',
'profile:notfound' => 'Barkatu. Ezin dugu bilatu eskatzen ari zaren profila.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/fi.php b/mod/profile/languages/fi.php
index cd14c1532ee..3049fbce1c3 100644
--- a/mod/profile/languages/fi.php
+++ b/mod/profile/languages/fi.php
@@ -1,6 +1,6 @@
'Profiili',
'profile:notfound' => 'Hakemaasi profiilia ei löytynyt.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/fr.php b/mod/profile/languages/fr.php
index e26168cc47e..929b4c451af 100644
--- a/mod/profile/languages/fr.php
+++ b/mod/profile/languages/fr.php
@@ -1,6 +1,6 @@
'Profil',
'profile:notfound' => 'Désolé, nous n\'avons pas pu trouver le profil demandé.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/gl.php b/mod/profile/languages/gl.php
index f4a5d26b3c1..9cf3e0658ea 100644
--- a/mod/profile/languages/gl.php
+++ b/mod/profile/languages/gl.php
@@ -1,6 +1,6 @@
'Perfi',
'profile:notfound' => 'Non foi posíbel atopar o perfil indicado.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/it.php b/mod/profile/languages/it.php
index a8ac4a60401..72fb3f09242 100644
--- a/mod/profile/languages/it.php
+++ b/mod/profile/languages/it.php
@@ -1,6 +1,6 @@
'Profilo',
'profile:notfound' => 'Spiacenti ma è impossibile trovare il profilo richiesto.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/ja.php b/mod/profile/languages/ja.php
index 0c7d7af6d56..db6608f63a1 100644
--- a/mod/profile/languages/ja.php
+++ b/mod/profile/languages/ja.php
@@ -1,6 +1,6 @@
'プロフィール',
'profile:notfound' => '申し訳ありません、お探しのプロフィールを見つけることができませんでした。',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/ko.php b/mod/profile/languages/ko.php
index f6708562781..d844c2f8114 100644
--- a/mod/profile/languages/ko.php
+++ b/mod/profile/languages/ko.php
@@ -1,6 +1,6 @@
'신상',
'profile:notfound' => '미안합니다. 요청된 신상정보를 찾을 수 없었습니다.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/nl.php b/mod/profile/languages/nl.php
index 46110bfdca4..db4ec8f3e35 100644
--- a/mod/profile/languages/nl.php
+++ b/mod/profile/languages/nl.php
@@ -1,6 +1,6 @@
'Profiel',
'profile:notfound' => 'Sorry. Het opgegeven profiel kon niet gevonden worden.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/pl.php b/mod/profile/languages/pl.php
index ebe69de922d..f18caccac77 100644
--- a/mod/profile/languages/pl.php
+++ b/mod/profile/languages/pl.php
@@ -1,6 +1,6 @@
'Profil',
'profile:notfound' => 'Przepraszamy. Nie można znaleźć określonego profilu.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/pt_br.php b/mod/profile/languages/pt_br.php
index 4e790f7230b..e6fd0379463 100644
--- a/mod/profile/languages/pt_br.php
+++ b/mod/profile/languages/pt_br.php
@@ -1,6 +1,6 @@
'Perfil',
'profile:notfound' => 'Desculpe. Não foi possível encontrar o perfil especificado.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/ru.php b/mod/profile/languages/ru.php
index 7b852531407..811e87d99fd 100644
--- a/mod/profile/languages/ru.php
+++ b/mod/profile/languages/ru.php
@@ -1,6 +1,6 @@
'Профиль',
'profile:notfound' => 'Извините, не удается найти указанный профиль.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/sr.php b/mod/profile/languages/sr.php
index b4d2dd60127..38f50d63b10 100644
--- a/mod/profile/languages/sr.php
+++ b/mod/profile/languages/sr.php
@@ -1,6 +1,6 @@
'Профил',
'profile:notfound' => 'Извините. Нисмо успели да пронађемо профил.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/tr.php b/mod/profile/languages/tr.php
index 699a9dd2213..12c3f29b46b 100644
--- a/mod/profile/languages/tr.php
+++ b/mod/profile/languages/tr.php
@@ -1,6 +1,6 @@
'Profil',
'profile:notfound' => 'Üzgünüz. İstediğiniz profili bulamadık.',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/languages/zh_hans.php b/mod/profile/languages/zh_hans.php
index b511e08de21..c50a2852d1e 100644
--- a/mod/profile/languages/zh_hans.php
+++ b/mod/profile/languages/zh_hans.php
@@ -1,6 +1,6 @@
'简历',
'profile:notfound' => '抱歉,未找到该简历。',
-);
\ No newline at end of file
+];
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 2d398bce685..8c886a89c09 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -55,7 +55,7 @@ function profile_page_handler($page) {
forward();
}
- $action = NULL;
+ $action = null;
if (isset($page[1])) {
$action = $page[1];
}
@@ -109,7 +109,7 @@ function profile_ecml_views_hook($hook, $entity_type, $return_value) {
* @return array
*/
function profile_default_widgets_hook($hook, $type, $return) {
- $return[] = array(
+ $return[] = [
'name' => elgg_echo('profile'),
'widget_context' => 'profile',
'widget_columns' => 2,
@@ -117,7 +117,7 @@ function profile_default_widgets_hook($hook, $type, $return) {
'event' => 'create',
'entity_type' => 'user',
'entity_subtype' => ELGG_ENTITIES_ANY_VALUE,
- );
+ ];
return $return;
}
@@ -147,11 +147,11 @@ function _profile_topbar_menu($hook, $type, $return, $params) {
'href' => $viewer->getURL(),
'text' => $viewer->name,
'title' => elgg_echo('profile'),
- 'icon' => elgg_view('output/img', array(
+ 'icon' => elgg_view('output/img', [
'src' => $viewer->getIconURL('topbar'),
'alt' => $viewer->name,
'class' => 'elgg-border-plain elgg-transition',
- )),
+ ]),
'priority' => 100,
]);
diff --git a/mod/profile/views/default/profile/css.php b/mod/profile/views/default/profile/css.php
index fe4877ad809..74be11d0b16 100644
--- a/mod/profile/views/default/profile/css.php
+++ b/mod/profile/views/default/profile/css.php
@@ -71,4 +71,4 @@
display: block;
float: left;
}
-}
\ No newline at end of file
+}
diff --git a/mod/profile/views/default/profile/details.php b/mod/profile/views/default/profile/details.php
index f63b33f7412..a4fb98d74cc 100644
--- a/mod/profile/views/default/profile/details.php
+++ b/mod/profile/views/default/profile/details.php
@@ -20,9 +20,8 @@
$fields_output = '';
if (is_array($profile_fields) && sizeof($profile_fields) > 0) {
-
// move description to the bottom of the list
- if(isset($profile_fields['description'])) {
+ if (isset($profile_fields['description'])) {
$temp = $profile_fields['description'];
unset($profile_fields['description']);
$profile_fields['description'] = $temp;
@@ -32,7 +31,6 @@
$value = $user->$shortname;
if (!is_null($value)) {
-
// fix profile URLs populated by https://github.com/Elgg/Elgg/issues/5232
// @todo Replace with upgrade script, only need to alter users with last_update after 1.8.13
if ($valtype == 'url' && $value == 'http://') {
diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php
index ce85dfc5410..953e2fc7817 100644
--- a/mod/profile/views/default/profile/owner_block.php
+++ b/mod/profile/views/default/profile/owner_block.php
@@ -8,15 +8,15 @@
$user = elgg_extract('entity', $vars);
if (!($user instanceof \ElggUser)) {
// no user so we quit view
- echo elgg_echo('viewfailure', array(__FILE__));
+ echo elgg_echo('viewfailure', [__FILE__]);
return true;
}
-$icon = elgg_view_entity_icon($user, 'large', array(
+$icon = elgg_view_entity_icon($user, 'large', [
'use_hover' => false,
'use_link' => false,
'img_class' => 'photo u-photo',
-));
+]);
// grab the actions and admin menu items from user hover
$menu = elgg()->menus->getMenu('user_hover', [
@@ -35,7 +35,7 @@
$admin_links .= "
$text… ";
$admin_links .= '';
$admin_links .= '';
@@ -43,10 +43,10 @@
}
// content links
-$content_menu = elgg_view_menu('owner_block', array(
+$content_menu = elgg_view_menu('owner_block', [
'entity' => elgg_get_page_owner_entity(),
'class' => 'profile-content-menu',
-));
+]);
echo <<
-
\ No newline at end of file
+
diff --git a/mod/profile/views/default/resources/profile/view.php b/mod/profile/views/default/resources/profile/view.php
index f6a86c55980..dcdd070723a 100644
--- a/mod/profile/views/default/resources/profile/view.php
+++ b/mod/profile/views/default/resources/profile/view.php
@@ -12,8 +12,8 @@
'owner_guid' => $user->guid,
]);
-$body = elgg_view_layout('one_column', array(
+$body = elgg_view_layout('one_column', [
'content' => $content,
'title' => $user->getDisplayName(),
-));
+]);
echo elgg_view_page($user->name, $body);
diff --git a/mod/profile/views/json/profile/layout.php b/mod/profile/views/json/profile/layout.php
index a403bfdd131..883fbdc1863 100644
--- a/mod/profile/views/json/profile/layout.php
+++ b/mod/profile/views/json/profile/layout.php
@@ -1,7 +1,7 @@
$report), true)) {
+if (!elgg_trigger_plugin_hook('reportedcontent:add', 'system', ['report' => $report], true)) {
$report->delete();
$fail();
}
diff --git a/mod/reportedcontent/actions/reportedcontent/archive.php b/mod/reportedcontent/actions/reportedcontent/archive.php
index 37102141bbb..c99e869c0f4 100644
--- a/mod/reportedcontent/actions/reportedcontent/archive.php
+++ b/mod/reportedcontent/actions/reportedcontent/archive.php
@@ -1,7 +1,7 @@
$report), true)) {
+if (!elgg_trigger_plugin_hook('reportedcontent:delete', 'system', ['report' => $report], true)) {
register_error(elgg_echo("reportedcontent:notdeleted"));
forward(REFERER);
}
diff --git a/mod/reportedcontent/languages/ca.php b/mod/reportedcontent/languages/ca.php
index 7267529fe6f..9f3af905f5b 100644
--- a/mod/reportedcontent/languages/ca.php
+++ b/mod/reportedcontent/languages/ca.php
@@ -1,5 +1,5 @@
'Elements denunciats',
'admin:administer_utilities:reportedcontent' => 'Contingut denunciat',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Ens sap greu, hi ha hagut una errada a l´hora d´intentar denunciar el contingut.',
'reportedcontent:notarchived' => 'No s´ha pogut arxivar la denúncia',
-);
+];
diff --git a/mod/reportedcontent/languages/cmn.php b/mod/reportedcontent/languages/cmn.php
index 5219fab5651..180ec0f6224 100644
--- a/mod/reportedcontent/languages/cmn.php
+++ b/mod/reportedcontent/languages/cmn.php
@@ -1,5 +1,5 @@
'報告的項目',
'admin:administer_utilities:reportedcontent' => '報告的內容',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => '抱歉,嘗試報告這個內容時失敗。',
'reportedcontent:notarchived' => '我們無法封存該報告',
-);
+];
diff --git a/mod/reportedcontent/languages/da.php b/mod/reportedcontent/languages/da.php
index 7f5438cf675..ce4e9af7e87 100644
--- a/mod/reportedcontent/languages/da.php
+++ b/mod/reportedcontent/languages/da.php
@@ -1,5 +1,5 @@
'Rapporterede poster',
'admin:administer_utilities:reportedcontent' => 'Rapporteret indhold',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Beklager, forsøget på at rapportere dette indhold fejlede.',
'reportedcontent:notarchived' => 'Vi kunne ikke arkivere denne rapport',
-);
+];
diff --git a/mod/reportedcontent/languages/de.php b/mod/reportedcontent/languages/de.php
index e4a30809bb3..a10c68b2d45 100644
--- a/mod/reportedcontent/languages/de.php
+++ b/mod/reportedcontent/languages/de.php
@@ -1,5 +1,5 @@
'Gemeldete Beiträge',
'admin:administer_utilities:reportedcontent' => 'Gemeldete Beiträge',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Entschuldigung, leider ist der Versuch, diesen Beitrag zu melden, gescheitert.',
'reportedcontent:notarchived' => 'Die Meldung konnte nicht archiviert werden.',
-);
+];
diff --git a/mod/reportedcontent/languages/el.php b/mod/reportedcontent/languages/el.php
index 2c04d6e85ef..40e6e6197c3 100644
--- a/mod/reportedcontent/languages/el.php
+++ b/mod/reportedcontent/languages/el.php
@@ -1,5 +1,5 @@
'Τα στοιχεία που αναφέρθηκαν',
'admin:administer_utilities:reportedcontent' => 'Περιεχόμενο που έχει αναφερθεί',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Λυπούμαστε, η προσπάθεια αναφοράς αυτού του περιεχομένου απέτυχε',
'reportedcontent:notarchived' => 'Δεν ήταν δυνατή η αρχειοθέτηση αυτής της αναφοράς',
-);
+];
diff --git a/mod/reportedcontent/languages/en.php b/mod/reportedcontent/languages/en.php
index 710e460835a..71313b36fc4 100644
--- a/mod/reportedcontent/languages/en.php
+++ b/mod/reportedcontent/languages/en.php
@@ -1,5 +1,5 @@
'Reported items',
'admin:administer_utilities:reportedcontent' => 'Reported content',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Sorry, the attempt to report this content has failed.',
'reportedcontent:notarchived' => 'We were not able to archive that report',
-);
+];
diff --git a/mod/reportedcontent/languages/es.php b/mod/reportedcontent/languages/es.php
index 94c38f3a7fb..5a0c3e25d22 100644
--- a/mod/reportedcontent/languages/es.php
+++ b/mod/reportedcontent/languages/es.php
@@ -1,5 +1,5 @@
'Elementos reportados',
'admin:administer_utilities:reportedcontent' => 'Contenido reportado',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'No se pudo enviar el reporte.',
'reportedcontent:notarchived' => 'No se pudo archivar el reporte',
-);
+];
diff --git a/mod/reportedcontent/languages/eu_es.php b/mod/reportedcontent/languages/eu_es.php
index 3aada5e5bc6..bab50cd18bf 100644
--- a/mod/reportedcontent/languages/eu_es.php
+++ b/mod/reportedcontent/languages/eu_es.php
@@ -1,5 +1,5 @@
'Salatutako elementuak',
'admin:administer_utilities:reportedcontent' => 'Salatutako edukia',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Bakartu, eduki hau salatzeko ahaleginak huts egin du.',
'reportedcontent:notarchived' => 'Ezinezkoa dugu salaketa hori artxibatzea',
-);
+];
diff --git a/mod/reportedcontent/languages/fi.php b/mod/reportedcontent/languages/fi.php
index ee188efc358..a64c224158c 100644
--- a/mod/reportedcontent/languages/fi.php
+++ b/mod/reportedcontent/languages/fi.php
@@ -1,5 +1,5 @@
'Ilmiannetut kohteet',
'admin:administer_utilities:reportedcontent' => 'Asiaton sisältö',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Ilmoituksen tekeminen epäonnistui.',
'reportedcontent:notarchived' => 'Ilmoituksen arkistoiminen epäonnistui',
-);
+];
diff --git a/mod/reportedcontent/languages/fr.php b/mod/reportedcontent/languages/fr.php
index c670e8ab406..c27af7dd6d4 100644
--- a/mod/reportedcontent/languages/fr.php
+++ b/mod/reportedcontent/languages/fr.php
@@ -1,5 +1,5 @@
'Eléments signalés',
'admin:administer_utilities:reportedcontent' => 'Contenu signalé',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Désolé, la tentative de signaler ce contenu a échoué.',
'reportedcontent:notarchived' => 'Il a été impossible d\'archiver ce signalement',
-);
+];
diff --git a/mod/reportedcontent/languages/gl.php b/mod/reportedcontent/languages/gl.php
index 3157f75cd99..13e532875ef 100644
--- a/mod/reportedcontent/languages/gl.php
+++ b/mod/reportedcontent/languages/gl.php
@@ -1,5 +1,5 @@
'Elementos denunciados',
'admin:administer_utilities:reportedcontent' => 'Contido denunciado',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Non foi posíbel denunciar este contido.',
'reportedcontent:notarchived' => 'Non foi posíbel arquivar a denuncia.',
-);
+];
diff --git a/mod/reportedcontent/languages/it.php b/mod/reportedcontent/languages/it.php
index 1828936502b..456995a82f1 100644
--- a/mod/reportedcontent/languages/it.php
+++ b/mod/reportedcontent/languages/it.php
@@ -1,5 +1,5 @@
'Elementi segnalati',
'admin:administer_utilities:reportedcontent' => 'Contenuto segnalato',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Spiacenti, invio segnalazione fallito',
'reportedcontent:notarchived' => 'Non è stato possibile archiviare la segnalazione',
-);
+];
diff --git a/mod/reportedcontent/languages/ja.php b/mod/reportedcontent/languages/ja.php
index 1f4276f8ea2..67976a2b019 100644
--- a/mod/reportedcontent/languages/ja.php
+++ b/mod/reportedcontent/languages/ja.php
@@ -1,5 +1,5 @@
'報告された対象',
'admin:administer_utilities:reportedcontent' => '報告されたコンテント',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => '申し訳ありません、このコンテントを報告しようとしましたが、失敗しました。もう一度お試しください。',
'reportedcontent:notarchived' => 'この報告を書庫に保存することができませんでした。',
-);
+];
diff --git a/mod/reportedcontent/languages/ko.php b/mod/reportedcontent/languages/ko.php
index 60abb820330..673eb973477 100644
--- a/mod/reportedcontent/languages/ko.php
+++ b/mod/reportedcontent/languages/ko.php
@@ -1,5 +1,5 @@
'신고된 항목',
'admin:administer_utilities:reportedcontent' => '신고된 내용',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => '죄송합니다. 이 내용을 신고하는데 실패하였습니다.',
'reportedcontent:notarchived' => '이 신고를 저장할 수 없었습니다',
-);
+];
diff --git a/mod/reportedcontent/languages/nl.php b/mod/reportedcontent/languages/nl.php
index 1afd6549105..5eaf2949d45 100644
--- a/mod/reportedcontent/languages/nl.php
+++ b/mod/reportedcontent/languages/nl.php
@@ -1,5 +1,5 @@
'Gemelde items',
'admin:administer_utilities:reportedcontent' => 'Gemelde inhoud',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Sorry, de poging om deze inhoud te melden is mislukt.',
'reportedcontent:notarchived' => 'Het was niet mogelijk om deze melding te archiveren',
-);
+];
diff --git a/mod/reportedcontent/languages/pl.php b/mod/reportedcontent/languages/pl.php
index 772a649ed41..de53109d82d 100644
--- a/mod/reportedcontent/languages/pl.php
+++ b/mod/reportedcontent/languages/pl.php
@@ -1,5 +1,5 @@
'Zgłoszone elementy',
'admin:administer_utilities:reportedcontent' => 'Zgłoszona treść',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Przykro nam, próba zgłoszenia tej treści zakończyła się niepowodzeniem.',
'reportedcontent:notarchived' => 'Nie powiodła się archiwizacja tego zgłoszenia',
-);
+];
diff --git a/mod/reportedcontent/languages/pt_br.php b/mod/reportedcontent/languages/pt_br.php
index fe5e733f249..bb9d31f4384 100644
--- a/mod/reportedcontent/languages/pt_br.php
+++ b/mod/reportedcontent/languages/pt_br.php
@@ -1,5 +1,5 @@
'Itens denunciados',
'admin:administer_utilities:reportedcontent' => 'Conteúdo denunciado',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Desculpe. A tentativa de denunciar este item falhou.',
'reportedcontent:notarchived' => 'Não foi possível arquivar esta denúncia',
-);
+];
diff --git a/mod/reportedcontent/languages/ru.php b/mod/reportedcontent/languages/ru.php
index 065f36e4c71..7e0e47d8b66 100644
--- a/mod/reportedcontent/languages/ru.php
+++ b/mod/reportedcontent/languages/ru.php
@@ -1,5 +1,5 @@
'На что жалуются',
'admin:administer_utilities:reportedcontent' => 'Пожаловаться',
@@ -32,4 +32,4 @@
'reportedcontent:failed' => 'Простите, пожаловаться не получилось. Пожалуйтесь на эту ошибку.',
'reportedcontent:notarchived' => 'Простите, невозможно заархивировать жалобу.',
-);
+];
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index 90e2bfb711c..f5e924a09cd 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -21,9 +21,8 @@ function reportedcontent_init() {
if (elgg_is_logged_in()) {
-
// Extend footer with report content link
- elgg_register_menu_item('extras', array(
+ elgg_register_menu_item('extras', [
'name' => 'report_this',
'href' => 'reportedcontent/add',
'title' => elgg_echo('reportedcontent:this:tooltip'),
@@ -33,7 +32,7 @@ function reportedcontent_init() {
'section' => 'default',
'link_class' => 'elgg-lightbox',
'deps' => 'elgg/reportedcontent',
- ));
+ ]);
}
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'reportedcontent_user_hover_menu');
@@ -92,4 +91,4 @@ function reportedcontent_user_hover_menu($hook, $type, $return, $params) {
]);
return $return;
-}
\ No newline at end of file
+}
diff --git a/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
index fb9a4f02954..1099062adf6 100644
--- a/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
+++ b/mod/reportedcontent/views/default/admin/administer_utilities/reportedcontent.php
@@ -16,4 +16,4 @@
'as' => 'text',
],
'no_results' => elgg_echo('reportedcontent:none'),
-]);
\ No newline at end of file
+]);
diff --git a/mod/reportedcontent/views/default/elgg/reportedcontent.js b/mod/reportedcontent/views/default/elgg/reportedcontent.js
index 9f84a2fd326..96ea42bedf3 100644
--- a/mod/reportedcontent/views/default/elgg/reportedcontent.js
+++ b/mod/reportedcontent/views/default/elgg/reportedcontent.js
@@ -84,3 +84,4 @@ define(function (require) {
return false;
})
});
+
diff --git a/mod/reportedcontent/views/default/forms/reportedcontent/add.php b/mod/reportedcontent/views/default/forms/reportedcontent/add.php
index e3b2de0c51d..0eab2bb9e50 100644
--- a/mod/reportedcontent/views/default/forms/reportedcontent/add.php
+++ b/mod/reportedcontent/views/default/forms/reportedcontent/add.php
@@ -25,7 +25,7 @@
'#label' => elgg_echo('reportedcontent:address'),
'name' => 'address',
'value' => $address,
- 'readonly' => (bool)$address,
+ 'readonly' => (bool) $address,
'required' => true,
],
[
@@ -40,9 +40,9 @@
echo elgg_view_field($field);
}
-$footer = elgg_view('input/submit', array(
+$footer = elgg_view('input/submit', [
'value' => elgg_echo('reportedcontent:report'),
-));
+]);
$footer .= elgg_view('input/button', [
'class' => 'elgg-button-cancel',
'value' => elgg_echo('cancel'),
diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php
index 443d0297cf1..630c1dd7e09 100644
--- a/mod/reportedcontent/views/default/object/reported_content.php
+++ b/mod/reportedcontent/views/default/object/reported_content.php
@@ -22,18 +22,18 @@
state != 'archived') {
- $attrs = [
- 'class' => 'elgg-button elgg-button-action',
- 'data-elgg-action' => json_encode([
- 'name' => 'reportedcontent/archive',
- 'data' => [
- 'guid' => $report->guid,
- ]
- ]),
- ];
- echo elgg_format_element('button', $attrs, elgg_echo('reportedcontent:archive'));
- }
+if ($report->state != 'archived') {
+ $attrs = [
+ 'class' => 'elgg-button elgg-button-action',
+ 'data-elgg-action' => json_encode([
+ 'name' => 'reportedcontent/archive',
+ 'data' => [
+ 'guid' => $report->guid,
+ ]
+ ]),
+ ];
+ echo elgg_format_element('button', $attrs, elgg_echo('reportedcontent:archive'));
+}
$attrs = [
'class' => 'elgg-button elgg-button-action',
'data-elgg-action' => json_encode([
@@ -69,7 +69,7 @@
echo " " . elgg_view_friendly_time($report->time_created);
?>
- description): ?>
+ description) : ?>
description; ?>
diff --git a/mod/reportedcontent/views/default/resources/reportedcontent/add.php b/mod/reportedcontent/views/default/resources/reportedcontent/add.php
index 49570afeabf..63dd82666b9 100644
--- a/mod/reportedcontent/views/default/resources/reportedcontent/add.php
+++ b/mod/reportedcontent/views/default/resources/reportedcontent/add.php
@@ -6,11 +6,11 @@
$content = elgg_view_form('reportedcontent/add');
$sidebar = elgg_echo('reportedcontent:instructions');
-$params = array(
+$params = [
'title' => $title,
'content' => $content,
'sidebar' => $sidebar,
-);
+];
$body = elgg_view_layout('one_sidebar', $params);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/search/languages/da.php b/mod/search/languages/da.php
index e735e65b2ae..9ed2e320046 100644
--- a/mod/search/languages/da.php
+++ b/mod/search/languages/da.php
@@ -1,6 +1,6 @@
'Indtast et søgeord:',
'search:no_results' => 'Ingen resultater...',
'search:matched' => 'Match: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'af',
'search:unavailable_entity' => 'Utilgængelig søgeterm',
'search:unknown_entity' => 'Ukendt Entitets type',
-);
+];
diff --git a/mod/search/languages/de.php b/mod/search/languages/de.php
index 7451485bcf0..9e2d8443c56 100644
--- a/mod/search/languages/de.php
+++ b/mod/search/languages/de.php
@@ -1,6 +1,6 @@
'Gebe einen Suchbegriff ein:',
'search:no_results' => 'Keine Treffer.',
'search:matched' => 'Treffer: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'von',
'search:unavailable_entity' => 'Entität nicht verfügbar.',
'search:unknown_entity' => 'Der Typ der Entitäts ist unbekannt.',
-);
+];
diff --git a/mod/search/languages/el.php b/mod/search/languages/el.php
index a8defbd4a53..ac1573273d4 100644
--- a/mod/search/languages/el.php
+++ b/mod/search/languages/el.php
@@ -1,6 +1,6 @@
'Εισάγετε μια φράση για αναζήτηση:',
'search:no_results' => 'Δεν υπάρχουν αποτελέσματα.',
'search:matched' => 'Matched:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'από',
'search:unavailable_entity' => 'Μη Διαθέσιμη Οντότητα',
'search:unknown_entity' => 'Μη διαθέσιμος τύπος οντότητας',
-);
+];
diff --git a/mod/search/languages/en.php b/mod/search/languages/en.php
index 8444d2b5ce1..b772d0f5662 100644
--- a/mod/search/languages/en.php
+++ b/mod/search/languages/en.php
@@ -1,6 +1,6 @@
'Enter a search term:',
'search:no_results' => 'No results.',
'search:matched' => 'Matched: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'by',
'search:unavailable_entity' => 'Unavailable Entity',
'search:unknown_entity' => 'Unknown Entity type',
-);
+];
diff --git a/mod/search/languages/es.php b/mod/search/languages/es.php
index 98a88357c72..e60b4aba41a 100644
--- a/mod/search/languages/es.php
+++ b/mod/search/languages/es.php
@@ -1,6 +1,6 @@
'Introduzca un término de búsqueda:',
'search:no_results' => 'Sin resultados.',
'search:matched' => 'Coincide: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'por',
'search:unavailable_entity' => 'Entrada no disponible',
'search:unknown_entity' => 'Tipo de Entidad Desconocida',
-);
+];
diff --git a/mod/search/languages/eu_es.php b/mod/search/languages/eu_es.php
index 0ef9bd6bfbc..7692c636a6c 100644
--- a/mod/search/languages/eu_es.php
+++ b/mod/search/languages/eu_es.php
@@ -1,6 +1,6 @@
'Sartu bilaketaren terminoa:',
'search:no_results' => 'Ez dago emaitzarik.',
'search:matched' => 'Bilatuta:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'nork',
'search:unavailable_entity' => 'Entitate erabilezina',
'search:unknown_entity' => 'Entitate mota ezezaguna',
-);
+];
diff --git a/mod/search/languages/fa.php b/mod/search/languages/fa.php
index 676c5708922..a30538afcf9 100644
--- a/mod/search/languages/fa.php
+++ b/mod/search/languages/fa.php
@@ -1,6 +1,6 @@
'یک واژه برای جستجو وارد کنید:',
'search:no_results' => 'بدون نتیجه.',
'search:matched' => 'همسان:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'توسط',
'search:unavailable_entity' => 'نهاد در دسترس نیست',
'search:unknown_entity' => 'نوع نهاد ناشناخته',
-);
+];
diff --git a/mod/search/languages/fi.php b/mod/search/languages/fi.php
index 618bc128db4..0faee5eed80 100644
--- a/mod/search/languages/fi.php
+++ b/mod/search/languages/fi.php
@@ -1,6 +1,6 @@
'Syötä hakusana:',
'search:no_results' => 'Ei hakutuloksia.',
'search:matched' => 'Matched: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'käyttäjältä',
'search:unavailable_entity' => 'Kohde, jota ei saatavilla',
'search:unknown_entity' => 'Tuntematon kohdetyyppi',
-);
+];
diff --git a/mod/search/languages/fr.php b/mod/search/languages/fr.php
index 2f9231187e1..de843d32fd9 100644
--- a/mod/search/languages/fr.php
+++ b/mod/search/languages/fr.php
@@ -1,6 +1,6 @@
'Entrer un terme de recherche :',
'search:no_results' => 'Aucun résultat.',
'search:matched' => 'Correspondant: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'par',
'search:unavailable_entity' => 'Entité indisponible',
'search:unknown_entity' => 'Type d\'entité inconnu',
-);
+];
diff --git a/mod/search/languages/gl.php b/mod/search/languages/gl.php
index 9f53722738c..6f1299bf5d1 100644
--- a/mod/search/languages/gl.php
+++ b/mod/search/languages/gl.php
@@ -1,6 +1,6 @@
'Escriba un temo de busca:',
'search:no_results' => 'Non hai resultados',
'search:matched' => 'Coincidencias:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'de',
'search:unavailable_entity' => 'Entidade non dispoñíbel',
'search:unknown_entity' => 'Tipo de entidade descoñecido',
-);
+];
diff --git a/mod/search/languages/it.php b/mod/search/languages/it.php
index 0b84de27e8e..2b98c17393d 100644
--- a/mod/search/languages/it.php
+++ b/mod/search/languages/it.php
@@ -1,6 +1,6 @@
'Inserisci il testo da cercare:',
'search:no_results' => 'Nessun risultato.',
'search:matched' => 'Corrispondenze:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'di',
'search:unavailable_entity' => 'Elemento non disponibile',
'search:unknown_entity' => 'Tipo di elemento sconosciuto',
-);
+];
diff --git a/mod/search/languages/ja.php b/mod/search/languages/ja.php
index 1fddd62b82e..6bb1d35a6b0 100644
--- a/mod/search/languages/ja.php
+++ b/mod/search/languages/ja.php
@@ -1,6 +1,6 @@
'検索キーワードを入力して下さい:',
'search:no_results' => '一致するものはありませんでした。',
'search:matched' => '一致:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'by',
'search:unavailable_entity' => '利用不可なエンティティ',
'search:unknown_entity' => '不明なエンティティ型です。',
-);
+];
diff --git a/mod/search/languages/ko.php b/mod/search/languages/ko.php
index c84ea36cb2c..edff973eab2 100644
--- a/mod/search/languages/ko.php
+++ b/mod/search/languages/ko.php
@@ -1,6 +1,6 @@
'검색할 말을 입력하세요:',
'search:no_results' => '결과가 없습니다.',
'search:matched' => '찾음:',
@@ -17,4 +17,4 @@
'search:comment_by' => '의',
'search:unavailable_entity' => '없는 항목',
'search:unknown_entity' => '알수없는 항목 종류',
-);
+];
diff --git a/mod/search/languages/nl.php b/mod/search/languages/nl.php
index cf6fe0b2aab..98e8160ceab 100644
--- a/mod/search/languages/nl.php
+++ b/mod/search/languages/nl.php
@@ -1,6 +1,6 @@
'Geef een zoekterm op:',
'search:no_results' => 'Geen resultaten:',
'search:matched' => 'Gevonden:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'door',
'search:unavailable_entity' => 'Niet beschikbare Entity',
'search:unknown_entity' => 'Onbekend Entity type',
-);
+];
diff --git a/mod/search/languages/pl.php b/mod/search/languages/pl.php
index 19762d1d14f..aace16a15f4 100644
--- a/mod/search/languages/pl.php
+++ b/mod/search/languages/pl.php
@@ -1,6 +1,6 @@
'Wpisz słowo kluczowe:',
'search:no_results' => 'Brak wyników.',
'search:matched' => 'Dopasowano:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'przez',
'search:unavailable_entity' => 'Niedostępna encja',
'search:unknown_entity' => 'Nieznany typ encji',
-);
+];
diff --git a/mod/search/languages/pt_br.php b/mod/search/languages/pt_br.php
index 9955fbaf813..c908b0e4dae 100644
--- a/mod/search/languages/pt_br.php
+++ b/mod/search/languages/pt_br.php
@@ -1,6 +1,6 @@
'Insira um termo de busca:',
'search:no_results' => 'Nenhum resultado encontrado.',
'search:matched' => 'Encontrado:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'por',
'search:unavailable_entity' => 'Entidade indisponível',
'search:unknown_entity' => 'Tipo de entidade desconhecida',
-);
+];
diff --git a/mod/search/languages/ru.php b/mod/search/languages/ru.php
index 12a68568767..3b0df4edf1c 100644
--- a/mod/search/languages/ru.php
+++ b/mod/search/languages/ru.php
@@ -1,6 +1,6 @@
'Введите запрос:',
'search:no_results' => 'Ничего не найдено',
'search:matched' => 'Найдено: ',
@@ -17,4 +17,4 @@
'search:comment_by' => 'от',
'search:unavailable_entity' => 'Недоступно',
'search:unknown_entity' => 'Неизвестный тип ресурса',
-);
+];
diff --git a/mod/search/languages/zh_hans.php b/mod/search/languages/zh_hans.php
index 7fe8f748ba7..f1ed4dbbf49 100644
--- a/mod/search/languages/zh_hans.php
+++ b/mod/search/languages/zh_hans.php
@@ -1,6 +1,6 @@
'输入搜索词',
'search:no_results' => '没有结果。',
'search:matched' => '匹配:',
@@ -17,4 +17,4 @@
'search:comment_by' => 'by',
'search:unavailable_entity' => '不可用实体',
'search:unknown_entity' => '未知的实体类型',
-);
+];
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php
index 590c0aa64af..37af10cfa64 100644
--- a/mod/search/search_hooks.php
+++ b/mod/search/search_hooks.php
@@ -17,27 +17,27 @@
*/
function search_objects_hook($hook, $type, $value, $params) {
- $params['joins'] = (array) elgg_extract('joins', $params, array());
- $params['wheres'] = (array) elgg_extract('wheres', $params, array());
+ $params['joins'] = (array) elgg_extract('joins', $params, []);
+ $params['wheres'] = (array) elgg_extract('wheres', $params, []);
$db_prefix = elgg_get_config('dbprefix');
$join = "JOIN {$db_prefix}objects_entity oe ON e.guid = oe.guid";
array_unshift($params['joins'], $join);
- $fields = array('title', 'description');
+ $fields = ['title', 'description'];
$where = search_get_where_sql('oe', $fields, $params);
$params['wheres'][] = $where;
- $params['count'] = TRUE;
+ $params['count'] = true;
$count = elgg_get_entities($params);
// no need to continue if nothing here.
if (!$count) {
- return array('entities' => array(), 'count' => $count);
+ return ['entities' => [], 'count' => $count];
}
- $params['count'] = FALSE;
+ $params['count'] = false;
if (isset($params['sort']) || !isset($params['order_by'])) {
$params['order_by'] = search_get_order_by_sql('e', 'oe', $params['sort'], $params['order']);
}
@@ -53,10 +53,10 @@ function search_objects_hook($hook, $type, $value, $params) {
$entity->setVolatileData('search_matched_description', $desc);
}
- return array(
+ return [
'entities' => $entities,
'count' => $count,
- );
+ ];
}
/**
@@ -70,8 +70,8 @@ function search_objects_hook($hook, $type, $value, $params) {
*/
function search_groups_hook($hook, $type, $value, $params) {
- $params['joins'] = (array) elgg_extract('joins', $params, array());
- $params['wheres'] = (array) elgg_extract('wheres', $params, array());
+ $params['joins'] = (array) elgg_extract('joins', $params, []);
+ $params['wheres'] = (array) elgg_extract('wheres', $params, []);
$db_prefix = elgg_get_config('dbprefix');
@@ -80,19 +80,19 @@ function search_groups_hook($hook, $type, $value, $params) {
$join = "JOIN {$db_prefix}groups_entity ge ON e.guid = ge.guid";
array_unshift($params['joins'], $join);
- $fields = array('name', 'description');
+ $fields = ['name', 'description'];
$where = search_get_where_sql('ge', $fields, $params);
$params['wheres'][] = $where;
- $params['count'] = TRUE;
+ $params['count'] = true;
$count = elgg_get_entities($params);
// no need to continue if nothing here.
if (!$count) {
- return array('entities' => array(), 'count' => $count);
+ return ['entities' => [], 'count' => $count];
}
- $params['count'] = FALSE;
+ $params['count'] = false;
if (isset($params['sort']) || !isset($params['order_by'])) {
$params['order_by'] = search_get_order_by_sql('e', 'ge', $params['sort'], $params['order']);
}
@@ -107,10 +107,10 @@ function search_groups_hook($hook, $type, $value, $params) {
$entity->setVolatileData('search_matched_description', $description);
}
- return array(
+ return [
'entities' => $entities,
'count' => $count,
- );
+ ];
}
/**
@@ -126,8 +126,8 @@ function search_groups_hook($hook, $type, $value, $params) {
*/
function search_users_hook($hook, $type, $value, $params) {
- $params['joins'] = (array) elgg_extract('joins', $params, array());
- $params['wheres'] = (array) elgg_extract('wheres', $params, array());
+ $params['joins'] = (array) elgg_extract('joins', $params, []);
+ $params['wheres'] = (array) elgg_extract('wheres', $params, []);
$db_prefix = elgg_get_config('dbprefix');
@@ -137,7 +137,7 @@ function search_users_hook($hook, $type, $value, $params) {
array_unshift($params['joins'], $join);
// username and display name
- $fields = array('username', 'name');
+ $fields = ['username', 'name'];
$where = search_get_where_sql('ue', $fields, $params);
// profile fields
@@ -148,7 +148,7 @@ function search_users_hook($hook, $type, $value, $params) {
// get the where clauses for the md names
// can't use egef_metadata() because the n_table join comes too late.
- $clauses = _elgg_entities_get_metastrings_options('metadata', array(
+ $clauses = _elgg_entities_get_metastrings_options('metadata', [
'metadata_names' => $profile_fields,
// avoid notices
@@ -158,7 +158,7 @@ function search_users_hook($hook, $type, $value, $params) {
'metadata_case_sensitive' => null,
'order_by_metadata' => null,
'metadata_owner_guids' => null,
- ));
+ ]);
$params['joins'] = array_merge($clauses['joins'], $params['joins']);
$md_where = "(({$clauses['wheres'][0]}) AND md.value LIKE '%$query%')";
@@ -173,10 +173,10 @@ function search_users_hook($hook, $type, $value, $params) {
// no need to continue if nothing here.
if (!$count) {
- return array('entities' => array(), 'count' => $count);
+ return ['entities' => [], 'count' => $count];
}
- $params['count'] = FALSE;
+ $params['count'] = false;
if (isset($params['sort']) || !isset($params['order_by'])) {
$params['order_by'] = search_get_order_by_sql('e', 'ue', $params['sort'], $params['order']);
}
@@ -184,7 +184,6 @@ function search_users_hook($hook, $type, $value, $params) {
// add the volatile data for why these entities have been returned.
foreach ($entities as $entity) {
-
$title = search_get_highlighted_relevant_substrings($entity->name, $query);
// include the username if it matches but the display name doesn't.
@@ -218,10 +217,10 @@ function search_users_hook($hook, $type, $value, $params) {
}
}
- return array(
+ return [
'entities' => $entities,
'count' => $count,
- );
+ ];
}
/**
@@ -235,8 +234,8 @@ function search_users_hook($hook, $type, $value, $params) {
*/
function search_tags_hook($hook, $type, $value, $params) {
- $params['joins'] = (array) elgg_extract('joins', $params, array());
- $params['wheres'] = (array) elgg_extract('wheres', $params, array());
+ $params['joins'] = (array) elgg_extract('joins', $params, []);
+ $params['wheres'] = (array) elgg_extract('wheres', $params, []);
$db_prefix = elgg_get_config('dbprefix');
@@ -252,7 +251,7 @@ function search_tags_hook($hook, $type, $value, $params) {
if (is_array($tag_names)) {
$search_tag_names = $tag_names;
} else {
- $search_tag_names = array($tag_names);
+ $search_tag_names = [$tag_names];
}
// check these are valid to avoid arbitrary metadata searches.
@@ -266,7 +265,7 @@ function search_tags_hook($hook, $type, $value, $params) {
}
if (!$search_tag_names) {
- return array('entities' => array(), 'count' => $count);
+ return ['entities' => [], 'count' => $count];
}
// don't use elgg_get_entities_from_metadata() here because of
@@ -275,8 +274,8 @@ function search_tags_hook($hook, $type, $value, $params) {
// out the matches later.
$params['joins'][] = "JOIN {$db_prefix}metadata md on e.guid = md.entity_guid";
- $access = _elgg_get_access_where_sql(array('table_alias' => 'md'));
- $sanitised_tags = array();
+ $access = _elgg_get_access_where_sql(['table_alias' => 'md']);
+ $sanitised_tags = [];
foreach ($search_tag_names as $tag) {
$sanitised_tags[] = '"' . sanitise_string($tag) . '"';
@@ -286,15 +285,15 @@ function search_tags_hook($hook, $type, $value, $params) {
$params['wheres'][] = "(md.name IN ($tags_in) AND md.value = '$query' AND $access)";
- $params['count'] = TRUE;
+ $params['count'] = true;
$count = elgg_get_entities($params);
// no need to continue if nothing here.
if (!$count) {
- return array('entities' => array(), 'count' => $count);
+ return ['entities' => [], 'count' => $count];
}
- $params['count'] = FALSE;
+ $params['count'] = false;
if (isset($params['sort']) || !isset($params['order_by'])) {
$params['order_by'] = search_get_order_by_sql('e', null, $params['sort'], $params['order']);
}
@@ -302,7 +301,7 @@ function search_tags_hook($hook, $type, $value, $params) {
// add the volatile data for why these entities have been returned.
foreach ($entities as $entity) {
- $matched_tags_strs = array();
+ $matched_tags_strs = [];
// get tags for each tag name requested to find which ones matched.
foreach ($search_tag_names as $tag_name) {
@@ -320,7 +319,7 @@ function search_tags_hook($hook, $type, $value, $params) {
}
// different entities have different titles
- switch($entity->type) {
+ switch ($entity->type) {
case 'site':
case 'user':
case 'group':
@@ -355,10 +354,10 @@ function search_tags_hook($hook, $type, $value, $params) {
$entity->setVolatileData('search_matched_extra', $tags_str);
}
- return array(
+ return [
'entities' => $entities,
'count' => $count,
- );
+ ];
}
/**
diff --git a/mod/search/start.php b/mod/search/start.php
index 037add841cf..24d4300a1cb 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -4,7 +4,7 @@
*
*/
-elgg_register_event_handler('init','system','search_init');
+elgg_register_event_handler('init', 'system', 'search_init');
/**
* Initialize search plugin
@@ -46,7 +46,7 @@ function search_page_handler($page) {
// it expects a search by tags.
// actually it doesn't, but maybe it should.
// maintain backward compatibility
- if(!get_input('q', get_input('tag', NULL))) {
+ if (!get_input('q', get_input('tag', null))) {
set_input('q', $page[0]);
//set_input('search_type', 'tags');
}
@@ -61,9 +61,9 @@ function search_page_handler($page) {
*
* @param string $haystack
* @param string $query
- * @param int $min_match_context = 30
- * @param int $max_length = 300
- * @param bool $tag_match Search is for tags. Don't ignore words.
+ * @param int $min_match_context = 30
+ * @param int $max_length = 300
+ * @param bool $tag_match Search is for tags. Don't ignore words.
* @return string
*/
function search_get_highlighted_relevant_substrings($haystack, $query, $min_match_context = 30, $max_length = 300, $tag_match = false) {
@@ -75,7 +75,7 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
if (!$tag_match) {
$words = search_remove_ignored_words($query, 'array');
} else {
- $words = array();
+ $words = [];
}
// if haystack < $max_length return the entire haystack w/formatting immediately
@@ -86,8 +86,8 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
}
// get the starting positions and lengths for all matching words
- $starts = array();
- $lengths = array();
+ $starts = [];
+ $lengths = [];
foreach ($words as $word) {
$word = elgg_strtolower($word);
$count = elgg_substr_count($haystack_lc, $word);
@@ -97,7 +97,7 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
// find the start positions for the words
if ($count > 1) {
$offset = 0;
- while (FALSE !== $pos = elgg_strpos($haystack_lc, $word, $offset)) {
+ while (false !== $pos = elgg_strpos($haystack_lc, $word, $offset)) {
$start = ($pos - $min_match_context > 0) ? $pos - $min_match_context : 0;
$starts[] = $start;
$stop = $pos + $word_len + $min_match_context;
@@ -127,8 +127,8 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
if ($total_length < $max_length && $offsets) {
$add_length = floor((($max_length - $total_length) / count($offsets)) / 2);
- $starts = array();
- $lengths = array();
+ $starts = [];
+ $lengths = [];
foreach ($offsets as $offset => $length) {
$start = ($offset - $add_length > 0) ? $offset - $add_length : 0;
$length = $length + $add_length;
@@ -145,7 +145,7 @@ function search_get_highlighted_relevant_substrings($haystack, $query, $min_matc
// the others as needed to fit within $max_length.
arsort($offsets);
- $return_strs = array();
+ $return_strs = [];
$total_length = 0;
foreach ($offsets as $start => $length) {
$string = trim(elgg_substr($haystack, $start, $length));
@@ -199,14 +199,14 @@ function search_consolidate_substrings($offsets, $lengths) {
// reset the indexes maintaining association with the original offsets.
$offsets = array_merge($offsets);
- $new_lengths = array();
+ $new_lengths = [];
foreach ($offsets as $i => $offset) {
$new_lengths[] = $lengths[$i];
}
$lengths = $new_lengths;
- $return = array();
+ $return = [];
$count = count($offsets);
for ($i=0; $i<$count; $i++) {
$offset = $offsets[$i];
@@ -234,18 +234,18 @@ function search_consolidate_substrings($offsets, $lengths) {
/**
* Safely highlights the words in $words found in $string avoiding recursion
*
- * @param array $words
+ * @param array $words
* @param string $string
* @return string
*/
function search_highlight_words($words, $string) {
$i = 1;
- $replace_html = array(
+ $replace_html = [
'strong' => rand(10000, 99999),
'class' => rand(10000, 99999),
'search-highlight' => rand(10000, 99999),
'search-highlight-color' => rand(10000, 99999)
- );
+ ];
foreach ($words as $word) {
// remove any boolean mode operators
@@ -284,7 +284,7 @@ function search_highlight_words($words, $string) {
* it's taken literally.)
*
* @param array $query
- * @param str $format Return as an array or a string
+ * @param str $format Return as an array or a string
* @return mixed
*/
function search_remove_ignored_words($query, $format = 'array') {
@@ -307,8 +307,8 @@ function search_remove_ignored_words($query, $format = 'array') {
* Passes results, and original params to the view functions for
* search type.
*
- * @param array $results
- * @param array $params
+ * @param array $results
+ * @param array $params
* @param string $view_type = list, entity or layout
* @return string
*/
@@ -320,10 +320,10 @@ function search_get_search_view($params, $view_type) {
break;
default:
- return FALSE;
+ return false;
}
- $view_order = array();
+ $view_order = [];
// check if there's a special search list view for this type:subtype
if (isset($params['type']) && $params['type'] && isset($params['subtype']) && $params['subtype']) {
@@ -349,13 +349,13 @@ function search_get_search_view($params, $view_type) {
}
}
- return FALSE;
+ return false;
}
/**
* Returns a where clause for a search query.
*
- * @param str $table Prefix for table to search on
+ * @param str $table Prefix for table to search on
* @param array $fields Fields to match against
* @param array $params Original search params
* @return str
@@ -393,14 +393,14 @@ function search_get_where_sql($table, $fields, $params) {
* Returns ORDER BY sql for insertion into elgg_get_entities().
*
* @param str $entities_table Prefix for entities table.
- * @param str $type_table Prefix for the type table.
- * @param str $sort ORDER BY part
- * @param str $order ASC or DESC
+ * @param str $type_table Prefix for the type table.
+ * @param str $sort ORDER BY part
+ * @param str $order ASC or DESC
* @return str
*/
function search_get_order_by_sql($entities_table, $type_table, $sort, $order) {
- $on = NULL;
+ $on = null;
switch ($sort) {
default:
diff --git a/mod/search/views/default/resources/search/index.php b/mod/search/views/default/resources/search/index.php
index 0fd763f9d60..ce60f9c04b5 100644
--- a/mod/search/views/default/resources/search/index.php
+++ b/mod/search/views/default/resources/search/index.php
@@ -23,10 +23,10 @@
$title = sprintf(elgg_echo('search:results'), "\"$display_query\"");
$body = elgg_echo('search:no_query');
- $layout = elgg_view_layout('one_sidebar', array(
+ $layout = elgg_view_layout('one_sidebar', [
'title' => elgg_echo('search:search_error'),
'content' => $body
- ));
+ ]);
echo elgg_view_page($title, $layout);
return;
@@ -62,7 +62,7 @@
}
// set up search params
-$params = array(
+$params = [
'query' => $query,
'offset' => $offset,
'limit' => $limit,
@@ -75,21 +75,21 @@
'owner_guid' => $owner_guid,
'container_guid' => $container_guid,
// 'friends' => $friends
- 'pagination' => ($search_type == 'all') ? FALSE : TRUE
-);
+ 'pagination' => ($search_type == 'all') ? false : true
+];
$types = get_registered_entity_types();
$types = elgg_trigger_plugin_hook('search_types', 'get_queries', $params, $types);
-$custom_types = elgg_trigger_plugin_hook('search_types', 'get_types', $params, array());
+$custom_types = elgg_trigger_plugin_hook('search_types', 'get_types', $params, []);
// add sidebar items for all and native types
-$data = htmlspecialchars(http_build_query(array(
+$data = htmlspecialchars(http_build_query([
'q' => $query,
'owner_guid' => $owner_guid,
'search_type' => 'all',
//'friends' => $friends
-)));
+]));
$url = elgg_get_site_url() . "search?$data";
$menu_item = new ElggMenuItem('all', elgg_echo('all'), $url);
elgg_register_menu_item('page', $menu_item);
@@ -100,14 +100,14 @@
foreach ($subtypes as $subtype) {
$label = "item:$type:$subtype";
- $data = htmlspecialchars(http_build_query(array(
+ $data = htmlspecialchars(http_build_query([
'q' => $query,
'entity_subtype' => $subtype,
'entity_type' => $type,
'owner_guid' => $owner_guid,
'search_type' => 'entities',
'friends' => $friends
- )));
+ ]));
$url = elgg_get_site_url()."search?$data";
$menu_item = new ElggMenuItem($label, elgg_echo($label), $url);
@@ -116,13 +116,13 @@
} else {
$label = "item:$type";
- $data = htmlspecialchars(http_build_query(array(
+ $data = htmlspecialchars(http_build_query([
'q' => $query,
'entity_type' => $type,
'owner_guid' => $owner_guid,
'search_type' => 'entities',
'friends' => $friends
- )));
+ ]));
$url = elgg_get_site_url() . "search?$data";
@@ -135,10 +135,10 @@
foreach ($custom_types as $type) {
$label = "search_types:$type";
- $data = htmlspecialchars(http_build_query(array(
+ $data = htmlspecialchars(http_build_query([
'q' => $query,
'search_type' => $type,
- )));
+ ]));
$url = elgg_get_site_url()."search?$data";
@@ -173,8 +173,8 @@
$current_params['subtype'] = $subtype;
$current_params['type'] = $type;
- $results = elgg_trigger_plugin_hook('search', "$type:$subtype", $current_params, NULL);
- if ($results === FALSE) {
+ $results = elgg_trigger_plugin_hook('search', "$type:$subtype", $current_params, null);
+ if ($results === false) {
// someone is saying not to display these types in searches.
continue;
} elseif (is_array($results) && !count($results)) {
@@ -183,15 +183,15 @@
// no results and not hooked. use default type search.
// don't change the params here, since it's really a different subtype.
// Will be passed to elgg_get_entities().
- $results = elgg_trigger_plugin_hook('search', $type, $current_params, array());
+ $results = elgg_trigger_plugin_hook('search', $type, $current_params, []);
}
if (is_array($results['entities']) && $results['count']) {
if ($view = search_get_search_view($current_params, 'list')) {
- $results_html .= elgg_view($view, array(
+ $results_html .= elgg_view($view, [
'results' => $results,
'params' => $current_params,
- ));
+ ]);
}
}
}
@@ -201,18 +201,18 @@
$current_params['type'] = $type;
$current_params['subtype'] = ELGG_ENTITIES_NO_VALUE;
- $results = elgg_trigger_plugin_hook('search', $type, $current_params, array());
- if ($results === FALSE) {
+ $results = elgg_trigger_plugin_hook('search', $type, $current_params, []);
+ if ($results === false) {
// someone is saying not to display these types in searches.
continue;
}
if (is_array($results['entities']) && $results['count']) {
if ($view = search_get_search_view($current_params, 'list')) {
- $results_html .= elgg_view($view, array(
+ $results_html .= elgg_view($view, [
'results' => $results,
'params' => $current_params,
- ));
+ ]);
}
}
}
@@ -229,19 +229,19 @@
$current_params = $params;
$current_params['search_type'] = $type;
- $results = elgg_trigger_plugin_hook('search', $type, $current_params, array());
+ $results = elgg_trigger_plugin_hook('search', $type, $current_params, []);
- if ($results === FALSE) {
+ if ($results === false) {
// someone is saying not to display these types in searches.
continue;
}
if (is_array($results['entities']) && $results['count']) {
if ($view = search_get_search_view($current_params, 'list')) {
- $results_html .= elgg_view($view, array(
+ $results_html .= elgg_view($view, [
'results' => $results,
'params' => $current_params,
- ));
+ ]);
}
}
}
@@ -250,13 +250,13 @@
// highlight search terms
if ($search_type == 'tags') {
- $searched_words = array($display_query);
+ $searched_words = [$display_query];
} else {
$searched_words = search_remove_ignored_words($display_query, 'array');
}
$highlighted_query = search_highlight_words($searched_words, $display_query);
-$highlighted_title = elgg_echo('search:results', array("\"$highlighted_query\""));
+$highlighted_title = elgg_echo('search:results', ["\"$highlighted_query\""]);
if (!$results_html) {
$body = elgg_view('search/no_results');
@@ -268,8 +268,8 @@
// matched (which is out of date now anyway).
// we want to know what search type it is.
$layout_view = search_get_search_view($params, 'layout');
-$layout = elgg_view($layout_view, array('params' => $params, 'body' => $body, 'title' => $highlighted_title));
+$layout = elgg_view($layout_view, ['params' => $params, 'body' => $body, 'title' => $highlighted_title]);
-$title = elgg_echo('search:results', array("\"$display_query\""));
+$title = elgg_echo('search:results', ["\"$display_query\""]);
echo elgg_view_page($title, $layout);
diff --git a/mod/search/views/default/search/entity.php b/mod/search/views/default/search/entity.php
index e04d08836b7..732c1c880f1 100644
--- a/mod/search/views/default/search/entity.php
+++ b/mod/search/views/default/search/entity.php
@@ -4,7 +4,7 @@
*
* Display largely controlled by a set of overrideable volatile data:
* - search_icon (defaults to entity icon)
- * - search_matched_title
+ * - search_matched_title
* - search_matched_description
* - search_matched_extra
* - search_url (defaults to entity->getURL())
diff --git a/mod/search/views/default/search/header.php b/mod/search/views/default/search/header.php
index 6f8654c137b..63ed2762dd1 100644
--- a/mod/search/views/default/search/header.php
+++ b/mod/search/views/default/search/header.php
@@ -3,4 +3,4 @@
* Search box in page header
*/
-echo elgg_view('search/search_box', array('class' => 'elgg-search-header'));
\ No newline at end of file
+echo elgg_view('search/search_box', ['class' => 'elgg-search-header']);
diff --git a/mod/search/views/default/search/layout.php b/mod/search/views/default/search/layout.php
index ca772a936fa..87cbdd7a893 100644
--- a/mod/search/views/default/search/layout.php
+++ b/mod/search/views/default/search/layout.php
@@ -5,7 +5,7 @@
* @uses $vars['body']
*/
-echo elgg_view_layout('one_sidebar', array(
+echo elgg_view_layout('one_sidebar', [
'title' => $vars['title'],
'content' => $vars['body']
-));
\ No newline at end of file
+]);
diff --git a/mod/search/views/default/search/list.php b/mod/search/views/default/search/list.php
index 73b74bab7b7..0f6b14b738c 100644
--- a/mod/search/views/default/search/list.php
+++ b/mod/search/views/default/search/list.php
@@ -19,11 +19,11 @@
$count = $vars['results']['count'] - count($entities);
if (!is_array($entities) || !count($entities)) {
- return FALSE;
+ return false;
}
$query = http_build_query(
- array(
+ [
'q' => $vars['params']['query'],
'entity_type' => $vars['params']['type'],
'entity_subtype' => $vars['params']['subtype'],
@@ -32,7 +32,7 @@
'search_type' => $vars['params']['search_type'],
'container_guid' => $vars['params']['container_guid'],
//@todo include vars for sorting, order, and friend-only.
- )
+ ]
);
$url = elgg_get_site_url() . "search?$query";
@@ -41,12 +41,12 @@
// get pagination
if (array_key_exists('pagination', $vars['params']) && $vars['params']['pagination']) {
- $nav = elgg_view('navigation/pagination', array(
+ $nav = elgg_view('navigation/pagination', [
'base_url' => $url,
'offset' => $vars['params']['offset'],
'count' => $vars['results']['count'],
'limit' => $vars['params']['limit'],
- ));
+ ]);
$show_more = false;
} else {
// faceted search page so no pagination
@@ -55,7 +55,7 @@
}
// figure out what we're dealing with.
-$type_str = NULL;
+$type_str = null;
if (array_key_exists('type', $vars['params']) && array_key_exists('subtype', $vars['params'])) {
$type_str_tmp = "item:{$vars['params']['type']}:{$vars['params']['subtype']}";
@@ -79,16 +79,16 @@
}
if ($show_more) {
- $more_str = elgg_echo('search:more', array($count, $type_str));
+ $more_str = elgg_echo('search:more', [$count, $type_str]);
$more_url = elgg_http_remove_url_query_element($url, 'limit');
$more_link = "
$more_str ";
} else {
$more_link = '';
}
-$body = elgg_view_title($type_str, array(
+$body = elgg_view_title($type_str, [
'class' => 'search-heading-category',
-));
+]);
$list_body = '';
$view_params = $vars['params'];
@@ -103,11 +103,11 @@
$id = "elgg-{$entity->getType()}-{$entity->getGUID()}";
$list_body .= "
";
- $list_body .= elgg_view($view, array(
+ $list_body .= elgg_view($view, [
'entity' => $entity,
'params' => $view_params,
'results' => $vars['results']
- ));
+ ]);
$list_body .= ' ';
}
diff --git a/mod/search/views/default/search/object/comment/entity.php b/mod/search/views/default/search/object/comment/entity.php
index 9a86e53e23f..3ecf9f193f1 100644
--- a/mod/search/views/default/search/object/comment/entity.php
+++ b/mod/search/views/default/search/object/comment/entity.php
@@ -26,7 +26,7 @@
$title = elgg_echo('item:' . $container->getType());
}
-$title = elgg_echo('search:comment_on', array($title));
+$title = elgg_echo('search:comment_on', [$title]);
$url = $entity->getURL();
$title = "
$title ";
diff --git a/mod/search/views/default/search/search_box.php b/mod/search/views/default/search/search_box.php
index 6a02898e8d3..bb32803e517 100644
--- a/mod/search/views/default/search/search_box.php
+++ b/mod/search/views/default/search/search_box.php
@@ -9,7 +9,7 @@
$value = "";
if (array_key_exists('value', $vars)) {
$value = $vars['value'];
-} elseif ($value = get_input('q', get_input('tag', NULL))) {
+} elseif ($value = get_input('q', get_input('tag', null))) {
$value = $value;
}
@@ -30,7 +30,7 @@
// render placeholder separately so it will double-encode if needed
$placeholder = htmlspecialchars(elgg_echo('search'), ENT_QUOTES, 'UTF-8');
-$search_attrs = elgg_format_attributes(array(
+$search_attrs = elgg_format_attributes([
'type' => 'text',
'class' => 'search-input',
'size' => '21',
@@ -39,7 +39,7 @@
'autocorrect' => 'off',
'required' => true,
'value' => $display_query,
-));
+]);
?>
';
diff --git a/mod/site_notifications/views/default/object/site_notification.php b/mod/site_notifications/views/default/object/site_notification.php
index dc5a9550f7c..8a7b2906208 100644
--- a/mod/site_notifications/views/default/object/site_notification.php
+++ b/mod/site_notifications/views/default/object/site_notification.php
@@ -12,40 +12,40 @@
}
$url = $entity->getURL();
if ($url) {
- $text = elgg_view('output/url', array(
+ $text = elgg_view('output/url', [
'text' => $text,
'href' => $url,
'is_trusted' => true,
'class' => 'site-notifications-link',
'id' => 'site-notifications-link-' . $entity->guid,
- ));
+ ]);
}
-elgg_register_menu_item('site_notifications', array(
+elgg_register_menu_item('site_notifications', [
'name' => 'time',
'href' => false,
'text' => elgg_view_friendly_time($entity->getTimeCreated()),
-));
-elgg_register_menu_item('site_notifications', array(
+]);
+elgg_register_menu_item('site_notifications', [
'name' => 'delete',
'href' => 'action/site_notifications/delete?guid=' . $entity->guid,
'text' => elgg_view_icon('delete'),
'is_action' => true,
'link_class' => 'site-notifications-delete',
'id' => 'site-notifications-delete-' . $entity->guid,
-));
-$menu = elgg_view_menu('site_notifications', array(
+]);
+$menu = elgg_view_menu('site_notifications', [
'class' => 'elgg-menu-hz elgg-menu-entity',
-));
+]);
-$checkbox = elgg_view('input/checkbox', array(
- 'name' => 'notification_id[]',
- 'value' => $entity->getGUID(),
+$checkbox = elgg_view('input/checkbox', [
+ 'name' => 'notification_id[]',
+ 'value' => $entity->getGUID(),
'default' => false
-));
+]);
-$list_body = elgg_view_image_block($icon, $menu . $text, array(
+$list_body = elgg_view_image_block($icon, $menu . $text, [
'class' => 'pvn'
-));
+]);
-echo elgg_view_image_block($checkbox, $list_body);
\ No newline at end of file
+echo elgg_view_image_block($checkbox, $list_body);
diff --git a/mod/site_notifications/views/default/resources/site_notifications/view.php b/mod/site_notifications/views/default/resources/site_notifications/view.php
index 0f501f3edee..c3e4acd6f81 100644
--- a/mod/site_notifications/views/default/resources/site_notifications/view.php
+++ b/mod/site_notifications/views/default/resources/site_notifications/view.php
@@ -17,25 +17,25 @@
$title = elgg_echo('site_notifications');
-$list = elgg_list_entities_from_metadata(array(
+$list = elgg_list_entities_from_metadata([
'type' => 'object',
'subtype' => 'site_notification',
'owner_guid' => $page_owner->guid,
'full_view' => false,
'metadata_name' => 'read',
'metadata_value' => false,
-));
+]);
-$body_vars = array(
+$body_vars = [
'list' => $list
-);
+];
-$form = elgg_view_form("site_notifications/process", array(), $body_vars);
+$form = elgg_view_form("site_notifications/process", [], $body_vars);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'content' => $form,
'title' => $title,
'filter' => '',
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/site_notifications/views/default/site_notifications.js b/mod/site_notifications/views/default/site_notifications.js
index 2b031fba3cf..f375206cab9 100644
--- a/mod/site_notifications/views/default/site_notifications.js
+++ b/mod/site_notifications/views/default/site_notifications.js
@@ -70,3 +70,4 @@ elgg.site_notifications.toggle_all = function() {
};
elgg.register_hook_handler('init', 'system', elgg.site_notifications.init);
+
diff --git a/mod/site_notifications/views/default/site_notifications/css.php b/mod/site_notifications/views/default/site_notifications/css.php
index 5ad5c65cc26..5a929d589e0 100644
--- a/mod/site_notifications/views/default/site_notifications/css.php
+++ b/mod/site_notifications/views/default/site_notifications/css.php
@@ -15,4 +15,4 @@
}
.site-notifications-buttonbank input {
margin-left: 10px;
-}
\ No newline at end of file
+}
diff --git a/mod/tagcloud/languages/ar.php b/mod/tagcloud/languages/ar.php
index 2e2d06a9191..297e59e6d48 100644
--- a/mod/tagcloud/languages/ar.php
+++ b/mod/tagcloud/languages/ar.php
@@ -1,8 +1,8 @@
'وسم سحابي',
'tagcloud:widget:description' => 'وسم سحابي',
'tagcloud:widget:numtags' => 'إضهار عدد الوسوم السحابية',
'tagcloud:site_cloud' => 'وسم سحابي للموقع',
'tagcloud:allsitetags' => 'كل وسوم الموقع',
-);
+];
diff --git a/mod/tagcloud/languages/ca.php b/mod/tagcloud/languages/ca.php
index db27871709d..c74730e0c49 100644
--- a/mod/tagcloud/languages/ca.php
+++ b/mod/tagcloud/languages/ca.php
@@ -1,8 +1,8 @@
'Núvol d\'etiquetes',
'tagcloud:widget:description' => 'Núvol d\'etiquetes',
'tagcloud:widget:numtags' => 'Nombre d\'etiquetes a mostrar',
'tagcloud:site_cloud' => 'Núvol d\'etiquetes',
'tagcloud:allsitetags' => 'Totes les etiquetes',
-);
+];
diff --git a/mod/tagcloud/languages/cmn.php b/mod/tagcloud/languages/cmn.php
index b152896c255..d6c30a18385 100644
--- a/mod/tagcloud/languages/cmn.php
+++ b/mod/tagcloud/languages/cmn.php
@@ -1,8 +1,8 @@
'標籤雲',
'tagcloud:widget:description' => '標籤雲',
'tagcloud:widget:numtags' => '要顯示的標籤數量',
'tagcloud:site_cloud' => '站臺標籤雲',
'tagcloud:allsitetags' => '全站標籤',
-);
+];
diff --git a/mod/tagcloud/languages/da.php b/mod/tagcloud/languages/da.php
index f19cfd5a2da..1941cc38c48 100644
--- a/mod/tagcloud/languages/da.php
+++ b/mod/tagcloud/languages/da.php
@@ -1,8 +1,8 @@
'Tag Cloud',
'tagcloud:widget:description' => 'Tag cloud',
'tagcloud:widget:numtags' => 'Antal tags, der skal vises',
'tagcloud:site_cloud' => 'Site Tag Cloud',
'tagcloud:allsitetags' => 'Alle tags',
-);
+];
diff --git a/mod/tagcloud/languages/de.php b/mod/tagcloud/languages/de.php
index 4b50e1de404..061b166e654 100644
--- a/mod/tagcloud/languages/de.php
+++ b/mod/tagcloud/languages/de.php
@@ -1,8 +1,8 @@
'Tagcloud',
'tagcloud:widget:description' => 'Tagcloud',
'tagcloud:widget:numtags' => 'Anzahl der anzuzeigenden Tags.',
'tagcloud:site_cloud' => 'Tagcloud',
'tagcloud:allsitetags' => 'Alle Tags der Seite',
-);
+];
diff --git a/mod/tagcloud/languages/el.php b/mod/tagcloud/languages/el.php
index 445c98694e9..76ae9b3a179 100644
--- a/mod/tagcloud/languages/el.php
+++ b/mod/tagcloud/languages/el.php
@@ -1,8 +1,8 @@
'Σύννεφο Ετικετών',
'tagcloud:widget:description' => 'Σύννεφο ετικετών',
'tagcloud:widget:numtags' => 'Αριθμός ετικετών για προβολή',
'tagcloud:site_cloud' => 'Σύννεφο Ετικετών Ιστότοπου',
'tagcloud:allsitetags' => 'Όλες οι ετικέτες',
-);
+];
diff --git a/mod/tagcloud/languages/en.php b/mod/tagcloud/languages/en.php
index 4faf3d4a812..15ea48d960f 100644
--- a/mod/tagcloud/languages/en.php
+++ b/mod/tagcloud/languages/en.php
@@ -1,8 +1,8 @@
'Tag Cloud',
'tagcloud:widget:description' => 'Tag cloud',
'tagcloud:widget:numtags' => 'Number of tags to show',
'tagcloud:site_cloud' => 'Site Tag Cloud',
'tagcloud:allsitetags' => 'All site tags',
-);
+];
diff --git a/mod/tagcloud/languages/es.php b/mod/tagcloud/languages/es.php
index 5ec70848bc1..7b5d34e9fc5 100644
--- a/mod/tagcloud/languages/es.php
+++ b/mod/tagcloud/languages/es.php
@@ -1,8 +1,8 @@
'Nube de etiquetas',
'tagcloud:widget:description' => 'Nube de etiquetas',
'tagcloud:widget:numtags' => 'Número de etiquetas a mostrar',
'tagcloud:site_cloud' => 'Nube de Tags del Sitio',
'tagcloud:allsitetags' => 'Tags de todo el sitio',
-);
+];
diff --git a/mod/tagcloud/languages/eu_es.php b/mod/tagcloud/languages/eu_es.php
index 48e0ce83350..7bf02baa056 100644
--- a/mod/tagcloud/languages/eu_es.php
+++ b/mod/tagcloud/languages/eu_es.php
@@ -1,8 +1,8 @@
'Etiketen hodeia',
'tagcloud:widget:description' => 'Etiketen hodeia',
'tagcloud:widget:numtags' => 'Erakutsiko diren etiketa kopurua',
'tagcloud:site_cloud' => 'Guneko etiketa hodeia',
'tagcloud:allsitetags' => 'Guneko etiketa guztiak',
-);
+];
diff --git a/mod/tagcloud/languages/fi.php b/mod/tagcloud/languages/fi.php
index 7cb2242324f..2877bb609df 100644
--- a/mod/tagcloud/languages/fi.php
+++ b/mod/tagcloud/languages/fi.php
@@ -1,8 +1,8 @@
'Tagipilvi',
'tagcloud:widget:description' => 'Tagipilvi',
'tagcloud:widget:numtags' => 'Näytettävien kohteiden määrä',
'tagcloud:site_cloud' => 'Tagipilvi',
'tagcloud:allsitetags' => 'Kaikki sivuston tagit',
-);
+];
diff --git a/mod/tagcloud/languages/fr.php b/mod/tagcloud/languages/fr.php
index 86f472cf2b2..6ef6854d30b 100644
--- a/mod/tagcloud/languages/fr.php
+++ b/mod/tagcloud/languages/fr.php
@@ -1,8 +1,8 @@
'Nuage de Tags',
'tagcloud:widget:description' => 'Nuage de tags',
'tagcloud:widget:numtags' => 'Nombre de tags à afficher',
'tagcloud:site_cloud' => 'Nuage de tag du site',
'tagcloud:allsitetags' => 'Tous les tags du site',
-);
+];
diff --git a/mod/tagcloud/languages/gl.php b/mod/tagcloud/languages/gl.php
index 40ac2bb7722..7fad83fffbe 100644
--- a/mod/tagcloud/languages/gl.php
+++ b/mod/tagcloud/languages/gl.php
@@ -1,8 +1,8 @@
'Nube de etiquetas',
'tagcloud:widget:description' => 'Nube de etiquetas',
'tagcloud:widget:numtags' => 'Número de etiquetas para mostrar',
'tagcloud:site_cloud' => 'Nube de etiquetas global',
'tagcloud:allsitetags' => 'Etiquetas globais',
-);
+];
diff --git a/mod/tagcloud/languages/it.php b/mod/tagcloud/languages/it.php
index 2cb77417587..32721928150 100644
--- a/mod/tagcloud/languages/it.php
+++ b/mod/tagcloud/languages/it.php
@@ -1,8 +1,8 @@
'Nuvola di tag',
'tagcloud:widget:description' => 'Nuvola di tag',
'tagcloud:widget:numtags' => 'Numero di tag da mostrare',
'tagcloud:site_cloud' => 'Nuvola di tag del sito',
'tagcloud:allsitetags' => 'Tutte le tag del sito',
-);
+];
diff --git a/mod/tagcloud/languages/ja.php b/mod/tagcloud/languages/ja.php
index 2263badc606..33f6d38137b 100644
--- a/mod/tagcloud/languages/ja.php
+++ b/mod/tagcloud/languages/ja.php
@@ -1,8 +1,8 @@
'タグクラウド',
'tagcloud:widget:description' => 'タグクラウド',
'tagcloud:widget:numtags' => 'タグの表示数',
'tagcloud:site_cloud' => 'タグクラウド',
'tagcloud:allsitetags' => '全タグ',
-);
+];
diff --git a/mod/tagcloud/languages/ko.php b/mod/tagcloud/languages/ko.php
index e931aed7997..2837ce770eb 100644
--- a/mod/tagcloud/languages/ko.php
+++ b/mod/tagcloud/languages/ko.php
@@ -1,8 +1,8 @@
'꼬리표 모음',
'tagcloud:widget:description' => '꼬리표 모음',
'tagcloud:widget:numtags' => '보여줄 꼬리표 수',
'tagcloud:site_cloud' => '누리집 꼬리표 구름',
'tagcloud:allsitetags' => '모든 꼬리표',
-);
+];
diff --git a/mod/tagcloud/languages/nl.php b/mod/tagcloud/languages/nl.php
index 661adf1b942..64e78bf7f9a 100644
--- a/mod/tagcloud/languages/nl.php
+++ b/mod/tagcloud/languages/nl.php
@@ -1,8 +1,8 @@
'Tagcloud',
'tagcloud:widget:description' => 'Tag cloud',
'tagcloud:widget:numtags' => 'Aantal tags om weer te geven',
'tagcloud:site_cloud' => 'Site tag-cloud',
'tagcloud:allsitetags' => 'Alle site-tags',
-);
+];
diff --git a/mod/tagcloud/languages/pl.php b/mod/tagcloud/languages/pl.php
index 678620c781f..5c5bb394ad2 100644
--- a/mod/tagcloud/languages/pl.php
+++ b/mod/tagcloud/languages/pl.php
@@ -1,8 +1,8 @@
'Chmura tagów',
'tagcloud:widget:description' => 'Chmura tagów',
'tagcloud:widget:numtags' => 'Ilość wyświetlanych tagów',
'tagcloud:site_cloud' => 'Chmura tagów strony',
'tagcloud:allsitetags' => 'Wszystkie tagi',
-);
+];
diff --git a/mod/tagcloud/languages/pt_br.php b/mod/tagcloud/languages/pt_br.php
index 70ad31e1bbd..658f3d24ad2 100644
--- a/mod/tagcloud/languages/pt_br.php
+++ b/mod/tagcloud/languages/pt_br.php
@@ -1,8 +1,8 @@
'Nuvem de palavras',
'tagcloud:widget:description' => 'Nuvem de palavras',
'tagcloud:widget:numtags' => 'Número de palavras a demonstrar',
'tagcloud:site_cloud' => 'Núvem de palavras do site',
'tagcloud:allsitetags' => 'Todos descritores (tags) do site',
-);
+];
diff --git a/mod/tagcloud/languages/ru.php b/mod/tagcloud/languages/ru.php
index b5e625d316b..8024550e447 100644
--- a/mod/tagcloud/languages/ru.php
+++ b/mod/tagcloud/languages/ru.php
@@ -1,8 +1,8 @@
'Облако тегов',
'tagcloud:widget:description' => 'Облако тегов',
'tagcloud:widget:numtags' => 'Количество тегов показывать',
'tagcloud:site_cloud' => 'Облако тегов сайта',
'tagcloud:allsitetags' => 'Все теги сайта',
-);
+];
diff --git a/mod/tagcloud/languages/sr.php b/mod/tagcloud/languages/sr.php
index 1030f245c13..c2880a2b46a 100644
--- a/mod/tagcloud/languages/sr.php
+++ b/mod/tagcloud/languages/sr.php
@@ -1,8 +1,8 @@
'Облак ознака',
'tagcloud:widget:description' => 'Облак ознака',
'tagcloud:widget:numtags' => 'Број ознака за приказ',
'tagcloud:site_cloud' => 'Облак ознака целог сајта',
'tagcloud:allsitetags' => 'Све ознаке сајта',
-);
+];
diff --git a/mod/tagcloud/views/default/elgg/tagcloud.css b/mod/tagcloud/views/default/elgg/tagcloud.css
index 4b083cf4154..70579d19833 100644
--- a/mod/tagcloud/views/default/elgg/tagcloud.css
+++ b/mod/tagcloud/views/default/elgg/tagcloud.css
@@ -2,3 +2,4 @@
text-align: justify;
margin-bottom: 5px;
}
+
diff --git a/mod/tagcloud/views/default/output/tagcloud.php b/mod/tagcloud/views/default/output/tagcloud.php
index c7be64b5590..cf49ca99af0 100644
--- a/mod/tagcloud/views/default/output/tagcloud.php
+++ b/mod/tagcloud/views/default/output/tagcloud.php
@@ -15,7 +15,6 @@
}
if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) {
-
$counter = 0;
$max = 0;
@@ -28,10 +27,9 @@
$params = $vars;
unset($params['tagcloud']);
- $tags = array();
+ $tags = [];
foreach ($vars['tagcloud'] as $tag) {
-
$params['value'] = $tag->tag;
// protecting against division by zero warnings
diff --git a/mod/tagcloud/views/default/page/elements/tagcloud_block.php b/mod/tagcloud/views/default/page/elements/tagcloud_block.php
index 6f0ce12ec72..c866905baab 100644
--- a/mod/tagcloud/views/default/page/elements/tagcloud_block.php
+++ b/mod/tagcloud/views/default/page/elements/tagcloud_block.php
@@ -13,7 +13,7 @@
$type = elgg_extract('type', $vars, 'object');
-$options = array(
+$options = [
'type' => $type,
'subtype' => elgg_extract('subtypes', $vars, ELGG_ENTITIES_ANY_VALUE),
'owner_guid' => $owner_guid,
@@ -21,16 +21,16 @@
'threshold' => 0,
'limit' => elgg_extract('limit', $vars, 50),
'tag_name' => 'tags',
-);
+];
$title = elgg_echo('tagcloud');
if (is_array($options['subtype']) && count($options['subtype']) > 1) {
// we cannot provide links to tagged objects with multiple types
$tag_data = elgg_get_tags($options);
- $cloud = elgg_view("output/tagcloud", array(
+ $cloud = elgg_view("output/tagcloud", [
'value' => $tag_data,
'type' => $type,
- ));
+ ]);
} else {
$cloud = elgg_view_tagcloud($options);
}
@@ -41,11 +41,11 @@
// add a link to all site tags
$cloud .= '';
$cloud .= elgg_view_icon('tag');
-$cloud .= elgg_view('output/url', array(
+$cloud .= elgg_view('output/url', [
'href' => 'tags',
'text' => elgg_echo('tagcloud:allsitetags'),
'is_trusted' => true,
-));
+]);
$cloud .= '
';
diff --git a/mod/tagcloud/views/default/resources/tagcloud.php b/mod/tagcloud/views/default/resources/tagcloud.php
index f829fe92961..72565edbc96 100644
--- a/mod/tagcloud/views/default/resources/tagcloud.php
+++ b/mod/tagcloud/views/default/resources/tagcloud.php
@@ -1,17 +1,17 @@
0,
'limit' => 100,
'tag_name' => 'tags',
-);
+];
$content = elgg_view_tagcloud($options);
-$body = elgg_view_layout('one_sidebar', array(
+$body = elgg_view_layout('one_sidebar', [
'title' => $title,
'content' => $content,
-));
+]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/tagcloud/views/default/tagcloud/theme_sandbox/component.php b/mod/tagcloud/views/default/tagcloud/theme_sandbox/component.php
index 73e43ab1c9b..4d5f82baec9 100644
--- a/mod/tagcloud/views/default/tagcloud/theme_sandbox/component.php
+++ b/mod/tagcloud/views/default/tagcloud/theme_sandbox/component.php
@@ -1,18 +1,18 @@
'php', 'total' => 2),
- (object)array('tag' => 'elgg', 'total' => 8),
- (object)array('tag' => 'javascript', 'total' => 3),
- (object)array('tag' => 'css', 'total' => 4),
- (object)array('tag' => 'html', 'total' => 1),
- (object)array('tag' => 'framework', 'total' => 4),
- (object)array('tag' => 'social', 'total' => 3),
- (object)array('tag' => 'web', 'total' => 7),
- (object)array('tag' => 'code', 'total' => 2),
-);
+$tags = [
+ (object) ['tag' => 'php', 'total' => 2],
+ (object) ['tag' => 'elgg', 'total' => 8],
+ (object) ['tag' => 'javascript', 'total' => 3],
+ (object) ['tag' => 'css', 'total' => 4],
+ (object) ['tag' => 'html', 'total' => 1],
+ (object) ['tag' => 'framework', 'total' => 4],
+ (object) ['tag' => 'social', 'total' => 3],
+ (object) ['tag' => 'web', 'total' => 7],
+ (object) ['tag' => 'code', 'total' => 2],
+];
$body = '';
-$body .= elgg_view('output/tagcloud', array('value' => $tags));
+$body .= elgg_view('output/tagcloud', ['value' => $tags]);
$body .= '
';
echo elgg_view_module('theme-sandbox-demo', 'Tag cloud (.elgg-tagcloud)', $body);
diff --git a/mod/thewire/actions/thewire/add.php b/mod/thewire/actions/thewire/add.php
index 3444fea2936..fec91b60394 100644
--- a/mod/thewire/actions/thewire/add.php
+++ b/mod/thewire/actions/thewire/add.php
@@ -1,7 +1,7 @@
canEdit()) {
-
// unset reply metadata on children
- $children = elgg_get_entities_from_relationship(array(
+ $children = elgg_get_entities_from_relationship([
'relationship' => 'parent',
'relationship_guid' => $guid,
'inverse_relationship' => true,
- ));
+ ]);
if ($children) {
foreach ($children as $child) {
$child->reply = false;
diff --git a/mod/thewire/languages/da.php b/mod/thewire/languages/da.php
index 28abe1db5b9..afca32a2ee5 100644
--- a/mod/thewire/languages/da.php
+++ b/mod/thewire/languages/da.php
@@ -1,5 +1,5 @@
"Maximum number of characters for wire messages:",
'thewire:settings:limit:none' => "No limit",
-);
+];
diff --git a/mod/thewire/languages/de.php b/mod/thewire/languages/de.php
index fe42a70bc69..0c9306371cb 100644
--- a/mod/thewire/languages/de.php
+++ b/mod/thewire/languages/de.php
@@ -1,5 +1,5 @@
"Maximal erlaubte Anzahl an Zeichen in Nachrichten im Heißen Draht:",
'thewire:settings:limit:none' => "Kein Limit",
-);
+];
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php
index d2649a4876a..efdc725b682 100644
--- a/mod/thewire/languages/en.php
+++ b/mod/thewire/languages/en.php
@@ -1,5 +1,5 @@
"Maximum number of characters for wire messages:",
'thewire:settings:limit:none' => "No limit",
-);
+];
diff --git a/mod/thewire/languages/es.php b/mod/thewire/languages/es.php
index 90e2388ed06..0ea40468061 100644
--- a/mod/thewire/languages/es.php
+++ b/mod/thewire/languages/es.php
@@ -1,5 +1,5 @@
"Maximum number of characters for wire messages:",
'thewire:settings:limit:none' => "No limit",
-);
+];
diff --git a/mod/thewire/languages/eu_es.php b/mod/thewire/languages/eu_es.php
index 0f375b07d94..92a16c67046 100644
--- a/mod/thewire/languages/eu_es.php
+++ b/mod/thewire/languages/eu_es.php
@@ -1,5 +1,5 @@
"Hariko mezurako karaktere kopuru maximoa:",
'thewire:settings:limit:none' => "Muga gabe",
-);
+];
diff --git a/mod/thewire/languages/fi.php b/mod/thewire/languages/fi.php
index 2d0a22251b0..4439268537c 100644
--- a/mod/thewire/languages/fi.php
+++ b/mod/thewire/languages/fi.php
@@ -1,5 +1,5 @@
"Tilapäivityksen suurin sallittu merkkimäärä:",
'thewire:settings:limit:none' => "Ei rajaa",
-);
+];
diff --git a/mod/thewire/languages/fr.php b/mod/thewire/languages/fr.php
index 2e3bca887d0..759f7ff3c59 100644
--- a/mod/thewire/languages/fr.php
+++ b/mod/thewire/languages/fr.php
@@ -1,5 +1,5 @@
"Nombre maximum de caractères pour chaque commentaire :",
'thewire:settings:limit:none' => "Pas de limite",
-);
+];
diff --git a/mod/thewire/languages/gl.php b/mod/thewire/languages/gl.php
index debe7312dc0..fc9fc3284c6 100644
--- a/mod/thewire/languages/gl.php
+++ b/mod/thewire/languages/gl.php
@@ -1,5 +1,5 @@
"Número máximo de caracteres por chío:",
'thewire:settings:limit:none' => "Sen límite",
-);
+];
diff --git a/mod/thewire/languages/it.php b/mod/thewire/languages/it.php
index 62c05bcbfdb..ac089b79a70 100644
--- a/mod/thewire/languages/it.php
+++ b/mod/thewire/languages/it.php
@@ -1,5 +1,5 @@
"Numero massimo di caratteri per gli aggiornamenti di stato:",
'thewire:settings:limit:none' => "Nessun limite",
-);
+];
diff --git a/mod/thewire/languages/ja.php b/mod/thewire/languages/ja.php
index f26c7bdf30f..82c1a497ebd 100644
--- a/mod/thewire/languages/ja.php
+++ b/mod/thewire/languages/ja.php
@@ -1,5 +1,5 @@
"つぶやきに使用できる最大の文字数:",
'thewire:settings:limit:none' => "制限なし",
-);
+];
diff --git a/mod/thewire/languages/ko.php b/mod/thewire/languages/ko.php
index 385d6355513..b92ebce5e43 100644
--- a/mod/thewire/languages/ko.php
+++ b/mod/thewire/languages/ko.php
@@ -1,5 +1,5 @@
"쪽글의 최대 문자수:",
'thewire:settings:limit:none' => "제한없슴",
-);
+];
diff --git a/mod/thewire/languages/nl.php b/mod/thewire/languages/nl.php
index 653842d793b..2b504d6f56b 100644
--- a/mod/thewire/languages/nl.php
+++ b/mod/thewire/languages/nl.php
@@ -1,5 +1,5 @@
"Maximum aantal karakters voor Wire-berichten:",
'thewire:settings:limit:none' => "Geen limiet",
-);
+];
diff --git a/mod/thewire/languages/pl.php b/mod/thewire/languages/pl.php
index 3cb986a97a9..42a2916af53 100644
--- a/mod/thewire/languages/pl.php
+++ b/mod/thewire/languages/pl.php
@@ -1,5 +1,5 @@
"Maximum number of characters for wire messages:",
'thewire:settings:limit:none' => "Bez limitu",
-);
+];
diff --git a/mod/thewire/languages/pt_br.php b/mod/thewire/languages/pt_br.php
index 98abeb37130..018ab8e355a 100644
--- a/mod/thewire/languages/pt_br.php
+++ b/mod/thewire/languages/pt_br.php
@@ -1,12 +1,12 @@
"Micro-blog",
'thewire:everyone' => "Todas mensagens do Micro-blog",
- 'thewire:user' => "Micro-blog de %s
+ 'thewire:user' => "Micro-blog de %s
",
'thewire:friends' => "Seus amigos no Micro-blog",
'thewire:replying' => "Responder para %s quem escreveu",
@@ -56,4 +56,4 @@
*/
'thewire:settings:limit' => "Número máximo de caracteres para mensagens no micro-blog:",
'thewire:settings:limit:none' => "Sem limite",
-);
+];
diff --git a/mod/thewire/languages/ru.php b/mod/thewire/languages/ru.php
index a87d8880953..a8a2bae023e 100644
--- a/mod/thewire/languages/ru.php
+++ b/mod/thewire/languages/ru.php
@@ -1,5 +1,5 @@
"Максимальное количество символов сообщения:",
'thewire:settings:limit:none' => "Без ограничения",
-);
+];
diff --git a/mod/thewire/languages/sr.php b/mod/thewire/languages/sr.php
index a01c26f7030..a80cee0b128 100644
--- a/mod/thewire/languages/sr.php
+++ b/mod/thewire/languages/sr.php
@@ -1,5 +1,5 @@
"Максимални број знакова у објави на жици:",
'thewire:settings:limit:none' => "Без ограничења",
-);
+];
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index b3a77f18fe4..62e05372653 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -76,7 +76,7 @@ function thewire_init() {
function thewire_page_handler($page) {
if (!isset($page[0])) {
- $page = array('all');
+ $page = ['all'];
}
switch ($page[0]) {
@@ -162,22 +162,22 @@ function thewire_prepare_notification($hook, $type, $notification, $params) {
$method = $params['method'];
$descr = $entity->description;
- $subject = elgg_echo('thewire:notify:subject', array($owner->name), $language);
+ $subject = elgg_echo('thewire:notify:subject', [$owner->name], $language);
if ($entity->reply) {
$parent = thewire_get_parent($entity->guid);
if ($parent) {
$parent_owner = $parent->getOwnerEntity();
- $body = elgg_echo('thewire:notify:reply', array($owner->name, $parent_owner->name), $language);
+ $body = elgg_echo('thewire:notify:reply', [$owner->name, $parent_owner->name], $language);
}
} else {
- $body = elgg_echo('thewire:notify:post', array($owner->name), $language);
+ $body = elgg_echo('thewire:notify:post', [$owner->name], $language);
}
$body .= "\n\n" . $descr . "\n\n";
- $body .= elgg_echo('thewire:notify:footer', array($entity->getURL()), $language);
+ $body .= elgg_echo('thewire:notify:footer', [$entity->getURL()], $language);
$notification->subject = $subject;
$notification->body = $body;
- $notification->summary = elgg_echo('thewire:notify:summary', array($descr), $language);
+ $notification->summary = elgg_echo('thewire:notify:summary', [$descr], $language);
$notification->url = $entity->getURL();
return $notification;
}
@@ -191,7 +191,7 @@ function thewire_prepare_notification($hook, $type, $notification, $params) {
function thewire_get_hashtags($text) {
// beginning of text or white space followed by hashtag
// hashtag must begin with # and contain at least one character not digit, space, or punctuation
- $matches = array();
+ $matches = [];
preg_match_all('/(^|[^\w])#(\w*[^\s\d!-\/:-@]+\w*)/', $text, $matches);
return $matches[2];
}
@@ -284,21 +284,21 @@ function thewire_save_post($text, $userid, $access_id, $parent_guid = 0, $method
}
if ($guid) {
- elgg_create_river_item(array(
+ elgg_create_river_item([
'view' => 'river/object/thewire/create',
'action_type' => 'create',
'subject_guid' => $post->owner_guid,
'object_guid' => $post->guid,
- ));
+ ]);
// let other plugins know we are setting a user status
- $params = array(
+ $params = [
'entity' => $post,
'user' => $post->getOwnerEntity(),
'message' => $post->description,
'url' => $post->getURL(),
'origin' => 'thewire',
- );
+ ];
elgg_trigger_plugin_hook('status', 'user', $params);
}
@@ -319,14 +319,14 @@ function thewire_add_original_poster($hook, $type, $subscriptions, $params) {
$event = $params['event'];
$entity = $event->getObject();
if ($entity && elgg_instanceof($entity, 'object', 'thewire')) {
- $parent = $entity->getEntitiesFromRelationship(array('relationship' => 'parent'));
+ $parent = $entity->getEntitiesFromRelationship(['relationship' => 'parent']);
if ($parent) {
$parent = $parent[0];
// do not add a subscription if reply was to self
if ($parent->getOwnerGUID() !== $entity->getOwnerGUID()) {
if (!array_key_exists($parent->getOwnerGUID(), $subscriptions)) {
- $personal_methods = (array)get_user_notification_settings($parent->getOwnerGUID());
- $methods = array();
+ $personal_methods = (array) get_user_notification_settings($parent->getOwnerGUID());
+ $methods = [];
foreach ($personal_methods as $method => $state) {
if ($state) {
$methods[] = $method;
@@ -348,11 +348,11 @@ function thewire_add_original_poster($hook, $type, $subscriptions, $params) {
* @return guid
*/
function thewire_latest_guid() {
- $post = elgg_get_entities(array(
+ $post = elgg_get_entities([
'type' => 'object',
'subtype' => 'thewire',
'limit' => 1,
- ));
+ ]);
if ($post) {
return $post[0]->guid;
} else {
@@ -367,10 +367,10 @@ function thewire_latest_guid() {
* @return ElggObject or null
*/
function thewire_get_parent($post_guid) {
- $parents = elgg_get_entities_from_relationship(array(
+ $parents = elgg_get_entities_from_relationship([
'relationship' => 'parent',
'relationship_guid' => $post_guid,
- ));
+ ]);
if ($parents) {
return $parents[0];
}
@@ -404,33 +404,33 @@ function thewire_setup_entity_menu_items($hook, $type, $value, $params) {
$entity = $params['entity'];
if (elgg_is_logged_in()) {
- $options = array(
+ $options = [
'name' => 'reply',
'text' => elgg_echo('reply'),
'href' => "thewire/reply/$entity->guid",
'priority' => 150,
- );
+ ];
$value[] = ElggMenuItem::factory($options);
}
if ($entity->reply) {
- $options = array(
+ $options = [
'name' => 'previous',
'text' => elgg_echo('previous'),
'href' => "thewire/previous/$entity->guid",
'priority' => 160,
'link_class' => 'thewire-previous',
'title' => elgg_echo('thewire:previous:help'),
- );
+ ];
$value[] = ElggMenuItem::factory($options);
}
- $options = array(
+ $options = [
'name' => 'thread',
'text' => elgg_echo('thewire:thread'),
'href' => "thewire/thread/$entity->wire_thread",
'priority' => 170,
- );
+ ];
$value[] = ElggMenuItem::factory($options);
return $value;
diff --git a/mod/thewire/views/default/elgg/thewire.js b/mod/thewire/views/default/elgg/thewire.js
index a7e4390cc51..999c2da76c4 100644
--- a/mod/thewire/views/default/elgg/thewire.js
+++ b/mod/thewire/views/default/elgg/thewire.js
@@ -73,7 +73,6 @@ define(function (require) {
}
}
});
-
}
event.preventDefault();
@@ -88,3 +87,4 @@ define(function (require) {
*/
elgg.thewire = TW;
});
+
diff --git a/mod/thewire/views/default/forms/thewire/add.php b/mod/thewire/views/default/forms/thewire/add.php
index ed9c06ff536..945c07b9855 100644
--- a/mod/thewire/views/default/forms/thewire/add.php
+++ b/mod/thewire/views/default/forms/thewire/add.php
@@ -8,7 +8,7 @@
elgg_require_js('elgg/thewire');
$post = elgg_extract('post', $vars);
-$char_limit = (int)elgg_get_plugin_setting('limit', 'thewire');
+$char_limit = (int) elgg_get_plugin_setting('limit', 'thewire');
$text = elgg_echo('post');
if ($post) {
@@ -18,10 +18,10 @@
$parent_input = '';
if ($post) {
- $parent_input = elgg_view('input/hidden', array(
+ $parent_input = elgg_view('input/hidden', [
'name' => 'parent_guid',
'value' => $post->guid,
- ));
+ ]);
}
$count_down = "$char_limit $chars_left";
@@ -33,19 +33,19 @@
$num_lines = 3;
}
-$post_input = elgg_view('input/plaintext', array(
+$post_input = elgg_view('input/plaintext', [
'name' => 'body',
'class' => 'mtm',
'id' => 'thewire-textarea',
'rows' => $num_lines,
'data-max-length' => $char_limit,
'required' => true,
-));
+]);
-$submit_button = elgg_view('input/submit', array(
+$submit_button = elgg_view('input/submit', [
'value' => $text,
'id' => 'thewire-submit-button',
-));
+]);
echo << $post,
'handler' => 'thewire',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
- ));
+ ]);
}
-$params = array(
+$params = [
'entity' => $post,
'title' => false,
'metadata' => $metadata,
@@ -42,7 +42,7 @@
'tags' => false,
'icon' => elgg_view_entity_icon($post->getOwnerEntity(), 'tiny'),
'class' => 'thewire-post',
-);
+];
$params = $params + $vars;
echo elgg_view('object/elements/summary', $params);
diff --git a/mod/thewire/views/default/plugins/thewire/settings.php b/mod/thewire/views/default/plugins/thewire/settings.php
index e12cbf195b0..75c77e956f4 100644
--- a/mod/thewire/views/default/plugins/thewire/settings.php
+++ b/mod/thewire/views/default/plugins/thewire/settings.php
@@ -6,16 +6,16 @@
$plugin = $vars['entity'];
$label = elgg_echo('thewire:settings:limit');
-$input = elgg_view('input/select', array(
+$input = elgg_view('input/select', [
'name' => 'params[limit]',
- 'value' => (int)$vars['entity']->limit,
+ 'value' => (int) $vars['entity']->limit,
'id' => 'thewire-limit',
- 'options_values' => array(
+ 'options_values' => [
0 => elgg_echo('thewire:settings:limit:none'),
140 => '140',
250 => '250',
- ),
-));
+ ],
+]);
echo <<
diff --git a/mod/thewire/views/default/resources/thewire/everyone.php b/mod/thewire/views/default/resources/thewire/everyone.php
index c4ae1c04a8a..6a12e232777 100644
--- a/mod/thewire/views/default/resources/thewire/everyone.php
+++ b/mod/thewire/views/default/resources/thewire/everyone.php
@@ -1,7 +1,7 @@
'thewire-form');
+ $form_vars = ['class' => 'thewire-form'];
$content .= elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
}
-$content .= elgg_list_entities(array(
+$content .= elgg_list_entities([
'type' => 'object',
'subtype' => 'thewire',
'limit' => get_input('limit', 15),
'preload_owners' => true,
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => 'all',
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('thewire/sidebar'),
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/friends.php b/mod/thewire/views/default/resources/thewire/friends.php
index 51fb75c9eb7..d62f92230bc 100644
--- a/mod/thewire/views/default/resources/thewire/friends.php
+++ b/mod/thewire/views/default/resources/thewire/friends.php
@@ -15,12 +15,12 @@
elgg_push_breadcrumb(elgg_echo('friends'));
if (elgg_get_logged_in_user_guid() == $owner->guid) {
- $form_vars = array('class' => 'thewire-form');
+ $form_vars = ['class' => 'thewire-form'];
$content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
}
-$content .= elgg_list_entities_from_relationship(array(
+$content .= elgg_list_entities_from_relationship([
'type' => 'object',
'subtype' => 'thewire',
'full_view' => false,
@@ -28,12 +28,12 @@
'relationship_guid' => $owner->guid,
'relationship_join_on' => 'container_guid',
'preload_owners' => true,
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => 'friends',
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/owner.php b/mod/thewire/views/default/resources/thewire/owner.php
index dc25940e177..5ab6f750e90 100644
--- a/mod/thewire/views/default/resources/thewire/owner.php
+++ b/mod/thewire/views/default/resources/thewire/owner.php
@@ -1,7 +1,7 @@
name));
+$title = elgg_echo('thewire:user', [$owner->name]);
elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name);
$context = '';
if (elgg_get_logged_in_user_guid() == $owner->guid) {
- $form_vars = array('class' => 'thewire-form');
+ $form_vars = ['class' => 'thewire-form'];
$content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
$context = 'mine';
}
-$content .= elgg_list_entities(array(
+$content .= elgg_list_entities([
'type' => 'object',
'subtype' => 'thewire',
'owner_guid' => $owner->guid,
'limit' => get_input('limit', 15),
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter_context' => $context,
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('thewire/sidebar'),
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/previous.php b/mod/thewire/views/default/resources/thewire/previous.php
index 3901c08cbce..6dbad803a0d 100644
--- a/mod/thewire/views/default/resources/thewire/previous.php
+++ b/mod/thewire/views/default/resources/thewire/previous.php
@@ -11,10 +11,10 @@
$body = elgg_view_entity($parent);
}
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => false,
'content' => $body,
'title' => $title,
-));
+]);
-echo elgg_view_page($title, $body);
\ No newline at end of file
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/reply.php b/mod/thewire/views/default/resources/thewire/reply.php
index 38c49db289e..a41530caf16 100644
--- a/mod/thewire/views/default/resources/thewire/reply.php
+++ b/mod/thewire/views/default/resources/thewire/reply.php
@@ -13,16 +13,16 @@
elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
elgg_push_breadcrumb($title);
-$content = elgg_view('thewire/reply', array('post' => $post));
-$form_vars = array('class' => 'thewire-form');
-$content .= elgg_view_form('thewire/add', $form_vars, array('post' => $post));
+$content = elgg_view('thewire/reply', ['post' => $post]);
+$form_vars = ['class' => 'thewire-form'];
+$content .= elgg_view_form('thewire/add', $form_vars, ['post' => $post]);
$content .= elgg_view('input/urlshortener');
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => false,
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/tag.php b/mod/thewire/views/default/resources/thewire/tag.php
index 876b1a8b8f4..364c5471239 100644
--- a/mod/thewire/views/default/resources/thewire/tag.php
+++ b/mod/thewire/views/default/resources/thewire/tag.php
@@ -14,22 +14,22 @@
// remove # from tag
$tag = trim($tag, '# ');
-$title = elgg_echo('thewire:tags', array($tag));
+$title = elgg_echo('thewire:tags', [$tag]);
-$content = elgg_list_entities_from_metadata(array(
+$content = elgg_list_entities_from_metadata([
'metadata_name' => 'tags',
'metadata_value' => $tag,
'metadata_case_sensitive' => false,
'type' => 'object',
'subtype' => 'thewire',
'limit' => 15,
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => false,
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/thread.php b/mod/thewire/views/default/resources/thewire/thread.php
index a2b4de594d3..fc8415cf0f8 100644
--- a/mod/thewire/views/default/resources/thewire/thread.php
+++ b/mod/thewire/views/default/resources/thewire/thread.php
@@ -10,19 +10,19 @@
elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
elgg_push_breadcrumb($title);
-$content = elgg_list_entities_from_metadata(array(
+$content = elgg_list_entities_from_metadata([
"metadata_name" => "wire_thread",
"metadata_value" => $thread_id,
"type" => "object",
"subtype" => "thewire",
"limit" => max(20, elgg_get_config('default_limit')),
'preload_owners' => true,
-));
+]);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => false,
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/resources/thewire/view.php b/mod/thewire/views/default/resources/thewire/view.php
index 423d25e737d..aaac47c4e2c 100644
--- a/mod/thewire/views/default/resources/thewire/view.php
+++ b/mod/thewire/views/default/resources/thewire/view.php
@@ -13,7 +13,7 @@
forward();
}
-$title = elgg_echo('thewire:by', array($owner->name));
+$title = elgg_echo('thewire:by', [$owner->name]);
elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
elgg_push_breadcrumb($owner->name, 'thewire/owner/' . $owner->username);
@@ -21,10 +21,10 @@
$content = elgg_view_entity($post);
-$body = elgg_view_layout('content', array(
+$body = elgg_view_layout('content', [
'filter' => false,
'content' => $content,
'title' => $title,
-));
+]);
echo elgg_view_page($title, $body);
diff --git a/mod/thewire/views/default/river/object/thewire/create.php b/mod/thewire/views/default/river/object/thewire/create.php
index 4ee00d7a980..08fe1dba602 100644
--- a/mod/thewire/views/default/river/object/thewire/create.php
+++ b/mod/thewire/views/default/river/object/thewire/create.php
@@ -11,27 +11,27 @@
$excerpt = thewire_filter($excerpt);
$subject = $item->getSubjectEntity();
-$subject_link = elgg_view('output/url', array(
+$subject_link = elgg_view('output/url', [
'href' => $subject->getURL(),
'text' => $subject->name,
'class' => 'elgg-river-subject',
'is_trusted' => true,
-));
+]);
-$object_link = elgg_view('output/url', array(
+$object_link = elgg_view('output/url', [
'href' => "thewire/owner/$subject->username",
'text' => elgg_echo('thewire:wire'),
'class' => 'elgg-river-object',
'is_trusted' => true,
-));
+]);
-$summary = elgg_echo("river:create:object:thewire", array($subject_link, $object_link));
+$summary = elgg_echo("river:create:object:thewire", [$subject_link, $object_link]);
-echo elgg_view('river/elements/layout', array(
+echo elgg_view('river/elements/layout', [
'item' => $item,
'message' => $excerpt,
'summary' => $summary,
// truthy value to bypass responses rendering
'responses' => ' ',
-));
\ No newline at end of file
+]);
diff --git a/mod/thewire/views/default/thewire.js b/mod/thewire/views/default/thewire.js
index bc98430e945..c9bd5221314 100644
--- a/mod/thewire/views/default/thewire.js
+++ b/mod/thewire/views/default/thewire.js
@@ -75,10 +75,10 @@ elgg.thewire.viewPrevious = function(event) {
}
}
});
-
}
event.preventDefault();
};
elgg.register_hook_handler('init', 'system', elgg.thewire.init);
+
diff --git a/mod/thewire/views/default/thewire/css.php b/mod/thewire/views/default/thewire/css.php
index 4941e43346b..68a27adab4f 100644
--- a/mod/thewire/views/default/thewire/css.php
+++ b/mod/thewire/views/default/thewire/css.php
@@ -38,4 +38,4 @@
#profile-details .wire-status {
margin-top: 10px;
-}
\ No newline at end of file
+}
diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php
index 55ea494e3ec..7344d9bca52 100644
--- a/mod/thewire/views/default/thewire/profile_status.php
+++ b/mod/thewire/views/default/thewire/profile_status.php
@@ -8,12 +8,12 @@
$owner = $vars['entity']->guid;
//grab the user's latest from the wire
-$params = array(
+$params = [
'type' => 'object',
'subtype' => 'thewire',
'owner_guid' => $owner,
'limit' => 1,
-);
+];
$latest_wire = elgg_get_entities($params);
if ($latest_wire && count($latest_wire) > 0) {
@@ -24,21 +24,20 @@
$button = '';
if ($owner == elgg_get_logged_in_user_guid()) {
$url_to_wire = "thewire/owner/" . $vars['entity']->username;
- $button = elgg_view('output/url', array(
+ $button = elgg_view('output/url', [
'text' => elgg_echo('update'),
'href' => $url_to_wire,
'class' => 'elgg-button elgg-button-action float-alt',
'is_trusted' => true,
- ));
+ ]);
}
$body = $content . $time;
- $content = elgg_view_image_block('', $body, array('image_alt' => $button));
+ $content = elgg_view_image_block('', $body, ['image_alt' => $button]);
echo <<< HTML
$content
HTML;
-
}
diff --git a/mod/thewire/views/default/thewire/reply.php b/mod/thewire/views/default/thewire/reply.php
index 341b691b19f..efd3e904083 100644
--- a/mod/thewire/views/default/thewire/reply.php
+++ b/mod/thewire/views/default/thewire/reply.php
@@ -5,10 +5,10 @@
$post = $vars['post'];
$poster = $post->getOwnerEntity();
-$poster_details = array(
+$poster_details = [
htmlspecialchars($poster->name, ENT_QUOTES, 'UTF-8'),
htmlspecialchars($poster->username, ENT_QUOTES, 'UTF-8'),
-);
+];
?>
:
-description;
\ No newline at end of file
+description;
diff --git a/mod/thewire/views/default/thewire/sidebar.php b/mod/thewire/views/default/thewire/sidebar.php
index 0947f91eda3..1ae942e4292 100644
--- a/mod/thewire/views/default/thewire/sidebar.php
+++ b/mod/thewire/views/default/thewire/sidebar.php
@@ -3,7 +3,7 @@
* The wire sidebar
*/
-echo elgg_view('page/elements/tagcloud_block', array(
+echo elgg_view('page/elements/tagcloud_block', [
'subtypes' => 'thewire',
'container_guid' => elgg_get_page_owner_guid(),
-));
+]);
diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php
index 8fddb8aa8ba..685b962efb3 100644
--- a/mod/thewire/views/rss/object/thewire.php
+++ b/mod/thewire/views/rss/object/thewire.php
@@ -10,7 +10,7 @@
return true;
}
-$title = elgg_echo('thewire:by', array($owner->name));
+$title = elgg_echo('thewire:by', [$owner->name]);
$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');
$pubdate = date('r', $vars['entity']->getTimeCreated());
diff --git a/mod/thewire/views/rss/search/object/thewire/entity.php b/mod/thewire/views/rss/search/object/thewire/entity.php
index d9ea81ad133..54c1367aa63 100644
--- a/mod/thewire/views/rss/search/object/thewire/entity.php
+++ b/mod/thewire/views/rss/search/object/thewire/entity.php
@@ -7,12 +7,12 @@
*/
if (!array_key_exists('entity', $vars)) {
- return FALSE;
+ return false;
}
$owner = $vars['entity']->getOwnerEntity();
if ($owner) {
- $title = elgg_echo('thewire:by', array($owner->name));
+ $title = elgg_echo('thewire:by', [$owner->name]);
}
$description = $vars['entity']->getVolatileData('search_matched_description');
diff --git a/mod/twitter_api/actions/twitter_api/interstitial_settings.php b/mod/twitter_api/actions/twitter_api/interstitial_settings.php
index 51357e8625b..992acf6fe2d 100644
--- a/mod/twitter_api/actions/twitter_api/interstitial_settings.php
+++ b/mod/twitter_api/actions/twitter_api/interstitial_settings.php
@@ -49,4 +49,4 @@
elgg_clear_sticky_form('twitter_api_interstitial');
system_message(elgg_echo('twitter_api:interstitial:saved'));
-forward('/');
\ No newline at end of file
+forward('/');
diff --git a/mod/twitter_api/languages/da.php b/mod/twitter_api/languages/da.php
index 1787b49be56..f995e18022a 100644
--- a/mod/twitter_api/languages/da.php
+++ b/mod/twitter_api/languages/da.php
@@ -1,5 +1,5 @@
'Twitter Services',
'twitter_api:requires_oauth' => 'Twitter Services kræver at OAuth Libraries plugin er aktiveret.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Your passwords do not match.',
'twitter_api:interstitial:cannot_save' => 'Cannot save account details.',
'twitter_api:interstitial:saved' => 'Account details saved!',
-);
+];
diff --git a/mod/twitter_api/languages/de.php b/mod/twitter_api/languages/de.php
index a788c2ccfe3..8a303a06d46 100644
--- a/mod/twitter_api/languages/de.php
+++ b/mod/twitter_api/languages/de.php
@@ -1,5 +1,5 @@
'Twitter-Service',
'twitter_api:requires_oauth' => 'Für die Twitter-Services muss das OAuth-Libraries-Plugin aktiviert sein.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Die beiden Passwort-Eingaben stimmen nicht überein.',
'twitter_api:interstitial:cannot_save' => 'Das Speichern der Eingaben ist fehlgeschlagen!',
'twitter_api:interstitial:saved' => 'Die Eingaben wurden gespeichert.',
-);
+];
diff --git a/mod/twitter_api/languages/en.php b/mod/twitter_api/languages/en.php
index e8aaeabf92c..b2df2ef9195 100644
--- a/mod/twitter_api/languages/en.php
+++ b/mod/twitter_api/languages/en.php
@@ -1,5 +1,5 @@
'Twitter Services',
'twitter_api:requires_oauth' => 'Twitter Services requires the OAuth Libraries plugin to be enabled.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Your passwords do not match.',
'twitter_api:interstitial:cannot_save' => 'Cannot save account details.',
'twitter_api:interstitial:saved' => 'Account details saved!',
-);
+];
diff --git a/mod/twitter_api/languages/es.php b/mod/twitter_api/languages/es.php
index 6080d55e06c..59f616aeff8 100644
--- a/mod/twitter_api/languages/es.php
+++ b/mod/twitter_api/languages/es.php
@@ -1,5 +1,5 @@
'Servicios de Twitter',
'twitter_api:requires_oauth' => 'Los servicios de Twitter requieren que el plugin de la biblioteca OAuth Librares esté habilitada.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Las contraseñas no coinciden.',
'twitter_api:interstitial:cannot_save' => 'No se pudieron guardar los detalles de la cuenta.',
'twitter_api:interstitial:saved' => 'Configuración de la cuenta guardada',
-);
+];
diff --git a/mod/twitter_api/languages/eu_es.php b/mod/twitter_api/languages/eu_es.php
index 172f590031b..60cd43af83e 100644
--- a/mod/twitter_api/languages/eu_es.php
+++ b/mod/twitter_api/languages/eu_es.php
@@ -1,5 +1,5 @@
'Twitter Zerbitzuak',
'twitter_api:requires_oauth' => 'Twitter Zerbitzuak OAuth Liburutegi plugina behar du gaitu ahal izateko.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Zure pasahitzak ez datoz bat.',
'twitter_api:interstitial:cannot_save' => 'Ezin dira kontuko xehetasunak gorde.',
'twitter_api:interstitial:saved' => 'Kontuko xehetasunak gorde dira!',
-);
+];
diff --git a/mod/twitter_api/languages/fi.php b/mod/twitter_api/languages/fi.php
index a758300692f..a9f1f5859ba 100644
--- a/mod/twitter_api/languages/fi.php
+++ b/mod/twitter_api/languages/fi.php
@@ -1,5 +1,5 @@
'Twitter-kirjautuminen',
'twitter_api:requires_oauth' => 'Tämä liitännäinen vaatii, että OAuth-kirjastoliitännäinen on käytössä.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Salasanat eivät täsmää.',
'twitter_api:interstitial:cannot_save' => 'Tietojen tallentaminen epäonnistui.',
'twitter_api:interstitial:saved' => 'Tiedot tallennettu!',
-);
+];
diff --git a/mod/twitter_api/languages/fr.php b/mod/twitter_api/languages/fr.php
index 064f4ea8d27..a2f8b9309c4 100644
--- a/mod/twitter_api/languages/fr.php
+++ b/mod/twitter_api/languages/fr.php
@@ -1,5 +1,5 @@
'Services Twitter',
'twitter_api:requires_oauth' => 'Les Services Twitter nécessitent l\'activation du plugin des bibliothèques OAuth pour pouvoir être activés.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Vos mots de passe ne correspondent pas.',
'twitter_api:interstitial:cannot_save' => 'Impossible d\'enregistrer les informations du compte.',
'twitter_api:interstitial:saved' => 'Informations du compte enregistrées !',
-);
+];
diff --git a/mod/twitter_api/languages/gl.php b/mod/twitter_api/languages/gl.php
index 3d89bebc9cb..a8850913a7e 100644
--- a/mod/twitter_api/languages/gl.php
+++ b/mod/twitter_api/languages/gl.php
@@ -1,5 +1,5 @@
'Servizos de Twitter',
'twitter_api:requires_oauth' => '«Servizos de Twitter» necesita o complemento «Bibliotecas de OAuth».',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Os contrasinais non coinciden.',
'twitter_api:interstitial:cannot_save' => 'Non foi posíbel gardar os detalles da conta.',
'twitter_api:interstitial:saved' => 'Gardáronse os detalles da conta.',
-);
+];
diff --git a/mod/twitter_api/languages/it.php b/mod/twitter_api/languages/it.php
index 8ebd179062c..addcf172f17 100644
--- a/mod/twitter_api/languages/it.php
+++ b/mod/twitter_api/languages/it.php
@@ -1,5 +1,5 @@
'Servizi Twitter',
'twitter_api:requires_oauth' => 'Twitter Services requires the OAuth Libraries plugin to be enabled.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Le tue password non coincidono.',
'twitter_api:interstitial:cannot_save' => 'Impossibile salvare i dettagli dell\'account.',
'twitter_api:interstitial:saved' => 'Dettagli account salvati!',
-);
+];
diff --git a/mod/twitter_api/languages/ja.php b/mod/twitter_api/languages/ja.php
index 6c937f504a0..fee1754508a 100644
--- a/mod/twitter_api/languages/ja.php
+++ b/mod/twitter_api/languages/ja.php
@@ -1,5 +1,5 @@
'Twitter サービス',
'twitter_api:requires_oauth' => 'Twitterサービス機能を使用するには OAuth Libraries plugin が起動されている必要があります',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'パスワードが違います。',
'twitter_api:interstitial:cannot_save' => 'アカウントの詳細を細んすることができませんでした。',
'twitter_api:interstitial:saved' => 'アカウントの詳細を保存しました!',
-);
+];
diff --git a/mod/twitter_api/languages/nl.php b/mod/twitter_api/languages/nl.php
index 2d674348e7a..31135bf1b08 100644
--- a/mod/twitter_api/languages/nl.php
+++ b/mod/twitter_api/languages/nl.php
@@ -1,5 +1,5 @@
'Twitter Services',
'twitter_api:requires_oauth' => 'Twitter Services vereist dat de OAuth libraries-plugin is ingeschakeld.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Je wachtwoorden komen niet overeen.',
'twitter_api:interstitial:cannot_save' => 'De accountdetails kunnen niet worden opgeslagen.',
'twitter_api:interstitial:saved' => 'Accountdetails opgeslagen!',
-);
+];
diff --git a/mod/twitter_api/languages/pl.php b/mod/twitter_api/languages/pl.php
index de13731ca7a..13d63dd1d8e 100644
--- a/mod/twitter_api/languages/pl.php
+++ b/mod/twitter_api/languages/pl.php
@@ -1,5 +1,5 @@
'Usługi Twittera',
'twitter_api:requires_oauth' => 'Usługi Twittera wymagają włączonego pluginu dostarczającego bibliotekę OAuth.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Twoje hasła do siebie nie pasują.',
'twitter_api:interstitial:cannot_save' => 'Nie udało się zapisać szczegółów konta.',
'twitter_api:interstitial:saved' => 'Szczegóły konta zostały zapisane!',
-);
+];
diff --git a/mod/twitter_api/languages/pt_br.php b/mod/twitter_api/languages/pt_br.php
index 8672828fd9d..30f60779ebd 100644
--- a/mod/twitter_api/languages/pt_br.php
+++ b/mod/twitter_api/languages/pt_br.php
@@ -1,5 +1,5 @@
'Servicos do Twitter',
'twitter_api:requires_oauth' => 'Servicos do Twitter necessitam que o plugin da Biblioteca \'OAuth\' esteja habilitado.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Suas senhas não são iguais.',
'twitter_api:interstitial:cannot_save' => 'Não foi possível salvar os detalhes da conta.',
'twitter_api:interstitial:saved' => 'Detalhes da conta foram salvos.',
-);
+];
diff --git a/mod/twitter_api/languages/ru.php b/mod/twitter_api/languages/ru.php
index aa06bfac59c..35081b46a6f 100644
--- a/mod/twitter_api/languages/ru.php
+++ b/mod/twitter_api/languages/ru.php
@@ -1,5 +1,5 @@
'Сервисы Twitter',
'twitter_api:requires_oauth' => 'Сервисы Twitter требуют, чтобы плагин OAuth был включен.',
@@ -53,4 +53,4 @@
'twitter_api:interstitial:password_mismatch' => 'Ваши пароли не совпадают.',
'twitter_api:interstitial:cannot_save' => 'Не могу сохранить аккаунт.',
'twitter_api:interstitial:saved' => 'Аккаунт сохранен!',
-);
+];
diff --git a/mod/twitter_api/lib/twitter_api.php b/mod/twitter_api/lib/twitter_api.php
index 2976fe1ce81..997ee19e6a5 100644
--- a/mod/twitter_api/lib/twitter_api.php
+++ b/mod/twitter_api/lib/twitter_api.php
@@ -7,7 +7,7 @@
/**
* Get the API wrapper object
- *
+ *
* @param string $oauth_token User's OAuth token
* @param string $oauth_token_secret User's OAuth secret
* @return TwitterOAuth|null
@@ -61,9 +61,9 @@ function twitter_api_forward() {
$request_link = twitter_api_get_authorize_url($callback);
// capture metadata about login to persist through redirects
- $login_metadata = array(
+ $login_metadata = [
'persistent' => (bool) get_input("persistent"),
- );
+ ];
// capture referrer if in site, but not the twitter_api
$session = elgg_get_session();
@@ -124,15 +124,15 @@ function twitter_api_login() {
// attempt to find user and log them in.
// else, create a new user.
- $options = array(
+ $options = [
'type' => 'user',
'plugin_id' => 'twitter_api',
- 'plugin_user_setting_name_value_pairs' => array(
+ 'plugin_user_setting_name_value_pairs' => [
'access_key' => $token['oauth_token'],
'access_secret' => $token['oauth_token_secret'],
- ),
+ ],
'limit' => 0,
- );
+ ];
$users = elgg_get_entities_from_plugin_user_settings($options);
@@ -149,7 +149,7 @@ function twitter_api_login() {
$twitter = $api->get('account/verify_credentials');
// backward compatibility for deprecated Twitter Login plugin
- $user = FALSE;
+ $user = false;
if ($twitter_user = get_user_by_username($token['screen_name'])) {
if (($screen_name = $twitter_user->twitter_screen_name) && ($screen_name == $token['screen_name'])) {
// convert existing account
@@ -162,7 +162,7 @@ function twitter_api_login() {
if (!$user) {
$user = twitter_api_create_user($twitter);
$site_name = elgg_get_site_entity()->name;
- system_message(elgg_echo('twitter_api:login:email', array($site_name)));
+ system_message(elgg_echo('twitter_api:login:email', [$site_name]));
$forward = "twitter_api/interstitial";
}
@@ -191,7 +191,7 @@ function twitter_api_login() {
/**
* Create a new user from Twitter information
- *
+ *
* @param object $twitter Twitter OAuth response
* @return ElggUser
*/
@@ -278,15 +278,15 @@ function twitter_api_authorize() {
}
// make sure no other users are registered to this twitter account.
- $options = array(
+ $options = [
'type' => 'user',
'plugin_id' => 'twitter_api',
- 'plugin_user_setting_name_value_pairs' => array(
+ 'plugin_user_setting_name_value_pairs' => [
'access_key' => $token['oauth_token'],
'access_secret' => $token['oauth_token_secret'],
- ),
+ ],
'limit' => 0
- );
+ ];
$users = elgg_get_entities_from_plugin_user_settings($options);
/* @var ElggUser[] $users */
@@ -305,7 +305,7 @@ function twitter_api_authorize() {
elgg_set_plugin_user_setting('access_secret', $token['oauth_token_secret'], 0, 'twitter_api');
// trigger authorization hook
- elgg_trigger_plugin_hook('authorize', 'twitter_api', array('token' => $token));
+ elgg_trigger_plugin_hook('authorize', 'twitter_api', ['token' => $token]);
system_message(elgg_echo('twitter_api:authorize:success'));
forward('settings/plugins', 'twitter_api');
@@ -329,7 +329,7 @@ function twitter_api_revoke() {
*
* @param string $callback The callback URL
*/
-function twitter_api_get_authorize_url($callback = NULL, $login = true) {
+function twitter_api_get_authorize_url($callback = null, $login = true) {
$session = elgg_get_session();
// request tokens from Twitter
@@ -337,10 +337,10 @@ function twitter_api_get_authorize_url($callback = NULL, $login = true) {
$token = $twitter->getRequestToken($callback);
// save token in session for use after authorization
- $session->set('twitter_api', array(
+ $session->set('twitter_api', [
'oauth_token' => $token['oauth_token'],
'oauth_token_secret' => $token['oauth_token_secret'],
- ));
+ ]);
return $twitter->getAuthorizeURL($token['oauth_token'], $login);
}
@@ -351,7 +351,7 @@ function twitter_api_get_authorize_url($callback = NULL, $login = true) {
* @param bool $oauth_verifier
* @return array
*/
-function twitter_api_get_access_token($oauth_verifier = FALSE) {
+function twitter_api_get_access_token($oauth_verifier = false) {
$session = elgg_get_session();
// retrieve stored tokens
diff --git a/mod/twitter_api/start.php b/mod/twitter_api/start.php
index 29325e34321..e135d23736b 100644
--- a/mod/twitter_api/start.php
+++ b/mod/twitter_api/start.php
@@ -109,7 +109,7 @@ function twitter_api_tweet($hook, $type, $returnvalue, $params) {
return;
}
- $api->post('statuses/update', array('status' => $params['message']));
+ $api->post('statuses/update', ['status' => $params['message']]);
}
/**
@@ -119,18 +119,18 @@ function twitter_api_tweet($hook, $type, $returnvalue, $params) {
* @param array $options
* @return array
*/
-function twitter_api_fetch_tweets($user_guid, $options = array()) {
+function twitter_api_fetch_tweets($user_guid, $options = []) {
// check user settings
$access_key = elgg_get_plugin_user_setting('access_key', $user_guid, 'twitter_api');
$access_secret = elgg_get_plugin_user_setting('access_secret', $user_guid, 'twitter_api');
if (!($access_key && $access_secret)) {
- return FALSE;
+ return false;
}
$api = twitter_api_get_api_object($access_key, $access_secret);
if (!$api) {
- return FALSE;
+ return false;
}
return $api->get('statuses/user_timeline', $options);
diff --git a/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php b/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
index 747e0eafa40..964cb702f3e 100644
--- a/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
+++ b/mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
@@ -7,7 +7,7 @@
$values = elgg_get_sticky_values('twitter_api_interstitial');
elgg_clear_sticky_form('twitter_api_interstitial');
} else {
- $values = array();
+ $values = [];
}
$site = elgg_get_site_entity();
@@ -16,7 +16,7 @@
$email = elgg_extract('email', $values);
echo '';
-echo elgg_echo('twitter_api:interstitial:description', array($site->name));
+echo elgg_echo('twitter_api:interstitial:description', [$site->name]);
echo '
';
if (!isset($display_name)) {
@@ -27,7 +27,7 @@
$title = elgg_echo('username');
$body = elgg_echo('twitter_api:interstitial:username');
-$body .= elgg_view('input/text', array('value' => $user->username, 'disabled' => 'disabled'));
+$body .= elgg_view('input/text', ['value' => $user->username, 'disabled' => 'disabled']);
echo elgg_view_module('info', $title, $body);
@@ -35,7 +35,7 @@
$title = elgg_echo('name');
$body = elgg_echo('twitter_api:interstitial:name');
-$body .= elgg_view('input/text', array('name' => 'display_name', 'value' => $display_name));
+$body .= elgg_view('input/text', ['name' => 'display_name', 'value' => $display_name]);
echo elgg_view_module('info', $title, $body);
@@ -43,7 +43,7 @@
$title = elgg_echo('email');
$body = elgg_echo('twitter_api:interstitial:email');
-$body .= elgg_view('input/email', array('name' => 'email', 'value' => $email));
+$body .= elgg_view('input/email', ['name' => 'email', 'value' => $email]);
echo elgg_view_module('info', $title, $body);
@@ -51,21 +51,21 @@
$title = elgg_echo('password');
$body = elgg_echo('twitter_api:interstitial:password');
-$body .= elgg_view('input/password', array('name' => 'password_1'));
+$body .= elgg_view('input/password', ['name' => 'password_1']);
$body .= elgg_echo('twitter_api:interstitial:password2');
-$body .= elgg_view('input/password', array('name' => 'password_2'));
+$body .= elgg_view('input/password', ['name' => 'password_2']);
echo elgg_view_module('info', $title, $body);
// buttons
-echo elgg_view('input/submit', array(
+echo elgg_view('input/submit', [
'value' => elgg_echo('save')
-));
+]);
-echo elgg_view('output/url', array(
+echo elgg_view('output/url', [
'class' => 'float-alt',
'text' => elgg_echo('twitter_api:interstitial:no_thanks'),
'href' => '/',
'is_trusted' => true,
-));
\ No newline at end of file
+]);
diff --git a/mod/twitter_api/views/default/plugins/twitter_api/settings.php b/mod/twitter_api/views/default/plugins/twitter_api/settings.php
index 00e47567815..5798420c6fd 100644
--- a/mod/twitter_api/views/default/plugins/twitter_api/settings.php
+++ b/mod/twitter_api/views/default/plugins/twitter_api/settings.php
@@ -3,53 +3,53 @@
* Twitter API plugin settings
*/
-$instructions = elgg_echo('twitter_api:settings:instructions', array(elgg_get_site_url()));
+$instructions = elgg_echo('twitter_api:settings:instructions', [elgg_get_site_url()]);
$consumer_key_string = elgg_echo('twitter_api:consumer_key');
-$consumer_key_view = elgg_view('input/text', array(
+$consumer_key_view = elgg_view('input/text', [
'name' => 'params[consumer_key]',
'value' => $vars['entity']->consumer_key,
'class' => 'elgg-input-thin',
-));
+]);
$consumer_secret_string = elgg_echo('twitter_api:consumer_secret');
-$consumer_secret_view = elgg_view('input/text', array(
+$consumer_secret_view = elgg_view('input/text', [
'name' => 'params[consumer_secret]',
'value' => $vars['entity']->consumer_secret,
'class' => 'elgg-input-thin',
-));
+]);
$sign_on_with_twitter_string = elgg_echo('twitter_api:login');
-$sign_on_with_twitter_view = elgg_view('input/select', array(
+$sign_on_with_twitter_view = elgg_view('input/select', [
'name' => 'params[sign_on]',
- 'options_values' => array(
+ 'options_values' => [
'yes' => elgg_echo('option:yes'),
'no' => elgg_echo('option:no'),
- ),
+ ],
'value' => $vars['entity']->sign_on ? $vars['entity']->sign_on : 'no',
-));
+]);
$new_users_with_twitter = elgg_echo('twitter_api:new_users');
-$new_users_with_twitter_view = elgg_view('input/select', array(
+$new_users_with_twitter_view = elgg_view('input/select', [
'name' => 'params[new_users]',
- 'options_values' => array(
+ 'options_values' => [
'yes' => elgg_echo('option:yes'),
'no' => elgg_echo('option:no'),
- ),
+ ],
'value' => $vars['entity']->new_users ? $vars['entity']->new_users : 'no',
-));
+]);
$post_to_twitter = '';
if (elgg_is_active_plugin('thewire')) {
$post_to_twitter_string = elgg_echo('twitter_api:post_to_twitter');
- $post_to_twitter_view = elgg_view('input/dropdown', array(
+ $post_to_twitter_view = elgg_view('input/dropdown', [
'name' => 'params[wire_posts]',
- 'options_values' => array(
+ 'options_values' => [
'yes' => elgg_echo('option:yes'),
'no' => elgg_echo('option:no'),
- ),
+ ],
'value' => $vars['entity']->wire_posts ? $vars['entity']->wire_posts : 'no',
- ));
+ ]);
$post_to_twitter = "$post_to_twitter_string $post_to_twitter_view
";
}
diff --git a/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
index edcea2f0d6e..920fc1b4178 100644
--- a/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
+++ b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
@@ -18,20 +18,20 @@
}
$site_name = elgg_get_site_entity()->name;
-echo '' . elgg_echo('twitter_api:usersettings:description', array($site_name)) . '
';
+echo '' . elgg_echo('twitter_api:usersettings:description', [$site_name]) . '
';
if (!$access_key || !$access_secret) {
// send user off to validate account
$request_link = twitter_api_get_authorize_url(null, false);
- echo '' . elgg_echo('twitter_api:usersettings:request', array($request_link, $site_name)) . '
';
+ echo '' . elgg_echo('twitter_api:usersettings:request', [$request_link, $site_name]) . '
';
} else {
// if this user logged in through twitter and never set up an email address, don't
// let them disassociate their account.
if ($user->email) {
$url = elgg_get_site_url() . "twitter_api/revoke";
- echo '' . elgg_echo('twitter_api:usersettings:authorized', array($site_name, $twitter_name)) . '
';
+ echo '' . elgg_echo('twitter_api:usersettings:authorized', [$site_name, $twitter_name]) . '
';
echo '' . sprintf(elgg_echo('twitter_api:usersettings:revoke'), $url) . '
';
} else {
- echo elgg_echo('twitter_api:usersettings:cannot_revoke', array(elgg_normalize_url('twitter_api/interstitial')));
+ echo elgg_echo('twitter_api:usersettings:cannot_revoke', [elgg_normalize_url('twitter_api/interstitial')]);
}
}
diff --git a/mod/twitter_api/views/default/resources/twitter_api/interstitial.php b/mod/twitter_api/views/default/resources/twitter_api/interstitial.php
index 23b5069cb5b..c6e2314b010 100644
--- a/mod/twitter_api/views/default/resources/twitter_api/interstitial.php
+++ b/mod/twitter_api/views/default/resources/twitter_api/interstitial.php
@@ -10,10 +10,10 @@
$content = elgg_view_form('twitter_api/interstitial_settings');
-$params = array(
+$params = [
'content' => $content,
'title' => $title,
-);
+];
$body = elgg_view_layout('one_sidebar', $params);
echo elgg_view_page($title, $body);
diff --git a/mod/twitter_api/views/default/twitter_api/css.php b/mod/twitter_api/views/default/twitter_api/css.php
index 2d081d361da..9d7a7deb7a9 100644
--- a/mod/twitter_api/views/default/twitter_api/css.php
+++ b/mod/twitter_api/views/default/twitter_api/css.php
@@ -10,4 +10,4 @@
.twitter-secret {
width: 400px;
-}
\ No newline at end of file
+}
diff --git a/mod/uservalidationbyemail/actions/uservalidationbyemail/bulk_action.php b/mod/uservalidationbyemail/actions/uservalidationbyemail/bulk_action.php
index fbbcc1c9373..4be3fae257e 100644
--- a/mod/uservalidationbyemail/actions/uservalidationbyemail/bulk_action.php
+++ b/mod/uservalidationbyemail/actions/uservalidationbyemail/bulk_action.php
@@ -7,7 +7,7 @@
*/
$action_type = get_input('action_type');
-$valid_actions = array('delete', 'resend_validation', 'validate');
+$valid_actions = ['delete', 'resend_validation', 'validate'];
if (!in_array($action_type, $valid_actions)) {
forward(REFERRER);
@@ -15,4 +15,4 @@
$action_name = "uservalidationbyemail/$action_type";
-action($action_name);
\ No newline at end of file
+action($action_name);
diff --git a/mod/uservalidationbyemail/actions/uservalidationbyemail/delete.php b/mod/uservalidationbyemail/actions/uservalidationbyemail/delete.php
index b076d30482c..40f7ea37d30 100644
--- a/mod/uservalidationbyemail/actions/uservalidationbyemail/delete.php
+++ b/mod/uservalidationbyemail/actions/uservalidationbyemail/delete.php
@@ -7,7 +7,7 @@
*/
$user_guids = get_input('user_guids');
-$error = FALSE;
+$error = false;
if (!$user_guids) {
register_error(elgg_echo('uservalidationbyemail:errors:unknown_users'));
@@ -15,19 +15,19 @@
}
$access = access_get_show_hidden_status();
-access_show_hidden_entities(TRUE);
+access_show_hidden_entities(true);
foreach ($user_guids as $guid) {
$user = get_entity($guid);
if (!$user instanceof ElggUser) {
- $error = TRUE;
+ $error = true;
continue;
}
// don't delete validated users
$is_validated = elgg_get_user_validation_status($guid);
- if ($is_validated !== FALSE || !$user->delete()) {
- $error = TRUE;
+ if ($is_validated !== false || !$user->delete()) {
+ $error = true;
continue;
}
}
@@ -48,4 +48,4 @@
system_message($message_txt);
}
-forward(REFERRER);
\ No newline at end of file
+forward(REFERRER);
diff --git a/mod/uservalidationbyemail/actions/uservalidationbyemail/resend_validation.php b/mod/uservalidationbyemail/actions/uservalidationbyemail/resend_validation.php
index 1f736dfe703..b0521b9deb2 100644
--- a/mod/uservalidationbyemail/actions/uservalidationbyemail/resend_validation.php
+++ b/mod/uservalidationbyemail/actions/uservalidationbyemail/resend_validation.php
@@ -7,7 +7,7 @@
*/
$user_guids = get_input('user_guids');
-$error = FALSE;
+$error = false;
if (!$user_guids) {
register_error(elgg_echo('uservalidationbyemail:errors:unknown_users'));
@@ -15,19 +15,19 @@
}
$access = access_get_show_hidden_status();
-access_show_hidden_entities(TRUE);
+access_show_hidden_entities(true);
foreach ($user_guids as $guid) {
$user = get_entity($guid);
if (!$user instanceof ElggUser) {
- $error = TRUE;
+ $error = true;
continue;
}
// don't resend emails to validated users
$is_validated = elgg_get_user_validation_status($guid);
- if ($is_validated !== FALSE || !uservalidationbyemail_request_validation($guid)) {
- $error = TRUE;
+ if ($is_validated !== false || !uservalidationbyemail_request_validation($guid)) {
+ $error = true;
continue;
}
}
diff --git a/mod/uservalidationbyemail/actions/uservalidationbyemail/validate.php b/mod/uservalidationbyemail/actions/uservalidationbyemail/validate.php
index d6be9cfe52b..b85c493e42a 100644
--- a/mod/uservalidationbyemail/actions/uservalidationbyemail/validate.php
+++ b/mod/uservalidationbyemail/actions/uservalidationbyemail/validate.php
@@ -7,7 +7,7 @@
*/
$user_guids = get_input('user_guids');
-$error = FALSE;
+$error = false;
if (!$user_guids) {
register_error(elgg_echo('uservalidationbyemail:errors:unknown_users'));
@@ -15,21 +15,21 @@
}
$access = access_get_show_hidden_status();
-access_show_hidden_entities(TRUE);
+access_show_hidden_entities(true);
foreach ($user_guids as $guid) {
$user = get_entity($guid);
if (!$user instanceof ElggUser) {
- $error = TRUE;
+ $error = true;
continue;
}
// only validate if not validated
$is_validated = elgg_get_user_validation_status($guid);
- $validate_success = elgg_set_user_validation_status($guid, TRUE, 'manual');
+ $validate_success = elgg_set_user_validation_status($guid, true, 'manual');
- if ($is_validated !== FALSE || !($validate_success && $user->enable())) {
- $error = TRUE;
+ if ($is_validated !== false || !($validate_success && $user->enable())) {
+ $error = true;
continue;
}
}
@@ -50,4 +50,4 @@
system_message($message_txt);
}
-forward(REFERRER);
\ No newline at end of file
+forward(REFERRER);
diff --git a/mod/uservalidationbyemail/languages/da.php b/mod/uservalidationbyemail/languages/da.php
index 0049bd01d67..4cc5cc4ef77 100644
--- a/mod/uservalidationbyemail/languages/da.php
+++ b/mod/uservalidationbyemail/languages/da.php
@@ -1,20 +1,20 @@
'Ikke valideret',
'email:validate:subject' => "%s vær venlig at bekræfte din e-mail adresse for %s!",
- 'email:validate:body' => "Hej %s,
-
-Før du kan begynde at bruge %s, skal du bekræfte din e-mail adresse.
-
-Vær venlig at bekræfte din e-mail adresse ved at klikke på linket herunder:
-
-%s
-
-Hvis du ikke kan klikke på linket så kopier og indsæt det i din browser manuelt.
-
-%s
-%s
+ 'email:validate:body' => "Hej %s,
+
+Før du kan begynde at bruge %s, skal du bekræfte din e-mail adresse.
+
+Vær venlig at bekræfte din e-mail adresse ved at klikke på linket herunder:
+
+%s
+
+Hvis du ikke kan klikke på linket så kopier og indsæt det i din browser manuelt.
+
+%s
+%s
",
'email:confirm:success' => "Du har bekræftet din e-mail adresse!",
'email:confirm:fail' => "Din e-mail adresse kunne ikke bekræftes...",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Anmodning om validering gensendt.',
'uservalidationbyemail:messages:resent_validations' => 'Anmodning om validering gensendt til alle markerede brugere.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/de.php b/mod/uservalidationbyemail/languages/de.php
index 74868271ef6..8cf104a8320 100644
--- a/mod/uservalidationbyemail/languages/de.php
+++ b/mod/uservalidationbyemail/languages/de.php
@@ -1,5 +1,5 @@
'Inaktiv',
'email:validate:subject' => "%s, bitte bestätige Deine Email-Adresse!",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Bestätigungs-Email gesendet.',
'uservalidationbyemail:messages:resent_validations' => 'Die Bestätigungs-Email wurde erneut an alle markierten Benutzeraccount gesendet.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/en.php b/mod/uservalidationbyemail/languages/en.php
index 9024942d16a..088d5b4febe 100644
--- a/mod/uservalidationbyemail/languages/en.php
+++ b/mod/uservalidationbyemail/languages/en.php
@@ -1,5 +1,5 @@
'Unvalidated',
'email:validate:subject' => "%s please confirm your email address for %s!",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Validation request resent.',
'uservalidationbyemail:messages:resent_validations' => 'Validation requests resent to all checked users.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/es.php b/mod/uservalidationbyemail/languages/es.php
index a3469d6dabe..02f7a969d3d 100644
--- a/mod/uservalidationbyemail/languages/es.php
+++ b/mod/uservalidationbyemail/languages/es.php
@@ -1,5 +1,5 @@
'Sin validar',
'email:validate:subject' => "%s por favor confirma tu dirección de email para %s!",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Solicitud devalidación reenviada.',
'uservalidationbyemail:messages:resent_validations' => 'Solicitud devalidación reenviada a todos los usuarios marcados.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/eu_es.php b/mod/uservalidationbyemail/languages/eu_es.php
index da3f316aab5..3d383d92481 100644
--- a/mod/uservalidationbyemail/languages/eu_es.php
+++ b/mod/uservalidationbyemail/languages/eu_es.php
@@ -1,5 +1,5 @@
'Ez balidatua',
'email:validate:subject' => "%s mesedez konfirmatu zure email helbidea %s-rentzat!",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Balidazio eskaera berbidalita.',
'uservalidationbyemail:messages:resent_validations' => 'Markatutako erabiltzaile guztiei balidazio eskaera berbidalita.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/fi.php b/mod/uservalidationbyemail/languages/fi.php
index 24b8d709121..debd70bafa6 100644
--- a/mod/uservalidationbyemail/languages/fi.php
+++ b/mod/uservalidationbyemail/languages/fi.php
@@ -1,5 +1,5 @@
'Vahvistamattomat käyttäjät',
'email:validate:subject' => "%s, vahvista sähköpostiosoitteesi palveluun %s.",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Vahvistusviesti lähetetty uudelleen.',
'uservalidationbyemail:messages:resent_validations' => 'Vahvistusviesti uudellenlähetetty valituille käyttäjille.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/fr.php b/mod/uservalidationbyemail/languages/fr.php
index 034996037a5..256be72832f 100644
--- a/mod/uservalidationbyemail/languages/fr.php
+++ b/mod/uservalidationbyemail/languages/fr.php
@@ -1,5 +1,5 @@
'Non validés',
'email:validate:subject' => "%s veuillez SVP confirmer votre adresse email pour %s !",
@@ -52,4 +52,4 @@
'uservalidationbyemail:messages:resent_validation' => 'La demande de confirmation a bien été renvoyée.',
'uservalidationbyemail:messages:resent_validations' => 'Les demandes de confirmation ont bien été renvoyées aux utilisateurs sélectionnés.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/gl.php b/mod/uservalidationbyemail/languages/gl.php
index e96b81189c2..0316c9e819f 100644
--- a/mod/uservalidationbyemail/languages/gl.php
+++ b/mod/uservalidationbyemail/languages/gl.php
@@ -1,5 +1,5 @@
'Sen validar',
'email:validate:subject' => "%s confirme o seu enderezo de correo para %s",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Enviouse de novo a solicitude de validación.',
'uservalidationbyemail:messages:resent_validations' => 'Enviáronse de novo as solicitudes de validación aos usuarios seleccionados.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/it.php b/mod/uservalidationbyemail/languages/it.php
index 93fe55c35da..07240b58478 100644
--- a/mod/uservalidationbyemail/languages/it.php
+++ b/mod/uservalidationbyemail/languages/it.php
@@ -1,5 +1,5 @@
'Non convalidato',
'email:validate:subject' => "%s per favore conferma il tuo indirizzo email per %s!",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Richiesta di validazione reinviata',
'uservalidationbyemail:messages:resent_validations' => 'Richieste di validazione reinviate a tutti gli utenti selezionati'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/ja.php b/mod/uservalidationbyemail/languages/ja.php
index 1bde91bf4ca..cdfee801e71 100644
--- a/mod/uservalidationbyemail/languages/ja.php
+++ b/mod/uservalidationbyemail/languages/ja.php
@@ -1,5 +1,5 @@
'未確認ユーザ',
'email:validate:subject' => "【登録確認メール】%s様、%sで登録されたメールアドレスにお送りしています",
@@ -53,4 +53,4 @@
'uservalidationbyemail:messages:resent_validation' => '確認メールを送信しました。',
'uservalidationbyemail:messages:resent_validations' => 'チェックしたユーザ全員に確認メールを再送しました。'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/nl.php b/mod/uservalidationbyemail/languages/nl.php
index 7d8febb92ff..fc26698e373 100644
--- a/mod/uservalidationbyemail/languages/nl.php
+++ b/mod/uservalidationbyemail/languages/nl.php
@@ -1,5 +1,5 @@
'Ongevalideerd',
'email:validate:subject' => "%s, bevestig alsjeblieft je e-mailadres voor %s!",
@@ -54,4 +54,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Validatie opnieuw verzonden',
'uservalidationbyemail:messages:resent_validations' => 'Validatie opnieuw verzonden aan alle geselecteerde gebruikers.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/pl.php b/mod/uservalidationbyemail/languages/pl.php
index 006a8207aa7..6c7e6f4a7eb 100644
--- a/mod/uservalidationbyemail/languages/pl.php
+++ b/mod/uservalidationbyemail/languages/pl.php
@@ -1,13 +1,13 @@
'Niezatwierdzony',
'email:validate:subject' => "%s proszę potwierdź swój adres e-mail!",
- 'email:validate:body' => "Witaj %s,
-
-Proszę potwierdź swój adres e-mail poprzez klikniecie poniższego linku :
-
-%s
+ 'email:validate:body' => "Witaj %s,
+
+Proszę potwierdź swój adres e-mail poprzez klikniecie poniższego linku :
+
+%s
",
'email:confirm:success' => "Potwierdzono adres e-mail!",
'email:confirm:fail' => "Adres e-mail nie mógł zostać zweryfikowany...",
@@ -44,4 +44,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Wysłano e-mail potwierdzający.',
'uservalidationbyemail:messages:resent_validations' => 'Wysłano e-maile potwierdzające do wszystkich zaznaczonych użytkowników.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/pt_br.php b/mod/uservalidationbyemail/languages/pt_br.php
index 7117e40fe17..61545f66eae 100644
--- a/mod/uservalidationbyemail/languages/pt_br.php
+++ b/mod/uservalidationbyemail/languages/pt_br.php
@@ -1,20 +1,20 @@
'Sem validação',
'email:validate:subject' => "%s por favor, confirme seu endereço de email para %s!",
- 'email:validate:body' => "Olá %s,
-
-Antes de você iniciar o uso da %, você deve confirmar seu endereço de email.
-
-Por favor, confirme seu endereço de email clicando no link abaixo:
-
-%s
-
-Se você não conseguir clicar no link, copie e cole o endereço para o navegador (browser) manualmente.
-
-%s
-%s
+ 'email:validate:body' => "Olá %s,
+
+Antes de você iniciar o uso da %, você deve confirmar seu endereço de email.
+
+Por favor, confirme seu endereço de email clicando no link abaixo:
+
+%s
+
+Se você não conseguir clicar no link, copie e cole o endereço para o navegador (browser) manualmente.
+
+%s
+%s
",
'email:confirm:success' => "Você já confirmou seu endereço de email!",
'email:confirm:fail' => "Seu endereço de email não pode ser confirmado...",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Solicitação de validação re-enviada.',
'uservalidationbyemail:messages:resent_validations' => 'Solicitação de validação re-enviada para todos usuários marcados.'
-);
+];
diff --git a/mod/uservalidationbyemail/languages/ru.php b/mod/uservalidationbyemail/languages/ru.php
index b57ce8c4ace..5d3fce46084 100644
--- a/mod/uservalidationbyemail/languages/ru.php
+++ b/mod/uservalidationbyemail/languages/ru.php
@@ -1,5 +1,5 @@
'Непровереный',
'email:validate:subject' => "%s пожалуйста, подтвердите свой email для %s!",
@@ -51,4 +51,4 @@
'uservalidationbyemail:messages:resent_validation' => 'Запрос на подтверждение переслан.',
'uservalidationbyemail:messages:resent_validations' => 'Запрос отправлен всем отмеченным пользователям.'
-);
+];
diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php
index c423d2804fc..6f328a7ca29 100644
--- a/mod/uservalidationbyemail/lib/functions.php
+++ b/mod/uservalidationbyemail/lib/functions.php
@@ -18,21 +18,21 @@ function uservalidationbyemail_generate_code($user_guid, $email_address) {
elgg_deprecated_notice(__FUNCTION__ . ' has been deprecated. Validation now relies on signed URL API', '2.3');
// Note: binding to site URL for multisite.
$site_url = elgg_get_site_url();
- return elgg_build_hmac([(int)$user_guid, $email_address, $site_url])->getToken();
+ return elgg_build_hmac([(int) $user_guid, $email_address, $site_url])->getToken();
}
/**
* Request user validation email.
* Send email out to the address and request a confirmation.
*
- * @param int $user_guid The user's GUID
+ * @param int $user_guid The user's GUID
* @return mixed
*/
function uservalidationbyemail_request_validation($user_guid) {
$site = elgg_get_site_entity();
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$user = get_entity($user_guid);
if (($user) && ($user instanceof ElggUser)) {
@@ -43,19 +43,19 @@ function uservalidationbyemail_request_validation($user_guid) {
// Get email to show in the next page
elgg_get_session()->set('emailsent', $user->email);
- $subject = elgg_echo('email:validate:subject', array(
+ $subject = elgg_echo('email:validate:subject', [
$user->name,
$site->name
- ), $user->language
+ ], $user->language
);
- $body = elgg_echo('email:validate:body', array(
+ $body = elgg_echo('email:validate:body', [
$user->name,
$site->name,
$link,
$site->name,
$site->url
- ), $user->language
+ ], $user->language
);
$params = [
@@ -70,7 +70,7 @@ function uservalidationbyemail_request_validation($user_guid) {
return $result;
}
- return FALSE;
+ return false;
}
/**
@@ -100,7 +100,7 @@ function uservalidationbyemail_get_unvalidated_users_sql_where() {
$db_prefix = elgg_get_config('dbprefix');
// thanks to daveb@freenode for the SQL tips!
- $wheres = array();
+ $wheres = [];
$wheres[] = "e.enabled='no'";
$wheres[] = "NOT EXISTS (
SELECT 1 FROM {$db_prefix}metadata md
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 3e524399853..a5a116985b0 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -80,16 +80,16 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) {
// set context so our canEdit() override works
elgg_push_context('uservalidationbyemail_new_user');
$hidden_entities = access_get_show_hidden_status();
- access_show_hidden_entities(TRUE);
+ access_show_hidden_entities(true);
// Don't do a recursive disable. Any entities owned by the user at this point
// are products of plugins that hook into create user and might need
// access to the entities.
// @todo That ^ sounds like a specific case...would be nice to track it down...
- $user->disable('uservalidationbyemail_new_user', FALSE);
+ $user->disable('uservalidationbyemail_new_user', false);
// set user as unvalidated and send out validation email
- elgg_set_user_validation_status($user->guid, FALSE);
+ elgg_set_user_validation_status($user->guid, false);
uservalidationbyemail_request_validation($user->guid);
elgg_pop_context();
@@ -138,7 +138,7 @@ function uservalidationbyemail_allow_new_user_can_edit($hook, $type, $value, $pa
$context = elgg_get_context();
if ($context == 'uservalidationbyemail_new_user' || $context == 'uservalidationbyemail_validate_user') {
- return TRUE;
+ return true;
}
return;
@@ -160,7 +160,7 @@ function uservalidationbyemail_check_auth_attempt($credentials) {
// See if the user exists and isn't validated
$access_status = access_get_show_hidden_status();
- access_show_hidden_entities(TRUE);
+ access_show_hidden_entities(true);
// check if logging in with email address
if (strpos($username, '@') !== false) {
@@ -213,7 +213,7 @@ function uservalidationbyemail_page_handler($page) {
*/
function uservalidationbyemail_validate_new_admin_user($event, $type, $user) {
if ($user instanceof ElggUser && !$user->validated) {
- elgg_set_user_validation_status($user->guid, TRUE, 'admin_user');
+ elgg_set_user_validation_status($user->guid, true, 'admin_user');
}
}
@@ -238,7 +238,7 @@ function uservalidationbyemail_public_pages($hook, $type, $return_value, $params
*/
function uservalidationbyemail_check_manual_login($event, $type, $user) {
$access_status = access_get_show_hidden_status();
- access_show_hidden_entities(TRUE);
+ access_show_hidden_entities(true);
if (($user instanceof ElggUser) && !$user->isEnabled() && !$user->validated) {
// send new validation email
diff --git a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
index 62a35d0bb5d..c3a5510e222 100644
--- a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
+++ b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
@@ -3,7 +3,7 @@
* List of unvalidated users
*/
-echo elgg_view_form('uservalidationbyemail/bulk_action', array(
+echo elgg_view_form('uservalidationbyemail/bulk_action', [
'id' => 'uservalidationbyemail-form',
'action' => 'action/uservalidationbyemail/bulk_action'
-));
+]);
diff --git a/mod/uservalidationbyemail/views/default/elgg/uservalidationbyemail.js b/mod/uservalidationbyemail/views/default/elgg/uservalidationbyemail.js
index 05c138ca735..8219c883131 100644
--- a/mod/uservalidationbyemail/views/default/elgg/uservalidationbyemail.js
+++ b/mod/uservalidationbyemail/views/default/elgg/uservalidationbyemail.js
@@ -41,3 +41,4 @@ define('elgg/uservalidationbyemail', function (require) {
init: init
};
});
+
diff --git a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
index 16786b3765e..f8bfa6c5c11 100644
--- a/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
+++ b/mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
@@ -10,17 +10,17 @@
$offset = get_input('offset', 0);
// can't use elgg_list_entities() and friends because we don't use the default view for users.
-$ia = elgg_set_ignore_access(TRUE);
+$ia = elgg_set_ignore_access(true);
$hidden_entities = access_get_show_hidden_status();
-access_show_hidden_entities(TRUE);
+access_show_hidden_entities(true);
-$options = array(
+$options = [
'type' => 'user',
'wheres' => uservalidationbyemail_get_unvalidated_users_sql_where(),
'limit' => $limit,
'offset' => $offset,
- 'count' => TRUE,
-);
+ 'count' => true,
+];
$count = elgg_get_entities($options);
if (!$count) {
@@ -28,10 +28,10 @@
elgg_set_ignore_access($ia);
echo elgg_autop(elgg_echo('uservalidationbyemail:admin:no_unvalidated_users'));
- return TRUE;
+ return true;
}
-$options['count'] = FALSE;
+$options['count'] = false;
$users = elgg_get_entities($options);
@@ -39,41 +39,41 @@
elgg_set_ignore_access($ia);
// setup pagination
-$pagination = elgg_view('navigation/pagination',array(
+$pagination = elgg_view('navigation/pagination', [
'base_url' => 'admin/users/unvalidated',
'offset' => $offset,
'count' => $count,
'limit' => $limit,
-));
+]);
$bulk_actions_checkbox = ' ' . elgg_echo('all') . ' ';
-$validate = elgg_view('output/url', array(
+$validate = elgg_view('output/url', [
'href' => 'action/uservalidationbyemail/validate/',
'text' => elgg_echo('uservalidationbyemail:admin:validate'),
'title' => elgg_echo('uservalidationbyemail:confirm_validate_checked'),
'class' => 'uservalidationbyemail-submit',
'is_action' => true,
'is_trusted' => true,
-));
+]);
-$resend_email = elgg_view('output/url', array(
+$resend_email = elgg_view('output/url', [
'href' => 'action/uservalidationbyemail/resend_validation/',
'text' => elgg_echo('uservalidationbyemail:admin:resend_validation'),
'title' => elgg_echo('uservalidationbyemail:confirm_resend_validation_checked'),
'class' => 'uservalidationbyemail-submit',
'is_action' => true,
'is_trusted' => true,
-));
+]);
-$delete = elgg_view('output/url', array(
+$delete = elgg_view('output/url', [
'href' => 'action/uservalidationbyemail/delete/',
'text' => elgg_echo('delete'),
'title' => elgg_echo('uservalidationbyemail:confirm_delete_checked'),
'class' => 'uservalidationbyemail-submit',
'is_action' => true,
'is_trusted' => true,
-));
+]);
$bulk_actions = <<<___END
__END;
-echo elgg_view_image_block($checkbox, $block, array('image_alt' => $menu));
+echo elgg_view_image_block($checkbox, $block, ['image_alt' => $menu]);
diff --git a/mod/web_services/classes/APIException.php b/mod/web_services/classes/APIException.php
index b6e1c347b0c..8655806ba6e 100644
--- a/mod/web_services/classes/APIException.php
+++ b/mod/web_services/classes/APIException.php
@@ -8,4 +8,5 @@
* @package Elgg.Core
* @subpackage Exceptions.Stub
*/
-class APIException extends Exception {}
+class APIException extends Exception {
+}
diff --git a/mod/web_services/classes/ElggHMACCache.php b/mod/web_services/classes/ElggHMACCache.php
index 857b13a2b9a..9b1ce4f9578 100644
--- a/mod/web_services/classes/ElggHMACCache.php
+++ b/mod/web_services/classes/ElggHMACCache.php
@@ -86,7 +86,7 @@ public function clear() {
public function __destruct() {
$dbprefix = elgg_get_config('dbprefix');
$time = time();
- $age = (int)$this->getVariable("max_age");
+ $age = (int) $this->getVariable("max_age");
$expires = $time - $age;
diff --git a/mod/web_services/classes/ErrorResult.php b/mod/web_services/classes/ErrorResult.php
index afad4c740bd..84032a6e7fd 100644
--- a/mod/web_services/classes/ErrorResult.php
+++ b/mod/web_services/classes/ErrorResult.php
@@ -26,12 +26,12 @@ class ErrorResult extends GenericResult {
*
* @return void
*/
- public function __construct($message, $code = "", Exception $exception = NULL) {
+ public function __construct($message, $code = "", Exception $exception = null) {
if ($code == "") {
$code = ErrorResult::$RESULT_FAIL;
}
- if ($exception != NULL) {
+ if ($exception != null) {
$this->setResult($exception->__toString());
}
@@ -47,7 +47,7 @@ public function __construct($message, $code = "", Exception $exception = NULL) {
*
* @return ErrorResult
*/
- public static function getInstance($message, $code = "", Exception $exception = NULL) {
+ public static function getInstance($message, $code = "", Exception $exception = null) {
// Return a new error object.
return new ErrorResult($message, $code, $exception);
}
diff --git a/mod/web_services/classes/NotImplementedException.php b/mod/web_services/classes/NotImplementedException.php
index d1decf75c9d..9cec4b35a7c 100644
--- a/mod/web_services/classes/NotImplementedException.php
+++ b/mod/web_services/classes/NotImplementedException.php
@@ -7,4 +7,5 @@
* @package Elgg.Core
* @subpackage Exception
*/
-class NotImplementedException extends CallException {}
+class NotImplementedException extends CallException {
+}
diff --git a/mod/web_services/languages/de.php b/mod/web_services/languages/de.php
index 007095ed96e..d93dcce4fe2 100644
--- a/mod/web_services/languages/de.php
+++ b/mod/web_services/languages/de.php
@@ -1,5 +1,5 @@
"Der Typ der API-Rückgabe ist unbekannt. Das sollte nicht passieren.",
'APIException:MissingParameterInMethod' => "Fehlender Parameter %s in Methode %s.",
'APIException:ParameterNotArray' => "%s scheint kein Feld zu sein.",
@@ -39,4 +39,4 @@
'system.api.list' => "Liste alle im System verfügbaren API-Aufrufe auf.",
'auth.gettoken' => "Dieser API-Aufruf ermöglicht es einem Benutzer ein Authentifizierungs-Token zu beziehen, das für die Authentifizierung nachfolgender API-Aufrufe verwendet werden kann. Übergebe es als Parameter auth_token.",
-);
+];
diff --git a/mod/web_services/languages/en.php b/mod/web_services/languages/en.php
index 1c288de877d..8c635dae95e 100644
--- a/mod/web_services/languages/en.php
+++ b/mod/web_services/languages/en.php
@@ -1,5 +1,5 @@
"API Result is of an unknown type, this should never happen.",
'APIException:MissingParameterInMethod' => "Missing parameter %s in method %s",
'APIException:ParameterNotArray' => "%s does not appear to be an array.",
@@ -39,4 +39,4 @@
'system.api.list' => "List all available API calls on the system.",
'auth.gettoken' => "This API call lets a user obtain a user authentication token which can be used for authenticating future API calls. Pass it as the parameter auth_token",
-);
+];
diff --git a/mod/web_services/languages/es.php b/mod/web_services/languages/es.php
index 8b241853e81..a3d962a364e 100644
--- a/mod/web_services/languages/es.php
+++ b/mod/web_services/languages/es.php
@@ -1,5 +1,5 @@
"El resultado de la API es del tipo desconocido, esto nunca debe pasar.",
'APIException:MissingParameterInMethod' => "Falta parámetro %s en método %s",
'APIException:ParameterNotArray' => "%s no parece estar en un arreglo.",
@@ -39,4 +39,4 @@
'system.api.list' => "Muestra una lista de todas las llamadas a la API disponibles en el sistema.",
'auth.gettoken' => "Esta llamada a la API permite a un usuario obtener un código de autenticación que puede usarse para autenticar futuras llamadas a la API. Pásela como valor del parámetro «auth_token».",
-);
+];
diff --git a/mod/web_services/languages/eu_es.php b/mod/web_services/languages/eu_es.php
index ba499f5f70c..c601347404b 100644
--- a/mod/web_services/languages/eu_es.php
+++ b/mod/web_services/languages/eu_es.php
@@ -1,5 +1,5 @@
"APIaren emaitza mota ezezaguna da, hau ez zen inoiz gertatu behar.",
'APIException:MissingParameterInMethod' => "%s parametroa faltan %s metodoan",
'APIException:ParameterNotArray' => "%s ematen du ez dela array bat.",
@@ -39,4 +39,4 @@
'system.api.list' => "Sistema eskuragarri dauden API dei guztiak zerrendatu",
'auth.gettoken' => "API dei honek erabiltzaileari autentifikazio tokena lortzen uzten dio non etorkizuneko API deiak autentifikatzen erabiltzeko. auth_token parametro bezala pasatu",
-);
+];
diff --git a/mod/web_services/languages/fi.php b/mod/web_services/languages/fi.php
index f8fda5037ee..92d48f808ee 100644
--- a/mod/web_services/languages/fi.php
+++ b/mod/web_services/languages/fi.php
@@ -1,5 +1,5 @@
"API Result is of an unknown type, this should never happen.",
'APIException:MissingParameterInMethod' => "Puuttuva parametri %s metodissa %s",
'APIException:ParameterNotArray' => "%s ei ole array.",
@@ -39,4 +39,4 @@
'system.api.list' => "Listaa kaikki käytettävissä olevat API-kutsut.",
'auth.gettoken' => "This API call lets a user obtain a user authentication token which can be used for authenticating future API calls. Pass it as the parameter auth_token",
-);
+];
diff --git a/mod/web_services/languages/fr.php b/mod/web_services/languages/fr.php
index f9e440d5028..92e5eae2654 100644
--- a/mod/web_services/languages/fr.php
+++ b/mod/web_services/languages/fr.php
@@ -1,5 +1,5 @@
"Le résultat de l'API est d'un type inconnu, cela ne devrait jamais se produire. ",
'APIException:MissingParameterInMethod' => "Il manque un paramètre %s à la méthode %s",
'APIException:ParameterNotArray' => "%s ne semble pas être un tableau. ",
@@ -39,4 +39,4 @@
'system.api.list' => "Liste de tous les appels API disponibles sur le système.",
'auth.gettoken' => "Cet appel à l'API permet à un utilisateur d'obtenir un jeton d'authentification d'utilisateur qui peut être utilisé pour authentifier les futurs appels à l'API. Passez-le en tant que paramètre auth_token",
-);
+];
diff --git a/mod/web_services/languages/gl.php b/mod/web_services/languages/gl.php
index b614217e446..36fc786a62a 100644
--- a/mod/web_services/languages/gl.php
+++ b/mod/web_services/languages/gl.php
@@ -1,5 +1,5 @@
"Non se coñece o tipo do resultado da API, isto non debería acontecer nunca.",
'APIException:MissingParameterInMethod' => "Falta o parámetro «%s» do método «%s».",
'APIException:ParameterNotArray' => "«%s» non parece ser un vector",
@@ -39,4 +39,4 @@
'system.api.list' => "Listar todas as chamadas á API dispoñíbeis no sistema.",
'auth.gettoken' => "Esta chamada á API permite ao usuario obter un código de autenticación que pode usarse para autenticar chamadas futuras á API. Pasa o código como valor do parámetro «auth_token».",
-);
+];
diff --git a/mod/web_services/languages/it.php b/mod/web_services/languages/it.php
index a4c43aacdb7..0c60eab5034 100644
--- a/mod/web_services/languages/it.php
+++ b/mod/web_services/languages/it.php
@@ -1,5 +1,5 @@
"Il risultato dell'API è di un tipo sconosciuto, ciò non dovrebbe mai accadere.",
'APIException:MissingParameterInMethod' => "Parametro %s mancante nel metodo %s",
'APIException:ParameterNotArray' => "%s non sembra essere una matrice.",
@@ -39,4 +39,4 @@
'system.api.list' => "Elenca tutte le chiamate API disponibili nel sistema.",
'auth.gettoken' => "Questa chiamata API permette a un utente di ottenere un token di autenticazione che può essere utilizzato per autenticare successive chiamate API. Passarlo come parametro auth_token",
-);
+];
diff --git a/mod/web_services/languages/ja.php b/mod/web_services/languages/ja.php
index 1300fefa500..6c7a9f6b267 100644
--- a/mod/web_services/languages/ja.php
+++ b/mod/web_services/languages/ja.php
@@ -1,5 +1,5 @@
"API Result は不明な型です。このようなことは起きないはずなのですが。。。",
'APIException:MissingParameterInMethod' => "メソッド「 %2\$s 」のパラメタ「 %1\$s 」が欠落しています",
'APIException:ParameterNotArray' => "%s は、配列ではないようです。",
@@ -39,4 +39,4 @@
'system.api.list' => "このシステムでの利用可能な全APIコール一覧。",
'auth.gettoken' => "このAPIコールはユーザ認証トークンをユーザに渡します。このトークンは今後のAPIコールの時に使用されます。 パラメータ auth_token として渡してください。",
-);
+];
diff --git a/mod/web_services/languages/nl.php b/mod/web_services/languages/nl.php
index 2a7429f4fa5..0ef92b84d61 100644
--- a/mod/web_services/languages/nl.php
+++ b/mod/web_services/languages/nl.php
@@ -1,5 +1,5 @@
"API resultaat is van een ongekend type, dit zou nooit moeten gebeuren.",
'APIException:MissingParameterInMethod' => "Ontbrekende parameter %s in de methode %s",
'APIException:ParameterNotArray' => "%s lijkt geen array te zijn.",
@@ -39,4 +39,4 @@
'system.api.list' => "Toont een lijst van alle beschikbare API calls in het systeem",
'auth.gettoken' => "Deze API call levert een user authenticatie token op waarmee men in de toekomst API calls kan authentiseren. Gebruik het dan als de auth_token parameter.",
-);
+];
diff --git a/mod/web_services/languages/pt_br.php b/mod/web_services/languages/pt_br.php
index 7645ccdccb4..b8def2303a3 100644
--- a/mod/web_services/languages/pt_br.php
+++ b/mod/web_services/languages/pt_br.php
@@ -1,5 +1,5 @@
"Resultado da API é de um tipo desconhecido, isto nunca deveria ocorrer.",
'APIException:MissingParameterInMethod' => "Parâmetro perdido %s no método %s",
'APIException:ParameterNotArray' => "%s não parece ser uma matriz (array)",
@@ -39,4 +39,4 @@
'system.api.list' => "Lista todas chamadas de API disponíveis no sistema.",
'auth.gettoken' => "Eata chamada de API permite ao usuário obter um token de autenticação que pode ser usado para autenticar futuras chamadas de API. Passa isso como um parametro auth_token",
-);
+];
diff --git a/mod/web_services/lib/api_user.php b/mod/web_services/lib/api_user.php
index 2a49e285e90..4781dbe9674 100644
--- a/mod/web_services/lib/api_user.php
+++ b/mod/web_services/lib/api_user.php
@@ -30,7 +30,7 @@ function create_api_user() {
* Find an API User's details based on the provided public api key.
* These users are not users in the traditional sense.
*
- * @param string $api_key The API Key
+ * @param string $api_key The API Key
*
* @return mixed stdClass representing the database row or false.
*/
@@ -47,7 +47,7 @@ function get_api_user($api_key) {
/**
* Revoke an api user key.
*
- * @param string $api_key The API Key (public).
+ * @param string $api_key The API Key (public).
*
* @return bool
*/
diff --git a/mod/web_services/lib/client.php b/mod/web_services/lib/client.php
index 36193e875ad..ca591c0ba17 100644
--- a/mod/web_services/lib/client.php
+++ b/mod/web_services/lib/client.php
@@ -1,7 +1,7 @@
$method,
'header' => serialise_api_headers($headers)
- );
+ ];
if ($method == 'POST') {
$http_opts['content'] = $post_data;
}
- $opts = array('http' => $http_opts);
+ $opts = ['http' => $http_opts];
// Send context
$context = stream_context_create($opts);
@@ -138,7 +138,7 @@ function send_api_post_call($url, array $call, array $keys, $post_data,
* @return array
*/
function get_standard_api_key_array($secret_key, $api_key) {
- return array('public' => $api_key, 'private' => $secret_key);
+ return ['public' => $api_key, 'private' => $secret_key];
}
/**
diff --git a/mod/web_services/lib/tokens.php b/mod/web_services/lib/tokens.php
index a7aaf830645..290d41de7f9 100644
--- a/mod/web_services/lib/tokens.php
+++ b/mod/web_services/lib/tokens.php
@@ -43,7 +43,7 @@ function create_user_token($username, $expire = 60) {
*/
function get_user_tokens($user_guid) {
$dbprefix = elgg_get_config('dbprefix');
- $user_guid = (int)$user_guid;
+ $user_guid = (int) $user_guid;
$tokens = get_data("SELECT * from {$dbprefix}users_apisessions
where user_guid=$user_guid");
diff --git a/mod/web_services/lib/web_services.php b/mod/web_services/lib/web_services.php
index c9f23b06318..7619dcf0f18 100644
--- a/mod/web_services/lib/web_services.php
+++ b/mod/web_services/lib/web_services.php
@@ -20,7 +20,7 @@ function authenticate_method($method) {
// method must be exposed
if (!isset($API_METHODS[$method])) {
- throw new APIException(elgg_echo('APIException:MethodCallNotImplemented', array($method)));
+ throw new APIException(elgg_echo('APIException:MethodCallNotImplemented', [$method]));
}
// check API authentication if required
@@ -32,7 +32,7 @@ function authenticate_method($method) {
}
$user_pam = new ElggPAM('user');
- $user_auth_result = $user_pam->authenticate(array());
+ $user_auth_result = $user_pam->authenticate([]);
// check if user authentication is required
if ($API_METHODS[$method]["require_user_auth"] == true) {
@@ -59,21 +59,21 @@ function execute_method($method) {
// method must be exposed
if (!isset($API_METHODS[$method])) {
- $msg = elgg_echo('APIException:MethodCallNotImplemented', array($method));
+ $msg = elgg_echo('APIException:MethodCallNotImplemented', [$method]);
throw new APIException($msg);
}
// function must be callable
$function = elgg_extract('function', $API_METHODS[$method]);
if (!$function || !is_callable($function)) {
- $msg = elgg_echo('APIException:FunctionDoesNotExist', array($method));
+ $msg = elgg_echo('APIException:FunctionDoesNotExist', [$method]);
throw new APIException($msg);
}
// check http call method
if (strcmp(get_call_method(), $API_METHODS[$method]["call_method"]) != 0) {
- $msg = elgg_echo('CallException:InvalidCallMethod', array($method,
- $API_METHODS[$method]["call_method"]));
+ $msg = elgg_echo('CallException:InvalidCallMethod', [$method,
+ $API_METHODS[$method]["call_method"]]);
throw new CallException($msg);
}
@@ -109,13 +109,13 @@ function execute_method($method) {
}
if ($result === false) {
- $msg = elgg_echo('APIException:FunctionParseError', array($function, $serialised_parameters));
+ $msg = elgg_echo('APIException:FunctionParseError', [$function, $serialised_parameters]);
throw new APIException($msg);
}
- if ($result === NULL) {
+ if ($result === null) {
// If no value
- $msg = elgg_echo('APIException:FunctionNoReturn', array($function, $serialised_parameters));
+ $msg = elgg_echo('APIException:FunctionNoReturn', [$function, $serialised_parameters]);
throw new APIException($msg);
}
@@ -147,7 +147,7 @@ function get_call_method() {
function get_parameters_for_method($method) {
global $API_METHODS;
- $sanitised = array();
+ $sanitised = [];
// if there are parameters, sanitize them
if (isset($API_METHODS[$method]['parameters'])) {
@@ -204,14 +204,13 @@ function verify_parameters($method, $parameters) {
foreach ($API_METHODS[$method]['parameters'] as $key => $value) {
// this tests the expose structure: must be array to describe parameter and type must be defined
if (!is_array($value) || !isset($value['type'])) {
-
- $msg = elgg_echo('APIException:InvalidParameter', array($key, $method));
+ $msg = elgg_echo('APIException:InvalidParameter', [$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 = elgg_echo('APIException:MissingParameterInMethod', array($key, $method));
+ $msg = elgg_echo('APIException:MissingParameterInMethod', [$key, $method]);
throw new APIException($msg);
}
}
@@ -265,7 +264,6 @@ function serialise_parameters($method, $parameters) {
$serialised_parameters = "";
foreach ($API_METHODS[$method]['parameters'] as $key => $value) {
-
// avoid warning on parameters that are not required and not present
if (!isset($parameters[$key])) {
$serialised_parameters .= ',null';
@@ -273,11 +271,10 @@ function serialise_parameters($method, $parameters) {
}
// Set variables casting to type.
- switch (strtolower($value['type']))
- {
+ switch (strtolower($value['type'])) {
case 'int':
case 'integer' :
- $serialised_parameters .= "," . (int)trim($parameters[$key]);
+ $serialised_parameters .= "," . (int) trim($parameters[$key]);
break;
case 'bool':
case 'boolean':
@@ -295,12 +292,12 @@ function serialise_parameters($method, $parameters) {
$serialised_parameters .= ',' . var_export(trim($parameters[$key]), true);
break;
case 'float':
- $serialised_parameters .= "," . (float)trim($parameters[$key]);
+ $serialised_parameters .= "," . (float) trim($parameters[$key]);
break;
case 'array':
// we can handle an array of strings, maybe ints, definitely not booleans or other arrays
if (!is_array($parameters[$key])) {
- $msg = elgg_echo('APIException:ParameterNotArray', array($key));
+ $msg = elgg_echo('APIException:ParameterNotArray', [$key]);
throw new APIException($msg);
}
@@ -324,7 +321,7 @@ function serialise_parameters($method, $parameters) {
$serialised_parameters .= $array;
break;
default:
- $msg = elgg_echo('APIException:UnrecognisedTypeCast', array($value['type'], $key, $method));
+ $msg = elgg_echo('APIException:UnrecognisedTypeCast', [$value['type'], $key, $method]);
throw new APIException($msg);
}
}
@@ -417,7 +414,7 @@ function api_auth_hmac() {
if (strcmp($api_header->posthash, $calculated_posthash) != 0) {
$msg = elgg_echo('SecurityException:InvalidPostHash',
- array($calculated_posthash, $api_header->posthash));
+ [$calculated_posthash, $api_header->posthash]);
throw new SecurityException($msg);
}
@@ -512,18 +509,18 @@ function get_and_validate_api_headers() {
*/
function map_api_hash($algo) {
$algo = strtolower(sanitise_string($algo));
- $supported_algos = array(
+ $supported_algos = [
"md5" => "md5", // @todo Consider phasing this out
"sha" => "sha1", // alias for sha1
"sha1" => "sha1",
"sha256" => "sha256"
- );
+ ];
if (array_key_exists($algo, $supported_algos)) {
return $supported_algos[$algo];
}
- throw new APIException(elgg_echo('APIException:AlgorithmNotSupported', array($algo)));
+ throw new APIException(elgg_echo('APIException:AlgorithmNotSupported', [$algo]));
}
/**
@@ -719,9 +716,9 @@ function _php_api_exception_handler($exception) {
error_log("*** FATAL EXCEPTION (API) *** : " . $exception);
$code = $exception->getCode() == 0 ? ErrorResult::$RESULT_FAIL : $exception->getCode();
- $result = new ErrorResult($exception->getMessage(), $code, NULL);
+ $result = new ErrorResult($exception->getMessage(), $code, null);
- echo elgg_view_page($exception->getMessage(), elgg_view("api/output", array("result" => $result)));
+ echo elgg_view_page($exception->getMessage(), elgg_view("api/output", ["result" => $result]));
}
diff --git a/mod/web_services/start.php b/mod/web_services/start.php
index 23b84a8f341..cfbd88d1646 100644
--- a/mod/web_services/start.php
+++ b/mod/web_services/start.php
@@ -29,10 +29,10 @@ function ws_init() {
elgg_ws_expose_function(
"auth.gettoken",
"auth_gettoken",
- array(
- 'username' => array ('type' => 'string'),
- 'password' => array ('type' => 'string'),
- ),
+ [
+ 'username' => ['type' => 'string'],
+ 'password' => ['type' => 'string'],
+ ],
elgg_echo('auth.gettoken'),
'POST',
false,
@@ -46,7 +46,7 @@ function ws_init() {
/**
* Handle a web service request
- *
+ *
* Handles requests of format: http://site/services/api/handler/response_format/request
* The first element after 'services/api/' is the service handler name as
* registered by {@link register_service_handler()}.
@@ -57,7 +57,7 @@ function ws_init() {
* function registered by {@link register_service_handler()}.
*
* If a service handler isn't found, a 404 header is sent.
- *
+ *
* @param array $segments URL segments
* @return bool
*/
@@ -98,11 +98,11 @@ function ws_page_handler($segments) {
* )
*/
global $API_METHODS;
-$API_METHODS = array();
+$API_METHODS = [];
/** Define a global array of errors */
global $ERRORS;
-$ERRORS = array();
+$ERRORS = [];
/**
* Expose a function as a web service.
@@ -158,28 +158,28 @@ function elgg_ws_expose_function(
}
// does not check whether this method has already been exposed - good idea?
- $API_METHODS[$method] = array();
+ $API_METHODS[$method] = [];
$API_METHODS[$method]["description"] = $description;
// does not check whether callable - done in execute_method()
$API_METHODS[$method]["function"] = $function;
- if ($parameters != NULL) {
+ if ($parameters != null) {
if (!is_array($parameters)) {
- $msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', array($method));
+ $msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', [$method]);
throw new InvalidParameterException($msg);
}
// catch common mistake of not setting up param array correctly
$first = current($parameters);
if (!is_array($first)) {
- $msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', array($method));
+ $msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', [$method]);
throw new InvalidParameterException($msg);
}
}
- if ($parameters != NULL) {
+ if ($parameters != null) {
// ensure the required flag is set correctly in default case for each parameter
foreach ($parameters as $key => $value) {
// check if 'required' was specified - if not, make it true
@@ -201,7 +201,7 @@ function elgg_ws_expose_function(
break;
default :
$msg = elgg_echo('InvalidParameterException:UnrecognisedHttpMethod',
- array($call_method, $method));
+ [$call_method, $method]);
throw new InvalidParameterException($msg);
}
@@ -210,7 +210,7 @@ function elgg_ws_expose_function(
$API_METHODS[$method]["require_user_auth"] = $require_user_auth;
- $API_METHODS[$method]["assoc"] = (bool)$assoc;
+ $API_METHODS[$method]["assoc"] = (bool) $assoc;
return true;
}
@@ -256,7 +256,7 @@ function elgg_ws_register_service_handler($handler, $function) {
global $CONFIG;
if (!isset($CONFIG->servicehandler)) {
- $CONFIG->servicehandler = array();
+ $CONFIG->servicehandler = [];
}
if (is_callable($function, true)) {
$CONFIG->servicehandler[$handler] = $function;
@@ -343,7 +343,7 @@ function ws_rest_handler() {
}
// Output the result
- echo elgg_view_page($method, elgg_view("api/output", array("result" => $result)));
+ echo elgg_view_page($method, elgg_view("api/output", ["result" => $result]));
}
/**
@@ -366,7 +366,7 @@ function ws_unit_test($hook, $type, $value, $params) {
/**
* Filters system API list to remove PHP internal function names
- *
+ *
* @param string $hook "rest:output"
* @param string $type "system.api.list"
* @param array $return API list
@@ -376,7 +376,7 @@ function ws_unit_test($hook, $type, $value, $params) {
function ws_system_api_list_hook($hook, $type, $return, $params) {
if (!empty($return) && is_array($return)) {
- foreach($return as $method => $settings) {
+ foreach ($return as $method => $settings) {
unset($return[$method]['function']);
}
}
diff --git a/mod/web_services/views/default/api/output.php b/mod/web_services/views/default/api/output.php
index a7041c0f4ba..62cde9fa813 100644
--- a/mod/web_services/views/default/api/output.php
+++ b/mod/web_services/views/default/api/output.php
@@ -18,8 +18,7 @@
status}) ****";
+ else echo "**** ERROR ({$export->status}) ****";
?>
@@ -39,4 +38,4 @@
Runtime: runtime_errors); ?>
-
\ No newline at end of file
+
diff --git a/mod/web_services/views/json/api/output.php b/mod/web_services/views/json/api/output.php
index e65b141369a..50f86755686 100644
--- a/mod/web_services/views/json/api/output.php
+++ b/mod/web_services/views/json/api/output.php
@@ -9,4 +9,4 @@
$result = $vars['result'];
$export = $result->export();
-echo json_encode($export);
\ No newline at end of file
+echo json_encode($export);
diff --git a/views/default/admin.css.php b/views/default/admin.css.php
index a5882ff78fe..08fff7ab660 100644
--- a/views/default/admin.css.php
+++ b/views/default/admin.css.php
@@ -546,16 +546,16 @@
padding: 0 3px;
}
.elgg-fieldset-horizontal .elgg-field {
- display: inline-block;
- margin: 0 10px 0 0;
+ display: inline-block;
+ margin: 0 10px 0 0;
}
.elgg-fieldset-horizontal.elgg-justify-right .elgg-field {
- margin: 0 0 0 10px;
+ margin: 0 0 0 10px;
}
.elgg-fieldset-horizontal.elgg-justify-center .elgg-field {
- margin: 0 5px;
+ margin: 0 5px;
}
.elgg-button {
@@ -639,7 +639,7 @@
?>
/* **************************************
- DATE PICKER
+ DATE PICKER
*************************************** */
.ui-datepicker {
margin-top: 3px;
@@ -773,7 +773,7 @@
cursor: pointer;
}
/* ***************************************
- PROGRESS BAR
+ PROGRESS BAR
**************************************** */
.elgg-progressbar {
height: 20px;
@@ -1138,7 +1138,7 @@
PLUGINS
**************************************** */
#plugins-filter {
- margin: 5px 5px 20px;
+ margin: 5px 5px 20px;
}
.elgg-admin-plugins-categories li {
padding-right: 5px;
@@ -1264,16 +1264,16 @@
color: #8a1f11;
border-color: #fbc2c4;
padding: 3px 6px;
- margin: 3px 0;
- width: auto;
+ margin: 3px 0;
+ width: auto;
}
.elgg-plugin .elgg-state-warning {
background: #f4f4f4;
color: #000000;
border-color: #fbe58b;
padding: 3px 6px;
- margin: 3px 0;
- width: auto;
+ margin: 3px 0;
+ width: auto;
}
.elgg-plugin-list-error .elgg-state-error,
.elgg-plugin-list-error .elgg-state-warning {
diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/appearance/default_widgets.php
index 43b9c77a1c9..a12e70b028e 100644
--- a/views/default/admin/appearance/default_widgets.php
+++ b/views/default/admin/appearance/default_widgets.php
@@ -8,7 +8,7 @@
elgg_push_context('default_widgets');
$widget_context = get_input('widget_context');
-$list = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, array());
+$list = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, []);
// default to something if we can
if (!$widget_context && $list) {
@@ -16,7 +16,7 @@
}
$current_info = null;
-$tabs = array();
+$tabs = [];
foreach ($list as $info) {
$url = "admin/appearance/default_widgets?widget_context={$info['widget_context']}";
$selected = false;
@@ -25,20 +25,20 @@
$current_info = $info;
}
- $tabs[] = array(
+ $tabs[] = [
'title' => $info['name'],
'url' => $url,
'selected' => $selected
- );
+ ];
}
-$tabs_vars = array(
+$tabs_vars = [
'tabs' => $tabs
-);
+];
echo elgg_view('navigation/tabs', $tabs_vars);
-echo elgg_view('output/longtext', array('value' => elgg_echo('admin:default_widgets:instructions')));
+echo elgg_view('output/longtext', ['value' => elgg_echo('admin:default_widgets:instructions')]);
if (!$current_info) {
$content = elgg_echo('admin:default_widgets:unknown_type');
diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/appearance/menu_items.php
index 1d5c95cf9de..ec234b53a34 100644
--- a/views/default/admin/appearance/menu_items.php
+++ b/views/default/admin/appearance/menu_items.php
@@ -7,4 +7,4 @@
*/
-echo elgg_view_form('admin/menu/save', array('class' => 'elgg-form-settings'));
+echo elgg_view_form('admin/menu/save', ['class' => 'elgg-form-settings']);
diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php
index 4b8297464e7..ed54c060d77 100644
--- a/views/default/admin/appearance/profile_fields.php
+++ b/views/default/admin/appearance/profile_fields.php
@@ -3,17 +3,17 @@
* Admin area: edit default profile fields
*/
-$add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array());
+$add = elgg_view_form('profile/fields/add', ['class' => 'elgg-form-settings'], []);
$list = elgg_view('admin/appearance/profile_fields/list');
-$reset = elgg_view('output/url', array(
+$reset = elgg_view('output/url', [
'text' => elgg_echo('reset'),
'href' => 'action/profile/fields/reset',
'title' => elgg_echo('profile:resetdefault'),
'confirm' => elgg_echo('profile:resetdefault:confirm'),
'class' => 'elgg-button elgg-button-cancel',
'is_trusted' => 'true',
-));
+]);
$body = <<<__HTML
$add
diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php
index b95452cb5a4..b0dc7626dc1 100644
--- a/views/default/admin/appearance/profile_fields/list.php
+++ b/views/default/admin/appearance/profile_fields/list.php
@@ -7,8 +7,8 @@
// List form elements
$n = 0;
-$loaded_defaults = array();
-$items = array();
+$loaded_defaults = [];
+$items = [];
$fieldlist = elgg_get_config('profile_custom_fields');
if ($fieldlist || $fieldlist === '0') {
$fieldlistarray = explode(',', $fieldlist);
@@ -30,14 +30,14 @@
$item->translation));
+ echo elgg_view("profile/", ['value' => $item->translation]);
- $url = elgg_view('output/url', array(
+ $url = elgg_view('output/url', [
'href' => "action/profile/fields/delete?id={$item->shortname}",
'text' => elgg_view_icon('delete-alt'),
'is_action' => true,
'is_trusted' => true,
- ));
+ ]);
$type = elgg_echo($item->type);
$drag_arrow = elgg_view_icon("drag-arrow", "elgg-state-draggable");
echo <<
-
\ No newline at end of file
+
diff --git a/views/default/admin/footer.php b/views/default/admin/footer.php
index ce420e99a41..b4564a7e14c 100644
--- a/views/default/admin/footer.php
+++ b/views/default/admin/footer.php
@@ -3,7 +3,7 @@
* Elgg admin footer. Extend this view to add content to the admin footer
*/
-$options = array(
+$options = [
'class' => 'elgg-menu-hz'
-);
-echo elgg_view_menu('admin_footer', $options);
\ No newline at end of file
+];
+echo elgg_view_menu('admin_footer', $options);
diff --git a/views/default/admin/header.php b/views/default/admin/header.php
index 39213b9e938..5ffe707dd86 100644
--- a/views/default/admin/header.php
+++ b/views/default/admin/header.php
@@ -2,12 +2,12 @@
/**
* Elgg admin header
*/
-
+
$admin_title = elgg_get_site_entity()->name . ' ' . elgg_echo('admin');
-$options = array(
+$options = [
'sort_by' => 'priority'
-);
+];
?>
@@ -23,4 +23,4 @@
-
\ No newline at end of file
+
diff --git a/views/default/admin/plugin_settings.php b/views/default/admin/plugin_settings.php
index 1c6e9e2067a..ab1afcf3cd6 100644
--- a/views/default/admin/plugin_settings.php
+++ b/views/default/admin/plugin_settings.php
@@ -19,8 +19,8 @@
if (elgg_view_exists("settings/$plugin_id/edit") || elgg_view_exists("plugins/$plugin_id/settings")) {
$title = $plugin->getManifest()->getName();
- $params = array('id' => "$plugin_id-settings", 'class' => 'elgg-form-settings');
+ $params = ['id' => "$plugin_id-settings", 'class' => 'elgg-form-settings'];
$body = elgg_view_form("plugins/settings/save", $params, $vars);
echo elgg_view_module('info', $title, $body);
-}
\ No newline at end of file
+}
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php
index 9001fda937a..88e00b3e35e 100644
--- a/views/default/admin/plugins.php
+++ b/views/default/admin/plugins.php
@@ -7,7 +7,7 @@
* @uses $vars['list_only']
*/
-$list_only = (bool)elgg_extract('list_only', $vars);
+$list_only = (bool) elgg_extract('list_only', $vars);
// @todo this should occur in the controller code
_elgg_generate_plugin_entities();
@@ -17,7 +17,7 @@
// Get a list of the all categories
// and trim down the plugin list if we're not viewing all categories.
// @todo this could be cached somewhere after have the manifest loaded
-$categories = array();
+$categories = [];
foreach ($installed_plugins as $id => $plugin) {
if (!$plugin->isValid()) {
@@ -29,7 +29,7 @@
if ($disable_plugins) {
// force disable and warn
elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(),
- elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId())));
+ elgg_echo('ElggPlugin:InvalidAndDeactivated', [$plugin->getId()]));
$plugin->deactivate();
}
}
diff --git a/views/default/admin/plugins/filter.php b/views/default/admin/plugins/filter.php
index d9ffb7005ce..3ed087d69e6 100644
--- a/views/default/admin/plugins/filter.php
+++ b/views/default/admin/plugins/filter.php
@@ -17,13 +17,13 @@
}
$key = preg_replace('/[^a-z0-9-]/i', '-', $key);
- $link = elgg_view('output/url', array(
+ $link = elgg_view('output/url', [
'text' => $category,
'href' => '#',
'rel' => $key
- ));
+ ]);
- $list_items .= elgg_format_element('li', array(), $link);
+ $list_items .= elgg_format_element('li', [], $link);
}
$body = elgg_format_element([
diff --git a/views/default/admin/settings/advanced.php b/views/default/admin/settings/advanced.php
index a262740f222..c7f65d11159 100644
--- a/views/default/admin/settings/advanced.php
+++ b/views/default/admin/settings/advanced.php
@@ -6,4 +6,4 @@
* @subpackage Core
*/
-echo elgg_view_form('admin/site/update_advanced', array('class' => 'elgg-form-settings'));
+echo elgg_view_form('admin/site/update_advanced', ['class' => 'elgg-form-settings']);
diff --git a/views/default/admin/settings/basic.php b/views/default/admin/settings/basic.php
index 9334ba81bed..a885c40817b 100644
--- a/views/default/admin/settings/basic.php
+++ b/views/default/admin/settings/basic.php
@@ -6,4 +6,4 @@
* @subpackage Core
*/
-echo elgg_view_form('admin/site/update_basic', array('class' => 'elgg-form-settings'));
+echo elgg_view_form('admin/site/update_basic', ['class' => 'elgg-form-settings']);
diff --git a/views/default/admin/sidebar.php b/views/default/admin/sidebar.php
index fea3e21e1cf..d92e2d0c6a6 100644
--- a/views/default/admin/sidebar.php
+++ b/views/default/admin/sidebar.php
@@ -3,6 +3,6 @@
* Admin sidebar -- just outputs the page menus
*/
-$content = elgg_view_menu('page', array('sort_by' => 'priority', 'show_section_headers' => true));
+$content = elgg_view_menu('page', ['sort_by' => 'priority', 'show_section_headers' => true]);
-echo elgg_view_module('main', '', $content, array('class' => 'elgg-admin-sidebar-menu', 'id' => 'elgg-admin-nav-collapse'));
\ No newline at end of file
+echo elgg_view_module('main', '', $content, ['class' => 'elgg-admin-sidebar-menu', 'id' => 'elgg-admin-nav-collapse']);
diff --git a/views/default/admin/statistics/overview/basic.php b/views/default/admin/statistics/overview/basic.php
index 3faab7c68fc..75911fc0307 100644
--- a/views/default/admin/statistics/overview/basic.php
+++ b/views/default/admin/statistics/overview/basic.php
@@ -23,4 +23,4 @@
:
/
-
\ No newline at end of file
+
diff --git a/views/default/admin/statistics/overview/numentities.php b/views/default/admin/statistics/overview/numentities.php
index c0d0c240d03..bf33f92ba77 100644
--- a/views/default/admin/statistics/overview/numentities.php
+++ b/views/default/admin/statistics/overview/numentities.php
@@ -5,7 +5,6 @@
foreach ($entity_stats as $k => $entry) {
arsort($entry);
foreach ($entry as $a => $b) {
-
if ($a == "__base__") {
$a = elgg_echo("item:{$k}");
if (empty($a))
diff --git a/views/default/admin/statistics/server/memcache.php b/views/default/admin/statistics/server/memcache.php
index b7372bf7213..4c351c9f90c 100644
--- a/views/default/admin/statistics/server/memcache.php
+++ b/views/default/admin/statistics/server/memcache.php
@@ -11,7 +11,6 @@
$memcache = new Memcache;
foreach ($servers as $server) {
-
$title = "{$server[0]}:{$server[1]}";
$memcache->connect($server[0], $server[1]);
diff --git a/views/default/admin/upgrades.php b/views/default/admin/upgrades.php
index 6cda9a743e9..009d2771a4b 100644
--- a/views/default/admin/upgrades.php
+++ b/views/default/admin/upgrades.php
@@ -5,19 +5,19 @@
elgg_require_js('elgg/upgrader');
-elgg_register_menu_item('title', array(
+elgg_register_menu_item('title', [
'name' => 'run_upgrades',
'text' => elgg_echo('admin:upgrades:run'),
'id' => 'elgg-upgrades-run',
'link_class' => 'elgg-button elgg-button-action hidden',
-));
+]);
-$upgrades = elgg_get_entities_from_private_settings(array(
+$upgrades = elgg_get_entities_from_private_settings([
'type' => 'object',
'subtype' => 'elgg_upgrade',
'private_setting_name' => 'is_completed',
'private_setting_value' => false
-));
+]);
if (!$upgrades) {
echo elgg_echo('admin:upgrades:none');
diff --git a/views/default/admin/users/add.php b/views/default/admin/users/add.php
index 6d22b9c29d0..8d806a0a558 100644
--- a/views/default/admin/users/add.php
+++ b/views/default/admin/users/add.php
@@ -4,6 +4,6 @@
*/
$title = elgg_echo('adduser');
-$body = elgg_view_form('useradd', array(), array('show_admin' => true));
+$body = elgg_view_form('useradd', [], ['show_admin' => true]);
-echo elgg_view_module('inline', $title, $body);
\ No newline at end of file
+echo elgg_view_module('inline', $title, $body);
diff --git a/views/default/admin/users/newest.css b/views/default/admin/users/newest.css
index f657e6aa8e8..bb53b1fa2e4 100644
--- a/views/default/admin/users/newest.css
+++ b/views/default/admin/users/newest.css
@@ -2,3 +2,4 @@
.elgg-newest-users td + td {
white-space: nowrap;
}
+
diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php
index 5d29a53e2cd..b8766ee7c09 100644
--- a/views/default/annotation/default.php
+++ b/views/default/annotation/default.php
@@ -16,13 +16,13 @@
$icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = "getURL()}\">$owner->name ";
-$menu = elgg_view_menu('annotation', array(
+$menu = elgg_view_menu('annotation', [
'annotation' => $annotation,
'sort_by' => 'priority',
'class' => 'elgg-menu-hz float-alt',
-));
+]);
-$text = elgg_view("output/longtext", array("value" => $annotation->value));
+$text = elgg_view("output/longtext", ["value" => $annotation->value]);
$friendlytime = elgg_view_friendly_time($annotation->time_created);
diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php
index cb946ea35d3..0d4862849db 100644
--- a/views/default/core/account/login_dropdown.php
+++ b/views/default/core/account/login_dropdown.php
@@ -7,16 +7,16 @@
return true;
}
-$body = elgg_view_form('login', array(), array('returntoreferer' => TRUE));
+$body = elgg_view_form('login', [], ['returntoreferer' => true]);
?>
- elgg_get_login_url([], '#login-dropdown-box'),
'rel' => 'popup',
'class' => 'elgg-button elgg-button-dropdown',
'text' => elgg_echo('login'),
- ));
- echo elgg_view_module('dropdown', '', $body, array('id' => 'login-dropdown-box'));
+ ]);
+ echo elgg_view_module('dropdown', '', $body, ['id' => 'login-dropdown-box']);
?>
diff --git a/views/default/core/ajax/edit_comment.php b/views/default/core/ajax/edit_comment.php
index 183cf5bd3e8..77692df4d3a 100644
--- a/views/default/core/ajax/edit_comment.php
+++ b/views/default/core/ajax/edit_comment.php
@@ -16,9 +16,9 @@
return false;
}
-$form_vars = array(
+$form_vars = [
'class' => 'hidden mvl',
'id' => "edit-comment-{$guid}",
-);
-$body_vars = array('comment' => $comment);
+];
+$body_vars = ['comment' => $comment];
echo elgg_view_form('comment/save', $form_vars, $body_vars);
diff --git a/views/default/core/avatar/crop.php b/views/default/core/avatar/crop.php
index 1c59842c84b..b3d8d35d6ce 100644
--- a/views/default/core/avatar/crop.php
+++ b/views/default/core/avatar/crop.php
@@ -12,5 +12,5 @@
-
+
diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php
index 6f9124192c3..b42cbd2c003 100644
--- a/views/default/core/avatar/upload.php
+++ b/views/default/core/avatar/upload.php
@@ -5,25 +5,25 @@
* @uses $vars['entity']
*/
-$user_avatar = elgg_view('output/img', array(
+$user_avatar = elgg_view('output/img', [
'src' => $vars['entity']->getIconUrl('medium'),
'alt' => elgg_echo('avatar'),
-));
+]);
$current_label = elgg_echo('avatar:current');
$remove_button = '';
if ($vars['entity']->icontime) {
- $remove_button = elgg_view('output/url', array(
+ $remove_button = elgg_view('output/url', [
'text' => elgg_echo('remove'),
'title' => elgg_echo('avatar:remove'),
'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(),
'is_action' => true,
'class' => 'elgg-button elgg-button-cancel mll',
- ));
+ ]);
}
-$form_params = array('enctype' => 'multipart/form-data');
+$form_params = ['enctype' => 'multipart/form-data'];
$upload_form = elgg_view_form('avatar/upload', $form_params, $vars);
?>
diff --git a/views/default/core/maintenance/login.php b/views/default/core/maintenance/login.php
index 77713cf0a09..b9fe0f8875a 100644
--- a/views/default/core/maintenance/login.php
+++ b/views/default/core/maintenance/login.php
@@ -3,7 +3,7 @@
* Maintenance mode login
*/
-echo elgg_view('core/account/login_box', array(
+echo elgg_view('core/account/login_box', [
'module' => 'maintenance-login',
'title' => elgg_echo('admin:login'),
-));
+]);
diff --git a/views/default/core/river/filter.js b/views/default/core/river/filter.js
index ca0e319e8cc..e79d0e99495 100644
--- a/views/default/core/river/filter.js
+++ b/views/default/core/river/filter.js
@@ -12,4 +12,4 @@ define(function (require) {
url += '?' + $(this).val();
window.location.href = url;
});
-});
\ No newline at end of file
+});
diff --git a/views/default/core/river/filter.php b/views/default/core/river/filter.php
index f3b3380d392..4f25ce2f512 100644
--- a/views/default/core/river/filter.php
+++ b/views/default/core/river/filter.php
@@ -6,29 +6,29 @@
*/
// create selection array
-$options = array();
-$options['type=all'] = elgg_echo('river:select', array(elgg_echo('all')));
+$options = [];
+$options['type=all'] = elgg_echo('river:select', [elgg_echo('all')]);
$registered_entities = elgg_get_config('registered_entities');
if (!empty($registered_entities)) {
foreach ($registered_entities as $type => $subtypes) {
// subtype will always be an array.
if (!count($subtypes)) {
- $label = elgg_echo('river:select', array(elgg_echo("item:$type")));
+ $label = elgg_echo('river:select', [elgg_echo("item:$type")]);
$options["type=$type"] = $label;
} else {
foreach ($subtypes as $subtype) {
- $label = elgg_echo('river:select', array(elgg_echo("item:$type:$subtype")));
+ $label = elgg_echo('river:select', [elgg_echo("item:$type:$subtype")]);
$options["type=$type&subtype=$subtype"] = $label;
}
}
}
}
-$params = array(
+$params = [
'id' => 'elgg-river-selector',
'options_values' => $options,
-);
+];
$selector = $vars['selector'];
if ($selector) {
$params['value'] = $selector;
diff --git a/views/default/core/river/filter_deps.php b/views/default/core/river/filter_deps.php
index c0c21f7f6fd..32308ce0e79 100644
--- a/views/default/core/river/filter_deps.php
+++ b/views/default/core/river/filter_deps.php
@@ -3,4 +3,4 @@
/**
* Extends core/river/filter view to load AMD modules in a BC way
*/
-elgg_require_js('core/river/filter');
\ No newline at end of file
+elgg_require_js('core/river/filter');
diff --git a/views/default/core/settings/account.php b/views/default/core/settings/account.php
index 273f1e8f4a6..2bfb7e3a6d8 100644
--- a/views/default/core/settings/account.php
+++ b/views/default/core/settings/account.php
@@ -1,11 +1,11 @@
'elgg-form-alt',
-));
+]);
diff --git a/views/default/core/settings/account/default_access.php b/views/default/core/settings/account/default_access.php
index 07592b00a5b..686ccd44660 100644
--- a/views/default/core/settings/account/default_access.php
+++ b/views/default/core/settings/account/default_access.php
@@ -21,11 +21,11 @@
}
$title = elgg_echo('default_access:settings');
-$content = elgg_view_field(array(
+$content = elgg_view_field([
'#type' => 'access',
'name' => 'default_access',
'value' => $default_access,
'#label' => elgg_echo('default_access:label'),
- ));
+ ]);
-echo elgg_view_module('info', $title, $content);
\ No newline at end of file
+echo elgg_view_module('info', $title, $content);
diff --git a/views/default/core/settings/account/email.php b/views/default/core/settings/account/email.php
index 5399601c6d9..02d44b0b5aa 100644
--- a/views/default/core/settings/account/email.php
+++ b/views/default/core/settings/account/email.php
@@ -17,19 +17,19 @@
$content = '';
if (elgg_get_config('security_email_require_password') && ($user->getGUID() === elgg_get_logged_in_user_guid())) {
// user needs to provide current password in order to be able to change his/her email address
- $content .= elgg_view_field(array(
+ $content .= elgg_view_field([
'#type' => 'password',
'#label' => elgg_echo('email:address:password'),
'#help' => elgg_echo('email:address:password:help'),
'name' => 'email_password',
- ));
+ ]);
}
-$content .= elgg_view_field(array(
+$content .= elgg_view_field([
'#type' => 'email',
'name' => 'email',
'value' => $user->email,
'#label' => elgg_echo('email:address:label'),
-));
+]);
echo elgg_view_module('info', $title, $content);
diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php
index 989dd7d0e58..e63b59dcaf0 100644
--- a/views/default/core/settings/account/language.php
+++ b/views/default/core/settings/account/language.php
@@ -13,12 +13,12 @@
}
$title = elgg_echo('user:set:language');
-$content = elgg_view_field(array(
+$content = elgg_view_field([
'#type' => 'select',
'name' => 'language',
'value' => $user->language,
'options_values' => get_installed_translations(),
'#label' => elgg_echo('user:language:label'),
- ));
+ ]);
-echo elgg_view_module('info', $title, $content);
\ No newline at end of file
+echo elgg_view_module('info', $title, $content);
diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php
index 0a8f807ed45..5c1c6ee8683 100644
--- a/views/default/core/settings/account/name.php
+++ b/views/default/core/settings/account/name.php
@@ -14,12 +14,12 @@
}
$title = elgg_echo('user:name:label');
-$content .= elgg_view_field(array(
+$content .= elgg_view_field([
'#type' => 'text',
'name' => 'name',
'value' => $user->name,
'#label' => elgg_echo('name'),
- ));
+ ]);
echo elgg_view_module('info', $title, $content);
diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php
index b472f4be759..0b47da8af24 100644
--- a/views/default/core/settings/account/notifications.php
+++ b/views/default/core/settings/account/notifications.php
@@ -15,21 +15,20 @@
// Loop through options
foreach ($NOTIFICATION_HANDLERS as $k => $v) {
-
if ($notification_settings->$k) {
$val = "yes";
} else {
$val = "no";
}
- $radio = elgg_view('input/radio', array(
+ $radio = elgg_view('input/radio', [
'name' => "method[$k]",
'value' => $val,
- 'options' => array(
+ 'options' => [
elgg_echo('option:yes') => 'yes',
elgg_echo('option:no') => 'no'
- ),
- ));
+ ],
+ ]);
$cells = '' . elgg_echo("notification:method:$k") . ': ';
$cells .= "$radio ";
diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php
index 06185312973..1926836e0bf 100644
--- a/views/default/core/settings/account/password.php
+++ b/views/default/core/settings/account/password.php
@@ -17,25 +17,25 @@
// only make the admin user enter current password for changing his own password.
$admin = '';
if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) {
- $admin .= elgg_view_field(array(
+ $admin .= elgg_view_field([
'#type' => 'password',
'name' => 'current_password',
'#label' => elgg_echo('user:current_password:label'),
- ));
+ ]);
}
-$password = elgg_view_field(array(
+$password = elgg_view_field([
'#type' => 'password',
'name' => 'password',
'#label' => elgg_echo('user:password:label'),
- ));
+ ]);
-$password2 = elgg_view_field(array(
+$password2 = elgg_view_field([
'#type' => 'password',
'name' => 'password2',
'#label' => elgg_echo('user:password2:label')
- ));
+ ]);
$content = $admin . $password . $password2;
-echo elgg_view_module('info', $title, $content);
\ No newline at end of file
+echo elgg_view_module('info', $title, $content);
diff --git a/views/default/elements/components/tags.css b/views/default/elements/components/tags.css
index 07ef3f8e272..6c955ddc937 100644
--- a/views/default/elements/components/tags.css
+++ b/views/default/elements/components/tags.css
@@ -2,10 +2,11 @@
Tags
*************************************** */
.elgg-tags {
- font-size: 85%;
- color: #999;
+ font-size: 85%;
+ color: #999;
}
.elgg-tags > .elgg-icon {
- margin-right: 5px;
+ margin-right: 5px;
}
+
diff --git a/views/default/elements/core.css.php b/views/default/elements/core.css.php
index 8af231cff2f..11920856688 100644
--- a/views/default/elements/core.css.php
+++ b/views/default/elements/core.css.php
@@ -1,10 +1,10 @@
li:after {content: '|'; background: ...;}
- *************************************** */
+ * MENUS
+ *
+ * To add separators to a menu:
+ * .elgg-menu-$menu > li:after {content: '|'; background: ...;}
+ *************************************** */
/* Enabled nesting of dropdown/flyout menus */
.elgg-menu > li { position: relative; }
diff --git a/views/default/elements/fa.css b/views/default/elements/fa.css
index 12b8bdd851f..1543d022527 100644
--- a/views/default/elements/fa.css
+++ b/views/default/elements/fa.css
@@ -10,4 +10,4 @@
.fa-caret-down:before,
.fa-caret-down:before {
font-size: larger !important;
-}
\ No newline at end of file
+}
diff --git a/views/default/elements/forms.css.php b/views/default/elements/forms.css.php
index 7936e698afb..66ae675587b 100644
--- a/views/default/elements/forms.css.php
+++ b/views/default/elements/forms.css.php
@@ -109,16 +109,16 @@
}
.elgg-fieldset-horizontal .elgg-field {
- display: inline-block;
- margin: 0 10px 0 0;
+ display: inline-block;
+ margin: 0 10px 0 0;
}
.elgg-fieldset-horizontal.elgg-justify-right .elgg-field {
- margin: 0 0 0 10px;
+ margin: 0 0 0 10px;
}
.elgg-fieldset-horizontal.elgg-justify-center .elgg-field {
- margin: 0 5px;
+ margin: 0 5px;
}
/* ***************************************
diff --git a/views/default/elements/grid.css.php b/views/default/elements/grid.css.php
index 1e66cb030a8..1cbb61456ba 100644
--- a/views/default/elements/grid.css.php
+++ b/views/default/elements/grid.css.php
@@ -4,7 +4,7 @@
*
* @package Elgg.Core
* @subpackage UI
- *
+ *
* To work around subpixel rounding discrepancies, apply .elgg-col-last to
* the last column
* @todo we need broswer-specific test cases for this
@@ -74,4 +74,4 @@
min-height: 0 !important;
width: 100%;
}
-}
\ No newline at end of file
+}
diff --git a/views/default/elements/misc/checkbox_switch.css b/views/default/elements/misc/checkbox_switch.css
index cd10961d59f..5aac80e8c96 100644
--- a/views/default/elements/misc/checkbox_switch.css
+++ b/views/default/elements/misc/checkbox_switch.css
@@ -39,3 +39,4 @@ input:checked ~ .elgg-input-checkbox-switch:after {
.elgg-input-single-checkbox label + .elgg-field-label {
display: inline-block;
}
+
diff --git a/views/default/elements/misc/spinner.css b/views/default/elements/misc/spinner.css
index 7047b921a3c..673a1ea27cf 100644
--- a/views/default/elements/misc/spinner.css
+++ b/views/default/elements/misc/spinner.css
@@ -3,33 +3,34 @@
*************************************** */
.elgg-spinner {
- /* general spinner styles */
- background: #fff;
- padding: 10px;
- border: 1px solid #CCC;
- border-top: 0;
- border-radius: 0 0 15px 15px;
- /* negative half the width for proper centering */
- margin-left: -25.5px;
+ /* general spinner styles */
+ background: #fff;
+ padding: 10px;
+ border: 1px solid #CCC;
+ border-top: 0;
+ border-radius: 0 0 15px 15px;
+ /* negative half the width for proper centering */
+ margin-left: -25.5px;
- position: fixed;
- top: 0;
- z-index: 10000;
+ position: fixed;
+ top: 0;
+ z-index: 10000;
- /* transitioned values */
- left: -10000px;
- opacity: 0;
+ /* transitioned values */
+ left: -10000px;
+ opacity: 0;
- /* fade out over 300ms, then jump offscreen */
- -webkit-transition: opacity 300ms ease-in-out, left 0s linear 300ms;
- transition: opacity 300ms ease-in-out, left 0s linear 300ms;
+ /* fade out over 300ms, then jump offscreen */
+ -webkit-transition: opacity 300ms ease-in-out, left 0s linear 300ms;
+ transition: opacity 300ms ease-in-out, left 0s linear 300ms;
}
.elgg-spinner-active .elgg-spinner {
- left: 50%;
- opacity: 1;
+ left: 50%;
+ opacity: 1;
- /* set values immediately */
- -webkit-transition: opacity 0s, left 0s;
- transition: opacity 0s, left 0s;
+ /* set values immediately */
+ -webkit-transition: opacity 0s, left 0s;
+ transition: opacity 0s, left 0s;
}
+
diff --git a/views/default/elements/patches.css.php b/views/default/elements/patches.css.php
index 2e5dcf1eb2f..3c1efabec68 100644
--- a/views/default/elements/patches.css.php
+++ b/views/default/elements/patches.css.php
@@ -21,16 +21,16 @@
}
.elgg-fieldset-horizontal .elgg-field {
- display: inline-block;
- margin: 0 10px 0 0;
+ display: inline-block;
+ margin: 0 10px 0 0;
}
.elgg-fieldset-horizontal.elgg-justify-right .elgg-field {
- margin: 0 0 0 10px;
+ margin: 0 0 0 10px;
}
.elgg-fieldset-horizontal.elgg-justify-center .elgg-field {
- margin: 0 5px;
+ margin: 0 5px;
}
.elgg-justify-center {
diff --git a/views/default/elements/reset.css.php b/views/default/elements/reset.css.php
index 3fec38286e7..0fafe6ce352 100644
--- a/views/default/elements/reset.css.php
+++ b/views/default/elements/reset.css.php
@@ -90,4 +90,4 @@
}
[hidden] {
display: none !important;
-}
\ No newline at end of file
+}
diff --git a/views/default/elements/widgets.css b/views/default/elements/widgets.css
index 35804ca5cb6..6162d91d0ef 100644
--- a/views/default/elements/widgets.css
+++ b/views/default/elements/widgets.css
@@ -94,4 +94,4 @@ a.elgg-widget-collapsed:before {
.elgg-module-widget {
margin: 0 0 15px;
}
-}
\ No newline at end of file
+}
diff --git a/views/default/elgg.js.php b/views/default/elgg.js.php
index 0477f4edcd7..2db7d729495 100644
--- a/views/default/elgg.js.php
+++ b/views/default/elgg.js.php
@@ -15,7 +15,7 @@
echo elgg_view('elgg/popup.js');
$elggDir = \Elgg\Application::elggDir();
-$files = array(
+$files = [
// these must come first
$elggDir->getPath("js/lib/elgglib.js"),
@@ -37,7 +37,7 @@
//ui
$elggDir->getPath("js/lib/ui.js"),
-);
+];
foreach ($files as $file) {
diff --git a/views/default/elgg/Ajax.js b/views/default/elgg/Ajax.js
index 07a5897159e..78989b6599c 100644
--- a/views/default/elgg/Ajax.js
+++ b/views/default/elgg/Ajax.js
@@ -390,3 +390,4 @@ define(function (require) {
return Ajax;
});
+
diff --git a/views/default/elgg/Plugin.js b/views/default/elgg/Plugin.js
index a656e954cef..1c0f7276434 100644
--- a/views/default/elgg/Plugin.js
+++ b/views/default/elgg/Plugin.js
@@ -31,3 +31,4 @@ define(function (require) {
return Plugin;
});
+
diff --git a/views/default/elgg/UserPicker.js b/views/default/elgg/UserPicker.js
index c6d6efd5a74..affbaa5ddfe 100644
--- a/views/default/elgg/UserPicker.js
+++ b/views/default/elgg/UserPicker.js
@@ -28,7 +28,7 @@ define(function(require) {
this.isSealed = false;
this.$input.autocomplete({
- source: function(request, response) {
+ source: function(request, response) {
// note: "this" below will not be bound to the input, but rather
// to an object created by the autocomplete component
var Autocomplete = this;
@@ -166,4 +166,4 @@ define(function(require) {
};
return UserPicker;
-});
\ No newline at end of file
+});
diff --git a/views/default/elgg/admin.js b/views/default/elgg/admin.js
index 8371b85957b..0e1efa004c2 100644
--- a/views/default/elgg/admin.js
+++ b/views/default/elgg/admin.js
@@ -335,4 +335,4 @@ define(function(require) {
}
init();
-});
\ No newline at end of file
+});
diff --git a/views/default/elgg/autocomplete.js b/views/default/elgg/autocomplete.js
index c8e1160cab1..9bf985c7528 100644
--- a/views/default/elgg/autocomplete.js
+++ b/views/default/elgg/autocomplete.js
@@ -26,3 +26,4 @@ define(function (require) {
}
};
});
+
diff --git a/views/default/elgg/lightbox.js b/views/default/elgg/lightbox.js
index 8ca9db027fe..1238f18d283 100644
--- a/views/default/elgg/lightbox.js
+++ b/views/default/elgg/lightbox.js
@@ -130,7 +130,7 @@ define(function (require) {
.on('resize.lightbox', function() {
elgg.data.lightbox.reposition = $(window).height() > 600;
lightbox.resize();
- });
+ });
},
/**
@@ -162,4 +162,4 @@ define(function (require) {
lightbox.bind(".elgg-lightbox-iframe", {iframe: true});
return lightbox;
-});
\ No newline at end of file
+});
diff --git a/views/default/elgg/menus/dropdown.js b/views/default/elgg/menus/dropdown.js
index 09a01c3df0a..8699b43b602 100644
--- a/views/default/elgg/menus/dropdown.js
+++ b/views/default/elgg/menus/dropdown.js
@@ -56,4 +56,4 @@ define(function (require) {
dropdown.init();
return dropdown;
-});
\ No newline at end of file
+});
diff --git a/views/default/elgg/menus/toggle.js b/views/default/elgg/menus/toggle.js
index 3adbc50f442..6d6506bad2b 100644
--- a/views/default/elgg/menus/toggle.js
+++ b/views/default/elgg/menus/toggle.js
@@ -40,3 +40,4 @@ define(function (require) {
return toggle;
});
+
diff --git a/views/default/elgg/popup.js b/views/default/elgg/popup.js
index db5544327e0..54dbde87a67 100644
--- a/views/default/elgg/popup.js
+++ b/views/default/elgg/popup.js
@@ -170,4 +170,4 @@ define('elgg/popup', ['elgg', 'jquery', 'jquery-ui'], function (elgg, $) {
};
return popup;
-});
\ No newline at end of file
+});
diff --git a/views/default/elgg/ready.js b/views/default/elgg/ready.js
index 8536e4ba22f..123f714ce77 100644
--- a/views/default/elgg/ready.js
+++ b/views/default/elgg/ready.js
@@ -10,3 +10,4 @@ define(function(require) {
elgg.trigger_hook('ready', 'system');
});
+
diff --git a/views/default/elgg/spinner.js b/views/default/elgg/spinner.js
index 1363f46d8b4..77b8248ceed 100644
--- a/views/default/elgg/spinner.js
+++ b/views/default/elgg/spinner.js
@@ -58,3 +58,4 @@ define(function (require) {
return spinner;
});
+
diff --git a/views/default/elgg/upgrades.js b/views/default/elgg/upgrades.js
index 13db44b2c84..9c346555548 100644
--- a/views/default/elgg/upgrades.js
+++ b/views/default/elgg/upgrades.js
@@ -119,3 +119,4 @@ define(function(require) {
$('#upgrade-run').click(run);
});
+
diff --git a/views/default/elgg/widgets.js b/views/default/elgg/widgets.js
index 545b2b83cd0..f913da89004 100644
--- a/views/default/elgg/widgets.js
+++ b/views/default/elgg/widgets.js
@@ -160,3 +160,4 @@ define(['elgg', 'jquery', 'elgg/ready'], function (elgg, $) {
return widgets;
});
+
diff --git a/views/default/errors/403.php b/views/default/errors/403.php
index 5885ba86ec2..500a01aaea4 100644
--- a/views/default/errors/403.php
+++ b/views/default/errors/403.php
@@ -8,4 +8,4 @@
-
\ No newline at end of file
+
diff --git a/views/default/errors/default.php b/views/default/errors/default.php
index ae172021ac3..4a898c36377 100644
--- a/views/default/errors/default.php
+++ b/views/default/errors/default.php
@@ -9,4 +9,4 @@
-
\ No newline at end of file
+
diff --git a/views/default/export/entity.php b/views/default/export/entity.php
index 4a91ee56ee7..d8f72d1a882 100644
--- a/views/default/export/entity.php
+++ b/views/default/export/entity.php
@@ -12,10 +12,10 @@
if (!$entity) {
throw new InvalidParameterException("No entity found, it either doesn't exist or you don't have access to it.");
}
-$options = array(
+$options = [
'guid' => $entity->guid,
'limit' => 0
-);
+];
$metadata = elgg_get_metadata($options);
$annotations = elgg_get_annotations($options);
$relationships = get_entity_relationships($entity->guid);
@@ -26,13 +26,13 @@
$v) {
- if ((in_array($k, $exportable_values)) || (elgg_is_admin_logged_in())) {
+ foreach ($entity as $k => $v) {
+ if ((in_array($k, $exportable_values)) || (elgg_is_admin_logged_in())) {
?>
- :
+ :
@@ -40,11 +40,11 @@
@@ -54,13 +54,13 @@
@@ -69,13 +69,13 @@
-
- relationship; ?>: guid_two; ?>
-
+
+ relationship; ?>: guid_two; ?>
+
-entity_guid);
?>
-getURL() . "\">GUID:{$m->entity_guid}"; else echo "GUID:".$m->entity_guid;
-?>: name; ?> value; ?>
\ No newline at end of file
+getURL() . "\">GUID:{$m->entity_guid}";
+else echo "GUID:".$m->entity_guid;
+?>: name; ?> value; ?>
diff --git a/views/default/export/relationship.php b/views/default/export/relationship.php
index 094339a5464..9439f1feadb 100644
--- a/views/default/export/relationship.php
+++ b/views/default/export/relationship.php
@@ -14,9 +14,11 @@
$e2 = get_entity($r->guid_two);
?>
getURL() . "\">GUID:" . $r->guid_one . ""; else echo "GUID:".$r->guid_one;
+ if ($e1) echo "getURL() . "\">GUID:" . $r->guid_one . " ";
+else echo "GUID:".$r->guid_one;
?>
relationship; ?>
getURL() . "\">GUID:" . $r->guid_two . ""; else echo "GUID:".$r->guid_two;
+ if ($e2) echo "getURL() . "\">GUID:" . $r->guid_two . " ";
+else echo "GUID:".$r->guid_two;
?>
diff --git a/views/default/forms/admin/security/settings.php b/views/default/forms/admin/security/settings.php
index 9f28fab8fc0..7622fa2f26d 100644
--- a/views/default/forms/admin/security/settings.php
+++ b/views/default/forms/admin/security/settings.php
@@ -36,7 +36,6 @@
'checked' => $protect_cron,
]);
if ($protect_cron) {
-
$periods = elgg_get_config('elgg_cron_periods');
$rows = [];
diff --git a/views/default/forms/admin/site/advanced/caching.php b/views/default/forms/admin/site/advanced/caching.php
index ee2b245e0db..fc206b07136 100644
--- a/views/default/forms/admin/site/advanced/caching.php
+++ b/views/default/forms/admin/site/advanced/caching.php
@@ -4,15 +4,15 @@
*/
// simple cache
-$is_simple_cache_on = (bool)elgg_get_config('simplecache_enabled');
+$is_simple_cache_on = (bool) elgg_get_config('simplecache_enabled');
$simple_cache_disabled_class = $is_simple_cache_on ? '' : 'elgg-state-disabled';
-$params = array(
+$params = [
'label' => elgg_echo('installation:simplecache:label'),
'name' => 'simplecache_enabled',
'checked' => $is_simple_cache_on,
'switch' => true,
-);
+];
$simple_cache_warning = '' . elgg_echo('installation:simplecache:description') . '
';
if ($GLOBALS['_ELGG']->simplecache_enabled_in_settings) {
@@ -24,14 +24,14 @@
$simple_cache_input = elgg_view("input/checkbox", $params);
$cache_symlinked = _elgg_is_cache_symlinked();
-$params = array(
+$params = [
'label' => elgg_echo('installation:cache_symlink:label'),
'name' => 'cache_symlink_enabled',
'checked' => $cache_symlinked,
'class' => $simple_cache_disabled_class,
'label_class' => $simple_cache_disabled_class,
'switch' => true,
-);
+];
$symlink_warning = '' . elgg_echo('installation:cache_symlink:description') . '
';
if ($cache_symlinked) {
$params['class'] = 'elgg-state-disabled';
@@ -48,21 +48,21 @@
// minify
$minify_description = elgg_echo('installation:minify:description');
-$minify_js_input = elgg_view("input/checkbox", array(
+$minify_js_input = elgg_view("input/checkbox", [
'label' => elgg_echo('installation:minify_js:label'),
'name' => 'simplecache_minify_js',
- 'checked' => (bool)elgg_get_config('simplecache_minify_js'),
+ 'checked' => (bool) elgg_get_config('simplecache_minify_js'),
'label_class' => $simple_cache_disabled_class,
'switch' => true,
-));
+]);
-$minify_css_input = elgg_view("input/checkbox", array(
+$minify_css_input = elgg_view("input/checkbox", [
'label' => elgg_echo('installation:minify_css:label'),
'name' => 'simplecache_minify_css',
- 'checked' => (bool)elgg_get_config('simplecache_minify_css'),
+ 'checked' => (bool) elgg_get_config('simplecache_minify_css'),
'label_class' => $simple_cache_disabled_class,
'switch' => true,
-));
+]);
$system_cache_input = elgg_view_field([
'#type' => 'checkbox',
diff --git a/views/default/forms/admin/site/advanced/content_access.php b/views/default/forms/admin/site/advanced/content_access.php
index e7be7c5bdab..82dd0379fbd 100644
--- a/views/default/forms/admin/site/advanced/content_access.php
+++ b/views/default/forms/admin/site/advanced/content_access.php
@@ -28,7 +28,7 @@
'label' => elgg_echo('installation:allow_user_default_access:label'),
'#help' => elgg_echo('installation:allow_user_default_access:description'),
'name' => 'allow_user_default_access',
- 'checked' => (bool)elgg_get_config('allow_user_default_access'),
+ 'checked' => (bool) elgg_get_config('allow_user_default_access'),
'switch' => true,
]);
diff --git a/views/default/forms/admin/site/advanced/site_access.php b/views/default/forms/admin/site/advanced/site_access.php
index 1f9e493b8bd..c01e219d646 100644
--- a/views/default/forms/admin/site/advanced/site_access.php
+++ b/views/default/forms/admin/site/advanced/site_access.php
@@ -9,7 +9,7 @@
'label' => elgg_echo('installation:registration:label'),
'#help' => elgg_echo('installation:registration:description'),
'name' => 'allow_registration',
- 'checked' => (bool)elgg_get_config('allow_registration'),
+ 'checked' => (bool) elgg_get_config('allow_registration'),
'switch' => true,
]);
@@ -19,7 +19,7 @@
'label' => elgg_echo('installation:walled_garden:label'),
'#help' => elgg_echo('installation:walled_garden:description'),
'name' => 'walled_garden',
- 'checked' => (bool)elgg_get_config('walled_garden'),
+ 'checked' => (bool) elgg_get_config('walled_garden'),
'switch' => true,
]);
diff --git a/views/default/forms/admin/site/set_maintenance_mode.php b/views/default/forms/admin/site/set_maintenance_mode.php
index b0d994b3297..97c8ed4621a 100644
--- a/views/default/forms/admin/site/set_maintenance_mode.php
+++ b/views/default/forms/admin/site/set_maintenance_mode.php
@@ -4,7 +4,7 @@
*/
$site = elgg_get_site_entity();
-$mode = (int)elgg_get_config('elgg_maintenance_mode', null);
+$mode = (int) elgg_get_config('elgg_maintenance_mode', null);
$message = $site->getPrivateSetting('elgg_maintenance_message');
if (!$message) {
@@ -19,10 +19,10 @@
'#type' => 'select',
'#label' => elgg_echo('admin:maintenance_mode:mode_label'),
'name' => 'mode',
- 'options_values' => array(
+ 'options_values' => [
'1' => elgg_echo('on'),
'0' => elgg_echo('off'),
- ),
+ ],
'value' => $mode,
]);
diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php
index 3e798cb2782..72e524ee2b2 100644
--- a/views/default/forms/avatar/crop.php
+++ b/views/default/forms/avatar/crop.php
@@ -9,17 +9,17 @@
elgg_load_js('elgg.avatar_cropper');
elgg_load_css('jquery.imgareaselect');
-$master_img = elgg_view('output/img', array(
+$master_img = elgg_view('output/img', [
'src' => $vars['entity']->getIconUrl('master'),
'alt' => elgg_echo('avatar'),
'class' => 'mrl',
'id' => 'user-avatar-cropper',
-));
+]);
-$preview_img = elgg_view('output/img', array(
+$preview_img = elgg_view('output/img', [
'src' => $vars['entity']->getIconUrl('master'),
'alt' => elgg_echo('avatar'),
-));
+]);
?>
@@ -29,14 +29,14 @@
diff --git a/views/default/forms/avatar/upload.php b/views/default/forms/avatar/upload.php
index d91e8575eb0..c3490cdcb56 100644
--- a/views/default/forms/avatar/upload.php
+++ b/views/default/forms/avatar/upload.php
@@ -1,16 +1,16 @@
- 'avatar')); ?>
+ 'avatar']); ?>
diff --git a/views/default/forms/comment/save.js b/views/default/forms/comment/save.js
index 046bb679742..b451698d26b 100644
--- a/views/default/forms/comment/save.js
+++ b/views/default/forms/comment/save.js
@@ -16,4 +16,4 @@ define(function (require) {
}
}
});
-});
\ No newline at end of file
+});
diff --git a/views/default/forms/comment/save.php b/views/default/forms/comment/save.php
index d92e0dc9b88..814028d8476 100644
--- a/views/default/forms/comment/save.php
+++ b/views/default/forms/comment/save.php
@@ -23,52 +23,51 @@
$entity_guid_input = '';
if ($entity) {
- $entity_guid_input = elgg_view('input/hidden', array(
+ $entity_guid_input = elgg_view('input/hidden', [
'name' => 'entity_guid',
'value' => $entity->guid,
- ));
+ ]);
}
$comment_text = '';
$comment_guid_input = '';
if ($comment && $comment->canEdit()) {
- $entity_guid_input = elgg_view('input/hidden', array(
+ $entity_guid_input = elgg_view('input/hidden', [
'name' => 'comment_guid',
'value' => $comment->guid,
- ));
+ ]);
$comment_label = elgg_echo("generic_comments:edit");
- $submit_input = elgg_view('input/submit', array('value' => elgg_echo('save')));
+ $submit_input = elgg_view('input/submit', ['value' => elgg_echo('save')]);
$comment_text = $comment->description;
} else {
$comment_label = elgg_echo("generic_comments:add");
- $submit_input = elgg_view('input/submit', array('value' => elgg_echo('comment')));
+ $submit_input = elgg_view('input/submit', ['value' => elgg_echo('comment')]);
}
$cancel_button = '';
if ($comment) {
- $cancel_button = elgg_view('input/button', array(
+ $cancel_button = elgg_view('input/button', [
'value' => elgg_echo('cancel'),
'class' => 'elgg-button-cancel mlm',
'href' => $entity ? $entity->getURL() : '#',
- ));
+ ]);
}
if ($inline) {
- $comment_input = elgg_view('input/text', array(
+ $comment_input = elgg_view('input/text', [
'name' => 'generic_comment',
'value' => $comment_text,
'required' => true
- ));
+ ]);
echo $comment_input . $entity_guid_input . $comment_guid_input . $submit_input;
} else {
-
- $comment_input = elgg_view('input/longtext', array(
+ $comment_input = elgg_view('input/longtext', [
'name' => 'generic_comment',
'value' => $comment_text,
'required' => true,
'editor_type' => 'simple',
- ));
+ ]);
echo <<
\ No newline at end of file
+
diff --git a/views/installation/forms/install/template.php b/views/installation/forms/install/template.php
index 6f23fb3d808..a8b82dc1820 100644
--- a/views/installation/forms/install/template.php
+++ b/views/installation/forms/install/template.php
@@ -27,8 +27,8 @@
$form_body .= $field;
}
-$form_body .= elgg_view('input/submit', array(
+$form_body .= elgg_view('input/submit', [
'value' => elgg_echo('install:next'),
-));
+]);
echo $form_body;
diff --git a/views/installation/input/access.php b/views/installation/input/access.php
index c3d4713bc55..9d1b7c1827e 100644
--- a/views/installation/input/access.php
+++ b/views/installation/input/access.php
@@ -11,28 +11,26 @@
$class = "elgg-input-access";
if ((!isset($vars['options'])) || (!is_array($vars['options']))) {
- $vars['options'] = array();
+ $vars['options'] = [];
$vars['options'] = get_write_access_array();
}
if (is_array($vars['options']) && sizeof($vars['options']) > 0) {
-
?>
$option) {
- if ($key != $vars['value']) {
- echo "{$option} ";
- } else {
- echo "{$option} ";
- }
+ foreach ($vars['options'] as $key => $option) {
+ if ($key != $vars['value']) {
+ echo "{$option} ";
+ } else {
+ echo "{$option} ";
}
+ }
?>
-
\ No newline at end of file
+
diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php
index 6fbe2516900..758ff3aae85 100644
--- a/views/installation/input/checkbox.php
+++ b/views/installation/input/checkbox.php
@@ -21,4 +21,4 @@
?>
- name="" value="" />
\ No newline at end of file
+ name="" value="" />
diff --git a/views/installation/input/combo.php b/views/installation/input/combo.php
index 508dbcd0151..28baffad37d 100644
--- a/views/installation/input/combo.php
+++ b/views/installation/input/combo.php
@@ -16,4 +16,4 @@
echo "$label ";
-echo '
';
\ No newline at end of file
+echo '
';
diff --git a/views/installation/input/form.php b/views/installation/input/form.php
index 3556413a897..33734f2e501 100644
--- a/views/installation/input/form.php
+++ b/views/installation/input/form.php
@@ -27,4 +27,4 @@
?>
\ No newline at end of file
+
diff --git a/views/installation/input/submit.php b/views/installation/input/submit.php
index 5d891c3806d..24762218e48 100644
--- a/views/installation/input/submit.php
+++ b/views/installation/input/submit.php
@@ -8,4 +8,4 @@
$vars['type'] = 'submit';
-echo elgg_view('input/button', $vars);
\ No newline at end of file
+echo elgg_view('input/button', $vars);
diff --git a/views/installation/install/js_rewrite_check.php b/views/installation/install/js_rewrite_check.php
index 611a00c8a46..8ad19fcc709 100644
--- a/views/installation/install/js_rewrite_check.php
+++ b/views/installation/install/js_rewrite_check.php
@@ -5,12 +5,12 @@
* @uses $vars['url'] URL to test via Ajax (note: not relying on legacy site URL injection)
*/
-$args = array(
+$args = [
json_encode($vars['url']),
json_encode(elgg_echo('install:check:rewrite:success')),
json_encode(elgg_get_site_url() . 'install.php?step=database')
-);
+];
?>
\ No newline at end of file
+
diff --git a/views/installation/install/pages/admin.php b/views/installation/install/pages/admin.php
index e810aa70109..d4473e2f21e 100644
--- a/views/installation/install/pages/admin.php
+++ b/views/installation/install/pages/admin.php
@@ -9,9 +9,9 @@
$url = current_page_url();
-$form_vars = array(
+$form_vars = [
'action' => $url,
- 'disable_security' => TRUE,
-);
+ 'disable_security' => true,
+];
echo elgg_view_form('install/template', $form_vars, $vars);
diff --git a/views/installation/install/pages/database.php b/views/installation/install/pages/database.php
index d24b4f57bbc..0a0df0b875c 100644
--- a/views/installation/install/pages/database.php
+++ b/views/installation/install/pages/database.php
@@ -7,8 +7,8 @@
if (isset($vars['failure']) && $vars['failure']) {
echo elgg_autop(elgg_echo('install:database:error'));
- $vars['refresh'] = TRUE;
- $vars['advance'] = FALSE;
+ $vars['refresh'] = true;
+ $vars['advance'] = false;
echo elgg_view('install/nav', $vars);
} else {
echo elgg_autop(elgg_echo('install:database:instructions'));
@@ -17,10 +17,10 @@
$url = current_page_url();
- $form_vars = array(
+ $form_vars = [
'action' => $url,
- 'disable_security' => TRUE,
- );
+ 'disable_security' => true,
+ ];
echo elgg_view_form('install/template', $form_vars, $vars);
-}
\ No newline at end of file
+}
diff --git a/views/installation/install/pages/settings.php b/views/installation/install/pages/settings.php
index 04f23c0ea6c..f33a6c6ee84 100644
--- a/views/installation/install/pages/settings.php
+++ b/views/installation/install/pages/settings.php
@@ -6,9 +6,9 @@
$url = current_page_url();
-$form_vars = array(
+$form_vars = [
'action' => $url,
- 'disable_security' => TRUE,
-);
+ 'disable_security' => true,
+];
echo elgg_view_form('install/template', $form_vars, $vars);
diff --git a/views/installation/page/default.php b/views/installation/page/default.php
index bbca12b1c5b..a7a7abed2b4 100644
--- a/views/installation/page/default.php
+++ b/views/installation/page/default.php
@@ -15,9 +15,9 @@
elgg_set_http_header('Content-type: text/html; charset=utf-8');
// turn off browser caching
-elgg_set_http_header('Pragma: public', TRUE);
-elgg_set_http_header("Cache-Control: no-cache, must-revalidate", TRUE);
-elgg_set_http_header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE);
+elgg_set_http_header('Pragma: public', true);
+elgg_set_http_header("Cache-Control: no-cache, must-revalidate", true);
+elgg_set_http_header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', true);
$isElggAtRoot = Elgg\Application::elggDir()->getPath() === Directory\Local::root()->getPath();
$elggSubdir = $isElggAtRoot ? '' : 'vendor/elgg/elgg/';
@@ -46,7 +46,7 @@
- $vars['sysmessages'])); ?>
+ $vars['sysmessages']]); ?>
diff --git a/views/installation/page/elements/messages.php b/views/installation/page/elements/messages.php
index 46261dca404..86a22bb3d5f 100644
--- a/views/installation/page/elements/messages.php
+++ b/views/installation/page/elements/messages.php
@@ -6,10 +6,9 @@
*/
if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) {
-
echo '';
- foreach ($vars['object'] as $type => $list ) {
+ foreach ($vars['object'] as $type => $list) {
foreach ($list as $message) {
echo "";
echo elgg_autop($message);
diff --git a/views/json/export/metadata.php b/views/json/export/metadata.php
index 0f343151a86..5d3a77c1751 100644
--- a/views/json/export/metadata.php
+++ b/views/json/export/metadata.php
@@ -19,4 +19,4 @@
global $jsonexport;
$jsonexport['metadata'][] = $entity;
-// echo json_encode($export);
\ No newline at end of file
+// echo json_encode($export);
diff --git a/views/json/export/relationship.php b/views/json/export/relationship.php
index 7adcadf6368..f67f025ca78 100644
--- a/views/json/export/relationship.php
+++ b/views/json/export/relationship.php
@@ -19,4 +19,4 @@
}
global $jsonexport;
-$jsonexport['relationships'][] = $export;
\ No newline at end of file
+$jsonexport['relationships'][] = $export;
diff --git a/views/json/page/layouts/default.php b/views/json/page/layouts/default.php
index 695f165f48b..7a87ee93a8d 100644
--- a/views/json/page/layouts/default.php
+++ b/views/json/page/layouts/default.php
@@ -1,7 +1,7 @@
toObject();
if (elgg_view_exists($item->view, 'default')) {
- $object->description = elgg_view('river/elements/summary', array('item' => $item), FALSE, FALSE, 'default');
+ $object->description = elgg_view('river/elements/summary', ['item' => $item], false, false, 'default');
}
echo json_encode($object);
diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php
index de652fc8ec5..64137499cdf 100644
--- a/views/rss/annotation/generic_comment.php
+++ b/views/rss/annotation/generic_comment.php
@@ -13,9 +13,9 @@
$pubdate = date('r', $annotation->getTimeCreated());
$permalink = $annotation->getURL();
-$title = elgg_echo('generic_comment:title', array($poster_name));
+$title = elgg_echo('generic_comment:title', [$poster_name]);
-$creator = elgg_view('page/components/creator', array('entity' => $annotation));
+$creator = elgg_view('page/components/creator', ['entity' => $annotation]);
$extensions = elgg_view('extensions/item', $vars);
$item = <<<__HTML
diff --git a/views/rss/output/url.php b/views/rss/output/url.php
index b0f4d9792ba..d0efa4b8c10 100644
--- a/views/rss/output/url.php
+++ b/views/rss/output/url.php
@@ -1,6 +1,6 @@
$vars['entity']->getGUID(),
'annotation_name' => 'generic_comment',
'order_by' => 'n_table.time_created desc',
-);
+];
echo elgg_list_annotations($options);
diff --git a/views/rss/page/layouts/default.php b/views/rss/page/layouts/default.php
index 7f3ddebbdd7..7f68478668a 100644
--- a/views/rss/page/layouts/default.php
+++ b/views/rss/page/layouts/default.php
@@ -2,4 +2,4 @@
/**
* RSS layout shell
*/
-echo $vars['content'];
\ No newline at end of file
+echo $vars['content'];
diff --git a/views/rss/river/elements/layout.php b/views/rss/river/elements/layout.php
index ac6677435a5..589a751b2ae 100644
--- a/views/rss/river/elements/layout.php
+++ b/views/rss/river/elements/layout.php
@@ -8,7 +8,7 @@
$name = $item->getSubjectEntity()->name;
$name = htmlspecialchars($name, ENT_NOQUOTES, 'UTF-8');
-$title = elgg_echo('river:update', array($name));
+$title = elgg_echo('river:update', [$name]);
$timestamp = date('r', $item->getTimePosted());
$summary = elgg_view('river/elements/summary', $vars, false, false, 'default');