source: extensions/Media_Icon/include/thumbnails.inc.php

Last change on this file was 32691, checked in by ddtddt, 3 years ago

[media_icon] piwigo 12

  • 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', MEDIA_ICON_ABSOLUTE_PATH.'template/media_icon.tpl');
13       
14        $template->assign('media_icon_style',$conf_media_icon_general['style']);
15
16        $template->assign('media_icon_active',  $conf_media_icon_general['active']);
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) {
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.