aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFabio Varesano <fax8@13637.no-reply.drupal.org>2006-06-20 21:23:24 +0000
committerFabio Varesano <fax8@13637.no-reply.drupal.org>2006-06-20 21:23:24 +0000
commit749a91f80a644bd7d2222309289c32a5bb728ef2 (patch)
tree3efd76bbdff5ae9525931f6d5e3eaa5f009740ad /plugins
parent38373b18497493630ba298df1ec638655d09f8db (diff)
downloadvideo-749a91f80a644bd7d2222309289c32a5bb728ef2.tar.gz
video-749a91f80a644bd7d2222309289c32a5bb728ef2.tar.bz2
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/video_multidownload/video_multidownload.module31
-rw-r--r--plugins/video_upload/video_upload.module2
2 files changed, 30 insertions, 3 deletions
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',
@@ -62,6 +64,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;
diff --git a/plugins/video_upload/video_upload.module b/plugins/video_upload/video_upload.module
index 832cf3f..34515a3 100644
--- a/plugins/video_upload/video_upload.module
+++ b/plugins/video_upload/video_upload.module
@@ -36,7 +36,7 @@ function video_upload_settings() {
$form['video_upload_override_vidfile'] = array(
'#type' => 'checkbox',
'#title' => t('override video file'),
- '#description' => t('Check this if your users must only submit videos throught uploading. This disable path insertion.'),
+ '#description' => t('Check this if your users must only submit videos through uploading. This disables path insertion.'),
'#default_value' => variable_get('video_upload_override_vidfile', false),
);
$form['video_upload_uploadable_extensions'] = array(