Ignore:
Timestamp:
2011/02/19 19:48:25 (16 years ago)
Author:
fukuda
Message:

・/admin/mail/preview.php のリファクタリング
・使用していないmail_method=3に関するコードを削除

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php

    r20203 r20205  
    6363     */ 
    6464    function action() { 
    65         $objQuery = new SC_Query(); 
     65         
     66        $objMailHelper = new SC_Helper_Mail_Ex(); 
    6667        $objSess = new SC_Session(); 
    67         $objDate = new SC_Date(); 
    68  
    6968        // 認証可否の判定 
    7069        SC_Utils_Ex::sfIsSuccess($objSess); 
    7170 
    72         if (SC_Utils_Ex::sfIsInt($_GET['send_id']) 
    73                    || SC_Utils_Ex::sfIsInt($_GET['id'])){ 
    74                         
    75             if (is_numeric($_GET["send_id"])) { 
    76                 $id = $_GET["send_id"]; 
    77                 $sql = "SELECT body, mail_method FROM dtb_send_history WHERE send_id = ?"; 
    78             } else { 
    79                 $sql = "SELECT body, mail_method FROM dtb_mailmaga_template WHERE template_id = ?"; 
    80                 $id = $_GET['id']; 
     71        switch ($this->getMode()) { 
     72        case 'template': 
     73            if (SC_Utils_Ex::sfIsInt($_GET['template_id'])){ 
     74                $arrMail = $objMailHelper->sfGetMailTemplate($_GET['template_id']); 
    8175            } 
    82             $result = $objQuery->getAll($sql, array($id)); 
     76            break; 
     77        case 'history'; 
     78            if (SC_Utils_Ex::sfIsInt($_GET['send_id'])){ 
     79                $arrMail = $objMailHelper->sfGetSendHistory($_GET['send_id']); 
     80            } 
     81            break; 
     82        default: 
     83        } 
    8384 
    84             if ( $result ){ 
    85                 if ( $result[0]["mail_method"] == 2 ){ 
    86                     // テキスト形式の時はタグ文字をエスケープ 
    87                     $this->escape_flag = 1; 
    88                 }     
    89                 $this->body = $result[0]["body"]; 
    90             } 
    91         } 
     85        $this->mail = $arrMail[0]; 
    9286        $this->setTemplate($this->tpl_mainpage); 
    9387    } 
Note: See TracChangeset for help on using the changeset viewer.