| 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); |
| 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 |
} |
} |