From 749a91f80a644bd7d2222309289c32a5bb728ef2 Mon Sep 17 00:00:00 2001 From: Fabio Varesano Date: Tue, 20 Jun 2006 21:23:24 +0000 Subject: Changed check_url to check_plain in _video_get_fileurl in order to make mms:// or rstp:// links usable. Fixed some grammar errors on video_upload Thanks Darryl (http://drupal.org/user/64435) for pointing this out. Fixed an error on video_multidownload which generated a function undefined error. Moved some video_multidownload specific ssettings from video.module to video_multidownload Added global $user to video_access. Thanks kungfoo (http://drupal.org/user/65090) for pointing this out. --- .../video_multidownload/video_multidownload.module | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'plugins/video_multidownload/video_multidownload.module') diff --git a/plugins/video_multidownload/video_multidownload.module b/plugins/video_multidownload/video_multidownload.module index e912c19..b936224 100644 --- a/plugins/video_multidownload/video_multidownload.module +++ b/plugins/video_multidownload/video_multidownload.module @@ -38,7 +38,9 @@ function video_multidownload_menu($may_cache) { if (arg(0) == 'node' && is_numeric(arg(1))) { if ($node = node_load(arg(1)) and $node->type == 'video') { if(isset($node->disable_multidownload) && - !$node->disable_multidownload) { + !$node->disable_multidownload && + ($node->use_play_folder || $node->download_folder!='') + ) { $items[] = array('path' => 'node/'.arg(1).'/multidownload', 'title' => t('download other formats'), 'callback' => 'video_multidownload_download', @@ -61,6 +63,31 @@ function video_multidownload_perm() { } +/** + * Implementation of hook_settings() + */ +function video_multidownload_settings() { + $form = array(); + + $options = array(1 => 'Yes', 0 => 'No'); + + $form['multifile'] = array('#type' => 'fieldset', '#title' => t('Multi-file download options'), '#description' => t('Allows a list of files to be shown on the download page. The list is usually gotten from a specified folder. This ability is useful for providing different sizes and video types for download.')); + $form['multifile']['video_multidownload'] = array( + '#type' => 'radios', + '#title' => t('Allow Multi-file Downloads'), + '#options' => $options, + '#default_value' => variable_get('video_multidownload', 0), + '#description' => t('This feature can be disabled separately for each node. If turned on make sure you set the permissions so users can use this feature.') . ' ' . l(t('access control'), 'admin/access')); + $form['multifile']['video_download_ext'] = array( + '#type' => 'textfield', + '#title' => t('File extensions to show'), + '#default_value' => variable_get('video_download_ext', 'mov,wmv,rm,flv,avi,divx,mpg,mpeg,mp4,zip'), + '#description' => t('The extensions of files to list from the multi-file download folder on the download page. Extensions should be comma seperated with no spaces, for example (mov,wmv,rm).')); + + return $form; +} + + /** * Implementation of hook_form_alter() * We use this to add multidownload fields to the video creation form. @@ -148,7 +175,7 @@ function video_multidownload_download() { $play_dir_stub = str_replace(basename($node->vidfile), "", $node->vidfile); //Remove the filename from the play file to get directory. $play_dir = getcwd() . '/' . $play_dir_stub; //Get the local directory path where the file is kept. if ($node->use_play_folder == 1 and file_exists($play_dir) and $play_dir_stub != '/') { //Make sure play stub won't allow scanning base drupal directory. - $scan_play_folder = _video_scandir($play_dir); + $scan_play_folder = _video_multidownload_scandir($play_dir); $scan_play_folder['local_dir'] = $play_dir; //For getting filesize. $scan_play_folder['dir_stub'] = $play_dir_stub; //To put in the URL. $folder_array[] = $scan_play_folder; -- cgit v1.2.3