Last change
on this file since 19811 was
19811,
checked in by julien1311, 11 years ago
|
add an admin page to choose the extension to handle
|
-
Property svn:eol-style set to
LF
|
File size:
910 bytes
|
Rev | Line | |
---|
[19673] | 1 | <?php |
---|
| 2 | add_event_handler('loc_end_index_thumbnails', 'pdf2tab_thumbnails'); |
---|
| 3 | |
---|
| 4 | load_language('plugin.lang', PDF2TAB_PATH); |
---|
| 5 | |
---|
| 6 | function pdf2tab_thumbnails($tpl_thumbnails_var) { |
---|
[19811] | 7 | global $template, $conf; |
---|
[19673] | 8 | |
---|
[19811] | 9 | $conf_pdf2tab = unserialize($conf['pdf2tab']); |
---|
| 10 | |
---|
[19673] | 11 | $template->set_prefilter('index_thumbnails', 'pdf2tab_add_tag_thumbnails'); |
---|
| 12 | |
---|
[19811] | 13 | $template->assign('pdf2tab_supported_extensions', $conf_pdf2tab['extensions']); |
---|
[19674] | 14 | $template->set_filename('pdf2tab_template_thumbnails', PDF2TAB_ABSOLUTE_PATH.'template/thumbnails.tpl'); |
---|
[19673] | 15 | $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_thumbnails', true)); |
---|
| 16 | |
---|
| 17 | return $tpl_thumbnails_var; |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | function 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.