root/releases/0.9rc1/mod/tinymce/tinymce_userdetails_actions.php

Revision 659, 0.9 kB (checked in by misja, 2 years ago)

Taking gettext to a new level, see message <http://lists.elgg.org/pipermail/development/2006-October/000590.html>. In a nutshell: all gettext calls are replaced by gettext, revamped gettext handling plus some additional fixes.

  • Property svn:eol-style set to native
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('visualeditor');
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:editor', $id);
14             if ($current == $value) {
15                 $messages[] .= __gettext("Your editor preferences have been saved");
16             } else {
17                 if (user_flag_set('visualeditor', $value, $id)) {
18                     $messages[] .= __gettext("Your editor preferences have been changed");
19                 } else {
20                     $messages[] .= __gettext("Your editor preferences could not be changed");
21                 }
22             }
23         }
24     }
25
26 ?>
27
Note: See TracBrowser for help on using the browser.