date_tools_page()Main Date Tools page
contributions/date/date_tools/date_tools.module, line 103
<?php
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;
}
?>