source: extensions/pdf2tab/picture.php @ 19295

Revision 19295, 414 bytes checked in by julien1311, 7 years ago (diff)

manage picture.php
language files

  • Property svn:eol-style set to LF
Line 
1<?php
2add_event_handler('render_element_content','pdf2tab_add_tag_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2);
3
4function pdf2tab_add_tag_picture($content, $element_info) {
5        preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match);
6       
7        $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank">'.$match[0].'</a>',$content);
8       
9        return $content;
10}
11?>
Note: See TracBrowser for help on using the repository browser.