]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
I had my user info hardcoded... oops.
authorCraig Andrews <candrews@integralblue.com>
Thu, 6 Aug 2009 19:19:33 +0000 (15:19 -0400)
committerCraig Andrews <candrews@integralblue.com>
Thu, 6 Aug 2009 19:19:33 +0000 (15:19 -0400)
plugins/Autocomplete/AutocompletePlugin.php

index ddb0dea329d9989526f431005d89ee885aa2317b..58b6a84cabe20b5a855f8956b9705568ed6cc709 100644 (file)
@@ -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');
+        }
     }
 
 }