root/elgg/trunk/mod/forum/trunk/userdetails_actions.php

Revision 176, 1.0 kB (checked in by cedenoj, 10 months ago)

refs #2827 Adding forum plugin for elgg

Line 
1 <?php
2
3     // Save the user's editor choice
4     $action = optional_param('action');
5     $id = optional_param('id',0,PARAM_INT);
6     $value = optional_param('forum');
7
8     if (logged_on && !empty($action)
9         && run("permissions:check", array("userdetails:change",$id))) {
10         if (!empty($value) && in_array($value,array('yes','no'))) {
11
12             // Get the current value, will also create an initial entry if not yet set
13             $current = run('userdetails:forum', $id);
14             if ($current == $value) {
15                 $messages[] .= __gettext("Your forum view preferences have been saved");
16             } else {
17                 if (user_flag_set('forum', $value, $id)) {
18                     $messages[] .= __gettext("Your forum view preferences have been changed");
19                 } else {
20                     $messages[] .= __gettext("Your forum view preferences could not be changed");
21                 }
22             }
23         }
24     }
25
26 ?>
Note: See TracBrowser for help on using the browser.