Changeset 798764c in github


Ignore:
Timestamp:
Feb 18, 2011 4:54:19 AM (2 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
2b3a8e8
Parents:
4d982d3
Message:

Add plugin hook before the final HTML content of a page is sent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_html_page.php

    rba3377f r798764c  
    267267        } 
    268268 
    269             $this->base_path = $base_path; 
     269        $this->base_path = $base_path; 
    270270 
    271271        // correct absolute paths in images and other tags 
    272             // add timestamp to .js and .css filename 
     272        // add timestamp to .js and .css filename 
    273273        $output = preg_replace_callback( 
    274274            '!(src|href|background)=(["\']?)([a-z0-9/_.-]+)(["\'\s>])!i', 
    275                 array($this, 'file_callback'), $output); 
     275            array($this, 'file_callback'), $output); 
    276276        $output = str_replace('$__skin_path', $base_path, $output); 
    277277 
    278         if ($this->charset != RCMAIL_CHARSET) 
    279                 echo rcube_charset_convert($output, RCMAIL_CHARSET, $this->charset); 
    280             else 
    281                 echo $output; 
     278        // trigger hook with final HTML content to be sent 
     279        $hook = rcmail::get_instance()->plugins->exec_hook("send_page", array('content' => $output)); 
     280        if (!$hook['abort']) { 
     281            if ($this->charset != RCMAIL_CHARSET) 
     282                echo rcube_charset_convert($hook['content'], RCMAIL_CHARSET, $this->charset); 
     283            else 
     284                echo $hook['content']; 
     285        } 
    282286    } 
    283287     
Note: See TracChangeset for help on using the changeset viewer.