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

Diff of /contributions/modules/drupal_ftp/drupal_ftp.module

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

revision 1.1, Fri Jun 22 19:55:23 2007 UTC revision 1.2, Fri Jun 22 21:08:44 2007 UTC
# Line 584  function drupal_ftp_menu($may_cache) { Line 584  function drupal_ftp_menu($may_cache) {
584        'type' => MENU_CALLBACK,        'type' => MENU_CALLBACK,
585        'access' => user_access('access content'),        'access' => user_access('access content'),
586      );      );
587        $items[] = array(
588          'path' => 'ftp/dl',
589          'title' => t('FTP Download'),
590          'callback' => 'drupal_ftp_test_dl',
591          'type' => MENU_CALLBACK,
592          'access' => user_access('access content'),
593        );
594    }    }
595    return $items;    return $items;
596  }  }
597    
598    function drupal_ftp_test_dl() {
599    // _drupal_ftp_download_file($FileName, $Directory, &$Err)
600      $args = func_get_args();
601      $directory = '/' . implode('/', $args);
602      $err = '';
603      $file = $_GET['file'];
604      _drupal_ftp_connect("ftp.drupal.org", "anonymous", "someone@somewhere.com", "/", $err);
605      $output = _drupal_ftp_download_file($file, $directory, $err);
606      if (!$err) {
607        drupal_set_title($file);
608      }
609      else {
610        drupal_set_message($err, 'error');
611      }
612      return $output;
613    }
614    
615  function drupal_ftp_test_page() {  function drupal_ftp_test_page() {
616    $args = func_get_args();    $args = func_get_args();
617    $directory = '/' . implode('/', $args);    $directory = '/' . implode('/', $args);
# Line 610  function drupal_ftp_test_page() { Line 634  function drupal_ftp_test_page() {
634        }        }
635        else {        else {
636          // File          // File
637          $output .= $fileList[$i]["filename"] . " (" . $fileList[$i]["filesize"] . " bytes)<br>";          $output .= l($fileList[$i]["filename"], 'ftp/dl' . (!empty($args) ? $directory : ''), array(), 'file=' . $fileList[$i]["filename"]) . " (" . $fileList[$i]["filesize"] . " bytes)<br>";
638        }        }
639      }      }
640    }    }

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

  ViewVC Help
Powered by ViewVC 1.1.2