/[drupal]/contributions/modules/export_dxml/export_dxml.module
ViewVC logotype

Diff of /contributions/modules/export_dxml/export_dxml.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2, Tue Nov 29 09:11:23 2005 UTC revision 1.3, Tue Nov 29 19:28:10 2005 UTC
# Line 1  Line 1 
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
# Line 23  function export_dxml_link($type, $node = Line 23  function export_dxml_link($type, $node =
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    }    }
# Line 37  function export_dxml_link($type, $node = Line 39  function export_dxml_link($type, $node =
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
# Line 102  function book_node_visitor_dxml_pre($nod Line 108  function book_node_visitor_dxml_pre($nod
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";
# Line 171  function export_dxml_menu($may_cache) { Line 180  function export_dxml_menu($may_cache) {
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;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2