/[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.1, Mon Nov 28 08:21:15 2005 UTC revision 1.2, Tue Nov 29 09:11:23 2005 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: $  // $Id: export_dxml.module,v 1.1 2005/11/28 08:21:15 puregin Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 8  Line 8 
8   */   */
9    
10  /**  /**
11     * Implementation of hook_perm().
12     */
13    function export_dxml_perm() {
14      return array('export books as dxml');
15    }
16    
17    
18    /**
19   * Implementation of hook_link().   * Implementation of hook_link().
20   */   */
21  function export_dxml_link($type, $node = 0, $main = 0) {  function export_dxml_link($type, $node = 0, $main = 0) {
22    $links = array();    $links = array();
23    if ($type == 'node' && isset($node->parent)) {    if ($type == 'node' && isset($node->parent)) {
24      if (!$main) {      if (!$main) {
25        if (user_access('export books')) {        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'), 'book/export/dxml/'. $node->nid, array('title' => t('Export this book page and its sub-pages as Drupal XML (suitable for re-import)')));
27        }        }
28      }      }
# Line 23  function export_dxml_link($type, $node = Line 31  function export_dxml_link($type, $node =
31    return $links;    return $links;
32  }  }
33    
 /*  
  *          dxml: Drupal book XML is supported in export_dxml.module  
  *          opml: OPML (Outline Processor Markup Language) is supported in export_opml.module  
 */  
   
34  /**  /**
35   * This function is called by book_export() to generate DXML for export.   * This function is called by book_export() to generate DXML for export.
36   *   *
# Line 43  function export_dxml_link($type, $node = Line 46  function export_dxml_link($type, $node =
46   *   - the DXML representing the node and its children in the book hierarchy   *   - the DXML representing the node and its children in the book hierarchy
47  */  */
48  function book_export_dxml($nid, $depth) {  function book_export_dxml($nid, $depth) {
49    if (user_access('export books')) {    if (user_access('export books as dxml')) {
50        drupal_set_header('Content-Type: text/xml; charset=utf-8');        drupal_set_header('Content-Type: text/xml; charset=utf-8');
51        $xml = "<?xml version='1.0'?>\n";        $xml = "<?xml version='1.0'?>\n";
52        $xml .= "<!DOCTYPE book PUBLIC \"-//Drupal//DTD DXML V1.0//EN\" \"http://drupal.org/xml/dxml.dtd\">\n";        $xml .= "<!DOCTYPE book PUBLIC \"-//Drupal//DTD DXML V1.0//EN\" \"http://drupal.org/xml/dxml.dtd\">\n";
# Line 168  function export_dxml_menu($may_cache) { Line 171  function export_dxml_menu($may_cache) {
171        'callback' => 'export_dxml_admin',        'callback' => 'export_dxml_admin',
172        'type' => MENU_NORMAL_ITEM,        'type' => MENU_NORMAL_ITEM,
173        'weight' => 0);        'weight' => 0);
174        $items[] = array(
175          'path' => 'book/export',
176          'callback' => 'book_export',
177          'access' => (user_access('export books as dxml') && user_access('access content')),
178          'type' => MENU_CALLBACK);
179    }    }
180    
181    return $items;    return $items;

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

  ViewVC Help
Powered by ViewVC 1.1.2