summaryrefslogtreecommitdiff
path: root/plugins/Autocomplete
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-06 15:19:33 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-06 15:19:33 -0400
commit380c48662673d64214e64766f38014c6057d3142 (patch)
tree8af494170ec787dd3ef0d782ac8e601cb6125e99 /plugins/Autocomplete
parent26b608d914bb5a04c2285111588cbdad12a5a936 (diff)
I had my user info hardcoded... oops.
Diffstat (limited to 'plugins/Autocomplete')
-rw-r--r--plugins/Autocomplete/AutocompletePlugin.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php
index ddb0dea32..58b6a84ca 100644
--- a/plugins/Autocomplete/AutocompletePlugin.php
+++ b/plugins/Autocomplete/AutocompletePlugin.php
@@ -39,19 +39,24 @@ class AutocompletePlugin extends Plugin
}
function onEndShowScripts($action){
- $js_string = <<<EOT
+ if (common_logged_in()) {
+ $current_user = common_current_user();
+ $js_string = <<<EOT
<script type="text/javascript">
-var current_user = { screen_name: 'CANDREWS', id: '1' };
+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');
+ $action->raw($js_string);
+ $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js');
+ $action->script('plugins/Autocomplete/Autocomplete.js');
+ }
}
function onEndShowLaconicaStyles($action)
{
- $action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css');
+ if (common_logged_in()) {
+ $action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css');
+ }
}
}