Skip to content
Snippets Groups Projects
Commit 85c10e48 authored by Brandon Bergren's avatar Brandon Bergren
Browse files

#338511, reported by goba: Rename "create macro" permission to "create gmap macro".

parent a4a6dff3
No related branches found
No related tags found
No related merge requests found
......@@ -451,7 +451,7 @@ function gmap_filter($op, $delta = 0, $format = -1, $text = '') {
* Implementation of hook_filter_tips().
*/
function gmap_filter_tips($delta, $format, $long = FALSE) {
if (user_access('create macro')) { // only display macro if user can create one
if (user_access('create gmap macro')) { // only display macro if user can create one
return t('Insert Google Map macro.') .'<a href="'. url('map/macro') .'" target="_blank" >'. t('Create a macro') .'</a>';
}
else {
......
<?php
// $Id$
/**
* @file
* Install / update routines for gmap_macro_builder.
*/
/**
* Rename 'create macro' permission.
*/
function gmap_macro_builder_update_6100() {
$ret = array();
$result = db_query('SELECT pid, perm FROM {permission}');
while ($row = db_fetch_object($result)) {
// We leave "create macro" in for now just in case someone else already had that permission.
// It should get removed automatically the next time an admin tweaks the permissions.
$permissions = explode(', ', $row->perm);
if (in_array('create macro', $permissions) && !in_array('create gmap macro', $permissions)) {
$permissions[] = 'create gmap macro';
}
$permissions = implode(', ', $permissions);
db_query("UPDATE {permission} SET perm = '%s' WHERE pid = %d", $permissions, $row->pid);
}
return $ret;
}
......@@ -22,7 +22,7 @@ function gmap_macro_builder_help($path, $arg) {
* Implementation of hook_perm().
*/
function gmap_macro_builder_perm() {
return array('create macro');
return array('create gmap macro');
}
/**
......@@ -32,7 +32,7 @@ function gmap_macro_builder_menu() {
$items['map/macro'] = array(
'type' => MENU_NORMAL_ITEM,
'title' => 'Build a GMap macro',
'access arguments' => array('create macro'),
'access arguments' => array('create gmap macro'),
'page callback' => 'drupal_get_form',
'page arguments' => array('gmap_macro_builder_form'),
);
......
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