source: extensions/File_Uploader/plugin_pdf2tab/include/thumbnails.inc.php @ 19675

Revision 19675, 897 bytes checked in by julien1311, 7 years ago (diff)

add pdf2tab plugin

  • Property svn:eol-style set to LF
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;
8        include_once('constants.inc.php');
9       
10        $template->set_prefilter('index_thumbnails', 'pdf2tab_add_tag_thumbnails');
11       
12        $template->assign('pdf2tab_supported_extensions', $supported_extensions);
13        $template->set_filename('pdf2tab_template_thumbnails', FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH.'template/thumbnails.tpl');
14        $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_thumbnails', true));
15       
16        return $tpl_thumbnails_var;
17}
18
19function pdf2tab_add_tag_thumbnails($content, &$smarty) {
20        global $template;
21
22        $search = 'class="thumbnail"';
23       
24        $replacement = 'class="thumbnail" pdf2tab="{$thumbnail.path}"';
25        $content= str_replace($search, $replacement, $content);
26
27        return $content;
28}
29?>
Note: See TracBrowser for help on using the repository browser.