date_tools_page

Versions
5 – 6
date_tools_page()

Main Date Tools page

Code

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;
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.