Esempio n. 1
0
File: yak.php Progetto: k1LoW/yak
 /**
  * afterLayout
  *
  * @return
  */
 function afterLayout()
 {
     parent::afterLayout();
     $view =& ClassRegistry::getObject('view');
     if ($this->emoji->isMobile()) {
         if ($this->emoji->isSjisCarrier()) {
             header("Content-type: application/xhtml+xml; charset=Shift_JIS");
         } else {
             header("Content-type: application/xhtml+xml; charset=UTF-8");
         }
     } else {
         header('Content-Type: text/html; charset=UTF-8');
     }
     if (isset($view->output)) {
         if (empty($this->data) || $this->emoji->isMobile()) {
             $view->output = $this->emoji->filter($view->output, array('DecToUtf8', 'HexToUtf8', 'output'));
         } else {
             // for PC form
             $outputArray = preg_split('/(value ?= ?[\'"][^"]+[\'"])|(<textarea[^>]+>[^<]+<\\/textarea>)/', $view->output, null, PREG_SPLIT_DELIM_CAPTURE);
             $output = '';
             foreach ($outputArray as $key => $value) {
                 if (!preg_match('/value ?= ?[\'"]([^"]+)[\'"]|<textarea[^>]+>([^<]+)<\\/textarea>/', $value)) {
                     $output .= $this->emoji->filter($value, array('DecToUtf8', 'HexToUtf8', 'output'));
                 } else {
                     $output .= $value;
                 }
             }
             $view->output = $output;
         }
     }
 }
Esempio n. 2
0
 /**
  * afterLayout
  *
  */
 function afterLayout()
 {
     parent::afterLayout();
     $view =& ClassRegistry::getObject('view');
     if (!$view) {
         return false;
     }
     $view->output = $view->output;
     if (empty($view->ctp)) {
         $view->ctp = array();
     }
     $tip = '';
     $style = 'position: fixed;
               border-bottom:1px solid #AAAAAA;
               background:-moz-linear-gradient(center top , #EFEFEF, #CACACA) repeat scroll 0 0 transparent;
               -moz-border-radius-bottomright:8px;
               -moz-border-radius-topright:8px;
               margin:0px; line-height:1.6em; padding:4px 4px;
               top:0px; left:0px; cursor:pointer;';
     $tip = "<div id='clickinit' style='" . $style . "'>" . $this->Html->image('../clickinit/img/clickinit.png') . "</div>";
     $tip .= '<script type="text/javascript">var clickinitInitUrl="' . Router::url('/') . 'clickinit/clickinit/init' . '";</script>';
     $tip .= $this->Html->script('../clickinit/js/clickinit.js');
     if (preg_match('#</body>#', $view->output)) {
         $view->output = preg_replace('#</body>#', $tip . "\n</body>", $view->output, 1);
     }
 }
 /**
  * Trigger
  */
 public function afterLayout()
 {
     if (Configure::read('debug') == 0) {
         $r = App::import('vendor', 'php_speedy');
         global $compressor;
         if ($compressor instanceof compressor) {
             $compressor->return_content = true;
             $this->view->output = $compressor->finish($this->view->output);
         }
         return parent::afterLayout();
     }
 }
 /**
  * After layout logic.
  *
  * @param string $layoutFile
  * @return void
  */
 public function afterLayout($layoutFile)
 {
     parent::afterLayout($layoutFile);
     $content = $this->_View->Blocks->get('content');
     // We only want to apply inline CSS to HTML emails, so first check if
     // the content is HTML before proceeding.
     if ($this->isHtml($content) === false) {
         return;
     }
     if (!isset($this->InlineCss)) {
         $this->InlineCss = new CssToInlineStyles();
     }
     // Convert inline style blocks to inline CSS on the HTML content.
     $this->InlineCss->setHTML($content);
     $this->InlineCss->setUseInlineStylesBlock(true);
     $content = $this->InlineCss->convert();
     $this->_View->Blocks->set('content', $content);
     return;
 }
Esempio n. 5
0
 /**
  * afterLayout
  *
  */
 function afterLayout()
 {
     parent::afterLayout();
     $view =& ClassRegistry::getObject('view');
     if (!$view) {
         return false;
     }
     $view->output = $view->output;
     if (empty($view->ctp)) {
         $view->ctp = array();
     }
     $viewPath = APP . 'views/';
     if ($view->theme) {
         $viewPath = APP . 'views/themed/' . $view->theme;
     }
     if ($view->params['plugin']) {
         $viewPath = APP . $view->params['plugin'] . '/views/';
     }
     // layout
     array_push($view->ctp, $viewPath . 'layouts/' . $view->layout . $view->ext);
     // view
     array_push($view->ctp, $viewPath . $view->params['controller'] . '/' . $view->params['action'] . $view->ext);
     $viewFiles = '<ul style="margin-left:15px;list-style-type:circle;color:#000000;"><li>' . implode("</li><li>", $view->ctp) . '</li></ul>';
     $tip = '';
     $style = 'position: fixed;
               border-bottom:1px solid #AAAAAA;
               background:-moz-linear-gradient(center top , #EFEFEF, #CACACA) repeat scroll 0 0 transparent;
               -moz-border-radius-bottomright:8px;
               -moz-border-radius-topright:8px;
               margin:0px; line-height:1.6em; padding:4px 4px;
               top:35px; left:0px; cursor:pointer;';
     $tip = "<div id='viewpath' style='" . $style . "'>" . $this->Html->image('../viewpath/img/viewpath.png') . "</div>";
     $tip .= "<div id='viewpathList' style='background-color: #FFFFFF;\n                                           font-size:14px;\n                                           display:none;\n                                           font-family: helvetica,arial,sans-serif;\n                                           padding: 5px;\n                                           border: 1px solid #AAAAAA;\n                                           position: fixed;\n                                           top:65px; left:0px;'>" . '<h2 style="font-size:16px;
                       font-family:\'Trebuchet MS\',trebuchet,helvetica,arial,sans-serif;
                       color:#5D1717;margin-bottom:5px;">' . 'View File Path' . '</h2>' . $viewFiles . "</div>";
     $tip .= $this->Html->script('../viewpath/js/list.js');
     if (preg_match('#</body>#', $view->output) && $viewFiles) {
         $view->output = preg_replace('#</body>#', $tip . "\n</body>", $view->output, 1);
     }
 }