Ignore:
Timestamp:
2011/01/05 22:10:58 (13 years ago)
Author:
fukuda
Message:

#880(mobile/sphoneディレクトリを削除)に対応。まずmobileのみ意図通りの動作になるように一部コミット(entryディレクトリ) 登録完了時に無限ループする?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/entry/LC_Page_Entry_Kiyaku.php

    r19805 r19830  
    6363     */ 
    6464    function action() { 
    65         $objCustomer = new SC_Customer(); 
    6665 
    6766        // 規約内容の取得 
     
    6968        $objQuery->setOrder("rank DESC"); 
    7069        $arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1"); 
    71  
    72         $max = count($arrRet); 
    73         $this->tpl_kiyaku_text = ""; 
    74         for ($i = 0; $i < $max; $i++) { 
    75             $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_title'] . "\n\n"; 
    76             $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_text'] . "\n\n"; 
    77         } 
    78     } 
    79  
    80     /** 
    81      * モバイルページを初期化する. 
    82      * 
    83      * @return void 
    84      */ 
    85     function mobileInit() { 
    86         $this->init(); 
    87     } 
    88  
    89     /** 
    90      * Page のプロセス(モバイル). 
    91      * 
    92      * @return void 
    93      */ 
    94     function mobileProcess() { 
    95         $this->mobilAection(); 
    96         $this->sendResponse(); 
    97     } 
    98  
    99     /** 
    100      * Page のアクション(モバイル). 
    101      * 
    102      * @return void 
    103      */ 
    104     function mobileAction() { 
    105         $objCustomer = new SC_Customer(); 
    106  
    107         $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; 
    108         $next = $offset; 
    109  
    110         // 規約内容の取得 
    111         $objQuery = new SC_Query(); 
    112         $count = $objQuery->count("dtb_kiyaku", "del_flg <> 1"); 
    113         $objQuery->setOrder("rank DESC"); 
    114         $objQuery->setLimitOffset(1, $offset); 
    115         $arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1"); 
    116  
    117         if($count > $offset + 1){ 
    118             $next++; 
    119         } else { 
    120             $next = -1; 
     70        $this->max = count($arrRet); 
     71         
     72        // mobile時はGETでページ指定 
     73        if ( Net_UserAgent_Mobile::isMobile() === true ){ 
     74            $this->offset = is_numeric($_GET['offset'])===true ? $offset = intval($_GET['offset']) : 1; 
    12175        } 
    12276 
    123         $max = count($arrRet); 
     77        // 規約文の作成 
    12478        $this->tpl_kiyaku_text = ""; 
    125         for ($i = 0; $i < $max; $i++) { 
     79        for ($i = 0; $i < $this->max; $i++) { 
     80            if ($this->offset !== null && ($this->offset - 1) <> $i) continue; 
    12681            $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_title'] . "\n\n"; 
    12782            $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_text'] . "\n\n"; 
Note: See TracChangeset for help on using the changeset viewer.