Browse Source

Porting plugin engine to PHP4

pecesama 15 years ago
parent
commit
fa676b0fa4
3 changed files with 9 additions and 7 deletions
  1. 1 1
      admin/options.php
  2. 7 5
      classes/plugin.class.php
  3. 1 1
      plugins/kodrs.php

+ 1 - 1
admin/options.php View File

@@ -233,7 +233,7 @@ if ($user->isAdmin()) {
233 233
 											<option value="0" <?php if(!$conf->check_version) echo "selected=\"selected\""; ?>><?php echo __("Deactive")?></option>
234 234
 										</select>
235 235
 									</li>
236
-<?php	
236
+<?php	print_r($trigger);echo "<br>";die("Antes de trigger->call add options panel");
237 237
 									$trigger->call('add_options_panel');	
238 238
 ?>									
239 239
 								</ul>

+ 7 - 5
classes/plugin.class.php View File

@@ -66,12 +66,14 @@ if(!defined('entry') || !entry) die('Not a valid page');
66 66
             return $this->exists[$name] = false;
67 67
         }		
68 68
         
69
-		function & instance(){
70
-			static $instance;
71
-			if( !isset($instance) ) {
72
-				$instance = new plugin();
69
+		function instance(){
70
+			//$instance;			
71
+			if( !isset($GLOBALS['$instance']) ) {
72
+				$GLOBALS['$instance'] = new plugin();
73 73
 			}
74
-			return $instance;
74
+			//print_r($GLOBALS['$instance']);
75
+			//die();
76
+			return $GLOBALS['$instance'];
75 77
         }
76 78
 		
77 79
 	}

+ 1 - 1
plugins/kodrs.php View File

@@ -38,7 +38,7 @@ class kodrs extends plugins {
38 38
 		}
39 39
 	}
40 40
 	
41
-	static function replace_with_geshi($matches) {		
41
+	function replace_with_geshi($matches) {		
42 42
 		$lang = strtolower($matches[1])	;		
43 43
 		$code = trim($matches[2]);
44 44
 		$geshi = new geshi($code, (isset($lang)) ? $lang : "");