You are here

function tinymce_profile_validate in TinyMCE 6.2

Same name and namespace in other branches
  1. 5.2 tinymce.module \tinymce_profile_validate()
  2. 5 tinymce.module \tinymce_profile_validate()
  3. 6 tinymce.admin.inc \tinymce_profile_validate()

Profile validation.

1 call to tinymce_profile_validate()
tinymce_admin in ./tinymce.admin.inc
Controller for tinymce administrative settings.

File

./tinymce.admin.inc, line 477
Admin interface for TinyMCE module.

Code

function tinymce_profile_validate($edit) {
  $errors = array();
  if (!isset($edit['name'])) {
    $errors['name'] = t('You must give a profile name.');
  }
  if (!isset($edit['rids'])) {
    $errors['rids'] = t('You must select at least one role.');
  }
  foreach ($errors as $name => $message) {
    form_set_error($name, $message);
  }
  return count($errors) == 0;
}