Just a few fixes with plugins

master
vbracco 2008-10-31 14:56:09 +00:00
parent d3d420eb6e
commit 1d00d46f5d
2 changed files with 15 additions and 10 deletions

View File

@ -652,7 +652,7 @@ if(!defined('entry') || !entry) die('Not a valid page');
foreach ($conf->plugins as $index => $plugin) { foreach ($conf->plugins as $index => $plugin) {
//echo "[".$index."] => ".$plugin."<br />"; //echo "[".$index."] => ".$plugin."<br />";
if (!file_exists("plugins/".$plugin.".php")) { if (!file_exists(Absolute_Path."plugins/".$plugin.".php")) {
//echo "\tNo existe el archivo<br />"; //echo "\tNo existe el archivo<br />";
unset($conf->plugins[$index]); unset($conf->plugins[$index]);
continue; continue;

View File

@ -28,14 +28,17 @@ if(!defined('entry') || !entry) die('Not a valid page');
echo "<br />";*/ echo "<br />";*/
$index = 0; $index = 0;
foreach (plugins::$instances as $plugin) { foreach (plugins::$instances as $plugin) {
$action = $this->actions[$name][$index][1]; if(array_key_exists($index,$this->actions[$name])){
if (is_callable(array($plugin, $action))) { $action = $this->actions[$name][$index][1];
$plugin->$action(); if (is_callable(array($plugin, $action))) {
//echo "ejecutar: ".$action."()<br/>";
$plugin->$action();
$index++;
}
} }
$index++;
} }
} }
function exists($name) { function exists($name) {
if (isset($this->exists[$name])) { if (isset($this->exists[$name])) {
@ -50,9 +53,11 @@ if(!defined('entry') || !entry) die('Not a valid page');
print_r($this->actions[$name]); print_r($this->actions[$name]);
echo "<br />"; echo "<br />";
echo $this->actions[$name][0][1]; echo $this->actions[$name][0][1];
echo "<br />";*/ echo "<br />";*/
if (is_callable(array($plugin, $this->actions[$name][0][1]))) { if(array_key_exists($name,$this->actions)){
return $this->exists[$name] = true; if (is_callable(array($plugin, $this->actions[$name][0][1]))) {
return $this->exists[$name] = true;
}
} }
} }