Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gmap
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
gmap
Commits
85c10e48
Commit
85c10e48
authored
16 years ago
by
Brandon Bergren
Browse files
Options
Downloads
Patches
Plain Diff
#338511, reported by goba: Rename "create macro" permission to "create gmap macro".
parent
a4a6dff3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gmap.module
+1
-1
1 addition, 1 deletion
gmap.module
gmap_macro_builder.install
+26
-0
26 additions, 0 deletions
gmap_macro_builder.install
gmap_macro_builder.module
+2
-2
2 additions, 2 deletions
gmap_macro_builder.module
with
29 additions
and
3 deletions
gmap.module
+
1
−
1
View file @
85c10e48
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
gmap_macro_builder.install
0 → 100644
+
26
−
0
View file @
85c10e48
<?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
;
}
This diff is collapsed.
Click to expand it.
gmap_macro_builder.module
+
2
−
2
View file @
85c10e48
...
...
@@ -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'
),
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment