diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-06-28 11:40:00 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-14 11:51:34 -0400 |
| commit | ce0a182c7fcd0c67020a44109440cd807bee2e82 (patch) | |
| tree | 982da49e530893758274385edd921a44ee3e7dc0 /phpBB/includes/permissions.php | |
| parent | 7f9a1c811647c00b20cfa4f5029f6b569597cb4b (diff) | |
| download | forums-ce0a182c7fcd0c67020a44109440cd807bee2e82.tar forums-ce0a182c7fcd0c67020a44109440cd807bee2e82.tar.gz forums-ce0a182c7fcd0c67020a44109440cd807bee2e82.tar.bz2 forums-ce0a182c7fcd0c67020a44109440cd807bee2e82.tar.xz forums-ce0a182c7fcd0c67020a44109440cd807bee2e82.zip | |
[ticket/11582] Add methods to return the language string
PHPBB3-11582
Diffstat (limited to 'phpBB/includes/permissions.php')
| -rw-r--r-- | phpBB/includes/permissions.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/phpBB/includes/permissions.php b/phpBB/includes/permissions.php index ddeadc825b..f3b2ab5da0 100644 --- a/phpBB/includes/permissions.php +++ b/phpBB/includes/permissions.php @@ -84,6 +84,16 @@ class phpbb_permissions } /** + * Returns the language string of a permission category + * + * @return array Language string + */ + public function get_lang_category($category) + { + return $this->user->lang($this->categories[$category]); + } + + /** * Returns an array with all the permission types (a_, u_, m_, etc.) * * @return array Layout: type-identifier => Language key @@ -94,6 +104,25 @@ class phpbb_permissions } /** + * Returns the language string of a permission type + * + * @return array Language string + */ + public function get_lang_type($type, $scope = false) + { + if ($scope && isset($this->types[$scope][$type])) + { + $lang_key = $this->types[$scope][$type]; + } + else + { + $lang_key = $this->types[$type]; + } + + return $this->user->lang($lang_key); + } + + /** * Returns an array with all the permissions. * Each Permission has the following layout: * 'acl_<type><permission>' => array( |
