- Timestamp:
- 2013/05/02 18:11:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_PageLayout.php
r22610 r22796 29 29 * @version $Id:SC_Helper_PageLayout.php 15532 2007-08-31 14:39:46Z nanasess $ 30 30 */ 31 class SC_Helper_PageLayout 32 { 31 class SC_Helper_PageLayout { 33 32 34 33 // }}} … … 48 47 * @return void 49 48 */ 50 function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_type_id = DEVICE_TYPE_PC) 51 { 49 function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_type_id = DEVICE_TYPE_PC) { 52 50 53 51 // URLを元にページ情報を取得 … … 89 87 . 'tpl_path: ' . $arrBloc['tpl_path'] . "\n" 90 88 . 'php_path: ' . $arrBloc['php_path']; 91 trigger_error($error, E_USER_WARNING);89 GC_Utils_Ex::gfPrintLog($error); 92 90 } 93 91 } … … 111 109 * @return array ページ属性の配列 112 110 */ 113 function getPageProperties($device_type_id = DEVICE_TYPE_PC, $page_id = null, $where = '', $arrParams = array()) 114 { 111 function getPageProperties($device_type_id = DEVICE_TYPE_PC, $page_id = null, $where = '', $arrParams = array()) { 115 112 $objQuery =& SC_Query_Ex::getSingletonInstance(); 116 113 $where = 'device_type_id = ? ' . (SC_Utils_Ex::isBlank($where) ? $where : 'AND ' . $where); … … 136 133 * @return array ブロック情報の配列 137 134 */ 138 function getBlocs($device_type_id = DEVICE_TYPE_PC, $where = '', $arrParams = array(), $has_realpath = true) 139 { 140 $objBloc = new SC_Helper_Bloc_Ex($device_type_id); 141 $arrBlocs = $objBloc->getWhere($where, $arrParams); 135 function getBlocs($device_type_id = DEVICE_TYPE_PC, $where = '', $arrParams = array(), $has_realpath = true) { 136 $objQuery =& SC_Query_Ex::getSingletonInstance(); 137 $where = 'device_type_id = ? ' . (SC_Utils_Ex::isBlank($where) ? $where : 'AND ' . $where); 138 $arrParams = array_merge(array($device_type_id), $arrParams); 139 $objQuery->setOrder('bloc_id'); 140 $arrBlocs = $objQuery->select('*', 'dtb_bloc', $where, $arrParams); 142 141 if ($has_realpath) { 143 142 $this->setBlocPathTo($device_type_id, $arrBlocs); … … 155 154 * @return array 配置情報を含めたブロックの配列 156 155 */ 157 function getBlocPositions($device_type_id, $page_id, $has_realpath = true) 158 { 156 function getBlocPositions($device_type_id, $page_id, $has_realpath = true) { 159 157 $objQuery =& SC_Query_Ex::getSingletonInstance(); 160 158 $table = <<< __EOF__ … … 170 168 $this->setBlocPathTo($device_type_id, $arrBlocs); 171 169 } 172 173 //全ページ設定と各ページのブロックの重複を削除174 foreach ($arrBlocs as $index => $arrBloc) {175 if($arrBloc['anywhere'] == 1){176 $arrUniqBlocIds[] = $arrBloc['bloc_id'];177 }178 }179 foreach ($arrBlocs as $bloc_index => $arrBlocData) {180 if(in_array($arrBlocData['bloc_id'], $arrUniqBlocIds) && $arrBlocData['anywhere'] == 0){181 unset($arrBlocs[$bloc_index]);182 }183 }184 170 return $arrBlocs; 185 171 } … … 195 181 * @return integer 削除数 196 182 */ 197 function lfDelPageData($page_id, $device_type_id = DEVICE_TYPE_PC) 198 { 183 function lfDelPageData($page_id, $device_type_id = DEVICE_TYPE_PC) { 199 184 $objQuery =& SC_Query_Ex::getSingletonInstance(); 200 185 // page_id が空でない場合にはdeleteを実行 … … 218 203 * @return void // TODO boolean にするべき? 219 204 */ 220 function lfDelFile($filename, $device_type_id) 221 { 205 function lfDelFile($filename, $device_type_id) { 222 206 $objQuery =& SC_Query_Ex::getSingletonInstance(); 223 207 … … 251 235 * @return 編集可能ページの場合 true 252 236 */ 253 function isEditablePage($device_type_id, $page_id) 254 { 237 function isEditablePage($device_type_id, $page_id) { 255 238 if ($page_id == 0) { 256 239 return false; … … 271 254 * @return string テンプレートのパス 272 255 */ 273 function getTemplatePath($device_type_id = DEVICE_TYPE_PC, $isUser = false) 274 { 256 function getTemplatePath($device_type_id = DEVICE_TYPE_PC, $isUser = false) { 275 257 $templateName = ''; 276 258 switch ($device_type_id) { … … 309 291 * @return string 端末に応じた DocumentRoot から user_data までのパス 310 292 */ 311 function getUserDir($device_type_id = DEVICE_TYPE_PC, $hasPackage = false) 312 { 293 function getUserDir($device_type_id = DEVICE_TYPE_PC, $hasPackage = false) { 313 294 switch ($device_type_id) { 314 295 case DEVICE_TYPE_MOBILE: … … 342 323 * @return void 343 324 */ 344 function setBlocPathTo($device_type_id = DEVICE_TYPE_PC, &$arrBlocs = array()) 345 { 325 function setBlocPathTo($device_type_id = DEVICE_TYPE_PC, &$arrBlocs = array()) { 346 326 foreach ($arrBlocs as $key => $value) { 347 327 $arrBloc =& $arrBlocs[$key]; … … 359 339 * @return integer $col_num カラム数 360 340 */ 361 function getColumnNum($arrPageLayout) 362 { 341 function getColumnNum($arrPageLayout) { 363 342 // メインは確定 364 343 $col_num = 1;
Note: See TracChangeset
for help on using the changeset viewer.
