Changeset 19295 for extensions
- Timestamp:
- Dec 6, 2012, 12:15:39 AM (12 years ago)
- Location:
- extensions/pdf2tab
- Files:
-
- 11 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pdf2tab/picture.php
r19287 r19295 1 1 <?php 2 add_event_handler(' loc_after_page_header', 'pdf2tab_picture');2 add_event_handler('render_element_content','pdf2tab_add_tag_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2); 3 3 4 function pdf2tab_ picture() {5 global $template;4 function pdf2tab_add_tag_picture($content, $element_info) { 5 preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match); 6 6 7 $ template->set_prefilter('picture_content', 'pdf2tab_add_tag_picture');7 $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank">'.$match[0].'</a>',$content); 8 8 9 $template->set_filename('pdf2tab_template_picture', dirname(__FILE__).'/template/pdf2tab_picture.tpl');10 $template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_picture', true));11 }12 13 function pdf2tab_add_tag_picture($content, &$smarty) {14 global $template;15 16 $search = 'id="theMainImage"';17 18 $replacement = 'id="theMainImage" pdf2tab="{$thumbnail.path}"';19 $content= str_replace($search, $replacement, $content);20 21 9 return $content; 22 10 }
Note: See TracChangeset
for help on using the changeset viewer.