From: Chuck Hagenbuch Date: Mon, 11 Oct 2010 02:29:51 +0000 (-0400) Subject: Remove Imode browser class X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dbe2a81b36e299fc12a3500beb2070be511a45c4;p=horde.git Remove Imode browser class --- diff --git a/framework/Browser/lib/Horde/Browser/Imode.php b/framework/Browser/lib/Horde/Browser/Imode.php deleted file mode 100644 index 69c67da6a..000000000 --- a/framework/Browser/lib/Horde/Browser/Imode.php +++ /dev/null @@ -1,467 +0,0 @@ - - * @category Horde - * @package Browser - */ -class Horde_Browser_Imode -{ - /** - * Device data. From http://www.nttdocomo.co.jp/i/tag/s5.html#5_1 - * - * @var array - */ - protected $_data = array( - 'D209i' => array( - 'imagewidth' => 96, 'imageheight' => 90, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'F209i' => array( - 'imagewidth' => 96, 'imageheight' => 91, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'N209i' => array( - 'imagewidth' => 108, 'imageheight' => 82, - 'textwidth' => 9, 'textheight' => 6, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'P209i' => array( - 'imagewidth' => 96, 'imageheight' => 87, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'P209is' => array( - 'imagewidth' => 96, 'imageheight' => 87, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'R209i' => array( - 'imagewidth' => 96, 'imageheight' => 72, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'ER209i' => array( - 'imagewidth' => 120, 'imageheight' => 72, - 'textwidth' => 10, 'textheight' => 6, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'KO209i' => array( - 'imagewidth' => 96, 'imageheight' => 96, - 'textwidth' => 8, 'textheight' => 8, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'D210i' => array( - 'imagewidth' => 96, 'imageheight' => 91, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'F210i' => array( - 'imagewidth' => 96, 'imageheight' => 113, - 'textwidth' => 8, 'textheight' => 8, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'N210i' => array( - 'imagewidth' => 118, 'imageheight' => 113, - 'textwidth' => 10, 'textheight' => 8, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'P210i' => array( - 'imagewidth' => 96, 'imageheight' => 91, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'KO210i' => array( - 'imagewidth' => 96, 'imageheight' => 96, - 'textwidth' => 8, 'textheight' => 8, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'SO210i' => array( - 'imagewidth' => 120, 'imageheight' => 113, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'D501i' => array( - 'imagewidth' => 96, 'imageheight' => 72, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'black', - 'imageformats' => array('gif') - ), - 'F501i' => array( - 'imagewidth' => 112, 'imageheight' => 84, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'black', - 'imageformats' => array('gif') - ), - 'N501i' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' =>10, - 'color' => 'black', - 'imageformats' => array('gif') - ), - 'P501i' => array( - 'imagewidth' => 96, 'imageheight' => 120, - 'textwidth' => 8, 'textheight' => 8, - 'color' => 'black', - 'imageformats' => array('gif') - ), - 'D502i' => array( - 'imagewidth' => 96, 'imageheight' => 90, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'F502i' => array( - 'imagewidth' => 96, 'imageheight' => 91, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'F502it' => array( - 'imagewidth' => 96, 'imageheight' => 91, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'N502i' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'N502it' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'P502i' => array( - 'imagewidth' => 96, 'imageheighth' => 117, - 'textwidth' => 8, 'textheight' => 8, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'NM502i' => array( - 'imagewidth' => 111, 'imageheight' => 77, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'black', - 'imageformats' => array('gif') - ), - 'SO502i' => array( - 'imagewidth' => 120, 'imageheight' => 120, - 'textwidth' => 8, 'textheight' => 8, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'SO502iwm' => array( - 'imagewidth' => 120, 'imageheight' => 113, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'F503i' => array( - 'imagewidth' => 120, 'imageheight' => 130, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'F503iS' => array( - 'imagewidth' => 120, 'imageheight' => 130, - 'textwidth' => 12, 'textheight' => 12, - 'color' => 4096, - 'imageformats' => array('gif') - ), - 'P503i' => array( - 'imagewidth' => 120, 'imageheight' => 130, - 'textwidth' => 12, 'textheight' => 10, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'P503iS' => array( - 'imagewidth' => 120, 'imageheight' => 130, - 'textwidth' => 12, 'textheight' => 10, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'SO503i' => array( - 'imagewidth' => 120, 'imageheight' => 113, - 'textwidth' => 8.5, 'textheight' => 7, - 'color' => 65536, - 'imageformats' => array('gif') - ), - 'D503i' => array( - 'imagewidth' => 132, 'imageheight' => 126, - 'textwidth' => 8, 'textheight' => 7, - 'color' => 4096, - 'imageformats' => array('gif') - ), - 'N503i' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 4096, - 'imageformats' => array('gif', 'jpg') - ), - 'N503iS' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 4096, - 'imageformats' => array('gif', 'jpg') - ), - 'N691i' => array( - 'imagewidth' => 96, 'imageheight' => 72, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'SH821i' => array( - 'imagewidth' => 96, 'imageheight' => 78, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 256, - 'imageformats' => array('gif') - ), - 'N821i' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'P821i' => array( - 'imagewidth' => 118, 'imageheight' => 128, - 'textwidth' => 10, 'textheight' => 10, - 'color' => 'grey', - 'imageformats' => array('gif') - ), - 'safe' => array( - 'imagewidth' => 94, 'imageheight' => 72, - 'textwidth' => 8, 'textheight' => 6, - 'color' => 'black', - 'imageformats' => array('gif') - ) - ); - - /** - * TODO - */ - protected $_manufacturerlist = array( - 'D' => 'Mitsubishi', - 'P' => 'Panasonic (Matsushita)', - 'NM' => 'Nokia', - 'SO' => 'Sony', - 'F' => 'Fujitsu', - 'N' => 'Nec', - 'SH' => 'Sharp', - 'ER' => 'Ericsson', - 'R' => 'Japan Radio', - 'KO' => 'Kokusai (Hitachi)' - ); - - /** - * TODO - */ - protected $_extra = array( - 't' => 'Transport layer', - 'e' => 'English language', - 's' => 'Second version' - ); - - /** - * TODO - */ - protected $_user_agent; - - /** - * TODO - */ - protected $_model; - - /** - * TODO - */ - protected $_manufacturer; - - /** - * TODO - */ - protected $_httpversion; - - /** - * TODO - */ - protected $_cache = 5; - - /** - * Constructor. - * NOTE: Does not handle bogus user_agents or most of the other error - * situation properly yet. - * - * Example usage: - * $ua = new Browser_imode($_SERVER['HTTP_USER_AGENT']); - * - * @param string $input The user agent to match. - * - * @throws Horde_Browser_Exception - */ - public function __construct($input) - { - $temp = explode('/', $input); - - $this->_user_agent = $input; - $this->_httpversion = $temp[1]; - $this->_model = $temp[2]; - if ($temp[3]) { - $this->_cache = substr($temp[3], 1); - } - - preg_match('/(^[a-zA-Z]+)([0-9]+i)(.*)\/?(.*)/', $this->_model, $matches); - - // @TODO: Fix situation of unknown manufacturer. Implement - // extrainfo properly. - $this->_manufacturer = $this->_manufacturerlist[$matches[1]]; - $this->_extra = $matches[3]; - - if (!($this->_data[$this->_model])) { - throw new Horde_Browser_Exception('Unknown User Agent'); - } - } - - /** - * TODO - * - * Example usage: - * $imagedim = $ua->getImageDimensions(); - * $imagewidth = $imagedim[0]; - * $imageheight = $imagedim[1]; - * - * @return array The maximum imagewidth and imageheight that - * fit on the handset screen without scrolling. - */ - public function getImageDimensions() - { - $data = $this->_data[$this->_model]; - return array($data['imagewidth'], $data['imageheight']); - } - - /** - * TODO - * - * Example usage: - * $textdim = $ua->getTextDimensions(); - * $textwidth = $textdim[0]; - * $textheight = $textdim[1]; - * - * @return array The Maximum textwidth and textheight that - * fit on the handset screen without scrolling. - */ - public function getTextDimensions() - { - return array($this->_data[$this->_model]['textwidth'], - $this->_data[$this->_model]['textheight']); - } - - /** - * TODO - * - * @return integer The amount of handset cache in kilobytes. - */ - public function getCache() - { - return (int)$this->_cache; - } - - /** - * TODO - */ - public function getManufacturer() - { - return $this->_manufacturer; - } - - /** - * TODO - */ - public function getExtra() - { - return $this->_extra; - } - - /** - * TODO - */ - public function getImageFormats() - { - return $this->_data[$this->_model]['imageformats']; - } - - /** - * TODO - * - * @return integer Which color model the handset supports. - * Values have the following meaning: - *
-     * 0 -> black and white
-     * 1 -> 4 tone greyscale
-     * 2 -> 256 color
-     * 
- */ - public function getColor() - { - return $this->_data[$this->_model]['color']; - } - - /** - * TODO - */ - public function getHTTPVersion() - { - return $this->_httpversion; - } - - /** - * TODO - */ - public function isColor() - { - return $this->_data[$this->_model]['color'] == 256; - } - - /** - * TODO - */ - public function isGreyScale() - { - return $this->_data[$this->_model]['color'] == 'grey'; - } - - /** - * TODO - */ - public function isBlackAndWhite() - { - return $this->_data[$this->_model]['color'] == 'black'; - } - -} diff --git a/framework/Browser/package.xml b/framework/Browser/package.xml index 293364698..80050ab6a 100644 --- a/framework/Browser/package.xml +++ b/framework/Browser/package.xml @@ -35,7 +35,6 @@ about the current user's browser and its capabilities. - @@ -63,7 +62,6 @@ about the current user's browser and its capabilities. -