Skip to content
Snippets Groups Projects
Commit 17c9081b authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-64] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@463 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 70af42a6
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,11 @@ function unl_permission() {
'description' => t('If this is not checked, a user can not change the permissions of the administrator role. Requires the "Administer permissions" permission.'),
'restrict access' => TRUE,
),
'unl theme settings' => array(
'title' => t('Change Theme Settings'),
'description' => t('Allow this role to change the current theme settings.'),
)
);
}
......@@ -103,6 +108,16 @@ function unl_menu() {
'file' => 'unl_migration.php',
);
$items['admin/themes'] = array(
'title' => 'Appearance',
'description' => 'Configure your theme.',
'access callback' => 'unl_user_access',
'access arguments' => array(array('!administer themes', 'unl theme settings')),
'page callback' => 'drupal_get_form',
'position' => 'left',
'weight' => -6,
);
if (conf_path() == 'sites/default') {
$items['admin/sites/unl'] = array(
'title' => 'UNL Site Creation Tool',
......@@ -133,6 +148,15 @@ function unl_menu() {
return $items;
}
function unl_menu_alter(&$items)
{
foreach (array('module', 'file', 'page arguments') as $key) {
$items['admin/themes'][$key] = $items['admin/appearance/settings/' . variable_get('theme_default')][$key];
}
return $items;
}
function unl_form_alter(&$form, $form_state, $form_id) {
// Make new menu items expanded by default.
if ($form_id == 'menu_edit_item' && $form['mlid']['#value'] == 0) {
......@@ -318,4 +342,20 @@ function unl_url_outbound_alter(&$path, &$options, $original_path) {
$options['https'] = (bool) (variable_get('https', 0) && !$generic_user);
}
function unl_user_access($permissions, $account = NULL) {
foreach ($permissions as $permission) {
if (substr($permission, 0, 1) == '!') {
$permission = substr($permission, 1);
$result = !user_access($permission, $account);
}
else {
$result = user_access($permission, $account);
}
if (!$result) {
return FALSE;
}
}
return TRUE;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment