Ignore:
Timestamp:
2011/01/11 16:34:33 (13 years ago)
Author:
kotani
Message:

#880(mobile/sphoneディレクトリを削除)に対応。まずmobileのみ意図通りの動作になるように一部コミット(productsディレクトリ)

File:
1 edited

Legend:

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

    r19833 r19865  
    3030 * @package Page 
    3131 * @author LOCKON CO.,LTD. 
    32  * @version $Id:LC_Page_Products_List.php 15532 2007-08-31 14:39:46Z nanasess $ 
     32 * @version $Id$ 
    3333 */ 
    3434class LC_Page_Products_List extends LC_Page { 
     
    9090 
    9191    /** 
    92      *  ページのアクション(旧process) 
     92     * Page のAction. 
     93     * 
    9394     * @return void 
    9495     */ 
    9596    function action() { 
    9697        $this->lfLoadParam(); 
    97         //$objView = new SC_SiteView(!$this->inCart); 
    9898        $objQuery = new SC_Query(); 
    9999        $objDb = new SC_Helper_DB_Ex(); 
     
    182182        } 
    183183 
     184        // ページャ用データ設定(モバイル) 
     185        if (Net_UserAgent_Mobile::isMobile() === true) { 
     186            $this->lfSetPagerMobile(); 
     187        } 
     188 
    184189        $this->tpl_javascript .= 'function fnOnLoad(){' . $js_fnOnLoad . '}'; 
    185190        $this->tpl_onload .= 'fnOnLoad(); '; 
    186191 
    187192        $this->tpl_rnd = SC_Utils_Ex::sfGetRandomString(3); 
    188     } 
    189  
    190     /** 
    191      * モバイルページを初期化する. 
    192      * 
    193      * @return void 
    194      */ 
    195     function mobileInit() { 
    196         $this->init(); 
    197     } 
    198  
    199     /** 
    200      * Page のプロセス(モバイル). 
    201      * 
    202      * @return void 
    203      */ 
    204     function mobileProcess() { 
    205         parent::mobileProcess(); 
    206         $this->mobieAction(); 
    207         $this->sendResponse(); 
    208     } 
    209  
    210     /** 
    211      * Page のAction(モバイル). 
    212      * 
    213      * FIXME スパゲッティ... 
    214      * 
    215      * @return void 
    216      */ 
    217     function mobieAction(){ 
    218         $this->lfLoadParam(); 
    219         //$objView = new SC_MobileView(); 
    220         $objQuery = new SC_Query(); 
    221         $objDb = new SC_Helper_DB_Ex(); 
    222  
    223         // タイトル編集 
    224         $tpl_search_mode = false; 
    225  
    226         if ($this->mode == 'search') { 
    227             $this->tpl_subtitle = "検索結果"; 
    228             $tpl_search_mode = true; 
    229         } elseif ($this->arrSearchData['category_id'] == 0) { 
    230             $this->tpl_subtitle = "全商品"; 
    231         } else { 
    232             $arrCat = $objDb->sfGetCat($this->arrSearchData['category_id']); 
    233             $this->tpl_subtitle = $arrCat['name']; 
    234         } 
    235  
    236         $count = $objQuery->count("dtb_best_products", "category_id = ?", array($this->arrSearchData['category_id'])); 
    237  
    238             // 商品一覧の表示処理 
    239         $this->lfDispProductsList(); 
    240  
    241             // 検索条件を画面に表示 
    242             // カテゴリー検索条件 
    243         if ($this->arrSearchData['category_id'] == 0) { 
    244             $this->arrSearch['category'] = "指定なし"; 
    245         } else { 
    246                 $arrCat = $objQuery->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($category_id)); 
    247             $this->arrSearch['category'] = $arrCat; 
    248             } 
    249  
    250             // 商品名検索条件 
    251         if ($this->arrForm['name'] === "") { 
    252             $this->arrSearch['name'] = "指定なし"; 
    253             } else { 
    254             $this->arrSearch['name'] = $this->arrForm['name']; 
    255                     } 
    256  
    257         // ページ送り機能用のURLを作成する。 
    258         $objURL = new Net_URL($_SERVER['PHP_SELF']); 
    259         foreach ($_REQUEST as $key => $value) { 
    260             if ($key == session_name() || $key == 'pageno') { 
    261                 continue; 
    262             } 
    263             $objURL->addQueryString($key, mb_convert_encoding($value, 'SJIS', CHAR_CODE)); 
    264         } 
    265  
    266         if ($this->objNavi->now_page > 1) { 
    267             $objURL->addQueryString('pageno', $this->objNavi->now_page - 1); 
    268             $this->tpl_previous_page = $objURL->path . '?' . $objURL->getQueryString(); 
    269         } 
    270         if ($this->objNavi->now_page < $this->objNavi->max_page) { 
    271             $objURL->addQueryString('pageno', $this->objNavi->now_page + 1); 
    272             $this->tpl_next_page = $objURL->path . '?' . $objURL->getQueryString(); 
    273         } 
    274  
    275         $this->tpl_search_mode = $tpl_search_mode; 
    276  
    277         $this->tpl_mainpage = MOBILE_TEMPLATE_REALDIR . "products/list.tpl"; 
    278193    } 
    279194 
     
    368283            $arrval[] = $this->arrSearchData['maker_id']; 
    369284        } 
    370   
     285 
    371286        // 検索結果対象となる商品の数を取得 
    372287        $objQuery =& SC_Query::getSingletonInstance(); 
     
    537452        $this->inCart = strlen($this->arrForm['product_id']) >= 1; 
    538453    } 
     454 
     455    /** 
     456     * ページャ用データ設定(モバイル) 
     457     * 
     458     * @return void 
     459     */ 
     460    function lfSetPagerMobile() { 
     461        // ページ送り機能用のURLを作成する。 
     462        $objURL = new Net_URL($_SERVER['PHP_SELF']); 
     463        foreach ($_REQUEST as $key => $value) { 
     464            if ($key == session_name() || $key == 'pageno') { 
     465                continue; 
     466            } 
     467            $objURL->addQueryString($key, mb_convert_encoding($value, 'SJIS', CHAR_CODE)); 
     468        } 
     469 
     470        if ($this->objNavi->now_page > 1) { 
     471            $objURL->addQueryString('pageno', $this->objNavi->now_page - 1); 
     472            $this->tpl_previous_page = $objURL->path . '?' . $objURL->getQueryString(); 
     473        } 
     474        if ($this->objNavi->now_page < $this->objNavi->max_page) { 
     475            $objURL->addQueryString('pageno', $this->objNavi->now_page + 1); 
     476            $this->tpl_next_page = $objURL->path . '?' . $objURL->getQueryString(); 
     477        } 
     478    } 
    539479} 
    540480?> 
Note: See TracChangeset for help on using the changeset viewer.