function findCss($components, $basedir, $baseurl) { $files = array(); $media = array(null, 'all', 'screen', 'print', 'handheld'); $f = Wtk_Render::factory(null, 'Html5'); foreach ($components as $comp) { foreach ($media as $medium) { $css = $f->template . '/' . $comp; if ($medium) { $css .= '.' . $medium; } $css .= '.css'; if (!file_exists($basedir . $css)) { continue; } $files[] = array('file' => $basedir . $css, 'url' => $baseurl . $css, 'medium' => $medium); } } return $files; }
function send() { $this->render(); $local = getenv('STRASS_MODE') == 'devel'; if ($local) { $this->_recipients = array(); $this->_to = array(); $this->_headers['To'] = array(); $this->_headers['Bcc'] = array(); } $config = Zend_Registry::get('config'); if (!$config->system->mail->enable) { return true; } $r = Wtk_Render::factory($this->_doc, 'Txt'); $this->setBodyText($r->render()); $r = Wtk_Render::factory($this->_doc, 'Html5'); $this->setBodyHTML($r->render()); // assure que le courriel est bien envoyé à l'admin, // pour archivage. if (!isset($this->_recipients[$config->system->admin])) { if (empty($this->_to)) { $this->addTo($config->system->admin, $config->system->short_title); } else { $this->addBcc($config->system->admin, $config->system->short_title); } } // assure l'existence d'un expéditeur, par défaut le config. if (!isset($this->_headers['From'])) { $this->setFrom($config->system->admin, $config->system->short_title); } $smtp = $local ? null : $config->system->mail->smtp; if ($smtp) { return parent::send(new Zend_Mail_Transport_Smtp($smtp)); } else { return parent::send(new Zend_Mail_Transport_Sendmail()); } }
protected function _render($view) { $render = Wtk_Render::factory($view->document, $this->_wtkRender); return $render->render(); }
function render() { $html = parent::render(); $html = preg_replace("`([^\" ]+)@([^\" ]+)\\.([^\" ]+)`", "\$1@\$2.\$3", $html); return $html; }