source: extensions/Media_Icon/thumbnails.php @ 19288

Last change on this file since 19288 was 19284, checked in by julien1311, 11 years ago
  • Property svn:eol-style set to LF
File size: 1.1 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;
6
7        add_event_handler('loc_end_page_header', 'media_icon_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
17function 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
28function media_icon_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.