Last change
on this file since 19311 was
19311,
checked in by julien1311, 11 years ago
|
version auto
gestion de picture.php
|
-
Property svn:eol-style set to
LF
|
File size:
1.1 KB
|
Line | |
---|
1 | <?php |
---|
2 | add_event_handler('loc_end_index_thumbnails', 'media_icon_thumbnails'); |
---|
3 | |
---|
4 | function media_icon_thumbnails($tpl_thumbnails_var) { |
---|
5 | global $template; |
---|
6 | |
---|
7 | add_event_handler('loc_end_page_header', 'media_icon_thumbnails_css'); |
---|
8 | |
---|
9 | $template->set_prefilter('index_thumbnails', 'media_icon_prefilter_thumbnails'); |
---|
10 | |
---|
11 | $template->set_filename('media_icon_template', dirname(__FILE__).'/template/media_icon.tpl'); |
---|
12 | $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('media_icon_template', true)); |
---|
13 | |
---|
14 | return $tpl_thumbnails_var; |
---|
15 | } |
---|
16 | |
---|
17 | function media_icon_prefilter_thumbnails($content, &$smarty) { |
---|
18 | global $template; |
---|
19 | |
---|
20 | $search = 'class="thumbnail"'; |
---|
21 | |
---|
22 | $replacement = 'class="thumbnail" media_icon="{$thumbnail.file}"'; |
---|
23 | $content= str_replace($search, $replacement, $content); |
---|
24 | |
---|
25 | return $content; |
---|
26 | } |
---|
27 | |
---|
28 | function media_icon_thumbnails_css() { |
---|
29 | global $template, $conf; |
---|
30 | |
---|
31 | $conf_media_icon = unserialize($conf['media_icon']); |
---|
32 | |
---|
33 | //add a stylesheet |
---|
34 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.MEDIA_ICON_PATH.'template/'.$conf_media_icon['style'].'_media_icon.css">'); |
---|
35 | } |
---|
36 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.