You are here

function tinymce_profile_validate in TinyMCE 5.2

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

Profile validation.

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

File

./tinymce.module, line 1052
Integrate the TinyMCE editor (http://tinymce.moxiecode.com/) into Drupal.

Code

function tinymce_profile_validate($edit) {
  $errors = array();
  if (!$edit['name']) {
    $errors['name'] = t('You must give a profile name.');
  }
  if (!$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;
}