source: extensions/pdf2tab/include/thumbnails.inc.php @ 32244

Last change on this file since 32244 was 19811, checked in by julien1311, 12 years ago

add an admin page to choose the extension to handle

  • Property svn:eol-style set to LF
File size: 910 bytes
Line 
1<?php
2add_event_handler('loc_end_index_thumbnails', 'pdf2tab_thumbnails');
3
4load_language('plugin.lang', PDF2TAB_PATH);
5
6function pdf2tab_thumbnails($tpl_thumbnails_var) {
7        global $template, $conf;
8       
9        $conf_pdf2tab = unserialize($conf['pdf2tab']);
10       
11        $template->set_prefilter('index_thumbnails', 'pdf2tab_add_tag_thumbnails');
12       
13        $template->assign('pdf2tab_supported_extensions', $conf_pdf2tab['extensions']);
14        $template->set_filename('pdf2tab_template_thumbnails', PDF2TAB_ABSOLUTE_PATH.'template/thumbnails.tpl');
15        $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_thumbnails', true));
16       
17        return $tpl_thumbnails_var;
18}
19
20function pdf2tab_add_tag_thumbnails($content, &$smarty) {
21        global $template;
22
23        $search = 'class="thumbnail"';
24       
25        $replacement = 'class="thumbnail" pdf2tab="{$thumbnail.path}"';
26        $content= str_replace($search, $replacement, $content);
27
28        return $content;
29}
30?>
Note: See TracBrowser for help on using the repository browser.