You are here

function media_element_info in D7 Media 7.3

Same name and namespace in other branches
  1. 7.4 media.module \media_element_info()
  2. 7 media.module \media_element_info()
  3. 7.2 media.module \media_element_info()

Implements hook_element_info().

File

./media.module, line 685
Media API

Code

function media_element_info() {
  $types['media'] = array(
    '#input' => TRUE,
    '#process' => array(
      'media_element_process',
    ),
    '#value_callback' => 'media_file_value',
    '#element_validate' => array(
      'media_element_validate',
    ),
    '#pre_render' => array(
      'media_element_pre_render',
    ),
    '#theme' => 'media_widget',
    '#theme_wrappers' => array(
      'form_element',
    ),
    '#size' => 22,
    '#extended' => FALSE,
    '#media_options' => array(
      'global' => array(
        // Example: array('image', 'audio');
        'types' => array(),
        // Example: array('http', 'ftp', 'flickr');
        'schemes' => array(),
      ),
    ),
    '#attached' => array(
      'library' => array(
        array(
          'media',
          'media_browser',
        ),
      ),
    ),
  );
  $setting = array();
  $setting['media']['global'] = $types['media']['#media_options'];
  $types['media']['#attached']['js'][] = array(
    'type' => 'setting',
    'data' => $setting,
  );
  return $types;
}