]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1342 dashboard widgets do not have access controls
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 20 Nov 2010 17:18:35 +0000 (17:18 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 20 Nov 2010 17:18:35 +0000 (17:18 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7386 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/widgets/settings.php

index 73166b7182058f31bbcd9db2de11cc9c3d97d4e1..e2db3b5db69d2e9d9e563c8b8e2c6321add33f18 100644 (file)
@@ -11,16 +11,21 @@ $widget = $vars['widget'];
 $edit_view = "widgets/$widget->handler/edit";
 $custom_form_section = elgg_view($edit_view, array('entity' => $widget));
 
-$access_text = elgg_echo('access');
+$access_label = elgg_echo('access');
 $access = elgg_view('input/access', array('internalname' => 'params[access_id]','value' => $widget->access_id));
+$access_html = "<p><label>$access_label:</label> $access</p>";
+
 $hidden = elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $widget->guid));
 $submit = elgg_view('input/submit', array('value' => elgg_echo('save')));
 
+// dashboard widgets do not get access controls
+if (elgg_in_context('dashboard')) {
+       $access = '';
+}
+
 $body = <<<___END
        $custom_form_section
-       <p>
-               <label>$access_text:</label> $access
-       </p>
+       $access
        <p>
                $hidden
                $submit