Changeset 20853 for branches/version-2_11-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php
- Timestamp:
- 2011/04/18 01:23:08 (13 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_11-dev:20852
- bzr:committer:
- Kentaro Ohkouchi <nanasess@fsm.ne.jp>
- bzr:file-ids:
data/Smarty/templates/admin/design/bloc.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fdesign%2Fbloc.tpl
data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php 15687@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fdesign%2FLC_Page_Admin_Design_Bloc.php- bzr:mapping-version:
- v4
- bzr:merge:
nanasess@fsm.ne.jp-20110417162230-n4313fa03qat7gb8- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- nanasess@fsm.ne.jp-20110417162304-sgwwjhys56bgj43r
- bzr:revno:
- 3564
- bzr:revprop:branch-nick:
- branches/version-2_11-dev
- bzr:root:
- branches/version-2_11-dev
- bzr:text-revisions:
data/Smarty/templates/admin/design/bloc.tpl nanasess@fsm.ne.jp-20110417162230-n4313fa03qat7gb8
data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php nanasess@fsm.ne.jp-20110417162230-n4313fa03qat7gb8- bzr:timestamp:
- 2011-04-18 01:23:04.625999928 +0900
- bzr:user-agent:
- bzr2.2.2+bzr-svn1.0.4
- svn:original-date:
- 2011-04-17T16:23:04.626000Z
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php
r20841 r20853 68 68 * Page のアクション. 69 69 * 70 * FIXME テンプレートパスの取得方法を要修正71 *72 70 * @return void 73 71 */ … … 75 73 $objFormParam = new SC_FormParam_Ex(); 76 74 $this->lfInitParam($objFormParam, $_REQUEST); 77 78 // ページIDを取得 75 $objFormParam->setParam($_REQUEST); 76 $objFormParam->convParam(); 77 $this->arrErr = $objFormParam->checkError(); 78 $is_error = (!SC_Utils_Ex::isBlank($this->arrErr)); 79 79 80 $bloc_id = $objFormParam->getValue('bloc_id'); 80 81 $this->bloc_id = $bloc_id; 81 82 82 // 端末種別IDを取得 83 $device_type_id = $objFormParam->getValue('device_type_id'); 84 83 $device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); 85 84 $this->objLayout = new SC_Helper_PageLayout_Ex(); 86 $package_path = $this->objLayout->getTemplatePath($device_type_id) . BLOC_DIR;87 88 //サブタイトルの追加89 $this->tpl_subtitle .= ' - ' . $this->arrDeviceType[$device_type_id];90 91 // ブロック一覧を取得92 $this->arrBlocList = $this->lfGetBlocData($device_type_id);93 94 // bloc_id が指定されている場合にはブロックデータの取得95 if ($bloc_id != '') {96 $arrBlocData = $this->lfGetBlocData($device_type_id, "bloc_id = ?",97 array($bloc_id));98 99 $bloc_file = $arrBlocData[0]['tpl_path'];100 if (SC_Utils_Ex::isAbsoluteRealPath($bloc_file)) {101 $tplPath = $bloc_file;102 } else {103 $tplPath = SC_Helper_PageLayout_Ex::getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file;104 }105 106 // テンプレートファイルの読み込み107 $arrBlocData[0]['tpl_data'] = file_get_contents($tplPath);108 $this->arrBlocData = $arrBlocData[0];109 }110 111 // メッセージ表示112 if (isset($_GET['msg']) && $_GET['msg'] == 'on') {113 // 完了メッセージ114 $this->tpl_onload="alert('登録が完了しました。');";115 }116 85 117 86 switch($this->getMode()) { … … 131 100 132 101 // ファイル作成 102 $package_path = $this->objLayout->getTemplatePath($device_type_id) . BLOC_DIR; 133 103 $new_bloc_path = $package_path . $_POST['filename'] . ".tpl"; 134 104 // ディレクトリの作成 … … 179 149 break; 180 150 default: 181 GC_Utils_Ex::gfPrintLog("MODEエラー:".$this->getMode()); 182 break; 151 if (isset($_GET['msg']) && $_GET['msg'] == 'on') { 152 // 完了メッセージ 153 $this->tpl_onload="alert('登録が完了しました。');"; 154 } 183 155 } 184 156 $this->device_type_id = $device_type_id; 157 158 if (!$is_error) { 159 // ブロック一覧を取得 160 $this->arrBlocList = $this->objLayout->getBlocs($device_type_id); 161 // bloc_id が指定されている場合にはブロックデータの取得 162 if (!SC_Utils_Ex::isBlank($this->bloc_id)) { 163 $arrBloc = $this->getBlocTemplate($this->device_type_id, $this->bloc_id, $this->objLayout); 164 $objFormParam->setParam($arrBloc); 165 } 166 } else { 167 // 画面にエラー表示しないため, ログ出力 168 GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); 169 } 170 $this->tpl_subtitle .= ' - ' . $this->arrDeviceType[$this->device_type_id]; 171 $this->arrForm = $objFormParam->getFormParamList(); 185 172 } 186 173 … … 198 185 * 199 186 * @param object $objFormParam SC_FormParamインスタンス 200 * @param array $arrPost $_POSTデータ 201 * @return void 202 */ 203 function lfInitParam(&$objFormParam, $arrPost) { 187 * @return void 188 */ 189 function lfInitParam(&$objFormParam) { 204 190 $objFormParam->addParam("ブロックID", "bloc_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK")); 205 $objFormParam->addParam("端末種別ID", "device_type_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"), DEVICE_TYPE_PC); 206 $objFormParam->setParam($arrPost); 207 $objFormParam->convParam(); 191 $objFormParam->addParam("端末種別ID", "device_type_id", INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK")); 192 $objFormParam->addParam("ブロック名", "bloc_name", STEXT_LEN, 'KVa', array("SPTAB_CHECK", "MAX_LENGTH_CHECK")); 193 $objFormParam->addParam("ファイル名", "filename", STEXT_LEN, 'a', array("SPTAB_CHECK", "MAX_LENGTH_CHECK")); 194 $objFormParam->addParam("ブロックデータ", "bloc_html"); 195 } 196 197 /** 198 * ブロックのテンプレートを取得する. 199 * 200 * @param integer $device_type_id 端末種別ID 201 * @param integer $bloc_id ブロックID 202 * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス 203 * @return array ブロック情報の配列 204 */ 205 function getBlocTemplate($device_type_id, $bloc_id, &$objLayout) { 206 $arrBloc = $objLayout->getBlocs($device_type_id, 'bloc_id = ?', array($bloc_id)); 207 if (SC_Utils_Ex::isAbsoluteRealPath($arrBloc[0]['tpl_path'])) { 208 $tpl_path = $arrBloc[0]['tpl_path']; 209 } else { 210 $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id) . BLOC_DIR . $arrBloc[0]['tpl_path']; 211 } 212 if (file_exists($tpl_path)) { 213 $arrBloc[0]['bloc_html'] = file_get_contents($tpl_path); 214 } 215 return $arrBloc[0]; 208 216 } 209 217
Note: See TracChangeset
for help on using the changeset viewer.