You are here

private function video_transcoder::_transcoders in Video 6.4

Same name and namespace in other branches
  1. 7 includes/transcoder.inc \video_transcoder::_transcoders()
1 call to video_transcoder::_transcoders()
video_transcoder::admin_settings in includes/transcoder.inc

File

includes/transcoder.inc, line 104

Class

video_transcoder

Code

private function _transcoders() {

  // @TODO : think to change this to observer patteren
  $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') . '/transcoders';
  $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) . '/transcoders';
    $mobule_files = file_scan_directory($module_path, '^.*\\.inc$');
    $files = array_merge($files, $mobule_files);
  }
  foreach ($files as $file) {
    if (!module_load_include('inc', 'video', '/transcoders/' . $file->name)) {
      require_once $file->filename;
    }
    $focus = new $file->name();
    $form['radios'][$focus
      ->get_value()] = $focus
      ->get_name();
    $form['help'][] = $focus
      ->get_help();
    $form['admin_settings'] = $form['admin_settings'] + $focus
      ->admin_settings();
  }

  //    //we need to move our video/thumbnail fieldsets to the bottom of our form as they are used for each trancoder
  //    $autothumb = $form['admin_settings']['autothumb'];
  //    $autoconv = $form['admin_settings']['autoconv'];
  //    unset($form['admin_settings']['autothumb'], $form['admin_settings']['autoconv']);
  //    if(!$this->transcoder->is_wsod())
  //    $form['admin_settings']['autothumb'] = $autothumb;
  //    $form['admin_settings']['autoconv'] = $autoconv;
  return $form;
}