]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3610 $guid was not defined
authorcash <cash.costello@gmail.com>
Sat, 25 Jun 2011 14:43:42 +0000 (10:43 -0400)
committercash <cash.costello@gmail.com>
Sat, 25 Jun 2011 14:43:42 +0000 (10:43 -0400)
js/lib/ui.js
mod/likes/start.php
mod/likes/views/default/likes/count.php
mod/likes/views/default/likes/js.php [new file with mode: 0644]

index 692311d730c9979d7fe20eb6d0ff43af9db9bd62..89a996122d09dbe8aea5f309b709880e66978d6d 100644 (file)
@@ -227,25 +227,6 @@ elgg.ui.requiresConfirmation = function(e) {
        }
 };
 
-/**
- * Repositions the likes popup
- *
- * @param {String} hook    'getOptions'
- * @param {String} type    'ui.popup'
- * @param {Object} params  An array of info about the target and source.
- * @param {Object} options Options to pass to
- *
- * @return {Object}
- */
-elgg.ui.likesPopupHandler = function(hook, type, params, options) {
-       if (params.target.hasClass('elgg-likes-list')) {
-               options.my = 'right bottom';
-               options.at = 'left top';
-               return options;
-       }
-       return null;
-};
-
 /**
  * Repositions the login popup
  *
@@ -266,5 +247,4 @@ elgg.ui.LoginHandler = function(hook, type, params, options) {
 };
 
 elgg.register_hook_handler('init', 'system', elgg.ui.init);
-elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler);
 elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.LoginHandler);
\ No newline at end of file
index df1c7b109a0f6231d57d88617a65fcfee4f054c7..d45fb96b3da6f6e95d2fe00db6515ea336bbb6e3 100644 (file)
@@ -9,6 +9,7 @@ elgg_register_event_handler('init', 'system', 'likes_init');
 function likes_init() {
 
        elgg_extend_view('css/elgg', 'likes/css');
+       elgg_extend_view('js/elgg', 'likes/js');
 
        // registered with priority < 500 so other plugins can remove likes
        elgg_register_plugin_hook_handler('register', 'menu:river', 'likes_river_menu_setup', 400);
index 3d03fec669c9b9c2890e6a14abe17132f44b14f7..bdc50bcd1b9c0255fee01329476c4bf82d6324ad 100644 (file)
@@ -8,6 +8,7 @@
 
 $list = '';
 $num_of_likes = likes_count($vars['entity']);
+$guid = $vars['entity']->getGUID();
 
 if ($num_of_likes) {
        // display the number of likes
diff --git a/mod/likes/views/default/likes/js.php b/mod/likes/views/default/likes/js.php
new file mode 100644 (file)
index 0000000..b7e0005
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Likes JavaScript extension for elgg.js
+ */
+?>
+
+/**
+ * Repositions the likes popup
+ *
+ * @param {String} hook    'getOptions'
+ * @param {String} type    'ui.popup'
+ * @param {Object} params  An array of info about the target and source.
+ * @param {Object} options Options to pass to
+ *
+ * @return {Object}
+ */
+elgg.ui.likesPopupHandler = function(hook, type, params, options) {
+       if (params.target.hasClass('elgg-likes-list')) {
+               options.my = 'right bottom';
+               options.at = 'left top';
+               return options;
+       }
+       return null;
+};
+
+elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.likesPopupHandler);
\ No newline at end of file