@@ -38,6 +38,15 @@ function book_render() {
|
||||
* format determined by the $type parameter.
|
||||
*/
|
||||
function book_export($type, $nid) {
|
||||
// Check that the node exists and that the current user has access to it.
|
||||
$node = node_load($nid);
|
||||
if (!$node) {
|
||||
return MENU_NOT_FOUND;
|
||||
}
|
||||
if (!node_access('view', $node)) {
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
$type = drupal_strtolower($type);
|
||||
|
||||
$export_function = 'book_export_' . $type;
|
||||
|
||||
Reference in New Issue
Block a user