コード例 #1
0
ファイル: BlockController.php プロジェクト: jewelhuq/fraym
 /**
  * @param $block
  * @param $html
  * @param $xml simplexml object
  * @param bool $force true if to output block info on ajax request
  * @return mixed
  */
 public function addBlockInfo($block, $html, $xml, $force = false)
 {
     if ($this->user->isAdmin() === false) {
         return;
     }
     // do not add block info to ajax requests
     if ($this->request->isXmlHttpRequest() && $force === false) {
         return $html;
     }
     $renderTime = 0;
     if ($this->blockParser->getXMLAttr($xml, 'id')) {
         $renderTime = $this->core->stopTimer('blockExecution_' . $this->blockParser->getXMLAttr($xml, 'id'));
     }
     $this->view->assign('renderTime', $renderTime);
     $this->view->assign('type', $this->blockParser->getXMLAttr($xml, 'type'));
     $this->view->assign('id', $this->blockParser->getXMLAttr($xml, 'id'));
     $this->view->assign('block', $block);
     $this->view->assign('moudleName', $block ? $block->extension->name : '');
     $this->view->assign('content', $html);
     return $this->template->fetch('BlockInfo.tpl');
 }