| 1 |
<?php |
<?php |
| 2 |
// $Id: export_dxml.module,v 1.1 2005/11/28 08:21:15 puregin Exp $ |
// $Id: $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 23 |
if ($type == 'node' && isset($node->parent)) { |
if ($type == 'node' && isset($node->parent)) { |
| 24 |
if (!$main) { |
if (!$main) { |
| 25 |
if (user_access('export books as dxml')) { |
if (user_access('export books as dxml')) { |
| 26 |
$links[] = l(t('export Drupal XML'), 'book/export/dxml/'. $node->nid, array('title' => t('Export this book page and its sub-pages as Drupal XML (suitable for re-import)'))); |
$links[] = l(t('export Drupal XML'), |
| 27 |
|
'book/export/dxml/'. $node->nid, |
| 28 |
|
array('title' => t('Export this book page and its sub-pages as Drupal XML (suitable for re-import)'))); |
| 29 |
} |
} |
| 30 |
} |
} |
| 31 |
} |
} |
| 39 |
* The function also calls drupal_set_header() to set a header suitable |
* The function also calls drupal_set_header() to set a header suitable |
| 40 |
* for returning XML content. |
* for returning XML content. |
| 41 |
* |
* |
| 42 |
|
* Note that the user must have both 'access content' permissions (checked |
| 43 |
|
* when the menu item for export is invoked in book.module) and |
| 44 |
|
* 'export books as dxml' permissions to export a book. |
| 45 |
|
* |
| 46 |
* @param nid |
* @param nid |
| 47 |
* - an integer representing the node id (nid) of the node to export |
* - an integer representing the node id (nid) of the node to export |
| 48 |
* @param depth |
* @param depth |
| 108 |
// wrap the teaser in a CDATA declaration |
// wrap the teaser in a CDATA declaration |
| 109 |
$teaser = "<teaser>\n"; |
$teaser = "<teaser>\n"; |
| 110 |
$teaser .= "<![CDATA["; |
$teaser .= "<![CDATA["; |
| 111 |
if ($node->body) { |
# if PHP code export is not allowed, supply an empty teaser |
| 112 |
$teaser .= $node->teaser; |
if ($allow_php) { |
| 113 |
|
if ($node->body) { |
| 114 |
|
$teaser .= $node->teaser; |
| 115 |
|
} |
| 116 |
} |
} |
| 117 |
$teaser .= "]]>\n"; |
$teaser .= "]]>\n"; |
| 118 |
$teaser .= "</teaser>\n"; |
$teaser .= "</teaser>\n"; |
| 180 |
'callback' => 'export_dxml_admin', |
'callback' => 'export_dxml_admin', |
| 181 |
'type' => MENU_NORMAL_ITEM, |
'type' => MENU_NORMAL_ITEM, |
| 182 |
'weight' => 0); |
'weight' => 0); |
|
$items[] = array( |
|
|
'path' => 'book/export', |
|
|
'callback' => 'book_export', |
|
|
'access' => (user_access('export books as dxml') && user_access('access content')), |
|
|
'type' => MENU_CALLBACK); |
|
| 183 |
} |
} |
| 184 |
|
|
| 185 |
return $items; |
return $items; |