thomascube
2009-07-13 a366a323b5d78f453b4988be576e6520957c9488
program/include/rcube_template.php
@@ -287,6 +287,11 @@
    public function send($templ = null, $exit = true)
    {
        if ($templ != 'iframe') {
            // prevent from endless loops
            if ($this->app->plugins->is_processing('render_page')) {
                raise_error(array('code' => 505, 'type' => 'php', 'message' => 'Recursion alert: ignoring output->send()'), true, false);
                return;
            }
            $this->parse($templ, false);
        }
        else {
@@ -294,6 +299,10 @@
            $this->write();
        }
        // set output asap
        ob_flush();
        flush();
        if ($exit) {
            exit;
        }
@@ -371,6 +380,9 @@
        // parse for specialtags
        $output = $this->parse_conditions($templ);
        $output = $this->parse_xml($output);
        // trigger generic hook where plugins can put additional content to the page
        $hook = $this->app->plugins->exec_hook("render_page", array('template' => $name, 'content' => $output));
        // add debug console
        if ($this->config['debug_level'] & 8) {
@@ -379,7 +391,8 @@
                <form action="/" name="debugform" style="display:inline"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:x-small" spellcheck="false"></textarea></form></div>'
            );
        }
        $output = $this->parse_with_globals($output);
        $output = $this->parse_with_globals($hook['content']);
        $this->write(trim($output));
        if ($exit) {
            exit;