示例#1
0
 /**
  * ブロックファイルに応じて tpl_mainpage を設定する
  *
  * @param  string $bloc_file ブロックファイル名
  * @return void
  */
 public function setTplMainpage($bloc_file)
 {
     if (Utils::isAbsoluteRealPath($bloc_file)) {
         $this->tpl_mainpage = $bloc_file;
     } else {
         $this->tpl_mainpage = Application::alias('eccube.helper.page_layout')->getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file;
     }
     $this->setTemplate($this->tpl_mainpage);
 }
示例#2
0
 /**
  * ブロックの情報を取得.
  *
  * @param  integer $bloc_id ブロックID
  * @return array
  */
 public function getBloc($bloc_id)
 {
     $objQuery = Application::alias('eccube.query');
     $col = '*';
     $where = 'bloc_id = ? AND device_type_id = ?';
     $arrRet = $objQuery->getRow($col, 'dtb_bloc', $where, array($bloc_id, $this->device_type_id));
     if (Utils::isAbsoluteRealPath($arrRet['tpl_path'])) {
         $tpl_path = $arrRet['tpl_path'];
     } else {
         $tpl_path = Application::alias('eccube.helper.page_layout')->getTemplatePath($this->device_type_id) . BLOC_DIR . $arrRet['tpl_path'];
     }
     if (file_exists($tpl_path)) {
         $arrRet['bloc_html'] = file_get_contents($tpl_path);
     }
     return $arrRet;
 }