html5_tools_forms.module in HTML5 Tools 6
File
html5_tools_forms/html5_tools_forms.module
View source
<?php
function html5_tools_forms_help($path, $arg) {
switch ($path) {
case 'admin/help#html5_tools_forms':
$output = '';
return $output;
}
}
function html5_tools_forms_form_system_site_information_settings_alter(&$form, &$form_state) {
if ($form['site_mail']['#type'] == 'textfield') {
$form['site_mail']['#type'] = 'emailfield';
}
}
function html5_tools_forms_form_search_block_form_alter(&$form, &$form_state) {
if ($form['search_block_form']['#type'] == 'textfield') {
$form['search_block_form']['#type'] = 'searchfield';
}
}
function html5_tools_forms_form_search_theme_form_alter(&$form, &$form_state) {
if ($form['search_theme_form']['#type'] == 'textfield') {
$form['search_theme_form']['#type'] = 'searchfield';
}
}
function html5_tools_forms_form_search_form_alter(&$form, &$form_state) {
if ($form['basic']['inline']['keys']['#type'] == 'textfield') {
$form['basic']['inline']['keys']['#type'] = 'searchfield';
}
}
function html5_tools_forms_form_user_register_alter(&$form, &$form_state) {
if ($form['mail']['#type'] == 'textfield') {
$form['mail']['#type'] = 'emailfield';
}
}
function html5_tools_forms_form_user_profile_form_alter(&$form, &$form_state) {
if ($form['account']['mail']['#type'] == 'textfield') {
$form['account']['mail']['#type'] = 'emailfield';
}
}
function html5_tools_forms_form_comment_form_alter(&$form, &$form_state) {
if ($form['mail']['#type'] == 'textfield') {
$form['mail']['#type'] = 'emailfield';
}
}
function html5_tools_forms_form_contact_mail_page_alter(&$form, &$form_state) {
if ($form['mail']['#type'] == 'textfield') {
$form['mail']['#type'] = 'emailfield';
}
}
function html5_tools_forms_form_contact_mail_user_alter(&$form, &$form_state) {
if ($form['mail']['#type'] == 'textfield') {
$form['mail']['#type'] = 'emailfield';
}
}
function html5_tools_forms_elements() {
return array(
'number' => array(
'#process' => array(
'html5_tools_forms_number_process',
),
),
);
}
function html5_tools_forms_number_process($element, $edit, $form_state, $form) {
if ($element['value']['#type'] == 'textfield') {
$element['value']['#type'] = 'numberfield';
}
return $element;
}