How are phrases for permissions fetched?

Luxus

Well-known member
Some Permission phrases like permission_general_view aren't in admin templates although they are clearly there in the html output. And they can't be found in any core files either. The html for them is this:
Code:
<tr class="permission">
	<th>{$permission.title}:</th>
$permission.title is a variable for phrases. I have searched the core files for $permission.title. No results besides a few in the admin_templates.xml file of the install directory. So this begs the question how those phrases are fetched, or more specifically, how does $permission.title work?
 
You would really want to look for $permission['title'] or the specific Controller actions for those templates you found to see how $permission is populated.
 
Phrase titles for adminnavigation, cronjobs, options, user permissions, style properties, thread prefixes, trophies, userfields and warnings are generated by the model

e.g. for the admin permission, you'll want to check the XenForo_Model_Permission

PHP:
ppublic function prepareAdminPermission(array $permission)
{
$permission['title'] = new XenForo_Phrase($this->getAdminPermissionTitlePhraseName(
$permission['admin_permission_id']
));
 
return $permission;
}
 
Top Bottom