Selaa lähdekoodia

Porting plugin engine to PHP4

pecesama 15 vuotta sitten
vanhempi
commit
fa676b0fa4
3 muutettua tiedostoa jossa 9 lisäystä ja 7 poistoa
  1. 1 1
      admin/options.php
  2. 7 5
      classes/plugin.class.php
  3. 1 1
      plugins/kodrs.php

+ 1 - 1
admin/options.php Näytä tiedosto

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

+ 7 - 5
classes/plugin.class.php Näytä tiedosto

66
             return $this->exists[$name] = false;
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 Näytä tiedosto

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