예제 #1
0
 /**
  * Process the template
  * @return boolean|string
  *
  * This function process the template. If $this->renderas is set, it
  * will produce a full page.
  */
 public function fetchPage()
 {
     $data = parent::fetchPage();
     if ($this->renderas) {
         $page = new OC_TemplateLayout($this->renderas, $this->app);
         // Add custom headers
         $page->assign('headers', $this->headers, false);
         foreach (OC_Util::$headers as $header) {
             $page->append('headers', $header);
         }
         $page->assign("content", $data, false);
         return $page->fetchPage();
     } else {
         return $data;
     }
 }
예제 #2
0
 /**
  * Process the template
  * @return boolean|string
  *
  * This function process the template. If $this->renderAs is set, it
  * will produce a full page.
  */
 public function fetchPage()
 {
     $data = parent::fetchPage();
     if ($this->renderAs) {
         $page = new OC_TemplateLayout($this->renderAs, $this->app);
         // Add custom headers
         $headers = '';
         foreach (OC_Util::$headers as $header) {
             $headers .= '<' . \OCP\Util::sanitizeHTML($header['tag']);
             foreach ($header['attributes'] as $name => $value) {
                 $headers .= ' ' . \OCP\Util::sanitizeHTML($name) . '="' . \OCP\Util::sanitizeHTML($value) . '"';
             }
             if ($header['text'] !== null) {
                 $headers .= '>' . \OCP\Util::sanitizeHTML($header['text']) . '</' . \OCP\Util::sanitizeHTML($header['tag']) . '>';
             } else {
                 $headers .= '/>';
             }
         }
         $page->assign('headers', $headers);
         $page->assign('content', $data);
         return $page->fetchPage();
     }
     return $data;
 }
예제 #3
0
 /**
  * @brief Proceeds the template
  * @return bool
  *
  * This function proceeds the template. If $this->renderas is set, it
  * will produce a full page.
  */
 public function fetchPage()
 {
     $data = $this->_fetch();
     if ($this->renderas) {
         $page = new OC_TemplateLayout($this->renderas);
         if ($this->renderas == 'user') {
             $page->assign('requesttoken', $this->vars['requesttoken']);
             $page->assign('requestlifespan', $this->vars['requestlifespan']);
         }
         // Add custom headers
         $page->assign('headers', $this->headers, false);
         foreach (OC_Util::$headers as $header) {
             $page->append('headers', $header);
         }
         $page->assign("content", $data, false);
         return $page->fetchPage();
     } else {
         return $data;
     }
 }