function yr_verdata_add_form in Yr Weatherdata 6.2
Same name and namespace in other branches
- 7.3 yr_verdata.admin.inc \yr_verdata_add_form()
- 7 yr_verdata.admin.inc \yr_verdata_add_form()
Function for adding locations to the database table.
1 string reference to 'yr_verdata_add_form'
- yr_verdata_menu in ./
yr_verdata.module - Implementation of hook_menu()
File
- ./
yr_verdata.admin.inc, line 216 - This file contains the functions for the admin interface for yr_verdata.
Code
function yr_verdata_add_form() {
$form['yvo'] = array(
'#type' => 'fieldset',
'#title' => t('Add location by URL'),
);
$form['yvo']['url'] = array(
'#type' => 'textfield',
'#title' => t('URL'),
'#description' => t('The base URL to the forecast for this location. For example !example_url.', array(
'!example_url' => l(t('http://www.yr.no/sted/Norge/Vest-Agder/Kristiansand/Kristiansand/'), 'http://www.yr.no/sted/Norge/Vest-Agder/Kristiansand/Kristiansand/'),
)),
'#size' => 60,
'#required' => TRUE,
);
$form['yvo']['weight'] = array(
'#type' => 'select',
'#title' => t('Weight'),
'#options' => drupal_map_assoc(array(
1,
2,
3,
4,
5,
6,
7,
8,
9,
)),
'#default_value' => 5,
'#description' => t('Lower values will be displayed first in listings, tables and blocks. Note: This depends on the sorting settings in the !conf page.', array(
'!conf' => l(t('configuration'), 'admin/settings/yr_verdata'),
)),
'#required' => TRUE,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Add location'),
);
drupal_set_breadcrumb(array(
l(t('Home'), '<front>'),
l(t('Forecast'), 'forecast'),
));
return $form;
}