diff options
author | Brion Vibber <brion@pobox.com> | 2009-10-12 21:01:34 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-10-12 21:01:34 +0000 |
commit | 18df82ba2302d5b72bc42f4d3296d6fff7d16341 (patch) | |
tree | ce2f955ff860b8d7355d64391d68a0f955067ec9 /plugins/Autocomplete/AutocompletePlugin.php | |
parent | 131292472c4bca7e99ee821ae62853f36f4c7bef (diff) | |
parent | 2b6dfbdf2b9df0992018f8df1f54b4cf16185599 (diff) |
Merge branch '0.8.x' of git://gitorious.org/~brion/statusnet/brion-fixes into 0.8.x
Diffstat (limited to 'plugins/Autocomplete/AutocompletePlugin.php')
-rw-r--r-- | plugins/Autocomplete/AutocompletePlugin.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index b75397270..baaec73c1 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -31,6 +31,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php'); + class AutocompletePlugin extends Plugin { function __construct() @@ -40,13 +42,6 @@ class AutocompletePlugin extends Plugin function onEndShowScripts($action){ if (common_logged_in()) { - $current_user = common_current_user(); - $js_string = <<<EOT -<script type="text/javascript"> -var current_user = { id: '$current_user->id' }; -</script> -EOT; - $action->raw($js_string); $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js'); $action->script('plugins/Autocomplete/Autocomplete.js'); } @@ -59,5 +54,12 @@ EOT; } } + function onRouterInitialized($m) + { + if (common_logged_in()) { + $m->connect('plugins/Autocomplete/autocomplete.json', array('action'=>'autocomplete')); + } + } + } ?> |