Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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());
     }
 }
Exemplo n.º 3
0
 protected function _render($view)
 {
     $render = Wtk_Render::factory($view->document, $this->_wtkRender);
     return $render->render();
 }
Exemplo n.º 4
0
 function render()
 {
     $html = parent::render();
     $html = preg_replace("`([^\" ]+)@([^\" ]+)\\.([^\" ]+)`", "\$1@\$2.\$3", $html);
     return $html;
 }