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

Diff of /contributions/modules/html_export/html_export.module

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

revision 1.4, Tue Jul 15 19:40:32 2008 UTC revision 1.5, Sat Aug 9 21:27:04 2008 UTC
# Line 38  function html_export_help($section) { Line 38  function html_export_help($section) {
38  /**  /**
39  * Implementation of hook_menu  * Implementation of hook_menu
40  */  */
41  function html_export_menu($may_cache) {  function html_export_menu() {
42    $items = array();    $items = array();
43    $items[] = array('path' => 'admin/settings/html_export',    $items['admin/settings/html_export'] = array(
44        'title' => t('HTML Export'),      'title' => 'HTML Export',
45        'description' => t('Export to HTML'),      'description' => 'Export your drupal site to static html page',
46        'callback' => 'drupal_get_form',      'page callback' => 'drupal_get_form',
47        'callback arguments' => 'html_export_settings',      'page arguments' => array('html_export_settings'),
48        'type' => MENU_NORMAL_ITEM,      'access arguments' => array('access administration pages'),
49      'access' => user_access('access administration pages'));      'type' => MENU_NORMAL_ITEM,
50       );
51    return $items;    return $items;
52  }  }
53  /**  /**
# Line 60  function html_export_settings() { Line 61  function html_export_settings() {
61      '#options' => array(0 => 'No',1 => 'Yes'),      '#options' => array(0 => 'No',1 => 'Yes'),
62      '#required' => true,      '#required' => true,
63    );    );
64      $form['#submit'] = array('html_export_settings_submit');
65    return system_settings_form($form);    return system_settings_form($form);
66  }  }
67  /**  /**
68  * Implementation of hook_settings_submit  * Implementation of hook_settings_submit
69  */  */
70  function html_export_settings_submit($form_id, $form_values) {  function html_export_settings_submit($form_id, $form_values) {
71          if($form_values["html_export"] == 1){          if($form_values["values"]["html_export"] == 1) {
72                  $clean = variable_get('clean_url',0);                  $clean = variable_get('clean_url',0);
73                  //turn clean URLs off temporarily if they are on                  //turn clean URLs off temporarily if they are on
74                  if($clean){                  if($clean){
# Line 92  function html_export_settings_submit($fo Line 94  function html_export_settings_submit($fo
94                  $export_path = str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . $export_path;                  $export_path = str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . $export_path;
95    
96                  //run the copyr function, modified to work with zip archive; copy the files,themes,sites,and misc directories                  //run the copyr function, modified to work with zip archive; copy the files,themes,sites,and misc directories
97                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . file_directory_path(),$export_path . '/' . file_directory_path());                  //_html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . file_directory_path(),$export_path . '/' . file_directory_path());
98                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . 'sites',$export_path . '/sites');                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . 'sites',$export_path . '/sites');
99                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . 'modules',$export_path . '/modules');                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . 'modules',$export_path . '/modules');
100                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . 'themes',$export_path . '/themes');                  _html_export_copyr(str_replace('index.php','',$_SERVER['PATH_TRANSLATED']) . 'themes',$export_path . '/themes');
# Line 124  function html_export_settings_submit($fo Line 126  function html_export_settings_submit($fo
126    
127                                  $nids[$url] = $tmp_url . '.html';                                  $nids[$url] = $tmp_url . '.html';
128                                  $nids['node/' . $node['nid']] = $tmp_url . '.html';                                  $nids['node/' . $node['nid']] = $tmp_url . '.html';
129    
130                          }                          }
131                  }                  }
132                  //run through all the nodes and render pages to add to the zip file                  //run through all the nodes and render pages to add to the zip file

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2