Révision ca0757b9
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/media/includes/media.theme.inc | ||
---|---|---|
7 | 7 |
* Theming functions for the Media module. |
8 | 8 |
*/ |
9 | 9 |
|
10 |
|
|
11 |
/** |
|
12 |
* Display a media file list. |
|
13 |
* |
|
14 |
* @param array $element |
|
15 |
* The form element. |
|
16 |
* |
|
17 |
* @return string |
|
18 |
* HTML of the file list |
|
19 |
*/ |
|
20 |
function theme_media_file_list($element) { |
|
21 |
// Add the CSS for our display. |
|
22 |
return '<div class="media-file-list">' . theme('form_element', $element, $element['#children']) . '</div>'; |
|
23 |
} |
|
24 |
|
|
25 |
/** |
|
26 |
* Add messages to the page. |
|
27 |
*/ |
|
28 |
function template_preprocess_media_dialog_page(&$variables) { |
|
29 |
$variables['messages'] = theme('status_messages'); |
|
30 |
} |
|
31 |
|
|
32 | 10 |
/** |
33 | 11 |
* Adds a wrapper around a preview of a media file. |
34 | 12 |
*/ |
... | ... | |
47 | 25 |
|
48 | 26 |
// Arguments for the thumbnail link. |
49 | 27 |
$thumb = $element['#children']; |
50 |
$target = 'file/' . $element['#file']->fid . '/edit'; |
|
28 |
if (file_entity_access('update', $element['#file'])) { |
|
29 |
$target = 'file/' . $element['#file']->fid . '/edit'; |
|
30 |
$title = t('Click to edit details'); |
|
31 |
} |
|
32 |
else { |
|
33 |
$target = 'file/' . $element['#file']->fid; |
|
34 |
$title = t('Click to view details'); |
|
35 |
} |
|
51 | 36 |
$options = array( |
52 | 37 |
'query' => drupal_get_destination(), |
53 | 38 |
'html' => TRUE, |
54 |
'attributes' => array('title' => t('Click to edit details')),
|
|
39 |
'attributes' => array('title' => $title),
|
|
55 | 40 |
); |
56 | 41 |
|
57 | 42 |
// Element should be a field renderable array. This should be improved. |
... | ... | |
85 | 70 |
*/ |
86 | 71 |
function theme_media_formatter_large_icon($variables) { |
87 | 72 |
$file = $variables['file']; |
88 |
$icon_dir = variable_get('media__icon_base_directory', 'public://media-icons') . '/' . variable_get('media__icon_set', 'default');
|
|
73 |
$icon_dir = variable_get('media_icon_base_directory', 'public://media-icons') . '/' . variable_get('media_icon_set', 'default');
|
|
89 | 74 |
$icon = file_icon_path($file, $icon_dir); |
90 | 75 |
$variables['path'] = $icon; |
91 | 76 |
|
... | ... | |
108 | 93 |
} |
109 | 94 |
return $output; |
110 | 95 |
} |
96 |
|
|
97 |
/** |
|
98 |
* Add messages to the page. |
|
99 |
*/ |
|
100 |
function template_preprocess_media_dialog_page(&$variables) { |
|
101 |
$variables['messages'] = theme('status_messages'); |
|
102 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules