You are here

function readonlymode_form_validate_url in Read only mode 7

Same name and namespace in other branches
  1. 6 readonlymode.module \readonlymode_form_validate_url()

Implements hook_form_validate().

1 string reference to 'readonlymode_form_validate_url'
readonlymode_form_system_site_maintenance_mode_alter in ./readonlymode.module
Implements hook_form_FORM_ID_alter().

File

./readonlymode.module, line 214
The Read Ony Mode main module file.

Code

function readonlymode_form_validate_url(&$form, $form_state) {
  if ($path = $form_state['values']['site_readonly_url']) {
    $item = menu_get_item($path);
    if (!$item || !$item['access']) {
      form_set_error('site_readonly_url', t('The path %link_path is either invalid or you do not have access to it.', array(
        '%link_path' => $path,
      )));
    }
  }
}