diff options
author | Luke Last <lukelast@30151.no-reply.drupal.org> | 2005-10-25 15:30:23 +0000 |
---|---|---|
committer | Luke Last <lukelast@30151.no-reply.drupal.org> | 2005-10-25 15:30:23 +0000 |
commit | f9bea5da03d524667c8126d2e98926c5a2757a61 (patch) | |
tree | 1ef88be98119b8a82b19aab122f6aab27b9a7b95 | |
parent | f1c223d55d51b7bf493da800e2f7e5e9cb5d1042 (diff) | |
download | video-f9bea5da03d524667c8126d2e98926c5a2757a61.tar.gz video-f9bea5da03d524667c8126d2e98926c5a2757a61.tar.bz2 |
Patch #25595 Fixed tab caching bug.
-rw-r--r-- | video.module | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/video.module b/video.module index d0a2ce2..afd7ad2 100644 --- a/video.module +++ b/video.module @@ -115,7 +115,9 @@ function video_help($section = 'admin/help#video') { */ function video_menu($may_cache) { if ($may_cache) { - $items[] = array('path' => 'video', 'title' => t('videos'), + $items[] = array( + 'path' => 'video', + 'title' => t('videos'), 'callback' => 'video_page', 'access' => user_access('access video'), 'type' => MENU_SUGGESTED_ITEM); @@ -123,35 +125,34 @@ function video_menu($may_cache) { 'path' => 'node/add/video', 'title' => t('video'), 'access' => user_access('create video')); - // I don't get this whole goto thing - deekayen - $items[] = array( + $items[] = array( //This is not currently used. 'path' => 'video/goto', 'callback' => '_video_page_goto', 'type' => MENU_CALLBACK, 'callback arguments' => arg(3), 'access' => user_access('access video')); } - - if (arg(0) == 'node' && is_numeric(arg(1))) { - $node = node_load(array('nid' => arg(1))); - - if ($node->type == 'video') { - if (variable_get('video_displayplaymenutab', 1) == 1) { - $items[] = array('path' => 'node/'. arg(1) .'/play', - 'title' => t('play'), - 'callback' => 'video_play', - 'access' => user_access('access video'), - 'weight' => 3, - 'type' => MENU_LOCAL_TASK); - } - //If the video is of type youtube and multi-file downloads aren't turned on don't show the download tab. - if (variable_get('video_displaydownloadmenutab', 1) == 1 and (_video_get_filetype($node->vidfile) != 'youtube' or $node->disable_multidownload == 0)) { - $items[] = array('path' => 'node/'.arg(1).'/download', - 'title' => t('download'), - 'callback' => 'video_download', - 'access' => user_access('access video'), - 'weight' => 5, - 'type' => MENU_LOCAL_TASK); + else { //If $may_cache is false. + if (arg(0) == 'node' && is_numeric(arg(1))) { + $node = node_load(array('nid' => arg(1))); + if ($node->type == 'video') { + if (variable_get('video_displayplaymenutab', 1) == 1) { + $items[] = array('path' => 'node/'. arg(1) .'/play', + 'title' => t('play'), + 'callback' => 'video_play', + 'access' => user_access('access video'), + 'weight' => 3, + 'type' => MENU_LOCAL_TASK); + } + //If the video is of type youtube and multi-file downloads aren't turned on don't show the download tab. + if (variable_get('video_displaydownloadmenutab', 1) == 1 and (_video_get_filetype($node->vidfile) != 'youtube' or $node->disable_multidownload == 0)) { + $items[] = array('path' => 'node/'.arg(1).'/download', + 'title' => t('download'), + 'callback' => 'video_download', + 'access' => user_access('access video'), + 'weight' => 5, + 'type' => MENU_LOCAL_TASK); + } } } } |