summaryrefslogtreecommitdiff
path: root/plugins/Autocomplete
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-04-22 18:03:05 -0400
committerCraig Andrews <candrews@integralblue.com>2010-04-22 18:04:03 -0400
commitf91e99285196a3ef6d4f570e4839f7a4d87d5890 (patch)
tree111d9500a4f108bbdee30f341ae195bf4fb9f990 /plugins/Autocomplete
parent809e597841d1337b641784eee21d5e9b5dc297e1 (diff)
use onAutoload instead of always requiring
Diffstat (limited to 'plugins/Autocomplete')
-rw-r--r--plugins/Autocomplete/AutocompletePlugin.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php
index d586631a4..b2b18bf27 100644
--- a/plugins/Autocomplete/AutocompletePlugin.php
+++ b/plugins/Autocomplete/AutocompletePlugin.php
@@ -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');