diff --git a/includes/media.theme.inc b/includes/media.theme.inc index 4180faadb71f29b72f69481724e69a28e0cd76a6..d801baa15a0b6664276bfb3117cb771f20144c53 100644 --- a/includes/media.theme.inc +++ b/includes/media.theme.inc @@ -121,17 +121,6 @@ function theme_media_admin_thumbnail($variables) { return $output; } - -/** - * Theme operations for a thumbnail. - */ -function theme_media_admin_thumbnail_operations($variables) { - $destination = drupal_get_destination(); - $file = $variables['file']; - $output = l(t('edit'), 'file/' . $file->fid . '/edit', array('query' => $destination)); - return $output; -} - /** * Add messages to the page. */ @@ -182,40 +171,6 @@ function theme_media_browser_control_result_limit($variables) { return theme('item_list', array('items' => $per_display, 'attributes' => array('class' => 'result_limit'))); } - -/** - * Stolen from file.module theme_file_link - * - * @param $variables - * An associative array containing: - * - file: A file object to which the link will be created. - */ -function theme_media_link($variables) { - $file = $variables['file']; - - $url = 'file/' . $file->fid; - $icon = theme('file_icon', array('file' => $file)); - - // Set options as per anchor format described at - // http://microformats.org/wiki/file-format-examples - $options = array( - 'attributes' => array( - 'type' => $file->filemime . '; length=' . $file->filesize, - ), - ); - - // Use the description as the link text if available. - if (empty($file->description)) { - $link_text = check_plain($file->filename); - } - else { - $link_text = check_plain($file->description); - $options['attributes']['title'] = check_plain($file->filename); - } - - return '' . $icon . ' ' . l($link_text, $url, $options) . ''; -} - /** * Adds a wrapper around a preview of a media file. * @param unknown_type $element diff --git a/media.module b/media.module index 03b06a9b9fa59b095baf12fb75ebe879f49a48c8..cd8c3519846be4198f0afb9dcae82b3ac3c775f8 100644 --- a/media.module +++ b/media.module @@ -264,23 +264,14 @@ function media_permission() { /** * Implements hook_theme(). - * - * @TODO: Needs a major cleanup. */ function media_theme() { return array( - // The default media file list form element. 'media_file_list' => array( 'variables' => array('element' => NULL), ), - // A link for a file w/ an icon to the media/$fid page. - 'media_link' => array( - 'variables' => array('file' => NULL), - 'file' => 'includes/media.theme.inc', - ), - // A preview of the uploaded file. 'media_thumbnail' => array( 'render element' => 'element', @@ -293,17 +284,6 @@ function media_theme() { 'file' => 'includes/media.theme.inc', ), - // Administrative thumbnail previews. - 'media_admin_thumbnail_operations' => array( - 'variables' => array('file' => NULL), - 'file' => 'includes/media.theme.inc', - ), - - // Tabs in the media browser. - 'media_browser_tabs' => array( - 'file' => 'includes/media.theme.inc', - ), - // Dialog page. 'media_dialog_page' => array( 'render element' => 'page', @@ -311,12 +291,13 @@ function media_theme() { 'file' => 'includes/media.theme.inc', ), - // + // Media form API element type. 'media_element' => array( 'render element' => 'element', 'file' => 'includes/media.theme.inc', ), + // Display a file as a large icon. 'media_formatter_large_icon' => array( 'variables' => array('file' => NULL, 'attributes' => array()), 'file' => 'includes/media.theme.inc',