| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 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 |
|
|---|
| 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 |
|
|---|