cvs: pear /HTML_Progress2 Progress2.php
| From: | Laurent Laville | Date: | Mon, 01 Aug 2005 08:14:23 +0000 |
| Subject: | cvs: pear /HTML_Progress2 Progress2.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33494@lists.php.net to get a copy of this message | ||
farell Mon Aug 1 04:14:23 2005 EDT
Modified files:
/pear/HTML_Progress2 Progress2.php
Log:
- removed filter option on addListener() and removeListener() : see also progress monitor
http://cvs.php.net/diff.php/pear/HTML_Progress2/Progress2.php?r1=1.6&r2=1.7&ty=u
Index: pear/HTML_Progress2/Progress2.php
diff -u pear/HTML_Progress2/Progress2.php:1.6 pear/HTML_Progress2/Progress2.php:1.7
--- pear/HTML_Progress2/Progress2.php:1.6 Mon Aug 1 02:56:59 2005
+++ pear/HTML_Progress2/Progress2.php Mon Aug 1 04:14:22 2005
@@ -17,7 +17,7 @@
* @author Laurent Laville <pear@laurent-laville.org>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Progress2.php,v 1.6 2005/08/01 06:56:59 farell Exp $
+ * @version CVS: $Id: Progress2.php,v 1.7 2005/08/01 08:14:22 farell Exp $
* @link http://pear.php.net/package/HTML_Progress2
*/
@@ -2434,7 +2434,6 @@
. 'position:' . $progressAttr['position'] . ';'
. 'top:' . $progressAttr['top'] . 'px;'
. 'left:' . $progressAttr['left'] . 'px;'
- . 'padding-bottom:{_heightshift_}px;'
. 'height:{_heightshift_}px;">'
. PHP_EOL;
}
@@ -2805,30 +2804,18 @@
* @see removeListener()
* @tutorial progress.addlistener.pkg
*/
- function addListener($callback, $filter = true)
+ function addListener($callback)
{
if (!is_callable($callback)) {
- return $this->raiseError(HTML_PROGRESS2_ERROR_INVALID_CALLBACK, 'warning',
+ return $this->raiseError(HTML_PROGRESS2_ERROR_INVALID_CALLBACK,
'exception',
array('var' => '$callback',
'element' => 'valid Class-Method/Function',
'was' => 'callback',
'paramnum' => 1));
-
- } elseif (!is_bool($filter)) {
- return $this->raiseError(HTML_PROGRESS2_ERROR_INVALID_CALLBACK, 'warning',
- array('var' => '$filter',
- 'element' => 'boolean',
- 'was' => gettype($filter),
- 'paramnum' => 2));
}
$this->dispatcher =& Event_Dispatcher::getInstance();
-
- if ($filter) {
- $this->dispatcher->addObserver($callback, null, get_class($this));
- } else {
- $this->dispatcher->addObserver($callback);
- }
+ $this->dispatcher->addObserver($callback);
$this->_observerCount++;
}
@@ -2840,12 +2827,21 @@
* @return bool True if observer was removed, false otherwise
* @since 2.0.0
* @access public
+ * @throws HTML_PROGRESS2_ERROR_INVALID_CALLBACK
* @see addListener()
* @tutorial progress.removelistener.pkg
*/
function removeListener($callback)
{
- $result = $this->dispatcher->removeObserver($callback, null, get_class($this));
+ if (!is_callable($callback)) {
+ return $this->raiseError(HTML_PROGRESS2_ERROR_INVALID_CALLBACK,
'exception',
+ array('var' => '$callback',
+ 'element' => 'valid Class-Method/Function',
+ 'was' => 'callback',
+ 'paramnum' => 1));
+ }
+
+ $result = $this->dispatcher->removeObserver($callback);
if ($result) {
$this->_observerCount--;