diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-09-01 12:02:24 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-09-01 12:02:24 +0000 |
commit | 43557ce95d766e6d1a4ab19c9767b9532c403e0a (patch) | |
tree | b2c818a9239d251f2be2f8fbe88dcf6de4ca46f7 /engine/lib/access.php | |
parent | c5cc2821311012a8a4385a304a043c4b41f2afbb (diff) | |
download | elgg-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/lib/access.php')
-rw-r--r-- | engine/lib/access.php | 21 |
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; |