function calendar_plugin_display_attachment::validate in Calendar 6.2
Same name and namespace in other branches
- 7 includes/calendar_plugin_display_attachment.inc \calendar_plugin_display_attachment::validate()
- 7.2 includes/calendar_plugin_display_attachment.inc \calendar_plugin_display_attachment::validate()
Display validation.
File
- includes/
calendar_plugin_display_attachment.inc, line 89
Class
- calendar_plugin_display_attachment
- The plugin that handles calendar attachment displays.
Code
function validate() {
$errors = parent::validate();
$arguments = $this->display->handler
->get_option('arguments');
if (!in_array('date_argument', array_keys($arguments))) {
if (empty($this->view->date_info->arg_missing)) {
$errors[] = t("A Calendar period display will not work without a Date argument.");
}
$this->view->date_info->arg_missing = TRUE;
}
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
return $errors;
}