Ignore:
Timestamp:
2011/01/04 22:10:23 (13 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:19822
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/SC_Display.php 18986@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcamp%2Fcamp-2_5-E%2Fdata%2Fclass%2FSC_Display.php
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110104130612-y5ey6gojq1xmiqo0
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110104131017-gzt42owwlks4rfiw
bzr:revno:
2552
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-revisions:

data/class/SC_Display.php ohkouchi@loop-az.jp-20110104130612-y5ey6gojq1xmiqo0
bzr:timestamp:
2011-01-04 22:10:17.061000109 +0900
bzr:user-agent:
bzr2.2.1+bzr-svn1.0.4
svn:original-date:
2011-01-04T13:10:17.061000Z
Message:

#787(スマートフォン対応)

  • SC_Display::autoSet は使用してなさげなので削除
  • SC_Display::detectDevice() を static 参照できるよう修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_Display.php

    r19814 r19823  
    3434    var $device; 
    3535 
    36     var $autoSet; 
    37  
    3836    /** SC_View インスタンス */ 
    3937    var $view; 
     
    4947     */ 
    5048 
    51     function SC_Display($hasPrevURL = true, $autoGenerateHttpHeaders = true) { 
     49    function SC_Display($hasPrevURL = true) { 
    5250        $this->response = new SC_Response_Ex(); 
    53         $this->autoSet = $autoGenerateHttpHeaders; 
    5451        if ($hasPrevURL) { 
    5552            $this->setPrevURL(); 
     
    139136    /** 
    140137     * 機種を判別する。 
     138     * 
    141139     * SC_Display::MOBILE = ガラケー = 1 
    142140     * SC_Display::SMARTPHONE = スマホ = 2 
    143141     * SC_Display::PC = PC = 10 
    144      * ※PHP4の為にconstは使っていません。 1がガラケーで、2がスマホで4がPCです。 
    145      * @return 
     142     * 
     143     * @static 
     144     * @return integer 端末種別ID 
    146145     */ 
    147146    function detectDevice(){ 
     
    149148        $su = new SC_SmartphoneUserAgent(); 
    150149        $retDevice = 0; 
    151         if($nu->isMobile()){ 
    152             $retDevice = DEVICE_TYPE_MOBILE; 
    153         }elseif ($su->isSmartphone()){ 
    154             $retDevice = DEVICE_TYPE_SMARTPHONE; 
    155         }else{ 
    156             $retDevice = DEVICE_TYPE_PC; 
     150        if ($nu->isMobile()) { 
     151            return DEVICE_TYPE_MOBILE; 
     152        } elseif ($su->isSmartphone()) { 
     153            return DEVICE_TYPE_SMARTPHONE; 
     154        } else { 
     155            return DEVICE_TYPE_PC; 
    157156        } 
    158  
    159         if($this->autoSet){ 
    160             $this->setDevice($retDevice); 
    161         } 
    162         return $retDevice; 
    163157    } 
    164158 
Note: See TracChangeset for help on using the changeset viewer.