Last change
on this file since 19310 was
19310,
checked in by julien1311, 11 years ago
|
version auto
|
-
Property svn:eol-style set to
LF
|
File size:
474 bytes
|
Line | |
---|
1 | <?php |
---|
2 | add_event_handler('render_element_content','pdf2tab_add_tag_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2); |
---|
3 | |
---|
4 | function pdf2tab_add_tag_picture($content, $element_info) { |
---|
5 | if (strrchr($element_info['file'], ".") == ".pdf") { |
---|
6 | preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match); |
---|
7 | |
---|
8 | $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank">'.$match[0].'</a>',$content); |
---|
9 | } |
---|
10 | |
---|
11 | return $content; |
---|
12 | } |
---|
13 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.