/**
  * ページデータを取得する.
  *
  * @param integer $device_type_id 端末種別ID
  * @param integer $page_id ページID
  * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス
  * @return array ページデータの配列
  */
 function getTplMainpage($device_type_id, $page_id, &$objLayout)
 {
     $arrPageData = $objLayout->getPageProperties($device_type_id, $page_id);
     $objBlob = new SC_Helper_Blob_Ex();
     $containerName = $objBlob->getTemplateContainerName($device_type_id);
     $templatePath = $objLayout->getTemplatePath($device_type_id);
     $filename = $templatePath . $arrPageData[0]['filename'] . ".tpl";
     if ($objBlob->blobExists($containerName, $arrPageData[0]['filename'] . ".tpl")) {
         $arrPageData[0]['tpl_data'] = $objBlob->getBlobData($containerName, $arrPageData[0]['filename'] . ".tpl");
     }
     // ファイル名を画面表示用に加工しておく
     $arrPageData[0]['filename'] = preg_replace('|^' . preg_quote(USER_DIR) . '|', '', $arrPageData[0]['filename']);
     return $arrPageData[0];
 }
 /**
  * ブロックのテンプレートを取得する.
  *
  * @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];
 }