]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4661 not showing access on widgets loaded through ajax if the layout does...
authorCash Costello <cash.costello@gmail.com>
Sun, 15 Jul 2012 01:44:14 +0000 (21:44 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 15 Jul 2012 01:44:14 +0000 (21:44 -0400)
actions/widgets/add.php
js/lib/ui.widgets.js
views/default/page/layouts/widgets.php
views/default/page/layouts/widgets/add_panel.php

index f65d111347f86c6e4a17159ff610133bd85c04c2..d7b2f291cd3c77dd323c0cfea2e03de3899a40cf 100644 (file)
@@ -9,6 +9,7 @@
 $owner_guid = get_input('owner_guid');
 $handler = get_input('handler');
 $context = get_input('context');
+$show_access = (bool)get_input('show_access', true);
 $column = get_input('column', 1);
 $default_widgets = get_input('default_widgets', 0);
 
@@ -29,7 +30,7 @@ if (!empty($owner_guid)) {
                        $widget->move($column, 0);
 
                        // send widget html for insertion
-                       echo elgg_view_entity($widget);
+                       echo elgg_view_entity($widget, array('show_access' => $show_access));
 
                        //system_message(elgg_echo('widgets:add:success'));
                        forward(REFERER);
index b7d4b2fe4cdb908af443fa5ecca4ce4b46a23d82..26020bb4bf0590705d9e075d085e482603be392e 100644 (file)
@@ -58,6 +58,7 @@ elgg.ui.widgets.add = function(event) {
                        handler: type,
                        owner_guid: elgg.get_page_owner_guid(),
                        context: $("input[name='widget_context']").val(),
+                       show_access: $("input[name='show_access']").val(),
                        default_widgets: $("input[name='default_widgets']").val() || 0
                },
                success: function(json) {
index e3819cc206ecfad0f781762efe4fdb8caab42c94..c6b162516aee5a686f8bcd89eb8caa306a05ad4d 100644 (file)
@@ -31,6 +31,7 @@ if (elgg_can_edit_widget_layout($context)) {
                'widgets' => $widgets,
                'context' => $context,
                'exact_match' => $exact_match,
+               'show_access' => $show_access,
        );
        echo elgg_view('page/layouts/widgets/add_panel', $params);
 }
index 9eb78cdb69a3b82471b1c250a93166e079fb38e1..d9b11342aebd7e576937eac17f0671457090a7a2 100644 (file)
@@ -50,10 +50,13 @@ foreach ($widgets as $column_widgets) {
 ?>
        </ul>
 <?php
-       $params = array(
+       echo elgg_view('input/hidden', array(
                'name' => 'widget_context',
                'value' => $context
-       );
-       echo elgg_view('input/hidden', $params);
+       ));
+       echo elgg_view('input/hidden', array(
+               'name' => 'show_access',
+               'value' => (int)$vars['show_access']
+       ));
 ?>
 </div>