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.
Not
The attached pngs shows what the result looks like to node owner, admins and authenticated users.
http://drupal.org/files/fotonotesowneroradminview.png>
![]()
| Comment | File | Size | Author |
|---|---|---|---|
| fotonotestabauthenticateduserview.png | 658.55 KB | markpenny | |
| fotonotesowneroradminview.png | 775.75 KB | markpenny |
Comments
Comment #1
markpenny commentedSorry. Thought I was editing with the backbutton. Turned out I was generating another version.