/[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.1, Mon Apr 7 21:12:44 2008 UTC revision 1.2, Wed Jun 4 18:06:18 2008 UTC
# Line 65  function html_export_settings() { Line 65  function html_export_settings() {
65  /**  /**
66  * Implementation of hook_settings_submit  * Implementation of hook_settings_submit
67  */  */
68  function html_export_settings_submit($form_id, $form_values) {  function html_export_settings_submit($form_id, $form_values) {
69            $root = substr($_SERVER['HTTP_REFERER'],0,strpos($_SERVER['HTTP_REFERER'],$_GET['q']));
70          if($form_values["html_export"] == 1){          if($form_values["html_export"] == 1){
71                    //need a better way of stripping out the base URL BECAUSE if there is NO base path then this will most likely fail to grab the root correctly
72                    //Look for something that just returns the server url that it's located on eg http://site.com/
73                    //this also might all be unnessecary as all drupal sites submit their index.php to themselves....so I might just be able to send out a call to http_referer.  Pull it out and see what it's storing.
74                  $root = substr($_SERVER['HTTP_REFERER'],0,strpos($_SERVER['HTTP_REFERER'],base_path()));                  $root = substr($_SERVER['HTTP_REFERER'],0,strpos($_SERVER['HTTP_REFERER'],base_path()));
75                  //create a folder html_export to put the directory in                  //create a folder html_export to put the directory in
76                  $dir = file_create_path(file_directory_path() . '/html_export');                  $dir = file_create_path(file_directory_path() . '/html_export');
# Line 112  function html_export_settings_submit($fo Line 116  function html_export_settings_submit($fo
116                                  //account for clean URLs turned off                                  //account for clean URLs turned off
117                                  $data = str_replace('index.php?q=' . $key,$nidpath,$data);                                  $data = str_replace('index.php?q=' . $key,$nidpath,$data);
118                          }                          }
119                            $data = str_replace('?q=','',$data);
120                          $file = fopen($export_path . "/page" . $node['nid'] . ".html","w");                          $file = fopen($export_path . "/page" . $node['nid'] . ".html","w");
121                          fwrite($file,$data);                          fwrite($file,$data);
122                          fclose($file);                          fclose($file);
# Line 131  function html_export_settings_submit($fo Line 136  function html_export_settings_submit($fo
136                          //account for clean URLs turned off                          //account for clean URLs turned off
137                          $data = str_replace('index.php?q=' . $key,$nidpath,$data);                          $data = str_replace('index.php?q=' . $key,$nidpath,$data);
138                  }                  }
139                    $data = str_replace('?q=','',$data);
140                  $file = fopen($export_path . "/index.html","w");                  $file = fopen($export_path . "/index.html","w");
141                  fwrite($file,$data);                  fwrite($file,$data);
142                  fclose($file);                  fclose($file);

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

  ViewVC Help
Powered by ViewVC 1.1.2