I am returning to phpBB after quite a while and I'm a little rusty!
How do I add a new permission type? And have it show in the ACP? I think I am adding it correctly but it doesn't show in the ACP.
lang file: (mods/permissions_cms.php)
Code: Select all
<?php
/**
* acp_permissions_phpbb (phpBB Permission Set) [English]
*
* @package language
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
/**
* MODDERS PLEASE NOTE
*
* You are able to put your permission sets into a separate file too by
* prefixing the new file with permissions_ and putting it into the acp
* language folder.
*
* An example of how the file could look like:
*
* <code>
*
* if (empty($lang) || !is_array($lang))
* {
* $lang = array();
* }
*
* // Adding new category
* $lang['permission_cat']['bugs'] = 'Bugs';
*
* // Adding new permission set
* $lang['permission_type']['bug_'] = 'Bug Permissions';
*
* // Adding the permissions
* $lang = array_merge($lang, array(
* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'),
* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here
* ));
*
* </code>
*/
$lang['permission_cat']['pages'] = 'Pages';
// Adding new permission set
$lang['permission_type']['cms_'] = 'CMS Permissions';
// Adding the permissions
$lang = array_merge($lang, array(
'acl_cms_view' => array('lang' => 'Can view CMS pages', 'cat' => 'pages'),
'acl_cms_edit' => array('lang' => 'Can edit CMS pages', 'cat' => 'pages'),
));
?>
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();
include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
$auth_admin = new auth_admin();
$cache->destroy('acl_options');
$auth_admin->acl_add_option(array(
'local' => array(),
'global' => array('cms_view', 'cms_edit')
));
?>
Thanks
Chris