*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: MANAGER.php,v 1.7 2007-02-04 06:28:46 kimitake Exp $
- * $NucleusJP: MANAGER.php,v 1.6 2006/07/20 08:01:52 kimitake Exp $
+ * @version $Id: MANAGER.php,v 1.8 2007-04-06 19:36:29 kmorimatsu Exp $
+ * $NucleusJP: MANAGER.php,v 1.7 2007/02/04 06:28:46 kimitake Exp $
*/
class MANAGER {
}
/**
+ * checks if the given plugin IS loaded or not
+ */
+ function &pluginLoaded($name) {
+ $plugin =& $this->plugins[$name];
+ return $plugin;
+ }
+ function &pidLoaded($pid) {
+ $plugin=false;
+ reset($this->plugins);
+ while (list($name) = each($this->plugins)) {
+ if ($pid!=$this->plugins[$name]->getId()) continue;
+ $plugin= & $this->plugins[$name];
+ break;
+ }
+ return $plugin;
+ }
+
+ /**
* checks if the given plugin IS installed or not
*/
function pluginInstalled($name) {
*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PLUGIN.php,v 1.10 2007-03-30 22:18:28 kmorimatsu Exp $
- * $NucleusJP: PLUGIN.php,v 1.9 2007/03/13 05:03:23 shizuki Exp $
+ * @version $Id: PLUGIN.php,v 1.11 2007-04-06 19:36:29 kmorimatsu Exp $
+ * $NucleusJP: PLUGIN.php,v 1.10 2007/03/30 22:18:28 kmorimatsu Exp $
*/
class NucleusPlugin {
$this->plugin_options = 0;
}
+ function clearOptionValueCache(){
+ $this->_aOptionValues = array();
+ }
+
// private
function _createOption($context, $name, $desc, $type, $defValue, $typeExtras = '') {
// create in plugin_option_desc
$res = sql_query($query);
if ($o = mysql_fetch_object($res))
{
- foreach ($values as $contextid => $value) {
+ foreach ($values as $key => $value) {
+ // avoid overriding the key used by foreach statement
+ $contextid=$key;
+
// retreive any metadata
$meta = NucleusPlugin::getOptionMeta($o->oextra);
}
}
}
+ // clear option value cache if the plugin object is already loaded
+ if (is_object($o)) {
+ $plugin=& $manager->pidLoaded($o->opid);
+ if ($plugin) $plugin->clearOptionValueCache();
+ }
}
}