This patch to fotonotes.module allows all users with 'view original images' permissions to view but not edit fotonotes right in the image node.
Step 1. Copy (without and this code and paste into fotonotes.module at line 33 or so (just after the end of the $items['fotonote'] array and just before return $items;).
$items['node/%node/fotonotes'] = array(
'title' => 'Fotonotes',
'page callback' => 'view_fotonotes',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('view original images'),
'type' => MENU_LOCAL_TASK,
'weight' => '11',
);
Step 2. Copy (as above) this code and paste into fotonotes.module at about line 57 (between the end of the code block for function edit_fotonotes and the beginning of the code block for function fotonotes_check_access).
function view_fotonotes($node) {
$nid = $node->nid;
$_SESSION['nid'] = $nid;
drupal_add_js(drupal_get_path('module', 'fotonotes') .'/fotonotes/fnclientlib/js/fnclient.js');
drupal_add_css(drupal_get_path('module', 'fotonotes') .'/fotonotes/fnclientlib/styles/fnuser.css');
$js = 'var fnServer = "'. base_path() .'fotonote/";';
drupal_add_js($js, 'inline');
$output = theme('image', $node->images['preview'], $node->title, $node->title, array('class' => 'fn-image', 'id' => 'inote'. $node->nid));
return $output;
}
Step 3. Run example.com/update.php. (Replace example.com with the address of your website.)
Step 4. Enjoy.
Note: This patch puts the Fotonotes tab in all nodes generated by all modules. I am still working on confining it to image module nodes. When clicked in non-image module nodes, it returns a blank page.
The attached pngs show what the result looks like to node owners, admins and authenticated users.
http://drupal.org/files/fotonotesowneroradminview.png>
![]()
Comments
Comment #1
vm commentedDuplicate of: http://drupal.org/node/265013