/**
  * ブロックファイルに応じて tpl_mainpage を設定する
  *
  * @param  string $bloc_file ブロックファイル名
  * @return void
  */
 public function setTplMainpage($bloc_file)
 {
     if (SC_Utils_Ex::isAbsoluteRealPath($bloc_file)) {
         $this->tpl_mainpage = $bloc_file;
     } else {
         $this->tpl_mainpage = SC_Helper_PageLayout_Ex::getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file;
     }
     $this->setTemplate($this->tpl_mainpage);
 }
Пример #2
0
 /**
  * ブロックファイルに応じて tpl_mainpage を設定する
  *
  * @param string $bloc_file ブロックファイル名
  * @return void
  */
 function setTplMainpage($bloc_file)
 {
     if (SC_Utils_Ex::isAbsoluteRealPath($bloc_file)) {
         $this->tpl_mainpage = $bloc_file;
     } else {
         $this->tpl_mainpage = SC_Helper_PageLayout_Ex::getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file;
     }
     $this->setTemplate($this->tpl_mainpage);
     $debug_message = "block:" . $this->tpl_mainpage . "\n";
     GC_Utils_Ex::gfDebugLog($debug_message);
 }
 /**
  * ブロックのテンプレートを取得する.
  *
  * @param integer $device_type_id 端末種別ID
  * @param integer $bloc_id ブロックID
  * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス
  * @return array ブロック情報の配列
  */
 function getBlocTemplate($device_type_id, $bloc_id, &$objLayout)
 {
     $arrBloc = $objLayout->getBlocs($device_type_id, 'bloc_id = ?', array($bloc_id));
     if (SC_Utils_Ex::isAbsoluteRealPath($arrBloc[0]['tpl_path'])) {
         $tpl_path = $arrBloc[0]['tpl_path'];
     } else {
         $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id) . BLOC_DIR . $arrBloc[0]['tpl_path'];
     }
     $objBlob = new SC_Helper_Blob_Ex();
     $containerName = $objBlob->getTemplateContainerName($device_type_id);
     if ($objBlob->blobExists($containerName, $arrBloc[0]['filename'] . ".tpl")) {
         $arrBloc[0]['bloc_html'] = $objBlob->getBlobData($containerName, BLOC_DIR . $arrBloc[0]['filename'] . ".tpl");
     }
     return $arrBloc[0];
 }
 /**
  * ブロックの情報を取得.
  *
  * @param  integer $bloc_id ブロックID
  * @return array
  */
 public function getBloc($bloc_id)
 {
     $objQuery =& SC_Query_Ex::getSingletonInstance();
     $col = '*';
     $where = 'bloc_id = ? AND device_type_id = ?';
     $arrRet = $objQuery->getRow($col, 'dtb_bloc', $where, array($bloc_id, $this->device_type_id));
     if (SC_Utils_Ex::isAbsoluteRealPath($arrRet['tpl_path'])) {
         $tpl_path = $arrRet['tpl_path'];
     } else {
         $tpl_path = SC_Helper_PageLayout_Ex::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;
 }
 /**
  * ブロックのテンプレートを取得する.
  *
  * @param integer $device_type_id 端末種別ID
  * @param integer $bloc_id ブロックID
  * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス
  * @return array ブロック情報の配列
  */
 function getBlocTemplate($device_type_id, $bloc_id, &$objLayout)
 {
     $arrBloc = $objLayout->getBlocs($device_type_id, 'bloc_id = ?', array($bloc_id));
     if (SC_Utils_Ex::isAbsoluteRealPath($arrBloc[0]['tpl_path'])) {
         $tpl_path = $arrBloc[0]['tpl_path'];
     } else {
         $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id) . BLOC_DIR . $arrBloc[0]['tpl_path'];
     }
     if (file_exists($tpl_path)) {
         $arrBloc[0]['bloc_html'] = file_get_contents($tpl_path);
     }
     return $arrBloc[0];
 }