Minahito
minah****@users*****
2007年 1月 17日 (水) 17:22:48 JST
Index: xoops2jp/html/core/XCube_Delegate.class.php diff -u xoops2jp/html/core/XCube_Delegate.class.php:1.1.2.4 xoops2jp/html/core/XCube_Delegate.class.php:1.1.2.5 --- xoops2jp/html/core/XCube_Delegate.class.php:1.1.2.4 Tue Dec 26 23:30:54 2006 +++ xoops2jp/html/core/XCube_Delegate.class.php Wed Jan 17 17:22:48 2007 @@ -2,7 +2,7 @@ /** * * @package XCube - * @version $Id: XCube_Delegate.class.php,v 1.1.2.4 2006/12/26 14:30:54 nobunobu Exp $ + * @version $Id: XCube_Delegate.class.php,v 1.1.2.5 2007/01/17 08:22:48 minahito Exp $ * @copyright Copyright 2005, 2006 XOOPS Cube Project <http://xoopscube.org/> * @license http://xoopscube.sourceforge.net/bsd_licenses.txt Modified BSD license * @@ -294,6 +294,16 @@ } } + /** + * Gets a value indicating whether this object has callback functions. + * @public + * @return bool + */ + function isEmpty() + { + return (count($this->_mCallbacks) == 0); + } + function getID() { return $this->_mUniqueID; @@ -301,13 +311,6 @@ } /** - * Compatibility class name. - */ -class XCube_NewDelegate extends XCube_Delegate -{ -} - -/** * This is the agent of un-registered delegate objects. Usually, connected * functions can't be added to un-registered delegates. When destination * delegates are un-registered yet, this manager is keeping those functions @@ -424,6 +427,21 @@ } } + /** + * Gets a value indicating whether the specified delegate has callback functions. + * @public + * @param string $name delegate's name + * @return bool + */ + function isEmpty($name) + { + if (isset($this->_mDelegates[$name])) { + return $this->_mDelegates[$name]->isEmpty(); + } + + return isset($this->_mCallbacks[$name]) ? (count($this->_mCallbacks[$name]) == 0) : false; + } + /** *