Changeset 17673


Ignore:
Timestamp:
2008/11/01 14:02:54 (15 years ago)
Author:
Seasoft
Message:

merge 17635,17636,17638,17646,17647,17648,17649

Location:
branches/comu-ver2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/frontparts/form_personal_input.tpl

    r17575 r17673  
    127127    <div class="attention"><!--{$arrErr[$key1]}--><!--{$arrErr[$key2]}--></div> 
    128128    <!--{/if}--> 
    129     <input type="text" name="<!--{$key1}-->" value="<!--{$arrForm[$key1]}-->" style="<!--{$arrErr[$key1]|sfGetErrorColor}-->; ime-mode: disabled;" maxlength="<!--{$smarty.const.MTEXT_LEN}-->" size="40" class="box300" /><br /> 
     129    <input type="text" name="<!--{$key1}-->" value="<!--{$arrForm[$key1]|escape}-->" style="<!--{$arrErr[$key1]|sfGetErrorColor}-->; ime-mode: disabled;" maxlength="<!--{$smarty.const.MTEXT_LEN}-->" size="40" class="box300" /><br /> 
    130130    <input type="text" name="<!--{$key2}-->" value="<!--{$arrForm[$key2]|default:$arrForm[$key1]|escape}-->" style="<!--{$arrErr[$key1]|sfGetErrorColor}-->; ime-mode: disabled;" maxlength="<!--{$smarty.const.MTEXT_LEN}-->" size="40" class="box300" /><br /> 
    131131    <p class="mini"><em>確認のため2度入力してください。</em></p> 
     
    185185    <div class="attention"><!--{$arrErr.password}--><!--{$arrErr.password02}--></div> 
    186186    <!--{/if}--> 
    187     <input type="password" name="password" value="<!--{$arrForm.password}-->" maxlength="<!--{$smarty.const.PASSWORD_LEN2}-->" style="<!--{$arrErr.password|sfGetErrorColor}-->" size="15" class="box120" /> 
     187    <input type="password" name="password" value="<!--{$arrForm.password|escape}-->" maxlength="<!--{$smarty.const.PASSWORD_LEN2}-->" style="<!--{$arrErr.password|sfGetErrorColor}-->" size="15" class="box120" /> 
    188188    <p><em>半角英数字4~10文字でお願いします。(記号不可)</em></p> 
    189     <input type="password" name="password02" value="<!--{$arrForm.password02}-->" maxlength="<!--{$smarty.const.PASSWORD_LEN2}-->" style="<!--{$arrErr.password02|sfGetErrorColor}-->" size="15" class="box120" /> 
     189    <input type="password" name="password02" value="<!--{$arrForm.password02|escape}-->" maxlength="<!--{$smarty.const.PASSWORD_LEN2}-->" style="<!--{$arrErr.password02|sfGetErrorColor}-->" size="15" class="box120" /> 
    190190    <p><em>確認のために2度入力してください。</em></p> 
    191191  </td> 
     
    203203    </select> 
    204204    <br /> 
    205     答え:<input type="text" name="reminder_answer" value="<!--{$arrForm.reminder_answer}-->" style="<!--{$arrErr.reminder_answer|sfGetErrorColor}-->; ime-mode: active;" size="40" class="box260" /> 
     205    答え:<input type="text" name="reminder_answer" value="<!--{$arrForm.reminder_answer|escape}-->" style="<!--{$arrErr.reminder_answer|sfGetErrorColor}-->; ime-mode: active;" size="40" class="box260" /> 
    206206  </td> 
    207207</tr> 
  • branches/comu-ver2/data/Smarty/templates/default/list.tpl

    r17610 r17673  
    5353<div id="undercolumn" class="product product_list"> 
    5454    <form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|escape}-->"> 
    55         <input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->" /> 
     55        <input type="hidden" name="pageno" value="<!--{$tpl_pageno|escape}-->" /> 
    5656        <input type="hidden" name="mode" value="" /> 
    57         <input type="hidden" name="orderby" value="<!--{$orderby}-->" /> 
     57        <input type="hidden" name="orderby" value="<!--{$orderby|escape}-->" /> 
    5858        <input type="hidden" name="product_id" value="" /> 
    5959         
  • branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php

    r17672 r17673  
    6969        $this->arrErr  = array(); 
    7070        $this->arrForm = array(); 
    71         $this->tpl_select = DEFAULT_TEMPLATE_NAME; 
     71        $this->tpl_select = TEMPLATE_NAME; 
    7272        ini_set("max_execution_time", 300); 
    7373    } 
     
    117117            // common.cssの内容を更新 
    118118            $this->lfChangeCommonCss($template_code); 
    119  
     119             
     120            // テンプレートのコピー 
     121            $this->lfCopyTemplate($template_code); 
     122             
    120123            // ブロック位置を更新 
    121124            $this->lfChangeBloc($template_code); 
     
    139142            //現在使用中のテンプレートとデフォルトのテンプレートは削除できないようにする 
    140143            $template_code = $objForm->getValue('template_code_temp'); 
    141             if ($template_code == DEFAULT_TEMPLATE_NAME || $template_code == 'default') { 
     144            if ($template_code == TEMPLATE_NAME || $template_code == DEFAULT_TEMPLATE_NAME) { 
    142145                $this->tpl_onload = "alert('選択中のテンプレートは削除出来ません');"; 
    143146                break; 
     
    173176        // defaultパラメータのセット 
    174177        $this->templates = $this->lfGetAllTemplates(); 
    175         $this->now_template = DEFAULT_TEMPLATE_NAME; 
    176  
     178        $this->now_template = TEMPLATE_NAME; 
    177179        // 画面の表示 
    178180        $objView->assignobj($this); 
     
    232234        $objQuery = new SC_Query(); 
    233235        $sqlval['name'] = "\"" . $template_code . "\""; 
    234         $objQuery->update("mtb_constants", $sqlval, "id = ?", array('DEFAULT_TEMPLATE_NAME')); 
     236        $objQuery->update("mtb_constants", $sqlval, "id = ?", array('TEMPLATE_NAME')); 
    235237        // キャッシュを生成 
    236238        $masterData = new SC_DB_MasterData_Ex(); 
     
    311313        return $arrRet; 
    312314    } 
     315     
     316    /** 
     317     * テンプレート変更時に既に存在するキャンペーンのテンプレートがない場合はテンプレートを生成する 
     318     * 
     319     */ 
     320    function lfCopyTemplate($template_code){ 
     321        //すべてのキャンペーンのテンプレートファイルを確認 
     322        $objQuery = new SC_Query(); 
     323        $sql = "SELECT directory_name,cart_flg FROM dtb_campaign WHERE del_flg = 0"; 
     324        $result = $objQuery->getall( $sql ); 
     325        //デザインテンプレートディレクトリにファイルが存在するか確認 
     326        foreach( $result as $key => $val ){ 
     327            //index.phpが存在すればキャンペーンのテンプレートがあると判定 
     328            //全部チェックした方がいいか? 
     329            $campaign_template_file_path = SMARTY_TEMPLATES_DIR.$template_code ."/". CAMPAIGN_TEMPLATE_DIR . $val['directory_name'] . "/" .CAMPAIGN_TEMPLATE_ACTIVE .  "site_frame.tpl"; 
     330            var_dump("<font color='red'>$campaign_template_file_path</font><br>"); 
     331            if(!file_exists($campaign_template_file_path)){ 
     332                var_dump("<font color='red'>test</font>"); 
     333                //ファイルがなければコピーして作成 
     334                $this->lfCreateTemplate(SMARTY_TEMPLATES_DIR.$template_code ."/" . CAMPAIGN_TEMPLATE_DIR , $val['directory_name'],$val['cart_flg'] ); 
     335            } 
     336        } 
     337    } 
     338     
     339   /* 
     340     * 関数名:lfCreateTemplate() 
     341     * 引数1 :ディレクトリパス 
     342     * 引数2 :作成ファイル名 
     343     * 説明 :キャンペーンの初期テンプレート作成 
     344     * 戻り値:無し 
     345     */ 
     346    function lfCreateTemplate($dir, $file , $cart_flg) { 
     347        umask(0); 
     348        $objFileManager = new SC_Helper_FileManager_Ex(); 
     349         
     350        // 作成ファイルディレクトリ 
     351        $create_dir = $dir . $file; 
     352        $create_active_dir = $create_dir . "/" . CAMPAIGN_TEMPLATE_ACTIVE; 
     353        $create_end_dir = $create_dir . "/" . CAMPAIGN_TEMPLATE_END; 
     354        // デフォルトファイルディレクトリ 
     355        $default_dir = TEMPLATE_DIR . CAMPAIGN_TEMPLATE_DIR; 
     356        $default_active_dir = $default_dir . "/" . CAMPAIGN_TEMPLATE_ACTIVE; 
     357        $default_end_dir = $default_dir . "/" . CAMPAIGN_TEMPLATE_END; 
     358 
     359        $ret = $objFileManager->sfCreateFile($create_dir, 0755); 
     360        $ret = $objFileManager->sfCreateFile($create_active_dir, 0755); 
     361        $ret = $objFileManager->sfCreateFile($create_end_dir, 0755); 
     362 
     363        // キャンペーン実行PHPをコピー 
     364        $ret = $objFileManager->sfCreateFile(CAMPAIGN_PATH . $file); 
     365        copy(HTML_PATH . CAMPAIGN_TEMPLATE_DIR . "index.php", CAMPAIGN_PATH . $file . "/index.php"); 
     366        copy(HTML_PATH . CAMPAIGN_TEMPLATE_DIR . "application.php", CAMPAIGN_PATH . $file . "/application.php"); 
     367        copy(HTML_PATH . CAMPAIGN_TEMPLATE_DIR . "complete.php", CAMPAIGN_PATH . $file . "/complete.php"); 
     368        copy(HTML_PATH . CAMPAIGN_TEMPLATE_DIR . "entry.php", CAMPAIGN_PATH . $file . "/entry.php"); 
     369 
     370        // デフォルトテンプレート作成(キャンペーン中) 
     371        $header = $this->lfGetFileContents($default_active_dir."header.tpl"); 
     372        SC_Utils_Ex::sfWriteFile($header, $create_active_dir."header.tpl", "w"); 
     373        $contents = $this->lfGetFileContents($default_active_dir."contents.tpl"); 
     374        if(!$cart_flg) { 
     375            $contents .= "\n" . '<!--{*ログインフォーム*}-->' . "\n"; 
     376            $contents .= $this->lfGetFileContents(CAMPAIGN_BLOC_PATH . "login.tpl"); 
     377            $contents .= '<!--{*会員登録フォーム*}-->'."\n"; 
     378            $contents .= $this->lfGetFileContents(CAMPAIGN_BLOC_PATH . "entry.tpl"); 
     379        } 
     380        SC_Utils_Ex::sfWriteFile($contents, $create_active_dir."contents.tpl", "w"); 
     381        $footer = $this->lfGetFileContents($default_active_dir."footer.tpl"); 
     382        SC_Utils_Ex::sfWriteFile($footer, $create_active_dir."footer.tpl", "w"); 
     383 
     384        // サイトフレーム作成 
     385        $site_frame  = $header."\n"; 
     386        $site_frame .= '<script type="text/javascript" src="<!--{$TPL_DIR}-->js/navi.js"></script>'."\n"; 
     387        $site_frame .= '<script type="text/javascript" src="<!--{$TPL_DIR}-->js/site.js"></script>'."\n"; 
     388        $site_frame .= '<!--{include file=$tpl_mainpage}-->'."\n"; 
     389        $site_frame .= $footer."\n"; 
     390        SC_Utils_Ex::sfWriteFile($site_frame, $create_active_dir."site_frame.tpl", "w"); 
     391 
     392        /* デフォルトテンプレート作成(キャンペーン終了) */ 
     393        $header = $this->lfGetFileContents($default_end_dir."header.tpl"); 
     394        SC_Utils_Ex::sfWriteFile($header, $create_end_dir."header.tpl", "w"); 
     395        $contents = $this->lfGetFileContents($default_end_dir."contents.tpl"); 
     396        SC_Utils_Ex::sfWriteFile($contents, $create_end_dir."contents.tpl", "w"); 
     397        $footer = $this->lfGetFileContents($default_end_dir."footer.tpl"); 
     398        SC_Utils_Ex::sfWriteFile($footer, $create_end_dir."footer.tpl", "w"); 
     399    } 
     400     
     401    /* 
     402     * 関数名:lfGetFileContents() 
     403     * 引数1 :ファイルパス 
     404     * 説明 :ファイル読込 
     405     * 戻り値:無し 
     406     */ 
     407    function lfGetFileContents($read_file) { 
     408 
     409        if(file_exists($read_file)) { 
     410            $contents = file_get_contents($read_file); 
     411        } else { 
     412            $contents = ""; 
     413        } 
     414 
     415        return $contents; 
     416    } 
    313417} 
    314418?> 
  • branches/comu-ver2/data/mtb_constants_init.php

    r17605 r17673  
    542542define('DEFAULT_TEMPLATE_NAME', "default"); 
    543543/** テンプレート名 */ 
    544 define('TEMPLATE_NAME', DEFAULT_TEMPLATE_NAME); 
     544define('TEMPLATE_NAME', "default"); 
    545545/** SMARTYテンプレート */ 
    546546define('SMARTY_TEMPLATES_DIR',  DATA_PATH . "Smarty/templates/"); 
     
    550550define('TEMPLATE_DIR', SMARTY_TEMPLATES_DIR . TEMPLATE_NAME . "/"); 
    551551/** SMARTYテンプレート(管理機能) */ 
    552 define('TEMPLATE_ADMIN_DIR', TEMPLATE_DIR . "admin/"); 
     552define('TEMPLATE_ADMIN_DIR',  SMARTY_TEMPLATES_DIR . DEFAULT_TEMPLATE_NAME . "/admin/"); 
    553553/** SMARTYコンパイル */ 
    554554define('COMPILE_DIR', DATA_PATH . "Smarty/templates_c/" . TEMPLATE_NAME . "/"); 
  • branches/comu-ver2/html/campaign/application.php

    r17581 r17673  
    2323 
    2424// {{{ requires 
    25 require_once("../require.php"); 
     25require_once("../../require.php"); 
    2626require_once(CLASS_EX_PATH . "page_extends/campaign/LC_Page_CampaignApplication_Ex.php"); 
    2727 
  • branches/comu-ver2/html/campaign/complete.php

    r17581 r17673  
    2323 
    2424// {{{ requires 
    25 require_once("../require.php"); 
     25require_once("../../require.php"); 
    2626require_once(CLASS_EX_PATH . "page_extends/campaign/LC_Page_CampaignComplete_Ex.php"); 
    2727 
  • branches/comu-ver2/html/campaign/entry.php

    r17581 r17673  
    2323 
    2424// {{{ requires 
    25 require_once("../require.php"); 
     25require_once("../../require.php"); 
    2626require_once(CLASS_EX_PATH . "page_extends/campaign/LC_Page_CampaignEntry_Ex.php"); 
    2727 
  • branches/comu-ver2/html/campaign/index.php

    r17581 r17673  
    2323 
    2424// {{{ requires 
    25 require_once("../require.php"); 
     25require_once("../../require.php"); 
    2626require_once(CLASS_EX_PATH . "page_extends/campaign/LC_Page_Campaign_Ex.php"); 
    2727 
  • branches/comu-ver2/html/install/sql/insert_data.sql

    r17605 r17673  
    10521052INSERT INTO mtb_constants VALUES ('USE_MOBILE','true',292,'モバイルサイトを利用するか(true:利用する、false:利用しない) (false は一部対応)'); 
    10531053INSERT INTO mtb_constants VALUES ('DEFAULT_TEMPLATE_NAME', '"default"', 300,'デフォルトテンプレート名'); 
    1054 INSERT INTO mtb_constants VALUES ('TEMPLATE_NAME', 'DEFAULT_TEMPLATE_NAME', 301,'テンプレート名'); 
     1054INSERT INTO mtb_constants VALUES ('TEMPLATE_NAME', '"default"', 301,'テンプレート名'); 
    10551055INSERT INTO mtb_constants VALUES ('SMARTY_TEMPLATES_DIR',' DATA_PATH . "Smarty/templates/"', 302,'SMARTYテンプレート'); 
    10561056INSERT INTO mtb_constants VALUES ('TPL_DIR','URL_DIR . USER_DIR . USER_PACKAGE_DIR . TEMPLATE_NAME . "/"', 303,'SMARTYテンプレート'); 
    10571057INSERT INTO mtb_constants VALUES ('TEMPLATE_DIR','SMARTY_TEMPLATES_DIR . TEMPLATE_NAME . "/"', 304,'SMARTYテンプレート'); 
    1058 INSERT INTO mtb_constants VALUES ('TEMPLATE_ADMIN_DIR','TEMPLATE_DIR . "admin/"', 305,'SMARTYテンプレート(管理機能)'); 
     1058INSERT INTO mtb_constants VALUES ('TEMPLATE_ADMIN_DIR','SMARTY_TEMPLATES_DIR . DEFAULT_TEMPLATE_NAME . "/admin/"', 305,'SMARTYテンプレート(管理機能)'); 
    10591059INSERT INTO mtb_constants VALUES ('COMPILE_DIR','DATA_PATH . "Smarty/templates_c/" . TEMPLATE_NAME . "/"',306,'SMARTYコンパイル'); 
    10601060INSERT INTO mtb_constants VALUES ('COMPILE_ADMIN_DIR','COMPILE_DIR . "admin/"',307,'SMARTYコンパイル(管理機能)'); 
Note: See TracChangeset for help on using the changeset viewer.