aboutsummaryrefslogtreecommitdiff
path: root/video.module
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 /video.module
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 'video.module')
-rw-r--r--video.module23
1 files changed, 6 insertions, 17 deletions
diff --git a/video.module b/video.module
index cbc0251..bb9d86c 100644
--- a/video.module
+++ b/video.module
@@ -297,19 +297,6 @@ function video_settings() {
'#default_value' => variable_get('video_downloadcounter', 1),
'#description' => t('Counts a hit everytime someone downloads a video.'));
- $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;
}
@@ -332,6 +319,8 @@ function video_node_info() {
* access hook
*/
function video_access($op, $node) {
+ global $user;
+
switch($op) {
case 'view':
return $node->status; // see book.module for reference
@@ -1351,11 +1340,11 @@ function _video_get_fileurl($video_file) {
global $base_url;
//creation of absolute url
- if (!preg_match("/^(http|ftp|mm|rstp)(s?):\/\//", $video_file)) { //If path is relative to drupal.
- return check_url($base_url . '/' . $video_file);
+ if (preg_match("/^(http|ftp|mm|rstp)(s?):\/\//", $video_file)) { //If path is absolute
+ return check_plain($video_file);
}
- else { // path is absolute
- return check_url($video_file);
+ else { // path is relative to drupal install
+ return check_plain($base_url . '/' . $video_file);
}
}