required_by_role_test.module in Required by role 7.2
Same filename and directory in other branches
Module for testing.
File
tests/required_by_role_test/required_by_role_test.moduleView source
<?php
/**
* @file
* Module for testing.
*/
/**
* Implements hook_menu().
*/
function required_by_role_test_menu() {
$items = array();
$items['form-date-element-test'] = array(
'title' => 'Form date element test.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'required_by_role_test_date_select_form',
),
'access callback' => TRUE,
);
return $items;
}
/**
* Implements hook_form().
*/
function required_by_role_test_date_select_form($form, &$form_state) {
$form = array(
'#date' => new DateTime(),
);
$form['date'] = array(
'#type' => 'date_popup',
'#date_format' => 'm/d/Y',
'#default_value' => $form['#date']
->format('Y-m-d'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}
Functions
Name | Description |
---|---|
required_by_role_test_date_select_form | Implements hook_form(). |
required_by_role_test_menu | Implements hook_menu(). |