media_theme.inc 1.21 KB
Newer Older
1 2 3 4
<?php
// $Id$

/**
5 6 7 8
 * @file
 * Media Theming
 *
 * Theming functions for the Media module.
9 10 11
 */

/**
12 13 14 15
 * Display the media file browser.
 *
 * @param array $element
 *   The form element.
16 17
 * @return string
 */
18 19 20
function theme_media_file_browser($element) {
  // Add the CSS for our display.
  $output = '<div class="media browser">'. $element .'</div>';
21
  
22
  return $output;
23 24 25
}

/**
26 27 28 29
 * Display a media file list.
 *
 * @param array $element
 *   The form element.
30 31
 * @return string
 */
32 33 34 35
function theme_media_file_list($element) {
  // Add the CSS for our display.
  return '<div class="media-file-list">'. theme('form_element', $element, $element['#children']) .'</div>';
}
36

37 38 39 40 41 42 43 44
/**
 * Display a browser pane.
 *
 * @param array $form
 *   The form element.
 * @return string
 */
function theme_media_browser_pane($form) {
45
  $output   = array();
46 47 48 49 50 51 52 53 54 55 56 57 58 59
  
  // render the drawers
  $output[] = '<div'. drupal_attributes($form['#attributes']) .'>';
  
  // render the drawer list
  $output[] = '  <div class="browser drawers">';  
  $output[] = drupal_render_form(null, $form['drawers']);
  $output[] = ' </div>';
  
  // render the drawer displays
  $output[] = drupal_render_form(null, $form);
  $output[] = '</div>';
  
  return implode("\n", $output);
60
}