You are here

private function video_metadata::_metadata in Video 7

Same name and namespace in other branches
  1. 6.4 includes/metadata.inc \video_metadata::_metadata()
1 call to video_metadata::_metadata()
video_metadata::admin_settings in includes/metadata.inc

File

includes/metadata.inc, line 74

Class

video_metadata

Code

private function _metadata() {
  $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') . '/metadata';
  $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) . '/metadata';
    $mobule_files = file_scan_directory($module_path, '/.*\\.inc/');
    $files = array_merge($files, $mobule_files);
  }
  foreach ($files as $file) {
    if (!module_load_include('inc', 'video', '/metadata/' . $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();
  }
  return $form;
}