From fbf8a0a295104d0c4d7060c53c2c51330a355d28 Mon Sep 17 00:00:00 2001 From: Heshan Date: Mon, 14 Mar 2011 16:38:05 +0530 Subject: Added video trnscodig and tested with node on save transcoding --- includes/filesystem.inc | 128 ------------------------------------------------ 1 file changed, 128 deletions(-) delete mode 100644 includes/filesystem.inc (limited to 'includes') diff --git a/includes/filesystem.inc b/includes/filesystem.inc deleted file mode 100644 index d2d2fd9..0000000 --- a/includes/filesystem.inc +++ /dev/null @@ -1,128 +0,0 @@ -name == $filesystem) - require_once $file->filename; - } - } - } - } - if (class_exists($filesystem)) { - $this->filesystem = new $filesystem; - } else { - drupal_set_message(t('The filesystem is not configured properly.'), 'error'); - } - } - - public function save_file($video) { - return $this->filesystem->save_file($video); - } - - public function prepare_file($video) { - return $this->filesystem->prepare_file($video); - } - - public function load_file(&$video) { - return $this->filesystem->load_file($video); - } - - public function admin_settings() { - $form = array(); - $options = $this->_filesystem(); - $form['video_filesystem'] = array( - '#type' => 'radios', - '#title' => t('Video Filesystem'), - '#default_value' => variable_get('video_filesystem', 'drupal'), - '#options' => $options['radios'], - '#description' => t('!list', array('!list' => theme('item_list', $options['help']))), - '#prefix' => '
', - '#suffix' => '
', - ); - $form = $form + $options['admin_settings']; - return $form; - } - - private function _filesystem() { - $files = array(); - // Lets find our transcoder classes and build our radio options - // We do this by scanning our transcoders folder - $form = array('radios' => array(), 'help' => array(), 'admin_settings' => array()); - $path = drupal_get_path('module', 'video') . '/filesystem'; - $files = file_scan_directory($path, '/.*\.inc/'); - // check inside sub modules - $modules = module_list(); - foreach ($modules as $module) { - $mobule_files = array(); - $module_path = drupal_get_path('module', $module) . '/filesystem'; - $mobule_files = file_scan_directory($module_path, '/.*\.inc/'); - $files = array_merge($files, $mobule_files); - } - - foreach ($files as $file) { - if (!module_load_include('inc', 'video', '/filesystem/' . $file->name)) - require_once $file->filename; - $focus = new $file->name; - $form['radios'][$focus->get_value()] = $focus->get_name(); - $form['help'][] = $focus->get_help(); - // creating div for each option - $form['video_' . $focus->get_value() . '_start'] = array( - 'video_' . $focus->get_value() . '_start' => array( - '#type' => 'markup', - '#value' => '
', - ), - ); - $form['video_' . $focus->get_value() . '_end'] = array( - 'video_' . $focus->get_value() . '_end' => array( - '#type' => 'markup', - '#value' => '
', - ), - ); - - $form['admin_settings'] = $form['admin_settings'] + $form['video_' . $focus->get_value() . '_start'] + $focus->admin_settings() + $form['video_' . $focus->get_value() . '_end']; - } - return $form; - } - - public function admin_settings_validate(&$form, &$form_state) { - return $this->filesystem->admin_settings_validate($form, $form_state); - } - -} - -interface filesystem_interface { - - public function save_file($video); - - public function prepare_file($video); - - public function load_file($video); - - public function get_name(); - - public function get_help(); - - public function admin_settings(); - - public function admin_settings_validate($form, &$form_state); -} \ No newline at end of file -- cgit v1.2.3