Now all modules are in core modules folder
This commit is contained in:
parent
5ba1cdfa0b
commit
05b6a91b0c
1907 changed files with 0 additions and 0 deletions
203
modules/calendar/includes/calendar.inc
Normal file
203
modules/calendar/includes/calendar.inc
Normal file
|
@ -0,0 +1,203 @@
|
|||
<?php
|
||||
//$Id: calendar.inc,v 1.1.2.46 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* Build calendar
|
||||
*
|
||||
* @param unknown_type $view
|
||||
* @param unknown_type $items
|
||||
* @return themed table
|
||||
*/
|
||||
function calendar_build_calendar($view, $items) {
|
||||
// Remove nodes outside the selected date range.
|
||||
$values = array();
|
||||
foreach ($items as $delta => $item) {
|
||||
if (empty($item->calendar_start_date) || empty($item->calendar_end_date)) {
|
||||
continue;
|
||||
}
|
||||
$item_start = date_format($item->calendar_start_date, DATE_FORMAT_DATE);
|
||||
$item_end = date_format($item->calendar_end_date, DATE_FORMAT_DATE);
|
||||
if (($item_start >= $view->date_info->min_date_date && $item_start <= $view->date_info->max_date_date)
|
||||
|| ($item_end >= $view->date_info->min_date_date && $item_end <= $view->date_info->max_date_date)) {
|
||||
$values[$item_start][date_format($item->calendar_start_date, 'H:i:s')][] = $item;
|
||||
}
|
||||
}
|
||||
$items = $values;
|
||||
ksort($items);
|
||||
|
||||
$rows = array();
|
||||
$curday = drupal_clone($view->date_info->min_date);
|
||||
|
||||
switch ($view->date_info->granularity) {
|
||||
case 'year':
|
||||
$rows = array();
|
||||
$view->date_info->mini = TRUE;
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$rows[$i] = calendar_build_month($curday, $view, $items);
|
||||
}
|
||||
$view->date_info->mini = FALSE;
|
||||
break;
|
||||
|
||||
case 'month':
|
||||
$rows = calendar_build_month($curday, $view, $items);
|
||||
break;
|
||||
|
||||
case 'day':
|
||||
$rows = calendar_build_day($curday, $view, $items);
|
||||
break;
|
||||
|
||||
case 'week':
|
||||
$rows = calendar_build_week($curday, $view, $items);
|
||||
|
||||
// Merge the day names in as the first row.
|
||||
$rows = array_merge(array(calendar_week_header($view)), $rows);
|
||||
break;
|
||||
}
|
||||
return $rows;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Build one month.
|
||||
*/
|
||||
function calendar_build_month(&$curday, $view, $items) {
|
||||
$month = date_format($curday, 'n');
|
||||
date_modify($curday, '-' . strval(date_format($curday, 'j')-1) . ' days');
|
||||
|
||||
$rows = array();
|
||||
do {
|
||||
$rows = array_merge($rows, calendar_build_week($curday, $view, $items, TRUE));
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
$curday_month = date_format($curday, 'n');
|
||||
} while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);
|
||||
|
||||
// Merge the day names in as the first row.
|
||||
$rows = array_merge(array(calendar_week_header($view)), $rows);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build one week row.
|
||||
*/
|
||||
function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
$weekdays = calendar_untranslated_days($items, $view);
|
||||
$today = date_format(date_now(date_default_timezone_name()), DATE_FORMAT_DATE);
|
||||
$month = date_format($curday, 'n');
|
||||
$week = date_week($curday_date);
|
||||
$first_day = variable_get('date_first_day', 0);
|
||||
|
||||
// move backwards to the first day of the week
|
||||
$day_wday = date_format($curday, 'w');
|
||||
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
|
||||
// If we're displaying the week number, add it as the
|
||||
// first cell in the week.
|
||||
if (!empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', 'week'))) {
|
||||
$url = date_real_url($view, NULL, $view->date_info->year .'-W'. $week);
|
||||
if (!empty($view->date_info->display_types['week'])) {
|
||||
$weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
|
||||
}
|
||||
else {
|
||||
// Do not link week numbers, if Week views are disabled.
|
||||
$weekno = $week;
|
||||
}
|
||||
$rows[$week][] = array(
|
||||
'data' => $weekno,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'class' => 'week');
|
||||
}
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
$class = strtolower($weekdays[$i] .
|
||||
($view->date_info->mini ? ' mini' : ''));
|
||||
if ($check_month && ($curday_date < $view->date_info->min_date_date || $curday_date > $view->date_info->max_date_date || date_format($curday, 'n') != $month)) {
|
||||
$class .= ' empty';
|
||||
$content = array(
|
||||
'date' => '',
|
||||
'datebox' => '',
|
||||
'empty' => theme('calendar_empty_day', $curday_date, $view),
|
||||
'link' => '',
|
||||
'all_day' => array(),
|
||||
'items' => array(),
|
||||
);
|
||||
}
|
||||
else {
|
||||
$content = calendar_build_day($curday, $view, $items);
|
||||
$class .= ($curday_date == $today ? ' today' : '') .
|
||||
($curday_date < $today ? ' past' : '') .
|
||||
($curday_date > $today ? ' future' : '') .
|
||||
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
|
||||
}
|
||||
|
||||
$rows[$week][] = array(
|
||||
'data' => $content,
|
||||
'class' => $class, 'id' => $view->name . '-' . $curday_date);
|
||||
date_modify($curday, '+1 day');
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the contents of a single day for the $rows results.
|
||||
*/
|
||||
function calendar_build_day($curday, $view, $items) {
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
$selected = FALSE;
|
||||
$max_events = !empty($view->date_info->style_max_items) ? $view->date_info->style_max_items : 0;
|
||||
$types = array();
|
||||
$inner = array();
|
||||
$all_day = array();
|
||||
$empty = '';
|
||||
$link = '';
|
||||
$count = 0;
|
||||
foreach ($items as $date => $day) {
|
||||
if ($date == $curday_date) {
|
||||
$count = 0;
|
||||
$selected = TRUE;
|
||||
ksort($day);
|
||||
foreach ($day as $time => $hour) {
|
||||
foreach ($hour as $key => $item) {
|
||||
$count++;
|
||||
$types[$item->type] = $item;
|
||||
if (!$view->date_info->mini && ($max_events == CALENDAR_SHOW_ALL || $count <= $max_events || ($count > 0 && $max_events == CALENDAR_HIDE_ALL))) {
|
||||
// Theme the item here unless this is a 'Day' or 'Week' view.
|
||||
// Day and week views need to do more processing before rendering
|
||||
// the item, so just past them the unrendered item.
|
||||
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
|
||||
if ($item->calendar_all_day) {
|
||||
$all_day[] = in_array($view->date_info->calendar_type, array('day', 'week')) ? $item : theme($theme, $item, $view);
|
||||
}
|
||||
else {
|
||||
$key = date_format($item->calendar_start_date, 'H:i:s');
|
||||
$inner[$key][] = in_array($view->date_info->calendar_type, array('day', 'week')) ? $item : theme($theme, $item, $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ksort($inner);
|
||||
if (empty($inner) && empty($all_day)) {
|
||||
$empty = theme('calendar_empty_day', $curday_date, $view);
|
||||
}
|
||||
// We have hidden events on this day, use the theme('calendar_multiple_') to show a link.
|
||||
if ($max_events != CALENDAR_SHOW_ALL && $count > 0 && $count > $max_events && $view->date_info->calendar_type != 'day' && !$view->date_info->mini) {
|
||||
if ($view->date_info->style_max_items_behavior == 'hide' || $max_events == CALENDAR_HIDE_ALL) {
|
||||
$all_day = array();
|
||||
$inner = array();
|
||||
}
|
||||
$link = theme('calendar_'. $view->date_info->calendar_type .'_multiple_node', $curday_date, $count, $view, $types);
|
||||
}
|
||||
|
||||
$content = array(
|
||||
'date' => $curday_date,
|
||||
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
|
||||
'empty' => $empty,
|
||||
'link' => $link,
|
||||
'all_day' => $all_day,
|
||||
'items' => $inner,
|
||||
);
|
||||
return $content;
|
||||
}
|
||||
|
234
modules/calendar/includes/calendar.views.inc
Normal file
234
modules/calendar/includes/calendar.views.inc
Normal file
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
//$Id: calendar.views.inc,v 1.1.2.11 2010/11/29 11:41:58 karens Exp $
|
||||
/**
|
||||
* Implementation of hook_views_query()
|
||||
*
|
||||
* Handle the date_popup calendar goto date.
|
||||
*/
|
||||
function calendar_views_query_alter(&$view, &$query) {
|
||||
// Check if a new date has been selected and if so redirect.
|
||||
if (isset($_POST['calendar_goto']) && $_POST['view_name'] == $view->name) {
|
||||
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_elements.inc');
|
||||
$format = date_limit_format(variable_get('date_format_short', 'm/d/Y - H:i'), array('year', 'month', 'day'));
|
||||
$date = date_convert_from_custom($_POST['calendar_goto']['date'], $format);
|
||||
switch ($_POST['calendar_type']) {
|
||||
case 'year':
|
||||
$arg = date_pad(date_part_extract($date, 'year'), 4);
|
||||
break;
|
||||
case 'month':
|
||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
|
||||
break;
|
||||
case 'week':
|
||||
$ww = date_day_of_week($date, DATE_ISO);
|
||||
$ww = variable_get('date_first_day', 1) ? ($ww == 0 ? 6 : $ww - 1) : $ww;
|
||||
$date = date('Y-m-d', strtotime("-$ww days", strtotime($date)));
|
||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-W'. date_pad(date_week($date));
|
||||
break;
|
||||
default:
|
||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month')) .'-'. date_pad(date_part_extract($date, 'day'));
|
||||
break;
|
||||
|
||||
}
|
||||
drupal_goto(str_replace($_POST['calendar_previous_arg'], $arg, $_POST['view_url']));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
function calendar_views_pre_view(&$view, &$display_id, &$args) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Creates calendar displays of Views results.
|
||||
*
|
||||
* Create a new calendar by enabling or cloning the default calendar,
|
||||
* changing the date argument to use the correct date field(s), and setting
|
||||
* up the year, month, day, week, and block views with the desired styles
|
||||
* and fields.
|
||||
*
|
||||
* Unlike previous versions of the Calendar module, there is just a single
|
||||
* Date argument instead of year, month, and day arguments. The argument
|
||||
* value will be YYYY-MM-DD for a day, YYYY-MM for a month, YYYY for a
|
||||
* year, and YYYY-W99 for a week. There is a default option to set the
|
||||
* argument to the current date when the argument is empty.
|
||||
*
|
||||
* A calendar display creates calendar navigation and links to
|
||||
* multiple displays for the year, month, day, or week views. The actual
|
||||
* displays are created by attaching calendar views that use whatever
|
||||
* styles are desired for those pages.
|
||||
*
|
||||
* Calendar views are attachments to create the year, month, day,
|
||||
* and week displays. They can be set to use any style, either a
|
||||
* calendar style or any other Views style, like teasers or lists.
|
||||
* If you don't want to use one of them, don't attach it to
|
||||
* anything. Only the attached views will show up in the calendar.
|
||||
*
|
||||
* A calendar block will create a calendar block for the
|
||||
* view results. Attach a block view to the block and set up the
|
||||
* desired style in the block view.
|
||||
*/
|
||||
/**
|
||||
* Implementation of hook_views_plugins
|
||||
*/
|
||||
function calendar_views_plugins() {
|
||||
$path = drupal_get_path('module', 'calendar');
|
||||
$theme_path = $path;
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$theme_path = drupal_get_path('module', 'calendar_multiday');
|
||||
}
|
||||
|
||||
$views_path = drupal_get_path('module', 'views');
|
||||
require_once "./$theme_path/theme/theme.inc";
|
||||
|
||||
$data = array(
|
||||
'module' => 'calendar', // This just tells our themes are elsewhere.
|
||||
'display' => array(
|
||||
// Parents are not really displays, just needed so the files can
|
||||
// be included.
|
||||
'parent' => array(
|
||||
'no ui' => TRUE,
|
||||
'handler' => 'views_plugin_display',
|
||||
'path' => "$views_path/plugins",
|
||||
'parent' => '',
|
||||
),
|
||||
'page' => array(
|
||||
'no ui' => TRUE,
|
||||
'handler' => 'views_plugin_display_page',
|
||||
'path' => "$views_path/plugins",
|
||||
'parent' => 'parent',
|
||||
),
|
||||
'block' => array(
|
||||
'no ui' => TRUE,
|
||||
'handler' => 'views_plugin_display_block',
|
||||
'path' => "$views_path/plugins",
|
||||
'parent' => 'parent',
|
||||
),
|
||||
'attachment' => array(
|
||||
'no ui' => TRUE,
|
||||
'handler' => 'views_plugin_display_attachment',
|
||||
'path' => "$views_path/plugins",
|
||||
'parent' => 'parent',
|
||||
),
|
||||
'calendar_attachment' => array(
|
||||
'handler' => 'calendar_plugin_display_attachment',
|
||||
'path' => "$path/includes",
|
||||
'parent' => 'attachment',
|
||||
'no ui' => TRUE,
|
||||
),
|
||||
// Main calendar display plugin.
|
||||
'calendar' => array(
|
||||
'title' => t('Calendar page'),
|
||||
'help' => t('Calendar page. Attach Calendar period attachments to this page, set to show the year, month, day, and week views.'),
|
||||
'handler' => 'calendar_plugin_display_page',
|
||||
'path' => "$path/includes",
|
||||
'parent' => 'page',
|
||||
'theme' => 'views_view',
|
||||
'no ui' => TRUE,
|
||||
//'no remove' => TRUE,
|
||||
'uses hook menu' => TRUE,
|
||||
'uses hook block' => FALSE,
|
||||
'use ajax' => TRUE,
|
||||
'use pager' => FALSE,
|
||||
'accept attachments' => TRUE,
|
||||
'admin' => t('Calendar page'),
|
||||
'help topic' => 'getting-started',
|
||||
'js' => array(
|
||||
'misc/farbtastic/farbtastic.js',
|
||||
drupal_get_path('module', 'calendar') .'/js/calendar_colorpicker.js',
|
||||
),
|
||||
),
|
||||
// Calendar block display plugin.
|
||||
'calendar_block' => array(
|
||||
'title' => t('Calendar block'),
|
||||
'help' => t('Calendar page. Attach a Calendar period attachment to this block, set to show the year, month, day, or week view.'),
|
||||
'handler' => 'calendar_plugin_display_block',
|
||||
'path' => "$path/includes",
|
||||
'parent' => 'block',
|
||||
'theme' => 'views_view',
|
||||
'no ui' => TRUE,
|
||||
//'no remove' => TRUE,
|
||||
'uses hook block' => TRUE,
|
||||
'use ajax' => TRUE,
|
||||
'use pager' => FALSE,
|
||||
'use more' => TRUE,
|
||||
'accept attachments' => TRUE,
|
||||
'admin' => t('Calendar block'),
|
||||
'help topic' => 'getting-started',
|
||||
),
|
||||
// Display plugins for calendar displays.
|
||||
'calendar_period' => array(
|
||||
'title' => t('Calendar period'),
|
||||
'help' => t('An attachment for a Year, Month, Day, or Week calendar display, using any style you choose. Attach to a Calendar page and/or a Calendar block.'),
|
||||
'handler' => 'calendar_plugin_display_attachment',
|
||||
'path' => "$path/includes",
|
||||
'file' => 'calendar_plugin_display_attachment.inc',
|
||||
'parent' => 'calendar_attachment',
|
||||
'theme' => 'views_view',
|
||||
'no ui' => TRUE,
|
||||
//'no remove' => TRUE,
|
||||
'use ajax' => TRUE,
|
||||
'use pager' => TRUE,
|
||||
'admin' => t('Calendar page year, month, week, or day view'),
|
||||
'help topic' => 'getting-started',
|
||||
),
|
||||
),
|
||||
'style' => array(
|
||||
'parent' => array(
|
||||
// this isn't really a display but is necessary so the file can
|
||||
// be included.
|
||||
'no ui' => TRUE,
|
||||
'handler' => 'views_plugin_style',
|
||||
'path' => "$views_path/plugins",
|
||||
'parent' => '',
|
||||
),
|
||||
// Style plugin for the navigation.
|
||||
'calendar_nav' => array(
|
||||
'title' => t('Calendar navigation'),
|
||||
'help' => t('Creates back/next navigation and calendar links.'),
|
||||
'handler' => 'calendar_plugin_style',
|
||||
'path' => "$path/includes",
|
||||
'parent' => 'parent',
|
||||
'theme' => 'calendar_main',
|
||||
'theme file' => 'theme.inc',
|
||||
'theme path' => "$theme_path/theme",
|
||||
'uses row plugin' => FALSE,
|
||||
'uses fields' => TRUE,
|
||||
'uses options' => FALSE,
|
||||
'type' => 'calendar', // Only used on calendar page or block displays.
|
||||
'even empty' => TRUE,
|
||||
),
|
||||
'calendar_style' => array(
|
||||
'title' => t('Calendar'),
|
||||
'help' => t('Displays Views results in a calendar.'),
|
||||
'handler' => 'calendar_view_plugin_style',
|
||||
'path' => "$path/includes",
|
||||
'parent' => 'calendar_nav',
|
||||
'theme' => 'calendar_month',
|
||||
'theme file' => 'theme.inc',
|
||||
'theme path' => "$theme_path/theme",
|
||||
'additional themes' => array(
|
||||
'calendar_year' => 'style',
|
||||
'calendar_day' => 'style',
|
||||
'calendar_week' => 'style',
|
||||
'calendar_mini' => 'style',
|
||||
),
|
||||
'uses row plugin' => FALSE,
|
||||
'uses fields' => TRUE,
|
||||
'uses options' => TRUE,
|
||||
'type' => 'normal',
|
||||
'even empty' => TRUE,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$data['style']['calendar_style']['additional themes'] += array(
|
||||
'calendar_day_overlap' => 'style',
|
||||
'calendar_week_overlap' => 'style',
|
||||
);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
510
modules/calendar/includes/calendar.views_default.inc
Normal file
510
modules/calendar/includes/calendar.views_default.inc
Normal file
|
@ -0,0 +1,510 @@
|
|||
<?php
|
||||
//$Id: calendar.views_default.inc,v 1.1.2.23 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* Set up so it can be used as an API to create default calendars for
|
||||
* specific date fields.
|
||||
*
|
||||
* Use variable_set() to establish criteria for default calendars.
|
||||
* Set the variable in custom modules or in settings.
|
||||
*
|
||||
* Example: Add a new default calendar to custom
|
||||
* calendars that are already configured:
|
||||
*
|
||||
* $options = variable_get('calendar_default_view_options', array());
|
||||
* $option = array(
|
||||
* 'name' => 'example_event',
|
||||
* 'description' => 'An example event calendar for the date field.',
|
||||
* 'path' => 'example_event',
|
||||
* 'types' => array('example_content_type'),
|
||||
* 'date_fields' => array('field_example_date'),
|
||||
* );
|
||||
* $options[] = $option;
|
||||
* variable_set('calendar_default_view_options', $options);
|
||||
*
|
||||
*/
|
||||
function calendar_views_default_views() {
|
||||
$views = array();
|
||||
|
||||
// Construct the default view with default options.
|
||||
$view = calendar_views_construct();
|
||||
$views[$view->name] = $view;
|
||||
|
||||
// Then see if there are any custom calendars to be created
|
||||
// using variable_get().
|
||||
$calendar_options = variable_get('calendar_default_view_options', array());
|
||||
|
||||
foreach ((array) $calendar_options as $calendar_option) {
|
||||
$view = calendar_views_construct($calendar_option);
|
||||
$views[$view->name] = $view;
|
||||
}
|
||||
return $views;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Construct a default calendar to match specified options.
|
||||
* Views calls it without options, so the basic
|
||||
* default view will use the default values.
|
||||
*
|
||||
* @param $options: an optional array of options to
|
||||
* create default calendars.
|
||||
*
|
||||
* Possible options include:
|
||||
* @param string $name:
|
||||
* The view name, if empty, defaults to 'calendar'.
|
||||
* @param string $description:
|
||||
* The view description, if empty, defaults to generic description.
|
||||
* @param string $path:
|
||||
* The view url, if empty, defaults to 'calendar'.
|
||||
* @param array $types:
|
||||
* Array of content types to limit the calendar to those types.
|
||||
* If empty, defaults to no type filter.
|
||||
* @param array $date_fields:
|
||||
* Date fields used to filter the calendar.
|
||||
* If empty, defaults to array('changed') for node.changed.
|
||||
* @param array $display_fields:
|
||||
* Fields to display in the calendar.
|
||||
* If empty, defaults to title and date fields.
|
||||
*
|
||||
* @return the default calendar array.
|
||||
*/
|
||||
function calendar_views_construct($options = NULL) {
|
||||
|
||||
$name = NULL;
|
||||
$description = NULL;
|
||||
$path = NULL;
|
||||
$types = NULL;
|
||||
$date_fields = NULL;
|
||||
$display_fields = NULL;
|
||||
|
||||
if (empty($options)) {
|
||||
$disabled = TRUE;
|
||||
}
|
||||
else {
|
||||
$disabled = FALSE;
|
||||
extract($options);
|
||||
}
|
||||
if (empty($name)) {
|
||||
$name = 'calendar';
|
||||
}
|
||||
if (empty($description)) {
|
||||
$description = 'A multi-dimensional calendar view with back/next navigation.';
|
||||
}
|
||||
if (empty($path)) {
|
||||
$path = 'calendar';
|
||||
}
|
||||
if (empty($types)) {
|
||||
$types = array();
|
||||
}
|
||||
if (empty($date_fields)) {
|
||||
$date_fields = array('changed');
|
||||
}
|
||||
$colors = array();
|
||||
$date_link_type = '';
|
||||
foreach ($types as $type => $label) {
|
||||
$colors[0][$type] = '#ffffff';
|
||||
$date_link_type = $type;
|
||||
}
|
||||
// Can handle core node date fields or CCK date fields.
|
||||
|
||||
$fields = array();
|
||||
$alias_fields = $date_fields;
|
||||
$sort_fields = array();
|
||||
$upcoming_fields = array();
|
||||
|
||||
foreach ($date_fields as $key => $field_name) {
|
||||
if (substr($field_name, 0, 6) == 'field_') {
|
||||
$table = 'node_data_'. $field_name;
|
||||
$alias_fields[$key] = $field_name .'_value';
|
||||
$alias = $table .'.'. $field_name .'_value';
|
||||
$cck_field = TRUE;
|
||||
}
|
||||
else {
|
||||
$table = 'node';
|
||||
$alias_fields[$key] = $field_name;
|
||||
$alias = $table .'.'. $field_name;
|
||||
$cck_field = FALSE;
|
||||
}
|
||||
$fields[$alias] = $alias;
|
||||
|
||||
// Add a sort for each date field:
|
||||
$sort_fields[$field_name] = array(
|
||||
'order' => 'ASC',
|
||||
'delta' => '-1',
|
||||
'id' => $field_name . ($cck_field ? '_value' : ''),
|
||||
'table' => $table,
|
||||
'field' => $field_name . ($cck_field ? '_value' : ''),
|
||||
'relationship' => 'none',
|
||||
);
|
||||
}
|
||||
|
||||
// Set up fields section with some of the basic options.
|
||||
// Won't handle all possible options, but should cover
|
||||
// the main ones needed for Drupal core and CCK fields.
|
||||
|
||||
if (empty($display_fields)) {
|
||||
$display_fields = array('title' => array());
|
||||
foreach ($date_fields as $field) {
|
||||
$display_fields[$field] = array();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($display_fields as $key => $value) {
|
||||
$cck_field = substr($key, 0, 6) == 'field_' ? TRUE : FALSE;
|
||||
$date_field = $cck_field && in_array($key, $date_fields) ? TRUE : FALSE;
|
||||
$display_fields[$key]['label'] = '';
|
||||
$display_fields[$key]['link_to_node'] = $key == 'title' ? 1 : 0;
|
||||
$display_fields[$key]['exclude'] = 0;
|
||||
$display_fields[$key]['id'] = $date_field ? $key .'_value' : $key;
|
||||
$display_fields[$key]['field'] = $date_field ? $key .'_value' : $key;
|
||||
$display_fields[$key]['table'] = $cck_field ? 'node_data_'. $key : 'node';
|
||||
$display_fields[$key]['relationship'] = 'none';
|
||||
if (in_array($key, array('changed'))) {
|
||||
$display_fields[$key]['date_format'] = 'small';
|
||||
}
|
||||
elseif ($cck_field) {
|
||||
$display_fields[$key]['label_type'] = 'none';
|
||||
$display_fields[$key]['format'] = 'time';
|
||||
$display_fields[$key]['multiple'] = array(
|
||||
'group' => 0,
|
||||
'multiple_number' => '',
|
||||
'multiple_from' => '',
|
||||
'multiple_reversed' => 0,
|
||||
);
|
||||
}
|
||||
// Upcoming and iCal fields should display the whole date, not just time.
|
||||
$upcoming_fields[$key] = $display_fields[$key];
|
||||
$upcoming_fields[$key]['format'] = 'default';
|
||||
}
|
||||
|
||||
$filters = array(
|
||||
'status' => array(
|
||||
'operator' => '=',
|
||||
'value' => 1,
|
||||
'group' => '0',
|
||||
'exposed' => FALSE,
|
||||
'expose' => array(
|
||||
'operator' => FALSE,
|
||||
'label' => '',
|
||||
),
|
||||
'id' => 'status',
|
||||
'table' => 'node',
|
||||
'field' => 'status',
|
||||
'relationship' => 'none',
|
||||
),
|
||||
);
|
||||
// Limit to types provided:
|
||||
if (!empty($types)) {
|
||||
$filters += array(
|
||||
'type' => array(
|
||||
'operator' => 'in',
|
||||
'value' => drupal_map_assoc(array_keys($types)),
|
||||
'group' => '0',
|
||||
'exposed' => FALSE,
|
||||
'expose' => array(
|
||||
'operator' => FALSE,
|
||||
'label' => '',
|
||||
),
|
||||
'id' => 'type',
|
||||
'table' => 'node',
|
||||
'field' => 'type',
|
||||
'relationship' => 'none',
|
||||
),
|
||||
);
|
||||
}
|
||||
// Filters for Upcoming and iCal views:
|
||||
$upcoming_filters = $filters + array(
|
||||
'date_filter' => array(
|
||||
'operator' => '>=',
|
||||
'value' => array(
|
||||
'value' => NULL,
|
||||
'min' => NULL,
|
||||
'max' => NULL,
|
||||
'default_date' => 'now',
|
||||
'default_to_date' => '',
|
||||
),
|
||||
'group' => '0',
|
||||
'exposed' => FALSE,
|
||||
'expose' => array(
|
||||
'operator' => FALSE,
|
||||
'label' => '',
|
||||
),
|
||||
'date_fields' => $fields,
|
||||
'granularity' => 'day',
|
||||
'form_type' => 'date_select',
|
||||
'default_date' => 'now',
|
||||
'default_to_date' => '',
|
||||
'id' => 'date_filter',
|
||||
'table' => 'node',
|
||||
'field' => 'date_filter',
|
||||
'override' => array(
|
||||
'button' => 'Use default',
|
||||
),
|
||||
'relationship' => 'none',
|
||||
),
|
||||
);
|
||||
|
||||
$view = new view;
|
||||
$view->name = $name;
|
||||
$view->description = $description;
|
||||
$view->tag = 'Calendar';
|
||||
$view->view_php = '';
|
||||
$view->base_table = 'node';
|
||||
$view->is_cacheable = FALSE;
|
||||
$view->api_version = 2;
|
||||
$view->disabled = $disabled; /* Edit this to true to make a default view disabled initially */
|
||||
|
||||
// Defaults.
|
||||
$handler = $view->new_display('default', 'Defaults', 'default');
|
||||
$handler->override_option('fields', $display_fields);
|
||||
$handler->override_option('sorts', $sort_fields);
|
||||
|
||||
$handler->override_option('arguments', array(
|
||||
'date_argument' => array(
|
||||
'default_action' => 'default',
|
||||
'style_plugin' => 'default_summary',
|
||||
'style_options' => array(),
|
||||
'wildcard' => 'all',
|
||||
'wildcard_substitution' => 'All',
|
||||
'title' => '',
|
||||
'default_argument_type' => 'date',
|
||||
'default_argument' => '',
|
||||
'validate_type' => 'none',
|
||||
'validate_fail' => 'not found',
|
||||
'date_fields' => $fields,
|
||||
'year_range' => '-3:+3',
|
||||
'date_method' => 'OR',
|
||||
'granularity' => 'month',
|
||||
'id' => 'date_argument',
|
||||
'table' => 'node',
|
||||
'field' => 'date_argument',
|
||||
'relationship' => 'none',
|
||||
'default_argument_user' => 0,
|
||||
'default_argument_fixed' => '',
|
||||
'default_argument_php' => '',
|
||||
'validate_argument_node_type' => array(),
|
||||
'validate_argument_node_access' => 0,
|
||||
'validate_argument_nid_type' => 'nid',
|
||||
'validate_argument_vocabulary' => array(
|
||||
),
|
||||
'validate_argument_type' => 'tid',
|
||||
'validate_argument_php' => '',
|
||||
'override' => array(
|
||||
'button' => 'Override',
|
||||
),
|
||||
'default_options_div_prefix' => '',
|
||||
),
|
||||
));
|
||||
$handler->override_option('filters', $filters);
|
||||
$handler->override_option('access', array(
|
||||
'type' => 'none',
|
||||
'role' => array(),
|
||||
'perm' => '',
|
||||
));
|
||||
$handler->override_option('title', 'Calendar');
|
||||
if (!empty($header)) {
|
||||
$handler->override_option('header', $header);
|
||||
// The only format we can be sure of is filtered.
|
||||
$handler->override_option('header_format', '1');
|
||||
}
|
||||
$handler->override_option('header_empty', 1);
|
||||
$handler->override_option('items_per_page', 0);
|
||||
$handler->override_option('use_more', 0);
|
||||
$handler->override_option('style_plugin', 'calendar_nav');
|
||||
$handler->override_option('style_options', array(
|
||||
));
|
||||
|
||||
// Calendar page.
|
||||
$handler = $view->new_display('calendar', 'Calendar page', 'calendar_1');
|
||||
$handler->override_option('style_options', array());
|
||||
$handler->override_option('path', $path);
|
||||
$handler->override_option('menu', array(
|
||||
'type' => 'none',
|
||||
'title' => '',
|
||||
'weight' => 0,
|
||||
'name' => 'navigation',
|
||||
));
|
||||
$handler->override_option('tab_options', array(
|
||||
'type' => 'none',
|
||||
'title' => '',
|
||||
'weight' => 0,
|
||||
));
|
||||
$handler->override_option('calendar_colors', array($colors));
|
||||
$handler->override_option('calendar_colors_vocabulary', array());
|
||||
$handler->override_option('calendar_colors_taxonomy', array());
|
||||
$handler->override_option('calendar_colors_group', array());
|
||||
$handler->override_option('calendar_popup', 0);
|
||||
$handler->override_option('calendar_date_link', $date_link_type);
|
||||
// Calendar block.
|
||||
$handler = $view->new_display('calendar_block', 'Calendar block', 'calendar_block_1');
|
||||
$handler->override_option('style_options', array());
|
||||
$handler->override_option('block_description', 'Calendar');
|
||||
$handler->override_option('block_caching', -1);
|
||||
|
||||
// Year view.
|
||||
$handler = $view->new_display('calendar_period', 'Year view', 'calendar_period_1');
|
||||
$handler->override_option('style_plugin', 'calendar_style');
|
||||
$handler->override_option('style_options', array(
|
||||
'display_type' => 'year',
|
||||
'name_size' => 1,
|
||||
'max_items' => 0,
|
||||
));
|
||||
$handler->override_option('attachment_position', 'after');
|
||||
$handler->override_option('inherit_arguments', TRUE);
|
||||
$handler->override_option('inherit_exposed_filters', TRUE);
|
||||
$handler->override_option('displays', array(
|
||||
'calendar_1' => 'calendar_1',
|
||||
'default' => 0,
|
||||
'calendar_block_1' => 0,
|
||||
));
|
||||
$handler->override_option('calendar_type', 'year');
|
||||
|
||||
// Month view.
|
||||
$handler = $view->new_display('calendar_period', 'Month view', 'calendar_period_2');
|
||||
$handler->override_option('style_plugin', 'calendar_style');
|
||||
$handler->override_option('style_options', array(
|
||||
'display_type' => 'month',
|
||||
'name_size' => '99',
|
||||
'with_weekno' => '1',
|
||||
'date_fields' => NULL,
|
||||
'max_items' => 0,
|
||||
));
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$handler->override_option['style_options']['multiday_theme'] = 1;
|
||||
}
|
||||
|
||||
$handler->override_option('attachment_position', 'after');
|
||||
$handler->override_option('inherit_arguments', TRUE);
|
||||
$handler->override_option('inherit_exposed_filters', TRUE);
|
||||
$handler->override_option('displays', array(
|
||||
'calendar_1' => 'calendar_1',
|
||||
'default' => 0,
|
||||
'calendar_block_1' => 0,
|
||||
));
|
||||
$handler->override_option('calendar_type', 'month');
|
||||
|
||||
// Day view.
|
||||
$handler = $view->new_display('calendar_period', 'Day view', 'calendar_period_3');
|
||||
$handler->override_option('style_plugin', 'calendar_style');
|
||||
$handler->override_option('style_options', array(
|
||||
'name_size' => '99',
|
||||
'with_weekno' => 0,
|
||||
'max_items' => 0,
|
||||
'max_items_behavior' => 'more',
|
||||
'groupby_times' => 'hour',
|
||||
'groupby_times_custom' => '',
|
||||
'groupby_field' => '',
|
||||
));
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$handler->override_option['style_options']['theme_style'] = 1;
|
||||
}
|
||||
|
||||
$handler->override_option('attachment_position', 'after');
|
||||
$handler->override_option('inherit_arguments', TRUE);
|
||||
$handler->override_option('inherit_exposed_filters', TRUE);
|
||||
$handler->override_option('displays', array(
|
||||
'calendar_1' => 'calendar_1',
|
||||
'default' => 0,
|
||||
'calendar_block_1' => 0,
|
||||
));
|
||||
$handler->override_option('calendar_type', 'day');
|
||||
|
||||
// Week view.
|
||||
$handler = $view->new_display('calendar_period', 'Week view', 'calendar_period_4');
|
||||
$handler->override_option('style_plugin', 'calendar_style');
|
||||
$handler->override_option('style_options', array(
|
||||
'name_size' => '99',
|
||||
'with_weekno' => 0,
|
||||
'max_items' => 0,
|
||||
'max_items_behavior' => 'more',
|
||||
'groupby_times' => 'hour',
|
||||
'groupby_times_custom' => '',
|
||||
'groupby_field' => '',
|
||||
));
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$handler->override_option['style_options']['theme_style'] = 1;
|
||||
}
|
||||
|
||||
$handler->override_option('attachment_position', 'after');
|
||||
$handler->override_option('inherit_arguments', TRUE);
|
||||
$handler->override_option('inherit_exposed_filters', TRUE);
|
||||
$handler->override_option('displays', array(
|
||||
'calendar_1' => 'calendar_1',
|
||||
'default' => 0,
|
||||
'calendar_block_1' => 0,
|
||||
));
|
||||
$handler->override_option('calendar_type', 'week');
|
||||
|
||||
// Block view.
|
||||
$handler = $view->new_display('calendar_period', 'Block view', 'calendar_period_5');
|
||||
$handler->override_option('style_plugin', 'calendar_style');
|
||||
$handler->override_option('style_options', array(
|
||||
'display_type' => 'month',
|
||||
'name_size' => '1',
|
||||
));
|
||||
$handler->override_option('attachment_position', 'after');
|
||||
$handler->override_option('inherit_arguments', TRUE);
|
||||
$handler->override_option('inherit_exposed_filters', TRUE);
|
||||
$handler->override_option('displays', array(
|
||||
'calendar_1' => 0,
|
||||
'default' => 0,
|
||||
'calendar_block_1' => 'calendar_block_1',
|
||||
));
|
||||
$handler->override_option('calendar_type', 'month');
|
||||
|
||||
|
||||
// iCal feed.
|
||||
if (module_exists('calendar_ical')) {
|
||||
$handler = $view->new_display('calendar_ical', 'iCal feed', 'calendar_ical_1');
|
||||
$handler->override_option('arguments', array());
|
||||
$handler->override_option('filters', $upcoming_filters);
|
||||
$handler->override_option('style_plugin', 'ical');
|
||||
$handler->override_option('style_options', array(
|
||||
'mission_description' => FALSE,
|
||||
'description' => '',
|
||||
'summary_field' => 'node_title',
|
||||
'description_field' => '',
|
||||
'location_field' => '',
|
||||
));
|
||||
$handler->override_option('row_plugin', '');
|
||||
$handler->override_option('path', $path .'/ical');
|
||||
$handler->override_option('menu', array(
|
||||
'type' => 'none',
|
||||
'title' => '',
|
||||
'weight' => 0,
|
||||
'name' => 'navigation',
|
||||
));
|
||||
$handler->override_option('tab_options', array(
|
||||
'type' => 'none',
|
||||
'title' => '',
|
||||
'weight' => 0,
|
||||
));
|
||||
$handler->override_option('displays', array(
|
||||
'calendar_1' => 'calendar_1',
|
||||
'default' => 0,
|
||||
'calendar_block_1' => 'calendar_block_1',
|
||||
));
|
||||
$handler->override_option('sitename_title', FALSE);
|
||||
}
|
||||
|
||||
// Upcoming events block.
|
||||
$handler = $view->new_display('block', 'Upcoming', 'block_1');
|
||||
$handler->override_option('fields', $upcoming_fields);
|
||||
$handler->override_option('arguments', array());
|
||||
$handler->override_option('filters', $upcoming_filters);
|
||||
$handler->override_option('use_more', 1);
|
||||
$handler->override_option('items_per_page', 5);
|
||||
$handler->override_option('style_plugin', 'list');
|
||||
$handler->override_option('style_options', array(
|
||||
'grouping' => '',
|
||||
'type' => 'ul',
|
||||
));
|
||||
$handler->override_option('title', 'Upcoming');
|
||||
$handler->override_option('block_description', 'Upcoming');
|
||||
$handler->override_option('block_caching', -1);
|
||||
|
||||
return $view;
|
||||
}
|
243
modules/calendar/includes/calendar_plugin_display_attachment.inc
Normal file
243
modules/calendar/includes/calendar_plugin_display_attachment.inc
Normal file
|
@ -0,0 +1,243 @@
|
|||
<?php
|
||||
// $Id: calendar_plugin_display_attachment.inc,v 1.1.2.22 2011/01/03 02:39:05 karens Exp $
|
||||
/**
|
||||
* The plugin that handles calendar attachment displays.
|
||||
*
|
||||
* Adding year/month/day/week pages as attachments makes it
|
||||
* possible to use any style type, so they could be tables,
|
||||
* lists, teasers, or nodes as well as traditional calendar
|
||||
* pages.
|
||||
*
|
||||
* Force 'inherit_arguments' and 'inherit_filters' to TRUE,
|
||||
* and 'attachment_position' to 'after', and don't display
|
||||
* those options in the UI.
|
||||
*
|
||||
* Allows paging (regular attachments do not), and adds an option
|
||||
* to choose what calendar period this display represents.
|
||||
*/
|
||||
class calendar_plugin_display_attachment extends views_plugin_display_attachment {
|
||||
|
||||
/**
|
||||
* Instead of going through the standard views_view.tpl.php, delegate this
|
||||
* to the style handler.
|
||||
*/
|
||||
function render() {
|
||||
if (!empty($this->view->date_info->forbid)) {
|
||||
return '';
|
||||
}
|
||||
return $this->view->style_plugin->render($this->view->result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an array of possible display periods.
|
||||
*/
|
||||
function display_types($type = 'month') {
|
||||
$types = calendar_display_types();
|
||||
return $types[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Identify the period of this display.
|
||||
*/
|
||||
function calendar_type() {
|
||||
$types = calendar_display_types();
|
||||
$default = $this->get_option('calendar_type');
|
||||
if (!array_key_exists($default, $types)) $default = 'month';
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inspect argument and view information to see which calendar
|
||||
* period we should show. The argument tells us what to use
|
||||
* if there is no value, the view args tell us what to use
|
||||
* if there are values.
|
||||
*/
|
||||
function display_granularity($display_id) {
|
||||
|
||||
$arguments = $this->view->get_items('argument', $display_id);
|
||||
$wildcard = '';
|
||||
$argument = '';
|
||||
$default_granularity = '';
|
||||
$i = 0;
|
||||
foreach ($arguments as $argument) {
|
||||
if ($argument['id'] == 'date_argument') {
|
||||
$pos = $i;
|
||||
$default_granularity = $argument['granularity'];
|
||||
$wildcard = $argument['wildcard'];
|
||||
$argument = !empty($this->view->args) && !empty($this->view->args[$pos]) ? $this->view->args[$pos] : '';
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
// TODO Anything else we need to do for 'all' arguments?
|
||||
if ($argument == $wildcard) {
|
||||
$view_granularity = $default_granularity;
|
||||
}
|
||||
elseif (!empty($argument)) {
|
||||
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
|
||||
$date_handler = new date_sql_handler();
|
||||
$view_granularity = $date_handler->arg_granularity($argument);
|
||||
}
|
||||
else {
|
||||
$view_granularity = $default_granularity;
|
||||
}
|
||||
return $view_granularity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display validation.
|
||||
*/
|
||||
function validate() {
|
||||
$errors = parent::validate();
|
||||
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
if (!in_array('date_argument', array_keys($arguments))) {
|
||||
if (empty($this->view->date_info->arg_missing)) {
|
||||
$errors[] = t("A Calendar period display will not work without a Date argument.");
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
}
|
||||
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||
if (empty($this->view->date_info->arg_missing_default)) {
|
||||
$errors[] = calendar_errors('missing_argument_default');
|
||||
}
|
||||
$this->view->date_info->arg_missing_default = TRUE;
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach only the appropriate displays for the current argument.
|
||||
*/
|
||||
function attach_to($display_id) {
|
||||
$display_granularity = $this->calendar_type();
|
||||
$view_granularity = $this->display_granularity($display_id);
|
||||
|
||||
// If this is not the right display to show,
|
||||
// don't attach it, just exit.
|
||||
if ($view_granularity != $display_granularity) {
|
||||
unset($this->display);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view->date_info->parent_id = $display_id;
|
||||
|
||||
// See if we're attaching to a block rather than a page.
|
||||
if (substr($display_id, 0, 14) == 'calendar_block') {
|
||||
$this->view->date_info->mini = TRUE;
|
||||
$this->view->date_info->block = TRUE;
|
||||
$this->view->date_info->calendar_popup = FALSE;
|
||||
if (!isset($this->view->date_info->block_identifier)) {
|
||||
$this->view->date_info->block_identifier = 'mini';
|
||||
}
|
||||
}
|
||||
elseif (substr($display_id, 0, 9) == 'calendar_') {
|
||||
$this->view->date_info->calendar_colors = $this->view->display[$display_id]->handler->options['calendar_colors'];
|
||||
$this->view->date_info->calendar_colors_taxonomy = $this->view->display[$display_id]->handler->options['calendar_colors_taxonomy'];
|
||||
$this->view->date_info->calendar_colors_group = $this->view->display[$display_id]->handler->options['calendar_colors_group'];
|
||||
$this->view->date_info->calendar_popup = $this->view->display[$display_id]->handler->options['calendar_popup'];
|
||||
$this->view->date_info->calendar_date_link = $this->view->display[$display_id]->handler->options['calendar_date_link'];
|
||||
}
|
||||
parent::attach_to($display_id);
|
||||
}
|
||||
|
||||
function pre_execute() {
|
||||
// Make sure parent function is called so things like items per page get set.
|
||||
parent::pre_execute();
|
||||
$this->view->date_info->display_granularity = $this->calendar_type();
|
||||
$this->view->date_info->calendar_type = $this->calendar_type();
|
||||
}
|
||||
|
||||
function query() {
|
||||
// If we are using legend colors based on taxonomy, make sure the
|
||||
// node vid field is added to the query so the theme can use it.
|
||||
if (!empty($this->view->date_info->calendar_colors_taxonomy)) {
|
||||
if (empty($this->additional_fields)) $this->additional_fields = array();
|
||||
$this->view->query->add_field('node', 'vid');
|
||||
}
|
||||
parent::query();
|
||||
}
|
||||
|
||||
/**
|
||||
* Override some of the parent options.
|
||||
*/
|
||||
function options(&$display) {
|
||||
parent::options($display);
|
||||
$display['inherit_argments'] = TRUE;
|
||||
$display['inherit_filters'] = TRUE;
|
||||
$display['attachment_position'] = 'after';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom option definitions.
|
||||
*/
|
||||
function option_definition() {
|
||||
$options = parent::option_definition();
|
||||
$options['calendar_type'] = array('default' => $this->calendar_type());
|
||||
return $options;
|
||||
}
|
||||
|
||||
function options_form(&$form, &$form_state) {
|
||||
// It is very important to call the parent function here:
|
||||
parent::options_form($form, $form_state);
|
||||
|
||||
switch ($form_state['section']) {
|
||||
case 'calendar_type':
|
||||
$form['#title'] .= t('Calendar period');
|
||||
$form['calendar_type'] = array(
|
||||
'#type' => 'select',
|
||||
'#description' => t('Select the calendar time period for this display.'),
|
||||
'#default_value' => $this->calendar_type(),
|
||||
'#options' => calendar_display_types(),
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform any necessary changes to the form values prior to storage.
|
||||
* There is no need for this function to actually store the data.
|
||||
*/
|
||||
# function options_submit($form, &$form_state) {
|
||||
function options_submit(&$form, &$form_state) {
|
||||
// It is very important to call the parent function here:
|
||||
parent::options_submit($form, $form_state);
|
||||
switch ($form_state['section']) {
|
||||
case 'calendar_type':
|
||||
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the summary for attachment options in the views UI.
|
||||
*
|
||||
* This output is returned as an array.
|
||||
*/
|
||||
function options_summary(&$categories, &$options) {
|
||||
parent::options_summary($categories, $options);
|
||||
$types = calendar_display_types();
|
||||
$categories['calendar_settings'] = array(
|
||||
'title' => t('Calendar settings'),
|
||||
);
|
||||
|
||||
$options['calendar_type'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Calendar period'),
|
||||
'value' => $types[$this->calendar_type()],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take away the option to change these values.
|
||||
*/
|
||||
function defaultable_sections($section = NULL) {
|
||||
if (in_array($section, array('inherit_argments', 'inherit_filters', 'attachment_position',))) {
|
||||
return FALSE;
|
||||
}
|
||||
return parent::defaultable_sections($section);
|
||||
}
|
||||
|
||||
}
|
78
modules/calendar/includes/calendar_plugin_display_block.inc
Normal file
78
modules/calendar/includes/calendar_plugin_display_block.inc
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
// $Id: calendar_plugin_display_block.inc,v 1.1.2.12 2010/12/28 15:35:50 karens Exp $
|
||||
/**
|
||||
* The plugin that handles a calendar block.
|
||||
*
|
||||
* The only style option that will be available is the calendar
|
||||
* style, which creates the navigation and links to other calendar
|
||||
* displays. All options for paging, row plugins, etc. are
|
||||
* deferred to the attachments.
|
||||
*/
|
||||
class calendar_plugin_display_block extends views_plugin_display_block {
|
||||
|
||||
function init(&$view, &$display, $options = NULL) {
|
||||
parent::init($view, $display, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display validation.
|
||||
*/
|
||||
function validate() {
|
||||
$errors = parent::validate();
|
||||
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
if (!in_array('date_argument', array_keys($arguments))) {
|
||||
if (empty($this->view->date_info->arg_missing)) {
|
||||
$errors[] = t("The Calendar period display '@display_title' will not work without a Date argument.", array('@display_title' => $this->definition['title']));
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
}
|
||||
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||
if (empty($this->view->date_info->arg_missing_default)) {
|
||||
$errors[] = calendar_errors('missing_argument_default');
|
||||
}
|
||||
$this->view->date_info->arg_missing_default = TRUE;
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
function get_style_type() { return 'calendar'; }
|
||||
|
||||
function defaultable_sections($section = NULL) {
|
||||
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
|
||||
return FALSE;
|
||||
}
|
||||
return parent::defaultable_sections($section);
|
||||
}
|
||||
|
||||
/**
|
||||
* Override some of the parent options.
|
||||
*/
|
||||
function options(&$display) {
|
||||
parent::options($display);
|
||||
$display['style_plugin'] = 'calendar_nav';
|
||||
$display['items_per_page'] = 0;
|
||||
$display['row_plugin'] = '';
|
||||
$display['defaults']['style_plugin'] = FALSE;
|
||||
$display['defaults']['style_options'] = FALSE;
|
||||
$display['defaults']['items_per_page'] = FALSE;
|
||||
$display['defaults']['row_plugin'] = FALSE;
|
||||
$display['defaults']['row_options'] = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* The display block handler returns the structure necessary for a block.
|
||||
*
|
||||
* TODO This can be removed when the patch at http://drupal.org/node/290328
|
||||
* gets into an official release.
|
||||
*/
|
||||
function execute() {
|
||||
// Prior to this being called, the $view should already be set to this
|
||||
// display, and arguments should be set on the view.
|
||||
$info['content'] = $this->view->render();
|
||||
$info['subject'] = filter_xss_admin($this->view->get_title());
|
||||
if (!empty($this->view->result) || $this->get_option('empty') || !empty($this->view->style_plugin->definition['even empty'])) {
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
}
|
298
modules/calendar/includes/calendar_plugin_display_page.inc
Normal file
298
modules/calendar/includes/calendar_plugin_display_page.inc
Normal file
|
@ -0,0 +1,298 @@
|
|||
<?php
|
||||
// $Id: calendar_plugin_display_page.inc,v 1.1.2.25 2011/01/03 02:39:05 karens Exp $
|
||||
/**
|
||||
* The plugin that handles a full calendar page.
|
||||
*
|
||||
* The only style option that will be available is the calendar
|
||||
* style, which creates the navigation and links to other calendar
|
||||
* displays. All options for paging, row plugins, etc. are
|
||||
* deferred to the attachments.
|
||||
*/
|
||||
class calendar_plugin_display_page extends views_plugin_display_page {
|
||||
|
||||
function render() {
|
||||
if (!empty($this->view->date_info->forbid)) {
|
||||
drupal_not_found();
|
||||
exit;
|
||||
}
|
||||
return parent::render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display validation.
|
||||
*/
|
||||
function validate() {
|
||||
$errors = parent::validate();
|
||||
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
if (!in_array('date_argument', array_keys($arguments))) {
|
||||
if (empty($this->view->date_info->arg_missing)) {
|
||||
$errors[] = t("The Calendar display '@display_title' will not work without a Date argument.", array('@display_title' => $this->definition['title']));
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
}
|
||||
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||
if (empty($this->view->date_info->arg_missing_default)) {
|
||||
$errors[] = calendar_errors('missing_argument_default');
|
||||
}
|
||||
$this->view->date_info->arg_missing_default = TRUE;
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
function get_style_type() { return 'calendar'; }
|
||||
|
||||
function defaultable_sections($section = NULL) {
|
||||
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
|
||||
return FALSE;
|
||||
}
|
||||
return parent::defaultable_sections($section);
|
||||
}
|
||||
|
||||
/**
|
||||
* Override some of the parent options.
|
||||
*/
|
||||
function options(&$display) {
|
||||
parent::options($display);
|
||||
$display['style_plugin'] = 'calendar_nav';
|
||||
$display['items_per_page'] = 0;
|
||||
$display['row_plugin'] = '';
|
||||
$display['defaults']['style_plugin'] = FALSE;
|
||||
$display['defaults']['style_options'] = FALSE;
|
||||
$display['defaults']['row_plugin'] = FALSE;
|
||||
$display['defaults']['row_options'] = FALSE;
|
||||
$display['defaults']['items_per_page'] = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom option definitions.
|
||||
*/
|
||||
function option_definition () {
|
||||
$options = parent::option_definition();
|
||||
$options['calendar_colors'] = array('default' => array());
|
||||
$options['calendar_colors_vocabulary'] = array('default' => array());
|
||||
$options['calendar_colors_taxonomy'] = array('default' => array());
|
||||
$options['calendar_colors_group'] = array('default' => array());
|
||||
$options['calendar_popup'] = array('default' => 0);
|
||||
$options['calendar_date_link'] = array('default' => '');
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the summary for attachment options in the views UI.
|
||||
*
|
||||
* This output is returned as an array.
|
||||
*/
|
||||
function options_summary(&$categories, &$options) {
|
||||
// It is very important to call the parent function here:
|
||||
parent::options_summary($categories, $options);
|
||||
|
||||
$categories['calendar_settings'] = array(
|
||||
'title' => theme('advanced_help_topic', 'calendar', 'settings') . t('Calendar settings'),
|
||||
);
|
||||
|
||||
$colors = $this->get_option('calendar_colors');
|
||||
$colors_taxonomy = $this->get_option('calendar_colors_taxonomy');
|
||||
$options['calendar_colors'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Legend Content Types'),
|
||||
'value' => t('Edit'),
|
||||
);
|
||||
$options['calendar_colors_vocabulary'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Legend Vocabularies'),
|
||||
'value' => t('Edit'),
|
||||
);
|
||||
$options['calendar_colors_taxonomy'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Legend Terms'),
|
||||
'value' => t('Edit'),
|
||||
);
|
||||
if (function_exists('og_all_groups_options')) {
|
||||
$colors_group = $this->get_option('calendar_colors_group');
|
||||
$options['calendar_colors_group'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Legend Groups'),
|
||||
'value' => t('Edit'),
|
||||
);
|
||||
}
|
||||
$popup_options = $this->popup_options();
|
||||
$default = $this->get_option('calendar_popup');
|
||||
$options['calendar_popup'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Date changer'),
|
||||
'value' => isset($default) ? $popup_options[$default] : $popup_options[0],
|
||||
);
|
||||
$default = $this->get_option('calendar_date_link');
|
||||
$options['calendar_date_link'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Add new date link'),
|
||||
'value' => !empty($default) ? check_plain(node_get_types('name', $default)) : t('None'),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function popup_options() {
|
||||
return array(0 => t('No'), 1 => t('Yes'));
|
||||
}
|
||||
|
||||
function options_form(&$form, &$form_state) {
|
||||
// It is very important to call the parent function here:
|
||||
parent::options_form($form, $form_state);
|
||||
|
||||
switch ($form_state['section']) {
|
||||
case 'calendar_popup':
|
||||
$form['#title'] .= t('Date changer');
|
||||
$form['calendar_popup'] = array(
|
||||
'#type' => 'radios',
|
||||
'#default_value' => $this->get_option('calendar_popup'),
|
||||
'#options' => $this->popup_options(),
|
||||
'#description' => t('Display a popup calendar date selector?'),
|
||||
);
|
||||
break;
|
||||
|
||||
case 'calendar_date_link':
|
||||
$form['#title'] .= t('Add new date link');
|
||||
$form['calendar_date_link'] = array(
|
||||
'#type' => 'radios',
|
||||
'#default_value' => $this->get_option('calendar_date_link'),
|
||||
'#options' => array('' => t('No link')) + node_get_types('names'),
|
||||
'#description' => t('Display a link to add a new date of the specified content type. Displayed only to users with appropriate permissions.'),
|
||||
);
|
||||
break;
|
||||
|
||||
case 'calendar_colors':
|
||||
$method = 'types';
|
||||
// TODO Move the embedded styles other than the color into a stylesheet.
|
||||
$form['#title'] .= t('Content Type Legend Colors');
|
||||
$form['calendar_colors']['#tree'] = TRUE;
|
||||
$form['calendar_colors']['#prefix'] .= '<div class="form-item"><label>'. t('Content Type') .'</label><p>'. t('Set a hex color value (like #ffffff) to use in the calendar legend for each content type. Types with empty values will have no stripe in the calendar and will not be added to the legend.') .'</p></div>';
|
||||
$form['calendar_colors']['colorpicker'] = array(
|
||||
'#type' => 'calendar_colorpicker',
|
||||
'#prefix' => '<div class="clear-block"><div style="float:left">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
$colors = $this->get_option('calendar_colors');
|
||||
|
||||
switch ($method) {
|
||||
case 'types':
|
||||
$color_types = node_get_types('names');
|
||||
break;
|
||||
}
|
||||
foreach ($color_types as $key => $name) {
|
||||
$form['calendar_colors']['color'][$key] = array(
|
||||
'#title' => $name,
|
||||
'#type' => 'calendar_colorfield',
|
||||
'#default_value' => isset($colors[$key]) ? $colors[$key] : '#ffffff',
|
||||
'#calendar_colorpicker' => 'calendar-colors-colorpicker',
|
||||
'#prefix' => '<div style="float:left;margin-right:10px">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
}
|
||||
$form['calendar_colors']['color']['#suffix'] = '</div>';
|
||||
break;
|
||||
|
||||
case 'calendar_colors_vocabulary':
|
||||
$taxonomies = taxonomy_get_vocabularies();
|
||||
$options = array();
|
||||
foreach ($taxonomies as $vid => $vocab) {
|
||||
$options[$vid] = $vocab->name;
|
||||
}
|
||||
$colors_vocabulary = $this->get_option('calendar_colors_vocabulary');
|
||||
$form['#title'] .= t('Vocabulary Legend Types');
|
||||
$form['calendar_colors_vocabulary'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#default_value' => isset($colors_vocabulary) ? $colors_vocabulary : array(),
|
||||
'#multiple' => TRUE,
|
||||
'#options' => $options,
|
||||
);
|
||||
$form['calendar_colors_vocabulary']['#prefix'] .= '<div class="form-item"><label>'. t('Vocabularies') .'</label>'. t('Select vocabularies to use for setting calendar legend colors by taxonomy term. This works best for vocabularies with only a limited number of possible terms.') .'</div>';
|
||||
break;
|
||||
|
||||
case 'calendar_colors_taxonomy':
|
||||
$taxonomies = (array) $this->get_option('calendar_colors_vocabulary');
|
||||
$colors_taxonomy = $this->get_option('calendar_colors_taxonomy');
|
||||
$form['#title'] .= t('Taxonomy Legend Colors');
|
||||
$form['calendar_colors_taxonomy']['#prefix'] = '';
|
||||
if (empty($taxonomies)) {
|
||||
$form['calendar_colors_taxonomy']['#prefix'] .= '<div class="form-item warning">'. t('Please select Legend vocabularies first!') .'</div>';
|
||||
}
|
||||
$form['calendar_colors_taxonomy']['#prefix'] .= '<div class="form-item"><label>'. t('Taxonomy Terms') .'</label><p>'. t('Set a hex color value (like #ffffff) to use in the calendar legend for each taxonomy term. Terms with empty values will have no stripe in the calendar and will not be added to the legend.') .'</p></div>';
|
||||
$form['calendar_colors_taxonomy']['#tree'] = TRUE;
|
||||
$form['calendar_colors_taxonomy']['colorpicker'] = array(
|
||||
'#type' => 'calendar_colorpicker',
|
||||
'#prefix' => '<div class="clear-block"><div style="float:left">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
foreach ($taxonomies as $vid => $taxonomy){
|
||||
$vocab = taxonomy_get_tree($vid);
|
||||
foreach ($vocab as $tid => $term){
|
||||
$form['calendar_colors_taxonomy']['color'][$term->tid] = array(
|
||||
'#title' => t($term->name),
|
||||
'#type' => 'calendar_colorfield',
|
||||
'#default_value' => isset($colors_taxonomy[$term->tid]) ? $colors_taxonomy[$term->tid] : '#ffffff',
|
||||
'#calendar_colorpicker' => 'calendar-colors-taxonomy-colorpicker',
|
||||
'#prefix' => '<div style="float:left;margin-right:10px">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
}
|
||||
}
|
||||
$form['calendar_colors_taxonomy']['color']['#suffix'] = '</div>';
|
||||
break;
|
||||
|
||||
case 'calendar_colors_group':
|
||||
$colors_group = $this->get_option('calendar_colors_group');
|
||||
$form['#title'] .= t('Group Legend Colors');
|
||||
$form['calendar_colors_group']['#prefix'] = '';
|
||||
$form['calendar_colors_group']['#prefix'] .= '<div class="form-item"><label>' . t('Group') . '</label><p>' . t('Set a hex color value (like #ffffff) to use in the calendar legend for each group. Groups with empty values will have no stripe in the calendar and will not be added to the legend.') .'</p></div>';
|
||||
$form['calendar_colors_group']['#tree'] = TRUE;
|
||||
$form['calendar_colors_group']['colorpicker'] = array(
|
||||
'#type' => 'calendar_colorpicker',
|
||||
'#prefix' => '<div class="clear-block"><div style="float:left">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
$groups = og_all_groups_options();
|
||||
foreach ($groups as $gid => $group_name){
|
||||
$form['calendar_colors_group']['color'][$gid] = array(
|
||||
'#title' => t($group_name),
|
||||
'#type' => 'calendar_colorfield',
|
||||
'#default_value' => isset($colors_group[$gid]) ? $colors_group[$gid] : '#ffffff',
|
||||
'#calendar_colorpicker' => 'calendar-colors-group-colorpicker',
|
||||
'#prefix' => '<div style="float:left;margin-right:10px">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
}
|
||||
$form['calendar_colors_group']['color']['#suffix'] = '</div>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform any necessary changes to the form values prior to storage.
|
||||
* There is no need for this function to actually store the data.
|
||||
*/
|
||||
# function options_submit($form, &$form_state) {
|
||||
function options_submit(&$form, &$form_state) {
|
||||
// It is very important to call the parent function here:
|
||||
parent::options_submit($form, $form_state);
|
||||
switch ($form_state['section']) {
|
||||
case 'calendar_popup':
|
||||
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]['popup']);
|
||||
break;
|
||||
case 'calendar_colors':
|
||||
case 'calendar_colors_taxonomy':
|
||||
case 'calendar_colors_group':
|
||||
$this->set_option($form_state['section'], $form_state['values'][$form_state['section']]['color']);
|
||||
break;
|
||||
case 'calendar_colors_vocabulary':
|
||||
$this->set_option($form_state['section'], array_filter($form_state['values'][$form_state['section']]));
|
||||
break;
|
||||
case 'calendar_date_link':
|
||||
$this->set_option($form_state['section'], ($form_state['values'][$form_state['section']]));
|
||||
variable_set('calendar_date_link_'. $form_state['values']['calendar_date_link'], $this->display->handler->get_option('path'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
182
modules/calendar/includes/calendar_plugin_style.inc
Normal file
182
modules/calendar/includes/calendar_plugin_style.inc
Normal file
|
@ -0,0 +1,182 @@
|
|||
<?php
|
||||
// $Id: calendar_plugin_style.inc,v 1.1.2.18 2011/01/03 02:39:05 karens Exp $
|
||||
/**
|
||||
* Style plugin to create the calendar navigation and links.
|
||||
*
|
||||
* Used by the main calendar page and calendar block displays.
|
||||
*/
|
||||
class calendar_plugin_style extends views_plugin_style {
|
||||
/**
|
||||
* Init will be called after construct, when the plugin is attached to a
|
||||
* view and a display.
|
||||
*/
|
||||
function init(&$view, &$display, $options = NULL) {
|
||||
parent::init($view, $display, $options);
|
||||
if (!isset($view->date_info)) {
|
||||
$view->date_info = new StdClass();
|
||||
}
|
||||
$view->date_info->display_types = $this->display_types();
|
||||
}
|
||||
|
||||
function display_types($granularity = NULL, $option_type = 'names') {
|
||||
$ids = array();
|
||||
$names = array();
|
||||
foreach (calendar_display_types() as $name => $type) {
|
||||
foreach ($this->view->display as $id => $display) {
|
||||
if ($display->display_plugin == 'calendar_period') {
|
||||
if (!empty($display->display_options['calendar_type']) && $display->display_options['calendar_type'] == $name) {
|
||||
$attachments = array_filter($display->display_options['displays']);
|
||||
if (isset($attachments['calendar_1'])) {
|
||||
$ids[$name] = $id;
|
||||
$names[$name] = $display->display_title;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($granularity) {
|
||||
return $$option_type[$granularity];
|
||||
}
|
||||
return $$option_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calendar argument date fields used in this view.
|
||||
*/
|
||||
function date_fields() {
|
||||
$date_fields = array();
|
||||
$calendar_fields = date_api_fields($this->view->base_table);
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
foreach ($arguments as $name => $argument) {
|
||||
if (isset($argument['date_fields'])) {
|
||||
foreach ($argument['date_fields'] as $date_field) {
|
||||
$field = $calendar_fields['name'][$date_field];
|
||||
$handler = views_get_handler($field['table_name'], $field['field_name'], 'field');
|
||||
if ($handler) {
|
||||
$date_fields[$date_field] = $field;
|
||||
$date_fields[$date_field]['name'] = $handler->ui_name();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ($date_fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Style validation.
|
||||
*/
|
||||
function validate() {
|
||||
$errors = parent::validate();
|
||||
if (empty($this->display->display_options['style_plugin'])) {
|
||||
return $errors;
|
||||
}
|
||||
$style = $this->display->display_options['style_plugin'];
|
||||
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
if (!in_array('date_argument', array_keys($arguments))) {
|
||||
if (empty($this->view->date_info->arg_missing)) {
|
||||
$errors[$style] = t("The @style style requires a Date argument.", array('@style' => $style));
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
$this->date_info->arg_fields = array();
|
||||
}
|
||||
else {
|
||||
$this->date_info = new StdClass;
|
||||
$this->date_info->arg_fields = new StdClass;
|
||||
$this->date_info->arg_fields = $arguments['date_argument']['date_fields'];
|
||||
if ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||
if (empty($this->view->date_info->arg_missing_default)) {
|
||||
$errors[] = calendar_errors('missing_argument_default');
|
||||
}
|
||||
$this->view->date_info->arg_missing_default = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure date fields are not set up to 'Group multiple values'
|
||||
// in the calendar style.
|
||||
if ($style == 'calendar_style') {
|
||||
$view_fields = date_api_fields($this->view->base_table);
|
||||
$view_fields = $view_fields['name'];
|
||||
$fields = $this->display->handler->get_option('fields');
|
||||
$has_fields = FALSE;
|
||||
foreach ($fields as $column => $field) {
|
||||
$field_name = $field['table'] .".". $field['field'];
|
||||
if (in_array($field_name, $this->date_info->arg_fields)) {
|
||||
$has_fields = TRUE;
|
||||
}
|
||||
if (!empty($field['multiple']) && array_key_exists($field_name, $view_fields)) {
|
||||
$cck_fields = content_fields();
|
||||
$real_name = $view_fields[$field_name]['real_field_name'];
|
||||
if ($cck_fields[$real_name]['multiple'] && !empty($field['multiple']['group'])) {
|
||||
$errors[] = t("The date field '@field' used by the display '@display_title' cannot be set to 'Group multiple values'.", array('@field' => $view_fields[$field_name]['label'], '@display_title' => $this->display->display_title));
|
||||
}
|
||||
}
|
||||
}
|
||||
// The calendar needs the values from the date fields to split
|
||||
// the nodes into calendar cells, so make sure the field gets
|
||||
// added into the query.
|
||||
if (!$has_fields) {
|
||||
$errors[] = t('The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.');
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
function query() {
|
||||
|
||||
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
|
||||
|
||||
$style_options = $this->view->style_plugin->options;
|
||||
|
||||
// Evaluate our argument values and figure out which
|
||||
// calendar display we need to create.
|
||||
$i = 0;
|
||||
foreach ($this->view->argument as $id => $argument) {
|
||||
if ($argument->field == 'date_argument') {
|
||||
// TODO Decide if we want to provide a date here or not.
|
||||
// Adding this now is to prevent fatal errors later if the
|
||||
// view is used in unexpected ways without a date being set.
|
||||
if (empty($argument->min_date)) {
|
||||
$value = $argument->get_default_argument();
|
||||
$range = $argument->date_handler->arg_range($value);
|
||||
$argument->min_date = $range[0];
|
||||
$argument->max_date = $range[1];
|
||||
}
|
||||
$this->view->date_info->granularity = !empty($argument->granularity) ? $argument->granularity : $argument->options['granularity'];
|
||||
$this->view->date_info->date_arg = !empty($this->view->args) && count($this->view->args) > $argument->position ? $this->view->args[$argument->position] : '';
|
||||
$this->view->date_info->date_arg_pos = $i;
|
||||
$this->view->date_info->year = isset($argument->year) ? $argument->year : NULL;
|
||||
$this->view->date_info->month = isset($argument->month) ? $argument->month: NULL;
|
||||
$this->view->date_info->day = isset($argument->day) ? $argument->day : NULL;
|
||||
$this->view->date_info->week = isset($argument->week) ? $argument->week : NULL;
|
||||
$this->view->date_info->min_date = $argument->min_date;
|
||||
$this->view->date_info->max_date = $argument->max_date;
|
||||
$this->view->date_info->min_date_date = date_format($this->view->date_info->min_date, DATE_FORMAT_DATE);
|
||||
$this->view->date_info->max_date_date = date_format($this->view->date_info->max_date, DATE_FORMAT_DATE);
|
||||
$this->view->date_info->forbid = isset($argument->forbid) ? $argument->forbid : FALSE;
|
||||
|
||||
// Stop after the first date argument, if there is more than one.
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$this->view->date_info->display_types = $this->display_types();
|
||||
$keys = drupal_map_assoc(array_keys(calendar_display_types()));
|
||||
$this->view->date_info->calendar_type = $keys[$this->view->date_info->granularity];
|
||||
|
||||
// bring the node type into the query so we can use it in the theme
|
||||
if ($this->view->base_table == 'node') {
|
||||
$this->view->query->add_field('node', 'type');
|
||||
}
|
||||
|
||||
parent::query();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the calendar navigation style.
|
||||
*/
|
||||
function render() {
|
||||
return theme($this->theme_functions(), $this->view, $this->options, array());
|
||||
}
|
||||
}
|
||||
|
173
modules/calendar/includes/calendar_view_plugin_style.inc
Normal file
173
modules/calendar/includes/calendar_view_plugin_style.inc
Normal file
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
// $Id: calendar_view_plugin_style.inc,v 1.1.2.21 2010/12/28 15:35:50 karens Exp $
|
||||
|
||||
/**
|
||||
* Style plugin to render the year, month, week, or day calendar view.
|
||||
*/
|
||||
class calendar_view_plugin_style extends calendar_plugin_style {
|
||||
|
||||
/**
|
||||
* Init will be called after construct, when the plugin is attached to a
|
||||
* view and a display.
|
||||
*/
|
||||
function init(&$view, &$display, $options = NULL) {
|
||||
parent::init($view, $display, $options);
|
||||
$calendar_type = $this->display->handler->get_option('calendar_type');
|
||||
$view->date_info->style_name_size = $this->options['name_size'];
|
||||
$view->date_info->style_with_weekno = $this->options['with_weekno'];
|
||||
$view->date_info->style_multiday_theme = $this->options['multiday_theme'];
|
||||
$view->date_info->style_theme_style = $this->options['theme_style'];
|
||||
$view->date_info->style_max_items = $this->options['max_items'];
|
||||
$view->date_info->style_max_items_behavior = $this->options['max_items_behavior'];
|
||||
if (!empty($this->options['groupby_times_custom'])) {
|
||||
$view->date_info->style_groupby_times = explode(',', $this->options['groupby_times_custom']);
|
||||
}
|
||||
else {
|
||||
$view->date_info->style_groupby_times = calendar_groupby_times($this->options['groupby_times']);
|
||||
}
|
||||
$view->date_info->style_groupby_field = $this->options['groupby_field'];
|
||||
|
||||
// TODO make this an option setting.
|
||||
$view->date_info->style_show_empty_times = !empty($this->options['groupby_times_custom']) ? TRUE : FALSE;
|
||||
|
||||
// Make sure views does't try to limit the number of items in this view.
|
||||
$this->view->pager['items_per_page'] = 0;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set default options
|
||||
*/
|
||||
function options(&$options) {
|
||||
$options['name_size'] = 3;
|
||||
$options['with_weekno'] = 0;
|
||||
$options['multiday_theme'] = '1';
|
||||
$options['theme_style'] = '1';
|
||||
$options['max_items'] = 0;
|
||||
$options['max_items_behavior'] = 'more';
|
||||
$options['groupby_times'] = 'hour';
|
||||
$options['groupby_times_custom'] = '';
|
||||
$options['groupby_field'] = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Style options.
|
||||
*/
|
||||
function options_form(&$form, &$form_state) {
|
||||
$calendar_type = $this->display->handler->get_option('calendar_type');
|
||||
$form['name_size'] = array(
|
||||
'#title' => t('Calendar day of week names'),
|
||||
'#default_value' => $this->options['name_size'],
|
||||
'#type' => in_array($calendar_type, array('year', 'month', 'week')) ? 'radios' : 'value',
|
||||
'#options' => array(1 => t('First letter of name'), 2 => t('First two letters of name'), 3 => t('Abbreviated name'), 99 => t('Full name')),
|
||||
'#description' => t('The way day of week names should be displayed in a calendar.'),
|
||||
);
|
||||
|
||||
$form['with_weekno'] = array(
|
||||
'#title' => t('Show week numbers'),
|
||||
'#default_value' => $this->options['with_weekno'],
|
||||
'#type' => in_array($calendar_type, array('month')) ? 'radios' : 'value',
|
||||
'#options' => array(0 => t('No'), 1 => t('Yes')),
|
||||
'#description' => t('Whether or not to show week numbers in the left column of calendar weeks and months.'),
|
||||
);
|
||||
$form['max_items'] = array(
|
||||
'#title' => t('Maximum items'),
|
||||
'#type' => in_array($calendar_type, array('month')) ? 'select' : 'value',
|
||||
'#options' => array(CALENDAR_SHOW_ALL => t('Unlimited'), CALENDAR_HIDE_ALL => t('No items'), 3 => t('3 items'), 5 => t('5 items'), 10 => t('10 items')),
|
||||
'#default_value' => $calendar_type != 'day' ? $this->options['max_items'] : 0,
|
||||
'#description' => t('Maximum number of items to show in calendar cells, used to keep the calendar from expanding to a huge size when there are lots of items in one day. '),
|
||||
);
|
||||
$form['max_items_behavior'] = array(
|
||||
'#title' => t('Too many items'),
|
||||
'#type' => in_array($calendar_type, array('month')) ? 'select' : 'value',
|
||||
'#options' => array('more' => t("Show maximum, add 'more' link"), 'hide' => t('Hide all, add link to day')),
|
||||
'#default_value' => $calendar_type != 'day' ? $this->options['max_items_behavior'] : 'more',
|
||||
'#description' => t('Behavior when there are more than the above number of items in a single day. When there more items than this limit, a link to the day view will be displayed.'),
|
||||
);
|
||||
$form['groupby_times'] = array(
|
||||
'#title' => t('Time grouping'),
|
||||
'#type' => in_array($calendar_type, array('day', 'week')) ? 'select' : 'value',
|
||||
'#default_value' => $this->options['groupby_times'],
|
||||
'#description' => t("Group items together into time periods based on their start time."),
|
||||
'#options' => array('' => t('None'), 'hour' => t('Hour'), 'half' => t('Half hour'), 'custom' => t('Custom')),
|
||||
);
|
||||
$form['groupby_times_custom'] = array(
|
||||
'#title' => t('Custom time grouping'),
|
||||
'#type' => in_array($calendar_type, array('day', 'week')) ? 'textarea' : 'value',
|
||||
'#default_value' => $this->options['groupby_times_custom'],
|
||||
'#description' => t("When choosing the 'custom' Time grouping option above, create custom time period groupings as a comma-separated list of 24-hour times in the format HH:MM:SS, like '00:00:00,08:00:00,18:00:00'. Be sure to start with '00:00:00'. All items after the last time will go in the final group."),
|
||||
);
|
||||
// Create a list of fields that are available for grouping and truncation,
|
||||
// excluding the date fields in the view from the grouping options.
|
||||
$field_options = array();
|
||||
$date_field_options = array();
|
||||
$fields = $this->display->handler->get_option('fields');
|
||||
$date_fields = array_keys($this->date_fields());
|
||||
foreach ($fields as $field_name => $field) {
|
||||
$handler = views_get_handler($field['table'], $field['field'], 'field');
|
||||
if (!in_array($field['table'] .'.'. $field['field'], $date_fields)) {
|
||||
$field_options[$field['table'] .'_'. $field['field']] = $handler->ui_name();
|
||||
}
|
||||
else {
|
||||
$date_field_options[$field['table'] .'_'. $field['field']] = $handler->ui_name();
|
||||
}
|
||||
}
|
||||
$form['groupby_field'] = array(
|
||||
'#title' => t('Field grouping'),
|
||||
'#type' => in_array($calendar_type, array('day')) ? 'select' : 'value',
|
||||
'#default_value' => $this->options['groupby_field'],
|
||||
'#description' => t("Optionally group items into columns by a field value, for instance select the content type to show items for each content type in their own column, or use a location field to organize items into columns by location."),
|
||||
'#options' => array('' => '') + $field_options,
|
||||
);
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$form['multiday_theme'] = array(
|
||||
'#title' => t('Multi-day style'),
|
||||
'#default_value' => $this->options['multiday_theme'],
|
||||
'#type' => in_array($calendar_type, array('month', 'week')) ? 'select' : 'value',
|
||||
'#options' => array(0 => t('Display multi-day item as a single column'), 1 => t('Display multi-day item as a multiple column row')),
|
||||
'#description' => t('If selected, items which span multiple days will displayed as a multi-column row. If not selected, items will be displayed as an individual column.'),
|
||||
);
|
||||
$form['theme_style'] = array(
|
||||
'#title' => t('Overlapping time style'),
|
||||
'#default_value' => $this->options['theme_style'],
|
||||
'#type' => in_array($calendar_type, array('day', 'week')) ? 'select' : 'value',
|
||||
'#options' => array(0 => t('Do not display overlapping items'), 1 => t('Display overlapping items')),
|
||||
'#description' => t('Select whether calendar items are displayed as overlapping items.'),
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($form as $key => $value) {
|
||||
if ($value['#type'] == 'value') {
|
||||
$form[$key]['#value'] = $value['#default_value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the calendar attachment style.
|
||||
*/
|
||||
function render() {
|
||||
$calendar_type = $this->display->handler->get_option('calendar_type');
|
||||
// Adjust the theme to match the currently selected default.
|
||||
// Only the month view needs the special 'mini' class,
|
||||
// which is used to retrieve a different, more compact, theme.
|
||||
if (!empty($this->view->date_info->mini) && $this->view->date_info->granularity == 'month') {
|
||||
$this->definition['theme'] = 'calendar_mini';
|
||||
}
|
||||
elseif ( module_exists('calendar_multiday') && $calendar_type == 'week') {
|
||||
$this->view->date_info->mini = FALSE;
|
||||
$this->definition['theme'] = ($this->view->style_options['multiday_theme'] == '1' && $this->view->style_options['theme_style'] == '1') ? 'calendar_'. $this->view->date_info->granularity .'_overlap' : 'calendar_'. $this->view->date_info->granularity;
|
||||
}
|
||||
elseif ( module_exists('calendar_multiday') && $calendar_type == 'day') {
|
||||
$this->view->date_info->mini = FALSE;
|
||||
$this->definition['theme'] = ($this->view->style_options['theme_style'] == '1') ? 'calendar_'. $this->view->date_info->granularity .'_overlap' : 'calendar_'. $this->view->date_info->granularity;
|
||||
}
|
||||
else {
|
||||
$this->view->date_info->mini = FALSE;
|
||||
$this->definition['theme'] ='calendar_'. $this->view->date_info->granularity;
|
||||
}
|
||||
$this->view->date_info->hide_admin_links = TRUE;
|
||||
return theme($this->theme_functions(), $this->view, $this->options, array());
|
||||
}
|
||||
}
|
235
modules/calendar/includes/translations/includes.cs.po
Normal file
235
modules/calendar/includes/translations/includes.cs.po
Normal file
|
@ -0,0 +1,235 @@
|
|||
# $Id: includes.cs.po,v 1.1.2.1 2010/10/22 20:06:37 wojtha Exp $
|
||||
#
|
||||
# Czech translation of Calendar (6.x-2.2)
|
||||
# Copyright (c) 2010 by the Czech translation team
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Calendar (6.x-2.2)\n"
|
||||
"POT-Creation-Date: 2010-10-22 20:03+0000\n"
|
||||
"PO-Revision-Date: 2010-09-29 22:09+0000\n"
|
||||
"Language-Team: Czech\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
|
||||
|
||||
msgid "Edit"
|
||||
msgstr "Upravit"
|
||||
msgid "Maximum items"
|
||||
msgstr "Maximální počet položek"
|
||||
msgid "Custom"
|
||||
msgstr "Vlastní"
|
||||
msgid "Unlimited"
|
||||
msgstr "Neomezené"
|
||||
msgid "Full name"
|
||||
msgstr "Celé jméno"
|
||||
msgid "Hour"
|
||||
msgstr "Hodina"
|
||||
msgid "No link"
|
||||
msgstr "Žádný odkaz"
|
||||
msgid "First letter of name"
|
||||
msgstr "První písmeno jména"
|
||||
msgid "First two letters of name"
|
||||
msgstr "První dvě písmena jména"
|
||||
msgid "Abbreviated name"
|
||||
msgstr "Zkrácené jméno"
|
||||
msgid "Show week numbers"
|
||||
msgstr "Zobrazit čísla týdnů"
|
||||
msgid "3 items"
|
||||
msgstr "3 položky"
|
||||
msgid "5 items"
|
||||
msgstr "5 položek"
|
||||
msgid "10 items"
|
||||
msgstr "10 položek"
|
||||
msgid ""
|
||||
"Maximum number of items to show in calendar cells, used to keep the "
|
||||
"calendar from expanding to a huge size when there are lots of items in "
|
||||
"one day. "
|
||||
msgstr ""
|
||||
"Maximální počet položek zobrazených v buňce kalendáře. "
|
||||
"Slouží k omezení rozměrů kalendáře při větším počtu "
|
||||
"položek v jednom dni. "
|
||||
msgid "Too many items"
|
||||
msgstr "Příliš mnoho položek"
|
||||
msgid "Show maximum, add 'more' link"
|
||||
msgstr "Zobrazit maximální počet, připojit odkaz 'více'"
|
||||
msgid "Hide all, add link to day"
|
||||
msgstr "Skrýt vše, přidat odkaz na den"
|
||||
msgid ""
|
||||
"Behavior when there are more than the above number of items in a "
|
||||
"single day. When there more items than this limit, a link to the day "
|
||||
"view will be displayed."
|
||||
msgstr ""
|
||||
"Pokud je počet denních položek vyšší než definuje limit, potom "
|
||||
"je zobrazen odkaz do pohledu reprezentujícího den."
|
||||
msgid "Calendar page"
|
||||
msgstr "Stránka kalendáře"
|
||||
msgid ""
|
||||
"Calendar page. Attach Calendar period attachments to this page, set to "
|
||||
"show the year, month, day, and week views."
|
||||
msgstr ""
|
||||
"Stránka kalendáře. Přidat ke stránce s obdobím kalendáře, "
|
||||
"určenou k zobrazení ročního, měsíčního, denního nebo "
|
||||
"týdenního pohledu."
|
||||
msgid "Calendar block"
|
||||
msgstr "Blok kalendáře"
|
||||
msgid ""
|
||||
"Calendar page. Attach a Calendar period attachment to this block, set "
|
||||
"to show the year, month, day, or week view."
|
||||
msgstr ""
|
||||
"Stránka kalendáře. Přidat k bloku přílohu s obdobím "
|
||||
"kalendáře, určenou k zobrazení ročního, měsíčního, denního "
|
||||
"nebo týdenního pohledu."
|
||||
msgid ""
|
||||
"An attachment for a Year, Month, Day, or Week calendar display, using "
|
||||
"any style you choose. Attach to a Calendar page and/or a Calendar "
|
||||
"block."
|
||||
msgstr ""
|
||||
"Příloha pro zobrazení kalendáře na rok, měsíc, den nebo týden "
|
||||
"používá styl, který jste vybral. Přiložte ke stránce a/nebo "
|
||||
"bloku kalendáře."
|
||||
msgid "Calendar page year, month, week, or day view"
|
||||
msgstr "Pohled stránky kalendáře pro rok, měsíc, týden nebo den"
|
||||
msgid "Calendar navigation"
|
||||
msgstr "Navigace kalendáře"
|
||||
msgid "Creates back/next navigation and calendar links."
|
||||
msgstr "Vytvoří navigaci \"zpět/další\" a odkazy kalendáře."
|
||||
msgid "Displays Views results in a calendar."
|
||||
msgstr "Zobrazuje výsledek Views v kalendáři."
|
||||
msgid "A Calendar period display will not work without a Date argument."
|
||||
msgstr ""
|
||||
"Zobrazení období v kalendáři nebude fungovat bez argumentu typu "
|
||||
"\"datum\"."
|
||||
msgid "Select the calendar time period for this display."
|
||||
msgstr "Vyberte časové období kalendáře pro toto zobrazení."
|
||||
msgid ""
|
||||
"The Calendar period display '@display_title' will not work without a "
|
||||
"Date argument."
|
||||
msgstr ""
|
||||
"Pohled na období kalendáře '@display_title' nebude fungovat bez "
|
||||
"data, jako argumentu."
|
||||
msgid ""
|
||||
"The Calendar display '@display_title' will not work without a Date "
|
||||
"argument."
|
||||
msgstr ""
|
||||
"Pohled na kalendář '@display_title' nebude fungovat bez data, jako "
|
||||
"argumentu."
|
||||
msgid "Legend Content Types"
|
||||
msgstr "Typy obsahu legendy"
|
||||
msgid "Legend Vocabularies"
|
||||
msgstr "Slovníky legendy"
|
||||
msgid "Legend Terms"
|
||||
msgstr "Termíny legendy"
|
||||
msgid "Date changer"
|
||||
msgstr "Změna datumu"
|
||||
msgid "Add new date link"
|
||||
msgstr "Přidej nový odkaz na datum"
|
||||
msgid "Display a popup calendar date selector?"
|
||||
msgstr "Zobrazit popup kalendář pro výběr data?"
|
||||
msgid ""
|
||||
"Display a link to add a new date of the specified content type. "
|
||||
"Displayed only to users with appropriate permissions."
|
||||
msgstr ""
|
||||
"Zobrazit odkaz pro přidání nového data zadaného typu obsahu. "
|
||||
"Zobrazí se pouze uživatelům s odpovídajícím oprávněním."
|
||||
msgid "Content Type Legend Colors"
|
||||
msgstr "Barevná legenda typů obsahu"
|
||||
msgid ""
|
||||
"<div class=\"form-item\"><label>Content Type</label><p>Set a hex color "
|
||||
"value (like #ffffff) to use in the calendar legend for each content "
|
||||
"type. Types with empty values will have no stripe in the calendar and "
|
||||
"will not be added to the legend.</p></div>"
|
||||
msgstr ""
|
||||
"<div class=\"form-item\"><label>Typ obsahu</label><p>Nastavte "
|
||||
"šestnáctkovou hodnotu barvy (např. #ffffff) pro každý typ obsahu, "
|
||||
"který je v kalendáři použit. Pokud nebude typu přiřazena barva, "
|
||||
"potom nebude tento typ v kalendáři nijak zvýrazněn a ani nebude "
|
||||
"zahrnut do legendy.</p></div>"
|
||||
msgid "Vocabulary Legend Types"
|
||||
msgstr "Typy slovníků v legendě"
|
||||
msgid ""
|
||||
"<div class=\"form-item\"><label>Vocabularies</label>Select "
|
||||
"vocabularies to use for setting calendar legend colors by taxonomy "
|
||||
"term. This works best for vocabularies with only a limited number of "
|
||||
"possible terms.</div>"
|
||||
msgstr ""
|
||||
"<div class=\"form-item\"><label>Slovníky</label>Vyberte slovník "
|
||||
"jehož termíny chcete barevně odlišovat. Je vhodné používat "
|
||||
"slovníky s omezeným počtem termínů.</div>"
|
||||
msgid "Taxonomy Legend Colors"
|
||||
msgstr "Barvy taxonomie v legendě"
|
||||
msgid ""
|
||||
"<div class=\"form-item warning\">Please select Legend vocabularies "
|
||||
"first!</div>"
|
||||
msgstr ""
|
||||
"<div class=\"form-item warning\">Nejdříve prosím zvolte slovníky "
|
||||
"legendy!</div>"
|
||||
msgid ""
|
||||
"<div class=\"form-item\"><label>Taxonomy Terms</label><p>Set a hex "
|
||||
"color value (like #ffffff) to use in the calendar legend for each "
|
||||
"taxonomy term. Terms with empty values will have no stripe in the "
|
||||
"calendar and will not be added to the legend.</p></div>"
|
||||
msgstr ""
|
||||
"<div class=\"form-item\"><label>Termíny taxonomie</label><p>Nastavte "
|
||||
"šestnáctkovou hodnotu barvy (např. #ffffff) pro každý termín, "
|
||||
"který je v kalendáři použít. Pokud nebude termínu přiřazena "
|
||||
"barva, potom nebude tento termín v kalendáři nijak zvýrazněn a "
|
||||
"ani nebude zahrnut do legendy.</p></div>"
|
||||
msgid "The @style style requires a Date argument."
|
||||
msgstr "Styl @style vyžaduje argument typu \"datum\"."
|
||||
msgid ""
|
||||
"The date argument date fields must be added to this query. You can "
|
||||
"exclude them if you do not want them displayed in the calendar."
|
||||
msgstr ""
|
||||
"Pole, které slouží jako argument datumu musí být součástí "
|
||||
"dotazu. Avšak není nutné jej zobrazovat."
|
||||
msgid "Calendar day of week names"
|
||||
msgstr "Názvy dnů v kalendáři"
|
||||
msgid "The way day of week names should be displayed in a calendar."
|
||||
msgstr ""
|
||||
"Způsob jakým mají být v kalendáři zobrazena názvy dní v "
|
||||
"týdnu."
|
||||
msgid ""
|
||||
"Whether or not to show week numbers in the left column of calendar "
|
||||
"weeks and months."
|
||||
msgstr ""
|
||||
"Uvádět čísla týdnů v levém sloupci při zobrazení týdne nebo "
|
||||
"měsíce?"
|
||||
msgid "No items"
|
||||
msgstr "Žádné položky"
|
||||
msgid "Time grouping"
|
||||
msgstr "Seskupení podle času"
|
||||
msgid "Group items together into time periods based on their start time."
|
||||
msgstr ""
|
||||
"Seskup položky do časových období podle jejich počátečního "
|
||||
"času."
|
||||
msgid "Half hour"
|
||||
msgstr "Půl hodiny"
|
||||
msgid "Custom time grouping"
|
||||
msgstr "Vlastní seskupování podle času"
|
||||
msgid ""
|
||||
"When choosing the 'custom' Time grouping option above, create custom "
|
||||
"time period groupings as a comma-separated list of 24-hour times in "
|
||||
"the format HH:MM:SS, like '00:00:00,08:00:00,18:00:00'. Be sure to "
|
||||
"start with '00:00:00'. All items after the last time will go in the "
|
||||
"final group."
|
||||
msgstr ""
|
||||
"Když je výše zvoleno vlastní seskupování dle času, je nutné "
|
||||
"vytvořit vlastní časové intervaly jako čárkami oddělený seznam "
|
||||
"ve 24-hodinovém formátu HH:MM:SS (např. "
|
||||
"'00:00:00,08:00:00,18:00:00'). Ujistěte se, že začínáte časem "
|
||||
"'00:00:00'. Všechny položky po posledním čase budou zařazeny do "
|
||||
"konečné skupiny."
|
||||
msgid "Field grouping"
|
||||
msgstr "Seskupování polí"
|
||||
msgid ""
|
||||
"Optionally group items into columns by a field value, for instance "
|
||||
"select the content type to show items for each content type in their "
|
||||
"own column, or use a location field to organize items into columns by "
|
||||
"location."
|
||||
msgstr ""
|
||||
"Volitelně je možné seskupit položky do sloupců dle hodnoty pole. "
|
||||
"Např. vyberte typ obsahu pro zobrazení počtu položek každého "
|
||||
"typu obsahu ve vlastním sloupci, nebo použijte políčko místa pro "
|
||||
"roztřídění položek do sloupců dle místa."
|
Reference in a new issue