| 1 |
<?php |
<?php |
| 2 |
// $Id: export_opml.module,v 1.1 2005/11/28 08:44:12 puregin Exp $ |
// $Id: $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 21 |
if ($type == 'node' && isset($node->parent)) { |
if ($type == 'node' && isset($node->parent)) { |
| 22 |
if (!$main) { |
if (!$main) { |
| 23 |
if (user_access('export books as opml')) { |
if (user_access('export books as opml')) { |
| 24 |
$links[] = l(t('export OPML'), 'book/export/opml/'. $node->nid, array('title' => t('Export this book page and its sub-pages as OPML.'))); |
$links[] = l(t('export OPML'), |
| 25 |
|
'book/export/opml/'. $node->nid, |
| 26 |
|
array('title' => t('Export this book page and its sub-pages as OPML.'))); |
| 27 |
} |
} |
| 28 |
} |
} |
| 29 |
} |
} |
| 41 |
* The function also calls drupal_set_header() to set a header suitable |
* The function also calls drupal_set_header() to set a header suitable |
| 42 |
* for returning XML content. |
* for returning XML content. |
| 43 |
* |
* |
| 44 |
|
* Note that the user must have both 'access content' permissions (checked |
| 45 |
|
* when the menu item for export is invoked in book.module) and |
| 46 |
|
* 'export books as opml' permissions to export a book. |
| 47 |
|
* |
| 48 |
* @param nid |
* @param nid |
| 49 |
* - an integer representing the node id (nid) of the node to export |
* - an integer representing the node id (nid) of the node to export |
| 50 |
* @param depth |
* @param depth |
| 121 |
} |
} |
| 122 |
} |
} |
| 123 |
|
|
|
/** |
|
|
* Implementation of hook_menu(). |
|
|
*/ |
|
|
function export_opml_menu($may_cache) { |
|
|
$items = array(); |
|
|
|
|
|
if ($may_cache) { |
|
|
$items[] = array( |
|
|
'path' => 'book/export', |
|
|
'callback' => 'book_export', |
|
|
'access' => (user_access('export books as opml') && user_access('access content')), |
|
|
'type' => MENU_CALLBACK); |
|
|
} |
|
|
|
|
|
return $items; |
|
|
} |
|
|
|
|
|
|
|
| 124 |
|
|
| 125 |
|
|