Преглед на файлове

Just a few fixes with plugins

vbracco преди 15 години
родител
ревизия
1d00d46f5d
променени са 2 файла, в които са добавени 15 реда и са изтрити 10 реда
  1. 1 1
      classes/functions.php
  2. 14 9
      classes/plugin.class.php

+ 1 - 1
classes/functions.php Целия файл

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

+ 14 - 9
classes/plugin.class.php Целия файл

@@ -28,14 +28,17 @@ if(!defined('entry') || !entry) die('Not a valid page');
28 28
 			echo "<br />";*/
29 29
 			
30 30
 			$index = 0;
31
-            foreach (plugins::$instances as $plugin) {				
32
-				$action = $this->actions[$name][$index][1];                
33
-				if (is_callable(array($plugin, $action))) {                    
34
-					$plugin->$action();
31
+            foreach (plugins::$instances as $plugin) {
32
+				if(array_key_exists($index,$this->actions[$name])){
33
+					$action = $this->actions[$name][$index][1]; 
34
+					if (is_callable(array($plugin, $action))) {
35
+						//echo "ejecutar: ".$action."()<br/>";					
36
+						$plugin->$action();
37
+						$index++;
38
+					}
35 39
 				}
36
-				$index++;
37 40
 			}
38
-        }
41
+        }	
39 42
         
40 43
 		function exists($name) {
41 44
             if (isset($this->exists[$name])) {
@@ -50,9 +53,11 @@ if(!defined('entry') || !entry) die('Not a valid page');
50 53
 				print_r($this->actions[$name]);
51 54
 				echo "<br />";
52 55
 				echo $this->actions[$name][0][1];
53
-				echo "<br />";*/                
54
-				if (is_callable(array($plugin, $this->actions[$name][0][1]))) {
55
-                    return $this->exists[$name] = true;
56
+				echo "<br />";*/
57
+				if(array_key_exists($name,$this->actions)){
58
+					if (is_callable(array($plugin, $this->actions[$name][0][1]))) {
59
+						return $this->exists[$name] = true;
60
+					}
56 61
 				}
57 62
 			}
58 63