Ignore:
Timestamp:
2011/04/18 01:23:08 (13 years ago)
Author:
nanasess
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
Message:

#972 (リファクタリング開発:[管理画面]デザイン管理)

  • ブロック設定
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  
    6868     * Page のアクション. 
    6969     * 
    70      * FIXME テンプレートパスの取得方法を要修正 
    71      * 
    7270     * @return void 
    7371     */ 
     
    7573        $objFormParam = new SC_FormParam_Ex(); 
    7674        $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 
    7980        $bloc_id = $objFormParam->getValue('bloc_id'); 
    8081        $this->bloc_id = $bloc_id; 
    8182 
    82         // 端末種別IDを取得 
    83         $device_type_id = $objFormParam->getValue('device_type_id'); 
    84  
     83        $device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); 
    8584        $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         } 
    11685 
    11786        switch($this->getMode()) { 
     
    131100 
    132101                // ファイル作成 
     102                $package_path = $this->objLayout->getTemplatePath($device_type_id) . BLOC_DIR; 
    133103                $new_bloc_path = $package_path . $_POST['filename'] . ".tpl"; 
    134104                // ディレクトリの作成 
     
    179149            break; 
    180150        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            } 
    183155        } 
    184156        $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(); 
    185172    } 
    186173 
     
    198185     * 
    199186     * @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) { 
    204190        $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]; 
    208216    } 
    209217 
Note: See TracChangeset for help on using the changeset viewer.