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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user