aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-09-01 12:02:24 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-09-01 12:02:24 +0000
commit43557ce95d766e6d1a4ab19c9767b9532c403e0a (patch)
treeb2c818a9239d251f2be2f8fbe88dcf6de4ca46f7 /engine
parentc5cc2821311012a8a4385a304a043c4b41f2afbb (diff)
downloadelgg-43557ce95d766e6d1a4ab19c9767b9532c403e0a.tar.gz
elgg-43557ce95d766e6d1a4ab19c9767b9532c403e0a.tar.bz2
a simple function which returns a string version of an entity's access level
git-svn-id: https://code.elgg.org/elgg/trunk@3452 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/access.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 392c89a2f..32b476a39 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -647,6 +647,27 @@ END;
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);
}
+ /**
+ * Return a humanreadable version of an entity's access level
+ *
+ * @param $entity_accessid (int) The entity's access id
+ * @return string e.g. Public, Private etc
+ **/
+
+ function get_readable_access_level($entity_accessid){
+ $access = (int) $entity_accessid;
+ //get the access level for object in readable string
+ $options = get_write_access_array();
+ foreach($options as $key => $option) {
+ if($key == $access){
+ $entity_acl = htmlentities($option, ENT_QUOTES, 'UTF-8');
+ return $entity_acl;
+ break;
+ }
+ }
+ return false;
+ }
+
global $init_finished;
$init_finished = false;