Use __construct

1.10.x
jmontoyaa 10 years ago
parent 940fbdd51c
commit 7f42c3251a
  1. 90
      main/inc/lib/browser/Browser.php
  2. 4
      main/inc/lib/pear/HTML/QuickForm.php
  3. 2
      main/inc/lib/pear/HTML/QuickForm/header.php
  4. 5
      main/inc/lib/pear/HTML/Table.php

@ -109,7 +109,7 @@ class Browser
const OPERATING_SYSTEM_UNKNOWN = 'unknown'; const OPERATING_SYSTEM_UNKNOWN = 'unknown';
public function Browser($userAgent = "") public function __construct($userAgent = "")
{ {
$this->reset(); $this->reset();
if ($userAgent != "") { if ($userAgent != "") {
@ -259,8 +259,8 @@ class Browser
* Is the browser from facebook? * Is the browser from facebook?
* @return boolean True if the browser is from facebook otherwise false * @return boolean True if the browser is from facebook otherwise false
*/ */
public function isFacebook() public function isFacebook()
{ {
return $this->_is_facebook; return $this->_is_facebook;
} }
@ -304,9 +304,9 @@ class Browser
* Set the Browser to be a Facebook request * Set the Browser to be a Facebook request
* @param boolean $value is the browser a robot or not * @param boolean $value is the browser a robot or not
*/ */
protected function setFacebook($value = true) protected function setFacebook($value = true)
{ {
$this->_is_facebook = $value; $this->_is_facebook = $value;
} }
/** /**
@ -419,7 +419,7 @@ class Browser
$this->checkBrowserLynx() || $this->checkBrowserLynx() ||
$this->checkBrowserShiretoko() || $this->checkBrowserShiretoko() ||
$this->checkBrowserIceCat() || $this->checkBrowserIceCat() ||
$this->checkBrowserIceweasel() || $this->checkBrowserIceweasel() ||
$this->checkBrowserW3CValidator() || $this->checkBrowserW3CValidator() ||
$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */ $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
); );
@ -493,7 +493,7 @@ class Browser
} }
return false; return false;
} }
/** /**
* Determine if the browser is the BingBot or not (last updated 1.9) * Determine if the browser is the BingBot or not (last updated 1.9)
* @return boolean True if the browser is the BingBot otherwise false * @return boolean True if the browser is the BingBot otherwise false
@ -1039,10 +1039,10 @@ class Browser
* Detect Version for the Safari browser on iOS devices * Detect Version for the Safari browser on iOS devices
* @return boolean True if it detects the version correctly otherwise false * @return boolean True if it detects the version correctly otherwise false
*/ */
protected function getSafariVersionOnIos() protected function getSafariVersionOnIos()
{ {
$aresult = explode('/',stristr($this->_agent,'Version')); $aresult = explode('/',stristr($this->_agent,'Version'));
if( isset($aresult[1]) ) if( isset($aresult[1]) )
{ {
$aversion = explode(' ',$aresult[1]); $aversion = explode(' ',$aresult[1]);
$this->setVersion($aversion[0]); $this->setVersion($aversion[0]);
@ -1055,10 +1055,10 @@ class Browser
* Detect Version for the Chrome browser on iOS devices * Detect Version for the Chrome browser on iOS devices
* @return boolean True if it detects the version correctly otherwise false * @return boolean True if it detects the version correctly otherwise false
*/ */
protected function getChromeVersionOnIos() protected function getChromeVersionOnIos()
{ {
$aresult = explode('/',stristr($this->_agent,'CriOS')); $aresult = explode('/',stristr($this->_agent,'CriOS'));
if( isset($aresult[1]) ) if( isset($aresult[1]) )
{ {
$aversion = explode(' ',$aresult[1]); $aversion = explode(' ',$aresult[1]);
$this->setVersion($aversion[0]); $this->setVersion($aversion[0]);
@ -1149,71 +1149,71 @@ class Browser
*/ */
protected function checkPlatform() protected function checkPlatform()
{ {
if (stripos($this->_agent, 'windows') !== false) if (stripos($this->_agent, 'windows') !== false)
{ {
$this->_platform = self::PLATFORM_WINDOWS; $this->_platform = self::PLATFORM_WINDOWS;
} }
else if (stripos($this->_agent, 'iPad') !== false) else if (stripos($this->_agent, 'iPad') !== false)
{ {
$this->_platform = self::PLATFORM_IPAD; $this->_platform = self::PLATFORM_IPAD;
} }
else if (stripos($this->_agent, 'iPod') !== false) else if (stripos($this->_agent, 'iPod') !== false)
{ {
$this->_platform = self::PLATFORM_IPOD; $this->_platform = self::PLATFORM_IPOD;
} }
else if (stripos($this->_agent, 'iPhone') !== false) else if (stripos($this->_agent, 'iPhone') !== false)
{ {
$this->_platform = self::PLATFORM_IPHONE; $this->_platform = self::PLATFORM_IPHONE;
} }
elseif (stripos($this->_agent, 'mac') !== false) elseif (stripos($this->_agent, 'mac') !== false)
{ {
$this->_platform = self::PLATFORM_APPLE; $this->_platform = self::PLATFORM_APPLE;
} }
elseif (stripos($this->_agent, 'android') !== false) elseif (stripos($this->_agent, 'android') !== false)
{ {
$this->_platform = self::PLATFORM_ANDROID; $this->_platform = self::PLATFORM_ANDROID;
} }
elseif (stripos($this->_agent, 'linux') !== false) elseif (stripos($this->_agent, 'linux') !== false)
{ {
$this->_platform = self::PLATFORM_LINUX; $this->_platform = self::PLATFORM_LINUX;
} }
else if (stripos($this->_agent, 'Nokia') !== false) else if (stripos($this->_agent, 'Nokia') !== false)
{ {
$this->_platform = self::PLATFORM_NOKIA; $this->_platform = self::PLATFORM_NOKIA;
} }
else if (stripos($this->_agent, 'BlackBerry') !== false) else if (stripos($this->_agent, 'BlackBerry') !== false)
{ {
$this->_platform = self::PLATFORM_BLACKBERRY; $this->_platform = self::PLATFORM_BLACKBERRY;
} }
elseif (stripos($this->_agent, 'FreeBSD') !== false) elseif (stripos($this->_agent, 'FreeBSD') !== false)
{ {
$this->_platform = self::PLATFORM_FREEBSD; $this->_platform = self::PLATFORM_FREEBSD;
} }
elseif (stripos($this->_agent, 'OpenBSD') !== false) elseif (stripos($this->_agent, 'OpenBSD') !== false)
{ {
$this->_platform = self::PLATFORM_OPENBSD; $this->_platform = self::PLATFORM_OPENBSD;
} }
elseif (stripos($this->_agent, 'NetBSD') !== false) elseif (stripos($this->_agent, 'NetBSD') !== false)
{ {
$this->_platform = self::PLATFORM_NETBSD; $this->_platform = self::PLATFORM_NETBSD;
} }
elseif (stripos($this->_agent, 'OpenSolaris') !== false) elseif (stripos($this->_agent, 'OpenSolaris') !== false)
{ {
$this->_platform = self::PLATFORM_OPENSOLARIS; $this->_platform = self::PLATFORM_OPENSOLARIS;
} }
elseif (stripos($this->_agent, 'SunOS') !== false) elseif (stripos($this->_agent, 'SunOS') !== false)
{ {
$this->_platform = self::PLATFORM_SUNOS; $this->_platform = self::PLATFORM_SUNOS;
} }
elseif (stripos($this->_agent, 'OS\/2') !== false) elseif (stripos($this->_agent, 'OS\/2') !== false)
{ {
$this->_platform = self::PLATFORM_OS2; $this->_platform = self::PLATFORM_OS2;
} }
elseif (stripos($this->_agent, 'BeOS') !== false) elseif (stripos($this->_agent, 'BeOS') !== false)
{ {
$this->_platform = self::PLATFORM_BEOS; $this->_platform = self::PLATFORM_BEOS;
} }
elseif (stripos($this->_agent, 'win') !== false) elseif (stripos($this->_agent, 'win') !== false)
{ {
$this->_platform = self::PLATFORM_WINDOWS; $this->_platform = self::PLATFORM_WINDOWS;
} }

@ -2059,7 +2059,7 @@ class HTML_QuickForm_Error extends PEAR_Error
* Prefix for all error messages * Prefix for all error messages
* @var string * @var string
*/ */
var $error_message_prefix = 'QuickForm Error: '; public $error_message_prefix = 'QuickForm Error: ';
/** /**
* Creates a quickform error object, extending the PEAR_Error class * Creates a quickform error object, extending the PEAR_Error class
@ -2069,7 +2069,7 @@ class HTML_QuickForm_Error extends PEAR_Error
* @param int $level intensity of the error (PHP error code) * @param int $level intensity of the error (PHP error code)
* @param mixed $debuginfo any information that can inform user as to nature of the error * @param mixed $debuginfo any information that can inform user as to nature of the error
*/ */
function HTML_QuickForm_Error($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN, public function __construct($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN,
$level = E_USER_NOTICE, $debuginfo = null) $level = E_USER_NOTICE, $debuginfo = null)
{ {
if (is_int($code)) { if (is_int($code)) {

@ -42,7 +42,7 @@ class HTML_QuickForm_header extends HTML_QuickForm_static
* @access public * @access public
* @return void * @return void
*/ */
function HTML_QuickForm_header($elementName = null, $text = null) public function __construct($elementName = null, $text = null)
{ {
if (!empty($elementName)) { if (!empty($elementName)) {
$text = $elementName; $text = $elementName;

@ -83,7 +83,8 @@
* @version Release: @package_version@ * @version Release: @package_version@
* @link http://pear.php.net/package/HTML_Table * @link http://pear.php.net/package/HTML_Table
*/ */
class HTML_Table extends HTML_Common { class HTML_Table extends HTML_Common
{
/** /**
* Value to insert into empty cells. This is used as a default for * Value to insert into empty cells. This is used as a default for
@ -162,7 +163,7 @@ class HTML_Table extends HTML_Common {
* <tbody> or not * <tbody> or not
* @access public * @access public
*/ */
function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false) public function __construct($attributes = null, $tabOffset = 0, $useTGroups = false)
{ {
parent::__construct($attributes, (int)$tabOffset); parent::__construct($attributes, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups; $this->_useTGroups = (boolean)$useTGroups;

Loading…
Cancel
Save