Ignore:
Timestamp:
2008/03/10 10:42:58 (16 years ago)
Author:
pineray
Message:

ヘルパークラスを使用するように変更

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php

    r17112 r17114  
    9090 
    9191        // CSSファイルの読み込み 
    92         if($css_name != '' && file_exists($css_path)){ 
    93             $css_data = file_get_contents($css_path); 
     92        if($css_name != ''){ 
     93            $css_data = $objFileManager->sfReadFile($css_path); 
    9494        } 
    9595        // テキストエリアに表示 
     
    131131 
    132132    function lfExecuteConfirm($css_dir, $css_name, $old_css_name, $css_path) { 
     133        $objFileManager = new SC_Helper_FileManager_Ex(); 
     134 
    133135        // エラーチェック 
    134136        $this->arrErr = $this->lfErrorCheck($_POST, $css_dir); 
     
    137139        if (count($this->arrErr) == 0) { 
    138140            // 旧ファイルの削除 
    139             if ($old_css_name != '' && $old_css_name != $css_name && file_exists($css_dir . $old_css_name . '.css')) { 
    140                 unlink($css_dir . $old_css_name . '.css'); 
     141            if ($old_css_name != '' && $old_css_name != $css_name) { 
     142                $objFileManager->sfDeleteDir($css_dir . $old_css_name . '.css'); 
    141143            } 
    142144            // プレビュー用テンプレートに書き込み 
    143             $fp = fopen($css_path,"w"); // TODO 
    144             fwrite($fp, $_POST['css']); 
    145             fclose($fp); 
     145            $objFileManager->sfWriteFile($css_path, $_POST['css']); 
    146146 
    147147            $this->tpl_onload="alert('登録が完了しました。');"; 
     
    152152 
    153153    function lfExecuteDelete($css_path) { 
     154        $objFileManager = new SC_Helper_FileManager_Ex(); 
     155 
    154156        // css_name が空でない場合にはdeleteを実行 
    155         if ($_POST['css_name'] !== '' && file_exists($css_path)) { 
    156             unlink($css_path); 
     157        if ($_POST['css_name'] !== '') { 
     158            $objFileManager->sfDeleteDir($css_path); 
    157159        } 
    158160        $this->sendRedirect($this->getLocation("./css.php")); 
Note: See TracChangeset for help on using the changeset viewer.