Skip to content
Snippets Groups Projects
Commit a247e7db authored by Lev Tsypin's avatar Lev Tsypin
Browse files

Punctuation.

parent 57d97963
No related branches found
Tags tmp
No related merge requests found
......@@ -51,7 +51,7 @@ function registration_field_instance_settings_form($field, $instance) {
$form = $form_state = array();
$default_settings = isset($instance['settings']['default_registration_settings']) ? $instance['settings']['default_registration_settings'] : array();
// flatten scheduling and reminder settings since this form is in tree mode
// Flatten scheduling and reminder settings since this form is in tree mode.
foreach ($default_settings as $key => $val) {
if ($key != 'settings' and is_array($val)) {
foreach ($val as $key1 => $val1) {
......@@ -77,7 +77,7 @@ function registration_field_instance_settings_form($field, $instance) {
'#description' => t('These settings will be applied when an entity with this field is saved and does not yet have it\'s own settings applied.')
);
// unset the save button just in case
// Unset the save button just in case.
unset($settings_form['save']);
$form['default_registration_settings'] += $settings_form;
......@@ -133,7 +133,7 @@ function registration_field_widget_form(&$form, &$form_state, $field, $instance,
'#default_value' => isset($items[$delta]) ? $items[$delta] : array(),
);
// force some help text into the field, appending anything the user addded.
// force some help text into the field, appending anything the user added.
$element['#description'] .= ' ' . t('Select what type of registrations should be
enabled for this @type. Depending on the display settings, it will appear
as either string, registration link, or form.', array('@type' => $instance['bundle']));
......@@ -242,7 +242,7 @@ function registration_field_formatter_view($entity_type, $entity, $field, $insta
}
break;
case 'registration_form':
// enable registration link if accessible
// Enable registration link if accessible.
list($entity_id) = entity_extract_ids($entity_type, $entity);
if (registration_register_page_access($entity_type, $entity) && registration_status($entity_type, $entity_id)) {
$registration = entity_get_controller('registration')->create(array(
......@@ -286,39 +286,39 @@ function registration_form_field_ui_field_edit_form_validate(&$form, &$form_stat
form_set_error('cardinality', t('Cardinality on registration fields must be set to one.'));
}
// validate default registration settings
// Validate default registration settings.
$default_settings = $form_state['values']['instance']['settings']['default_registration_settings'];
$base_elem_key = 'instance][settings][default_registration_settings][';
// ensure capacity is a positive integer
// Ensure capacity is a positive integer.
$capacity = $default_settings['capacity'];
if (!is_numeric($capacity) || ((int) $capacity != $capacity) || ($capacity < 0)) {
form_set_error($base_elem_key . 'capacity', t('Capacity must be a positive integer.'));
}
// validate from address
// Validate from address.
if (!valid_email_address($default_settings['settings']['from_address'])) {
form_set_error($base_elem_key . 'settings][from_address', t('From email address is invalid.'));
}
// Validate open date
// Validate open date.
if (!empty($default_settings['scheduling']['open']) && strtotime($default_settings['scheduling']['open']) === FALSE) {
form_set_error($base_elem_key . 'scheduling][open', t('Date is invalid.'));
}
// Validate close date
// Validate close date.
if (!empty($default_settings['scheduling']['close']) && strtotime($default_settings['scheduling']['close']) === FALSE) {
form_set_error($base_elem_key . 'scheduling][close', t('Date is invalid.'));
}
// if sending a reminder, ensure date and template are set
// If sending a reminder, ensure date and template are set.
if ($default_settings['reminder']['send_reminder']
&& (empty($default_settings['reminder']['reminder_settings']['reminder_date']) ||
empty($default_settings['reminder']['reminder_settings']['reminder_template']))) {
form_set_error($base_elem_key . 'reminder][send_reminder', t('If sending a reminder, provide a date and template.'));
}
// Validate reminder date
// Validate reminder date.
if (!empty($default_settings['reminder']['reminder_settings']['reminder_date'])
&& strtotime($default_settings['reminder']['reminder_settings']['reminder_date']) === FALSE) {
form_set_error($base_elem_key . 'reminder][reminder_settings][reminder_date', t('Reminder date is invalid.'));
......@@ -363,7 +363,7 @@ function registration_form_field_ui_field_overview_form_validate(&$form, &$form_
* Implements hook_field_create_instance().
*/
function registration_field_create_instance($instance) {
// rebuild menu to recognize registration paths.
// Rebuild menu to recognize registration paths.
_registration_menu_rebuild($instance);
}
......@@ -371,7 +371,7 @@ function registration_field_create_instance($instance) {
* Implements hook_field_delete_instance().
*/
function registration_field_delete_instance($instance) {
// remove registration paths from menu router
// Remove registration paths from menu router.
_registration_menu_rebuild($instance);
// @TODO: should we delete all registrations at this point?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment