Changeset 19795


Ignore:
Timestamp:
2010/12/30 18:50:01 (12 years ago)
Author:
Seasoft
Message:

#825(ページクラスとテンプレートのファイル名を一致させる)
#748(モバイル/スマートフォンのデザイン管理機能)

  • 新規ブロックを登録できない不具合を改修
Location:
branches/version-2_5-dev
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/helper/SC_Helper_PageLayout.php

    r19777 r19795  
    139139                        $arrNavi[$key]['php_path'] = HTML_PATH . $val['php_path']; 
    140140                    } else { 
    141                         $arrNavi[$key]['tpl_path'] = $this->getTemplatePath($device_type_id) . $val['tpl_path']; 
     141                        $arrNavi[$key]['tpl_path'] = $this->getTemplatePath($device_type_id) . BLOC_DIR . $val['tpl_path']; 
    142142                    } 
    143143                    // phpから呼び出されるか、tplファイルが存在する場合 
  • branches/version-2_5-dev/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php

    r19768 r19795  
    8080            $bloc_id = $_REQUEST['bloc_id']; 
    8181        } else { 
    82             $bloc_id = 1; 
     82            $bloc_id = null; 
    8383        } 
    8484        $this->bloc_id = $bloc_id; 
     
    9393 
    9494        $this->objLayout = new SC_Helper_PageLayout_Ex(); 
    95         $package_path = $this->objLayout->getTemplatePath($device_type_id); 
     95        $package_path = $this->objLayout->getTemplatePath($device_type_id) . BLOC_DIR; 
    9696 
    9797        // ブロック一覧を取得 
     
    103103                                                array($bloc_id, $device_type_id)); 
    104104 
    105             $arrBlocData[0]['tpl_path'] = $this->objLayout->getTemplatePath($device_type_id) . $arrBlocData[0]['tpl_path']; 
     105            $tplPath = $package_path . $arrBlocData[0]['filename'] . '.tpl'; 
    106106 
    107107            // テンプレートファイルの読み込み 
    108             $arrBlocData[0]['tpl_data'] = file_get_contents($arrBlocData[0]['tpl_path']); 
     108            $arrBlocData[0]['tpl_data'] = file_get_contents($tplPath); 
    109109            $this->arrBlocData = $arrBlocData[0]; 
    110110        } 
     
    124124            // ディレクトリの作成 
    125125            SC_Utils::sfMakeDir($prev_path); 
    126             $fp = fopen($prev_path,"w"); 
    127             fwrite($fp, $_POST['bloc_html']); // FIXME いきなり POST はちょっと... 
    128             fclose($fp); 
     126            $res = file_put_contents($new_bloc_path, $_POST['bloc_html']); 
     127            if ($res === false) { 
     128                SC_Utils_Ex::sfDispException(); 
     129            } 
    129130 
    130131            // プレビューデータ表示 
     
    147148 
    148149                // 旧ファイルの削除 
    149                 $old_bloc_path = $package_path . $arrBlocData[0]['tpl_path']; 
    150                 if (file_exists($old_bloc_path)) { 
    151                     unlink($old_bloc_path); 
     150                if (file_exists($tplPath)) { 
     151                    unlink($tplPath); 
    152152                } 
    153153 
    154154                // ファイル作成 
    155                 $new_bloc_path = $package_path . BLOC_DIR . $_POST['filename'] . ".tpl"; 
     155                $new_bloc_path = $package_path . $_POST['filename'] . ".tpl"; 
    156156                // ディレクトリの作成 
    157157                SC_Utils::sfMakeDir($new_bloc_path); 
    158                 $fp = fopen($new_bloc_path,"w"); 
    159                 fwrite($fp, $_POST['bloc_html']); // FIXME いきなり POST はちょっと... 
    160                 fclose($fp); 
     158                $res = file_put_contents($new_bloc_path, $_POST['bloc_html']); 
     159                if ($res === false) { 
     160                    SC_Utils_Ex::sfDispException(); 
     161                } 
    161162 
    162163                $arrBlocData = $this->lfGetBlocData("filename = ? AND device_type_id = ?", 
     
    198199 
    199200                // ファイルの削除 
    200                 $del_file = $package_path . BLOC_DIR . $arrBlocData[0]['filename']. '.tpl'; 
    201                 if(file_exists($del_file)){ 
    202                     unlink($del_file); 
     201                if (file_exists($tplPath)) { 
     202                    unlink($tplPath); 
    203203                } 
    204204            } 
     
    254254        // 更新データ生成 
    255255        $arrUpdData = array("bloc_name" => $arrData['bloc_name'], 
    256                             "tpl_path" => BLOC_DIR . $arrData['filename'] . '.tpl', 
     256                            "tpl_path" => $arrData['filename'] . '.tpl', 
    257257                            "filename" => $arrData['filename']); 
    258258 
  • branches/version-2_5-dev/data/class/pages/rss/LC_Page_Rss_Products.php

    r19680 r19795  
    4444    function init() { 
    4545        parent::init(); 
    46         $this->tpl_mainpage = "rss/product.tpl"; 
     46        $this->tpl_mainpage = "rss/products.tpl"; 
    4747        $this->encode = "UTF-8"; 
    4848        $this->title = "商品一覧情報"; 
  • branches/version-2_5-dev/data/mtb_constants_init.php

    r19777 r19795  
    476476define('COMPILE_FTP_DIR', COMPILE_DIR . USER_DIR); 
    477477/** ブロックファイル保存先 */ 
    478 define('BLOC_DIR', "bloc/"); 
     478define('BLOC_DIR', "frontparts/bloc/"); 
    479479/** ブロックファイル保存先 */ 
    480480define('BLOC_PATH', TEMPLATE_DIR . BLOC_DIR); 
  • branches/version-2_5-dev/html/install/sql/insert_data.sql

    r19777 r19795  
    1 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 1, 'カテゴリ', 'bloc/category.tpl', 'category', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/category.php', 0); 
    2 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 2, '利用ガイド', 'bloc/guide.tpl', 'guide', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 0); 
    3 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 3, 'かごの中', 'bloc/cart.tpl', 'cart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/cart.php', 0); 
    4 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 4, '商品検索', 'bloc/search_products.tpl', 'search_products', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/search_products.php', 0); 
    5 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 5, '新着情報', 'bloc/news.tpl', 'news', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/news.php', 0); 
    6 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 6, 'ログイン', 'bloc/login.tpl', 'login', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/login.php', 0); 
    7 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 7, 'おすすめ商品', 'bloc/best5.tpl', 'best5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/best5.php', 0); 
    8 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 8, 'カレンダー', 'bloc/calendar.tpl', 'calendar', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/calendar.php', 0); 
    9 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 1, 'カテゴリ', 'bloc/category.tpl', 'category', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/category.php', 0); 
    10 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 2, '利用ガイド', 'bloc/guide.tpl', 'guide', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 0); 
    11 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 3, 'かごの中', 'bloc/cart.tpl', 'cart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/cart.php', 0); 
    12 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 4, '商品検索', 'bloc/search_products.tpl', 'search_products', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/search_products.php', 0); 
    13 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 5, '新着情報', 'bloc/news.tpl', 'news', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/news.php', 0); 
    14 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 6, 'ログイン', 'bloc/login.tpl', 'login', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/login.php', 0); 
    15 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 7, 'おすすめ商品', 'bloc/best5.tpl', 'best5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/best5.php', 0); 
    16 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 8, 'カレンダー', 'bloc/calendar.tpl', 'calendar', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/calendar.php', 0); 
    17 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 1, 'カテゴリ', 'bloc/category.tpl', 'category', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/category.php', 0); 
    18 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 2, '利用ガイド', 'bloc/guide.tpl', 'guide', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 0); 
    19 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 3, 'かごの中', 'bloc/cart.tpl', 'cart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/cart.php', 0); 
    20 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 4, '商品検索', 'bloc/search_products.tpl', 'search_products', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/search_products.php', 0); 
    21 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 5, '新着情報', 'bloc/news.tpl', 'news', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/news.php', 0); 
    22 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 6, 'ログイン', 'bloc/login.tpl', 'login', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/login.php', 0); 
    23 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 7, 'おすすめ商品', 'bloc/best5.tpl', 'best5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/best5.php', 0); 
    24 INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 8, 'カレンダー', 'bloc/calendar.tpl', 'calendar', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/calendar.php', 0); 
     1INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 1, 'カテゴリ', 'category.tpl', 'category', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/category.php', 0); 
     2INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 2, '利用ガイド', 'guide.tpl', 'guide', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 0); 
     3INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 3, 'かごの中', 'cart.tpl', 'cart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/cart.php', 0); 
     4INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 4, '商品検索', 'search_products.tpl', 'search_products', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/search_products.php', 0); 
     5INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 5, '新着情報', 'news.tpl', 'news', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/news.php', 0); 
     6INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 6, 'ログイン', 'login.tpl', 'login', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/login.php', 0); 
     7INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 7, 'おすすめ商品', 'best5.tpl', 'best5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/best5.php', 0); 
     8INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (10, 8, 'カレンダー', 'calendar.tpl', 'calendar', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/calendar.php', 0); 
     9INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 1, 'カテゴリ', 'category.tpl', 'category', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/category.php', 0); 
     10INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 2, '利用ガイド', 'guide.tpl', 'guide', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 0); 
     11INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 3, 'かごの中', 'cart.tpl', 'cart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/cart.php', 0); 
     12INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 4, '商品検索', 'search_products.tpl', 'search_products', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/search_products.php', 0); 
     13INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 5, '新着情報', 'news.tpl', 'news', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/news.php', 0); 
     14INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 6, 'ログイン', 'login.tpl', 'login', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/login.php', 0); 
     15INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 7, 'おすすめ商品', 'best5.tpl', 'best5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/best5.php', 0); 
     16INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (1, 8, 'カレンダー', 'calendar.tpl', 'calendar', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/calendar.php', 0); 
     17INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 1, 'カテゴリ', 'category.tpl', 'category', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/category.php', 0); 
     18INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 2, '利用ガイド', 'guide.tpl', 'guide', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 0); 
     19INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 3, 'かごの中', 'cart.tpl', 'cart', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/cart.php', 0); 
     20INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 4, '商品検索', 'search_products.tpl', 'search_products', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/search_products.php', 0); 
     21INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 5, '新着情報', 'news.tpl', 'news', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/news.php', 0); 
     22INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 6, 'ログイン', 'login.tpl', 'login', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/login.php', 0); 
     23INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 7, 'おすすめ商品', 'best5.tpl', 'best5', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/best5.php', 0); 
     24INSERT INTO dtb_bloc (device_type_id, bloc_id, bloc_name, tpl_path, filename, create_date, update_date, php_path, deletable_flg) VALUES (2, 8, 'カレンダー', 'calendar.tpl', 'calendar', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'frontparts/bloc/calendar.php', 0); 
    2525 
    2626INSERT INTO dtb_blocposition (device_type_id, page_id, target_id, bloc_id, bloc_row, anywhere) VALUES (10, 1, 1, 1, 2, 0); 
     
    12661266INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('TEMPLATE_FTP_DIR', 'USER_PATH . USER_PACKAGE_DIR . TEMPLATE_NAME . "/"', 309, 'SMARTYテンプレート(FTP許可)'); 
    12671267INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('COMPILE_FTP_DIR', 'COMPILE_DIR . USER_DIR', 310, 'SMARTYコンパイル(FTP許可)'); 
    1268 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('BLOC_DIR', '"bloc/"', 311, 'ブロックファイル保存先'); 
     1268INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('BLOC_DIR', '"frontparts/bloc/"', 311, 'ブロックファイル保存先'); 
    12691269INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('MOBILE_TEMPLATE_DIR', 'SMARTY_TEMPLATES_DIR . MOBILE_TEMPLATE_NAME . "/"', 312, 'SMARTYテンプレート(mobile)'); 
    12701270INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('MOBILE_COMPILE_DIR', 'DATA_PATH . "Smarty/templates_c/" . MOBILE_TEMPLATE_NAME . "/"', 313, 'SMARTYコンパイル(mobile)'); 
Note: See TracChangeset for help on using the changeset viewer.