Ryuji AMANO
ryuji_amano****@users*****
2006年 10月 7日 (土) 17:54:31 JST
Index: xoops2jp/html/core/XCube_Theme.class.php diff -u xoops2jp/html/core/XCube_Theme.class.php:1.1.2.1 xoops2jp/html/core/XCube_Theme.class.php:1.1.2.2 --- xoops2jp/html/core/XCube_Theme.class.php:1.1.2.1 Fri Sep 29 17:13:22 2006 +++ xoops2jp/html/core/XCube_Theme.class.php Sat Oct 7 17:54:31 2006 @@ -1,7 +1,7 @@ <?php /** * @package XCube - * @version $Id: XCube_Theme.class.php,v 1.1.2.1 2006/09/29 08:13:22 minahito Exp $ + * @version $Id: XCube_Theme.class.php,v 1.1.2.2 2006/10/07 08:54:31 ryuji_amano Exp $ */ /** @@ -72,13 +72,13 @@ { if (file_exists($file)) { $this->_mManifesto = parse_ini_file($file, true); - $this->mName = $this->_mManifesto['Manifesto']['Name']; - $this->mDepends = $this->_mManifesto['Manifesto']['Depends']; - $this->mVersion = $this->_mManifesto['Manifesto']['Version']; - $this->mUrl = $this->_mManifesto['Manifesto']['Url']; + $this->mName = isset($this->_mManifesto['Manifesto']['Name']) ? $this->_mManifesto['Manifesto']['Name'] : ""; + $this->mDepends = isset($this->_mManifesto['Manifesto']['Depends']) ? $this->_mManifesto['Manifesto']['Depends'] : ""; + $this->mVersion = isset($this->_mManifesto['Manifesto']['Version']) ? $this->_mManifesto['Manifesto']['Version'] : ""; + $this->mUrl = isset($this->_mManifesto['Manifesto']['Url']) ? $this->_mManifesto['Manifesto']['Url'] : ""; - $this->mRenderSystemName = $this->_mManifesto['Theme']['RenderSystem']; - $this->mAuthor = $this->_mManifesto['Theme']['Author']; + $this->mRenderSystemName = isset($this->_mManifesto['Theme']['RenderSystem']) ? $this->_mManifesto['Theme']['RenderSystem'] : ""; + $this->mAuthor = isset($this->_mManifesto['Theme']['Author']) ? $this->_mManifesto['Theme']['Author'] : ""; if (isset($this->_mManifesto['Theme']['ScreenShot'])) { $this->mScreenShot = $this->_mManifesto['Theme']['ScreenShot']; @@ -88,7 +88,7 @@ $this->mDescription = $this->_mManifesto['Theme']['Description']; } - $this->mFormat = $this->_mManifesto['Theme']['Format']; + $this->mFormat = isset($this->_mManifesto['Theme']['Format']) ? $this->_mManifesto['Theme']['Format'] : ""; return true; } Index: xoops2jp/html/core/XCube_Delegate.class.php diff -u xoops2jp/html/core/XCube_Delegate.class.php:1.1.2.1 xoops2jp/html/core/XCube_Delegate.class.php:1.1.2.2 --- xoops2jp/html/core/XCube_Delegate.class.php:1.1.2.1 Fri Sep 29 17:13:22 2006 +++ xoops2jp/html/core/XCube_Delegate.class.php Sat Oct 7 17:54:31 2006 @@ -1,7 +1,6 @@ <?php /** - * @package XCube - * @version $Id: XCube_Delegate.class.php,v 1.1.2.1 2006/09/29 08:13:22 minahito Exp $ + * @version $Id: XCube_Delegate.class.php,v 1.1.2.2 2006/10/07 08:54:31 ryuji_amano Exp $ */ @@ -72,7 +71,8 @@ * This is register name for lazy registering. */ var $_mLazyRegisterName = null; - + + var $_mUniqueID; /** * Constructor. The parameter of the constructor is a variable argument * style to specify the sigunature of this delegate. If the argument is @@ -89,6 +89,7 @@ if (func_num_args() > 0) { $this->_setSignatures(func_get_args()); } + $this->_mUniqueID = md5(uniqid(rand(), true)); } /** @@ -288,6 +289,11 @@ } } } + + function getID() + { + return $this->_mUniqueID; + } } /** @@ -329,15 +335,13 @@ */ function register($name, &$delegate) { - if (!isset($this->_mDelegates[$name])) { - $this->_mDelegates[$name] =& $delegate; + if (!isset($this->_mDelegates[$name][$delegate->getID()])) { + $this->_mDelegates[$name][$delegate->getID()] =& $delegate; if (isset($this->_mCallbacks[$name]) && count($this->_mCallbacks[$name]) > 0) { foreach (array_keys($this->_mCallbacks[$name]) as $key) { $delegate->add($this->_mCallbacks[$name][$key], $this->_mCallbackParameters[$name][$key][0], $this->_mCallbackParameters[$name][$key][1]); } - unset($this->_mCallbacks[$name]); - unset($this->_mCallbackParameters[$name]); } return true; @@ -362,12 +366,12 @@ function add($name, $callback, $param3 = null, $param4 = null) { if (isset($this->_mDelegates[$name])) { - $this->_mDelegates[$name]->add($callback, $param3, $param4); - } - else { - $this->_mCallbacks[$name][] = $callback; - $this->_mCallbackParameters[$name][] = array('0' => $param3, '1' => $param4); + foreach(array_keys($this->_mDelegates[$name]) as $key) { + $this->_mDelegates[$name][$key]->add($callback, $param3, $param4); + } } + $this->_mCallbacks[$name][] = $callback; + $this->_mCallbackParameters[$name][] = array('0' => $param3, '1' => $param4); } /** @@ -381,18 +385,19 @@ function delete($name, $delcallback) { if (isset($this->_mDelegates[$name])) { - $this->_mDelegates[$name]->delete($delcallback); - } else { - if (isset($this->_mCallbacks[$name])) { - foreach(array_keys($this->_mCallbacks[$name]) as $key) { - $callback = $this->_mCallbacks[$name][$key]; - if (XCube_DelegateUtils::_compareCallback($callback, $delcallback)) { - unset($this->_mCallbacks[$name][$key]); - unset($this->_mCallbackParameters[$name][$key]); - } - } - } - } + foreach(array_keys($this->_mDelegates[$name]) as $key) { + $this->_mDelegates[$name][$key]->delete($delcallback); + } + } + if (isset($this->_mCallbacks[$name])) { + foreach(array_keys($this->_mCallbacks[$name]) as $key) { + $callback = $this->_mCallbacks[$name][$key]; + if (XCube_DelegateUtils::_compareCallback($callback, $delcallback)) { + unset($this->_mCallbacks[$name][$key]); + unset($this->_mCallbackParameters[$name][$key]); + } + } + } } /** @@ -405,13 +410,14 @@ function reset($name) { if (isset($this->_mDelegates[$name])) { - $this->_mDelegates[$name]->reset(); - } else { - if (isset($this->_mCallbacks[$name])) { - unset($this->_mCallbacks[$name]); - unset($this->_mCallbackParameters[$name]); - } - } + foreach(array_keys($this->_mDelegates[$name]) as $key) { + $this->_mDelegates[$name][$key]->reset(); + } + } + if (isset($this->_mCallbacks[$name])) { + unset($this->_mCallbacks[$name]); + unset($this->_mCallbackParameters[$name]); + } } @@ -459,7 +465,8 @@ if ($root->mDelegateManager != null) { $delegates = $root->mDelegateManager->getDelegates(); if (isset($delegates[$delegateName])) { - $delegate =& $delegates[$delegateName]; + $keys = array_keys($delegates[$delegateName]); + $delegate =& $delegates[$delegateName][$keys[0]]; } else { $delegate =& new XCube_Delegate; $root->mDelegateManager->register($delegateName, $delegate);