Feature #272 - PEAR, Quick_Forms: Preparation for a upgrade, the current version has been identified as 3.2.7. Making code to be close to the original source, Chamilo's customizations have been distinguished.

skala
Ivan Tcholakov 15 years ago
parent adeed61f67
commit af65b48160
  1. 24
      main/inc/lib/pear/HTML/QuickForm.php
  2. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer.php
  3. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer/Array.php
  4. 16
      main/inc/lib/pear/HTML/QuickForm/Renderer/ArraySmarty.php
  5. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer/Default.php
  6. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer/ITDynamic.php
  7. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer/ITStatic.php
  8. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer/Object.php
  9. 12
      main/inc/lib/pear/HTML/QuickForm/Renderer/ObjectFlexy.php
  10. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer/QuickHtml.php
  11. 2
      main/inc/lib/pear/HTML/QuickForm/Rule.php
  12. 2
      main/inc/lib/pear/HTML/QuickForm/Rule/Callback.php
  13. 4
      main/inc/lib/pear/HTML/QuickForm/Rule/Compare.php
  14. 2
      main/inc/lib/pear/HTML/QuickForm/Rule/Email.php
  15. 7
      main/inc/lib/pear/HTML/QuickForm/Rule/Range.php
  16. 2
      main/inc/lib/pear/HTML/QuickForm/Rule/Regex.php
  17. 2
      main/inc/lib/pear/HTML/QuickForm/Rule/Required.php
  18. 4
      main/inc/lib/pear/HTML/QuickForm/RuleRegistry.php
  19. 2
      main/inc/lib/pear/HTML/QuickForm/advcheckbox.php
  20. 2
      main/inc/lib/pear/HTML/QuickForm/autocomplete.php
  21. 2
      main/inc/lib/pear/HTML/QuickForm/button.php
  22. 2
      main/inc/lib/pear/HTML/QuickForm/checkbox.php
  23. 15
      main/inc/lib/pear/HTML/QuickForm/date.php
  24. 11
      main/inc/lib/pear/HTML/QuickForm/element.php
  25. 2
      main/inc/lib/pear/HTML/QuickForm/file.php
  26. 10
      main/inc/lib/pear/HTML/QuickForm/group.php
  27. 2
      main/inc/lib/pear/HTML/QuickForm/header.php
  28. 2
      main/inc/lib/pear/HTML/QuickForm/hidden.php
  29. 2
      main/inc/lib/pear/HTML/QuickForm/hiddenselect.php
  30. 8
      main/inc/lib/pear/HTML/QuickForm/hierselect.php
  31. 2
      main/inc/lib/pear/HTML/QuickForm/html.php
  32. 2
      main/inc/lib/pear/HTML/QuickForm/image.php
  33. 2
      main/inc/lib/pear/HTML/QuickForm/input.php
  34. 2
      main/inc/lib/pear/HTML/QuickForm/password.php
  35. 2
      main/inc/lib/pear/HTML/QuickForm/radio.php
  36. 2
      main/inc/lib/pear/HTML/QuickForm/reset.php
  37. 5
      main/inc/lib/pear/HTML/QuickForm/select.php
  38. 2
      main/inc/lib/pear/HTML/QuickForm/static.php
  39. 2
      main/inc/lib/pear/HTML/QuickForm/submit.php
  40. 2
      main/inc/lib/pear/HTML/QuickForm/text.php
  41. 14
      main/inc/lib/pear/HTML/QuickForm/textarea.php
  42. 2
      main/inc/lib/pear/HTML/QuickForm/xbutton.php

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: QuickForm.php 17296 2008-12-15 17:08:44Z cfasanando $
// $Id: QuickForm.php,v 1.162 2006/10/07 20:12:17 avb Exp $
require_once('PEAR.php');
require_once('HTML/Common.php');
@ -62,9 +62,12 @@ $GLOBALS['_HTML_QuickForm_registered_rules'] = array(
'nopunctuation' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'),
'nonzero' => array('html_quickform_rule_regex', 'HTML/QuickForm/Rule/Regex.php'),
'callback' => array('html_quickform_rule_callback', 'HTML/QuickForm/Rule/Callback.php'),
// Added by Chamilo team, 16-MAR-2010
//'compare' => array('html_quickform_rule_compare', 'HTML/QuickForm/Rule/Compare.php')
'compare' => array('html_quickform_rule_compare', 'HTML/QuickForm/Rule/Compare.php'),
'comparedate' => array('html_quickform_rule_comparedate', 'HTML/QuickForm/Rule/CompareDate.php'),
'errordate' => array('html_quickform_rule_date', 'HTML/QuickForm/Rule/Date.php')
//
);
// {{{ error codes
@ -259,7 +262,10 @@ class HTML_QuickForm extends HTML_Common {
{
HTML_Common::HTML_Common($attributes);
$method = (strtoupper($method) == 'GET') ? 'get' : 'post';
// Modified by Chamilo team, 16-MAR-2010
//$action = ($action == '') ? $_SERVER['PHP_SELF'] : $action;
$action = ($action == '') ? api_get_self() : $action;
//
$target = empty($target) ? array() : array('target' => $target);
$attributes = array('action'=>$action, 'method'=>$method, 'name'=>$formName, 'id'=>$formName) + $target;
$this->updateAttributes($attributes);
@ -565,7 +571,7 @@ class HTML_QuickForm extends HTML_Common {
$className = $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][$type][1];
$includeFile = $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][$type][0];
include_once($includeFile);
// Suppressing a deprecation warning on PHP 5.3
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$elementObject =& new $className();
$elementObject = new $className();
//
@ -680,13 +686,9 @@ class HTML_QuickForm extends HTML_Common {
$this->_elements[$i + 1] =& $this->_elements[$i];
if ($this->_elementIndex[$currentName] == $i) {
$this->_elementIndex[$currentName] = $i + 1;
} else
{
if (is_array($this->_duplicateIndex[$currentName]))
{
$dupIdx = array_search($i, $this->_duplicateIndex[$currentName]);
$this->_duplicateIndex[$currentName][$dupIdx] = $i + 1;
}
} else {
$dupIdx = array_search($i, $this->_duplicateIndex[$currentName]);
$this->_duplicateIndex[$currentName][$dupIdx] = $i + 1;
}
unset($this->_elements[$i]);
}
@ -1667,7 +1669,7 @@ class HTML_QuickForm extends HTML_Common {
{
if (!isset($GLOBALS['_HTML_QuickForm_default_renderer'])) {
include_once('HTML/QuickForm/Renderer/Default.php');
// Suppressing a deprecation warning on PHP 5.3
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$GLOBALS['_HTML_QuickForm_default_renderer'] =& new HTML_QuickForm_Renderer_Default();
$GLOBALS['_HTML_QuickForm_default_renderer'] = new HTML_QuickForm_Renderer_Default();
//
@ -1827,7 +1829,7 @@ class HTML_QuickForm extends HTML_Common {
function toArray($collectHidden = false)
{
include_once 'HTML/QuickForm/Renderer/Array.php';
// Suppressing a deprecation warning on PHP 5.3
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$renderer =& new HTML_QuickForm_Renderer_Array($collectHidden);
$renderer = new HTML_QuickForm_Renderer_Array($collectHidden);
//

@ -16,7 +16,7 @@
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: Renderer.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Renderer.php,v 1.1 2003/03/08 17:02:07 mansion Exp $
/**
* An abstract base class for QuickForm renderers

@ -19,7 +19,7 @@
// | Thomas Schulz <ths@4bconsult.de> |
// +----------------------------------------------------------------------+
//
// $Id: Array.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Array.php,v 1.9 2004/10/15 20:00:48 ths Exp $
require_once 'HTML/QuickForm/Renderer.php';

@ -18,7 +18,7 @@
// | Thomas Schulz <ths@4bconsult.de> |
// +----------------------------------------------------------------------+
//
// $Id: ArraySmarty.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: ArraySmarty.php,v 1.11 2006/10/07 20:12:17 avb Exp $
require_once 'HTML/QuickForm/Renderer/Array.php';
@ -179,15 +179,15 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
$ret['error'] = $error;
}
// create keys for elements grouped by native group or name
if (api_strstr($ret['name'], '[') or $this->_currentGroup) {
if (strstr($ret['name'], '[') or $this->_currentGroup) {
// Fix for bug #8123: escape backslashes and quotes to prevent errors
// in eval(). The code below seems to handle the case where element
// name has unbalanced square brackets. Dunno whether we really
// need this after the fix for #8123, but I'm wary of making big
// changes to this code.
api_preg_match('/([^]]*)\\[([^]]*)\\]/', $ret['name'], $matches);
preg_match('/([^]]*)\\[([^]]*)\\]/', $ret['name'], $matches);
if (isset($matches[1])) {
$sKeysSub = api_substr_replace($ret['name'], '', 0, api_strlen($matches[1]));
$sKeysSub = substr_replace($ret['name'], '', 0, strlen($matches[1]));
$sKeysSub = str_replace(
array('\\', '\'', '[' , ']', '[\'\']'),
array('\\\\', '\\\'', '[\'', '\']', '[]' ),
@ -205,8 +205,8 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
return false;
}
// reduce string of keys by remove leading group keys
if (0 === api_strpos($sKeys, $this->_currentGroup['keys'])) {
$sKeys = api_substr_replace($sKeys, '', 0, api_strlen($this->_currentGroup['keys']));
if (0 === strpos($sKeys, $this->_currentGroup['keys'])) {
$sKeys = substr_replace($sKeys, '', 0, strlen($this->_currentGroup['keys']));
}
}
// element without a name
@ -217,7 +217,7 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
$sKeys = '[\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $ret['name']) . '\']';
}
// for radios: add extra key from value
if ('radio' == $ret['type'] and api_substr($sKeys, -2) != '[]') {
if ('radio' == $ret['type'] and substr($sKeys, -2) != '[]') {
$sKeys .= '[\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $ret['value']) . '\']';
}
$this->_elementIdx++;
@ -378,4 +378,4 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
$this->_error = $template;
} // end func setErrorTemplate
}
?>
?>

@ -18,7 +18,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Default.php 9612 2006-10-20 11:56:44Z bmol $
// $Id$
require_once('HTML/QuickForm/Renderer.php');

@ -16,7 +16,7 @@
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: ITDynamic.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: ITDynamic.php,v 1.5 2004/10/15 13:04:36 avb Exp $
require_once 'HTML/QuickForm/Renderer.php';

@ -16,7 +16,7 @@
// | Author: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: ITStatic.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: ITStatic.php,v 1.7 2004/06/28 14:20:22 avb Exp $
require_once('HTML/QuickForm/Renderer.php');

@ -16,7 +16,7 @@
// | Author: Ron McClain <ron@humaniq.com> |
// +----------------------------------------------------------------------+
//
// $Id: Object.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Object.php,v 1.4 2005/06/17 20:00:57 avb Exp $
require_once('HTML/QuickForm/Renderer.php');

@ -16,7 +16,7 @@
// | Author: Ron McClain <ron@humaniq.com> |
// +----------------------------------------------------------------------+
//
// $Id: ObjectFlexy.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: ObjectFlexy.php,v 1.8 2006/10/07 20:12:17 avb Exp $
require_once("HTML/QuickForm/Renderer/Object.php");
@ -139,7 +139,7 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
}
// Create an element key from the name
if (false !== ($pos = api_strpos($ret->name, '[')) || is_object($this->_currentGroup)) {
if (false !== ($pos = strpos($ret->name, '[')) || is_object($this->_currentGroup)) {
if (!$pos) {
$keys = '->{\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $ret->name) . '\'}';
} else {
@ -156,17 +156,17 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
return false;
}
// reduce string of keys by remove leading group keys
if (0 === api_strpos($keys, $this->_currentGroup->keys)) {
$keys = api_substr_replace($keys, '', 0, api_strlen($this->_currentGroup->keys));
if (0 === strpos($keys, $this->_currentGroup->keys)) {
$keys = substr_replace($keys, '', 0, strlen($this->_currentGroup->keys));
}
}
} elseif (0 == api_strlen($ret->name)) {
} elseif (0 == strlen($ret->name)) {
$keys = '->{\'element_' . $this->_elementIdx . '\'}';
} else {
$keys = '->{\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $ret->name) . '\'}';
}
// for radios: add extra key from value
if ('radio' == $ret->type && '[]' != api_substr($keys, -2)) {
if ('radio' == $ret->type && '[]' != substr($keys, -2)) {
$keys .= '->{\'' . str_replace(array('\\', '\''), array('\\\\', '\\\''), $ret->value) . '\'}';
}
$ret->keys = $keys;

@ -16,7 +16,7 @@
// | Authors: Jason Rust <jrust@rustyparts.com> |
// +----------------------------------------------------------------------+
//
// $Id: QuickHtml.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: QuickHtml.php,v 1.1 2003/08/25 16:41:02 jrust Exp $
require_once('HTML/QuickForm/Renderer/Default.php');

@ -16,7 +16,7 @@
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Rule.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Rule.php,v 1.2 2003/11/03 16:08:22 avb Exp $
class HTML_QuickForm_Rule
{

@ -16,7 +16,7 @@
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Callback.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Callback.php,v 1.7 2003/11/11 12:41:13 avb Exp $
require_once('HTML/QuickForm/Rule.php');

@ -16,7 +16,7 @@
// | Author: Alexey Borzov <avb@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: Compare.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Compare.php,v 1.3 2003/11/03 16:08:24 avb Exp $
require_once 'HTML/QuickForm/Rule.php';
@ -28,7 +28,7 @@ require_once 'HTML/QuickForm/Rule.php';
*
* @access public
* @package HTML_QuickForm
* @version $Revision: 6184 $
* @version $Revision: 1.3 $
*/
class HTML_QuickForm_Rule_Compare extends HTML_QuickForm_Rule
{

@ -16,7 +16,7 @@
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Email.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Email.php,v 1.4 2003/12/18 14:21:57 mansion Exp $
require_once('HTML/QuickForm/Rule.php');

@ -16,7 +16,7 @@
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Range.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: Range.php,v 1.6 2003/11/03 16:08:24 avb Exp $
require_once('HTML/QuickForm/Rule.php');
@ -36,7 +36,10 @@ class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
*/
function validate($value, $options)
{
// Modified by Ivan Tcholakov, 16-MAR-2010.
//$length = strlen($value);
$length = api_strlen($value);
//
switch ($this->name) {
case 'minlength': return ($length >= $options);
case 'maxlength': return ($length <= $options);
@ -61,4 +64,4 @@ class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Range
?>
?>

@ -16,7 +16,7 @@
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Regex.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Regex.php,v 1.3 2003/11/03 16:08:24 avb Exp $
require_once('HTML/QuickForm/Rule.php');

@ -16,7 +16,7 @@
// | Authors: Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: Required.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: Required.php,v 1.4 2005/06/18 20:58:33 avb Exp $
require_once('HTML/QuickForm/Rule.php');

@ -18,7 +18,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: RuleRegistry.php 9612 2006-10-20 11:56:44Z bmol $
// $Id: RuleRegistry.php,v 1.17 2006/06/20 22:09:15 avb Exp $
/**
* Registers rule objects and uses them for validation
@ -115,7 +115,7 @@ class HTML_QuickForm_RuleRegistry
if (!empty($path)) {
include_once($path);
}
// Suppressing a deprecation warning on PHP 5.3
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$this->_rules[$class] =& new $class();
$this->_rules[$class] = new $class();
//

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: advcheckbox.php 9612 2006-10-20 11:56:44Z bmol $
// $Id: advcheckbox.php,v 1.16 2006/06/20 16:33:06 avb Exp $
require_once('HTML/QuickForm/checkbox.php');

@ -23,7 +23,7 @@
// | http://www.sitepoint.com/article/1220 |
// +----------------------------------------------------------------------+
//
// $Id: autocomplete.php 9612 2006-10-20 11:56:44Z bmol $
// $Id: autocomplete.php,v 1.6 2005/08/05 16:33:56 avb Exp $
require_once("HTML/QuickForm/text.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: button.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: button.php,v 1.4 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: checkbox.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: checkbox.php,v 1.20 2005/07/22 17:30:51 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -18,7 +18,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: date.php 20682 2009-05-15 11:11:07Z ivantcholakov $
// $Id: date.php,v 1.57 2006/06/03 12:33:44 avb Exp $
require_once 'HTML/QuickForm/group.php';
require_once 'HTML/QuickForm/select.php';
@ -72,7 +72,11 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
'language' => 'en',
'format' => 'dMY',
'minYear' => 2001,
'maxYear' => 2090,
// Modified by Chamilo team, 16-MAR-2010.
// TODO: This modification to be rethinked.
//'maxYear' => 2090,
'maxYear' => 2010,
//
'addEmptyOption' => false,
'emptyOptionValue' => '',
'emptyOptionText' => '&nbsp;',
@ -297,9 +301,12 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
$separator = '';
$locale =& $this->_locale[$this->_options['language']];
$backslash = false;
// Modified by Ivan Tcholakov, 16-MAR-2010.
//for ($i = 0, $length = strlen($this->_options['format']); $i < $length; $i++) {
// $sign = $this->_options['format']{$i};
for ($i = 0, $length = api_strlen($this->_options['format']); $i < $length; $i++) {
//$sign = $this->_options['format']{$i};
$sign = api_substr($this->_options['format'], $i, 1);
//
if ($backslash) {
$backslash = false;
$separator .= $sign;
@ -494,4 +501,4 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
// }}}
}
?>
?>

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: element.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: element.php,v 1.34 2006/10/07 20:12:17 avb Exp $
require_once('HTML/Common.php');
@ -226,9 +226,12 @@ class HTML_QuickForm_element extends HTML_Common
function getFrozenHtml()
{
$value = $this->getValue();
global $charset;
return ('' != $value? htmlspecialchars($value, ENT_COMPAT, $charset): '&nbsp;') .
// Modified by Ivan Tcholakov, 16-MAR-2010.
//return ('' != $value? htmlspecialchars($value): '&nbsp;') .
// $this->_getPersistantData();
return ('' != $value ? @htmlspecialchars($value, ENT_COMPAT, HTML_Common::charset()): '&nbsp;') .
$this->_getPersistantData();
//
} //end func getFrozenHtml
// }}}
@ -483,4 +486,4 @@ class HTML_QuickForm_element extends HTML_Common
// }}}
} // end class HTML_QuickForm_element
?>
?>

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: file.php 9612 2006-10-20 11:56:44Z bmol $
// $Id: file.php,v 1.22 2006/10/07 20:12:17 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: group.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: group.php,v 1.38 2006/01/11 17:13:20 mansion Exp $
require_once("HTML/QuickForm/element.php");
@ -161,7 +161,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
} else {
$elementName = $this->_elements[$key]->getName();
$index = api_strlen($elementName) ? $elementName : $key;
$index = strlen($elementName) ? $elementName : $key;
if (is_array($value)) {
if (isset($value[$index])) {
$this->_elements[$key]->onQuickFormEvent('setGroupValue', $value[$index], $this);
@ -290,7 +290,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
function toHtml()
{
include_once('HTML/QuickForm/Renderer/Default.php');
// Suppressing a deprecation warning on PHP 5.3
// Modified by Ivan Tcholakov, 16-MAR-2010. Suppressing a deprecation warning on PHP 5.3
//$renderer =& new HTML_QuickForm_Renderer_Default();
$renderer = new HTML_QuickForm_Renderer_Default();
//
@ -436,7 +436,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
if ($this->_appendName) {
$elementName = $element->getName();
if (isset($elementName)) {
$element->setName($name . '['. (api_strlen($elementName)? $elementName: $key) .']');
$element->setName($name . '['. (strlen($elementName)? $elementName: $key) .']');
} else {
$element->setName($name);
}
@ -579,4 +579,4 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
// }}}
} //end class HTML_QuickForm_group
?>
?>

@ -16,7 +16,7 @@
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: header.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: header.php,v 1.1 2003/03/12 11:16:33 avb Exp $
require_once 'HTML/QuickForm/static.php';

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: hidden.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: hidden.php,v 1.10 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: hiddenselect.php 9612 2006-10-20 11:56:44Z bmol $
// $Id: hiddenselect.php,v 1.5 2006/10/07 21:18:41 avb Exp $
require_once('HTML/QuickForm/select.php');

@ -18,7 +18,7 @@
// | Alexey Borzov <avb@php.net>
// +----------------------------------------------------------------------+
//
// $Id: hierselect.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: hierselect.php,v 1.18 2006/10/07 15:07:48 avb Exp $
require_once('HTML/QuickForm/group.php');
require_once('HTML/QuickForm/select.php');
@ -480,8 +480,8 @@ JAVASCRIPT;
// add onreset handler to form to properly reset hierselect (see bug #2970)
if ('addElement' == $event) {
$onReset = $caller->getAttribute('onreset');
if (api_strlen($onReset)) {
if (api_strpos($onReset, '_hs_setupOnReset')) {
if (strlen($onReset)) {
if (strpos($onReset, '_hs_setupOnReset')) {
$caller->updateAttributes(array('onreset' => str_replace('_hs_setupOnReset(this, [', "_hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "', ", $onReset)));
} else {
$caller->updateAttributes(array('onreset' => "var temp = function() { {$onReset} } ; if (!temp()) { return false; } ; if (typeof _hs_setupOnReset != 'undefined') { return _hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "']); } "));
@ -575,4 +575,4 @@ JAVASCRIPT;
// }}}
} // end class HTML_QuickForm_hierselect
?>
?>

@ -16,7 +16,7 @@
// | Author: Alexey Borzov <borz_off@cs.msu.su> |
// +----------------------------------------------------------------------+
//
// $Id: html.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: html.php,v 1.1 2003/03/12 11:16:33 avb Exp $
require_once 'HTML/QuickForm/static.php';

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: image.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: image.php,v 1.4 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/input.php");
/**

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: input.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: input.php,v 1.8 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/element.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: password.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: password.php,v 1.6 2004/02/28 22:10:16 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: radio.php 9612 2006-10-20 11:56:44Z bmol $
// $Id: radio.php,v 1.18 2006/10/07 15:18:16 avb Exp $
require_once('HTML/QuickForm/input.php');

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: reset.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: reset.php,v 1.4 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: select.php 12243 2007-05-02 21:00:52Z yannoo $
// $Id: select.php,v 1.31 2006/06/03 12:03:46 avb Exp $
require_once('HTML/QuickForm/element.php');
@ -446,9 +446,12 @@ class HTML_QuickForm_select extends HTML_QuickForm_element {
case (is_a($options, 'db_result')):
return $this->loadDbResult($options, $param1, $param2, $param3);
break;
// Disabled by Chamilo team, 16-MAR-2010.
// TODO: To be verified (why it has been disabled).
//case (is_string($options) && !empty($options) || is_subclass_of($options, "db_common")):
// return $this->loadQuery($options, $param1, $param2, $param3, $param4);
// break;
//
}
} // end func load

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: static.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: static.php,v 1.6 2003/06/16 13:06:26 avb Exp $
require_once("HTML/QuickForm/element.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: submit.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: submit.php,v 1.4 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: text.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: text.php,v 1.5 2003/06/18 19:36:20 avb Exp $
require_once("HTML/QuickForm/input.php");

@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
// $Id: textarea.php 20456 2009-05-10 17:27:44Z ivantcholakov $
// $Id: textarea.php,v 1.11 2004/02/28 22:10:16 avb Exp $
require_once("HTML/QuickForm/element.php");
@ -187,11 +187,13 @@ class HTML_QuickForm_textarea extends HTML_QuickForm_element
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
global $charset;
return $this->_getTabs() .
'<textarea' . $this->_getAttrString($this->_attributes) . '>' .
// because we wrap the form later we don't want the text indented
preg_replace("/(\r\n|\n|\r)/", '&#010;', htmlspecialchars($this->_value, ENT_COMPAT, $charset)) .
// Modified by Ivan Tcholakov, 16-MAR-2010.
//preg_replace("/(\r\n|\n|\r)/", '&#010;', htmlspecialchars($this->_value)) .
preg_replace("/(\r\n|\n|\r)/", '&#010;', @htmlspecialchars($this->_value, ENT_COMPAT, HTML_Common::charset())) .
//
'</textarea>';
}
} //end func toHtml
@ -208,8 +210,10 @@ class HTML_QuickForm_textarea extends HTML_QuickForm_element
*/
function getFrozenHtml()
{
global $charset;
$value = htmlspecialchars($this->getValue(), ENT_COMPAT, $charset);
// Modified by Ivan Tcholakov, 16-MAR-2010.
//$value = htmlspecialchars($this->getValue());
$value = @htmlspecialchars($this->getValue(), ENT_COMPAT, HTML_Common::charset());
//
if ($this->getAttribute('wrap') == 'off') {
$html = $this->_getTabs() . '<pre>' . $value."</pre>\n";
} else {

@ -16,7 +16,7 @@
// | Authors: Alexey Borzov <avb@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: xbutton.php 6184 2005-09-07 10:08:17Z bmol $
// $Id: xbutton.php,v 1.1 2004/05/18 09:46:46 avb Exp $
require_once 'HTML/QuickForm/element.php';

Loading…
Cancel
Save