function date_tools_page in Date 6.2
Same name and namespace in other branches
- 8 date_tools/date_tools.module \date_tools_page()
- 7.3 date_tools/date_tools.module \date_tools_page()
- 7 date_tools/date_tools.module \date_tools_page()
- 7.2 date_tools/date_tools.module \date_tools_page()
Main Date Tools page
1 string reference to 'date_tools_page'
- date_tools_menu in date_tools/
date_tools.module
File
- date_tools/
date_tools.module, line 106
Code
function date_tools_page() {
$choices = array();
$choices[] = t('Dates and calendars can be complicated to set up. The !date_wizard makes it easy to create a simple date content type and related calendar.', array(
'!date_wizard' => l(t('Date wizard'), 'admin/content/date/tools/date_wizard'),
));
$content = '<ul><li>' . implode('</li><li>', $choices) . '</li></ul>';
if (module_exists('calendar')) {
$calendar_options = variable_get('calendar_default_view_options', array());
$calendars = array();
$node_types = node_get_types();
foreach ($calendar_options as $key => $option) {
$type_name = str_replace('calendar_', '', $key);
if (array_key_exists($type_name, $node_types)) {
$type = $node_types[$type_name];
$calendars[] = array(
l($type->name, 'admin/content/node-type/' . $type_name . '/fields'),
l($key, 'admin/build/views/edit/' . $key),
t('The calendar %view is a default calendar created for the content type %type_name.', array(
'%view' => $key,
'%type_name' => $type->name,
)),
l(t('remove !view', array(
'!view' => $key,
)), 'date/tools/remove/' . $key),
);
}
else {
// Do some cleanup while we're here if we have default calendars
// for non-existent content types.
calendar_remove($type_name);
}
}
if (!empty($calendars)) {
$headers = array(
t('Content Type'),
t('Calendar'),
t('Description'),
t('Operations'),
);
$content .= theme('table', $headers, $calendars);
}
}
return $content;
}