1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 01:06:48 +02:00

[ticket/11582] Add methods to return the language string

PHPBB3-11582
This commit is contained in:
Joas Schilling
2013-06-28 11:40:00 +02:00
parent 7f9a1c8116
commit ce0a182c7f
4 changed files with 35 additions and 10 deletions

View File

@@ -83,6 +83,16 @@ class phpbb_permissions
return $this->categories;
}
/**
* 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.)
*
@@ -93,6 +103,25 @@ class phpbb_permissions
return $this->types;
}
/**
* 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: