Removed obsolete $ in source files
This commit is contained in:
parent
a39c010e06
commit
e5f2b64d98
146 changed files with 836 additions and 1081 deletions
|
@ -112,5 +112,3 @@ DirectoryIndex index.php
|
|||
RewriteCond %{REQUEST_URI} !=/favicon.ico
|
||||
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
|
||||
</IfModule>
|
||||
|
||||
# $Id$
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: administerusersbyrole.info,v 1.1.2.2 2009/06/29 16:06:09 smokris Exp $
|
||||
name = Administer Users by Role
|
||||
description = "Allows users with 'administer users' permission and a role (specified in 'Permissions') to edit/delete other users with a specified role. Also provides control over user creation."
|
||||
package = Core - extended
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: administerusersbyrole.module,v 1.1.2.4 2009/01/28 03:44:27 smokris Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Allows users with 'administer users' permission and a role (specified in 'Permissions') to edit/delete other users with a specified role. If the user being edited has multiple roles, the user doing the editing must have permission to edit ALL of the user being edited's roles. Also provides control over user creation. Works well in conjunction with <a href='http://drupal.org/project/role_delegation'>role_delegation</a>.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: autosave.module,v 1.9 2009/11/06 00:41:16 ptalindstrom Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Does background saves of node being edited.
|
||||
|
@ -106,7 +104,7 @@ function autosave_form_node_type_form_alter(&$form, $form_state) {
|
|||
function autosave_form_alter(&$form, &$form_state, $form_id) {
|
||||
global $user;
|
||||
$path = $_GET['q'];
|
||||
|
||||
|
||||
if (stristr($form_id, '_node_form') && arg(0) != 'admin') {
|
||||
|
||||
// check if this content_type has the autosave function enabled and make sure it's a node edit or add form
|
||||
|
@ -118,15 +116,15 @@ function autosave_form_alter(&$form, &$form_state, $form_id) {
|
|||
// if WYSIWYG module is enabled; lets let JS know this
|
||||
if (module_exists('wysiwyg')) $settings['autosave']['wysiwyg'] = 1;
|
||||
else $settings['autosave']['wysiwyg'] = 0;
|
||||
|
||||
|
||||
// add security token
|
||||
$token = drupal_get_token($form_id);
|
||||
|
||||
|
||||
$settings['autosave']['url'] = url('autosave/handler/' . $token);
|
||||
$settings['autosave']['period'] = variable_get('autosave_period', 10);
|
||||
$settings['autosave']['autosave_path'] = $path;
|
||||
$settings['autosave']['hidden'] = variable_get('autosave_hidden', 0);
|
||||
|
||||
|
||||
// If an autosaved version of the form exists, make it available via javascript.
|
||||
if ($autosaved_form = autosave_get_autosaved_form($form_id, $path, $user->uid)) {
|
||||
//$autosaved_form_id = $form['type']['#value'] ? $form['type']['#value'] .'_node_form' : 'node_form';
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: better-formats-defaults-admin-form.tpl.php,v 1.3.2.7 2009/09/27 14:27:13 dragonwize Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to configure Better Formats defaults admin page.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: better_formats.info,v 1.1.2.2 2009/02/25 06:44:17 dragonwize Exp $
|
||||
name = Better Formats
|
||||
description = Enhances the core input format system by managing input format defaults and settings.
|
||||
package = Core - extended
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: better_formats.install,v 1.7.2.7 2009/05/31 06:24:40 dragonwize Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Installs the better_formats module.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: better_formats.module,v 1.23.2.17 2010/02/05 13:59:18 dragonwize Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Enhances Drupal's core input format settings.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: better_formats_defaults.admin.inc,v 1.3.2.11 2010/02/05 13:52:48 dragonwize Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains FAPI and theme functions for the format defaults form.
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// $Id: better_formats_node_type_form.js,v 1.4.2.3 2009/05/31 17:53:41 dragonwize Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Enhances the default format selection on content type edit forms.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: better_formats_settings.admin.inc,v 1.6.2.3 2009/02/25 06:44:17 dragonwize Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains FAPI and theme functions for the format settings form.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: calendar.info,v 1.8 2008/04/23 23:42:53 karens Exp $
|
||||
name = Calendar
|
||||
description = Views plugin to display views containing dates as Calendars.
|
||||
dependencies[] = views
|
||||
|
@ -13,4 +12,3 @@ version = "6.x-2.4"
|
|||
core = "6.x"
|
||||
project = "calendar"
|
||||
datestamp = "1294072550"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
//$Id: calendar.install,v 1.13.2.12 2010/02/28 14:23:48 karens Exp $
|
||||
|
||||
/**
|
||||
* Implementation of hook_enable().
|
||||
* Reset the calendar caches.
|
||||
|
@ -30,13 +28,13 @@ function calendar_uninstall() {
|
|||
$ret = array();
|
||||
variable_del('calendar_default_view_options');
|
||||
$displays = array(
|
||||
'calendar',
|
||||
'calendar_attachment',
|
||||
'calendar_year',
|
||||
'calendar_day',
|
||||
'calendar_month',
|
||||
'calendar_week',
|
||||
'calendar_block',
|
||||
'calendar',
|
||||
'calendar_attachment',
|
||||
'calendar_year',
|
||||
'calendar_day',
|
||||
'calendar_month',
|
||||
'calendar_week',
|
||||
'calendar_block',
|
||||
'calendar_block_view',
|
||||
'calendar_ical',
|
||||
);
|
||||
|
@ -78,12 +76,12 @@ function calendar_update_6000() {
|
|||
$ret = array();
|
||||
drupal_set_message(t('Calendar module cannot be updated until after Views has been updated. Please return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
|
||||
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
variable_del('calendar_empty_arg');
|
||||
|
||||
|
||||
// Can't use variable_del because we don't have a reliable
|
||||
// way to find the old view names.
|
||||
db_query("DELETE FROM {variable} WHERE name LIKE 'calendar_%'");
|
||||
|
@ -101,7 +99,7 @@ function calendar_update_6001() {
|
|||
$ret = array();
|
||||
drupal_set_message(t('Calendar module cannot be updated until after Views has been updated. Please return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
|
||||
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
if (!module_exists('calendar_ical')) {
|
||||
|
@ -117,7 +115,7 @@ function calendar_update_6002() {
|
|||
$ret = array();
|
||||
drupal_set_message(t('Calendar module cannot be updated until after Views has been updated. Please return to <a href="@update-php">update.php</a> and run the remaining updates.', array('@update-php' => base_path() .'update.php?op=selection')), 'warning', FALSE);
|
||||
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
$periods = array(
|
||||
|
@ -147,11 +145,11 @@ function calendar_update_6002() {
|
|||
db_query("UPDATE {views_display} SET id='%s', display_plugin='%s', display_options='%s' WHERE id='%s'", $row['id'], $row['display_plugin'], $row['display_options'], $id);
|
||||
}
|
||||
elseif ($row['display_plugin'] == 'calendar' || $row['display_plugin'] == 'calendar_block') {
|
||||
db_query("UPDATE {views_display} SET id='%s' WHERE id='%s'", $row['id'] .'_1', $row['id']);
|
||||
db_query("UPDATE {views_display} SET id='%s' WHERE id='%s'", $row['id'] .'_1', $row['id']);
|
||||
}
|
||||
db_query("DELETE FROM {views_object_cache} WHERE name = '%s'", $row['name']);
|
||||
}
|
||||
views_invalidate_cache();
|
||||
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar displays to use new handlers.');
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: calendar.module,v 1.121.2.43 2010/12/31 16:25:43 karens Exp $
|
||||
define('CALENDAR_SHOW_ALL', 0);
|
||||
define('CALENDAR_HIDE_ALL', -1);
|
||||
|
||||
|
@ -34,7 +33,7 @@ function calendar_init() {
|
|||
if (module_exists('calendar_multiday') || substr($_GET['q'], 0, 24) == 'admin/build/modules/list') {
|
||||
return;
|
||||
}
|
||||
// The css for Farbtastic color picker, painless to add it here
|
||||
// The css for Farbtastic color picker, painless to add it here
|
||||
// even though it isn't needed everywhere.
|
||||
drupal_add_css('misc/farbtastic/farbtastic.css');
|
||||
drupal_add_css(drupal_get_path('module', 'calendar') .'/calendar.css');
|
||||
|
@ -157,11 +156,11 @@ function calendar_block($op = 'list', $delta = 0) {
|
|||
* Calendar display types
|
||||
*/
|
||||
function calendar_display_types() {
|
||||
return array('year' => t('Year'), 'month' => t('Month'), 'day' => t('Day'), 'week' => t('Week'));
|
||||
return array('year' => t('Year'), 'month' => t('Month'), 'day' => t('Day'), 'week' => t('Week'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Figure out which type of display to use,
|
||||
* Figure out which type of display to use,
|
||||
* based on the current argument.
|
||||
*
|
||||
* @return year, month, day, or week.
|
||||
|
@ -193,7 +192,7 @@ function calendar_current_type($view) {
|
|||
* @param $delta - the delta for this field, used to distinguish fields that appear more than once in the calendar
|
||||
* @param $stripe - the hex code for this stripe.
|
||||
* @param $label - the label to give this stripe.
|
||||
*
|
||||
*
|
||||
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
||||
* may be a better way.
|
||||
*/
|
||||
|
@ -208,7 +207,7 @@ function calendar_node_stripe($view, &$node, $query_name, $delta, $stripe = NULL
|
|||
if(!(isset($node->stripe))){
|
||||
$node->stripe = array();
|
||||
$node->stripe_label = array();
|
||||
}
|
||||
}
|
||||
if (!$label && array_key_exists($type, $type_names)) {
|
||||
$label = $type_names[$type];
|
||||
}
|
||||
|
@ -235,7 +234,7 @@ function calendar_node_stripe($view, &$node, $query_name, $delta, $stripe = NULL
|
|||
* @param $delta - the delta for this field, used to distinguish fields that appear more than once in the calendar
|
||||
* @param $stripe - the hex code for this stripe.
|
||||
* @param $label - the label to give this stripe.
|
||||
*
|
||||
*
|
||||
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
||||
* may be a better way.
|
||||
*/
|
||||
|
@ -245,8 +244,8 @@ function calendar_node_taxonomy_stripe($view, &$node, $query_name, $delta, $stri
|
|||
if (empty($colors_taxonomy)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Rename the vid added by Views to the normal name that
|
||||
|
||||
// Rename the vid added by Views to the normal name that
|
||||
// taxonomy will expect, it's in the raw results.
|
||||
$node->vid = $node->raw->node_vid;
|
||||
$terms_for_node = taxonomy_node_get_terms($node);
|
||||
|
@ -269,7 +268,7 @@ function calendar_node_taxonomy_stripe($view, &$node, $query_name, $delta, $stri
|
|||
else {
|
||||
$node->stripe[] = '';
|
||||
$node->stripe_label[] = '';
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -282,7 +281,7 @@ function calendar_node_taxonomy_stripe($view, &$node, $query_name, $delta, $stri
|
|||
* @param $delta - the delta for this field, used to distinguish fields that appear more than once in the calendar
|
||||
* @param $stripe - the hex code for this stripe.
|
||||
* @param $label - the label to give this stripe.
|
||||
*
|
||||
*
|
||||
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
||||
* may be a better way.
|
||||
*/
|
||||
|
@ -315,7 +314,7 @@ function calendar_node_group_stripe($view, &$node, $query_name, $delta, $stripe
|
|||
else {
|
||||
$node->stripe[] = '';
|
||||
$node->stripe_label[] = '';
|
||||
}
|
||||
}
|
||||
return $stripe;
|
||||
}
|
||||
|
||||
|
@ -376,7 +375,7 @@ function calendar_date_select_form(&$form_state, $view) {
|
|||
'#type' => 'hidden',
|
||||
'#value' => $view->get_url(),
|
||||
);
|
||||
$pos = calendar_arg_position($view);
|
||||
$pos = calendar_arg_position($view);
|
||||
$form['calendar_previous_arg'] = array(
|
||||
'#type' => 'hidden',
|
||||
'#value' => $view->args[$pos],
|
||||
|
@ -399,7 +398,7 @@ function calendar_arg_position($view) {
|
|||
}
|
||||
/**
|
||||
* Get the url for a calendar node.
|
||||
*
|
||||
*
|
||||
* @param $node - a calendar node object
|
||||
* @param $default - a default url to use when nothing specific is provided.
|
||||
*/
|
||||
|
@ -446,24 +445,24 @@ function calendar_errors($error) {
|
|||
}
|
||||
/**
|
||||
* Implementation of hook_elements.
|
||||
*
|
||||
*
|
||||
* Much of the colorpicker code was adapted from the Colorpicker module.
|
||||
* That module has no stable release yet nor any D6 branch.
|
||||
*
|
||||
*
|
||||
* TODO Consider dropping the duplicate code and adding a dependency
|
||||
* when that module is more stable, if calendar module customizations will
|
||||
* when that module is more stable, if calendar module customizations will
|
||||
* work in it.
|
||||
*/
|
||||
function calendar_elements() {
|
||||
// the Farbtastic colorpicker
|
||||
$type['calendar_colorpicker'] = array(
|
||||
'#attributes' => array('class' => 'calendar_colorpicker'),
|
||||
'#attributes' => array('class' => 'calendar_colorpicker'),
|
||||
'#input' => TRUE,
|
||||
);
|
||||
|
||||
|
||||
// a textfield to associate with the Farbtastic colorpicker
|
||||
$type['calendar_colorfield'] = array(
|
||||
'#attributes' => array('class' => 'calendar_colorfield'),
|
||||
'#attributes' => array('class' => 'calendar_colorfield'),
|
||||
'#input' => TRUE,
|
||||
'#validate' => array('calendar_validate_hex_color' => array())
|
||||
);
|
||||
|
@ -511,7 +510,7 @@ function theme_calendar_colorfield($element) {
|
|||
|
||||
/**
|
||||
* Add link to calendar to nodes.
|
||||
*
|
||||
*
|
||||
* Controlled by value of 'calendar_date_link' in the view.
|
||||
*/
|
||||
function calendar_link($type, $object, $teaser = FALSE) {
|
||||
|
@ -553,7 +552,7 @@ function calendar_remove($view_name) {
|
|||
function calendar_week_header($view) {
|
||||
$len = isset($view->date_info->style_name_size) ? $view->date_info->style_name_size : (!empty($view->date_info->mini) ? 1 : 3);
|
||||
$with_week = !empty($view->date_info->style_with_weekno);
|
||||
|
||||
|
||||
// create week header
|
||||
$untranslated_days = calendar_untranslated_days();
|
||||
if ($len == 99) {
|
||||
|
@ -608,7 +607,7 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
// Midnights are determined based on the same timezone as the View uses
|
||||
$display_timezone = date_timezone_get($view->date_info->min_date);
|
||||
$display_timezone_name = timezone_name_get($display_timezone);
|
||||
|
||||
|
||||
// Translate the view min and max dates to UTC values
|
||||
// so we can compare UTC dates to the view range.
|
||||
$min_utc = drupal_clone($view->date_info->min_date);
|
||||
|
@ -650,14 +649,14 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
$local_tz = date_get_timezone($field['tz_handling'], 'date');
|
||||
$field_name = $field['field_name'];
|
||||
$rrule_field = str_replace(array('_value2', '_value'), '_rrule', $alias);
|
||||
|
||||
|
||||
// Set a flag to tell us if individual multi-day dates need to be
|
||||
// split into separate nodes.
|
||||
$split_dates = TRUE;
|
||||
if (strstr($view->current_display, '_ical')) {
|
||||
$split_dates = FALSE;
|
||||
}
|
||||
|
||||
|
||||
// If there is no field for this item, just default to the site format.
|
||||
if (!isset($view->field[$field_name])) {
|
||||
$format = variable_get('date_format_short', 'm/d/Y - H:i');
|
||||
|
@ -692,7 +691,7 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
|
||||
// set the domain part of the id
|
||||
$domain = check_plain($_SERVER['SERVER_NAME']);
|
||||
|
||||
|
||||
// If there are multiple date fields in this calendar we may get
|
||||
// duplicate items from the other date fields, so add a way to
|
||||
// make sure each individual date field only gets added to the
|
||||
|
@ -705,9 +704,9 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
if (substr($field['type'], 0, 3) == 'cck') {
|
||||
$real_field = str_replace(array('_value2', '_value'), '', $field_name);
|
||||
}
|
||||
|
||||
|
||||
$id = 'calendar.'. $item->{$view->base_field} .'.'. $real_field .'.'. $delta;
|
||||
|
||||
|
||||
// When creating iCal feeds for repeating dates we don't want all
|
||||
// the multiple values, send only the first value.
|
||||
if (strstr($view->current_display, '_ical')) {
|
||||
|
@ -718,30 +717,30 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!in_array($id, $processed) && !empty($item->calendar_fields->$alias)) {
|
||||
|
||||
|
||||
// Create from and to date values for each item, adjusted to
|
||||
// the correct timezone.
|
||||
$values[0] = !empty($item->calendar_fields->$fromto[0]) ? $item->calendar_fields->$fromto[0] : $item->calendar_fields->$alias;
|
||||
$values[1] = !empty($item->calendar_fields->$fromto[1]) ? $item->calendar_fields->$fromto[1] : $item->calendar_fields->$alias;
|
||||
|
||||
|
||||
$db_tz = date_get_timezone_db($tz_handling, isset($item->$tz_alias) ? $item->$tz_alias : $display_timezone_name);
|
||||
$to_zone = date_get_timezone($tz_handling, isset($item->$tz_alias) ? $item->$tz_alias : $display_timezone_name);
|
||||
|
||||
|
||||
// Now $display_timezone determines how $item is split into
|
||||
// one entry per day, while $to_zone determines how date is displayed.
|
||||
// For now, use the date fields's timezone for the day splitting.
|
||||
$display_timezone_name = $to_zone;
|
||||
$values_display = array();
|
||||
|
||||
|
||||
// Start date
|
||||
$date = date_make_date($values[0], $db_tz, $field['sql_type']);
|
||||
if ($db_tz != $to_zone) {
|
||||
date_timezone_set($date, timezone_open($to_zone));
|
||||
}
|
||||
$values[0] = date_format($date, DATE_FORMAT_DATETIME);
|
||||
|
||||
|
||||
if ($display_timezone_name != $to_zone) {
|
||||
date_timezone_set($date, $display_timezone);
|
||||
$values_display[0] = date_format($date, DATE_FORMAT_DATETIME);
|
||||
|
@ -749,7 +748,7 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
else {
|
||||
$values_display[0] = $values[0];
|
||||
}
|
||||
|
||||
|
||||
// End date
|
||||
$date = date_make_date($values[1], $db_tz, $field['sql_type']);
|
||||
if ($db_tz != $to_zone) {
|
||||
|
@ -763,7 +762,7 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
else {
|
||||
$values_display[1] = $values[1];
|
||||
}
|
||||
|
||||
|
||||
// Now $values contain start and end date of a node,
|
||||
// expressed as strings in the display (local) timezone.
|
||||
// $values_utc does the same in UTC timezone.
|
||||
|
@ -778,13 +777,13 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
date_timezone_set($date, $display_timezone);
|
||||
$max_zone_string[$display_timezone_name] = date_format($date, DATE_FORMAT_DATE);
|
||||
}
|
||||
|
||||
|
||||
// Create a node for each date within the field's date range,
|
||||
// limited to the view's date range (regarding only day, not time).
|
||||
$now = max($min_zone_string[$display_timezone_name], substr($values_display[0], 0, 10));
|
||||
$to = min($max_zone_string[$display_timezone_name], substr($values_display[1], 0, 10));
|
||||
$next = date_make_date($now, $display_timezone);
|
||||
|
||||
|
||||
if ($display_timezone_name != $to_zone) {
|
||||
// Make $start and $end (derived from $node) use the timezone $to_zone, just as $values[..] do
|
||||
date_timezone_set($next, timezone_open($to_zone));
|
||||
|
@ -792,13 +791,13 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
if (empty($to)) {
|
||||
$to = $now;
|
||||
}
|
||||
|
||||
|
||||
// $now and $next are midnight (in display timezone) on the first day where node will occur.
|
||||
// $to is midnight on the last day where node will occur.
|
||||
// All three were limited by the min-max date range of the view.
|
||||
while ($now <= $to) {
|
||||
$node = drupal_clone($item);
|
||||
|
||||
|
||||
// Make sure the pseudo node has the same properties a
|
||||
// regular node would have.
|
||||
if (isset($node->node_title) && !isset($node->title)) {
|
||||
|
@ -820,10 +819,10 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
$node->format_time = '';
|
||||
}
|
||||
$node->url = calendar_get_node_link($node);
|
||||
|
||||
|
||||
//$node->$fromto[0] = $values[0];
|
||||
//$node->$fromto[1] = $values[1];
|
||||
|
||||
|
||||
// Flag which datefield this node is using, in case
|
||||
// there are multiple date fields in the view.
|
||||
$node->datefield = $alias;
|
||||
|
@ -863,16 +862,16 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
}
|
||||
$node->date_start = date_create($values[0], timezone_open($to_zone));
|
||||
$node->date_end = date_create(!empty($values[1]) ? $values[1] : $values[0], timezone_open($to_zone));;
|
||||
|
||||
|
||||
// Make date objects
|
||||
$node->calendar_start_date = date_create($node->calendar_start, timezone_open($to_zone));
|
||||
$node->calendar_end_date = date_create($node->calendar_end, timezone_open($to_zone));
|
||||
|
||||
|
||||
// Change string timezones into
|
||||
// calendar_start and calendar_end are UTC dates as formatted strings
|
||||
$node->calendar_start = date_format($node->calendar_start_date, DATE_FORMAT_DATETIME);
|
||||
$node->calendar_end = date_format($node->calendar_end_date, DATE_FORMAT_DATETIME);
|
||||
|
||||
|
||||
if (substr($real_field, 0, 6) == 'field_') {
|
||||
$cck_field = content_fields($cck_field_name);
|
||||
$granularity = is_array($cck_field['granularity']) ? end($cck_field['granularity']) : $cck_field['granularity'];
|
||||
|
@ -883,13 +882,13 @@ function calendar_build_nodes(&$view, &$items) {
|
|||
$increment = 1;
|
||||
}
|
||||
$node->calendar_all_day = $granularity == 'day' ? TRUE : date_is_all_day($node->calendar_start, $node->calendar_end, $granularity, $increment);
|
||||
|
||||
|
||||
// Flag all day values specifically set in date.
|
||||
$all_day_field = str_replace(array('_value2', '_value'), '_all_day', $node->datefield);
|
||||
if (!empty($all_day_field) && !empty($item->$all_day_field)) {
|
||||
$node->calendar_all_day = TRUE;
|
||||
}
|
||||
|
||||
|
||||
unset($node->calendar_fields);
|
||||
if (isset($node) && (empty($node->calendar_start))) {
|
||||
// if no date for the node and no date in the item
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: calendar-view-ical.tpl.php,v 1.1.2.5 2010/11/21 12:25:12 karens Exp $
|
||||
/**
|
||||
* $calname
|
||||
* The name of the calendar.
|
||||
|
@ -7,7 +6,7 @@
|
|||
* The name of the site timezone.
|
||||
* $events
|
||||
* An array with the following information about each event:
|
||||
*
|
||||
*
|
||||
* $event['uid'] - a unique id for the event (usually the url).
|
||||
* $event['summary'] - the name of the event.
|
||||
* $event['start'] - the formatted start date of the event.
|
||||
|
@ -17,10 +16,10 @@
|
|||
* $event['url'] - the url for the event.
|
||||
* $event['location'] - the name of the event location.
|
||||
* $event['description'] - a description of the event.
|
||||
*
|
||||
*
|
||||
* Note that there are empty spaces after RRULE, URL, LOCATION, etc
|
||||
* that are needed to make sure we get the required line break.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: calendar_ical.info,v 1.1.2.1 2008/09/05 11:03:42 karens Exp $
|
||||
name = Calendar iCal
|
||||
description = Adds ical functionality to Calendar views.
|
||||
dependencies[] = views
|
||||
|
@ -14,4 +13,3 @@ version = "6.x-2.4"
|
|||
core = "6.x"
|
||||
project = "calendar"
|
||||
datestamp = "1294072550"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: calendar_ical.install,v 1.1.2.6 2010/02/28 14:23:48 karens Exp $
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
|
@ -13,7 +11,7 @@ function calendar_ical_install() {
|
|||
*/
|
||||
function calendar_ical_uninstall() {
|
||||
$displays = array(
|
||||
'ical',
|
||||
'ical',
|
||||
);
|
||||
db_query("DELETE FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')");
|
||||
db_query("DELETE FROM {cache_views}");
|
||||
|
@ -51,4 +49,4 @@ function calendar_ical_update_6000() {
|
|||
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar ical displays to use new handlers and ids.');
|
||||
views_invalidate_cache();
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: calendar_ical.module,v 1.1.2.6 2008/11/24 15:48:15 karens Exp $
|
||||
|
||||
/**
|
||||
* Implementation of hook_views_api().
|
||||
*
|
||||
|
@ -29,4 +27,4 @@ function theme_calendar_ical_icon($url) {
|
|||
if ($image = theme('image', drupal_get_path('module', 'date_api') .'/images/ical16x16.gif', t('Add to calendar'), t('Add to calendar'))) {
|
||||
return '<div style="text-align:right"><a href="'. check_url($url) .'" class="ical-icon" title="ical">'. $image .'</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
//$Id: calendar_ical.views.inc,v 1.1.2.6 2009/02/16 23:46:22 karens Exp $
|
||||
//views_include_handlers();
|
||||
/**
|
||||
* Implementation of hook_views_plugins
|
||||
*/
|
||||
|
@ -79,4 +77,4 @@ function calendar_ical_views_plugins() {
|
|||
),
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
//$Id: calendar_ical_admin.inc,v 1.1.2.2 2008/10/02 20:23:49 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Setup and admin functions.
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
// $Id: calendar_plugin_display_ical.inc,v 1.1.2.5 2008/11/25 16:12:36 karens Exp $
|
||||
/**
|
||||
* The plugin that handles a feed, such as RSS or atom.
|
||||
*
|
||||
* For the most part, feeds are page displays but with some subtle differences.
|
||||
*/
|
||||
class calendar_plugin_display_ical extends views_plugin_display_page {
|
||||
|
||||
|
||||
function get_style_type() { return 'ical'; }
|
||||
|
||||
function uses_breadcrumb() { return FALSE; }
|
||||
|
||||
|
||||
/**
|
||||
* Feeds do not go through the normal page theming mechanism. Instead, they
|
||||
* go through their own little theme function and then return NULL so that
|
||||
|
@ -188,23 +187,23 @@ class calendar_plugin_display_ical extends views_plugin_display_page {
|
|||
$plugin->attach_to($display_id, $this->get_path(), $clone->get_title());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display validation.
|
||||
*/
|
||||
function validate() {
|
||||
$errors = parent::validate();
|
||||
|
||||
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
$filters = $this->display->handler->get_option('filters');
|
||||
|
||||
|
||||
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
|
||||
if (empty($this->view->date_info->arg_missing)) {
|
||||
$errors[] = t("A Calendar period display will not work without a Date argument or a Date filter.");
|
||||
$errors[] = t("A Calendar period display will not work without a Date argument or a Date filter.");
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
}
|
||||
if (array_key_exists('date_argument', $arguments) &&
|
||||
if (array_key_exists('date_argument', $arguments) &&
|
||||
($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');
|
||||
|
@ -213,6 +212,5 @@ class calendar_plugin_display_ical extends views_plugin_display_page {
|
|||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: calendar_plugin_style_ical.inc,v 1.1.2.17 2009/04/28 22:47:29 karens Exp $
|
||||
/**
|
||||
* Default style plugin to render an iCal feed.
|
||||
*/
|
||||
|
@ -9,14 +8,14 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
$fields = $display->handler->default_display->options['fields'];
|
||||
$this->options['fields'] = $fields;
|
||||
}
|
||||
|
||||
|
||||
function query() {
|
||||
// We need these values for the iCal feed.
|
||||
$this->view->query->add_field('node', 'title');
|
||||
$this->view->query->add_field('node', 'type');
|
||||
parent::query();
|
||||
}
|
||||
|
||||
|
||||
function attach_to($display_id, $path, $title) {
|
||||
$display = $this->view->display[$display_id]->handler;
|
||||
$url_options = array();
|
||||
|
@ -24,7 +23,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
if ($input) {
|
||||
$url_options['query'] = $input;
|
||||
}
|
||||
|
||||
|
||||
// TODO adjust this to pick up default values when no arg is set?
|
||||
$url = url($this->view->get_url(NULL, $path), $url_options);
|
||||
if (empty($this->view->feed_icon)) {
|
||||
|
@ -50,14 +49,14 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
$options['location_field'] = '';
|
||||
$options['fields'] = array();
|
||||
}
|
||||
|
||||
|
||||
function option_definition() {
|
||||
$options = parent::option_definition();
|
||||
|
||||
$options['summary_field'] = array('default' => '', 'translatable' => TRUE);
|
||||
$options['description_field'] = array('default' => '', 'translatable' => TRUE);
|
||||
$options['location_field'] = array('default' => '', 'translatable' => TRUE);
|
||||
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
|
@ -68,7 +67,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
$options[$field['field']] = $handler->ui_name();
|
||||
}
|
||||
$form['#prefix'] = '<div class="form-item">'. t("Map the View fields to the values they should represent in the iCal feed. Only fields that have been added to the view are available to use in this way. You can add additional fields to the view and mark them 'Exclude from display' if you only want them in the iCal feed.") .'</div>';
|
||||
|
||||
|
||||
$form['summary_field'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Title'),
|
||||
|
@ -88,7 +87,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
'#default_value' => $this->options['location_field'],
|
||||
'#options' => $options,
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,30 +95,30 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
*/
|
||||
function validate() {
|
||||
$errors = parent::validate();
|
||||
|
||||
|
||||
$style = $this->display->display_options['style_plugin'];
|
||||
|
||||
|
||||
$arguments = $this->display->handler->get_option('arguments');
|
||||
$filters = $this->display->handler->get_option('filters');
|
||||
|
||||
|
||||
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
|
||||
if (empty($this->view->date_info->arg_missing)) {
|
||||
$errors[$style] = t("The @style style requires a Date argument or a Date filter.", array('@style' => $style));
|
||||
$errors[$style] = t("The @style style requires a Date argument or a Date filter.", array('@style' => $style));
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
}
|
||||
if (array_key_exists('date_argument', $arguments) &&
|
||||
if (array_key_exists('date_argument', $arguments) &&
|
||||
($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');
|
||||
$errors[] = calendar_errors('missing_argument_default');
|
||||
}
|
||||
$this->view->date_info->arg_missing_default = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (empty($this->options['summary_field'])) {
|
||||
$errors[] = $errors[$style] = t("The @style style requires a Title field for the iCal export.", array('@style' => $style));
|
||||
}
|
||||
// Make sure date fields are not set up to 'Group multiple values'
|
||||
// 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);
|
||||
|
@ -138,20 +137,20 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
|
||||
function render() {
|
||||
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
|
||||
|
||||
|
||||
// Transfer the style options to the view object so they
|
||||
// can be easily accessed in the theme.
|
||||
$style_options = $this->options;
|
||||
$this->view->date_info->summary_field = $style_options['summary_field'];
|
||||
$this->view->date_info->description_field = $style_options['description_field'];
|
||||
$this->view->date_info->location_field = $style_options['location_field'];
|
||||
|
||||
// Evaluate our argument values and figure out which
|
||||
|
||||
// Evaluate our argument values and figure out which
|
||||
// calendar display we need to create.
|
||||
$i = 0;
|
||||
$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.
|
||||
|
@ -172,13 +171,13 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
$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;
|
||||
|
||||
|
||||
// Stop after the first date argument, if there is more than one.
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// The ical display might have date filters instead of arguments.
|
||||
// If we missed getting a min date from date arguments, try date filters.
|
||||
if (empty($this->view->date_info->min_date)) {
|
||||
|
@ -204,19 +203,19 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
$this->view->date_info->date_fields = array();
|
||||
}
|
||||
$this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, array_keys($filter->options['date_fields']));
|
||||
|
||||
|
||||
// Stop after the first date filter, if there is more than one.
|
||||
break;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// Render each field into an output array.
|
||||
$items = array();
|
||||
$calendar_fields = date_api_fields($this->view->base_table);
|
||||
$calendar_fields = array_keys($calendar_fields['alias']);
|
||||
|
||||
|
||||
foreach ($this->view->result as $num => $row) {
|
||||
$items[$num] = $row;
|
||||
// Store the raw date values before formatting the results.
|
||||
|
@ -227,17 +226,17 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
|||
}
|
||||
foreach ($this->view->field as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
if (!empty($field) && is_object($field)) {
|
||||
$field_output = $field->theme($row);
|
||||
$items[$num]->{$field_alias} = $field_output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Massage the resulting items into formatted calendar items.
|
||||
$items = calendar_build_nodes($this->view, $items);
|
||||
|
||||
|
||||
// Merge in items from other sources.
|
||||
foreach (module_implements('calendar_add_items') as $module) {
|
||||
$function = $module .'_calendar_add_items';
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
// $Id: theme.inc,v 1.1.2.15 2010/11/21 11:00:56 karens Exp $
|
||||
/**
|
||||
* Preprocess an ical feed
|
||||
*/
|
||||
function template_preprocess_calendar_view_ical(&$vars) {
|
||||
global $base_url;
|
||||
global $language;
|
||||
|
||||
|
||||
$view = &$vars['view'];
|
||||
$options = &$vars['options'];
|
||||
$items = &$vars['rows'];
|
||||
|
||||
|
||||
$style = &$view->style_plugin;
|
||||
|
||||
// Figure out which display which has a path we're using for this feed. If there isn't
|
||||
|
@ -24,18 +23,18 @@ function template_preprocess_calendar_view_ical(&$vars) {
|
|||
|
||||
// Keep devel module from appending queries to ical export.
|
||||
$GLOBALS['devel_shutdown'] = FALSE;
|
||||
|
||||
|
||||
drupal_set_header('Content-Type: text/calendar; charset=utf-8');
|
||||
drupal_set_header('Content-Disposition: attachment; filename="calendar.ics"; ');
|
||||
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_ical.inc');
|
||||
require_once('./'. drupal_get_path('module', 'date_api') .'/theme/theme.inc');
|
||||
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
|
||||
|
||||
|
||||
$events = array();
|
||||
// Get the alias name for each of our data fields.
|
||||
foreach ($view->field as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
foreach (array('summary_field', 'description_field', 'location_field') as $data) {
|
||||
if ($field->field == $view->date_info->$data) {
|
||||
$$data = $field_alias;
|
||||
|
@ -70,11 +69,11 @@ function template_preprocess_calendar_view_ical(&$vars) {
|
|||
date_timezone_set($event['start'], timezone_open('UTC'));
|
||||
date_timezone_set($event['end'], timezone_open('UTC'));
|
||||
}
|
||||
|
||||
|
||||
$headertitle = filter_xss_admin($view->get_title());
|
||||
$title = variable_get('site_name', 'Drupal');
|
||||
$description = $headertitle . ($title ? ' | '. $title : '');
|
||||
|
||||
|
||||
$vars['calname'] = $description;
|
||||
$vars['events'] = $events;
|
||||
template_preprocess_date_vcalendar($vars);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: calendar_multiday.info,v 1.1.2.2 2011/01/03 12:28:47 karens Exp $
|
||||
name = Calendar Multiday
|
||||
description = "Use the calendar multiday display as an alternative to the standard display. (BETA version)"
|
||||
dependencies[] = calendar
|
||||
|
@ -12,4 +11,3 @@ version = "6.x-2.4"
|
|||
core = "6.x"
|
||||
project = "calendar"
|
||||
datestamp = "1294072550"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: calendar_multiday.module,v 1.1.2.2 2010/12/31 16:25:43 karens Exp $
|
||||
|
||||
/**
|
||||
* Implementation of hook_views_api().
|
||||
*
|
||||
|
@ -81,10 +79,10 @@ function calendar_multiday_theme() {
|
|||
'calendar_month_col' => $base + array(
|
||||
'template' => 'calendar-month-col',
|
||||
'arguments' => array('item' => NULL),
|
||||
),
|
||||
),
|
||||
'calendar_month_row' => $base + array(
|
||||
'template' => 'calendar-month-row',
|
||||
'arguments' => array('inner' => NULL, 'class' => NULL, 'iehint' => NULL),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// $Id: calendar_overlap.js,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/*
|
||||
* Create the splitter, set the viewport size, and set the position of the scrollbar to the first item.
|
||||
*/
|
||||
|
@ -8,16 +7,16 @@ Drupal.behaviors.calendarSetScroll = function (context) {
|
|||
$('.header-body-divider:not(.header-body-divider-processed)').each(function() {
|
||||
var divider = $(this).addClass('header-body-divider-processed');
|
||||
var start_y = divider.offset().top;
|
||||
|
||||
// Add the grippie icon
|
||||
|
||||
// Add the grippie icon
|
||||
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
|
||||
|
||||
|
||||
function startDrag(e) {
|
||||
start_y = divider.offset().top;
|
||||
$(document).mousemove(performDrag).mouseup(endDrag);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function performDrag(e) {
|
||||
var offset = e.pageY - start_y;
|
||||
var mwc = $('#multi-day-container');
|
||||
|
@ -25,25 +24,25 @@ Drupal.behaviors.calendarSetScroll = function (context) {
|
|||
start_y = divider.offset().top;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function endDrag(e) {
|
||||
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.single-day-footer:not(.single-day-footer-processed)').each(function() {
|
||||
var divider = $(this).addClass('single-day-footer-processed');
|
||||
var start_y = divider.offset().top;
|
||||
|
||||
// Add the grippie icon
|
||||
|
||||
// Add the grippie icon
|
||||
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
|
||||
|
||||
|
||||
function startDrag(e) {
|
||||
start_y = divider.offset().top;
|
||||
$(document).mousemove(performDrag).mouseup(endDrag);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function performDrag(e) {
|
||||
var offset = e.pageY - start_y;
|
||||
var sdc = $('#single-day-container');
|
||||
|
@ -51,12 +50,12 @@ Drupal.behaviors.calendarSetScroll = function (context) {
|
|||
start_y = divider.offset().top;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function endDrag(e) {
|
||||
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Size the window
|
||||
calendar_resizeViewport();
|
||||
}
|
||||
|
@ -69,14 +68,13 @@ function calendar_scrollToFirst() {
|
|||
}
|
||||
}
|
||||
|
||||
// Size the single day view
|
||||
// Size the single day view
|
||||
function calendar_resizeViewport() {
|
||||
// Size of the browser window
|
||||
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
|
||||
var top = $('#single-day-container').offset().top;
|
||||
|
||||
|
||||
$('#multi-day-container').height(75);
|
||||
// Give it a 20 pixel margin at the bottom
|
||||
$('#single-day-container').height(Math.max(400,viewportHeight - top - 20));
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
//$Id: calendar.inc,v 1.1.2.4 2011/01/02 00:00:56 karens Exp $
|
||||
/**
|
||||
* Build calendar
|
||||
*
|
||||
|
@ -23,10 +22,10 @@ function calendar_build_calendar($view, $items) {
|
|||
}
|
||||
$items = $values;
|
||||
ksort($items);
|
||||
|
||||
|
||||
$rows = array();
|
||||
$curday = drupal_clone($view->date_info->min_date);
|
||||
|
||||
|
||||
switch ($view->date_info->granularity) {
|
||||
case 'year':
|
||||
$rows = array();
|
||||
|
@ -49,7 +48,7 @@ function calendar_build_calendar($view, $items) {
|
|||
break;
|
||||
}
|
||||
return $rows;
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* Build one month.
|
||||
|
@ -85,20 +84,20 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
$week_rows = calendar_build_week($curday, $view, $items, TRUE);
|
||||
$multiday_buckets = $week_rows['multiday_buckets'];
|
||||
$singleday_buckets = $week_rows['singleday_buckets'];
|
||||
|
||||
|
||||
$total_rows = $week_rows['total_rows'];
|
||||
|
||||
|
||||
// Theme each row
|
||||
$output = "";
|
||||
$final_day = clone($curday);
|
||||
|
||||
|
||||
$iehint = 0;
|
||||
$max_multirow_cnt = 0;
|
||||
$max_singlerow_cnt = 0;
|
||||
|
||||
|
||||
for ($i = 0; $i < $total_rows + 1; $i++) {
|
||||
$inner = "";
|
||||
|
||||
|
||||
// If we're displaying the week number, add it as the
|
||||
// first cell in the week.
|
||||
if ($i == 0 && !empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', 'week'))) {
|
||||
|
@ -114,25 +113,25 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
'entry' => $weekno,
|
||||
'colspan' => 1,
|
||||
'rowspan' => $total_rows + 1,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'class' => 'week'
|
||||
);
|
||||
$inner .= theme('calendar_month_col', $item);
|
||||
}
|
||||
|
||||
|
||||
$curday = clone($init_day);
|
||||
|
||||
|
||||
// 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');
|
||||
|
||||
|
||||
for ( $wday = 0; $wday < 7; $wday++) {
|
||||
|
||||
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
$class = strtolower($weekdays[$wday]);
|
||||
$item = NULL;
|
||||
$in_month = !($curday_date < $view->date_info->min_date_date || $curday_date > $view->date_info->max_date_date || date_format($curday, 'n') != $month);
|
||||
|
||||
|
||||
// Add the datebox
|
||||
if ($i == 0) {
|
||||
$count = $in_month ? intval(count($multiday_buckets[$wday]) + count($singleday_buckets[$wday])) : FALSE;
|
||||
|
@ -151,40 +150,40 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
else {
|
||||
$index = $i - 1;
|
||||
$multi_count = count($multiday_buckets[$wday]);
|
||||
|
||||
|
||||
// Process multiday buckets first. If there is a multiday-bucket item in this row...
|
||||
if ($index < $multi_count) {
|
||||
|
||||
|
||||
// If this item is filled with either a blank or an entry...
|
||||
if ($multiday_buckets[$wday][$index]['filled']) {
|
||||
|
||||
|
||||
// Add item and add class
|
||||
$item = $multiday_buckets[$wday][$index];
|
||||
$item['class'] = 'multi-day';
|
||||
$item['date'] = $curday_date;
|
||||
|
||||
|
||||
// Is this an entry?
|
||||
if (!$multiday_buckets[$wday][$index]['avail']) {
|
||||
|
||||
|
||||
// If the item either starts or ends on today,
|
||||
// then add tags so we can style the borders
|
||||
if ($curday_date == $today && $in_month) {
|
||||
$item['class'] .= ' starts-today';
|
||||
}
|
||||
|
||||
|
||||
// Calculate on which day of this week this item ends on..
|
||||
$end_day = clone($curday);
|
||||
$span = $item['colspan'] - 1;
|
||||
date_modify($end_day, '+' . $span .' day');
|
||||
$endday_date = date_format($end_day, DATE_FORMAT_DATE);
|
||||
|
||||
|
||||
// If it ends today, add class
|
||||
if ($endday_date == $today && $in_month) {
|
||||
$item['class'] .= ' ends-today';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If this is an acutal entry, add classes regarding the state of the
|
||||
// item
|
||||
if ($multiday_buckets[$wday][$index]['avail']) {
|
||||
|
@ -192,11 +191,11 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
($curday_date < $today ? ' past' : '') .
|
||||
($curday_date > $today ? ' future' : '');
|
||||
}
|
||||
|
||||
|
||||
// Else, process the single day bucket - we only do this once per day
|
||||
}
|
||||
elseif ($index == $multi_count) {
|
||||
|
||||
|
||||
$single_day_cnt = 0;
|
||||
// If it's empty, add class
|
||||
if (count($singleday_buckets[$wday]) == 0) {
|
||||
|
@ -218,9 +217,9 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
}
|
||||
$class = 'single-day';
|
||||
}
|
||||
|
||||
|
||||
$rowspan = $total_rows - $index;
|
||||
|
||||
|
||||
// Add item...
|
||||
$item = array(
|
||||
'entry' => $single_days,
|
||||
|
@ -230,7 +229,7 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
'date' => $curday_date,
|
||||
'id' => $view->name . '-' . $curday_date . '-' . $index
|
||||
);
|
||||
|
||||
|
||||
// Hack for ie to help it properly space single day rows
|
||||
if ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
|
||||
$max_multirow_cnt = max($max_multirow_cnt, $single_day_cnt);
|
||||
|
@ -238,7 +237,7 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
else {
|
||||
$max_singlerow_cnt = max($max_singlerow_cnt, $single_day_cnt);
|
||||
}
|
||||
|
||||
|
||||
// If the singlerow is bigger than the multi-row, then null out
|
||||
// ieheight - I'm estimating that a single row is twice the size of
|
||||
// multi-row. This is really the best that can be done with ie
|
||||
|
@ -248,14 +247,14 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
elseif ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
|
||||
$iehint = max($iehint, $rowspan - 1); // How many rows to adjust for?
|
||||
}
|
||||
|
||||
|
||||
// Set the class
|
||||
$item['class'] .= ($curday_date == $today && $in_month ? ' today' : '') .
|
||||
($curday_date < $today ? ' past' : '') .
|
||||
($curday_date > $today ? ' future' : '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If there isn't an item, then add empty class
|
||||
if ($item != NULL) {
|
||||
if (!$in_month) {
|
||||
|
@ -264,10 +263,10 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
// Style this entry - it will be a <td>.
|
||||
$inner .= theme('calendar_month_col', $item);
|
||||
}
|
||||
|
||||
|
||||
date_modify($curday, '+1 day');
|
||||
}
|
||||
|
||||
|
||||
if ($i == 0) {
|
||||
$output .= theme('calendar_month_row', $inner, 'date-box', $iehint);
|
||||
}
|
||||
|
@ -283,14 +282,14 @@ function calendar_build_month(&$curday, $view, $items) {
|
|||
}
|
||||
}
|
||||
$curday = $final_day;
|
||||
|
||||
|
||||
// Add the row into the row array....
|
||||
$rows[] = array('data' => $output);
|
||||
|
||||
|
||||
$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;
|
||||
|
@ -309,7 +308,7 @@ function calendar_build_mini_week(&$curday, $view, $items, $check_month = FALSE)
|
|||
$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'))) {
|
||||
|
@ -323,7 +322,7 @@ function calendar_build_mini_week(&$curday, $view, $items, $check_month = FALSE)
|
|||
}
|
||||
$rows[$week][] = array(
|
||||
'data' => $weekno,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'class' => 'week');
|
||||
}
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
|
@ -347,7 +346,7 @@ function calendar_build_mini_week(&$curday, $view, $items, $check_month = FALSE)
|
|||
($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);
|
||||
|
@ -363,17 +362,17 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
|||
$weekdays = calendar_untranslated_days($items, $view);
|
||||
$month = date_format($curday, 'n');
|
||||
$first_day = variable_get('date_first_day', 0);
|
||||
|
||||
|
||||
// Set up buckets
|
||||
$total_rows = 0;
|
||||
$multiday_buckets = array( array(), array(), array(), array(), array(), array(), array());
|
||||
$singleday_buckets = array( array(), array(), array(), array(), array(), array(), array());
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
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 = strtolower($weekdays[$i]) .' empty';
|
||||
|
@ -389,7 +388,7 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
|||
date_modify($curday, '+1 day');
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
}
|
||||
|
||||
|
||||
$rows = array(
|
||||
'multiday_buckets' => $multiday_buckets,
|
||||
'singleday_buckets' => $singleday_buckets,
|
||||
|
@ -407,7 +406,7 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
$cur_cnt = 0;
|
||||
$total_cnt = 0;
|
||||
$types = array();
|
||||
|
||||
|
||||
// If we are hiding, count before processing further
|
||||
if ($max_events != CALENDAR_SHOW_ALL) {
|
||||
foreach ($items as $date => $day) {
|
||||
|
@ -421,7 +420,7 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If we haven't already exceeded the max or we'll showing all, then process the items
|
||||
if ($max_events == CALENDAR_SHOW_ALL || !$hide || $total_cnt <= $max_events) {
|
||||
// Count currently filled items
|
||||
|
@ -430,7 +429,7 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
$cur_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($items as $date => $day) {
|
||||
if ($date == $curday_date) {
|
||||
$count = 0;
|
||||
|
@ -438,38 +437,38 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
foreach ($day as $time => $hour) {
|
||||
foreach ($hour as $key => $item) {
|
||||
$count++;
|
||||
|
||||
|
||||
// Can we add an item?
|
||||
if ($max_events == CALENDAR_SHOW_ALL || $cur_cnt <= $max_events) {
|
||||
$all_day = $item->calendar_start_date == $item->calendar_end_date;
|
||||
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
|
||||
|
||||
|
||||
// Parse out date part
|
||||
$start_ydate = date_format($item->date_start, DATE_FORMAT_DATE);
|
||||
$end_ydate = date_format($item->date_end, DATE_FORMAT_DATE);
|
||||
$cur_ydate = date_format($curday, DATE_FORMAT_DATE);
|
||||
|
||||
|
||||
$is_multi_day = ($start_ydate < $cur_ydate || $end_ydate > $cur_ydate);
|
||||
|
||||
|
||||
// Does this event span multi-days?
|
||||
if ($multiday_theme && ($is_multi_day || $all_day)) {
|
||||
|
||||
|
||||
// If this the first day of the week, or is the start date of the multi-day event,
|
||||
// then record this item, otherwise skip over
|
||||
$day_no = date_format($curday, 'd');
|
||||
if ($wday == 0 || $start_ydate == $cur_ydate || ($view->date_info->granularity == 'month' && $day_no == 1) || ($all_day && !$is_multi_day)) {
|
||||
$cur_cnt++;
|
||||
|
||||
|
||||
// Calculate the colspan for this event
|
||||
|
||||
|
||||
// If the last day of this event exceeds the end of the current month or week,
|
||||
// truncate the remaining days
|
||||
$diff = date_difference($view->date_info->max_date, $curday, 'days');
|
||||
$remaining_days = ($view->date_info->granularity == 'month') ? min(6 - $wday, $diff) : $diff - 1;
|
||||
$remaining_days = ($view->date_info->granularity == 'month') ? min(6 - $wday, $diff) : $diff - 1;
|
||||
// The bucket_cnt defines the colspan. colspan = bucket_cnt + 1
|
||||
$days = date_difference($curday, $item->date_end, 'days');
|
||||
$bucket_cnt = max(0, min($days, $remaining_days));
|
||||
|
||||
|
||||
// See if there is an avaiable slot to add an event. This will allow
|
||||
// an event to precede a row filled up by a previous day event
|
||||
$avail = FALSE;
|
||||
|
@ -480,11 +479,11 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add continuation attributes
|
||||
$item->continuation = ($item->date_start < $curday);
|
||||
$item->continues = ( $days > $bucket_cnt );
|
||||
|
||||
|
||||
// Assign the item to the available bucket
|
||||
$multiday_buckets[$wday][$bucket_index] = array(
|
||||
'colspan' => $bucket_cnt + 1,
|
||||
|
@ -496,13 +495,13 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
'wday' => $wday,
|
||||
'entry' => theme($theme, $item, $view)
|
||||
);
|
||||
|
||||
|
||||
// Block out empty buckets for the next days in this event for this week
|
||||
for ($i = 0; $i < $bucket_cnt; $i++) {
|
||||
$bucket = &$multiday_buckets[$i + $wday + 1];
|
||||
$bucket_row_count = count($bucket);
|
||||
$row_diff = $bucket_index - $bucket_row_count;
|
||||
|
||||
|
||||
// Fill up the preceding buckets - these are available for future
|
||||
// events
|
||||
for ( $j = 0; $j < $row_diff; $j++) {
|
||||
|
@ -545,7 +544,7 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add a more link if necessary
|
||||
if ($max_events != CALENDAR_SHOW_ALL && $total_cnt > 0 && $cur_cnt < $total_cnt) {
|
||||
$singleday_buckets[$wday][][] = array(
|
||||
|
@ -606,7 +605,7 @@ function calendar_build_day($curday, $view, $items) {
|
|||
}
|
||||
$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),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
// $Id: calendar-datebox.tpl.php,v 1.1.2.2 2010/12/31 14:16:12 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* @file
|
||||
* Template to display the date box in a calendar.
|
||||
*
|
||||
* - $view: The view.
|
||||
|
@ -16,4 +15,4 @@
|
|||
* - $items: An array of items for this day.
|
||||
*/
|
||||
?>
|
||||
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print !empty($selected) ? $link : $day; ?> </div>
|
||||
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print !empty($selected) ? $link : $day; ?> </div>
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// $Id: calendar-day-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view item as a calendar day node.
|
||||
*
|
||||
* $node
|
||||
*
|
||||
* $node
|
||||
* A node object for this calendar item. Note this is
|
||||
* not a complete node object, but it will have $node->nid
|
||||
* that you can use to load the full object, and
|
||||
* $node->type to tell the content type of the node.
|
||||
*
|
||||
*
|
||||
* $fields
|
||||
* An array of information for every field selected in the 'Fields'
|
||||
* section of this view, formatted as requested in the View setup.
|
||||
*
|
||||
*
|
||||
* Calendar info for this individual calendar item is in local time --
|
||||
* the user timezone where configurable timezones are allowed and set,
|
||||
* otherwise the site timezone. If this item has extends over more than
|
||||
|
@ -21,20 +20,20 @@
|
|||
* date and calendar_start will be no earlier than the start of
|
||||
* the current day and calendar_end will be no later than the end
|
||||
* of the current day.
|
||||
*
|
||||
*
|
||||
* $calendar_start - A formatted datetime start date for this item.
|
||||
* i.e. '2008-05-12 05:26:15'.
|
||||
* $calendar_end - A formatted datetime end date for this item,
|
||||
* the same as the start date except for fields that have from/to
|
||||
* fields defined, like Date module dates.
|
||||
* fields defined, like Date module dates.
|
||||
* $calendar_start_date - a PHP date object for the start time.
|
||||
* $calendar_end_date - a PHP date object for the end time.
|
||||
*
|
||||
*
|
||||
* You can use PHP date functions on the date object to display date
|
||||
* information in other ways, like:
|
||||
*
|
||||
*
|
||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_day_node.
|
||||
*/
|
||||
$node_class = (isset($node->class)) ? ' ' . $node->class : '';
|
||||
|
@ -48,11 +47,11 @@ $node_class = (isset($node->class)) ? ' ' . $node->class : '';
|
|||
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
||||
<?php if ($field['label']): ?>
|
||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php print $field['data']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-day-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar day, grouped by time with overlapping items
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_day.
|
||||
*
|
||||
* $rows: The rendered data for this day.
|
||||
|
@ -14,17 +13,17 @@
|
|||
* $rows['items'] - an array of timed items for the day.
|
||||
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
||||
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
||||
* $rows['items'][$time_period][$column]['values'] - An array of formatted
|
||||
* $rows['items'][$time_period][$column]['values'] - An array of formatted
|
||||
* items for a time period and field column.
|
||||
*
|
||||
*
|
||||
* $view: The view.
|
||||
* $columns: an array of column names.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
* The width of the columns is dynamically set using <col></col>
|
||||
*
|
||||
* The width of the columns is dynamically set using <col></col>
|
||||
* based on the number of columns presented. The values passed in will
|
||||
* work to set the 'hour' column to 10% and split the remaining columns
|
||||
* work to set the 'hour' column to 10% and split the remaining columns
|
||||
* evenly over the remaining 90% of the table.
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
|
@ -48,7 +47,7 @@
|
|||
<?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : ' ';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -60,8 +59,8 @@
|
|||
try {
|
||||
// Hide container while it renders... Degrade w/o javascript support
|
||||
$('#single-day-container').css('visibility','hidden');
|
||||
}catch(e){
|
||||
// swallow
|
||||
}catch(e){
|
||||
// swallow
|
||||
}
|
||||
</script>
|
||||
<table class="full">
|
||||
|
@ -74,7 +73,7 @@
|
|||
<td class="first">
|
||||
<?php $is_first = TRUE; ?>
|
||||
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
|
||||
<?php
|
||||
<?php
|
||||
if ($time_cnt == 0) {
|
||||
$class = 'first ';
|
||||
}
|
||||
|
@ -88,11 +87,11 @@
|
|||
<span class="calendar-hour"><?php print $hour['hour']; ?></span>
|
||||
<span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
<td class="last">
|
||||
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
|
||||
<?php
|
||||
<?php
|
||||
if ($time_cnt == 0) {
|
||||
$class = 'first ';
|
||||
}
|
||||
|
@ -115,7 +114,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -129,7 +128,7 @@ try {
|
|||
calendar_resizeViewport();
|
||||
calendar_scrollToFirst();
|
||||
$('#single-day-container').css('visibility','visible');
|
||||
}catch(e){
|
||||
// swallow
|
||||
}catch(e){
|
||||
// swallow
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
// $Id: calendar-day.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar day, grouped by time
|
||||
* and optionally organized into columns by a field value.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_day.
|
||||
*
|
||||
* $rows: The rendered data for this day.
|
||||
|
@ -15,17 +14,17 @@
|
|||
* $rows['items'] - an array of timed items for the day.
|
||||
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
||||
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
||||
* $rows['items'][$time_period][$column]['values'] - An array of formatted
|
||||
* $rows['items'][$time_period][$column]['values'] - An array of formatted
|
||||
* items for a time period and field column.
|
||||
*
|
||||
*
|
||||
* $view: The view.
|
||||
* $columns: an array of column names.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
* The width of the columns is dynamically set using <col></col>
|
||||
*
|
||||
* The width of the columns is dynamically set using <col></col>
|
||||
* based on the number of columns presented. The values passed in will
|
||||
* work to set the 'hour' column to 10% and split the remaining columns
|
||||
* work to set the 'hour' column to 10% and split the remaining columns
|
||||
* evenly over the remaining 90% of the table.
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
|
@ -57,7 +56,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php foreach ($rows['items'] as $hour): ?>
|
||||
<tr>
|
||||
|
@ -73,9 +72,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-main.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display calendar navigation and links.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_main.
|
||||
*
|
||||
* $view: The view.
|
||||
|
@ -13,7 +12,7 @@
|
|||
* $mini: Whether this is a mini view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
|
@ -23,4 +22,4 @@
|
|||
<?php if (!empty($calendar_add_date)) print $calendar_add_date; ?>
|
||||
<?php if (empty($block)) print theme('links', $calendar_links);?>
|
||||
<?php print theme('date_navigation', $view) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-mini.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a mini calendar month.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_mini.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
|
@ -11,17 +10,17 @@
|
|||
* $view: The view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
* $show_title: If the title should be displayed. Normally false since the title is incorporated
|
||||
* into the navigation, but sometimes needed, like in the year view of mini calendars.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
<div class="calendar-calendar"><div class="month-view">
|
||||
<?php if ($view->date_info->show_title): ?>
|
||||
<?php print theme('date_navigation', $view); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<table class="mini">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -44,4 +43,4 @@
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-month-col.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a column
|
||||
*
|
||||
*
|
||||
* - $item: The item to render within a td element.
|
||||
*/
|
||||
$id = (isset($item['id'])) ? 'id="' . $item['id'] . '" ' : '';
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
// $Id: calendar-month-multiple-node.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a summary of the days items as a calendar month node.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_month_multiple_node.
|
||||
*/
|
||||
?>
|
||||
|
@ -17,12 +16,12 @@
|
|||
<?php endforeach; ?>
|
||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
||||
<div class="multiple-events">
|
||||
<div class="multiple-events">
|
||||
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// $Id: calendar-month-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view item as a calendar month node.
|
||||
*
|
||||
* $node
|
||||
*
|
||||
* $node
|
||||
* A node object for this calendar item. Note this is
|
||||
* not a complete node object, but it will have $node->nid
|
||||
* that you can use to load the full object, and
|
||||
* $node->type to tell the content type of the node.
|
||||
*
|
||||
*
|
||||
* $fields
|
||||
* An array of information for every field selected in the 'Fields'
|
||||
* section of this view, formatted as requested in the View setup.
|
||||
*
|
||||
*
|
||||
* Calendar info for this individual calendar item is in local time --
|
||||
* the user timezone where configurable timezones are allowed and set,
|
||||
* otherwise the site timezone. If this item has extends over more than
|
||||
|
@ -21,20 +20,20 @@
|
|||
* date and calendar_start will be no earlier than the start of
|
||||
* the current day and calendar_end will be no later than the end
|
||||
* of the current day.
|
||||
*
|
||||
*
|
||||
* $calendar_start - A formatted datetime start date for this item.
|
||||
* i.e. '2008-05-12 05:26:15'.
|
||||
* $calendar_end - A formatted datetime end date for this item,
|
||||
* the same as the start date except for fields that have from/to
|
||||
* fields defined, like Date module dates.
|
||||
* fields defined, like Date module dates.
|
||||
* $calendar_start_date - a PHP date object for the start time.
|
||||
* $calendar_end_date - a PHP date object for the end time.
|
||||
*
|
||||
*
|
||||
* You can use PHP date functions on the date object to display date
|
||||
* information in other ways, like:
|
||||
*
|
||||
*
|
||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_month_node.
|
||||
*/
|
||||
$index = 0;
|
||||
|
@ -50,15 +49,15 @@ $index = 0;
|
|||
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
||||
<?php if ($field['label']): ?>
|
||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php print $field['data']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($node->continues) && $node->continues) : ?>
|
||||
<div class="continues">»</div>
|
||||
<?php else : ?>
|
||||
<div class="cutoff"> </div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-month-row.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a row
|
||||
*
|
||||
*
|
||||
* - $inner: The rendered string of the row's contents.
|
||||
*/
|
||||
$attrs = ($class) ? 'class="' . $class . '"': '';
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-month.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar month.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_month.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
|
@ -14,9 +13,9 @@
|
|||
* $block: Whether or not this calendar is in a block.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $date_id: a css id that is unique for this date,
|
||||
* $date_id: a css id that is unique for this date,
|
||||
* it is in the form: calendar-nid-field_name-delta
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
|
@ -32,7 +31,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
<?php
|
||||
foreach ((array) $rows as $row) {
|
||||
print $row['data'];
|
||||
} ?>
|
||||
|
@ -47,11 +46,11 @@ try {
|
|||
$('tr[iehint]').each(function(index) {
|
||||
var iehint = this.getAttribute('iehint');
|
||||
// Add height of the multi day rows to the single day row - seems that 80% height works best
|
||||
var height = this.clientHeight + (multiday_height * .8 * iehint);
|
||||
var height = this.clientHeight + (multiday_height * .8 * iehint);
|
||||
this.style.height = height + 'px';
|
||||
});
|
||||
}
|
||||
}catch(e){
|
||||
// swallow
|
||||
// swallow
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<?php
|
||||
// $Id: calendar-week-multiple-node.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a summary of the days items as a calendar week node.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week_multiple_node.
|
||||
*/
|
||||
*/
|
||||
?>
|
||||
<div class="view-item view-item-<?php print $view->name ?>">
|
||||
<div class="calendar weekview" id="<?php print $curday ?>">
|
||||
|
@ -16,12 +15,12 @@
|
|||
<?php endforeach; ?>
|
||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
||||
<div class="multiple-events">
|
||||
<div class="multiple-events">
|
||||
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// $Id: calendar-week-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view item as a calendar week node.
|
||||
*
|
||||
* $node
|
||||
*
|
||||
* $node
|
||||
* A node object for this calendar item. Note this is
|
||||
* not a complete node object, but it will have $node->nid
|
||||
* that you can use to load the full object, and
|
||||
* $node->type to tell the content type of the node.
|
||||
*
|
||||
*
|
||||
* $fields
|
||||
* An array of information for every field selected in the 'Fields'
|
||||
* section of this view, formatted as requested in the View setup.
|
||||
*
|
||||
*
|
||||
* Calendar info for this individual calendar item is in local time --
|
||||
* the user timezone where configurable timezones are allowed and set,
|
||||
* otherwise the site timezone. If this item has extends over more than
|
||||
|
@ -21,22 +20,22 @@
|
|||
* date and calendar_start will be no earlier than the start of
|
||||
* the current day and calendar_end will be no later than the end
|
||||
* of the current day.
|
||||
*
|
||||
*
|
||||
* $calendar_start - A formatted datetime start date for this item.
|
||||
* i.e. '2008-05-12 05:26:15'.
|
||||
* $calendar_end - A formatted datetime end date for this item,
|
||||
* the same as the start date except for fields that have from/to
|
||||
* fields defined, like Date module dates.
|
||||
* fields defined, like Date module dates.
|
||||
* $calendar_start_date - a PHP date object for the start time.
|
||||
* $calendar_end_date - a PHP date object for the end time.
|
||||
*
|
||||
*
|
||||
* You can use PHP date functions on the date object to display date
|
||||
* information in other ways, like:
|
||||
*
|
||||
*
|
||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week_node.
|
||||
*/
|
||||
*/
|
||||
$index = 0;
|
||||
?>
|
||||
<div class="view-item view-item-<?php print $view->name ?>">
|
||||
|
@ -50,9 +49,9 @@ $index = 0;
|
|||
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
||||
<?php if ($field['label']): ?>
|
||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php print $field['data']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if (isset($node->continues) && $node->continues) : ?>
|
||||
|
@ -60,5 +59,5 @@ $index = 0;
|
|||
<?php else : ?>
|
||||
<div class="cutoff"> </div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<?php
|
||||
// $Id: calendar-week-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar week with overlapping items
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
* $rows: The rendered data for this week.
|
||||
*
|
||||
*
|
||||
* For each day of the week, you have:
|
||||
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
||||
* $rows['datebox'] - the formatted datebox for this day.
|
||||
|
@ -18,11 +17,11 @@
|
|||
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
||||
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
||||
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
||||
*
|
||||
*
|
||||
* $view: The view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
//dsm($rows);
|
||||
|
@ -50,8 +49,8 @@
|
|||
<tbody>
|
||||
<tr class="holder"><td class="calendar-time-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td><td class="calendar-day-holder"></td></tr>
|
||||
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
|
||||
<?php
|
||||
$colpos = 0;
|
||||
<?php
|
||||
$colpos = 0;
|
||||
$rowclass = "all-day";
|
||||
if( $i == 0) {
|
||||
$rowclass .= " first";
|
||||
|
@ -79,7 +78,7 @@
|
|||
</td>
|
||||
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
<?php endfor; ?>
|
||||
<?php for($j = $colpos; $j < 7; $j++) : ?>
|
||||
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
|
||||
<?php endfor;?>
|
||||
|
@ -103,7 +102,7 @@
|
|||
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="header-body-divider"> </div>
|
||||
|
@ -112,8 +111,8 @@
|
|||
try {
|
||||
// Hide container while it renders... Degrade w/o javascript support
|
||||
$('#single-day-container').css('visibility','hidden');
|
||||
}catch(e){
|
||||
// swallow
|
||||
}catch(e){
|
||||
// swallow
|
||||
}
|
||||
</script>
|
||||
<table class="full">
|
||||
|
@ -129,7 +128,7 @@
|
|||
<td>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($start_times as $time_cnt => $start_time): ?>
|
||||
<?php
|
||||
<?php
|
||||
if ($time_cnt == 0) {
|
||||
$class = 'first ';
|
||||
}
|
||||
|
@ -182,7 +181,7 @@ try {
|
|||
|
||||
// Show it now that it is complete and positioned
|
||||
$('#single-day-container').css('visibility','visible');
|
||||
}catch(e){
|
||||
// swallow
|
||||
}catch(e){
|
||||
// swallow
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<?php
|
||||
// $Id: calendar-week.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar week.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
* $rows: The rendered data for this week.
|
||||
*
|
||||
*
|
||||
* For each day of the week, you have:
|
||||
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
||||
* $rows['datebox'] - the formatted datebox for this day.
|
||||
|
@ -18,11 +17,11 @@
|
|||
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
||||
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
||||
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
||||
*
|
||||
*
|
||||
* $view: The view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
//dsm($rows);
|
||||
|
@ -46,8 +45,8 @@ $index = 0;
|
|||
</thead>
|
||||
<tbody>
|
||||
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
|
||||
<?php
|
||||
$colpos = 0;
|
||||
<?php
|
||||
$colpos = 0;
|
||||
$rowclass = "all-day";
|
||||
if( $i == 0) {
|
||||
$rowclass .= " first";
|
||||
|
@ -75,12 +74,12 @@ $index = 0;
|
|||
</td>
|
||||
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
<?php endfor; ?>
|
||||
<?php for($j = $colpos; $j < 7; $j++) : ?>
|
||||
<td class="multi-day no-entry"><div class="inner"> </div></td>
|
||||
<?php endfor;?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
<?php endfor; ?>
|
||||
<?php foreach ($items as $time): ?>
|
||||
<tr class="not-all-day">
|
||||
<td class="calendar-agenda-hour">
|
||||
|
@ -96,7 +95,7 @@ $index = 0;
|
|||
<div class="inner"> </div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endfor; ?>
|
||||
<?php endfor; ?>
|
||||
<?php $curpos = $colpos + 1;?>
|
||||
<td class="calendar-agenda-items single-day">
|
||||
<div class="calendar">
|
||||
|
@ -109,16 +108,16 @@ $index = 0;
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php for ($i = $curpos; $i < 7; $i++): ?>
|
||||
<td class="calendar-agenda-items single-day">
|
||||
<div class="calendar">
|
||||
<div class="inner"> </div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endfor; ?>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
// $Id: calendar-year.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar year.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_year.
|
||||
*
|
||||
* $view: The view.
|
||||
* $months: An array with a formatted month calendar for each month of the year.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
|
@ -18,10 +17,10 @@
|
|||
<div class="calendar-calendar"><div class="year-view">
|
||||
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
|
||||
<tbody>
|
||||
<tr><td><?php print $months[1] ?></td><td><?php print $months[2] ?></td><td><?php print $months[3] ?></td></tr>
|
||||
<tr><td><?php print $months[4] ?></td><td><?php print $months[5] ?></td><td><?php print $months[6] ?></td></tr>
|
||||
<tr><td><?php print $months[7] ?></td><td><?php print $months[8] ?></td><td><?php print $months[9] ?></td></tr>
|
||||
<tr><td><?php print $months[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
|
||||
<tr><td><?php print $months[1] ?></td><td><?php print $months[2] ?></td><td><?php print $months[3] ?></td></tr>
|
||||
<tr><td><?php print $months[4] ?></td><td><?php print $months[5] ?></td><td><?php print $months[6] ?></td></tr>
|
||||
<tr><td><?php print $months[7] ?></td><td><?php print $months[8] ?></td><td><?php print $months[9] ?></td></tr>
|
||||
<tr><td><?php print $months[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
<?php
|
||||
// $Id: theme.inc,v 1.1.2.4 2011/01/03 12:28:48 karens Exp $
|
||||
/**
|
||||
* Display a calendar navigation and links
|
||||
*/
|
||||
function template_preprocess_calendar_main(&$vars) {
|
||||
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
|
||||
$view = $vars['view'];
|
||||
|
||||
|
||||
$result = (array) $view->result;
|
||||
$options = $view->style_plugin->options;
|
||||
$handler = $view->style_plugin;
|
||||
|
@ -15,12 +14,12 @@ function template_preprocess_calendar_main(&$vars) {
|
|||
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
|
||||
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
|
||||
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
|
||||
|
||||
|
||||
$url = $view->get_url();
|
||||
$view->date_info->url = $url;
|
||||
$arg = $view->date_info->date_arg;
|
||||
$displays = $view->date_info->display_types;
|
||||
|
||||
|
||||
// Set up the links to other calendar views.
|
||||
$current_date = $view->date_info->min_date;
|
||||
if (!empty($date->info->day)) {
|
||||
|
@ -28,7 +27,7 @@ function template_preprocess_calendar_main(&$vars) {
|
|||
}
|
||||
elseif (!empty($view->date_info->week)) {
|
||||
$week = date_week_range($view->date_info->week, $view->date_info->year);
|
||||
$current_date = $week[0];
|
||||
$current_date = $week[0];
|
||||
}
|
||||
elseif (!empty($view->date_info->month)) {
|
||||
$current_date = date_make_date($view->date_info->year .'-'. date_pad($view->date_info->month) .'-01 00:00:00');
|
||||
|
@ -68,60 +67,60 @@ function template_preprocess_calendar_main(&$vars) {
|
|||
$calendar_links[] = $base + array('title' => date_t('Day', 'datetime'), 'href' => date_real_url($view, 'day'));
|
||||
}
|
||||
$vars['calendar_links'] = $calendar_links;
|
||||
|
||||
|
||||
// If the Date Popup module is enabled, add a popup date selector.
|
||||
if (!empty($view->date_info->calendar_popup)) {
|
||||
$vars['calendar_popup'] = '<div class="clear-block">'. calendar_date_select($view) .'</div>';
|
||||
}
|
||||
|
||||
|
||||
// If an 'Add new ... link is provided, add it here.
|
||||
// the query will bring the user back here after adding the node.
|
||||
if (!empty($view->date_info->calendar_date_link) && user_access('create '. $view->date_info->calendar_date_link .' content')) {
|
||||
$name = node_get_types('name', $view->date_info->calendar_date_link);
|
||||
$href = 'node/add/'. str_replace('_', '-', $view->date_info->calendar_date_link);
|
||||
$query = 'destination='. $view->date_info->url;
|
||||
$query = 'destination='. $view->date_info->url;
|
||||
$vars['calendar_links'][] = $base + array(
|
||||
'title' => t('Add+'),
|
||||
'href' => $href,
|
||||
'title' => t('Add+'),
|
||||
'href' => $href,
|
||||
'query' => $query,
|
||||
);
|
||||
}
|
||||
|
||||
$vars['view'] = $view;
|
||||
|
||||
$vars['view'] = $view;
|
||||
$vars['mini'] = !empty($view->date_info->mini);
|
||||
$vars['block'] = !empty($view->date_info->block);
|
||||
$vars['block_identifier'] = date_block_identifier($view);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a view as a calendar.
|
||||
*
|
||||
*
|
||||
* This preprocessor does all the work needed for all types of calendar
|
||||
* views and the template takes care of displaying links to related views.
|
||||
*/
|
||||
function template_preprocess_calendar(&$vars) {
|
||||
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
|
||||
$view = $vars['view'];
|
||||
|
||||
|
||||
// Make sure we only run through this function one time.
|
||||
if (!empty($view->date_info->calendar_processed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$result = (array) $view->result;
|
||||
$options = $view->style_plugin->options;
|
||||
$handler = $view->style_plugin;
|
||||
|
||||
$fields = $view->field;
|
||||
|
||||
|
||||
// Render each field into an output array. We have to do the rendering
|
||||
// here because we don't apppear to have full access to the view
|
||||
// here because we don't apppear to have full access to the view
|
||||
// handlers in the theme functions.
|
||||
$items = array();
|
||||
$calendar_fields = date_api_fields($view->base_table);
|
||||
$calendar_fields = array_keys($calendar_fields['alias']);
|
||||
|
||||
|
||||
foreach ($result as $num => $row) {
|
||||
$copy = drupal_clone($row);
|
||||
$items[$num] = $row;
|
||||
|
@ -135,7 +134,7 @@ function template_preprocess_calendar(&$vars) {
|
|||
}
|
||||
foreach ($fields as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
if (!empty($field) && is_object($field)) {
|
||||
// Theme the copy instead of the original row so duplicate date
|
||||
// fields each get a fresh copy of the original data to theme.
|
||||
|
@ -144,20 +143,20 @@ function template_preprocess_calendar(&$vars) {
|
|||
}
|
||||
foreach ($fields as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
if (!empty($field->options['exclude'])) {
|
||||
if (isset($items[$num]->{$field_alias})) unset($items[$num]->{$field_alias});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$vars['display_type'] = $view->date_info->granularity;
|
||||
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
|
||||
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
|
||||
|
||||
|
||||
// Massage the resulting items into formatted calendar items.
|
||||
$items = calendar_build_nodes($view, $items);
|
||||
|
||||
|
||||
// Merge in items from other sources.
|
||||
foreach (module_implements('calendar_add_items') as $module) {
|
||||
$function = $module .'_calendar_add_items';
|
||||
|
@ -171,14 +170,14 @@ function template_preprocess_calendar(&$vars) {
|
|||
}
|
||||
|
||||
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
|
||||
|
||||
|
||||
// Create the calendar day names and rows.
|
||||
$rows = calendar_build_calendar($view, $items);
|
||||
|
||||
|
||||
$vars['items'] = $items;
|
||||
$vars['rows'] = $rows;
|
||||
$view->date_info->calendar_processed = TRUE;
|
||||
$vars['view'] = $view;
|
||||
$vars['view'] = $view;
|
||||
$vars['mini'] = !empty($view->date_info->mini);
|
||||
$vars['block'] = !empty($view->date_info->block);
|
||||
}
|
||||
|
@ -190,9 +189,9 @@ function template_preprocess_calendar_month(&$vars) {
|
|||
// Add in all the $vars added by the main calendar preprocessor.
|
||||
template_preprocess_calendar($vars);
|
||||
$view = $vars['view'];
|
||||
|
||||
|
||||
$rows = $vars['rows'];
|
||||
|
||||
|
||||
if (sizeof($rows) > 1) {
|
||||
$day_names = array_shift($rows);
|
||||
}
|
||||
|
@ -200,7 +199,7 @@ function template_preprocess_calendar_month(&$vars) {
|
|||
$day_names = $rows;
|
||||
$rows = array();
|
||||
}
|
||||
|
||||
|
||||
$month_rows = $rows;
|
||||
foreach ($rows as $weekno => $row) {
|
||||
// If this row is already rendered, don't do anything.
|
||||
|
@ -234,10 +233,10 @@ function template_preprocess_calendar_month(&$vars) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$vars['rows'] = $month_rows;
|
||||
$vars['day_names'] = $day_names;
|
||||
|
||||
|
||||
$vars['display_type'] = $view->date_info->granularity;
|
||||
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
|
||||
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
|
||||
|
@ -249,7 +248,7 @@ function template_preprocess_calendar_month(&$vars) {
|
|||
function template_preprocess_calendar_mini(&$vars) {
|
||||
// Add in all the $vars added by the main calendar preprocessor.
|
||||
template_preprocess_calendar_month($vars);
|
||||
|
||||
|
||||
$view = $vars['view'];
|
||||
$view->date_info->show_title = !empty($view->date_info->show_title) ? $view->date_info->show_title : FALSE;
|
||||
$vars['show_title'] = $view->date_info->show_title;
|
||||
|
@ -263,15 +262,15 @@ function template_preprocess_calendar_year(&$vars) {
|
|||
// Add in all the $vars added by the main calendar preprocessor.
|
||||
$vars['view']->date_info->style_with_weekno = FALSE;
|
||||
template_preprocess_calendar($vars);
|
||||
|
||||
|
||||
// Get the url of the year view and remove the year argument from it.
|
||||
// TODO clean this up in case there is another arg that looks like
|
||||
// the year to make sure only the year gets removed.
|
||||
$view = $vars['view'];
|
||||
$year = date_format($view->date_info->min_date, 'Y');
|
||||
|
||||
// Construct a calendar for each month, adjusting the $view passed
|
||||
// to the theme so it will produce the right results.
|
||||
|
||||
// Construct a calendar for each month, adjusting the $view passed
|
||||
// to the theme so it will produce the right results.
|
||||
$view = drupal_clone($vars['view']);
|
||||
$rows = $vars['rows'];
|
||||
$months = array();
|
||||
|
@ -291,7 +290,7 @@ function template_preprocess_calendar_year(&$vars) {
|
|||
$vars['months'] = $months;
|
||||
$vars['view']->date_info->hide_nav = FALSE;
|
||||
$vars['view']->date_info->granularity = 'year';
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -305,27 +304,27 @@ function template_preprocess_calendar_day_overlap(&$vars) {
|
|||
* Display a day view.
|
||||
*/
|
||||
function template_preprocess_calendar_day(&$vars) {
|
||||
|
||||
|
||||
// Add in all the $vars added by the main calendar preprocessor.
|
||||
$vars['view']->style_with_weekno = FALSE;
|
||||
template_preprocess_calendar($vars);
|
||||
|
||||
|
||||
$view = $vars['view'];
|
||||
$rows = $vars['rows'];
|
||||
|
||||
|
||||
$item_count = 0;
|
||||
$by_hour_count = 0;
|
||||
$grouping_field = $view->date_info->style_groupby_field;
|
||||
|
||||
|
||||
$display_overlap = $view->date_info->style_theme_style == '1';
|
||||
|
||||
|
||||
// Add optional css
|
||||
if ($display_overlap) {
|
||||
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
|
||||
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
|
||||
$overlapped_items = array();
|
||||
}
|
||||
|
||||
|
||||
// If we're not grouping by time, move all items into the 'all day' array.
|
||||
if (empty($view->date_info->style_groupby_times)) {
|
||||
// Items are already grouped into times, so we need to process each time-group.
|
||||
|
@ -336,14 +335,14 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
}
|
||||
$rows['items'] = array();
|
||||
}
|
||||
|
||||
|
||||
$columns = array();
|
||||
|
||||
|
||||
// Move all_day items into the right columns and render them.
|
||||
$grouped_items = array();
|
||||
foreach ($rows['all_day'] as $item) {
|
||||
if (isset($item->{$grouping_field})) {
|
||||
$column = $item->{$grouping_field};
|
||||
$column = $item->{$grouping_field};
|
||||
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
|
||||
if (!in_array($column, $columns)) {
|
||||
$columns[] = $column;
|
||||
|
@ -357,14 +356,14 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
$item_count++;
|
||||
}
|
||||
$vars['rows']['all_day'] = $grouped_items;
|
||||
|
||||
|
||||
// Moved timed items into the right columns and render them.
|
||||
$start_times = $view->date_info->style_groupby_times;
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$end_start_time = '23:59:59';
|
||||
$start_time = array_shift($start_times);
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
||||
|
||||
$grouped_items = array();
|
||||
foreach ($rows['items'] as &$items) {
|
||||
foreach ($items as &$item) {
|
||||
|
@ -383,7 +382,7 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
// slots if the option to show empty times was chosen.
|
||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||
if ((!empty($show_empty_times) || $display_overlap) && !array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
@ -392,14 +391,14 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
if ($display_overlap) {
|
||||
$time_end = date_format($item->date_end, 'H:i:s');
|
||||
$item->time_start = $time;
|
||||
$item->time_end = $time_end;
|
||||
$item->time_end = $time_end;
|
||||
_calc_indents($overlapped_items, $time, $time_end, $item);
|
||||
}
|
||||
$item_count++;
|
||||
$by_hour_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Finish out the day's time values if we want to see empty times.
|
||||
if (!empty($show_empty_times) || $display_overlap) {
|
||||
while ($start_time < $end_start_time && ($start_time != NULL || $display_overlap)) {
|
||||
|
@ -409,13 +408,13 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
$next_start_time = array_shift($start_times);
|
||||
}
|
||||
if (!array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Do the headers last, once we know what the actual values are.
|
||||
$i = 0;
|
||||
$start_times = array_keys($grouped_items);
|
||||
|
@ -423,38 +422,38 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
|
||||
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
|
||||
$grouped_items[$start_time]['hour'] = $heading['hour'];
|
||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||
foreach ($grouped_items[$start_time]['values'] as $column => &$items) {
|
||||
foreach ($items as $index => &$item) {
|
||||
if ($display_overlap) {
|
||||
$offset = round(date_format($item->date_start, 'i') / 15);
|
||||
$duration = date_convert('1970-01-01 ' . $item->time_end, DATE_DATETIME, DATE_UNIX) -
|
||||
$duration = date_convert('1970-01-01 ' . $item->time_end, DATE_DATETIME, DATE_UNIX) -
|
||||
date_convert('1970-01-01 ' . $item->time_start, DATE_DATETIME, DATE_UNIX);
|
||||
$duration = round($duration / (15 * 60));
|
||||
$item->class = 'd_'. $duration . ' o_'. $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
|
||||
}
|
||||
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
|
||||
$grouped_items[$start_time]['values'][$column][$index] = theme($theme, $item, $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
ksort($grouped_items);
|
||||
$vars['rows']['items'] = $grouped_items;
|
||||
|
||||
|
||||
if (empty($columns)) {
|
||||
$columns = array(t('Items'));
|
||||
}
|
||||
$vars['columns'] = $columns;
|
||||
|
||||
|
||||
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
|
||||
$first_column_width = 10;
|
||||
|
||||
|
||||
if (empty($view->date_info->style_groupby_times)) {
|
||||
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
|
||||
$first_column_width = 1;
|
||||
}
|
||||
|
||||
|
||||
$vars['first_column_width'] = $first_column_width;
|
||||
if (count($columns)) {
|
||||
$vars['column_width'] = round((100 - $first_column_width)/count($columns));
|
||||
|
@ -482,13 +481,13 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
// Add in all the $vars added by the main calendar preprocessor.
|
||||
$vars['view']->style_with_weekno = FALSE;
|
||||
template_preprocess_calendar($vars);
|
||||
|
||||
|
||||
$view = $vars['view'];
|
||||
$rows = $vars['rows'];
|
||||
$item_count = 0;
|
||||
$by_hour_count = 0;
|
||||
$start_time = NULL;
|
||||
|
||||
|
||||
if (sizeof($rows) > 1) {
|
||||
$day_names = array_shift($rows);
|
||||
}
|
||||
|
@ -496,27 +495,27 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
$day_names = $rows;
|
||||
$rows = array();
|
||||
}
|
||||
|
||||
|
||||
// Moved timed items into the right columns and render them.
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$end_start_time = '23:59:59';
|
||||
|
||||
|
||||
$grouped_items = array();
|
||||
|
||||
|
||||
// pass the multiday buckets
|
||||
$vars['all_day'] = $rows['multiday_buckets'];
|
||||
|
||||
// Remove the count for singleday
|
||||
$vars['multiday_rows'] = max(0, $rows['total_rows'] - 1);
|
||||
$vars['multiday_rows'] = max(0, $rows['total_rows'] - 1);
|
||||
$display_overlap = ($view->date_info->style_multiday_theme == '1' && $view->date_info->style_theme_style == '1');
|
||||
$vars['display_overlap'] = $display_overlap;
|
||||
|
||||
|
||||
// Add optional css
|
||||
if ($display_overlap) {
|
||||
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
|
||||
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
|
||||
$overlapped_items = array( array(), array(), array(), array(), array(), array(), array());
|
||||
|
||||
|
||||
// Locate the first item
|
||||
$first_time = '23:59:59';
|
||||
$first_time_index = -1;
|
||||
|
@ -528,13 +527,13 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
$first_time = $time;
|
||||
$first_time_index = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($first_time_index > -1) {
|
||||
$rows['singleday_buckets'][$first_time_index][$first_time][0]['is_first'] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If we're not grouping by time, move all items into the 'all day' array.
|
||||
if (empty($view->date_info->style_groupby_times)) {
|
||||
$add_row = FALSE;
|
||||
|
@ -547,9 +546,9 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
}
|
||||
}
|
||||
if ( $add_row ) {
|
||||
$vars['multiday_rows']++;
|
||||
$vars['multiday_rows']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($rows['singleday_buckets'] as $wday => $singleday_row) {
|
||||
$columns[] = $wday;
|
||||
|
@ -564,23 +563,23 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
if ($vars['multiday_rows'] == 0) {
|
||||
$vars['multiday_rows']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Find the next time slot and fill it. Populate the skipped
|
||||
// slots if the option to show empty times was chosen.
|
||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||
if (($show_empty_times || $display_overlap) && !array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'][$wday] = array();
|
||||
$grouped_items[$start_time]['values'][$wday] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
}
|
||||
$grouped_items[$start_time]['values'][$wday][] = &$item;
|
||||
$grouped_items[$start_time]['values'][$wday][] = &$item;
|
||||
if ($display_overlap) {
|
||||
$date_end = date_format($item['item']->date_end, 'H:i:s');
|
||||
_calc_indents($overlapped_items[$wday], $time, $date_end, $item);
|
||||
}
|
||||
$item_count++;
|
||||
$item_count++;
|
||||
$by_hour_count++;
|
||||
}
|
||||
}
|
||||
|
@ -594,7 +593,7 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
$next_start_time = array_shift($start_times);
|
||||
}
|
||||
if (!array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'][$wday] = array();
|
||||
$grouped_items[$start_time]['values'][$wday] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
@ -603,7 +602,7 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
ksort($grouped_items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Do the headers last, once we know what the actual values are.
|
||||
$i = 0;
|
||||
$start_times = array_keys($grouped_items);
|
||||
|
@ -622,21 +621,21 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
$duration = round($duration / (15 * 60));
|
||||
$item['class'] = 'd_'. $duration . ' o_'. $offset . ' i_' . $item['indent'] . ' md_' . min($item['max_depth'], 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$vars['items'] = $grouped_items;
|
||||
|
||||
$vars['items'] = $grouped_items;
|
||||
|
||||
$vars['day_names'] = $day_names;
|
||||
$vars['columns'] = $columns;
|
||||
$vars['start_times'] = $view->date_info->style_groupby_times;
|
||||
$vars['first_time'] = $first_time;
|
||||
|
||||
|
||||
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
|
||||
$first_column_width = 10;
|
||||
|
||||
|
||||
if (empty($view->date_info->style_groupby_times)) {
|
||||
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
|
||||
$first_column_width = 1;
|
||||
|
@ -652,14 +651,14 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
function template_preprocess_calendar_datebox(&$vars) {
|
||||
$date = $vars['date'];
|
||||
$view = $vars['view'];
|
||||
|
||||
|
||||
$vars['day'] = intval(substr($date, 8, 2));
|
||||
$force_view_url = !empty($view->date_info->block) ? TRUE : FALSE;
|
||||
$vars['url'] = date_real_url($view, NULL, $date, $force_view_url);
|
||||
$vars['link'] = l($vars['day'], $vars['url']);
|
||||
$vars['granularity'] = $view->date_info->granularity;
|
||||
$vars['mini'] = $view->date_info->mini;
|
||||
|
||||
|
||||
if ($view->date_info->mini) {
|
||||
if (!empty($vars['selected'])) {
|
||||
$vars['class'] = 'mini-day-on';
|
||||
|
@ -682,11 +681,11 @@ function template_preprocess_calendar_node(&$vars) {
|
|||
$fields = array();
|
||||
foreach ($view->field as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
if (!empty($node->$field_alias)) {
|
||||
$data = $node->$field_alias;
|
||||
$label = $field->options['label'];
|
||||
|
||||
|
||||
// CCK has some special label options.
|
||||
if (!empty($field->content_field)) {
|
||||
switch ($field->options['label_type']) {
|
||||
|
@ -710,10 +709,10 @@ function template_preprocess_calendar_node(&$vars) {
|
|||
$vars['calendar_end'] = $node->calendar_end;
|
||||
$vars['calendar_start_date'] = $node->calendar_start_date;
|
||||
$vars['calendar_end_date'] = $node->calendar_end_date;
|
||||
|
||||
|
||||
// We added the node type to the results in the query,
|
||||
// but it will show up as $node->node_type instead of
|
||||
// $node->type. Rename it to match the normal way it
|
||||
// $node->type. Rename it to match the normal way it
|
||||
// would show up on a node object.
|
||||
$vars['node']->type = $vars['node']->node_type;
|
||||
}
|
||||
|
@ -737,7 +736,7 @@ function template_preprocess_calendar_month_multiple_node(&$vars) {
|
|||
$year = $parts[0];
|
||||
$month = intval($parts[1]);
|
||||
$day = intval($parts[2]);
|
||||
|
||||
|
||||
// create the link to the day
|
||||
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($day));
|
||||
}
|
||||
|
@ -767,13 +766,13 @@ function template_preprocess_calendar_week_node(&$vars) {
|
|||
function template_preprocess_calendar_week_multiple_node(&$vars) {
|
||||
$view = $vars['view'];
|
||||
$curday = $vars['curday'];
|
||||
|
||||
|
||||
// get the year month and date
|
||||
$parts = explode('-', substr($curday, 0, 10));
|
||||
$year = $parts[0];
|
||||
$month = intval($parts[1]);
|
||||
$day = intval($parts[2]);
|
||||
|
||||
|
||||
// create the link to the day
|
||||
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($day));
|
||||
}
|
||||
|
@ -820,7 +819,7 @@ function theme_calendar_stripe_legend() {
|
|||
array('class' => 'calendar-legend', 'data' => t('Key'))
|
||||
);
|
||||
$rows = array();
|
||||
$output = '';
|
||||
$output = '';
|
||||
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
|
||||
if ($stripe) {
|
||||
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'"> </div>');
|
||||
|
@ -858,7 +857,7 @@ function theme_calendar_stripe_stripe($node) {
|
|||
* The day to display.
|
||||
*/
|
||||
function theme_calendar_empty_day($curday, $view) {
|
||||
|
||||
|
||||
if ($view->date_info->calendar_type != 'day') {
|
||||
return '<div class="calendar-empty"> </div>'."\n";
|
||||
}
|
||||
|
@ -885,18 +884,18 @@ function theme_calendar_empty_day($curday, $view) {
|
|||
* Returns an array with the max depth of the branch and whether an overlap occurred
|
||||
*/
|
||||
function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
|
||||
|
||||
|
||||
// Are there any items at this depth?
|
||||
if (!empty($overlapped_items)) {
|
||||
|
||||
|
||||
// Iterate for each item as this depth and see if we overlap
|
||||
foreach ($overlapped_items as $index => &$entry) {
|
||||
foreach ($overlapped_items as $index => &$entry) {
|
||||
|
||||
// We search depth-first, so if there are children for this item, recurse into
|
||||
// each child tree looking for an overlap
|
||||
if (!empty($entry['children'])) {
|
||||
$rc = _calc_indents($entry['children'], $start, $end, $item, $depth + 1);
|
||||
|
||||
|
||||
// Was there an overlap in the child tree?
|
||||
if ($rc['overlap']) {
|
||||
if (is_object($entry['item'])) {
|
||||
|
@ -907,16 +906,16 @@ function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
|
|||
$entry['item']['indent'] = _calc_indent($entry['depth'], $rc['max_depth']);
|
||||
$entry['item']['max_depth'] = $rc['max_depth'];
|
||||
}
|
||||
|
||||
|
||||
// There was an overlap, pop out of this depth
|
||||
return $rc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// No, child overlap, so check if we overlap this item
|
||||
# if ($start >= $entry['start'] && $start <= $entry['end']) {
|
||||
if ($start >= $entry['start'] && $start < $entry['end']) {
|
||||
|
||||
|
||||
// We overlap, create an overlapping entry
|
||||
$entry['children'][] = array('item' => &$item, 'depth' => $depth + 1, 'start' => $start, 'end' => $end, 'children' => array());
|
||||
if (is_object($entry['item'])) {
|
||||
|
@ -937,19 +936,19 @@ function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
|
|||
$item['indent'] = _calc_indent($depth + 1, $max_depth);
|
||||
$item['max_depth'] = $max_depth;
|
||||
}
|
||||
|
||||
|
||||
// We overlap, so pop out of this depth
|
||||
return array('overlap' => TRUE, 'max_depth' => $max_depth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If there are items at this depth, but no overlap, then return no overlap and pop
|
||||
// out of this depth
|
||||
if ($depth > 0) {
|
||||
return array('overlap' => FALSE, 'max_depth' => 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// No overlap at any depth, reset the array of overlaps
|
||||
if ($depth == 0) {
|
||||
reset($overlapped_items);
|
||||
|
@ -958,7 +957,7 @@ function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
|
|||
else {
|
||||
$overlapped_items[] = array('item' => &$item, 'depth' => $depth, 'start' => $start, 'end' => $end, 'children' => array());
|
||||
}
|
||||
|
||||
|
||||
if (is_object($item)) {
|
||||
$item->indent = _calc_indent($depth, $depth);
|
||||
$item->max_depth = $depth;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
; $Id: calendar.help.ini,v 1.1.2.4 2008/10/28 11:46:19 karens Exp $
|
||||
|
||||
[advanced help settings]
|
||||
name = Calendar
|
||||
index name = "Calendar"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
//$Id: calendar.inc,v 1.1.2.46 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* Build calendar
|
||||
*
|
||||
|
@ -23,10 +22,10 @@ function calendar_build_calendar($view, $items) {
|
|||
}
|
||||
$items = $values;
|
||||
ksort($items);
|
||||
|
||||
|
||||
$rows = array();
|
||||
$curday = drupal_clone($view->date_info->min_date);
|
||||
|
||||
|
||||
switch ($view->date_info->granularity) {
|
||||
case 'year':
|
||||
$rows = array();
|
||||
|
@ -53,7 +52,7 @@ function calendar_build_calendar($view, $items) {
|
|||
break;
|
||||
}
|
||||
return $rows;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,7 +89,7 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
|||
$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'))) {
|
||||
|
@ -98,27 +97,27 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
|||
if (!empty($view->date_info->display_types['week'])) {
|
||||
$weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// Do not link week numbers, if Week views are disabled.
|
||||
$weekno = $week;
|
||||
}
|
||||
$rows[$week][] = array(
|
||||
'data' => $weekno,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'id' => $view->name . '-weekno-' . $curday_date,
|
||||
'class' => 'week');
|
||||
}
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||
$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),
|
||||
'date' => '',
|
||||
'datebox' => '',
|
||||
'empty' => theme('calendar_empty_day', $curday_date, $view),
|
||||
'link' => '',
|
||||
'all_day' => array(),
|
||||
'all_day' => array(),
|
||||
'items' => array(),
|
||||
);
|
||||
}
|
||||
|
@ -129,7 +128,7 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
|||
($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);
|
||||
|
@ -189,10 +188,10 @@ function calendar_build_day($curday, $view, $items) {
|
|||
}
|
||||
$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),
|
||||
'date' => $curday_date,
|
||||
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
|
||||
'empty' => $empty,
|
||||
'link' => $link,
|
||||
'all_day' => $all_day,
|
||||
|
@ -200,4 +199,3 @@ function calendar_build_day($curday, $view, $items) {
|
|||
);
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?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) {
|
||||
|
@ -10,24 +9,24 @@ function calendar_views_query_alter(&$view, &$query) {
|
|||
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);
|
||||
$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;
|
||||
break;
|
||||
case 'month':
|
||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
|
||||
break;
|
||||
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;
|
||||
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;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
drupal_goto(str_replace($_POST['calendar_previous_arg'], $arg, $_POST['view_url']));
|
||||
exit();
|
||||
|
@ -40,34 +39,34 @@ 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
|
||||
* 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
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* desired style in the block view.
|
||||
*/
|
||||
/**
|
||||
* Implementation of hook_views_plugins
|
||||
|
@ -78,7 +77,7 @@ function calendar_views_plugins() {
|
|||
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";
|
||||
|
||||
|
@ -135,7 +134,7 @@ function calendar_views_plugins() {
|
|||
'admin' => t('Calendar page'),
|
||||
'help topic' => 'getting-started',
|
||||
'js' => array(
|
||||
'misc/farbtastic/farbtastic.js',
|
||||
'misc/farbtastic/farbtastic.js',
|
||||
drupal_get_path('module', 'calendar') .'/js/calendar_colorpicker.js',
|
||||
),
|
||||
),
|
||||
|
@ -222,13 +221,13 @@ function calendar_views_plugins() {
|
|||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$data['style']['calendar_style']['additional themes'] += array(
|
||||
'calendar_day_overlap' => 'style',
|
||||
'calendar_week_overlap' => 'style',
|
||||
'calendar_week_overlap' => 'style',
|
||||
);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
<?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.
|
||||
*
|
||||
* 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',
|
||||
|
@ -20,19 +19,19 @@
|
|||
* );
|
||||
* $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
|
||||
|
||||
// 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;
|
||||
|
@ -41,31 +40,31 @@ function calendar_views_default_views() {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Construct a default calendar to match specified options.
|
||||
* Views calls it without options, so the basic
|
||||
* Views calls it without options, so the basic
|
||||
* default view will use the default values.
|
||||
*
|
||||
* @param $options: an optional array of options to
|
||||
*
|
||||
* @param $options: an optional array of options to
|
||||
* create default calendars.
|
||||
*
|
||||
*
|
||||
* Possible options include:
|
||||
* @param string $name:
|
||||
* @param string $name:
|
||||
* The view name, if empty, defaults to 'calendar'.
|
||||
* @param string $description:
|
||||
* @param string $description:
|
||||
* The view description, if empty, defaults to generic description.
|
||||
* @param string $path:
|
||||
* @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.
|
||||
* @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:
|
||||
* @param array $date_fields:
|
||||
* Date fields used to filter the calendar.
|
||||
* If empty, defaults to array('changed') for node.changed.
|
||||
* @param array $display_fields:
|
||||
* @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) {
|
||||
|
@ -76,7 +75,7 @@ $path = NULL;
|
|||
$types = NULL;
|
||||
$date_fields = NULL;
|
||||
$display_fields = NULL;
|
||||
|
||||
|
||||
if (empty($options)) {
|
||||
$disabled = TRUE;
|
||||
}
|
||||
|
@ -126,7 +125,7 @@ foreach ($date_fields as $key => $field_name) {
|
|||
$cck_field = FALSE;
|
||||
}
|
||||
$fields[$alias] = $alias;
|
||||
|
||||
|
||||
// Add a sort for each date field:
|
||||
$sort_fields[$field_name] = array(
|
||||
'order' => 'ASC',
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
<?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
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* 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 {
|
||||
|
@ -27,7 +26,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
}
|
||||
return $this->view->style_plugin->render($this->view->result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an array of possible display periods.
|
||||
*/
|
||||
|
@ -43,9 +42,9 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
$types = calendar_display_types();
|
||||
$default = $this->get_option('calendar_type');
|
||||
if (!array_key_exists($default, $types)) $default = 'month';
|
||||
return $default;
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Inspect argument and view information to see which calendar
|
||||
|
@ -54,7 +53,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
* if there are values.
|
||||
*/
|
||||
function display_granularity($display_id) {
|
||||
|
||||
|
||||
$arguments = $this->view->get_items('argument', $display_id);
|
||||
$wildcard = '';
|
||||
$argument = '';
|
||||
|
@ -84,19 +83,19 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
}
|
||||
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.");
|
||||
$errors[] = t("A Calendar period display will not work without a Date argument.");
|
||||
}
|
||||
$this->view->date_info->arg_missing = TRUE;
|
||||
$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)) {
|
||||
|
@ -107,21 +106,21 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
|
||||
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,
|
||||
|
||||
// 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.
|
||||
|
@ -139,7 +138,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
$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);
|
||||
}
|
||||
|
||||
|
@ -149,17 +148,17 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
$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
|
||||
// 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();
|
||||
if (empty($this->additional_fields)) $this->additional_fields = array();
|
||||
$this->view->query->add_field('node', 'vid');
|
||||
}
|
||||
parent::query();
|
||||
parent::query();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Override some of the parent options.
|
||||
*/
|
||||
|
@ -168,7 +167,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
$display['inherit_argments'] = TRUE;
|
||||
$display['inherit_filters'] = TRUE;
|
||||
$display['attachment_position'] = 'after';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add custom option definitions.
|
||||
|
@ -178,11 +177,11 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
$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');
|
||||
|
@ -210,7 +209,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Provide the summary for attachment options in the views UI.
|
||||
*
|
||||
|
@ -222,7 +221,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
|||
$categories['calendar_settings'] = array(
|
||||
'title' => t('Calendar settings'),
|
||||
);
|
||||
|
||||
|
||||
$options['calendar_type'] = array(
|
||||
'category' => 'calendar_settings',
|
||||
'title' => t('Calendar period'),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?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
|
||||
|
@ -13,31 +12,31 @@ 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']));
|
||||
$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');
|
||||
$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;
|
||||
|
@ -58,11 +57,11 @@ class calendar_plugin_display_block extends views_plugin_display_block {
|
|||
$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.
|
||||
*/
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
<?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();
|
||||
|
@ -23,11 +22,11 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
*/
|
||||
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']));
|
||||
$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;
|
||||
}
|
||||
|
@ -37,12 +36,12 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
}
|
||||
$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;
|
||||
|
@ -63,11 +62,11 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
$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());
|
||||
|
@ -91,7 +90,7 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
$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(
|
||||
|
@ -132,15 +131,15 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
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');
|
||||
|
@ -149,9 +148,9 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
'#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(
|
||||
|
@ -159,7 +158,7 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
'#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':
|
||||
|
@ -173,7 +172,7 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
'#prefix' => '<div class="clear-block"><div style="float:left">',
|
||||
'#suffix' => '</div>',
|
||||
);
|
||||
$colors = $this->get_option('calendar_colors');
|
||||
$colors = $this->get_option('calendar_colors');
|
||||
|
||||
switch ($method) {
|
||||
case 'types':
|
||||
|
@ -293,6 +292,6 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
|||
variable_set('calendar_date_link_'. $form_state['values']['calendar_date_link'], $this->display->handler->get_option('path'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<?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.
|
||||
* view and a display.
|
||||
*/
|
||||
function init(&$view, &$display, $options = NULL) {
|
||||
parent::init($view, $display, $options);
|
||||
|
@ -17,7 +16,7 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
}
|
||||
$view->date_info->display_types = $this->display_types();
|
||||
}
|
||||
|
||||
|
||||
function display_types($granularity = NULL, $option_type = 'names') {
|
||||
$ids = array();
|
||||
$names = array();
|
||||
|
@ -39,7 +38,7 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
}
|
||||
return $$option_type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calendar argument date fields used in this view.
|
||||
*/
|
||||
|
@ -61,7 +60,7 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
}
|
||||
return ($date_fields);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Style validation.
|
||||
*/
|
||||
|
@ -71,11 +70,11 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
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));
|
||||
$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();
|
||||
|
@ -86,13 +85,13 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
$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');
|
||||
$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'
|
||||
|
||||
// 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);
|
||||
|
@ -123,14 +122,14 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
}
|
||||
|
||||
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
|
||||
|
||||
// Evaluate our argument values and figure out which
|
||||
// calendar display we need to create.
|
||||
$i = 0;
|
||||
$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.
|
||||
|
@ -154,7 +153,7 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
$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;
|
||||
}
|
||||
|
@ -163,15 +162,15 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
$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.
|
||||
*/
|
||||
|
@ -179,4 +178,3 @@ class calendar_plugin_style extends views_plugin_style {
|
|||
return theme($this->theme_functions(), $this->view, $this->options, array());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?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.
|
||||
*/
|
||||
|
@ -8,7 +6,7 @@ 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.
|
||||
* view and a display.
|
||||
*/
|
||||
function init(&$view, &$display, $options = NULL) {
|
||||
parent::init($view, $display, $options);
|
||||
|
@ -26,15 +24,15 @@ class calendar_view_plugin_style extends calendar_plugin_style {
|
|||
$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
|
||||
*/
|
||||
|
@ -62,7 +60,7 @@ class calendar_view_plugin_style extends calendar_plugin_style {
|
|||
'#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'],
|
||||
|
@ -98,7 +96,7 @@ class calendar_view_plugin_style extends calendar_plugin_style {
|
|||
'#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.
|
||||
// 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');
|
||||
|
@ -119,8 +117,8 @@ class calendar_view_plugin_style extends calendar_plugin_style {
|
|||
'#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')) {
|
||||
|
||||
if (module_exists('calendar_multiday')) {
|
||||
$form['multiday_theme'] = array(
|
||||
'#title' => t('Multi-day style'),
|
||||
'#default_value' => $this->options['multiday_theme'],
|
||||
|
@ -135,8 +133,8 @@ class calendar_view_plugin_style extends calendar_plugin_style {
|
|||
'#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'];
|
||||
|
@ -170,4 +168,4 @@ class calendar_view_plugin_style extends calendar_plugin_style {
|
|||
$this->view->date_info->hide_admin_links = TRUE;
|
||||
return theme($this->theme_functions(), $this->view, $this->options, array());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: jcalendar.info,v 1.1.4.2 2008/06/23 14:55:01 karens Exp $
|
||||
name = Calendar Popup
|
||||
description = "Replaces the links to calendar items with a javascript popup that gracefully regresses if javascript is not enabled"
|
||||
dependencies[] = calendar
|
||||
|
@ -11,4 +10,3 @@ version = "6.x-2.4"
|
|||
core = "6.x"
|
||||
project = "calendar"
|
||||
datestamp = "1294072550"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: jcalendar.module,v 1.1.4.17 2010/11/21 12:24:45 karens Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* jQuery Calendar UI features.
|
||||
|
@ -87,11 +85,11 @@ function jcalendar_theme() {
|
|||
|
||||
/**
|
||||
* Overrideable theme for the jcalendar popup view.
|
||||
*
|
||||
*
|
||||
* Defaults to show the standard teaser view of the node.
|
||||
*/
|
||||
function theme_jcalendar_view($node) {
|
||||
$output = node_view($node, TRUE);
|
||||
$output .= '<div id="nodelink">'. l(t('more', array(), $node->language), calendar_get_node_link($node)) .'</div>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// $Id: calendar_colorpicker.js,v 1.1.4.3 2008/11/21 22:04:56 karens Exp $
|
||||
/**
|
||||
* Implementation of hook_elements.
|
||||
*
|
||||
*
|
||||
* Much of the colorpicker code was adapted from the Colorpicker module.
|
||||
* That module has no stable release yet nor any D6 branch.
|
||||
*/
|
||||
|
@ -9,16 +8,16 @@
|
|||
* Bind the colorpicker event to the form element
|
||||
*/
|
||||
Drupal.behaviors.calendarColorpicker = function (context) {
|
||||
|
||||
|
||||
// do we have multiple calendar_colors?
|
||||
if ($("div.calendar_colorpicker").size() > 0) {
|
||||
|
||||
|
||||
// loop over each calendar_color type
|
||||
$("div.calendar_colorpicker").each(function() {
|
||||
|
||||
// create the farbtastic colorpicker
|
||||
var farb = $.farbtastic(this);
|
||||
|
||||
|
||||
// get the id of the current matched colorpicker wrapper div
|
||||
var id = $(this).attr("id");
|
||||
|
||||
|
@ -26,7 +25,7 @@ Drupal.behaviors.calendarColorpicker = function (context) {
|
|||
$("input.calendar_colorfield").filter("." + id).each(function () {
|
||||
// set the background colors of all of the textfields appropriately
|
||||
farb.linkTo(this);
|
||||
|
||||
|
||||
// when clicked, they get linked to the farbtastic colorpicker that they are associated with
|
||||
$(this).click(function () {
|
||||
farb.linkTo(this);
|
||||
|
@ -37,4 +36,3 @@ Drupal.behaviors.calendarColorpicker = function (context) {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
// $Id: calendar-datebox.tpl.php,v 1.2.2.3 2010/11/21 14:15:32 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* @file
|
||||
* Template to display the date box in a calendar.
|
||||
*
|
||||
* - $view: The view.
|
||||
|
@ -16,4 +15,4 @@
|
|||
* - $items: An array of items for this day.
|
||||
*/
|
||||
?>
|
||||
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print $selected ? $link : $day; ?> </div>
|
||||
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print $selected ? $link : $day; ?> </div>
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// $Id: calendar-day-node.tpl.php,v 1.2.2.4 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view item as a calendar day node.
|
||||
*
|
||||
* $node
|
||||
*
|
||||
* $node
|
||||
* A node object for this calendar item. Note this is
|
||||
* not a complete node object, but it will have $node->nid
|
||||
* that you can use to load the full object, and
|
||||
* $node->type to tell the content type of the node.
|
||||
*
|
||||
*
|
||||
* $fields
|
||||
* An array of information for every field selected in the 'Fields'
|
||||
* section of this view, formatted as requested in the View setup.
|
||||
*
|
||||
*
|
||||
* Calendar info for this individual calendar item is in local time --
|
||||
* the user timezone where configurable timezones are allowed and set,
|
||||
* otherwise the site timezone. If this item has extends over more than
|
||||
|
@ -21,20 +20,20 @@
|
|||
* date and calendar_start will be no earlier than the start of
|
||||
* the current day and calendar_end will be no later than the end
|
||||
* of the current day.
|
||||
*
|
||||
*
|
||||
* $calendar_start - A formatted datetime start date for this item.
|
||||
* i.e. '2008-05-12 05:26:15'.
|
||||
* $calendar_end - A formatted datetime end date for this item,
|
||||
* the same as the start date except for fields that have from/to
|
||||
* fields defined, like Date module dates.
|
||||
* fields defined, like Date module dates.
|
||||
* $calendar_start_date - a PHP date object for the start time.
|
||||
* $calendar_end_date - a PHP date object for the end time.
|
||||
*
|
||||
*
|
||||
* You can use PHP date functions on the date object to display date
|
||||
* information in other ways, like:
|
||||
*
|
||||
*
|
||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_day_node.
|
||||
*/
|
||||
?>
|
||||
|
@ -45,9 +44,9 @@
|
|||
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
||||
<?php if ($field['label']): ?>
|
||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php print $field['data']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
// $Id: calendar-day.tpl.php,v 1.7.2.10 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar day, grouped by time
|
||||
* and optionally organized into columns by a field value.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_day.
|
||||
*
|
||||
* $rows: The rendered data for this day.
|
||||
|
@ -15,17 +14,17 @@
|
|||
* $rows['items'] - an array of timed items for the day.
|
||||
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
||||
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
||||
* $rows['items'][$time_period][$column]['values'] - An array of formatted
|
||||
* $rows['items'][$time_period][$column]['values'] - An array of formatted
|
||||
* items for a time period and field column.
|
||||
*
|
||||
*
|
||||
* $view: The view.
|
||||
* $columns: an array of column names.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
* The width of the columns is dynamically set using <col></col>
|
||||
*
|
||||
* The width of the columns is dynamically set using <col></col>
|
||||
* based on the number of columns presented. The values passed in will
|
||||
* work to set the 'hour' column to 10% and split the remaining columns
|
||||
* work to set the 'hour' column to 10% and split the remaining columns
|
||||
* evenly over the remaining 90% of the table.
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
|
@ -57,7 +56,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php foreach ($rows['items'] as $hour): ?>
|
||||
<tr>
|
||||
|
@ -73,9 +72,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-main.tpl.php,v 1.2.2.4 2009/01/10 20:04:18 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display calendar navigation and links.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_main.
|
||||
*
|
||||
* $view: The view.
|
||||
|
@ -13,7 +12,7 @@
|
|||
* $mini: Whether this is a mini view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
|
@ -23,4 +22,4 @@
|
|||
<?php if (!empty($calendar_add_date)) print $calendar_add_date; ?>
|
||||
<?php if (empty($block)) print theme('links', $calendar_links);?>
|
||||
<?php print theme('date_navigation', $view) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-mini.tpl.php,v 1.1.2.7 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a mini calendar month.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_mini.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
|
@ -11,17 +10,17 @@
|
|||
* $view: The view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
* $show_title: If the title should be displayed. Normally false since the title is incorporated
|
||||
* into the navigation, but sometimes needed, like in the year view of mini calendars.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
<div class="calendar-calendar"><div class="month-view">
|
||||
<?php if ($view->date_info->show_title): ?>
|
||||
<?php print theme('date_navigation', $view); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<table class="mini">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -44,4 +43,4 @@
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
// $Id: calendar-month-multiple-node.tpl.php,v 1.1.2.6 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a summary of the days items as a calendar month node.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_month_multiple_node.
|
||||
*/
|
||||
?>
|
||||
|
@ -17,12 +16,12 @@
|
|||
<?php endforeach; ?>
|
||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
||||
<div class="multiple-events">
|
||||
<div class="multiple-events">
|
||||
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// $Id: calendar-month-node.tpl.php,v 1.2.2.6 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view item as a calendar month node.
|
||||
*
|
||||
* $node
|
||||
*
|
||||
* $node
|
||||
* A node object for this calendar item. Note this is
|
||||
* not a complete node object, but it will have $node->nid
|
||||
* that you can use to load the full object, and
|
||||
* $node->type to tell the content type of the node.
|
||||
*
|
||||
*
|
||||
* $fields
|
||||
* An array of information for every field selected in the 'Fields'
|
||||
* section of this view, formatted as requested in the View setup.
|
||||
*
|
||||
*
|
||||
* Calendar info for this individual calendar item is in local time --
|
||||
* the user timezone where configurable timezones are allowed and set,
|
||||
* otherwise the site timezone. If this item has extends over more than
|
||||
|
@ -21,20 +20,20 @@
|
|||
* date and calendar_start will be no earlier than the start of
|
||||
* the current day and calendar_end will be no later than the end
|
||||
* of the current day.
|
||||
*
|
||||
*
|
||||
* $calendar_start - A formatted datetime start date for this item.
|
||||
* i.e. '2008-05-12 05:26:15'.
|
||||
* $calendar_end - A formatted datetime end date for this item,
|
||||
* the same as the start date except for fields that have from/to
|
||||
* fields defined, like Date module dates.
|
||||
* fields defined, like Date module dates.
|
||||
* $calendar_start_date - a PHP date object for the start time.
|
||||
* $calendar_end_date - a PHP date object for the end time.
|
||||
*
|
||||
*
|
||||
* You can use PHP date functions on the date object to display date
|
||||
* information in other ways, like:
|
||||
*
|
||||
*
|
||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_month_node.
|
||||
*/
|
||||
?>
|
||||
|
@ -45,9 +44,9 @@
|
|||
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
||||
<?php if ($field['label']): ?>
|
||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php print $field['data']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
// $Id: calendar-month.tpl.php,v 1.6.2.3 2008/06/19 22:55:56 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar month.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_month.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
|
@ -14,9 +13,9 @@
|
|||
* $block: Whether or not this calendar is in a block.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $date_id: a css id that is unique for this date,
|
||||
* $date_id: a css id that is unique for this date,
|
||||
* it is in the form: calendar-nid-field_name-delta
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
|
@ -43,4 +42,4 @@
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
<?php
|
||||
// $Id: calendar-week-multiple-node.tpl.php,v 1.1.2.5 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a summary of the days items as a calendar week node.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week_multiple_node.
|
||||
*/
|
||||
*/
|
||||
?>
|
||||
<div class="view-item view-item-<?php print $view->name ?>">
|
||||
<div class="<?php print $curday; ?> calendar weekview">
|
||||
|
@ -16,12 +15,12 @@
|
|||
<?php endforeach; ?>
|
||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
||||
<div class="multiple-events">
|
||||
<div class="multiple-events">
|
||||
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// $Id: calendar-week-node.tpl.php,v 1.2.2.3 2010/11/21 13:19:37 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view item as a calendar week node.
|
||||
*
|
||||
* $node
|
||||
*
|
||||
* $node
|
||||
* A node object for this calendar item. Note this is
|
||||
* not a complete node object, but it will have $node->nid
|
||||
* that you can use to load the full object, and
|
||||
* $node->type to tell the content type of the node.
|
||||
*
|
||||
*
|
||||
* $fields
|
||||
* An array of information for every field selected in the 'Fields'
|
||||
* section of this view, formatted as requested in the View setup.
|
||||
*
|
||||
*
|
||||
* Calendar info for this individual calendar item is in local time --
|
||||
* the user timezone where configurable timezones are allowed and set,
|
||||
* otherwise the site timezone. If this item has extends over more than
|
||||
|
@ -21,22 +20,22 @@
|
|||
* date and calendar_start will be no earlier than the start of
|
||||
* the current day and calendar_end will be no later than the end
|
||||
* of the current day.
|
||||
*
|
||||
*
|
||||
* $calendar_start - A formatted datetime start date for this item.
|
||||
* i.e. '2008-05-12 05:26:15'.
|
||||
* $calendar_end - A formatted datetime end date for this item,
|
||||
* the same as the start date except for fields that have from/to
|
||||
* fields defined, like Date module dates.
|
||||
* fields defined, like Date module dates.
|
||||
* $calendar_start_date - a PHP date object for the start time.
|
||||
* $calendar_end_date - a PHP date object for the end time.
|
||||
*
|
||||
*
|
||||
* You can use PHP date functions on the date object to display date
|
||||
* information in other ways, like:
|
||||
*
|
||||
*
|
||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week_node.
|
||||
*/
|
||||
*/
|
||||
?>
|
||||
<div class="view-item view-item-<?php print $view->name ?>">
|
||||
<div class="<?php print $node->date_id; ?> calendar weekview">
|
||||
|
@ -45,9 +44,9 @@
|
|||
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
||||
<?php if ($field['label']): ?>
|
||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php print $field['data']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<?php
|
||||
// $Id: calendar-week.tpl.php,v 1.5.2.6 2009/02/16 23:46:22 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar week.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_week.
|
||||
*
|
||||
* $day_names: An array of the day of week names for the table header.
|
||||
* $rows: The rendered data for this week.
|
||||
*
|
||||
*
|
||||
* For each day of the week, you have:
|
||||
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
||||
* $rows['datebox'] - the formatted datebox for this day.
|
||||
|
@ -18,11 +17,11 @@
|
|||
* $rows['items'][$time_period]['hour'] - the formatted hour for a time period.
|
||||
* $rows['items'][$time_period]['ampm'] - the formatted ampm value, if any for a time period.
|
||||
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
||||
*
|
||||
*
|
||||
* $view: The view.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
//dsm($rows);
|
||||
|
@ -55,7 +54,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php foreach ($items as $time): ?>
|
||||
<tr>
|
||||
|
@ -71,10 +70,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
<?php
|
||||
// $Id: calendar-year.tpl.php,v 1.6.2.1 2008/06/14 11:38:34 karens Exp $
|
||||
/**
|
||||
* @file
|
||||
* Template to display a view as a calendar year.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_calendar_year.
|
||||
*
|
||||
* $view: The view.
|
||||
* $months: An array with a formatted month calendar for each month of the year.
|
||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
* $max_date_formatted: The maximum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
||||
*
|
||||
*
|
||||
*/
|
||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||
?>
|
||||
|
@ -18,10 +17,10 @@
|
|||
<div class="calendar-calendar"><div class="year-view">
|
||||
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
|
||||
<tbody>
|
||||
<tr><td><?php print $months[1] ?></td><td><?php print $months[2] ?></td><td><?php print $months[3] ?></td></tr>
|
||||
<tr><td><?php print $months[4] ?></td><td><?php print $months[5] ?></td><td><?php print $months[6] ?></td></tr>
|
||||
<tr><td><?php print $months[7] ?></td><td><?php print $months[8] ?></td><td><?php print $months[9] ?></td></tr>
|
||||
<tr><td><?php print $months[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
|
||||
<tr><td><?php print $months[1] ?></td><td><?php print $months[2] ?></td><td><?php print $months[3] ?></td></tr>
|
||||
<tr><td><?php print $months[4] ?></td><td><?php print $months[5] ?></td><td><?php print $months[6] ?></td></tr>
|
||||
<tr><td><?php print $months[7] ?></td><td><?php print $months[8] ?></td><td><?php print $months[9] ?></td></tr>
|
||||
<tr><td><?php print $months[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div></div>
|
||||
</div></div>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: theme.inc,v 1.10.2.80 2011/01/03 12:45:27 karens Exp $
|
||||
/**
|
||||
* Display a calendar navigation and links
|
||||
*/
|
||||
|
@ -28,7 +27,7 @@ function template_preprocess_calendar_main(&$vars) {
|
|||
}
|
||||
elseif (!empty($view->date_info->week)) {
|
||||
$week = date_week_range($view->date_info->week, $view->date_info->year);
|
||||
$current_date = $week[0];
|
||||
$current_date = $week[0];
|
||||
}
|
||||
elseif (!empty($view->date_info->month)) {
|
||||
$current_date = date_make_date($view->date_info->year .'-'. date_pad($view->date_info->month) .'-01 00:00:00');
|
||||
|
@ -76,19 +75,19 @@ function template_preprocess_calendar_main(&$vars) {
|
|||
|
||||
// If an 'Add new ... link is provided, add it here.
|
||||
// the query will bring the user back here after adding the node.
|
||||
if (!empty($view->date_info->calendar_date_link)
|
||||
if (!empty($view->date_info->calendar_date_link)
|
||||
&& (user_access("administer nodes") || user_access('create '. $view->date_info->calendar_date_link .' content'))) {
|
||||
$name = node_get_types('name', $view->date_info->calendar_date_link);
|
||||
$href = 'node/add/'. str_replace('_', '-', $view->date_info->calendar_date_link);
|
||||
$query = 'destination='. $view->date_info->url;
|
||||
$query = 'destination='. $view->date_info->url;
|
||||
$vars['calendar_links']['calendar calendar-add'] = $base + array(
|
||||
'title' => t('Add+'),
|
||||
'href' => $href,
|
||||
'title' => t('Add+'),
|
||||
'href' => $href,
|
||||
'query' => $query,
|
||||
);
|
||||
}
|
||||
|
||||
$vars['view'] = $view;
|
||||
$vars['view'] = $view;
|
||||
$vars['mini'] = !empty($view->date_info->mini);
|
||||
$vars['block'] = !empty($view->date_info->block);
|
||||
$vars['block_identifier'] = date_block_identifier($view);
|
||||
|
@ -97,7 +96,7 @@ function template_preprocess_calendar_main(&$vars) {
|
|||
|
||||
/**
|
||||
* Display a view as a calendar.
|
||||
*
|
||||
*
|
||||
* This preprocessor does all the work needed for all types of calendar
|
||||
* views and the template takes care of displaying links to related views.
|
||||
*/
|
||||
|
@ -117,7 +116,7 @@ function template_preprocess_calendar(&$vars) {
|
|||
$fields = $view->field;
|
||||
|
||||
// Render each field into an output array. We have to do the rendering
|
||||
// here because we don't apppear to have full access to the view
|
||||
// here because we don't apppear to have full access to the view
|
||||
// handlers in the theme functions.
|
||||
$items = array();
|
||||
$calendar_fields = date_api_fields($view->base_table);
|
||||
|
@ -136,7 +135,7 @@ function template_preprocess_calendar(&$vars) {
|
|||
}
|
||||
foreach ($fields as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
if (!empty($field) && is_object($field)) {
|
||||
// Theme the copy instead of the original row so duplicate date
|
||||
// fields each get a fresh copy of the original data to theme.
|
||||
|
@ -176,7 +175,7 @@ function template_preprocess_calendar(&$vars) {
|
|||
$vars['rows'] = $rows;
|
||||
|
||||
$view->date_info->calendar_processed = TRUE;
|
||||
$vars['view'] = $view;
|
||||
$vars['view'] = $view;
|
||||
$vars['mini'] = !empty($view->date_info->mini);
|
||||
$vars['block'] = !empty($view->date_info->block);
|
||||
}
|
||||
|
@ -265,8 +264,8 @@ function template_preprocess_calendar_year(&$vars) {
|
|||
$view = $vars['view'];
|
||||
$year = date_format($view->date_info->min_date, 'Y');
|
||||
|
||||
// Construct a calendar for each month, adjusting the $view passed
|
||||
// to the theme so it will produce the right results.
|
||||
// Construct a calendar for each month, adjusting the $view passed
|
||||
// to the theme so it will produce the right results.
|
||||
$view = drupal_clone($vars['view']);
|
||||
$rows = $vars['rows'];
|
||||
$months = array();
|
||||
|
@ -322,7 +321,7 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
$grouped_items = array();
|
||||
foreach ($rows['all_day'] as $item) {
|
||||
if (isset($item->{$grouping_field})) {
|
||||
$column = $item->{$grouping_field};
|
||||
$column = $item->{$grouping_field};
|
||||
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
|
||||
if (!in_array($column, $columns)) {
|
||||
$columns[] = $column;
|
||||
|
@ -339,7 +338,7 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
|
||||
// Moved timed items into the right columns and render them.
|
||||
$start_times = $view->date_info->style_groupby_times;
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$end_start_time = '23:59:59';
|
||||
$start_time = array_shift($start_times);
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
@ -361,7 +360,7 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
// slots if the option to show empty times was chosen.
|
||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||
if ((!empty($show_empty_times)) && !array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
@ -377,7 +376,7 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
if (!empty($show_empty_times)) {
|
||||
while ($start_time < $end_start_time) {
|
||||
if (!array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
$grouped_items[$start_time]['values'] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
@ -391,8 +390,8 @@ function template_preprocess_calendar_day(&$vars) {
|
|||
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
|
||||
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
|
||||
$grouped_items[$start_time]['hour'] = $heading['hour'];
|
||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||
$i++;
|
||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||
$i++;
|
||||
}
|
||||
ksort($grouped_items);
|
||||
$vars['rows']['items'] = $grouped_items;
|
||||
|
@ -444,7 +443,7 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
}
|
||||
|
||||
// Moved timed items into the right columns and render them.
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$show_empty_times = $view->date_info->style_show_empty_times;
|
||||
$end_start_time = '23:59:59';
|
||||
|
||||
$grouped_items = array();
|
||||
|
@ -477,15 +476,15 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
// slots if the option to show empty times was chosen.
|
||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||
if (($show_empty_times) && !array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'][$weekno] = array();
|
||||
$grouped_items[$start_time]['values'][$weekno] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
}
|
||||
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
|
||||
$grouped_items[$start_time]['values'][$weekno][] = theme($theme, $item, $view);
|
||||
$item_count++;
|
||||
$by_hour_count++;
|
||||
$item_count++;
|
||||
$by_hour_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -493,7 +492,7 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
if ($show_empty_times) {
|
||||
while ($start_time < $end_start_time) {
|
||||
if (!array_key_exists($start_time, $grouped_items)) {
|
||||
$grouped_items[$start_time]['values'][$weekno] = array();
|
||||
$grouped_items[$start_time]['values'][$weekno] = array();
|
||||
}
|
||||
$start_time = $next_start_time;
|
||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||
|
@ -509,10 +508,10 @@ function template_preprocess_calendar_week(&$vars) {
|
|||
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
|
||||
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $row['data']['date']);
|
||||
$grouped_items[$start_time]['hour'] = $heading['hour'];
|
||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||
}
|
||||
|
||||
$vars['items'] = $grouped_items;
|
||||
$vars['items'] = $grouped_items;
|
||||
|
||||
$vars['day_names'] = $day_names;
|
||||
$vars['columns'] = $columns;
|
||||
|
@ -566,7 +565,7 @@ function template_preprocess_calendar_node(&$vars) {
|
|||
$fields = array();
|
||||
foreach ($view->field as $name => $field) {
|
||||
// Some fields, like the node edit and delete links, have no alias.
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
|
||||
if (!empty($node->$field_alias)) {
|
||||
$data = $node->$field_alias;
|
||||
$label = $field->options['label'];
|
||||
|
@ -597,7 +596,7 @@ function template_preprocess_calendar_node(&$vars) {
|
|||
|
||||
// We added the node type to the results in the query,
|
||||
// but it will show up as $node->node_type instead of
|
||||
// $node->type. Rename it to match the normal way it
|
||||
// $node->type. Rename it to match the normal way it
|
||||
// would show up on a node object.
|
||||
$vars['node']->type = $vars['node']->node_type;
|
||||
}
|
||||
|
@ -704,7 +703,7 @@ function theme_calendar_stripe_legend() {
|
|||
array('class' => 'calendar-legend', 'data' => t('Key'))
|
||||
);
|
||||
$rows = array();
|
||||
$output = '';
|
||||
$output = '';
|
||||
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
|
||||
if($stripe){
|
||||
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'"> </div>');
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
; $Id$
|
||||
|
||||
core = 6.x
|
||||
api = 2
|
||||
|
||||
|
@ -7,4 +5,4 @@ projects[] = drupal
|
|||
|
||||
libraries[ckeditor][download][type] = "svn"
|
||||
libraries[ckeditor][download][url] = "http://svn.ckeditor.com/CKEditor/releases/stable/"
|
||||
libraries[ckeditor][directory_name] = "ckeditor"
|
||||
libraries[ckeditor][directory_name] = "ckeditor"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
; $Id: content_taxonomy.info,v 1.1.2.2.2.1 2008/04/30 08:05:19 mh86 Exp $
|
||||
name = Content Taxonomy
|
||||
description = Defines a field type for taxonomy terms
|
||||
dependencies[] = content
|
||||
dependencies[] = content
|
||||
dependencies[] = taxonomy
|
||||
package = CCK
|
||||
core = 6.x
|
||||
|
@ -12,4 +11,3 @@ version = "6.x-1.0-rc2"
|
|||
core = "6.x"
|
||||
project = "content_taxonomy"
|
||||
datestamp = "1250688034"
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<?php
|
||||
// $Id: $
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
|
@ -41,16 +38,16 @@ function content_taxonomy_disable() {
|
|||
|
||||
/**
|
||||
* Implemenation of hook_update_N().
|
||||
*
|
||||
*
|
||||
* updates existing fields from 5.x to 6.x
|
||||
*/
|
||||
function content_taxonomy_update_6000() {
|
||||
if ($abort = content_check_update('content_taxonomy')) {
|
||||
return $abort;
|
||||
}
|
||||
|
||||
|
||||
drupal_load('module', 'content');
|
||||
|
||||
|
||||
$ret = array();
|
||||
|
||||
// Get the latest cache values and schema.
|
||||
|
@ -65,7 +62,7 @@ function content_taxonomy_update_6000() {
|
|||
case 'content_taxonomy':
|
||||
$db_info = content_database_info($field);
|
||||
$table = $db_info['table'];
|
||||
|
||||
|
||||
//fix old settings first and map them to the new ones.
|
||||
$result = db_query("SELECT * FROM {". content_field_tablename() ."} WHERE type = 'content_taxonomy' AND field_name = '%s'", $field['field_name']);
|
||||
while ($field = db_fetch_array($result)) {
|
||||
|
@ -76,7 +73,7 @@ function content_taxonomy_update_6000() {
|
|||
$field['type_name'] = $type_name;
|
||||
$field['columns'] = $db_info['columns'];
|
||||
content_alter_schema(array(), $field);
|
||||
|
||||
|
||||
$sql_nodes = db_query("SELECT * FROM {node} WHERE type = '%s'", $type_name);
|
||||
while ($node = db_fetch_object($sql_nodes)) {
|
||||
$tids = content_taxonomy_install_terms_by_field($node, $field_settings);
|
||||
|
@ -104,8 +101,8 @@ function content_taxonomy_update_6000() {
|
|||
}
|
||||
unset($field_settings['save']);
|
||||
$field_settings['hide_taxonomy_fields'] = isset($field_settings['hide_taxonomy_fields']) ? $field_settings['hide_taxonomy_fields'] : TRUE;
|
||||
$field_settings['parent'] = $field_settings['tid'];
|
||||
|
||||
$field_settings['parent'] = $field_settings['tid'];
|
||||
|
||||
$field['global_settings'] = array();
|
||||
$setting_names = module_invoke($field['module'], 'field_settings', 'save', $field);
|
||||
if (is_array($setting_names)) {
|
||||
|
@ -117,7 +114,7 @@ function content_taxonomy_update_6000() {
|
|||
$field['db_columns'] = $field['columns'];
|
||||
drupal_write_record(content_field_tablename(), $field, 'field_name');
|
||||
}
|
||||
|
||||
|
||||
foreach ($db_info['columns'] as $column => $attributes) {
|
||||
$attributes['not null'] = FALSE;
|
||||
$column = $attributes['column'];
|
||||
|
@ -139,7 +136,7 @@ function content_taxonomy_update_6000() {
|
|||
|
||||
/**
|
||||
* Implemenation of hook_update_N().
|
||||
*
|
||||
*
|
||||
* Renaming of the Parent setting
|
||||
*/
|
||||
function content_taxonomy_update_6001() {
|
||||
|
@ -167,7 +164,7 @@ function content_taxonomy_update_6001() {
|
|||
|
||||
/**
|
||||
* Implemenation of hook_update_N().
|
||||
*
|
||||
*
|
||||
* Fixing parent setting
|
||||
*/
|
||||
function content_taxonomy_update_6002() {
|
||||
|
@ -194,17 +191,17 @@ function content_taxonomy_install_terms_by_field($node, $field) {
|
|||
$result = db_query("SELECT n.tid FROM {term_hierarchy} h, {term_node} n, {term_data} td WHERE
|
||||
n.nid = %d AND n.tid = h.tid AND h.parent = %d AND td.tid=n.tid AND td.vid=%d",
|
||||
$node->nid, $field['tid'], $field['vid']);
|
||||
|
||||
|
||||
while ($data = db_fetch_array($result)) {
|
||||
$terms[$data["tid"]] = $data["tid"];
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
$result = taxonomy_node_get_terms_by_vocabulary($node, $field['vid']);
|
||||
foreach ($result as $tid => $term) {
|
||||
$terms[$tid] = $tid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $terms;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<?php
|
||||
|
||||
// $Id: content_taxonomy.module,v 1.2.2.15.2.33 2009/08/19 12:45:58 mh86 Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Defines a field type for referencing a taxonomy term.
|
||||
|
@ -63,20 +60,20 @@ function content_taxonomy_field_settings($op, $field) {
|
|||
switch ($op) {
|
||||
case 'form':
|
||||
$form = array();
|
||||
|
||||
|
||||
$form['save_term_node'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Save values additionally to the core taxonomy system (into the \'term_node\' table).'),
|
||||
'#default_value' => is_numeric($field['save_term_node']) ? $field['save_term_node'] : 0,
|
||||
'#description' => t('If this option is set, saving of terms is additionally handled by the taxonomy module. So saved terms from Content Taxonomy fields will appear as any other terms saved by the core taxonomy module. Set this option if you are using any other taxonomy application, like tagadelic. Otherwise terms are only saved in the cck tables and can only be accessed via the node or a view'),
|
||||
'#description' => t('If this option is set, saving of terms is additionally handled by the taxonomy module. So saved terms from Content Taxonomy fields will appear as any other terms saved by the core taxonomy module. Set this option if you are using any other taxonomy application, like tagadelic. Otherwise terms are only saved in the cck tables and can only be accessed via the node or a view'),
|
||||
);
|
||||
|
||||
|
||||
$options_voc = array();
|
||||
foreach (taxonomy_get_vocabularies() as $voc) {
|
||||
_content_taxonomy_localize_vocabulary($voc);
|
||||
$options_voc[$voc->vid] = $voc->name;
|
||||
}
|
||||
|
||||
|
||||
$form['vid'] = array(
|
||||
'#title' => t('Vocabulary'),
|
||||
'#type' => 'select',
|
||||
|
@ -84,13 +81,13 @@ function content_taxonomy_field_settings($op, $field) {
|
|||
'#options' => $options_voc,
|
||||
'#description' => t('Terms of the selected vocabulary get exposed to the field'),
|
||||
);
|
||||
|
||||
|
||||
$form['hierarchical_vocabulary'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Advanced settings for hierarchical vocabularies'),
|
||||
'#collapsible' => TRUE,
|
||||
);
|
||||
|
||||
|
||||
$form['hierarchical_vocabulary']['parent'] = array(
|
||||
'#title' => t('Parent Term'),
|
||||
'#type' => 'select',
|
||||
|
@ -118,22 +115,22 @@ function content_taxonomy_field_settings($op, $field) {
|
|||
'#default_value' => is_numeric($field['depth']) ? $field['depth'] : '',
|
||||
'#description' => t('By setting a numeric value, the depth of the hierarchy shown can be limited. Leave this field blank to show the whole hierarchy.'),
|
||||
);
|
||||
|
||||
|
||||
return $form;
|
||||
|
||||
|
||||
|
||||
return $form;
|
||||
|
||||
case 'save':
|
||||
return array('save_term_node', 'vid', 'parent', 'parent_php_code', 'depth');
|
||||
|
||||
|
||||
case 'database columns':
|
||||
return array(
|
||||
'value' => array('type' => 'int', 'not null' => FALSE, 'sortable' => FALSE),
|
||||
);
|
||||
|
||||
|
||||
case 'views data':
|
||||
$data = content_views_field_views_data($field);
|
||||
$table_alias = content_views_tablename($field);
|
||||
|
||||
|
||||
// Add a relation to the taxonomy term table.
|
||||
$data[$table_alias][$field['field_name'] .'_value']['relationship'] = array(
|
||||
'handler' => 'views_handler_relationship',
|
||||
|
@ -152,7 +149,7 @@ function content_taxonomy_field_settings($op, $field) {
|
|||
* Implementation of hook_field().
|
||||
*/
|
||||
function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
|
||||
switch ($op) {
|
||||
switch ($op) {
|
||||
case 'presave':
|
||||
if ($field['save_term_node']) {
|
||||
static $_content_taxonomy_array_cleared;
|
||||
|
@ -160,10 +157,10 @@ function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
|
|||
_content_taxonomy_taxonomy_unset($node->taxonomy, array($field['vid']));
|
||||
$_content_taxonomy_array_cleared[$node->nid][$field['vid']] = TRUE;
|
||||
}
|
||||
|
||||
|
||||
foreach ($items as $key => $entry) {
|
||||
if ($entry['value']) {
|
||||
if (is_object($node->taxonomy[$entry['value']])
|
||||
if (is_object($node->taxonomy[$entry['value']])
|
||||
|| (is_array($node->taxonomy) && in_array($entry['value'], $node->taxonomy))
|
||||
|| (isset($entry['_remove']) && $entry['_remove'] == 1)) {
|
||||
continue;
|
||||
|
@ -182,7 +179,7 @@ function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// the $node->taxonomy array should never be empty, because in this case the
|
||||
// the $node->taxonomy array should never be empty, because in this case the
|
||||
// taxonomy nodeapi doesn't call taxonomy_node_save which handles removing
|
||||
// and inserting of terms
|
||||
if (empty($node->taxonomy)) {
|
||||
|
@ -251,16 +248,16 @@ function content_taxonomy_content_is_empty($item, $field) {
|
|||
*/
|
||||
function content_taxonomy_allowed_values($field) {
|
||||
$options = array();
|
||||
|
||||
|
||||
//for opt groups call different function
|
||||
if (isset($field['widget']['group_parent']) && $field['widget']['group_parent'] > 0) {
|
||||
return content_taxonomy_allowed_values_groups($field);
|
||||
}
|
||||
|
||||
|
||||
$depth = (is_numeric($field['depth'])) ? $field['depth'] : NULL;
|
||||
|
||||
$tree = taxonomy_get_tree($field['vid'], content_taxonomy_field_get_parent($field), -1, $depth);
|
||||
|
||||
|
||||
if (is_array($tree)) {
|
||||
foreach ($tree as $term) {
|
||||
_content_taxonomy_localize_term($term);
|
||||
|
@ -280,14 +277,14 @@ function content_taxonomy_allowed_values($field) {
|
|||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creating Opt Groups for content_taxonomy_options
|
||||
*/
|
||||
function content_taxonomy_allowed_values_groups($field) {
|
||||
$options = array();
|
||||
$parent = content_taxonomy_field_get_parent($field);
|
||||
$group_parent = $field['widget']['group_parent'];
|
||||
|
||||
|
||||
//if children in no group
|
||||
$default_terms = taxonomy_get_children($parent, $field['vid']);
|
||||
foreach ($default_terms as $default_term) {
|
||||
|
@ -345,13 +342,13 @@ function content_taxonomy_form_alter(&$form, $form_state, $form_id) {
|
|||
}
|
||||
}
|
||||
_content_taxonomy_taxonomy_unset($form['taxonomy'], $_content_taxonomy_vids);
|
||||
|
||||
|
||||
//hide empty 'Vocabularies' fieldsets
|
||||
$empty_fieldset = TRUE;
|
||||
if (is_array($form['taxonomy'])) {
|
||||
foreach ($form['taxonomy'] as $key => $value) {
|
||||
if (is_array($value) && !empty($value)) {
|
||||
$empty_fieldset = FALSE;
|
||||
$empty_fieldset = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -423,7 +420,7 @@ function content_taxonomy_views_api() {
|
|||
*/
|
||||
function content_taxonomy_fields() {
|
||||
static $ct_fields;
|
||||
|
||||
|
||||
if (!is_array($ct_fields)) {
|
||||
$ct_fields = array();
|
||||
foreach (content_types() as $type_name => $type) {
|
||||
|
@ -438,7 +435,7 @@ function content_taxonomy_fields() {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Helper functions that returns all terms group by their vocabulary
|
||||
*
|
||||
* needed for some settings forms
|
||||
|
@ -452,7 +449,7 @@ function _content_taxonomy_get_all_terms() {
|
|||
_content_taxonomy_localize_term($term);
|
||||
$options[$voc->name][$term->tid] = str_repeat('- ', $term->depth) . $term->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
@ -489,7 +486,7 @@ function _content_taxonomy_localize_vocabulary(&$vocabulary) {
|
|||
|
||||
/**
|
||||
* carefully unsets node or node form taxonomy items
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param $form the node or node form's taxonomy selections. nodes are objects and forms are arrays, so only the actual taxonomy value or property is passed
|
||||
* @param $vids an array containing a list of vocabulary IDs whose terms should be unset
|
||||
|
@ -533,7 +530,7 @@ function content_taxonomy_content_diff_values($node, $field, $items) {
|
|||
foreach ($items as $item) {
|
||||
if (isset($item['value']) && is_numeric($item['value'])) {
|
||||
$term = taxonomy_get_term($item['value']);
|
||||
$return[] = $term->name;
|
||||
$return[] = $term->name;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
; $Id: content_taxonomy_autocomplete.info,v 1.1.2.4.2.1 2008/04/30 08:05:19 mh86 Exp $
|
||||
name = Content Taxonomy Autocomplete
|
||||
description = Defines a autocomplete widget type for content_taxonomy
|
||||
dependencies[] = content
|
||||
dependencies[] = content_taxonomy
|
||||
dependencies[] = content
|
||||
dependencies[] = content_taxonomy
|
||||
dependencies[] = taxonomy
|
||||
package = CCK
|
||||
core = 6.x
|
||||
|
@ -12,4 +11,3 @@ version = "6.x-1.0-rc2"
|
|||
core = "6.x"
|
||||
project = "content_taxonomy"
|
||||
datestamp = "1250688034"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: content_taxonomy_autocomplete.install,v 1.1.2.2 2008/12/17 21:31:07 mh86 Exp $
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: content_taxonomy_autocomplete.module,v 1.2.2.4.2.17 2009/08/19 09:42:30 mh86 Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Defines a widget type for content_taxonomy with autocomplete
|
||||
|
@ -69,16 +67,16 @@ function content_taxonomy_autocomplete_widget_settings($op, $widget) {
|
|||
),
|
||||
);
|
||||
$form['autocomplete']['extra_parent'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Extra Parent for new terms'),
|
||||
'#options' => _content_taxonomy_get_all_terms(),
|
||||
'#type' => 'select',
|
||||
'#title' => t('Extra Parent for new terms'),
|
||||
'#options' => _content_taxonomy_get_all_terms(),
|
||||
'#default_value' => (isset($widget['extra_parent']) && is_numeric($widget['extra_parent'])) ? $widget['extra_parent'] : 0,
|
||||
'#description' => t('This setting is only relevant if you have selected "Allow and insert new terms by the user into the vocabulary". If you select any term here, new terms will get children of the selected one, otherwise new terms get children of the parent term (root, if no parent selected) selected in the global settings.'),
|
||||
);
|
||||
|
||||
|
||||
$form['autocomplete']['maxlength'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Maximum length of autocomplete'),
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Maximum length of autocomplete'),
|
||||
'#default_value' => (isset($widget['maxlength']) && is_numeric($widget['maxlength'])) ? $widget['maxlength'] : 255,
|
||||
'#element_validate' => array('_content_taxonomy_autocomplete_widget_settings_maxlength_validate'),
|
||||
'#required' => TRUE,
|
||||
|
@ -86,8 +84,8 @@ function content_taxonomy_autocomplete_widget_settings($op, $widget) {
|
|||
);
|
||||
if (module_exists('active_tags')) {
|
||||
$form['autocomplete']['active_tags'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use Active Tags style widget'),
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use Active Tags style widget'),
|
||||
'#default_value' => isset($widget['active_tags']) ? $widget['active_tags'] : 0,
|
||||
'#description' => t('Use the Active Tags module to improve the usability of this autocomplete widget.'),
|
||||
);
|
||||
|
@ -122,7 +120,7 @@ function content_taxonomy_autocomplete_elements() {
|
|||
return array(
|
||||
'content_taxonomy_autocomplete' => array(
|
||||
'#input' => TRUE,
|
||||
'#columns' => array('value'),
|
||||
'#columns' => array('value'),
|
||||
'#delta' => 0,
|
||||
'#process' => array('content_taxonomy_autocomplete_process'),
|
||||
'#autocomplete_path' => FALSE,
|
||||
|
@ -173,7 +171,7 @@ function content_taxonomy_autocomplete_process($element, $edit, $form_state, $fo
|
|||
$field_name = $element['#field_name'];
|
||||
$field = $form['#field_info'][$field_name];
|
||||
$field_key = $element['#columns'][0];
|
||||
|
||||
|
||||
$element[$field_key] = array(
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : '',
|
||||
|
@ -187,16 +185,16 @@ function content_taxonomy_autocomplete_process($element, $edit, $form_state, $fo
|
|||
'#columns' => $element['#columns'],
|
||||
'#maxlength' => !empty($field['widget']['maxlength']) ? $field['widget']['maxlength'] : 255,
|
||||
);
|
||||
|
||||
|
||||
if (empty($element[$field_key]['#element_validate'])) {
|
||||
$element[$field_key]['#element_validate'] = array();
|
||||
}
|
||||
array_unshift($element[$field_key]['#element_validate'], 'content_taxonomy_autocomplete_validate');
|
||||
|
||||
|
||||
if (module_exists('active_tags') && $field['widget']['active_tags']) {
|
||||
active_tags_enable_widget('#' . $element['#id'] . '-value-wrapper');
|
||||
}
|
||||
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
|
@ -209,16 +207,16 @@ function content_taxonomy_autocomplete_validate($element, &$form_state) {
|
|||
$field_name = $element['#field_name'];
|
||||
$field = content_fields($field_name, $element['#type_name']);
|
||||
$field_key = $element['#columns'][0];
|
||||
|
||||
|
||||
//if the element parents array contains the field key, we have to remove it
|
||||
//because otherwise form_set_value won't work. (still the question why is it in)
|
||||
if ($element['#parents'][count($element['#parents'])-1] == $field_key) {
|
||||
array_pop($element['#parents']);
|
||||
array_pop($element['#array_parents']);
|
||||
}
|
||||
|
||||
|
||||
$value = $element['#value'];
|
||||
|
||||
|
||||
$extracted_ids = content_taxonomy_autocomplete_tags_get_tids($value, $field['vid'], content_taxonomy_field_get_parent($field), $field['widget']['extra_parent']);
|
||||
|
||||
if (!$field['multiple'] && count(content_taxonomy_autocomplete_split_tags($value, $field['vid'])) > 1) {
|
||||
|
@ -234,7 +232,7 @@ function content_taxonomy_autocomplete_validate($element, &$form_state) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$values = content_taxonomy_autocomplete_form2data($extracted_ids, $field, $element);
|
||||
form_set_value($element, $values, $form_state);
|
||||
}
|
||||
|
@ -249,9 +247,9 @@ function content_taxonomy_autocomplete_form2data($extracted_ids, $field, $elemen
|
|||
if (is_array($extracted_ids['non_existing_terms'])) {
|
||||
if ($field['widget']['extra_parent']) {
|
||||
$new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], $field['widget']['extra_parent']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], content_taxonomy_field_get_parent($field));
|
||||
$new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], content_taxonomy_field_get_parent($field));
|
||||
}
|
||||
}
|
||||
return content_transpose_array_rows_cols(array($element['#columns'][0] => array_merge($existing_tids, $new_tids)));
|
||||
|
@ -261,7 +259,7 @@ function content_taxonomy_autocomplete_form2data($extracted_ids, $field, $elemen
|
|||
|
||||
/**
|
||||
* Retrieve a pipe delimited string of autocomplete suggestions
|
||||
*
|
||||
*
|
||||
* @param String Fieldname
|
||||
* @param Integer TID of a parent (optional)
|
||||
* @param BOOLEAN whether a multiple field or not
|
||||
|
@ -274,13 +272,13 @@ function content_taxonomy_autocomplete_load($field_name, $string = '') {
|
|||
$content_type_info = _content_type_info();
|
||||
$vid = $content_type_info['fields'][$field_name]['vid'];
|
||||
$tid = content_taxonomy_field_get_parent($content_type_info['fields'][$field_name]);
|
||||
|
||||
|
||||
// If the menu system has splitted the search text because of slashes, glue it back.
|
||||
if (func_num_args() > 2) {
|
||||
$args = func_get_args();
|
||||
$string .= '/'. implode('/', array_slice($args, 2));
|
||||
}
|
||||
|
||||
|
||||
// The user enters a comma-separated list of tags. We only autocomplete the last tag.
|
||||
$array = drupal_explode_tags($string);
|
||||
|
||||
|
@ -289,17 +287,17 @@ function content_taxonomy_autocomplete_load($field_name, $string = '') {
|
|||
$matches = array();
|
||||
if ($last_string != '') {
|
||||
if ($tid) {
|
||||
$result = db_query_range(db_rewrite_sql("SELECT t.name FROM {term_data} t
|
||||
$result = db_query_range(db_rewrite_sql("SELECT t.name FROM {term_data} t
|
||||
LEFT JOIN {term_synonym} s ON t.tid = s.tid
|
||||
INNER JOIN {term_hierarchy} h ON t.tid = h.tid
|
||||
WHERE h.parent = %d
|
||||
WHERE h.parent = %d
|
||||
AND (LOWER(t.name) LIKE LOWER('%%%s%%') OR LOWER(s.name) LIKE LOWER('%%%s%%'))", 't', 'tid'),
|
||||
$tid,$last_string,$last_string,0,10);
|
||||
}
|
||||
else {
|
||||
$result = db_query_range(db_rewrite_sql("SELECT t.name FROM {term_data} t
|
||||
$result = db_query_range(db_rewrite_sql("SELECT t.name FROM {term_data} t
|
||||
LEFT JOIN {term_synonym} s ON t.tid = s.tid
|
||||
WHERE t.vid = %d
|
||||
WHERE t.vid = %d
|
||||
AND (LOWER(t.name) LIKE LOWER('%%%s%%') OR LOWER(s.name) LIKE LOWER('%%%s%%'))", 't', 'tid'),
|
||||
$vid, $last_string, $last_string, 0, 10);
|
||||
}
|
||||
|
@ -335,7 +333,7 @@ function content_taxonomy_autocomplete_tags_get_tids($typed_input, $vid, $parent
|
|||
// formatting so to save the term into the DB as the user intends.
|
||||
$typed_term = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $typed_term)));
|
||||
if ($typed_term == "") { continue; }
|
||||
|
||||
|
||||
// See if the term exists in the chosen vocabulary
|
||||
// and return the tid, otherwise, add a new record.
|
||||
$possibilities = taxonomy_get_term_by_name($typed_term);
|
||||
|
@ -348,7 +346,7 @@ function content_taxonomy_autocomplete_tags_get_tids($typed_input, $vid, $parent
|
|||
$parents = taxonomy_get_parents($possibility->tid);
|
||||
if (in_array($parent, array_keys($parents)) || in_array($extra_parent, array_keys($parents))) {
|
||||
$result['existing_tids'][$possibility->tid] = $possibility->tid;
|
||||
$typed_term_tid = $possibility->tid;
|
||||
$typed_term_tid = $possibility->tid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
; $Id: content_taxonomy_options.info,v 1.1.2.5.2.1 2008/04/30 08:05:19 mh86 Exp $
|
||||
name = Content Taxonomy Options
|
||||
description = Defines a option widget type for content_taxonomy for selects, radios/checkboxes
|
||||
dependencies[] = content
|
||||
dependencies[] = content_taxonomy
|
||||
dependencies[] = content
|
||||
dependencies[] = content_taxonomy
|
||||
dependencies[] = taxonomy
|
||||
dependencies[] = optionwidgets
|
||||
package = CCK
|
||||
|
@ -14,4 +13,3 @@ version = "6.x-1.0-rc2"
|
|||
core = "6.x"
|
||||
project = "content_taxonomy"
|
||||
datestamp = "1250688034"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: content_taxonomy_options.install,v 1.1.2.2 2008/12/17 21:31:07 mh86 Exp $
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<?php
|
||||
|
||||
// $Id: content_taxonomy_options.module,v 1.1.4.7.2.4 2008/12/27 11:25:27 mh86 Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Defines a widget type for content_taxonomy for options
|
||||
|
@ -56,7 +53,7 @@ function content_taxonomy_options_widget_settings($op, $widget) {
|
|||
'#weight' => 10,
|
||||
);
|
||||
$form['settings']['show_depth'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Indent child terms with \' - \' signs'),
|
||||
'#default_value' => is_numeric($widget['show_depth']) ? $widget['show_depth'] : 1,
|
||||
'#description' => t('If this option is checked, a hierarchy gets visualized by indenting child terms, otherwise it\'s a flat list'),
|
||||
|
@ -69,7 +66,7 @@ function content_taxonomy_options_widget_settings($op, $widget) {
|
|||
'#description' => t('This settings applies only for select fields. Select a parent term containg the grouping terms. Grouping terms should be parents of the selected terms (from the Global Settings).'),
|
||||
);
|
||||
return $form;
|
||||
|
||||
|
||||
case 'save':
|
||||
return array('group_parent', 'show_depth');
|
||||
}
|
||||
|
@ -80,7 +77,7 @@ function content_taxonomy_options_widget_settings($op, $widget) {
|
|||
*/
|
||||
function content_taxonomy_options_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
|
||||
$element = array(
|
||||
'#type' => ($field['widget']['type'] == 'content_taxonomy_select') ? 'optionwidgets_select' : 'optionwidgets_buttons',
|
||||
'#type' => ($field['widget']['type'] == 'content_taxonomy_select') ? 'optionwidgets_select' : 'optionwidgets_buttons',
|
||||
'#default_value' => !empty($items) ? $items : array(),
|
||||
);
|
||||
return $element;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
; $Id: content_taxonomy_tree.info,v 1.1.2.1 2008/04/30 08:05:19 mh86 Exp $
|
||||
name = Content Taxonomy Tree
|
||||
description = Defines a dynamic tree widget for Content Taxonomy
|
||||
dependencies[] = content
|
||||
dependencies[] = content_taxonomy
|
||||
dependencies[] = content
|
||||
dependencies[] = content_taxonomy
|
||||
dependencies[] = taxonomy
|
||||
dependencies[] = taxonomy_manager
|
||||
package = CCK
|
||||
|
@ -13,4 +12,3 @@ version = "6.x-1.0-rc2"
|
|||
core = "6.x"
|
||||
project = "content_taxonomy"
|
||||
datestamp = "1250688034"
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<?php
|
||||
// $Id: content_taxonomy_tree.install,v 1.1.2.2 2008/12/17 21:31:07 mh86 Exp $
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
<?php
|
||||
|
||||
// $Id: content_taxonomy_tree.module,v 1.1.2.5 2009/05/14 16:58:22 mh86 Exp $
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of hook_theme().
|
||||
*/
|
||||
|
@ -45,7 +40,7 @@ function content_taxonomy_tree_widget_settings($op, $widget) {
|
|||
'#weight' => 10,
|
||||
);
|
||||
$form['settings']['expand_all'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Expand whole tree by default'),
|
||||
'#default_value' => isset($widget['expand_all']) ? $widget['expand_all'] : 0,
|
||||
'#description' => t('Otherwise only branches, where a term is selected get expanded by default'),
|
||||
|
@ -64,7 +59,7 @@ function content_taxonomy_tree_elements() {
|
|||
return array(
|
||||
'content_taxonomy_tree' => array(
|
||||
'#input' => TRUE,
|
||||
'#columns' => array('value'),
|
||||
'#columns' => array('value'),
|
||||
'#delta' => 0,
|
||||
'#process' => array('content_taxonomy_tree_process'),
|
||||
'#element_validate' => array('content_taxonomy_tree_validate'),
|
||||
|
@ -106,12 +101,12 @@ function content_taxonomy_tree_process($element, $edit, &$form_state, $form) {
|
|||
}
|
||||
$element['#value'] = content_taxonomy_tree_data2form($element, $element['#value'], $field);
|
||||
}
|
||||
|
||||
|
||||
$element[$field_key] = array(
|
||||
'#type' => 'taxonomy_manager_tree',
|
||||
'#default_value' => isset($element['#value']) ? $element['#value'] : '',
|
||||
'#vid' => $field['vid'],
|
||||
'#parent' => content_taxonomy_field_get_parent($field),
|
||||
'#parent' => content_taxonomy_field_get_parent($field),
|
||||
'#default_value' => is_array($element['#value']) ? $element['#value'] : array(),
|
||||
'#render_whole_tree' => TRUE,
|
||||
'#pager' => FALSE,
|
||||
|
@ -126,12 +121,12 @@ function content_taxonomy_tree_process($element, $edit, &$form_state, $form) {
|
|||
'#title' => $element['#title'],
|
||||
'#description' => $element['#description'],
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// Make sure field info will be available to the validator which
|
||||
// does not get the values in $form.
|
||||
$form_state['#field_info'][$field['field_name']] = $field;
|
||||
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
|
@ -146,7 +141,7 @@ function content_taxonomy_tree_validate($element, &$form_state) {
|
|||
$field_key = $element['#columns'][0];
|
||||
|
||||
$values = content_taxonomy_tree_form2data($element, $form_state, $field);
|
||||
|
||||
|
||||
//check for required fields
|
||||
//if $element['#value'] is empty, it's validated by form.inc
|
||||
//otherwise we have to check this by our own
|
||||
|
@ -156,9 +151,9 @@ function content_taxonomy_tree_validate($element, &$form_state) {
|
|||
if (($field['multiple'] >= 2) && (count($element['#value']) > $field['multiple'])) {
|
||||
form_error($element[$field_key], t('%name: this field cannot hold more than @count values.', array('%name' => t($field['widget']['label']), '@count' => $field['multiple'])));
|
||||
}
|
||||
|
||||
|
||||
form_set_value($element, $values, $form_state);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,7 +181,7 @@ function content_taxonomy_tree_form2data($element, &$form_state, $field) {
|
|||
if (!is_array($selected_terms) || !count($selected_terms)) {
|
||||
$selected_terms[] = NULL;
|
||||
}
|
||||
|
||||
|
||||
$form_state['#field_info'][$field['field_name']] = $field;
|
||||
return content_transpose_array_rows_cols(array($element['#columns'][0] => array_values($selected_terms)));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs.admin.inc,v 1.1.2.3.2.33 2011/01/08 03:32:24 mgn Exp $
|
||||
/**
|
||||
* @file
|
||||
* Admin page callback file for the custom_breadcrumbs module.
|
||||
|
@ -12,7 +11,7 @@ function custom_breadcrumbs_page() {
|
|||
$custom_breadcrumbs_sort = variable_get('custom_breadcrumbs_sort', array(
|
||||
'direction' => array('name' => 'asc', 'breadcrumb_type' => 'asc', 'language' => 'asc'),
|
||||
'column' => 'name'));
|
||||
$sort = $custom_breadcrumbs_sort['direction'];
|
||||
$sort = $custom_breadcrumbs_sort['direction'];
|
||||
$multilingual = _custom_breadcrumbs_multilingual();
|
||||
$breadcrumbs = array();
|
||||
// Read session variable to load breadcrumbs of type and language selected by user.
|
||||
|
@ -35,7 +34,7 @@ function custom_breadcrumbs_page() {
|
|||
}
|
||||
}
|
||||
if (empty($modules)) {
|
||||
$modules = module_implements('cb_breadcrumb_info');
|
||||
$modules = module_implements('cb_breadcrumb_info');
|
||||
}
|
||||
foreach ($modules as $key => $module) {
|
||||
$more = custom_breadcrumbs_load_breadcrumbs($module, $tables[$key], NULL, $languages);
|
||||
|
@ -61,7 +60,7 @@ function custom_breadcrumbs_page() {
|
|||
// Add an arrow indicating sort direction.
|
||||
$image = array($order => theme('tablesort_indicator', $sort[$order]));
|
||||
|
||||
$headers = array();
|
||||
$headers = array();
|
||||
foreach ($columns as $key => $title) {
|
||||
$options = array('attributes' => array('title' => t('sort by @s', array('@s' => $title))));
|
||||
$options['query'] = 'order=' . $key . '&sort=' . $sort[$key];
|
||||
|
@ -90,7 +89,7 @@ function custom_breadcrumbs_page() {
|
|||
$rows[] = array(array('data' => t('No custom breadcrumbs have been defined.'), 'colspan' => 2 + (int)$multilingual));
|
||||
}
|
||||
|
||||
$output = drupal_get_form('custom_breadcrumbs_filter_form');
|
||||
$output = drupal_get_form('custom_breadcrumbs_filter_form');
|
||||
$output .= theme('table', $headers, $rows);
|
||||
return $output;
|
||||
}
|
||||
|
@ -105,17 +104,17 @@ function custom_breadcrumbs_page() {
|
|||
* @param $bc2
|
||||
* Second breadcrumb object.
|
||||
*
|
||||
* @return
|
||||
* @return
|
||||
* 0 if the two objects have equal ranking,
|
||||
* 1 if the first object is greater than the second,
|
||||
* -1 if the second object is greater than the first,
|
||||
* -1 if the second object is greater than the first,
|
||||
*/
|
||||
function _custom_breadcrumbs_sort_cmp($bc1, $bc2) {
|
||||
$custom_breadcrumbs_sort = variable_get('custom_breadcrumbs_sort', array(
|
||||
'direction' => array('name' => 'asc', 'breadcrumb_type' => 'asc', 'language' => 'asc'),
|
||||
'column' => 'name')
|
||||
);
|
||||
$options = array('name', 'breadcrumb_type', 'language');
|
||||
$options = array('name', 'breadcrumb_type', 'language');
|
||||
$first = $custom_breadcrumbs_sort['column'];
|
||||
$keys = array_keys($options, $first);
|
||||
$key = array_pop($keys);
|
||||
|
@ -130,7 +129,7 @@ function _custom_breadcrumbs_sort_cmp($bc1, $bc2) {
|
|||
if ($bc1->$options[0] == $bc2->$options[0]) {
|
||||
if ($bc1->$options[1] == $bc2->$options[1]) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return ($bc1->$options[1] > $bc2->$options[1]) ? $sortdir[$options[1]] : -1*$sortdir[$options[1]];
|
||||
}
|
||||
return ($bc1->$options[0] > $bc2->$options[0]) ? $sortdir[$options[0]] : -1*$sortdir[$options[0]];
|
||||
|
@ -204,7 +203,7 @@ function custom_breadcrumbs_form_validate($form, &$form_state) {
|
|||
}
|
||||
else {
|
||||
// If PHP is used, don't validate number of paths and titles.
|
||||
if ((strpos($form_state['values']['titles'], '<?php') !== FALSE) ||
|
||||
if ((strpos($form_state['values']['titles'], '<?php') !== FALSE) ||
|
||||
(strpos($form_state['values']['paths'], '<?php') !== FALSE)) {
|
||||
$check = FALSE;
|
||||
}
|
||||
|
@ -297,7 +296,7 @@ function custom_breadcrumbs_common_form_elements($bid, $breadcrumb) {
|
|||
$description = t('A list of titles for the breadcrumb links, one on each line. For each crumb title you can also specify a title attribute to add to the link. Separate the crumb title and the title attribute with a pipe (|) symbol.');
|
||||
if (variable_get('custom_breadcrumbs_use_php_in_titles', FALSE) && user_access('use php in custom breadcrumbs')) {
|
||||
$description .= ' '. t("Or, you can enter a small PHP code snippet (less than 250 characters) returning either an array of text strings for the breadcrumb titles, with one title per array element, or an associative array with elements 'titles' and 'paths' each containing an array of text strings for the breadcrumb titles and paths, respectively. Include the snippet between %php. Use with caution since incorrect PHP code can break your Drupal site. Token replacement will occur after any PHP is evaluated.", array('%php' => '<?php ?>'));
|
||||
}
|
||||
}
|
||||
|
||||
$form['titles'] = array(
|
||||
'#type' => 'textarea',
|
||||
|
@ -538,7 +537,7 @@ function custom_breadcrumbs_admin_settings() {
|
|||
$form['adv_settings']['module_weights']['table'] = custom_breadcrumbs_module_weight();
|
||||
if (!empty($form['adv_settings']['module_weights']['table'])) {
|
||||
$form['adv_settings']['module_weights']['table']['#theme'] = 'custom_breadcrumbs_module_weight';
|
||||
}
|
||||
}
|
||||
else {
|
||||
unset($form['adv_settings']['module_weights']);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: custom_breadcrumbs.info,v 1.6.4.1 2009/03/28 21:31:24 mgn Exp $
|
||||
name = Custom Breadcrumbs
|
||||
package = Custom Breadcrumbs
|
||||
description = Allows administrators to define custom breadcrumb trails for node types.
|
||||
|
@ -12,4 +11,3 @@ version = "6.x-2.0-rc1"
|
|||
core = "6.x"
|
||||
project = "custom_breadcrumbs"
|
||||
datestamp = "1294462254"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs.install,v 1.3.2.3.2.14 2011/01/08 03:53:17 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Install file for the custom_breadcrumbs module.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs.module,v 1.6.2.5.2.48 2011/01/02 20:51:22 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Provide custom breadcrumbs for node-type pages and base functionality
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_common.inc,v 1.1.2.9 2010/05/03 22:49:15 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Common helper functions used by custom breadcrumbs submodules.
|
||||
|
@ -11,7 +9,7 @@
|
|||
*
|
||||
* @param $curpath
|
||||
* The current Drupal path.
|
||||
* @param $breadcrumb_path
|
||||
* @param $breadcrumb_path
|
||||
* The path that the breadcrumb applies to.
|
||||
*
|
||||
* @return
|
||||
|
@ -90,7 +88,7 @@ function _custom_breadcrumbs_allowed_display($display) {
|
|||
* The $display->handler->view->args array.
|
||||
*
|
||||
* @return $arg_values
|
||||
* An associative array of two elements, 'types' and 'values', each an array with elements
|
||||
* An associative array of two elements, 'types' and 'values', each an array with elements
|
||||
* corresponding to the views arguments.
|
||||
*/
|
||||
function _custom_breadcrumbs_views_parse_args($arguments, $viewargs) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: custom_breadcrumbs_identifiers.info,v 1.1.2.1 2010/04/25 19:50:50 mgn Exp $
|
||||
name = Custom Breadcrumbs Identifiers
|
||||
package = Custom Breadcrumbs
|
||||
description = Provides special identifiers for custom breadcrumbs.
|
||||
|
@ -10,4 +9,3 @@ version = "6.x-2.0-rc1"
|
|||
core = "6.x"
|
||||
project = "custom_breadcrumbs"
|
||||
datestamp = "1294462254"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_identifiers.module,v 1.1.2.7 2010/12/30 18:36:25 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Provide special identifiers for use with custom breadcrumbs.
|
||||
|
@ -50,7 +48,7 @@ function custom_breadcrumbs_identifiers_cb_identifier_values($identifier, $obj)
|
|||
// Optionally wrap plain text crumb in span tag with class identifiers.
|
||||
if (variable_get('custom_breadcrumbs_none_span', FALSE)) {
|
||||
$class = 'custom-breadcrumbs-none';
|
||||
$attributes = $obj['attributes']['attributes'];
|
||||
$attributes = $obj['attributes']['attributes'];
|
||||
if (!empty($attributes['class'])) {
|
||||
$attributes['class'] .= ' ' . $class;
|
||||
}
|
||||
|
@ -196,6 +194,3 @@ function custom_breadcrumbs_identifiers_form_alter(&$form, $form_state, $form_id
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: custom_breadcrumbs_panels.info,v 1.1.2.1 2009/08/02 23:18:48 mgn Exp $
|
||||
name = Custom Breadcrumbs for Panels
|
||||
package = Custom Breadcrumbs
|
||||
dependencies[] = custom_breadcrumbs
|
||||
|
@ -16,4 +15,3 @@ version = "6.x-2.0-rc1"
|
|||
core = "6.x"
|
||||
project = "custom_breadcrumbs"
|
||||
datestamp = "1294462254"
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_panels.install,v 1.1.2.3 2010/05/03 22:49:15 mgn Exp $
|
||||
/**
|
||||
* @file
|
||||
* Install file for the custom_breadcrumbs_panels module.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_panels.module,v 1.1.2.9 2010/12/30 18:36:25 mgn Exp $
|
||||
/**
|
||||
* @file
|
||||
* Provide custom breadcrumbs for panels pages.
|
||||
|
@ -127,7 +126,7 @@ function custom_breadcrumbs_panels_ctools_render_alter($info, $page, $args, $con
|
|||
}
|
||||
}
|
||||
|
||||
// Is this a taxonomy term template?
|
||||
// Is this a taxonomy term template?
|
||||
if (isset($task['admin path']) && ($task['admin path'] == "taxonomy/term/%term") && module_exists('custom_breadcrumbs_taxonomy') && variable_get('custom_breadcrumbs_taxonomy_panels', FALSE)) {
|
||||
module_load_include('inc', 'custom_breadcrumbs_taxonomy');
|
||||
foreach ($contexts as $context) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: custom_breadcrumbs_paths.info,v 1.1.2.1 2009/04/06 12:43:32 mgn Exp $
|
||||
name = Custom Breadcrumbs for Paths
|
||||
package = Custom Breadcrumbs
|
||||
dependencies[] = custom_breadcrumbs
|
||||
|
@ -13,4 +12,3 @@ version = "6.x-2.0-rc1"
|
|||
core = "6.x"
|
||||
project = "custom_breadcrumbs"
|
||||
datestamp = "1294462254"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_paths.install,v 1.1.2.7 2010/05/03 22:49:15 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Install file for the custom_breadcrumbs module.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_paths.module,v 1.1.2.26 2010/12/30 18:36:25 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Assign custom breadcrumbs based on the Drupal path.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_taxonomy.admin.inc,v 1.1.2.8 2010/04/25 20:52:23 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Administration pages for custom_breadcrumbs_taxonomy.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_taxonomy.inc,v 1.1.2.19 2010/12/30 18:36:25 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Helper functions for custom_breadcrumbs_taxonomy.
|
||||
|
@ -179,7 +177,7 @@ function custom_breadcrumbs_taxonomy_node_get_lightest_term($node) {
|
|||
if (!empty($terms)) {
|
||||
if (count($terms) > 1) {
|
||||
foreach ($terms as $term) {
|
||||
// Only consider terms in the lightest vocabulary.
|
||||
// Only consider terms in the lightest vocabulary.
|
||||
if (!isset($vid)) {
|
||||
$vid = $term->vid;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
; $Id: custom_breadcrumbs_taxonomy.info,v 1.1.2.2 2009/05/30 22:02:07 mgn Exp $
|
||||
name = Custom Breadcrumbs for Taxonomy
|
||||
description = "Enables taxonomy based breadcrumbs and allows for node assosciations with taxonomy terms."
|
||||
package = Custom Breadcrumbs
|
||||
|
@ -11,4 +10,3 @@ version = "6.x-2.0-rc1"
|
|||
core = "6.x"
|
||||
project = "custom_breadcrumbs"
|
||||
datestamp = "1294462254"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_taxonomy.install,v 1.1.2.10 2011/01/08 03:53:17 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Install file for the custom_breadcrumbs_taxonomy module.
|
||||
|
@ -131,7 +129,7 @@ function custom_breadcrumbs_taxonomy_schema() {
|
|||
),
|
||||
'primary key' => array('bid'),
|
||||
);
|
||||
|
||||
|
||||
$schema['custom_breadcrumbs_taxonomy_vocabulary'] = array(
|
||||
'description' => 'Stores custom breadcrumbs for taxonomy vocabularies',
|
||||
'fields' => array(
|
||||
|
@ -211,6 +209,6 @@ function custom_breadcrumbs_taxonomy_update_6200() {
|
|||
$ret = array();
|
||||
db_add_field($ret, 'custom_breadcrumbs_taxonomy_term', 'name', array('type' => 'varchar', 'length' => 128, 'NOT NULL' => FALSE, 'description' => 'An optional name for the custom breadcrumb.'));
|
||||
db_add_field($ret, 'custom_breadcrumbs_taxonomy_vocabulary', 'name', array('type' => 'varchar', 'length' => 128, 'NOT NULL' => FALSE, 'description' => 'An optional name for the custom breadcrumb.'));
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
// $Id: custom_breadcrumbs_taxonomy.module,v 1.1.2.26 2010/12/30 18:36:25 mgn Exp $
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This module implements taxonomy_based breadcrumbs using a hybrid of methods
|
||||
|
@ -12,7 +10,7 @@
|
|||
*
|
||||
* - The HOME breadcrumb (if present) links to the home page. The text
|
||||
* displayed for HOME is administrator configurable on the custom_breadcrumbs
|
||||
* settings page.
|
||||
* settings page.
|
||||
* - The VOCABULARY breadcrumb (if present) will link to an administrator
|
||||
* defined page. If the VOCABULARY does not have an administrator
|
||||
* defined page, it will not appear in the breadcrumb trail.
|
||||
|
@ -25,8 +23,8 @@
|
|||
* mysite >> term >> term
|
||||
* home >> vocabulary >> term >> term
|
||||
* vocabulary >> term >> term
|
||||
*
|
||||
* If 'Use taxonomy hierarchy' is not checked, then the titles and paths used to
|
||||
*
|
||||
* If 'Use taxonomy hierarchy' is not checked, then the titles and paths used to
|
||||
* construct the breadcrumb should be defined at the custom_breadcrumbs administration
|
||||
* page in the same as other custom breadcrumbs. For a node containing multiple terms
|
||||
* and vocabularies, the lightest term with a visible, matching custom breadcrumb is
|
||||
|
@ -52,14 +50,14 @@ define('CUSTOM_BREADCRUMBS_TAXONOMY_NODE_TYPES_DEFAULT', 'book');
|
|||
function custom_breadcrumbs_taxonomy_cb_breadcrumb_info() {
|
||||
$breadcrumb_type_info = array();
|
||||
$breadcrumb_type_info['taxonomy_vocabulary'] = array(
|
||||
'table' => 'custom_breadcrumbs_taxonomy_vocabulary',
|
||||
'field' => 'vid',
|
||||
'table' => 'custom_breadcrumbs_taxonomy_vocabulary',
|
||||
'field' => 'vid',
|
||||
'type' => 'taxonomy_vocabulary',
|
||||
'name_constructor' => '_custom_breadcrumbs_taxonomy_vocabulary_breadcrumb_name'
|
||||
);
|
||||
$breadcrumb_type_info['taxonomy_term'] = array(
|
||||
'table' => 'custom_breadcrumbs_taxonomy_term',
|
||||
'field' => 'tid',
|
||||
'table' => 'custom_breadcrumbs_taxonomy_term',
|
||||
'field' => 'tid',
|
||||
'type' => 'taxonomy_term',
|
||||
'name_constructor' => '_custom_breadcrumbs_taxonomy_term_breadcrumb_name'
|
||||
);
|
||||
|
@ -71,7 +69,7 @@ function custom_breadcrumbs_taxonomy_cb_breadcrumb_info() {
|
|||
*
|
||||
* @param $breadcrumb
|
||||
* The breadcrumb object.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* A text string that will be used as the breadcrumb name.
|
||||
*/
|
||||
|
@ -79,11 +77,11 @@ function _custom_breadcrumbs_taxonomy_term_breadcrumb_name($breadcrumb) {
|
|||
$names = array();
|
||||
$parents = taxonomy_get_parents_all($breadcrumb->tid);
|
||||
while ($parent = array_shift($parents)) {
|
||||
$names[] = $parent->name;
|
||||
$names[] = $parent->name;
|
||||
}
|
||||
$term = taxonomy_get_term($breadcrumb->tid);
|
||||
$vocabulary = taxonomy_vocabulary_load($term->vid);
|
||||
$names[] = $vocabulary->name;
|
||||
$names[] = $vocabulary->name;
|
||||
$names = array_reverse($names);
|
||||
$output = implode('>', $names);
|
||||
return $output;
|
||||
|
@ -94,7 +92,7 @@ function _custom_breadcrumbs_taxonomy_term_breadcrumb_name($breadcrumb) {
|
|||
*
|
||||
* @param $breadcrumb
|
||||
* The breadcrumb object.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* A text string that will be used as the breadcrumb name.
|
||||
*/
|
||||
|
@ -449,7 +447,7 @@ function custom_breadcrumbs_taxonomy_form_taxonomy_form_term_alter(&$form, &$for
|
|||
/**
|
||||
* Implements hook_cb_node_form_table.
|
||||
*
|
||||
* @param $node
|
||||
* @param $node
|
||||
* The node object being edited
|
||||
*
|
||||
* @return $breadcrumbs
|
||||
|
@ -482,7 +480,7 @@ function custom_breadcrumbs_taxonomy_cb_node_form_table($node) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines if the current node is one of the types listed on the advanced settings page.
|
||||
* Determines if the current node is one of the types listed on the advanced settings page.
|
||||
*
|
||||
* @param $nodetype
|
||||
* The node type being considered for a custom breadcrumb.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue