Skip to content

Commit

Permalink
Patches for newer PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
andyvanee committed Jul 23, 2013
1 parent 4896051 commit fa0bb8c
Show file tree
Hide file tree
Showing 120 changed files with 10,594 additions and 9,096 deletions.
6 changes: 3 additions & 3 deletions Date/TimeZone.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function getDefault()
* @access public
* @param string $id the time zone id to use
*/
function setDefault($id)
static function setDefault($id)
{
if(Date_TimeZone::isValidID($id)) {
$GLOBALS['_DATE_TIMEZONE_DEFAULT'] = $id;
Expand All @@ -206,7 +206,7 @@ function setDefault($id)
* @param string $id the id to test
* @return boolean true if the supplied ID is valid
*/
function isValidID($id)
static function isValidID($id)
{
if(isset($GLOBALS['_DATE_TIMEZONE_DATA'][$id])) {
return true;
Expand Down Expand Up @@ -4728,4 +4728,4 @@ function getRawOffset()
* c-hanging-comment-ender-p: nil
* End:
*/
?>
?>
30 changes: 15 additions & 15 deletions HTML/QuickForm/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/**
* Class for a group of elements used to input dates (and times).
*
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
Expand Down Expand Up @@ -32,10 +32,10 @@

/**
* Class for a group of elements used to input dates (and times).
*
*
* Inspired by original 'date' element but reimplemented as a subclass
* of HTML_QuickForm_group
*
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <[email protected]>
Expand All @@ -48,7 +48,7 @@ class HTML_QuickForm_date extends HTML_QuickForm_group

/**
* Various options to control the element's display.
*
*
* @access private
* @var array
*/
Expand All @@ -72,10 +72,10 @@ class HTML_QuickForm_date extends HTML_QuickForm_group

/**
* Options in different languages
*
*
* Note to potential translators: to avoid encoding problems please send
* your translations with "weird" letters encoded as HTML Unicode entities
*
*
* @access private
* @var array
*/
Expand Down Expand Up @@ -243,12 +243,12 @@ class HTML_QuickForm_date extends HTML_QuickForm_group

/**
* Class constructor
*
*
* The following keys may appear in $options array:
* - 'language': date language
* - 'format': Format of the date, based on PHP's date() function.
* The following characters are currently recognised in format string:
* <pre>
* <pre>
* D => Short names of days
* l => Long names of days
* d => Day numbers
Expand Down Expand Up @@ -343,7 +343,7 @@ function _createElements()
case 'Y':
$options = $this->_createOptionList(
$this->_options['minYear'],
$this->_options['maxYear'],
$this->_options['maxYear'],
$this->_options['minYear'] > $this->_options['maxYear']? -1: 1
);
break;
Expand All @@ -353,7 +353,7 @@ function _createElements()
$this->_options['maxYear'],
$this->_options['minYear'] > $this->_options['maxYear']? -1: 1
);
array_walk($options, create_function('&$v,$k','$v = substr($v,-2);'));
array_walk($options, create_function('&$v,$k','$v = substr($v,-2);'));
break;
case 'h':
$options = $this->_createOptionList(1, 12);
Expand Down Expand Up @@ -388,7 +388,7 @@ function _createElements()
$separator .= (' ' == $sign? '&nbsp;': $sign);
$loadSelect = false;
}

if ($loadSelect) {
if (0 < count($this->_elements)) {
$this->_separator[] = $separator;
Expand All @@ -397,7 +397,7 @@ function _createElements()
}
$separator = '';
// Should we add an empty option to the top of the select?
if (!is_array($this->_options['addEmptyOption']) && $this->_options['addEmptyOption'] ||
if (!is_array($this->_options['addEmptyOption']) && $this->_options['addEmptyOption'] ||
is_array($this->_options['addEmptyOption']) && !empty($this->_options['addEmptyOption'][$sign])) {

// Using '+' array operator to preserve the keys
Expand All @@ -407,7 +407,7 @@ function _createElements()
$options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options;
}
}
$this->_elements[] =& new HTML_QuickForm_select($sign, null, $options, $this->getAttributes());
$this->_elements[] = new HTML_QuickForm_select($sign, null, $options, $this->getAttributes());
}
}
}
Expand Down Expand Up @@ -478,7 +478,7 @@ function setValue($value)
function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer = new HTML_QuickForm_Renderer_Default();
$renderer->setElementTemplate('{element}');
parent::accept($renderer);
return $this->_wrap[0] . $renderer->toHtml() . $this->_wrap[1];
Expand Down Expand Up @@ -508,4 +508,4 @@ function onQuickFormEvent($event, $arg, &$caller)

// }}}
}
?>
?>
Loading

0 comments on commit fa0bb8c

Please sign in to comment.