use onAutoload instead of always requiring
This commit is contained in:
parent
809e597841
commit
f91e992851
@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php');
|
|
||||||
|
|
||||||
class AutocompletePlugin extends Plugin
|
class AutocompletePlugin extends Plugin
|
||||||
{
|
{
|
||||||
function __construct()
|
function __construct()
|
||||||
@ -40,6 +38,16 @@ class AutocompletePlugin extends Plugin
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onAutoload($cls)
|
||||||
|
{
|
||||||
|
switch ($cls)
|
||||||
|
{
|
||||||
|
case 'AutocompleteAction':
|
||||||
|
require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onEndShowScripts($action){
|
function onEndShowScripts($action){
|
||||||
if (common_logged_in()) {
|
if (common_logged_in()) {
|
||||||
$action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js');
|
$action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js');
|
||||||
|
Loading…
Reference in New Issue
Block a user