source: extensions/Media_Icon/thumbnails.php @ 19375

Last change on this file since 19375 was 19372, checked in by julien1311, 12 years ago

add the capacity to choose the supported files

  • Property svn:eol-style set to LF
File size: 1.2 KB
Line 
1<?php
2add_event_handler('loc_end_index_thumbnails', 'media_icon_thumbnails');
3
4function media_icon_thumbnails($tpl_thumbnails_var) {
5        global $template, $conf;
6
7        $conf_media_icon_general = unserialize($conf['media_icon_general']);
8        $conf_media_icon_advanced = unserialize($conf['media_icon_advanced']);
9       
10        $template->set_prefilter('index_thumbnails', 'media_icon_prefilter_thumbnails');
11       
12        $template->set_filename('media_icon_template', dirname(__FILE__).'/template/media_icon_thumbnails.tpl');
13       
14        $template->assign('media_icon_style',$conf_media_icon_general['style']);
15       
16        $template->assign('media_icon_support', $conf_media_icon_general['support']);
17        $template->assign(
18                'media_icon_advanced',
19                array(
20                        'xposition' => $conf_media_icon_advanced['xposition'],
21                        'yposition' => $conf_media_icon_advanced['yposition'],
22                        'opacity' => $conf_media_icon_advanced['opacity'],
23                )
24        );
25       
26        $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('media_icon_template', true));
27       
28        return $tpl_thumbnails_var;
29}
30
31function media_icon_prefilter_thumbnails($content, &$smarty) {
32        global $template;
33
34        $search = 'class="thumbnail"';
35       
36        $replacement = 'class="thumbnail" media_icon="{$thumbnail.file}"';
37        $content= str_replace($search, $replacement, $content);
38
39        return $content;
40}
41?>
Note: See TracBrowser for help on using the repository browser.