aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 7a3e47e7d..f890b3518 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -3419,6 +3419,7 @@ function elgg_walled_garden() {
*
* @param string $view_type
* @return bool
+ * @since 1.7
*/
function elgg_is_valid_view_type($view_type) {
global $CONFIG;
@@ -3427,6 +3428,21 @@ function elgg_is_valid_view_type($view_type) {
}
/**
+ * Checks for $array[$key] and returns its value if it exists, else
+ * returns $default.
+ *
+ * Shorthand for $value = (isset($array['key'])) ? $array['key'] : 'default';
+ *
+ * @param string $key The key to check.
+ * @param array $array The array to check against.
+ * @param mixed $default Default value to return if nothing is found.
+ * @since 1.8
+ */
+function elgg_get_array_value($key, array $array, $default = NULL) {
+ return (isset($array[$key])) ? $array[$key] : $default;
+}
+
+/**
* Some useful constant definitions
*/
define('ACCESS_DEFAULT', -1);