aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/video_customfields/video_customfields.module24
-rw-r--r--plugins/video_image/video_image.module2
-rw-r--r--plugins/video_multidownload/video_multidownload.module14
-rw-r--r--plugins/video_upload/video_upload.module24
-rw-r--r--video.module75
5 files changed, 95 insertions, 44 deletions
diff --git a/plugins/video_customfields/video_customfields.module b/plugins/video_customfields/video_customfields.module
index 972bdc1..fa48795 100644
--- a/plugins/video_customfields/video_customfields.module
+++ b/plugins/video_customfields/video_customfields.module
@@ -14,7 +14,7 @@
*/
function video_customfields_help($section) {
switch ($section) {
- case 'admin/modules#description':
+ case 'admin/settings/modules#description':
return t('Enable addition of custom fileds on video nodes created by video module.');
}
}
@@ -27,6 +27,24 @@ function video_customfields_perm() {
return array('insert custom fields');
}
+/**
+ * Implementation of hook_menu().
+ */
+function video_customfields_menu($may_cache) {
+ $items = array();
+ if ($may_cache) {
+ $items[] = array(
+ 'path' => 'admin/content/video/customfields',
+ 'title' => t('customfields'),
+ 'description' => t('administer video_customfields module settings'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => array('video_customfields_settings_form'),
+ 'access' => user_access('administer site configuration'),
+ 'type' => MENU_NORMAL_ITEM,
+ );
+ }
+ return $items;
+}
/**
* Settings Hook
@@ -34,7 +52,7 @@ function video_customfields_perm() {
* @return
* string of form content or error message
*/
-function video_customfields_settings() {
+function video_customfields_settings_form() {
//Must have "administer site configuration" and "administer video" privilages.
if (!user_access('administer video')) {
drupal_access_denied();
@@ -88,7 +106,7 @@ function video_customfields_settings() {
'#default_value' => variable_get('video_customgroupcollapsed', 1),
'#description' => t('Should the custom fields group be initially collapsed when creating and editing video nodes?')
);
- return $form;
+ return system_settings_form($form);
}
diff --git a/plugins/video_image/video_image.module b/plugins/video_image/video_image.module
index 9664523..18c249b 100644
--- a/plugins/video_image/video_image.module
+++ b/plugins/video_image/video_image.module
@@ -63,7 +63,7 @@ function video_image_nodeapi(&$node, $op, $teaser) {
break;
case 'prepare':
// check that image.module is actived
- if ( !module_exist("image")) {
+ if ( !module_exists("image")) {
db_query("UPDATE {system} SET status = 0 WHERE name ='video_image' AND type = 'module' LIMIT 1");
drupal_set_message(t('video_image module requires the %module module.<br />To prevent system errors video_image module has been disabled.<br />Please install the image module and then reactivate the video_image module.', array('%module' => l('image', 'http://drupal.org/project/image'))), 'error');
break;
diff --git a/plugins/video_multidownload/video_multidownload.module b/plugins/video_multidownload/video_multidownload.module
index b936224..23b1826 100644
--- a/plugins/video_multidownload/video_multidownload.module
+++ b/plugins/video_multidownload/video_multidownload.module
@@ -32,7 +32,15 @@ function video_multidownload_help($section) {
function video_multidownload_menu($may_cache) {
$items = array();
if ($may_cache) {
- ; // for further uses
+ $items[] = array(
+ 'path' => 'admin/content/video/multidownload',
+ 'title' => t('multidownload'),
+ 'description' => t('administer video_multidownload module settings'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => array('video_multidownload_settings_form'),
+ 'access' => user_access('administer site configuration'),
+ 'type' => MENU_NORMAL_ITEM,
+ );
}
else {
if (arg(0) == 'node' && is_numeric(arg(1))) {
@@ -66,7 +74,7 @@ function video_multidownload_perm() {
/**
* Implementation of hook_settings()
*/
-function video_multidownload_settings() {
+function video_multidownload_settings_form() {
$form = array();
$options = array(1 => 'Yes', 0 => 'No');
@@ -84,7 +92,7 @@ function video_multidownload_settings() {
'#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;
+ return system_settings_form($form);
}
diff --git a/plugins/video_upload/video_upload.module b/plugins/video_upload/video_upload.module
index e467d7e..41e79ae 100644
--- a/plugins/video_upload/video_upload.module
+++ b/plugins/video_upload/video_upload.module
@@ -14,19 +14,39 @@
*/
function video_upload_help($section) {
switch ($section) {
- case 'admin/modules#description':
+ case 'admin/settings/modules#description':
return t('Enable video files uploading in video module.');
}
}
/**
+ * Implementation of hook_menu().
+ */
+function video_upload_menu($may_cache) {
+ $items = array();
+ if ($may_cache) {
+ $items[] = array(
+ 'path' => 'admin/content/video/upload',
+ 'title' => t('upload'),
+ 'description' => t('administer video_upload module settings'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => array('video_upload_settings_form'),
+ 'access' => user_access('administer site configuration'),
+ 'type' => MENU_NORMAL_ITEM,
+ );
+ }
+ return $items;
+}
+
+
+/**
* Settings Hook
*
* @return
* string of form content or error message
*/
-function video_upload_settings() {
+function video_upload_settings_form() {
//Must have "administer site configuration" and "administer video" privilages.
if (!user_access('administer video')) {
drupal_access_denied();
diff --git a/video.module b/video.module
index e16868a..5e3e0aa 100644
--- a/video.module
+++ b/video.module
@@ -35,10 +35,10 @@ function video_help($section = 'admin/help#video') {
<li>Create video posts at <a href="%node-add-video">create content &gt;&gt; video</a>.</li>
<li>Administer video module settings at <a href="%admin-settings-video">administer &gt;&gt; settings &gt;&gt; video</a>.</li>
</ul>
-', array('%admin-block' => url('admin/block'), '%node-add-video' => url('node/add/video'), '%admin-settings-video' => url('admin/settings/video')));
+', array('%admin-block' => url('admin/settings/block'), '%node-add-video' => url('node/add/video'), '%admin-settings-video' => url('admin/content/video')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%video">Video page</a>.', array('%video' => 'http://www.drupal.org/handbook/modules/video/')) .'</p>';
return $output;
- case 'admin/modules#description':
+ case 'admin/settings/modules#description':
return t('Allows video nodes.');
case 'node/add#video':
return t('Allows you to insert videos as nodes.');
@@ -91,6 +91,15 @@ function video_menu($may_cache) {
'path' => 'node/add/video',
'title' => t('video'),
'access' => user_access('create video'));
+ $items[] = array(
+ 'path' => 'admin/content/video',
+ 'title' => t('video settings'),
+ 'description' => t('administer video module settings'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => array('video_settings_form'),
+ 'access' => user_access('administer site configuration'),
+ 'type' => MENU_NORMAL_ITEM,
+ );
}
else { //If $may_cache is false.
if (arg(0) == 'node' && is_numeric(arg(1))) {
@@ -136,7 +145,7 @@ function video_menu($may_cache) {
* array of link information
*/
function video_link($type, $node = NULL) {
- $link = '';
+ $link = array();
// Node links for a video
if ($type == 'node' && $node->type == 'video' && $node->vidfile && user_access('access video')) {
//If the video is of type youtube and multi-file downloads aren't turned on don't show the download link.
@@ -149,38 +158,28 @@ function video_link($type, $node = NULL) {
if (user_access('play video')) {
if (variable_get('video_displayplaylink', 1)) {
- $link .= l(t('play'), "node/$node->nid/play", array('class' => 'outgoing', 'title' => t('play %link', array('%link' => $node->title))));
- $link .= ($display_download_link == 1) ? ' ' . t('or') . ' ' : ' | ';
+ $link['video_play'] = array(
+ 'title' => t('play'),
+ 'href' => "node/$node->nid/play",
+ 'attributes' => array(
+ 'class' => 'outgoing',
+ 'title' => t('play %link', array('%link' => $node->title)),
+ ),
+ );
}
}
- else {
- $link .= l(t('login'), "user/login", array('class' => 'outgoing', 'title' => t('login to your account')));
- $link .= ' ' . t('or') . ' ';
- $link .= l(t('register'), "user/register", array('class' => 'outgoing', 'title' => t('create a new account')));
- $link .= t(' to play video');
- $link .= ($display_download_link == 1) ? ' ' . t('or') . ' ' : ' | ';
- }
if ($display_download_link == 1) {
- $link .= l(t('download'), "node/$node->nid/download", array('class' => 'outgoing', 'title' => t('download %link', array('%link' => $node->title))));
- $link .= ' | ';
- }
- if (variable_get('video_displayplaytime', 1)) {
- $link .= format_interval($node->playtime_seconds) . ' | ';
- }
- if (variable_get('video_displayfilesize', 1) and $node->size != 0) {
- $link .= format_size($node->size) . ' | ';
- }
- if (variable_get('video_playcounter', 1) and user_access('view play counter')) {
- $link .= $node->play_counter . ' ' . t('plays') . ' | ';
- }
- if (variable_get('video_downloadcounter', 1) and user_access('view download counter')) {
- $link .= $node->download_counter . ' ' . t('downloads') . ' | ';
+ $link['video_download'] = array(
+ 'title' => t('download'),
+ 'href' => "node/$node->nid/download",
+ 'attributes' => array(
+ 'class' => 'outgoing',
+ 'title' => t('download %link', array('%link' => $node->title)),
+ ),
+ );
}
-
- $link = substr($link, 0, -3); //Trim the last " | " off.
- return array($link);
}
- return array();
+ return $link;
}
/**
@@ -242,7 +241,7 @@ function video_perm() {
* @return
* string of form content or error message
*/
-function video_settings() {
+function video_settings_form() {
global $base_url;
//Must have "administer site configuration" and "administer video" privilages.
@@ -318,8 +317,7 @@ function video_settings() {
'#default_value' => variable_get('video_downloadcounter', 1),
'#description' => t('Counts a hit everytime someone downloads a video.'));
-
- return $form;
+ return system_settings_form($form);
}
/******************************************************************************
@@ -333,7 +331,12 @@ function video_settings() {
* array
*/
function video_node_info() {
- return array('video' => array('name' => t('video'), 'base' => 'video'));
+ return array('video' => array(
+ 'name' => t('video'),
+ 'module' => 'video',
+ 'description' => t('allow a variety of video formats to be posted as nodes in your site'),
+ )
+ );
}
/**
@@ -625,8 +628,10 @@ function video_view(&$node, $teaser = FALSE, $page = FALSE) {
$node = node_prepare($node, $teaser); //Run the body through the standard filters.
// include the video css file
- theme_add_style(drupal_get_path('module', 'video').'/video.css');
+ drupal_add_css(drupal_get_path('module', 'video').'/video.css');
+ $node->content['body'] = array('#value' => $node->body);
+ return $node;
}
/********************************************************************