You are here

private function video_transcoder::_transcoders in Video 7

Same name and namespace in other branches
  1. 6.4 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 143

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(),
  );

  // check inside sub modules
  $modules = module_list();
  $files = array();
  foreach ($modules as $module) {
    $mobule_files = array();
    $module_path = drupal_get_path('module', $module) . '/transcoders';
    foreach (file_scan_directory($module_path, '/.*\\.inc/') as $filekey => $file) {
      $file->module = $module;
      $mobule_files[] = $file;
    }
    $files = array_merge($files, $mobule_files);
  }
  foreach ($files as $file) {
    module_load_include('inc', $file->module, '/transcoders/' . $file->name);
    $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;
}