From 8041073c8d74e5d24e3b9f10143f3e4bd04db2de Mon Sep 17 00:00:00 2001 From: Heshan Wanigasooriya Date: Tue, 23 Mar 2010 04:17:29 +0000 Subject: removing old files and commenting new file field and other files to the vidoe module page. --- plugins/video_optmetadata/video_optmetadata.module | 146 --------------------- 1 file changed, 146 deletions(-) delete mode 100644 plugins/video_optmetadata/video_optmetadata.module (limited to 'plugins/video_optmetadata/video_optmetadata.module') diff --git a/plugins/video_optmetadata/video_optmetadata.module b/plugins/video_optmetadata/video_optmetadata.module deleted file mode 100644 index 1bf1d69..0000000 --- a/plugins/video_optmetadata/video_optmetadata.module +++ /dev/null @@ -1,146 +0,0 @@ - - * @author Heshan Wanigasooriya - * @todo - */ - - -/** - * Implementation of hook_help(). - */ -function video_optmetadata_help($path, $arg) { - switch ($path) { - case 'admin/modules#description': - return t('Enable addition of optional metadata on video nodes created by video module. Optional metadata are Video Bitrate, Audio Bitrate, Audio Sampling Rate and Audio Channels.'); - } -} - - -/** - * Implementation of hook_perm(). - */ -function video_optmetadata_perm() { - return array('insert optional metadata'); -} - - - -/** - * Implementation of hook_form_alter() - * We use this to add some fields to the video creation form. - * In those fields users will be able to insert some video metadatas. - */ -function video_optmetadata_form_alter(&$form, &$form_state, $form_id) { - - if($form_id == 'video_node_form' && isset($form['video']) && user_access('insert optional metadata')) { - - // get node object - $node = $form['#node']; - // Optional Video Metadata. We display this group expanded only if displaying of optional metadata is enabled. - $form['metadata'] = array( - '#type' => 'fieldset', - '#title' => t('Optional Metadata'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#weight' => -16, - '#description' => t('Insert here the metadata informations.') - ); - $form['metadata']['video_bitrate'] = array( - '#type' => 'textfield', - '#title' => t('Video Bitrate'), - '#length' => 11, - '#maxlength' => 11, - '#default_value' => $node->video_bitrate, - '#description' => t('Video bitrate in kbits/sec.') - ); - $form['metadata']['audio_bitrate'] = array( - '#type' => 'textfield', - '#title' => t('Audio Bitrate'), - '#length' => 11, - '#maxlength' => 11, - '#default_value' => $node->audio_bitrate, - '#description' => t('Audio bitrate in kbits/sec.') - ); - $form['metadata']['audio_sampling_rate'] = array( - '#type' => 'select', - '#title' => t('Audio Sampling Rate'), - '#options' => array(0 => 'none', 8000 => '8 kHz', 11025 => '11 kHz', 16000 => '16 kHz', 22050 => '22 kHz', 32000 => '32 kHz', 44100 => '44.1 kHz', 48000 => '48 kHz', 96000 => '96 kHz', 192400 => '192 kHz'), - '#default_value' => $node->audio_sampling_rate, - '#description' => t('Integer value of audio sampling rate in Hz.') - ); - $form['metadata']['audio_channels'] = array( - '#type' => 'select', - '#title' => t('Audio Channels'), - '#options' => array('' => 'none', '5.1' => t('5.1'), 'stereo' => t('Stereo'), 'mono' => t('Mono')), - '#default_value' => $node->audio_channels - ); - // Ends Video Optional Metadata - } -} - - -/** - * Implementation of hook_nodeapi() - */ -function video_optmetadata_nodeapi(&$node, $op, $teaser) { - if($node->type == 'video') { - switch ($op) { - case 'view': - //Add the HTML formatted output of the optional video metadata to the bottom. - $node->body .= theme('video_metadata', $node); - break; - } - } -} - -/** - * Display optional metadata (Video and Audio bitrate,..) on the view page. - * - * @param $node - * object with node information - * - * @return - * string of content to display - $node->video_bitrate, $node->audio_bitrate, $node->audio_sampling_rate, $node->audio_channels, - */ -function theme_video_metadata($node) { - //Make sure atleast one fields had data. - if ($node->video_bitrate != 0 or $node->audio_bitrate != 0 or $node->audio_sampling_rate != 0 or $node->audio_channels != 0) { - $output = "\n\n
\n"; - $output .= '

'.t('Video Metadata')."

\n"; - if($node->video_bitrate != 0) { - $fields[] = array('title' => t('Video Bitrate') . ':', 'body' => $node->video_bitrate . ' ' . t('kbits/sec')); - } - if($node->audio_bitrate != 0) { - $fields[] = array('title' => t('Audio Bitrate') . ':', 'body' => $node->audio_bitrate . ' ' . t('kbits/sec')); - } - if($node->audio_sampling_rate != 0) { - $fields[] = array('title' => t('Audio Sampling Rate') . ':', 'body' => $node->audio_sampling_rate . ' ' . t('Hz')); - } - if($node->audio_channels != '') { - $fields[] = array('title' => t('Audio Channels') . ':', 'body' => $node->audio_channels); - } - $output .= theme('video_fields', $fields); //Generate the fields HTML. - $output .= '
'; //Closing div video_metadata - } - else { //If all the fields are blank then display nothing. - $output = ''; - } - return $output; -} - -/** - * Implementation of hook_theme(). - */ -function video_optmetadata_theme() { - return array( - 'video_metadata' => array( - 'arguments' => array('node' => NULL), - ), - ); -} \ No newline at end of file -- cgit v1.2.3