]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use onAutoload instead of always requiring
authorCraig Andrews <candrews@integralblue.com>
Thu, 22 Apr 2010 22:03:05 +0000 (18:03 -0400)
committerCraig Andrews <candrews@integralblue.com>
Thu, 22 Apr 2010 22:04:03 +0000 (18:04 -0400)
plugins/Autocomplete/AutocompletePlugin.php

index d586631a4a09dd4542784c1c7c0c2b239c9b137c..b2b18bf275681c76bcd13d836ec504f9a7d50259 100644 (file)
@@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php');
-
 class AutocompletePlugin extends Plugin
 {
     function __construct()
@@ -40,6 +38,16 @@ class AutocompletePlugin extends Plugin
         parent::__construct();
     }
 
+    function onAutoload($cls)
+    {
+        switch ($cls)
+        {
+         case 'AutocompleteAction':
+            require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php');
+            return false;
+        }
+    }
+
     function onEndShowScripts($action){
         if (common_logged_in()) {
             $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js');