| 72 |
'access' => user_access('access content'), |
'access' => user_access('access content'), |
| 73 |
'type' => MENU_SUGGESTED_ITEM, |
'type' => MENU_SUGGESTED_ITEM, |
| 74 |
'callback' => 'shazamgallery_fetch'); |
'callback' => 'shazamgallery_fetch'); |
| 75 |
|
$items[] = array('path' => 'node/add/gallery', 'title' => t('gallery'), |
| 76 |
|
'access' => user_access('create gallery')); |
| 77 |
} |
} |
| 78 |
return $items; |
return $items; |
| 79 |
} |
} |
| 86 |
} |
} |
| 87 |
|
|
| 88 |
/** |
/** |
| 89 |
|
* Implementation of hook_access(). |
| 90 |
|
*/ |
| 91 |
|
function shazamgallery_access($op, $node) { |
| 92 |
|
global $user; |
| 93 |
|
|
| 94 |
|
if ($op == 'create') { |
| 95 |
|
return user_access('create gallery'); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
if ($op == 'update') { |
| 99 |
|
if (($node->uid == $user->uid && user_access('edit own gallery'))) { |
| 100 |
|
return TRUE; |
| 101 |
|
} |
| 102 |
|
else { |
| 103 |
|
// do nothing. node-access() will determine further access |
| 104 |
|
} |
| 105 |
|
} |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
|
| 109 |
|
/** |
| 110 |
* Implementation of hook_form |
* Implementation of hook_form |
| 111 |
*/ |
*/ |
| 112 |
function shazamgallery_form(&$node, &$param) { |
function shazamgallery_form(&$node, &$param) { |