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
|
RewriteCond %{REQUEST_URI} !=/favicon.ico
|
||||||
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
|
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
|
||||||
</IfModule>
|
</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
|
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."
|
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
|
package = Core - extended
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: administerusersbyrole.module,v 1.1.2.4 2009/01/28 03:44:27 smokris Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @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>.
|
* 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
|
<?php
|
||||||
// $Id: autosave.module,v 1.9 2009/11/06 00:41:16 ptalindstrom Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Does background saves of node being edited.
|
* 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) {
|
function autosave_form_alter(&$form, &$form_state, $form_id) {
|
||||||
global $user;
|
global $user;
|
||||||
$path = $_GET['q'];
|
$path = $_GET['q'];
|
||||||
|
|
||||||
if (stristr($form_id, '_node_form') && arg(0) != 'admin') {
|
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
|
// 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 WYSIWYG module is enabled; lets let JS know this
|
||||||
if (module_exists('wysiwyg')) $settings['autosave']['wysiwyg'] = 1;
|
if (module_exists('wysiwyg')) $settings['autosave']['wysiwyg'] = 1;
|
||||||
else $settings['autosave']['wysiwyg'] = 0;
|
else $settings['autosave']['wysiwyg'] = 0;
|
||||||
|
|
||||||
// add security token
|
// add security token
|
||||||
$token = drupal_get_token($form_id);
|
$token = drupal_get_token($form_id);
|
||||||
|
|
||||||
$settings['autosave']['url'] = url('autosave/handler/' . $token);
|
$settings['autosave']['url'] = url('autosave/handler/' . $token);
|
||||||
$settings['autosave']['period'] = variable_get('autosave_period', 10);
|
$settings['autosave']['period'] = variable_get('autosave_period', 10);
|
||||||
$settings['autosave']['autosave_path'] = $path;
|
$settings['autosave']['autosave_path'] = $path;
|
||||||
$settings['autosave']['hidden'] = variable_get('autosave_hidden', 0);
|
$settings['autosave']['hidden'] = variable_get('autosave_hidden', 0);
|
||||||
|
|
||||||
// If an autosaved version of the form exists, make it available via javascript.
|
// 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)) {
|
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';
|
//$autosaved_form_id = $form['type']['#value'] ? $form['type']['#value'] .'_node_form' : 'node_form';
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: better-formats-defaults-admin-form.tpl.php,v 1.3.2.7 2009/09/27 14:27:13 dragonwize Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Default theme implementation to configure Better Formats defaults admin page.
|
* 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
|
name = Better Formats
|
||||||
description = Enhances the core input format system by managing input format defaults and settings.
|
description = Enhances the core input format system by managing input format defaults and settings.
|
||||||
package = Core - extended
|
package = Core - extended
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: better_formats.install,v 1.7.2.7 2009/05/31 06:24:40 dragonwize Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Installs the better_formats module.
|
* Installs the better_formats module.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: better_formats.module,v 1.23.2.17 2010/02/05 13:59:18 dragonwize Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Enhances Drupal's core input format settings.
|
* Enhances Drupal's core input format settings.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: better_formats_defaults.admin.inc,v 1.3.2.11 2010/02/05 13:52:48 dragonwize Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Contains FAPI and theme functions for the format defaults form.
|
* 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
|
* @file
|
||||||
* Enhances the default format selection on content type edit forms.
|
* Enhances the default format selection on content type edit forms.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: better_formats_settings.admin.inc,v 1.6.2.3 2009/02/25 06:44:17 dragonwize Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Contains FAPI and theme functions for the format settings form.
|
* 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
|
name = Calendar
|
||||||
description = Views plugin to display views containing dates as Calendars.
|
description = Views plugin to display views containing dates as Calendars.
|
||||||
dependencies[] = views
|
dependencies[] = views
|
||||||
|
@ -13,4 +12,3 @@ version = "6.x-2.4"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "calendar"
|
project = "calendar"
|
||||||
datestamp = "1294072550"
|
datestamp = "1294072550"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
//$Id: calendar.install,v 1.13.2.12 2010/02/28 14:23:48 karens Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_enable().
|
* Implementation of hook_enable().
|
||||||
* Reset the calendar caches.
|
* Reset the calendar caches.
|
||||||
|
@ -30,13 +28,13 @@ function calendar_uninstall() {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
variable_del('calendar_default_view_options');
|
variable_del('calendar_default_view_options');
|
||||||
$displays = array(
|
$displays = array(
|
||||||
'calendar',
|
'calendar',
|
||||||
'calendar_attachment',
|
'calendar_attachment',
|
||||||
'calendar_year',
|
'calendar_year',
|
||||||
'calendar_day',
|
'calendar_day',
|
||||||
'calendar_month',
|
'calendar_month',
|
||||||
'calendar_week',
|
'calendar_week',
|
||||||
'calendar_block',
|
'calendar_block',
|
||||||
'calendar_block_view',
|
'calendar_block_view',
|
||||||
'calendar_ical',
|
'calendar_ical',
|
||||||
);
|
);
|
||||||
|
@ -78,12 +76,12 @@ function calendar_update_6000() {
|
||||||
$ret = array();
|
$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);
|
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.'));
|
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
variable_del('calendar_empty_arg');
|
variable_del('calendar_empty_arg');
|
||||||
|
|
||||||
// Can't use variable_del because we don't have a reliable
|
// Can't use variable_del because we don't have a reliable
|
||||||
// way to find the old view names.
|
// way to find the old view names.
|
||||||
db_query("DELETE FROM {variable} WHERE name LIKE 'calendar_%'");
|
db_query("DELETE FROM {variable} WHERE name LIKE 'calendar_%'");
|
||||||
|
@ -101,7 +99,7 @@ function calendar_update_6001() {
|
||||||
$ret = array();
|
$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);
|
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.'));
|
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
if (!module_exists('calendar_ical')) {
|
if (!module_exists('calendar_ical')) {
|
||||||
|
@ -117,7 +115,7 @@ function calendar_update_6002() {
|
||||||
$ret = array();
|
$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);
|
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.'));
|
$ret['#abort'] = array('success' => FALSE, 'query' => t('calendar.module has updates, but cannot be updated until views.module is updated first.'));
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
$periods = array(
|
$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);
|
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') {
|
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']);
|
db_query("DELETE FROM {views_object_cache} WHERE name = '%s'", $row['name']);
|
||||||
}
|
}
|
||||||
views_invalidate_cache();
|
views_invalidate_cache();
|
||||||
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar displays to use new handlers.');
|
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar displays to use new handlers.');
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar.module,v 1.121.2.43 2010/12/31 16:25:43 karens Exp $
|
|
||||||
define('CALENDAR_SHOW_ALL', 0);
|
define('CALENDAR_SHOW_ALL', 0);
|
||||||
define('CALENDAR_HIDE_ALL', -1);
|
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') {
|
if (module_exists('calendar_multiday') || substr($_GET['q'], 0, 24) == 'admin/build/modules/list') {
|
||||||
return;
|
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.
|
// even though it isn't needed everywhere.
|
||||||
drupal_add_css('misc/farbtastic/farbtastic.css');
|
drupal_add_css('misc/farbtastic/farbtastic.css');
|
||||||
drupal_add_css(drupal_get_path('module', 'calendar') .'/calendar.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
|
* Calendar display types
|
||||||
*/
|
*/
|
||||||
function 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.
|
* based on the current argument.
|
||||||
*
|
*
|
||||||
* @return year, month, day, or week.
|
* @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 $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 $stripe - the hex code for this stripe.
|
||||||
* @param $label - the label to give this stripe.
|
* @param $label - the label to give this stripe.
|
||||||
*
|
*
|
||||||
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
||||||
* may be a better way.
|
* may be a better way.
|
||||||
*/
|
*/
|
||||||
|
@ -208,7 +207,7 @@ function calendar_node_stripe($view, &$node, $query_name, $delta, $stripe = NULL
|
||||||
if(!(isset($node->stripe))){
|
if(!(isset($node->stripe))){
|
||||||
$node->stripe = array();
|
$node->stripe = array();
|
||||||
$node->stripe_label = array();
|
$node->stripe_label = array();
|
||||||
}
|
}
|
||||||
if (!$label && array_key_exists($type, $type_names)) {
|
if (!$label && array_key_exists($type, $type_names)) {
|
||||||
$label = $type_names[$type];
|
$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 $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 $stripe - the hex code for this stripe.
|
||||||
* @param $label - the label to give this stripe.
|
* @param $label - the label to give this stripe.
|
||||||
*
|
*
|
||||||
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
||||||
* may be a better way.
|
* may be a better way.
|
||||||
*/
|
*/
|
||||||
|
@ -245,8 +244,8 @@ function calendar_node_taxonomy_stripe($view, &$node, $query_name, $delta, $stri
|
||||||
if (empty($colors_taxonomy)) {
|
if (empty($colors_taxonomy)) {
|
||||||
return;
|
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.
|
// taxonomy will expect, it's in the raw results.
|
||||||
$node->vid = $node->raw->node_vid;
|
$node->vid = $node->raw->node_vid;
|
||||||
$terms_for_node = taxonomy_node_get_terms($node);
|
$terms_for_node = taxonomy_node_get_terms($node);
|
||||||
|
@ -269,7 +268,7 @@ function calendar_node_taxonomy_stripe($view, &$node, $query_name, $delta, $stri
|
||||||
else {
|
else {
|
||||||
$node->stripe[] = '';
|
$node->stripe[] = '';
|
||||||
$node->stripe_label[] = '';
|
$node->stripe_label[] = '';
|
||||||
}
|
}
|
||||||
return;
|
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 $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 $stripe - the hex code for this stripe.
|
||||||
* @param $label - the label to give this stripe.
|
* @param $label - the label to give this stripe.
|
||||||
*
|
*
|
||||||
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
* TODO Reconsider use of $GLOBALS as a method of triggering the legend, there
|
||||||
* may be a better way.
|
* may be a better way.
|
||||||
*/
|
*/
|
||||||
|
@ -315,7 +314,7 @@ function calendar_node_group_stripe($view, &$node, $query_name, $delta, $stripe
|
||||||
else {
|
else {
|
||||||
$node->stripe[] = '';
|
$node->stripe[] = '';
|
||||||
$node->stripe_label[] = '';
|
$node->stripe_label[] = '';
|
||||||
}
|
}
|
||||||
return $stripe;
|
return $stripe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,7 +375,7 @@ function calendar_date_select_form(&$form_state, $view) {
|
||||||
'#type' => 'hidden',
|
'#type' => 'hidden',
|
||||||
'#value' => $view->get_url(),
|
'#value' => $view->get_url(),
|
||||||
);
|
);
|
||||||
$pos = calendar_arg_position($view);
|
$pos = calendar_arg_position($view);
|
||||||
$form['calendar_previous_arg'] = array(
|
$form['calendar_previous_arg'] = array(
|
||||||
'#type' => 'hidden',
|
'#type' => 'hidden',
|
||||||
'#value' => $view->args[$pos],
|
'#value' => $view->args[$pos],
|
||||||
|
@ -399,7 +398,7 @@ function calendar_arg_position($view) {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get the url for a calendar node.
|
* Get the url for a calendar node.
|
||||||
*
|
*
|
||||||
* @param $node - a calendar node object
|
* @param $node - a calendar node object
|
||||||
* @param $default - a default url to use when nothing specific is provided.
|
* @param $default - a default url to use when nothing specific is provided.
|
||||||
*/
|
*/
|
||||||
|
@ -446,24 +445,24 @@ function calendar_errors($error) {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_elements.
|
* Implementation of hook_elements.
|
||||||
*
|
*
|
||||||
* Much of the colorpicker code was adapted from the Colorpicker module.
|
* Much of the colorpicker code was adapted from the Colorpicker module.
|
||||||
* That module has no stable release yet nor any D6 branch.
|
* That module has no stable release yet nor any D6 branch.
|
||||||
*
|
*
|
||||||
* TODO Consider dropping the duplicate code and adding a dependency
|
* 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.
|
* work in it.
|
||||||
*/
|
*/
|
||||||
function calendar_elements() {
|
function calendar_elements() {
|
||||||
// the Farbtastic colorpicker
|
// the Farbtastic colorpicker
|
||||||
$type['calendar_colorpicker'] = array(
|
$type['calendar_colorpicker'] = array(
|
||||||
'#attributes' => array('class' => 'calendar_colorpicker'),
|
'#attributes' => array('class' => 'calendar_colorpicker'),
|
||||||
'#input' => TRUE,
|
'#input' => TRUE,
|
||||||
);
|
);
|
||||||
|
|
||||||
// a textfield to associate with the Farbtastic colorpicker
|
// a textfield to associate with the Farbtastic colorpicker
|
||||||
$type['calendar_colorfield'] = array(
|
$type['calendar_colorfield'] = array(
|
||||||
'#attributes' => array('class' => 'calendar_colorfield'),
|
'#attributes' => array('class' => 'calendar_colorfield'),
|
||||||
'#input' => TRUE,
|
'#input' => TRUE,
|
||||||
'#validate' => array('calendar_validate_hex_color' => array())
|
'#validate' => array('calendar_validate_hex_color' => array())
|
||||||
);
|
);
|
||||||
|
@ -511,7 +510,7 @@ function theme_calendar_colorfield($element) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add link to calendar to nodes.
|
* Add link to calendar to nodes.
|
||||||
*
|
*
|
||||||
* Controlled by value of 'calendar_date_link' in the view.
|
* Controlled by value of 'calendar_date_link' in the view.
|
||||||
*/
|
*/
|
||||||
function calendar_link($type, $object, $teaser = FALSE) {
|
function calendar_link($type, $object, $teaser = FALSE) {
|
||||||
|
@ -553,7 +552,7 @@ function calendar_remove($view_name) {
|
||||||
function calendar_week_header($view) {
|
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);
|
$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);
|
$with_week = !empty($view->date_info->style_with_weekno);
|
||||||
|
|
||||||
// create week header
|
// create week header
|
||||||
$untranslated_days = calendar_untranslated_days();
|
$untranslated_days = calendar_untranslated_days();
|
||||||
if ($len == 99) {
|
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
|
// Midnights are determined based on the same timezone as the View uses
|
||||||
$display_timezone = date_timezone_get($view->date_info->min_date);
|
$display_timezone = date_timezone_get($view->date_info->min_date);
|
||||||
$display_timezone_name = timezone_name_get($display_timezone);
|
$display_timezone_name = timezone_name_get($display_timezone);
|
||||||
|
|
||||||
// Translate the view min and max dates to UTC values
|
// Translate the view min and max dates to UTC values
|
||||||
// so we can compare UTC dates to the view range.
|
// so we can compare UTC dates to the view range.
|
||||||
$min_utc = drupal_clone($view->date_info->min_date);
|
$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');
|
$local_tz = date_get_timezone($field['tz_handling'], 'date');
|
||||||
$field_name = $field['field_name'];
|
$field_name = $field['field_name'];
|
||||||
$rrule_field = str_replace(array('_value2', '_value'), '_rrule', $alias);
|
$rrule_field = str_replace(array('_value2', '_value'), '_rrule', $alias);
|
||||||
|
|
||||||
// Set a flag to tell us if individual multi-day dates need to be
|
// Set a flag to tell us if individual multi-day dates need to be
|
||||||
// split into separate nodes.
|
// split into separate nodes.
|
||||||
$split_dates = TRUE;
|
$split_dates = TRUE;
|
||||||
if (strstr($view->current_display, '_ical')) {
|
if (strstr($view->current_display, '_ical')) {
|
||||||
$split_dates = FALSE;
|
$split_dates = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is no field for this item, just default to the site format.
|
// If there is no field for this item, just default to the site format.
|
||||||
if (!isset($view->field[$field_name])) {
|
if (!isset($view->field[$field_name])) {
|
||||||
$format = variable_get('date_format_short', 'm/d/Y - H:i');
|
$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
|
// set the domain part of the id
|
||||||
$domain = check_plain($_SERVER['SERVER_NAME']);
|
$domain = check_plain($_SERVER['SERVER_NAME']);
|
||||||
|
|
||||||
// If there are multiple date fields in this calendar we may get
|
// If there are multiple date fields in this calendar we may get
|
||||||
// duplicate items from the other date fields, so add a way to
|
// duplicate items from the other date fields, so add a way to
|
||||||
// make sure each individual date field only gets added to the
|
// 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') {
|
if (substr($field['type'], 0, 3) == 'cck') {
|
||||||
$real_field = str_replace(array('_value2', '_value'), '', $field_name);
|
$real_field = str_replace(array('_value2', '_value'), '', $field_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = 'calendar.'. $item->{$view->base_field} .'.'. $real_field .'.'. $delta;
|
$id = 'calendar.'. $item->{$view->base_field} .'.'. $real_field .'.'. $delta;
|
||||||
|
|
||||||
// When creating iCal feeds for repeating dates we don't want all
|
// When creating iCal feeds for repeating dates we don't want all
|
||||||
// the multiple values, send only the first value.
|
// the multiple values, send only the first value.
|
||||||
if (strstr($view->current_display, '_ical')) {
|
if (strstr($view->current_display, '_ical')) {
|
||||||
|
@ -718,30 +717,30 @@ function calendar_build_nodes(&$view, &$items) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($id, $processed) && !empty($item->calendar_fields->$alias)) {
|
if (!in_array($id, $processed) && !empty($item->calendar_fields->$alias)) {
|
||||||
|
|
||||||
// Create from and to date values for each item, adjusted to
|
// Create from and to date values for each item, adjusted to
|
||||||
// the correct timezone.
|
// the correct timezone.
|
||||||
$values[0] = !empty($item->calendar_fields->$fromto[0]) ? $item->calendar_fields->$fromto[0] : $item->calendar_fields->$alias;
|
$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;
|
$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);
|
$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);
|
$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
|
// Now $display_timezone determines how $item is split into
|
||||||
// one entry per day, while $to_zone determines how date is displayed.
|
// one entry per day, while $to_zone determines how date is displayed.
|
||||||
// For now, use the date fields's timezone for the day splitting.
|
// For now, use the date fields's timezone for the day splitting.
|
||||||
$display_timezone_name = $to_zone;
|
$display_timezone_name = $to_zone;
|
||||||
$values_display = array();
|
$values_display = array();
|
||||||
|
|
||||||
// Start date
|
// Start date
|
||||||
$date = date_make_date($values[0], $db_tz, $field['sql_type']);
|
$date = date_make_date($values[0], $db_tz, $field['sql_type']);
|
||||||
if ($db_tz != $to_zone) {
|
if ($db_tz != $to_zone) {
|
||||||
date_timezone_set($date, timezone_open($to_zone));
|
date_timezone_set($date, timezone_open($to_zone));
|
||||||
}
|
}
|
||||||
$values[0] = date_format($date, DATE_FORMAT_DATETIME);
|
$values[0] = date_format($date, DATE_FORMAT_DATETIME);
|
||||||
|
|
||||||
if ($display_timezone_name != $to_zone) {
|
if ($display_timezone_name != $to_zone) {
|
||||||
date_timezone_set($date, $display_timezone);
|
date_timezone_set($date, $display_timezone);
|
||||||
$values_display[0] = date_format($date, DATE_FORMAT_DATETIME);
|
$values_display[0] = date_format($date, DATE_FORMAT_DATETIME);
|
||||||
|
@ -749,7 +748,7 @@ function calendar_build_nodes(&$view, &$items) {
|
||||||
else {
|
else {
|
||||||
$values_display[0] = $values[0];
|
$values_display[0] = $values[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// End date
|
// End date
|
||||||
$date = date_make_date($values[1], $db_tz, $field['sql_type']);
|
$date = date_make_date($values[1], $db_tz, $field['sql_type']);
|
||||||
if ($db_tz != $to_zone) {
|
if ($db_tz != $to_zone) {
|
||||||
|
@ -763,7 +762,7 @@ function calendar_build_nodes(&$view, &$items) {
|
||||||
else {
|
else {
|
||||||
$values_display[1] = $values[1];
|
$values_display[1] = $values[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now $values contain start and end date of a node,
|
// Now $values contain start and end date of a node,
|
||||||
// expressed as strings in the display (local) timezone.
|
// expressed as strings in the display (local) timezone.
|
||||||
// $values_utc does the same in UTC 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);
|
date_timezone_set($date, $display_timezone);
|
||||||
$max_zone_string[$display_timezone_name] = date_format($date, DATE_FORMAT_DATE);
|
$max_zone_string[$display_timezone_name] = date_format($date, DATE_FORMAT_DATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a node for each date within the field's date range,
|
// Create a node for each date within the field's date range,
|
||||||
// limited to the view's date range (regarding only day, not time).
|
// 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));
|
$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));
|
$to = min($max_zone_string[$display_timezone_name], substr($values_display[1], 0, 10));
|
||||||
$next = date_make_date($now, $display_timezone);
|
$next = date_make_date($now, $display_timezone);
|
||||||
|
|
||||||
if ($display_timezone_name != $to_zone) {
|
if ($display_timezone_name != $to_zone) {
|
||||||
// Make $start and $end (derived from $node) use the timezone $to_zone, just as $values[..] do
|
// Make $start and $end (derived from $node) use the timezone $to_zone, just as $values[..] do
|
||||||
date_timezone_set($next, timezone_open($to_zone));
|
date_timezone_set($next, timezone_open($to_zone));
|
||||||
|
@ -792,13 +791,13 @@ function calendar_build_nodes(&$view, &$items) {
|
||||||
if (empty($to)) {
|
if (empty($to)) {
|
||||||
$to = $now;
|
$to = $now;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $now and $next are midnight (in display timezone) on the first day where node will occur.
|
// $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.
|
// $to is midnight on the last day where node will occur.
|
||||||
// All three were limited by the min-max date range of the view.
|
// All three were limited by the min-max date range of the view.
|
||||||
while ($now <= $to) {
|
while ($now <= $to) {
|
||||||
$node = drupal_clone($item);
|
$node = drupal_clone($item);
|
||||||
|
|
||||||
// Make sure the pseudo node has the same properties a
|
// Make sure the pseudo node has the same properties a
|
||||||
// regular node would have.
|
// regular node would have.
|
||||||
if (isset($node->node_title) && !isset($node->title)) {
|
if (isset($node->node_title) && !isset($node->title)) {
|
||||||
|
@ -820,10 +819,10 @@ function calendar_build_nodes(&$view, &$items) {
|
||||||
$node->format_time = '';
|
$node->format_time = '';
|
||||||
}
|
}
|
||||||
$node->url = calendar_get_node_link($node);
|
$node->url = calendar_get_node_link($node);
|
||||||
|
|
||||||
//$node->$fromto[0] = $values[0];
|
//$node->$fromto[0] = $values[0];
|
||||||
//$node->$fromto[1] = $values[1];
|
//$node->$fromto[1] = $values[1];
|
||||||
|
|
||||||
// Flag which datefield this node is using, in case
|
// Flag which datefield this node is using, in case
|
||||||
// there are multiple date fields in the view.
|
// there are multiple date fields in the view.
|
||||||
$node->datefield = $alias;
|
$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_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));;
|
$node->date_end = date_create(!empty($values[1]) ? $values[1] : $values[0], timezone_open($to_zone));;
|
||||||
|
|
||||||
// Make date objects
|
// Make date objects
|
||||||
$node->calendar_start_date = date_create($node->calendar_start, timezone_open($to_zone));
|
$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));
|
$node->calendar_end_date = date_create($node->calendar_end, timezone_open($to_zone));
|
||||||
|
|
||||||
// Change string timezones into
|
// Change string timezones into
|
||||||
// calendar_start and calendar_end are UTC dates as formatted strings
|
// 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_start = date_format($node->calendar_start_date, DATE_FORMAT_DATETIME);
|
||||||
$node->calendar_end = date_format($node->calendar_end_date, DATE_FORMAT_DATETIME);
|
$node->calendar_end = date_format($node->calendar_end_date, DATE_FORMAT_DATETIME);
|
||||||
|
|
||||||
if (substr($real_field, 0, 6) == 'field_') {
|
if (substr($real_field, 0, 6) == 'field_') {
|
||||||
$cck_field = content_fields($cck_field_name);
|
$cck_field = content_fields($cck_field_name);
|
||||||
$granularity = is_array($cck_field['granularity']) ? end($cck_field['granularity']) : $cck_field['granularity'];
|
$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;
|
$increment = 1;
|
||||||
}
|
}
|
||||||
$node->calendar_all_day = $granularity == 'day' ? TRUE : date_is_all_day($node->calendar_start, $node->calendar_end, $granularity, $increment);
|
$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.
|
// Flag all day values specifically set in date.
|
||||||
$all_day_field = str_replace(array('_value2', '_value'), '_all_day', $node->datefield);
|
$all_day_field = str_replace(array('_value2', '_value'), '_all_day', $node->datefield);
|
||||||
if (!empty($all_day_field) && !empty($item->$all_day_field)) {
|
if (!empty($all_day_field) && !empty($item->$all_day_field)) {
|
||||||
$node->calendar_all_day = TRUE;
|
$node->calendar_all_day = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($node->calendar_fields);
|
unset($node->calendar_fields);
|
||||||
if (isset($node) && (empty($node->calendar_start))) {
|
if (isset($node) && (empty($node->calendar_start))) {
|
||||||
// if no date for the node and no date in the item
|
// if no date for the node and no date in the item
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-view-ical.tpl.php,v 1.1.2.5 2010/11/21 12:25:12 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* $calname
|
* $calname
|
||||||
* The name of the calendar.
|
* The name of the calendar.
|
||||||
|
@ -7,7 +6,7 @@
|
||||||
* The name of the site timezone.
|
* The name of the site timezone.
|
||||||
* $events
|
* $events
|
||||||
* An array with the following information about each event:
|
* An array with the following information about each event:
|
||||||
*
|
*
|
||||||
* $event['uid'] - a unique id for the event (usually the url).
|
* $event['uid'] - a unique id for the event (usually the url).
|
||||||
* $event['summary'] - the name of the event.
|
* $event['summary'] - the name of the event.
|
||||||
* $event['start'] - the formatted start date of the event.
|
* $event['start'] - the formatted start date of the event.
|
||||||
|
@ -17,10 +16,10 @@
|
||||||
* $event['url'] - the url for the event.
|
* $event['url'] - the url for the event.
|
||||||
* $event['location'] - the name of the event location.
|
* $event['location'] - the name of the event location.
|
||||||
* $event['description'] - a description of the event.
|
* $event['description'] - a description of the event.
|
||||||
*
|
*
|
||||||
* Note that there are empty spaces after RRULE, URL, LOCATION, etc
|
* Note that there are empty spaces after RRULE, URL, LOCATION, etc
|
||||||
* that are needed to make sure we get the required line break.
|
* 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
|
name = Calendar iCal
|
||||||
description = Adds ical functionality to Calendar views.
|
description = Adds ical functionality to Calendar views.
|
||||||
dependencies[] = views
|
dependencies[] = views
|
||||||
|
@ -14,4 +13,3 @@ version = "6.x-2.4"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "calendar"
|
project = "calendar"
|
||||||
datestamp = "1294072550"
|
datestamp = "1294072550"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar_ical.install,v 1.1.2.6 2010/02/28 14:23:48 karens Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
|
@ -13,7 +11,7 @@ function calendar_ical_install() {
|
||||||
*/
|
*/
|
||||||
function calendar_ical_uninstall() {
|
function calendar_ical_uninstall() {
|
||||||
$displays = array(
|
$displays = array(
|
||||||
'ical',
|
'ical',
|
||||||
);
|
);
|
||||||
db_query("DELETE FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')");
|
db_query("DELETE FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')");
|
||||||
db_query("DELETE FROM {cache_views}");
|
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.');
|
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar ical displays to use new handlers and ids.');
|
||||||
views_invalidate_cache();
|
views_invalidate_cache();
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar_ical.module,v 1.1.2.6 2008/11/24 15:48:15 karens Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_views_api().
|
* 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'))) {
|
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>';
|
return '<div style="text-align:right"><a href="'. check_url($url) .'" class="ical-icon" title="ical">'. $image .'</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?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
|
* Implementation of hook_views_plugins
|
||||||
*/
|
*/
|
||||||
|
@ -79,4 +77,4 @@ function calendar_ical_views_plugins() {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
//$Id: calendar_ical_admin.inc,v 1.1.2.2 2008/10/02 20:23:49 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Setup and admin functions.
|
* Setup and admin functions.
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
<?php
|
<?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.
|
* The plugin that handles a feed, such as RSS or atom.
|
||||||
*
|
*
|
||||||
* For the most part, feeds are page displays but with some subtle differences.
|
* For the most part, feeds are page displays but with some subtle differences.
|
||||||
*/
|
*/
|
||||||
class calendar_plugin_display_ical extends views_plugin_display_page {
|
class calendar_plugin_display_ical extends views_plugin_display_page {
|
||||||
|
|
||||||
function get_style_type() { return 'ical'; }
|
function get_style_type() { return 'ical'; }
|
||||||
|
|
||||||
function uses_breadcrumb() { return FALSE; }
|
function uses_breadcrumb() { return FALSE; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Feeds do not go through the normal page theming mechanism. Instead, they
|
* 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
|
* 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());
|
$plugin->attach_to($display_id, $this->get_path(), $clone->get_title());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display validation.
|
* Display validation.
|
||||||
*/
|
*/
|
||||||
function validate() {
|
function validate() {
|
||||||
$errors = parent::validate();
|
$errors = parent::validate();
|
||||||
|
|
||||||
$arguments = $this->display->handler->get_option('arguments');
|
$arguments = $this->display->handler->get_option('arguments');
|
||||||
$filters = $this->display->handler->get_option('filters');
|
$filters = $this->display->handler->get_option('filters');
|
||||||
|
|
||||||
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
|
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
|
||||||
if (empty($this->view->date_info->arg_missing)) {
|
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')) {
|
($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date')) {
|
||||||
if (empty($this->view->date_info->arg_missing_default)) {
|
if (empty($this->view->date_info->arg_missing_default)) {
|
||||||
$errors[] = calendar_errors('missing_argument_default');
|
$errors[] = calendar_errors('missing_argument_default');
|
||||||
|
@ -213,6 +212,5 @@ class calendar_plugin_display_ical extends views_plugin_display_page {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?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.
|
* 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'];
|
$fields = $display->handler->default_display->options['fields'];
|
||||||
$this->options['fields'] = $fields;
|
$this->options['fields'] = $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
function query() {
|
function query() {
|
||||||
// We need these values for the iCal feed.
|
// We need these values for the iCal feed.
|
||||||
$this->view->query->add_field('node', 'title');
|
$this->view->query->add_field('node', 'title');
|
||||||
$this->view->query->add_field('node', 'type');
|
$this->view->query->add_field('node', 'type');
|
||||||
parent::query();
|
parent::query();
|
||||||
}
|
}
|
||||||
|
|
||||||
function attach_to($display_id, $path, $title) {
|
function attach_to($display_id, $path, $title) {
|
||||||
$display = $this->view->display[$display_id]->handler;
|
$display = $this->view->display[$display_id]->handler;
|
||||||
$url_options = array();
|
$url_options = array();
|
||||||
|
@ -24,7 +23,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
||||||
if ($input) {
|
if ($input) {
|
||||||
$url_options['query'] = $input;
|
$url_options['query'] = $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO adjust this to pick up default values when no arg is set?
|
// TODO adjust this to pick up default values when no arg is set?
|
||||||
$url = url($this->view->get_url(NULL, $path), $url_options);
|
$url = url($this->view->get_url(NULL, $path), $url_options);
|
||||||
if (empty($this->view->feed_icon)) {
|
if (empty($this->view->feed_icon)) {
|
||||||
|
@ -50,14 +49,14 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
||||||
$options['location_field'] = '';
|
$options['location_field'] = '';
|
||||||
$options['fields'] = array();
|
$options['fields'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
function option_definition() {
|
function option_definition() {
|
||||||
$options = parent::option_definition();
|
$options = parent::option_definition();
|
||||||
|
|
||||||
$options['summary_field'] = array('default' => '', 'translatable' => TRUE);
|
$options['summary_field'] = array('default' => '', 'translatable' => TRUE);
|
||||||
$options['description_field'] = array('default' => '', 'translatable' => TRUE);
|
$options['description_field'] = array('default' => '', 'translatable' => TRUE);
|
||||||
$options['location_field'] = array('default' => '', 'translatable' => TRUE);
|
$options['location_field'] = array('default' => '', 'translatable' => TRUE);
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +67,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
||||||
$options[$field['field']] = $handler->ui_name();
|
$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['#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(
|
$form['summary_field'] = array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#title' => t('Title'),
|
'#title' => t('Title'),
|
||||||
|
@ -88,7 +87,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
||||||
'#default_value' => $this->options['location_field'],
|
'#default_value' => $this->options['location_field'],
|
||||||
'#options' => $options,
|
'#options' => $options,
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,30 +95,30 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
|
||||||
*/
|
*/
|
||||||
function validate() {
|
function validate() {
|
||||||
$errors = parent::validate();
|
$errors = parent::validate();
|
||||||
|
|
||||||
$style = $this->display->display_options['style_plugin'];
|
$style = $this->display->display_options['style_plugin'];
|
||||||
|
|
||||||
$arguments = $this->display->handler->get_option('arguments');
|
$arguments = $this->display->handler->get_option('arguments');
|
||||||
$filters = $this->display->handler->get_option('filters');
|
$filters = $this->display->handler->get_option('filters');
|
||||||
|
|
||||||
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
|
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
|
||||||
if (empty($this->view->date_info->arg_missing)) {
|
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;
|
$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')) {
|
($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date')) {
|
||||||
if (empty($this->view->date_info->arg_missing_default)) {
|
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;
|
$this->view->date_info->arg_missing_default = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->options['summary_field'])) {
|
if (empty($this->options['summary_field'])) {
|
||||||
$errors[] = $errors[$style] = t("The @style style requires a Title field for the iCal export.", array('@style' => $style));
|
$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.
|
// in the calendar style.
|
||||||
if ($style == 'calendar_style') {
|
if ($style == 'calendar_style') {
|
||||||
$view_fields = date_api_fields($this->view->base_table);
|
$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;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
|
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
|
||||||
|
|
||||||
// Transfer the style options to the view object so they
|
// Transfer the style options to the view object so they
|
||||||
// can be easily accessed in the theme.
|
// can be easily accessed in the theme.
|
||||||
$style_options = $this->options;
|
$style_options = $this->options;
|
||||||
$this->view->date_info->summary_field = $style_options['summary_field'];
|
$this->view->date_info->summary_field = $style_options['summary_field'];
|
||||||
$this->view->date_info->description_field = $style_options['description_field'];
|
$this->view->date_info->description_field = $style_options['description_field'];
|
||||||
$this->view->date_info->location_field = $style_options['location_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.
|
// calendar display we need to create.
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($this->view->argument as $id => $argument) {
|
foreach ($this->view->argument as $id => $argument) {
|
||||||
if ($argument->field == 'date_argument') {
|
if ($argument->field == 'date_argument') {
|
||||||
// TODO Decide if we want to provide a date here or not.
|
// 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->week = isset($argument->week) ? $argument->week : NULL;
|
||||||
$this->view->date_info->min_date = $argument->min_date;
|
$this->view->date_info->min_date = $argument->min_date;
|
||||||
$this->view->date_info->max_date = $argument->max_date;
|
$this->view->date_info->max_date = $argument->max_date;
|
||||||
|
|
||||||
// Stop after the first date argument, if there is more than one.
|
// Stop after the first date argument, if there is more than one.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The ical display might have date filters instead of arguments.
|
// The ical display might have date filters instead of arguments.
|
||||||
// If we missed getting a min date from date arguments, try date filters.
|
// If we missed getting a min date from date arguments, try date filters.
|
||||||
if (empty($this->view->date_info->min_date)) {
|
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();
|
||||||
}
|
}
|
||||||
$this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, array_keys($filter->options['date_fields']));
|
$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.
|
// Stop after the first date filter, if there is more than one.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render each field into an output array.
|
// Render each field into an output array.
|
||||||
$items = array();
|
$items = array();
|
||||||
$calendar_fields = date_api_fields($this->view->base_table);
|
$calendar_fields = date_api_fields($this->view->base_table);
|
||||||
$calendar_fields = array_keys($calendar_fields['alias']);
|
$calendar_fields = array_keys($calendar_fields['alias']);
|
||||||
|
|
||||||
foreach ($this->view->result as $num => $row) {
|
foreach ($this->view->result as $num => $row) {
|
||||||
$items[$num] = $row;
|
$items[$num] = $row;
|
||||||
// Store the raw date values before formatting the results.
|
// 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) {
|
foreach ($this->view->field as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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)) {
|
if (!empty($field) && is_object($field)) {
|
||||||
$field_output = $field->theme($row);
|
$field_output = $field->theme($row);
|
||||||
$items[$num]->{$field_alias} = $field_output;
|
$items[$num]->{$field_alias} = $field_output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Massage the resulting items into formatted calendar items.
|
// Massage the resulting items into formatted calendar items.
|
||||||
$items = calendar_build_nodes($this->view, $items);
|
$items = calendar_build_nodes($this->view, $items);
|
||||||
|
|
||||||
// Merge in items from other sources.
|
// Merge in items from other sources.
|
||||||
foreach (module_implements('calendar_add_items') as $module) {
|
foreach (module_implements('calendar_add_items') as $module) {
|
||||||
$function = $module .'_calendar_add_items';
|
$function = $module .'_calendar_add_items';
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: theme.inc,v 1.1.2.15 2010/11/21 11:00:56 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* Preprocess an ical feed
|
* Preprocess an ical feed
|
||||||
*/
|
*/
|
||||||
function template_preprocess_calendar_view_ical(&$vars) {
|
function template_preprocess_calendar_view_ical(&$vars) {
|
||||||
global $base_url;
|
global $base_url;
|
||||||
global $language;
|
global $language;
|
||||||
|
|
||||||
$view = &$vars['view'];
|
$view = &$vars['view'];
|
||||||
$options = &$vars['options'];
|
$options = &$vars['options'];
|
||||||
$items = &$vars['rows'];
|
$items = &$vars['rows'];
|
||||||
|
|
||||||
$style = &$view->style_plugin;
|
$style = &$view->style_plugin;
|
||||||
|
|
||||||
// Figure out which display which has a path we're using for this feed. If there isn't
|
// 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.
|
// Keep devel module from appending queries to ical export.
|
||||||
$GLOBALS['devel_shutdown'] = FALSE;
|
$GLOBALS['devel_shutdown'] = FALSE;
|
||||||
|
|
||||||
drupal_set_header('Content-Type: text/calendar; charset=utf-8');
|
drupal_set_header('Content-Type: text/calendar; charset=utf-8');
|
||||||
drupal_set_header('Content-Disposition: attachment; filename="calendar.ics"; ');
|
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') .'/date_api_ical.inc');
|
||||||
require_once('./'. drupal_get_path('module', 'date_api') .'/theme/theme.inc');
|
require_once('./'. drupal_get_path('module', 'date_api') .'/theme/theme.inc');
|
||||||
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
|
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
|
||||||
|
|
||||||
$events = array();
|
$events = array();
|
||||||
// Get the alias name for each of our data fields.
|
// Get the alias name for each of our data fields.
|
||||||
foreach ($view->field as $name => $field) {
|
foreach ($view->field as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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) {
|
foreach (array('summary_field', 'description_field', 'location_field') as $data) {
|
||||||
if ($field->field == $view->date_info->$data) {
|
if ($field->field == $view->date_info->$data) {
|
||||||
$$data = $field_alias;
|
$$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['start'], timezone_open('UTC'));
|
||||||
date_timezone_set($event['end'], timezone_open('UTC'));
|
date_timezone_set($event['end'], timezone_open('UTC'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$headertitle = filter_xss_admin($view->get_title());
|
$headertitle = filter_xss_admin($view->get_title());
|
||||||
$title = variable_get('site_name', 'Drupal');
|
$title = variable_get('site_name', 'Drupal');
|
||||||
$description = $headertitle . ($title ? ' | '. $title : '');
|
$description = $headertitle . ($title ? ' | '. $title : '');
|
||||||
|
|
||||||
$vars['calname'] = $description;
|
$vars['calname'] = $description;
|
||||||
$vars['events'] = $events;
|
$vars['events'] = $events;
|
||||||
template_preprocess_date_vcalendar($vars);
|
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
|
name = Calendar Multiday
|
||||||
description = "Use the calendar multiday display as an alternative to the standard display. (BETA version)"
|
description = "Use the calendar multiday display as an alternative to the standard display. (BETA version)"
|
||||||
dependencies[] = calendar
|
dependencies[] = calendar
|
||||||
|
@ -12,4 +11,3 @@ version = "6.x-2.4"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "calendar"
|
project = "calendar"
|
||||||
datestamp = "1294072550"
|
datestamp = "1294072550"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar_multiday.module,v 1.1.2.2 2010/12/31 16:25:43 karens Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_views_api().
|
* Implementation of hook_views_api().
|
||||||
*
|
*
|
||||||
|
@ -81,10 +79,10 @@ function calendar_multiday_theme() {
|
||||||
'calendar_month_col' => $base + array(
|
'calendar_month_col' => $base + array(
|
||||||
'template' => 'calendar-month-col',
|
'template' => 'calendar-month-col',
|
||||||
'arguments' => array('item' => NULL),
|
'arguments' => array('item' => NULL),
|
||||||
),
|
),
|
||||||
'calendar_month_row' => $base + array(
|
'calendar_month_row' => $base + array(
|
||||||
'template' => 'calendar-month-row',
|
'template' => 'calendar-month-row',
|
||||||
'arguments' => array('inner' => NULL, 'class' => NULL, 'iehint' => NULL),
|
'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.
|
* 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() {
|
$('.header-body-divider:not(.header-body-divider-processed)').each(function() {
|
||||||
var divider = $(this).addClass('header-body-divider-processed');
|
var divider = $(this).addClass('header-body-divider-processed');
|
||||||
var start_y = divider.offset().top;
|
var start_y = divider.offset().top;
|
||||||
|
|
||||||
// Add the grippie icon
|
// Add the grippie icon
|
||||||
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
|
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
|
||||||
|
|
||||||
function startDrag(e) {
|
function startDrag(e) {
|
||||||
start_y = divider.offset().top;
|
start_y = divider.offset().top;
|
||||||
$(document).mousemove(performDrag).mouseup(endDrag);
|
$(document).mousemove(performDrag).mouseup(endDrag);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function performDrag(e) {
|
function performDrag(e) {
|
||||||
var offset = e.pageY - start_y;
|
var offset = e.pageY - start_y;
|
||||||
var mwc = $('#multi-day-container');
|
var mwc = $('#multi-day-container');
|
||||||
|
@ -25,25 +24,25 @@ Drupal.behaviors.calendarSetScroll = function (context) {
|
||||||
start_y = divider.offset().top;
|
start_y = divider.offset().top;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function endDrag(e) {
|
function endDrag(e) {
|
||||||
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
|
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.single-day-footer:not(.single-day-footer-processed)').each(function() {
|
$('.single-day-footer:not(.single-day-footer-processed)').each(function() {
|
||||||
var divider = $(this).addClass('single-day-footer-processed');
|
var divider = $(this).addClass('single-day-footer-processed');
|
||||||
var start_y = divider.offset().top;
|
var start_y = divider.offset().top;
|
||||||
|
|
||||||
// Add the grippie icon
|
// Add the grippie icon
|
||||||
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
|
$(this).prepend('<div class="grippie"></div>').mousedown(startDrag);
|
||||||
|
|
||||||
function startDrag(e) {
|
function startDrag(e) {
|
||||||
start_y = divider.offset().top;
|
start_y = divider.offset().top;
|
||||||
$(document).mousemove(performDrag).mouseup(endDrag);
|
$(document).mousemove(performDrag).mouseup(endDrag);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function performDrag(e) {
|
function performDrag(e) {
|
||||||
var offset = e.pageY - start_y;
|
var offset = e.pageY - start_y;
|
||||||
var sdc = $('#single-day-container');
|
var sdc = $('#single-day-container');
|
||||||
|
@ -51,12 +50,12 @@ Drupal.behaviors.calendarSetScroll = function (context) {
|
||||||
start_y = divider.offset().top;
|
start_y = divider.offset().top;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function endDrag(e) {
|
function endDrag(e) {
|
||||||
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
|
$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Size the window
|
// Size the window
|
||||||
calendar_resizeViewport();
|
calendar_resizeViewport();
|
||||||
}
|
}
|
||||||
|
@ -69,14 +68,13 @@ function calendar_scrollToFirst() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Size the single day view
|
// Size the single day view
|
||||||
function calendar_resizeViewport() {
|
function calendar_resizeViewport() {
|
||||||
// Size of the browser window
|
// Size of the browser window
|
||||||
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
|
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
|
||||||
var top = $('#single-day-container').offset().top;
|
var top = $('#single-day-container').offset().top;
|
||||||
|
|
||||||
$('#multi-day-container').height(75);
|
$('#multi-day-container').height(75);
|
||||||
// Give it a 20 pixel margin at the bottom
|
// Give it a 20 pixel margin at the bottom
|
||||||
$('#single-day-container').height(Math.max(400,viewportHeight - top - 20));
|
$('#single-day-container').height(Math.max(400,viewportHeight - top - 20));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
//$Id: calendar.inc,v 1.1.2.4 2011/01/02 00:00:56 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* Build calendar
|
* Build calendar
|
||||||
*
|
*
|
||||||
|
@ -23,10 +22,10 @@ function calendar_build_calendar($view, $items) {
|
||||||
}
|
}
|
||||||
$items = $values;
|
$items = $values;
|
||||||
ksort($items);
|
ksort($items);
|
||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$curday = drupal_clone($view->date_info->min_date);
|
$curday = drupal_clone($view->date_info->min_date);
|
||||||
|
|
||||||
switch ($view->date_info->granularity) {
|
switch ($view->date_info->granularity) {
|
||||||
case 'year':
|
case 'year':
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
@ -49,7 +48,7 @@ function calendar_build_calendar($view, $items) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Build one month.
|
* Build one month.
|
||||||
|
@ -85,20 +84,20 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
$week_rows = calendar_build_week($curday, $view, $items, TRUE);
|
$week_rows = calendar_build_week($curday, $view, $items, TRUE);
|
||||||
$multiday_buckets = $week_rows['multiday_buckets'];
|
$multiday_buckets = $week_rows['multiday_buckets'];
|
||||||
$singleday_buckets = $week_rows['singleday_buckets'];
|
$singleday_buckets = $week_rows['singleday_buckets'];
|
||||||
|
|
||||||
$total_rows = $week_rows['total_rows'];
|
$total_rows = $week_rows['total_rows'];
|
||||||
|
|
||||||
// Theme each row
|
// Theme each row
|
||||||
$output = "";
|
$output = "";
|
||||||
$final_day = clone($curday);
|
$final_day = clone($curday);
|
||||||
|
|
||||||
$iehint = 0;
|
$iehint = 0;
|
||||||
$max_multirow_cnt = 0;
|
$max_multirow_cnt = 0;
|
||||||
$max_singlerow_cnt = 0;
|
$max_singlerow_cnt = 0;
|
||||||
|
|
||||||
for ($i = 0; $i < $total_rows + 1; $i++) {
|
for ($i = 0; $i < $total_rows + 1; $i++) {
|
||||||
$inner = "";
|
$inner = "";
|
||||||
|
|
||||||
// If we're displaying the week number, add it as the
|
// If we're displaying the week number, add it as the
|
||||||
// first cell in the week.
|
// first cell in the week.
|
||||||
if ($i == 0 && !empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', '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,
|
'entry' => $weekno,
|
||||||
'colspan' => 1,
|
'colspan' => 1,
|
||||||
'rowspan' => $total_rows + 1,
|
'rowspan' => $total_rows + 1,
|
||||||
'id' => $view->name . '-weekno-' . $curday_date,
|
'id' => $view->name . '-weekno-' . $curday_date,
|
||||||
'class' => 'week'
|
'class' => 'week'
|
||||||
);
|
);
|
||||||
$inner .= theme('calendar_month_col', $item);
|
$inner .= theme('calendar_month_col', $item);
|
||||||
}
|
}
|
||||||
|
|
||||||
$curday = clone($init_day);
|
$curday = clone($init_day);
|
||||||
|
|
||||||
// move backwards to the first day of the week
|
// move backwards to the first day of the week
|
||||||
$day_wday = date_format($curday, 'w');
|
$day_wday = date_format($curday, 'w');
|
||||||
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
||||||
|
|
||||||
for ( $wday = 0; $wday < 7; $wday++) {
|
for ( $wday = 0; $wday < 7; $wday++) {
|
||||||
|
|
||||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||||
$class = strtolower($weekdays[$wday]);
|
$class = strtolower($weekdays[$wday]);
|
||||||
$item = NULL;
|
$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);
|
$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
|
// Add the datebox
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
$count = $in_month ? intval(count($multiday_buckets[$wday]) + count($singleday_buckets[$wday])) : FALSE;
|
$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 {
|
else {
|
||||||
$index = $i - 1;
|
$index = $i - 1;
|
||||||
$multi_count = count($multiday_buckets[$wday]);
|
$multi_count = count($multiday_buckets[$wday]);
|
||||||
|
|
||||||
// Process multiday buckets first. If there is a multiday-bucket item in this row...
|
// Process multiday buckets first. If there is a multiday-bucket item in this row...
|
||||||
if ($index < $multi_count) {
|
if ($index < $multi_count) {
|
||||||
|
|
||||||
// If this item is filled with either a blank or an entry...
|
// If this item is filled with either a blank or an entry...
|
||||||
if ($multiday_buckets[$wday][$index]['filled']) {
|
if ($multiday_buckets[$wday][$index]['filled']) {
|
||||||
|
|
||||||
// Add item and add class
|
// Add item and add class
|
||||||
$item = $multiday_buckets[$wday][$index];
|
$item = $multiday_buckets[$wday][$index];
|
||||||
$item['class'] = 'multi-day';
|
$item['class'] = 'multi-day';
|
||||||
$item['date'] = $curday_date;
|
$item['date'] = $curday_date;
|
||||||
|
|
||||||
// Is this an entry?
|
// Is this an entry?
|
||||||
if (!$multiday_buckets[$wday][$index]['avail']) {
|
if (!$multiday_buckets[$wday][$index]['avail']) {
|
||||||
|
|
||||||
// If the item either starts or ends on today,
|
// If the item either starts or ends on today,
|
||||||
// then add tags so we can style the borders
|
// then add tags so we can style the borders
|
||||||
if ($curday_date == $today && $in_month) {
|
if ($curday_date == $today && $in_month) {
|
||||||
$item['class'] .= ' starts-today';
|
$item['class'] .= ' starts-today';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate on which day of this week this item ends on..
|
// Calculate on which day of this week this item ends on..
|
||||||
$end_day = clone($curday);
|
$end_day = clone($curday);
|
||||||
$span = $item['colspan'] - 1;
|
$span = $item['colspan'] - 1;
|
||||||
date_modify($end_day, '+' . $span .' day');
|
date_modify($end_day, '+' . $span .' day');
|
||||||
$endday_date = date_format($end_day, DATE_FORMAT_DATE);
|
$endday_date = date_format($end_day, DATE_FORMAT_DATE);
|
||||||
|
|
||||||
// If it ends today, add class
|
// If it ends today, add class
|
||||||
if ($endday_date == $today && $in_month) {
|
if ($endday_date == $today && $in_month) {
|
||||||
$item['class'] .= ' ends-today';
|
$item['class'] .= ' ends-today';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is an acutal entry, add classes regarding the state of the
|
// If this is an acutal entry, add classes regarding the state of the
|
||||||
// item
|
// item
|
||||||
if ($multiday_buckets[$wday][$index]['avail']) {
|
if ($multiday_buckets[$wday][$index]['avail']) {
|
||||||
|
@ -192,11 +191,11 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
($curday_date < $today ? ' past' : '') .
|
($curday_date < $today ? ' past' : '') .
|
||||||
($curday_date > $today ? ' future' : '');
|
($curday_date > $today ? ' future' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Else, process the single day bucket - we only do this once per day
|
// Else, process the single day bucket - we only do this once per day
|
||||||
}
|
}
|
||||||
elseif ($index == $multi_count) {
|
elseif ($index == $multi_count) {
|
||||||
|
|
||||||
$single_day_cnt = 0;
|
$single_day_cnt = 0;
|
||||||
// If it's empty, add class
|
// If it's empty, add class
|
||||||
if (count($singleday_buckets[$wday]) == 0) {
|
if (count($singleday_buckets[$wday]) == 0) {
|
||||||
|
@ -218,9 +217,9 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
}
|
}
|
||||||
$class = 'single-day';
|
$class = 'single-day';
|
||||||
}
|
}
|
||||||
|
|
||||||
$rowspan = $total_rows - $index;
|
$rowspan = $total_rows - $index;
|
||||||
|
|
||||||
// Add item...
|
// Add item...
|
||||||
$item = array(
|
$item = array(
|
||||||
'entry' => $single_days,
|
'entry' => $single_days,
|
||||||
|
@ -230,7 +229,7 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
'date' => $curday_date,
|
'date' => $curday_date,
|
||||||
'id' => $view->name . '-' . $curday_date . '-' . $index
|
'id' => $view->name . '-' . $curday_date . '-' . $index
|
||||||
);
|
);
|
||||||
|
|
||||||
// Hack for ie to help it properly space single day rows
|
// Hack for ie to help it properly space single day rows
|
||||||
if ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
|
if ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
|
||||||
$max_multirow_cnt = max($max_multirow_cnt, $single_day_cnt);
|
$max_multirow_cnt = max($max_multirow_cnt, $single_day_cnt);
|
||||||
|
@ -238,7 +237,7 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
else {
|
else {
|
||||||
$max_singlerow_cnt = max($max_singlerow_cnt, $single_day_cnt);
|
$max_singlerow_cnt = max($max_singlerow_cnt, $single_day_cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the singlerow is bigger than the multi-row, then null out
|
// 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
|
// 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
|
// 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) {
|
elseif ($rowspan > 1 && $in_month && $single_day_cnt > 0) {
|
||||||
$iehint = max($iehint, $rowspan - 1); // How many rows to adjust for?
|
$iehint = max($iehint, $rowspan - 1); // How many rows to adjust for?
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the class
|
// Set the class
|
||||||
$item['class'] .= ($curday_date == $today && $in_month ? ' today' : '') .
|
$item['class'] .= ($curday_date == $today && $in_month ? ' today' : '') .
|
||||||
($curday_date < $today ? ' past' : '') .
|
($curday_date < $today ? ' past' : '') .
|
||||||
($curday_date > $today ? ' future' : '');
|
($curday_date > $today ? ' future' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there isn't an item, then add empty class
|
// If there isn't an item, then add empty class
|
||||||
if ($item != NULL) {
|
if ($item != NULL) {
|
||||||
if (!$in_month) {
|
if (!$in_month) {
|
||||||
|
@ -264,10 +263,10 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
// Style this entry - it will be a <td>.
|
// Style this entry - it will be a <td>.
|
||||||
$inner .= theme('calendar_month_col', $item);
|
$inner .= theme('calendar_month_col', $item);
|
||||||
}
|
}
|
||||||
|
|
||||||
date_modify($curday, '+1 day');
|
date_modify($curday, '+1 day');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
$output .= theme('calendar_month_row', $inner, 'date-box', $iehint);
|
$output .= theme('calendar_month_row', $inner, 'date-box', $iehint);
|
||||||
}
|
}
|
||||||
|
@ -283,14 +282,14 @@ function calendar_build_month(&$curday, $view, $items) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$curday = $final_day;
|
$curday = $final_day;
|
||||||
|
|
||||||
// Add the row into the row array....
|
// Add the row into the row array....
|
||||||
$rows[] = array('data' => $output);
|
$rows[] = array('data' => $output);
|
||||||
|
|
||||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||||
$curday_month = date_format($curday, 'n');
|
$curday_month = date_format($curday, 'n');
|
||||||
} while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);
|
} while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);
|
||||||
|
|
||||||
// Merge the day names in as the first row.
|
// Merge the day names in as the first row.
|
||||||
$rows = array_merge(array(calendar_week_header($view)), $rows);
|
$rows = array_merge(array(calendar_week_header($view)), $rows);
|
||||||
return $rows;
|
return $rows;
|
||||||
|
@ -309,7 +308,7 @@ function calendar_build_mini_week(&$curday, $view, $items, $check_month = FALSE)
|
||||||
$day_wday = date_format($curday, 'w');
|
$day_wday = date_format($curday, 'w');
|
||||||
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
||||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||||
|
|
||||||
// If we're displaying the week number, add it as the
|
// If we're displaying the week number, add it as the
|
||||||
// first cell in the week.
|
// first cell in the week.
|
||||||
if (!empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', '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(
|
$rows[$week][] = array(
|
||||||
'data' => $weekno,
|
'data' => $weekno,
|
||||||
'id' => $view->name . '-weekno-' . $curday_date,
|
'id' => $view->name . '-weekno-' . $curday_date,
|
||||||
'class' => 'week');
|
'class' => 'week');
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < 7; $i++) {
|
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' : '') .
|
($curday_date > $today ? ' future' : '') .
|
||||||
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
|
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$week][] = array(
|
$rows[$week][] = array(
|
||||||
'data' => $content,
|
'data' => $content,
|
||||||
'class' => $class, 'id' => $view->name . '-' . $curday_date);
|
'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);
|
$weekdays = calendar_untranslated_days($items, $view);
|
||||||
$month = date_format($curday, 'n');
|
$month = date_format($curday, 'n');
|
||||||
$first_day = variable_get('date_first_day', 0);
|
$first_day = variable_get('date_first_day', 0);
|
||||||
|
|
||||||
// Set up buckets
|
// Set up buckets
|
||||||
$total_rows = 0;
|
$total_rows = 0;
|
||||||
$multiday_buckets = array( array(), array(), array(), array(), array(), array(), array());
|
$multiday_buckets = array( array(), array(), array(), array(), array(), array(), array());
|
||||||
$singleday_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
|
// move backwards to the first day of the week
|
||||||
$day_wday = date_format($curday, 'w');
|
$day_wday = date_format($curday, 'w');
|
||||||
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
||||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||||
|
|
||||||
for ($i = 0; $i < 7; $i++) {
|
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)) {
|
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';
|
$class = strtolower($weekdays[$i]) .' empty';
|
||||||
|
@ -389,7 +388,7 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
||||||
date_modify($curday, '+1 day');
|
date_modify($curday, '+1 day');
|
||||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows = array(
|
$rows = array(
|
||||||
'multiday_buckets' => $multiday_buckets,
|
'multiday_buckets' => $multiday_buckets,
|
||||||
'singleday_buckets' => $singleday_buckets,
|
'singleday_buckets' => $singleday_buckets,
|
||||||
|
@ -407,7 +406,7 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
||||||
$cur_cnt = 0;
|
$cur_cnt = 0;
|
||||||
$total_cnt = 0;
|
$total_cnt = 0;
|
||||||
$types = array();
|
$types = array();
|
||||||
|
|
||||||
// If we are hiding, count before processing further
|
// If we are hiding, count before processing further
|
||||||
if ($max_events != CALENDAR_SHOW_ALL) {
|
if ($max_events != CALENDAR_SHOW_ALL) {
|
||||||
foreach ($items as $date => $day) {
|
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 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) {
|
if ($max_events == CALENDAR_SHOW_ALL || !$hide || $total_cnt <= $max_events) {
|
||||||
// Count currently filled items
|
// Count currently filled items
|
||||||
|
@ -430,7 +429,7 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
||||||
$cur_cnt++;
|
$cur_cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($items as $date => $day) {
|
foreach ($items as $date => $day) {
|
||||||
if ($date == $curday_date) {
|
if ($date == $curday_date) {
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
@ -438,38 +437,38 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
||||||
foreach ($day as $time => $hour) {
|
foreach ($day as $time => $hour) {
|
||||||
foreach ($hour as $key => $item) {
|
foreach ($hour as $key => $item) {
|
||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
// Can we add an item?
|
// Can we add an item?
|
||||||
if ($max_events == CALENDAR_SHOW_ALL || $cur_cnt <= $max_events) {
|
if ($max_events == CALENDAR_SHOW_ALL || $cur_cnt <= $max_events) {
|
||||||
$all_day = $item->calendar_start_date == $item->calendar_end_date;
|
$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';
|
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
|
||||||
|
|
||||||
// Parse out date part
|
// Parse out date part
|
||||||
$start_ydate = date_format($item->date_start, DATE_FORMAT_DATE);
|
$start_ydate = date_format($item->date_start, DATE_FORMAT_DATE);
|
||||||
$end_ydate = date_format($item->date_end, DATE_FORMAT_DATE);
|
$end_ydate = date_format($item->date_end, DATE_FORMAT_DATE);
|
||||||
$cur_ydate = date_format($curday, DATE_FORMAT_DATE);
|
$cur_ydate = date_format($curday, DATE_FORMAT_DATE);
|
||||||
|
|
||||||
$is_multi_day = ($start_ydate < $cur_ydate || $end_ydate > $cur_ydate);
|
$is_multi_day = ($start_ydate < $cur_ydate || $end_ydate > $cur_ydate);
|
||||||
|
|
||||||
// Does this event span multi-days?
|
// Does this event span multi-days?
|
||||||
if ($multiday_theme && ($is_multi_day || $all_day)) {
|
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,
|
// 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
|
// then record this item, otherwise skip over
|
||||||
$day_no = date_format($curday, 'd');
|
$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)) {
|
if ($wday == 0 || $start_ydate == $cur_ydate || ($view->date_info->granularity == 'month' && $day_no == 1) || ($all_day && !$is_multi_day)) {
|
||||||
$cur_cnt++;
|
$cur_cnt++;
|
||||||
|
|
||||||
// Calculate the colspan for this event
|
// Calculate the colspan for this event
|
||||||
|
|
||||||
// If the last day of this event exceeds the end of the current month or week,
|
// If the last day of this event exceeds the end of the current month or week,
|
||||||
// truncate the remaining days
|
// truncate the remaining days
|
||||||
$diff = date_difference($view->date_info->max_date, $curday, '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
|
// The bucket_cnt defines the colspan. colspan = bucket_cnt + 1
|
||||||
$days = date_difference($curday, $item->date_end, 'days');
|
$days = date_difference($curday, $item->date_end, 'days');
|
||||||
$bucket_cnt = max(0, min($days, $remaining_days));
|
$bucket_cnt = max(0, min($days, $remaining_days));
|
||||||
|
|
||||||
// See if there is an avaiable slot to add an event. This will allow
|
// 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
|
// an event to precede a row filled up by a previous day event
|
||||||
$avail = FALSE;
|
$avail = FALSE;
|
||||||
|
@ -480,11 +479,11 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add continuation attributes
|
// Add continuation attributes
|
||||||
$item->continuation = ($item->date_start < $curday);
|
$item->continuation = ($item->date_start < $curday);
|
||||||
$item->continues = ( $days > $bucket_cnt );
|
$item->continues = ( $days > $bucket_cnt );
|
||||||
|
|
||||||
// Assign the item to the available bucket
|
// Assign the item to the available bucket
|
||||||
$multiday_buckets[$wday][$bucket_index] = array(
|
$multiday_buckets[$wday][$bucket_index] = array(
|
||||||
'colspan' => $bucket_cnt + 1,
|
'colspan' => $bucket_cnt + 1,
|
||||||
|
@ -496,13 +495,13 @@ function calendar_build_week_day($curday, $view, $items, $wday, &$multiday_bucke
|
||||||
'wday' => $wday,
|
'wday' => $wday,
|
||||||
'entry' => theme($theme, $item, $view)
|
'entry' => theme($theme, $item, $view)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Block out empty buckets for the next days in this event for this week
|
// Block out empty buckets for the next days in this event for this week
|
||||||
for ($i = 0; $i < $bucket_cnt; $i++) {
|
for ($i = 0; $i < $bucket_cnt; $i++) {
|
||||||
$bucket = &$multiday_buckets[$i + $wday + 1];
|
$bucket = &$multiday_buckets[$i + $wday + 1];
|
||||||
$bucket_row_count = count($bucket);
|
$bucket_row_count = count($bucket);
|
||||||
$row_diff = $bucket_index - $bucket_row_count;
|
$row_diff = $bucket_index - $bucket_row_count;
|
||||||
|
|
||||||
// Fill up the preceding buckets - these are available for future
|
// Fill up the preceding buckets - these are available for future
|
||||||
// events
|
// events
|
||||||
for ( $j = 0; $j < $row_diff; $j++) {
|
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
|
// Add a more link if necessary
|
||||||
if ($max_events != CALENDAR_SHOW_ALL && $total_cnt > 0 && $cur_cnt < $total_cnt) {
|
if ($max_events != CALENDAR_SHOW_ALL && $total_cnt > 0 && $cur_cnt < $total_cnt) {
|
||||||
$singleday_buckets[$wday][][] = array(
|
$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);
|
$link = theme('calendar_'. $view->date_info->calendar_type .'_multiple_node', $curday_date, $count, $view, $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = array(
|
$content = array(
|
||||||
'date' => $curday_date,
|
'date' => $curday_date,
|
||||||
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
|
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?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.
|
* Template to display the date box in a calendar.
|
||||||
*
|
*
|
||||||
* - $view: The view.
|
* - $view: The view.
|
||||||
|
@ -16,4 +15,4 @@
|
||||||
* - $items: An array of items for this day.
|
* - $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
|
<?php
|
||||||
// $Id: calendar-day-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view item as a calendar day node.
|
* Template to display a view item as a calendar day node.
|
||||||
*
|
*
|
||||||
* $node
|
* $node
|
||||||
* A node object for this calendar item. Note this is
|
* A node object for this calendar item. Note this is
|
||||||
* not a complete node object, but it will have $node->nid
|
* not a complete node object, but it will have $node->nid
|
||||||
* that you can use to load the full object, and
|
* that you can use to load the full object, and
|
||||||
* $node->type to tell the content type of the node.
|
* $node->type to tell the content type of the node.
|
||||||
*
|
*
|
||||||
* $fields
|
* $fields
|
||||||
* An array of information for every field selected in the 'Fields'
|
* An array of information for every field selected in the 'Fields'
|
||||||
* section of this view, formatted as requested in the View setup.
|
* section of this view, formatted as requested in the View setup.
|
||||||
*
|
*
|
||||||
* Calendar info for this individual calendar item is in local time --
|
* Calendar info for this individual calendar item is in local time --
|
||||||
* the user timezone where configurable timezones are allowed and set,
|
* the user timezone where configurable timezones are allowed and set,
|
||||||
* otherwise the site timezone. If this item has extends over more than
|
* 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
|
* 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
|
* the current day and calendar_end will be no later than the end
|
||||||
* of the current day.
|
* of the current day.
|
||||||
*
|
*
|
||||||
* $calendar_start - A formatted datetime start date for this item.
|
* $calendar_start - A formatted datetime start date for this item.
|
||||||
* i.e. '2008-05-12 05:26:15'.
|
* i.e. '2008-05-12 05:26:15'.
|
||||||
* $calendar_end - A formatted datetime end date for this item,
|
* $calendar_end - A formatted datetime end date for this item,
|
||||||
* the same as the start date except for fields that have from/to
|
* 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_start_date - a PHP date object for the start time.
|
||||||
* $calendar_end_date - a PHP date object for the end 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
|
* You can use PHP date functions on the date object to display date
|
||||||
* information in other ways, like:
|
* information in other ways, like:
|
||||||
*
|
*
|
||||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_day_node.
|
* @see template_preprocess_calendar_day_node.
|
||||||
*/
|
*/
|
||||||
$node_class = (isset($node->class)) ? ' ' . $node->class : '';
|
$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'] ?>">
|
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
||||||
<?php if ($field['label']): ?>
|
<?php if ($field['label']): ?>
|
||||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php print $field['data']; ?>
|
<?php print $field['data']; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-day-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar day, grouped by time with overlapping items
|
* Template to display a view as a calendar day, grouped by time with overlapping items
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_day.
|
* @see template_preprocess_calendar_day.
|
||||||
*
|
*
|
||||||
* $rows: The rendered data for this day.
|
* $rows: The rendered data for this day.
|
||||||
|
@ -14,17 +13,17 @@
|
||||||
* $rows['items'] - an array of timed items for the day.
|
* $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]['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]['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.
|
* items for a time period and field column.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $columns: an array of column names.
|
* $columns: an array of column names.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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
|
* 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.
|
* evenly over the remaining 90% of the table.
|
||||||
*/
|
*/
|
||||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
//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]) : ' ';?>
|
<?php print isset($rows['all_day'][$column]) ? implode($rows['all_day'][$column]) : ' ';?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -60,8 +59,8 @@
|
||||||
try {
|
try {
|
||||||
// Hide container while it renders... Degrade w/o javascript support
|
// Hide container while it renders... Degrade w/o javascript support
|
||||||
$('#single-day-container').css('visibility','hidden');
|
$('#single-day-container').css('visibility','hidden');
|
||||||
}catch(e){
|
}catch(e){
|
||||||
// swallow
|
// swallow
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<table class="full">
|
<table class="full">
|
||||||
|
@ -74,7 +73,7 @@
|
||||||
<td class="first">
|
<td class="first">
|
||||||
<?php $is_first = TRUE; ?>
|
<?php $is_first = TRUE; ?>
|
||||||
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
|
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
|
||||||
<?php
|
<?php
|
||||||
if ($time_cnt == 0) {
|
if ($time_cnt == 0) {
|
||||||
$class = 'first ';
|
$class = 'first ';
|
||||||
}
|
}
|
||||||
|
@ -88,11 +87,11 @@
|
||||||
<span class="calendar-hour"><?php print $hour['hour']; ?></span>
|
<span class="calendar-hour"><?php print $hour['hour']; ?></span>
|
||||||
<span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
|
<span class="calendar-ampm"><?php print $hour['ampm']; ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="last">
|
<td class="last">
|
||||||
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
|
<?php foreach ($rows['items'] as $time_cnt => $hour): ?>
|
||||||
<?php
|
<?php
|
||||||
if ($time_cnt == 0) {
|
if ($time_cnt == 0) {
|
||||||
$class = 'first ';
|
$class = 'first ';
|
||||||
}
|
}
|
||||||
|
@ -115,7 +114,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -129,7 +128,7 @@ try {
|
||||||
calendar_resizeViewport();
|
calendar_resizeViewport();
|
||||||
calendar_scrollToFirst();
|
calendar_scrollToFirst();
|
||||||
$('#single-day-container').css('visibility','visible');
|
$('#single-day-container').css('visibility','visible');
|
||||||
}catch(e){
|
}catch(e){
|
||||||
// swallow
|
// swallow
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-day.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar day, grouped by time
|
* Template to display a view as a calendar day, grouped by time
|
||||||
* and optionally organized into columns by a field value.
|
* and optionally organized into columns by a field value.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_day.
|
* @see template_preprocess_calendar_day.
|
||||||
*
|
*
|
||||||
* $rows: The rendered data for this day.
|
* $rows: The rendered data for this day.
|
||||||
|
@ -15,17 +14,17 @@
|
||||||
* $rows['items'] - an array of timed items for the day.
|
* $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]['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]['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.
|
* items for a time period and field column.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $columns: an array of column names.
|
* $columns: an array of column names.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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
|
* 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.
|
* evenly over the remaining 90% of the table.
|
||||||
*/
|
*/
|
||||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
|
@ -57,7 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($rows['items'] as $hour): ?>
|
<?php foreach ($rows['items'] as $hour): ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -73,9 +72,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-main.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display calendar navigation and links.
|
* Template to display calendar navigation and links.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_main.
|
* @see template_preprocess_calendar_main.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
|
@ -13,7 +12,7 @@
|
||||||
* $mini: Whether this is a mini view.
|
* $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.
|
* $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.
|
* $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('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($calendar_add_date)) print $calendar_add_date; ?>
|
||||||
<?php if (empty($block)) print theme('links', $calendar_links);?>
|
<?php if (empty($block)) print theme('links', $calendar_links);?>
|
||||||
<?php print theme('date_navigation', $view) ?>
|
<?php print theme('date_navigation', $view) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-mini.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a mini calendar month.
|
* Template to display a view as a mini calendar month.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_mini.
|
* @see template_preprocess_calendar_mini.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $day_names: An array of the day of week names for the table header.
|
||||||
|
@ -11,17 +10,17 @@
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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
|
* $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.
|
* 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);
|
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
?>
|
?>
|
||||||
<div class="calendar-calendar"><div class="month-view">
|
<div class="calendar-calendar"><div class="month-view">
|
||||||
<?php if ($view->date_info->show_title): ?>
|
<?php if ($view->date_info->show_title): ?>
|
||||||
<?php print theme('date_navigation', $view); ?>
|
<?php print theme('date_navigation', $view); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<table class="mini">
|
<table class="mini">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -44,4 +43,4 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month-col.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a column
|
* Template to display a column
|
||||||
*
|
*
|
||||||
* - $item: The item to render within a td element.
|
* - $item: The item to render within a td element.
|
||||||
*/
|
*/
|
||||||
$id = (isset($item['id'])) ? 'id="' . $item['id'] . '" ' : '';
|
$id = (isset($item['id'])) ? 'id="' . $item['id'] . '" ' : '';
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month-multiple-node.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a summary of the days items as a calendar month node.
|
* Template to display a summary of the days items as a calendar month node.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_month_multiple_node.
|
* @see template_preprocess_calendar_month_multiple_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
@ -17,12 +16,12 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
<?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) ?>
|
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view item as a calendar month node.
|
* Template to display a view item as a calendar month node.
|
||||||
*
|
*
|
||||||
* $node
|
* $node
|
||||||
* A node object for this calendar item. Note this is
|
* A node object for this calendar item. Note this is
|
||||||
* not a complete node object, but it will have $node->nid
|
* not a complete node object, but it will have $node->nid
|
||||||
* that you can use to load the full object, and
|
* that you can use to load the full object, and
|
||||||
* $node->type to tell the content type of the node.
|
* $node->type to tell the content type of the node.
|
||||||
*
|
*
|
||||||
* $fields
|
* $fields
|
||||||
* An array of information for every field selected in the 'Fields'
|
* An array of information for every field selected in the 'Fields'
|
||||||
* section of this view, formatted as requested in the View setup.
|
* section of this view, formatted as requested in the View setup.
|
||||||
*
|
*
|
||||||
* Calendar info for this individual calendar item is in local time --
|
* Calendar info for this individual calendar item is in local time --
|
||||||
* the user timezone where configurable timezones are allowed and set,
|
* the user timezone where configurable timezones are allowed and set,
|
||||||
* otherwise the site timezone. If this item has extends over more than
|
* 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
|
* 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
|
* the current day and calendar_end will be no later than the end
|
||||||
* of the current day.
|
* of the current day.
|
||||||
*
|
*
|
||||||
* $calendar_start - A formatted datetime start date for this item.
|
* $calendar_start - A formatted datetime start date for this item.
|
||||||
* i.e. '2008-05-12 05:26:15'.
|
* i.e. '2008-05-12 05:26:15'.
|
||||||
* $calendar_end - A formatted datetime end date for this item,
|
* $calendar_end - A formatted datetime end date for this item,
|
||||||
* the same as the start date except for fields that have from/to
|
* 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_start_date - a PHP date object for the start time.
|
||||||
* $calendar_end_date - a PHP date object for the end 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
|
* You can use PHP date functions on the date object to display date
|
||||||
* information in other ways, like:
|
* information in other ways, like:
|
||||||
*
|
*
|
||||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_month_node.
|
* @see template_preprocess_calendar_month_node.
|
||||||
*/
|
*/
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
@ -50,15 +49,15 @@ $index = 0;
|
||||||
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
||||||
<?php if ($field['label']): ?>
|
<?php if ($field['label']): ?>
|
||||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php print $field['data']; ?>
|
<?php print $field['data']; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php if (isset($node->continues) && $node->continues) : ?>
|
<?php if (isset($node->continues) && $node->continues) : ?>
|
||||||
<div class="continues">»</div>
|
<div class="continues">»</div>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<div class="cutoff"> </div>
|
<div class="cutoff"> </div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month-row.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a row
|
* Template to display a row
|
||||||
*
|
*
|
||||||
* - $inner: The rendered string of the row's contents.
|
* - $inner: The rendered string of the row's contents.
|
||||||
*/
|
*/
|
||||||
$attrs = ($class) ? 'class="' . $class . '"': '';
|
$attrs = ($class) ? 'class="' . $class . '"': '';
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar month.
|
* Template to display a view as a calendar month.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_month.
|
* @see template_preprocess_calendar_month.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $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.
|
* $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.
|
* $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.
|
* $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
|
* it is in the form: calendar-nid-field_name-delta
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
?>
|
?>
|
||||||
|
@ -32,7 +31,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
foreach ((array) $rows as $row) {
|
foreach ((array) $rows as $row) {
|
||||||
print $row['data'];
|
print $row['data'];
|
||||||
} ?>
|
} ?>
|
||||||
|
@ -47,11 +46,11 @@ try {
|
||||||
$('tr[iehint]').each(function(index) {
|
$('tr[iehint]').each(function(index) {
|
||||||
var iehint = this.getAttribute('iehint');
|
var iehint = this.getAttribute('iehint');
|
||||||
// Add height of the multi day rows to the single day row - seems that 80% height works best
|
// 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';
|
this.style.height = height + 'px';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}catch(e){
|
}catch(e){
|
||||||
// swallow
|
// swallow
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week-multiple-node.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a summary of the days items as a calendar week node.
|
* Template to display a summary of the days items as a calendar week node.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week_multiple_node.
|
* @see template_preprocess_calendar_week_multiple_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="view-item view-item-<?php print $view->name ?>">
|
<div class="view-item view-item-<?php print $view->name ?>">
|
||||||
<div class="calendar weekview" id="<?php print $curday ?>">
|
<div class="calendar weekview" id="<?php print $curday ?>">
|
||||||
|
@ -16,12 +15,12 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
<?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) ?>
|
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week-node.tpl.php,v 1.1.2.2 2010/12/31 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view item as a calendar week node.
|
* Template to display a view item as a calendar week node.
|
||||||
*
|
*
|
||||||
* $node
|
* $node
|
||||||
* A node object for this calendar item. Note this is
|
* A node object for this calendar item. Note this is
|
||||||
* not a complete node object, but it will have $node->nid
|
* not a complete node object, but it will have $node->nid
|
||||||
* that you can use to load the full object, and
|
* that you can use to load the full object, and
|
||||||
* $node->type to tell the content type of the node.
|
* $node->type to tell the content type of the node.
|
||||||
*
|
*
|
||||||
* $fields
|
* $fields
|
||||||
* An array of information for every field selected in the 'Fields'
|
* An array of information for every field selected in the 'Fields'
|
||||||
* section of this view, formatted as requested in the View setup.
|
* section of this view, formatted as requested in the View setup.
|
||||||
*
|
*
|
||||||
* Calendar info for this individual calendar item is in local time --
|
* Calendar info for this individual calendar item is in local time --
|
||||||
* the user timezone where configurable timezones are allowed and set,
|
* the user timezone where configurable timezones are allowed and set,
|
||||||
* otherwise the site timezone. If this item has extends over more than
|
* 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
|
* 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
|
* the current day and calendar_end will be no later than the end
|
||||||
* of the current day.
|
* of the current day.
|
||||||
*
|
*
|
||||||
* $calendar_start - A formatted datetime start date for this item.
|
* $calendar_start - A formatted datetime start date for this item.
|
||||||
* i.e. '2008-05-12 05:26:15'.
|
* i.e. '2008-05-12 05:26:15'.
|
||||||
* $calendar_end - A formatted datetime end date for this item,
|
* $calendar_end - A formatted datetime end date for this item,
|
||||||
* the same as the start date except for fields that have from/to
|
* 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_start_date - a PHP date object for the start time.
|
||||||
* $calendar_end_date - a PHP date object for the end 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
|
* You can use PHP date functions on the date object to display date
|
||||||
* information in other ways, like:
|
* information in other ways, like:
|
||||||
*
|
*
|
||||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week_node.
|
* @see template_preprocess_calendar_week_node.
|
||||||
*/
|
*/
|
||||||
$index = 0;
|
$index = 0;
|
||||||
?>
|
?>
|
||||||
<div class="view-item view-item-<?php print $view->name ?>">
|
<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'] ?>">
|
<div id="<?php print $field['id']; ?>" class="view-field view-data-<?php print $field['id'] ?>">
|
||||||
<?php if ($field['label']): ?>
|
<?php if ($field['label']): ?>
|
||||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php print $field['data']; ?>
|
<?php print $field['data']; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php if (isset($node->continues) && $node->continues) : ?>
|
<?php if (isset($node->continues) && $node->continues) : ?>
|
||||||
|
@ -60,5 +59,5 @@ $index = 0;
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<div class="cutoff"> </div>
|
<div class="cutoff"> </div>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week-overlap.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar week with overlapping items
|
* Template to display a view as a calendar week with overlapping items
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week.
|
* @see template_preprocess_calendar_week.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $day_names: An array of the day of week names for the table header.
|
||||||
* $rows: The rendered data for this week.
|
* $rows: The rendered data for this week.
|
||||||
*
|
*
|
||||||
* For each day of the week, you have:
|
* For each day of the week, you have:
|
||||||
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
||||||
* $rows['datebox'] - the formatted datebox for this day.
|
* $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]['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]['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.
|
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
//dsm($rows);
|
//dsm($rows);
|
||||||
|
@ -50,8 +49,8 @@
|
||||||
<tbody>
|
<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>
|
<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 for ($i = 0; $i < $multiday_rows; $i++): ?>
|
||||||
<?php
|
<?php
|
||||||
$colpos = 0;
|
$colpos = 0;
|
||||||
$rowclass = "all-day";
|
$rowclass = "all-day";
|
||||||
if( $i == 0) {
|
if( $i == 0) {
|
||||||
$rowclass .= " first";
|
$rowclass .= " first";
|
||||||
|
@ -79,7 +78,7 @@
|
||||||
</td>
|
</td>
|
||||||
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
|
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
<?php for($j = $colpos; $j < 7; $j++) : ?>
|
<?php for($j = $colpos; $j < 7; $j++) : ?>
|
||||||
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
|
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
|
||||||
<?php endfor;?>
|
<?php endfor;?>
|
||||||
|
@ -103,7 +102,7 @@
|
||||||
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
|
<td class="calendar-agenda-items multi-day no-entry"><div class="inner"> </div></td>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-body-divider"> </div>
|
<div class="header-body-divider"> </div>
|
||||||
|
@ -112,8 +111,8 @@
|
||||||
try {
|
try {
|
||||||
// Hide container while it renders... Degrade w/o javascript support
|
// Hide container while it renders... Degrade w/o javascript support
|
||||||
$('#single-day-container').css('visibility','hidden');
|
$('#single-day-container').css('visibility','hidden');
|
||||||
}catch(e){
|
}catch(e){
|
||||||
// swallow
|
// swallow
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<table class="full">
|
<table class="full">
|
||||||
|
@ -129,7 +128,7 @@
|
||||||
<td>
|
<td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php foreach ($start_times as $time_cnt => $start_time): ?>
|
<?php foreach ($start_times as $time_cnt => $start_time): ?>
|
||||||
<?php
|
<?php
|
||||||
if ($time_cnt == 0) {
|
if ($time_cnt == 0) {
|
||||||
$class = 'first ';
|
$class = 'first ';
|
||||||
}
|
}
|
||||||
|
@ -182,7 +181,7 @@ try {
|
||||||
|
|
||||||
// Show it now that it is complete and positioned
|
// Show it now that it is complete and positioned
|
||||||
$('#single-day-container').css('visibility','visible');
|
$('#single-day-container').css('visibility','visible');
|
||||||
}catch(e){
|
}catch(e){
|
||||||
// swallow
|
// swallow
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar week.
|
* Template to display a view as a calendar week.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week.
|
* @see template_preprocess_calendar_week.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $day_names: An array of the day of week names for the table header.
|
||||||
* $rows: The rendered data for this week.
|
* $rows: The rendered data for this week.
|
||||||
*
|
*
|
||||||
* For each day of the week, you have:
|
* For each day of the week, you have:
|
||||||
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
||||||
* $rows['datebox'] - the formatted datebox for this day.
|
* $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]['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]['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.
|
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
//dsm($rows);
|
//dsm($rows);
|
||||||
|
@ -46,8 +45,8 @@ $index = 0;
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
|
<?php for ($i = 0; $i < $multiday_rows; $i++): ?>
|
||||||
<?php
|
<?php
|
||||||
$colpos = 0;
|
$colpos = 0;
|
||||||
$rowclass = "all-day";
|
$rowclass = "all-day";
|
||||||
if( $i == 0) {
|
if( $i == 0) {
|
||||||
$rowclass .= " first";
|
$rowclass .= " first";
|
||||||
|
@ -75,12 +74,12 @@ $index = 0;
|
||||||
</td>
|
</td>
|
||||||
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
|
<?php $colpos = $cell['wday'] + $cell['colspan']; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
<?php for($j = $colpos; $j < 7; $j++) : ?>
|
<?php for($j = $colpos; $j < 7; $j++) : ?>
|
||||||
<td class="multi-day no-entry"><div class="inner"> </div></td>
|
<td class="multi-day no-entry"><div class="inner"> </div></td>
|
||||||
<?php endfor;?>
|
<?php endfor;?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
<?php foreach ($items as $time): ?>
|
<?php foreach ($items as $time): ?>
|
||||||
<tr class="not-all-day">
|
<tr class="not-all-day">
|
||||||
<td class="calendar-agenda-hour">
|
<td class="calendar-agenda-hour">
|
||||||
|
@ -96,7 +95,7 @@ $index = 0;
|
||||||
<div class="inner"> </div>
|
<div class="inner"> </div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
<?php $curpos = $colpos + 1;?>
|
<?php $curpos = $colpos + 1;?>
|
||||||
<td class="calendar-agenda-items single-day">
|
<td class="calendar-agenda-items single-day">
|
||||||
<div class="calendar">
|
<div class="calendar">
|
||||||
|
@ -109,16 +108,16 @@ $index = 0;
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php for ($i = $curpos; $i < 7; $i++): ?>
|
<?php for ($i = $curpos; $i < 7; $i++): ?>
|
||||||
<td class="calendar-agenda-items single-day">
|
<td class="calendar-agenda-items single-day">
|
||||||
<div class="calendar">
|
<div class="calendar">
|
||||||
<div class="inner"> </div>
|
<div class="inner"> </div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-year.tpl.php,v 1.1.2.1 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar year.
|
* Template to display a view as a calendar year.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_year.
|
* @see template_preprocess_calendar_year.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $months: An array with a formatted month calendar for each month of the year.
|
* $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.
|
* $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.
|
* $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('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
?>
|
?>
|
||||||
|
@ -18,10 +17,10 @@
|
||||||
<div class="calendar-calendar"><div class="year-view">
|
<div class="calendar-calendar"><div class="year-view">
|
||||||
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
|
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
|
||||||
<tbody>
|
<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[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[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[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[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: theme.inc,v 1.1.2.4 2011/01/03 12:28:48 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* Display a calendar navigation and links
|
* Display a calendar navigation and links
|
||||||
*/
|
*/
|
||||||
function template_preprocess_calendar_main(&$vars) {
|
function template_preprocess_calendar_main(&$vars) {
|
||||||
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
|
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
|
|
||||||
$result = (array) $view->result;
|
$result = (array) $view->result;
|
||||||
$options = $view->style_plugin->options;
|
$options = $view->style_plugin->options;
|
||||||
$handler = $view->style_plugin;
|
$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['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);
|
$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';
|
$view->date_info->mini = isset($view->date_info->mini) ? $view->date_info->mini : $view->date_info->granularity == 'year';
|
||||||
|
|
||||||
$url = $view->get_url();
|
$url = $view->get_url();
|
||||||
$view->date_info->url = $url;
|
$view->date_info->url = $url;
|
||||||
$arg = $view->date_info->date_arg;
|
$arg = $view->date_info->date_arg;
|
||||||
$displays = $view->date_info->display_types;
|
$displays = $view->date_info->display_types;
|
||||||
|
|
||||||
// Set up the links to other calendar views.
|
// Set up the links to other calendar views.
|
||||||
$current_date = $view->date_info->min_date;
|
$current_date = $view->date_info->min_date;
|
||||||
if (!empty($date->info->day)) {
|
if (!empty($date->info->day)) {
|
||||||
|
@ -28,7 +27,7 @@ function template_preprocess_calendar_main(&$vars) {
|
||||||
}
|
}
|
||||||
elseif (!empty($view->date_info->week)) {
|
elseif (!empty($view->date_info->week)) {
|
||||||
$week = date_week_range($view->date_info->week, $view->date_info->year);
|
$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)) {
|
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');
|
$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'));
|
$calendar_links[] = $base + array('title' => date_t('Day', 'datetime'), 'href' => date_real_url($view, 'day'));
|
||||||
}
|
}
|
||||||
$vars['calendar_links'] = $calendar_links;
|
$vars['calendar_links'] = $calendar_links;
|
||||||
|
|
||||||
// If the Date Popup module is enabled, add a popup date selector.
|
// If the Date Popup module is enabled, add a popup date selector.
|
||||||
if (!empty($view->date_info->calendar_popup)) {
|
if (!empty($view->date_info->calendar_popup)) {
|
||||||
$vars['calendar_popup'] = '<div class="clear-block">'. calendar_date_select($view) .'</div>';
|
$vars['calendar_popup'] = '<div class="clear-block">'. calendar_date_select($view) .'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// If an 'Add new ... link is provided, add it here.
|
// If an 'Add new ... link is provided, add it here.
|
||||||
// the query will bring the user back here after adding the node.
|
// 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')) {
|
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);
|
$name = node_get_types('name', $view->date_info->calendar_date_link);
|
||||||
$href = 'node/add/'. str_replace('_', '-', $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(
|
$vars['calendar_links'][] = $base + array(
|
||||||
'title' => t('Add+'),
|
'title' => t('Add+'),
|
||||||
'href' => $href,
|
'href' => $href,
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars['view'] = $view;
|
$vars['view'] = $view;
|
||||||
$vars['mini'] = !empty($view->date_info->mini);
|
$vars['mini'] = !empty($view->date_info->mini);
|
||||||
$vars['block'] = !empty($view->date_info->block);
|
$vars['block'] = !empty($view->date_info->block);
|
||||||
$vars['block_identifier'] = date_block_identifier($view);
|
$vars['block_identifier'] = date_block_identifier($view);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a view as a calendar.
|
* Display a view as a calendar.
|
||||||
*
|
*
|
||||||
* This preprocessor does all the work needed for all types of 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.
|
* views and the template takes care of displaying links to related views.
|
||||||
*/
|
*/
|
||||||
function template_preprocess_calendar(&$vars) {
|
function template_preprocess_calendar(&$vars) {
|
||||||
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
|
require_once('./'. drupal_get_path('module', 'calendar_multiday') .'/includes/calendar.inc');
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
|
|
||||||
// Make sure we only run through this function one time.
|
// Make sure we only run through this function one time.
|
||||||
if (!empty($view->date_info->calendar_processed)) {
|
if (!empty($view->date_info->calendar_processed)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = (array) $view->result;
|
$result = (array) $view->result;
|
||||||
$options = $view->style_plugin->options;
|
$options = $view->style_plugin->options;
|
||||||
$handler = $view->style_plugin;
|
$handler = $view->style_plugin;
|
||||||
|
|
||||||
$fields = $view->field;
|
$fields = $view->field;
|
||||||
|
|
||||||
// Render each field into an output array. We have to do the rendering
|
// 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.
|
// handlers in the theme functions.
|
||||||
$items = array();
|
$items = array();
|
||||||
$calendar_fields = date_api_fields($view->base_table);
|
$calendar_fields = date_api_fields($view->base_table);
|
||||||
$calendar_fields = array_keys($calendar_fields['alias']);
|
$calendar_fields = array_keys($calendar_fields['alias']);
|
||||||
|
|
||||||
foreach ($result as $num => $row) {
|
foreach ($result as $num => $row) {
|
||||||
$copy = drupal_clone($row);
|
$copy = drupal_clone($row);
|
||||||
$items[$num] = $row;
|
$items[$num] = $row;
|
||||||
|
@ -135,7 +134,7 @@ function template_preprocess_calendar(&$vars) {
|
||||||
}
|
}
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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)) {
|
if (!empty($field) && is_object($field)) {
|
||||||
// Theme the copy instead of the original row so duplicate date
|
// Theme the copy instead of the original row so duplicate date
|
||||||
// fields each get a fresh copy of the original data to theme.
|
// 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) {
|
foreach ($fields as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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 (!empty($field->options['exclude'])) {
|
||||||
if (isset($items[$num]->{$field_alias})) unset($items[$num]->{$field_alias});
|
if (isset($items[$num]->{$field_alias})) unset($items[$num]->{$field_alias});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars['display_type'] = $view->date_info->granularity;
|
$vars['display_type'] = $view->date_info->granularity;
|
||||||
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
|
$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);
|
$vars['max_date_formatted'] = date_format($view->date_info->max_date, DATE_FORMAT_DATETIME);
|
||||||
|
|
||||||
// Massage the resulting items into formatted calendar items.
|
// Massage the resulting items into formatted calendar items.
|
||||||
$items = calendar_build_nodes($view, $items);
|
$items = calendar_build_nodes($view, $items);
|
||||||
|
|
||||||
// Merge in items from other sources.
|
// Merge in items from other sources.
|
||||||
foreach (module_implements('calendar_add_items') as $module) {
|
foreach (module_implements('calendar_add_items') as $module) {
|
||||||
$function = $module .'_calendar_add_items';
|
$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';
|
$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.
|
// Create the calendar day names and rows.
|
||||||
$rows = calendar_build_calendar($view, $items);
|
$rows = calendar_build_calendar($view, $items);
|
||||||
|
|
||||||
$vars['items'] = $items;
|
$vars['items'] = $items;
|
||||||
$vars['rows'] = $rows;
|
$vars['rows'] = $rows;
|
||||||
$view->date_info->calendar_processed = TRUE;
|
$view->date_info->calendar_processed = TRUE;
|
||||||
$vars['view'] = $view;
|
$vars['view'] = $view;
|
||||||
$vars['mini'] = !empty($view->date_info->mini);
|
$vars['mini'] = !empty($view->date_info->mini);
|
||||||
$vars['block'] = !empty($view->date_info->block);
|
$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.
|
// Add in all the $vars added by the main calendar preprocessor.
|
||||||
template_preprocess_calendar($vars);
|
template_preprocess_calendar($vars);
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
|
|
||||||
$rows = $vars['rows'];
|
$rows = $vars['rows'];
|
||||||
|
|
||||||
if (sizeof($rows) > 1) {
|
if (sizeof($rows) > 1) {
|
||||||
$day_names = array_shift($rows);
|
$day_names = array_shift($rows);
|
||||||
}
|
}
|
||||||
|
@ -200,7 +199,7 @@ function template_preprocess_calendar_month(&$vars) {
|
||||||
$day_names = $rows;
|
$day_names = $rows;
|
||||||
$rows = array();
|
$rows = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$month_rows = $rows;
|
$month_rows = $rows;
|
||||||
foreach ($rows as $weekno => $row) {
|
foreach ($rows as $weekno => $row) {
|
||||||
// If this row is already rendered, don't do anything.
|
// 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['rows'] = $month_rows;
|
||||||
$vars['day_names'] = $day_names;
|
$vars['day_names'] = $day_names;
|
||||||
|
|
||||||
$vars['display_type'] = $view->date_info->granularity;
|
$vars['display_type'] = $view->date_info->granularity;
|
||||||
$vars['min_date_formatted'] = date_format($view->date_info->min_date, DATE_FORMAT_DATETIME);
|
$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);
|
$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) {
|
function template_preprocess_calendar_mini(&$vars) {
|
||||||
// Add in all the $vars added by the main calendar preprocessor.
|
// Add in all the $vars added by the main calendar preprocessor.
|
||||||
template_preprocess_calendar_month($vars);
|
template_preprocess_calendar_month($vars);
|
||||||
|
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
$view->date_info->show_title = !empty($view->date_info->show_title) ? $view->date_info->show_title : FALSE;
|
$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;
|
$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.
|
// Add in all the $vars added by the main calendar preprocessor.
|
||||||
$vars['view']->date_info->style_with_weekno = FALSE;
|
$vars['view']->date_info->style_with_weekno = FALSE;
|
||||||
template_preprocess_calendar($vars);
|
template_preprocess_calendar($vars);
|
||||||
|
|
||||||
// Get the url of the year view and remove the year argument from it.
|
// 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
|
// TODO clean this up in case there is another arg that looks like
|
||||||
// the year to make sure only the year gets removed.
|
// the year to make sure only the year gets removed.
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
$year = date_format($view->date_info->min_date, 'Y');
|
$year = date_format($view->date_info->min_date, 'Y');
|
||||||
|
|
||||||
// Construct a calendar for each month, adjusting the $view passed
|
// Construct a calendar for each month, adjusting the $view passed
|
||||||
// to the theme so it will produce the right results.
|
// to the theme so it will produce the right results.
|
||||||
$view = drupal_clone($vars['view']);
|
$view = drupal_clone($vars['view']);
|
||||||
$rows = $vars['rows'];
|
$rows = $vars['rows'];
|
||||||
$months = array();
|
$months = array();
|
||||||
|
@ -291,7 +290,7 @@ function template_preprocess_calendar_year(&$vars) {
|
||||||
$vars['months'] = $months;
|
$vars['months'] = $months;
|
||||||
$vars['view']->date_info->hide_nav = FALSE;
|
$vars['view']->date_info->hide_nav = FALSE;
|
||||||
$vars['view']->date_info->granularity = 'year';
|
$vars['view']->date_info->granularity = 'year';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -305,27 +304,27 @@ function template_preprocess_calendar_day_overlap(&$vars) {
|
||||||
* Display a day view.
|
* Display a day view.
|
||||||
*/
|
*/
|
||||||
function template_preprocess_calendar_day(&$vars) {
|
function template_preprocess_calendar_day(&$vars) {
|
||||||
|
|
||||||
// Add in all the $vars added by the main calendar preprocessor.
|
// Add in all the $vars added by the main calendar preprocessor.
|
||||||
$vars['view']->style_with_weekno = FALSE;
|
$vars['view']->style_with_weekno = FALSE;
|
||||||
template_preprocess_calendar($vars);
|
template_preprocess_calendar($vars);
|
||||||
|
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
$rows = $vars['rows'];
|
$rows = $vars['rows'];
|
||||||
|
|
||||||
$item_count = 0;
|
$item_count = 0;
|
||||||
$by_hour_count = 0;
|
$by_hour_count = 0;
|
||||||
$grouping_field = $view->date_info->style_groupby_field;
|
$grouping_field = $view->date_info->style_groupby_field;
|
||||||
|
|
||||||
$display_overlap = $view->date_info->style_theme_style == '1';
|
$display_overlap = $view->date_info->style_theme_style == '1';
|
||||||
|
|
||||||
// Add optional css
|
// Add optional css
|
||||||
if ($display_overlap) {
|
if ($display_overlap) {
|
||||||
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
|
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
|
||||||
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
|
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
|
||||||
$overlapped_items = array();
|
$overlapped_items = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're not grouping by time, move all items into the 'all day' array.
|
// If we're not grouping by time, move all items into the 'all day' array.
|
||||||
if (empty($view->date_info->style_groupby_times)) {
|
if (empty($view->date_info->style_groupby_times)) {
|
||||||
// Items are already grouped into times, so we need to process each time-group.
|
// 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();
|
$rows['items'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$columns = array();
|
$columns = array();
|
||||||
|
|
||||||
// Move all_day items into the right columns and render them.
|
// Move all_day items into the right columns and render them.
|
||||||
$grouped_items = array();
|
$grouped_items = array();
|
||||||
foreach ($rows['all_day'] as $item) {
|
foreach ($rows['all_day'] as $item) {
|
||||||
if (isset($item->{$grouping_field})) {
|
if (isset($item->{$grouping_field})) {
|
||||||
$column = $item->{$grouping_field};
|
$column = $item->{$grouping_field};
|
||||||
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
|
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
|
||||||
if (!in_array($column, $columns)) {
|
if (!in_array($column, $columns)) {
|
||||||
$columns[] = $column;
|
$columns[] = $column;
|
||||||
|
@ -357,14 +356,14 @@ function template_preprocess_calendar_day(&$vars) {
|
||||||
$item_count++;
|
$item_count++;
|
||||||
}
|
}
|
||||||
$vars['rows']['all_day'] = $grouped_items;
|
$vars['rows']['all_day'] = $grouped_items;
|
||||||
|
|
||||||
// Moved timed items into the right columns and render them.
|
// Moved timed items into the right columns and render them.
|
||||||
$start_times = $view->date_info->style_groupby_times;
|
$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';
|
$end_start_time = '23:59:59';
|
||||||
$start_time = array_shift($start_times);
|
$start_time = array_shift($start_times);
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
||||||
|
|
||||||
$grouped_items = array();
|
$grouped_items = array();
|
||||||
foreach ($rows['items'] as &$items) {
|
foreach ($rows['items'] as &$items) {
|
||||||
foreach ($items as &$item) {
|
foreach ($items as &$item) {
|
||||||
|
@ -383,7 +382,7 @@ function template_preprocess_calendar_day(&$vars) {
|
||||||
// slots if the option to show empty times was chosen.
|
// slots if the option to show empty times was chosen.
|
||||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||||
if ((!empty($show_empty_times) || $display_overlap) && !array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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) {
|
if ($display_overlap) {
|
||||||
$time_end = date_format($item->date_end, 'H:i:s');
|
$time_end = date_format($item->date_end, 'H:i:s');
|
||||||
$item->time_start = $time;
|
$item->time_start = $time;
|
||||||
$item->time_end = $time_end;
|
$item->time_end = $time_end;
|
||||||
_calc_indents($overlapped_items, $time, $time_end, $item);
|
_calc_indents($overlapped_items, $time, $time_end, $item);
|
||||||
}
|
}
|
||||||
$item_count++;
|
$item_count++;
|
||||||
$by_hour_count++;
|
$by_hour_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish out the day's time values if we want to see empty times.
|
// Finish out the day's time values if we want to see empty times.
|
||||||
if (!empty($show_empty_times) || $display_overlap) {
|
if (!empty($show_empty_times) || $display_overlap) {
|
||||||
while ($start_time < $end_start_time && ($start_time != NULL || $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);
|
$next_start_time = array_shift($start_times);
|
||||||
}
|
}
|
||||||
if (!array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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.
|
// Do the headers last, once we know what the actual values are.
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$start_times = array_keys($grouped_items);
|
$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';
|
$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']);
|
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
|
||||||
$grouped_items[$start_time]['hour'] = $heading['hour'];
|
$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 ($grouped_items[$start_time]['values'] as $column => &$items) {
|
||||||
foreach ($items as $index => &$item) {
|
foreach ($items as $index => &$item) {
|
||||||
if ($display_overlap) {
|
if ($display_overlap) {
|
||||||
$offset = round(date_format($item->date_start, 'i') / 15);
|
$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);
|
date_convert('1970-01-01 ' . $item->time_start, DATE_DATETIME, DATE_UNIX);
|
||||||
$duration = round($duration / (15 * 60));
|
$duration = round($duration / (15 * 60));
|
||||||
$item->class = 'd_'. $duration . ' o_'. $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
|
$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';
|
$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);
|
$grouped_items[$start_time]['values'][$column][$index] = theme($theme, $item, $view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
ksort($grouped_items);
|
ksort($grouped_items);
|
||||||
$vars['rows']['items'] = $grouped_items;
|
$vars['rows']['items'] = $grouped_items;
|
||||||
|
|
||||||
if (empty($columns)) {
|
if (empty($columns)) {
|
||||||
$columns = array(t('Items'));
|
$columns = array(t('Items'));
|
||||||
}
|
}
|
||||||
$vars['columns'] = $columns;
|
$vars['columns'] = $columns;
|
||||||
|
|
||||||
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
|
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
|
||||||
$first_column_width = 10;
|
$first_column_width = 10;
|
||||||
|
|
||||||
if (empty($view->date_info->style_groupby_times)) {
|
if (empty($view->date_info->style_groupby_times)) {
|
||||||
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
|
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
|
||||||
$first_column_width = 1;
|
$first_column_width = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars['first_column_width'] = $first_column_width;
|
$vars['first_column_width'] = $first_column_width;
|
||||||
if (count($columns)) {
|
if (count($columns)) {
|
||||||
$vars['column_width'] = round((100 - $first_column_width)/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.
|
// Add in all the $vars added by the main calendar preprocessor.
|
||||||
$vars['view']->style_with_weekno = FALSE;
|
$vars['view']->style_with_weekno = FALSE;
|
||||||
template_preprocess_calendar($vars);
|
template_preprocess_calendar($vars);
|
||||||
|
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
$rows = $vars['rows'];
|
$rows = $vars['rows'];
|
||||||
$item_count = 0;
|
$item_count = 0;
|
||||||
$by_hour_count = 0;
|
$by_hour_count = 0;
|
||||||
$start_time = NULL;
|
$start_time = NULL;
|
||||||
|
|
||||||
if (sizeof($rows) > 1) {
|
if (sizeof($rows) > 1) {
|
||||||
$day_names = array_shift($rows);
|
$day_names = array_shift($rows);
|
||||||
}
|
}
|
||||||
|
@ -496,27 +495,27 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
$day_names = $rows;
|
$day_names = $rows;
|
||||||
$rows = array();
|
$rows = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Moved timed items into the right columns and render them.
|
// 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';
|
$end_start_time = '23:59:59';
|
||||||
|
|
||||||
$grouped_items = array();
|
$grouped_items = array();
|
||||||
|
|
||||||
// pass the multiday buckets
|
// pass the multiday buckets
|
||||||
$vars['all_day'] = $rows['multiday_buckets'];
|
$vars['all_day'] = $rows['multiday_buckets'];
|
||||||
|
|
||||||
// Remove the count for singleday
|
// 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');
|
$display_overlap = ($view->date_info->style_multiday_theme == '1' && $view->date_info->style_theme_style == '1');
|
||||||
$vars['display_overlap'] = $display_overlap;
|
$vars['display_overlap'] = $display_overlap;
|
||||||
|
|
||||||
// Add optional css
|
// Add optional css
|
||||||
if ($display_overlap) {
|
if ($display_overlap) {
|
||||||
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
|
drupal_add_css(drupal_get_path('module', 'calendar_multiday') .'/calendar-overlap.css');
|
||||||
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
|
drupal_add_js(drupal_get_path('module', 'calendar_multiday') . '/calendar_overlap.js');
|
||||||
$overlapped_items = array( array(), array(), array(), array(), array(), array(), array());
|
$overlapped_items = array( array(), array(), array(), array(), array(), array(), array());
|
||||||
|
|
||||||
// Locate the first item
|
// Locate the first item
|
||||||
$first_time = '23:59:59';
|
$first_time = '23:59:59';
|
||||||
$first_time_index = -1;
|
$first_time_index = -1;
|
||||||
|
@ -528,13 +527,13 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
$first_time = $time;
|
$first_time = $time;
|
||||||
$first_time_index = $i;
|
$first_time_index = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($first_time_index > -1) {
|
if ($first_time_index > -1) {
|
||||||
$rows['singleday_buckets'][$first_time_index][$first_time][0]['is_first'] = TRUE;
|
$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 we're not grouping by time, move all items into the 'all day' array.
|
||||||
if (empty($view->date_info->style_groupby_times)) {
|
if (empty($view->date_info->style_groupby_times)) {
|
||||||
$add_row = FALSE;
|
$add_row = FALSE;
|
||||||
|
@ -547,9 +546,9 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( $add_row ) {
|
if ( $add_row ) {
|
||||||
$vars['multiday_rows']++;
|
$vars['multiday_rows']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach ($rows['singleday_buckets'] as $wday => $singleday_row) {
|
foreach ($rows['singleday_buckets'] as $wday => $singleday_row) {
|
||||||
$columns[] = $wday;
|
$columns[] = $wday;
|
||||||
|
@ -564,23 +563,23 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
if ($vars['multiday_rows'] == 0) {
|
if ($vars['multiday_rows'] == 0) {
|
||||||
$vars['multiday_rows']++;
|
$vars['multiday_rows']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Find the next time slot and fill it. Populate the skipped
|
// Find the next time slot and fill it. Populate the skipped
|
||||||
// slots if the option to show empty times was chosen.
|
// slots if the option to show empty times was chosen.
|
||||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||||
if (($show_empty_times || $display_overlap) && !array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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) {
|
if ($display_overlap) {
|
||||||
$date_end = date_format($item['item']->date_end, 'H:i:s');
|
$date_end = date_format($item['item']->date_end, 'H:i:s');
|
||||||
_calc_indents($overlapped_items[$wday], $time, $date_end, $item);
|
_calc_indents($overlapped_items[$wday], $time, $date_end, $item);
|
||||||
}
|
}
|
||||||
$item_count++;
|
$item_count++;
|
||||||
$by_hour_count++;
|
$by_hour_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -594,7 +593,7 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
$next_start_time = array_shift($start_times);
|
$next_start_time = array_shift($start_times);
|
||||||
}
|
}
|
||||||
if (!array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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);
|
ksort($grouped_items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do the headers last, once we know what the actual values are.
|
// Do the headers last, once we know what the actual values are.
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$start_times = array_keys($grouped_items);
|
$start_times = array_keys($grouped_items);
|
||||||
|
@ -622,21 +621,21 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
$duration = round($duration / (15 * 60));
|
$duration = round($duration / (15 * 60));
|
||||||
$item['class'] = 'd_'. $duration . ' o_'. $offset . ' i_' . $item['indent'] . ' md_' . min($item['max_depth'], 5);
|
$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['day_names'] = $day_names;
|
||||||
$vars['columns'] = $columns;
|
$vars['columns'] = $columns;
|
||||||
$vars['start_times'] = $view->date_info->style_groupby_times;
|
$vars['start_times'] = $view->date_info->style_groupby_times;
|
||||||
$vars['first_time'] = $first_time;
|
$vars['first_time'] = $first_time;
|
||||||
|
|
||||||
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
|
$vars['agenda_hour_class'] = 'calendar-agenda-hour';
|
||||||
$first_column_width = 10;
|
$first_column_width = 10;
|
||||||
|
|
||||||
if (empty($view->date_info->style_groupby_times)) {
|
if (empty($view->date_info->style_groupby_times)) {
|
||||||
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
|
$vars['agenda_hour_class'] .= ' calendar-agenda-no-hours';
|
||||||
$first_column_width = 1;
|
$first_column_width = 1;
|
||||||
|
@ -652,14 +651,14 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
function template_preprocess_calendar_datebox(&$vars) {
|
function template_preprocess_calendar_datebox(&$vars) {
|
||||||
$date = $vars['date'];
|
$date = $vars['date'];
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
|
|
||||||
$vars['day'] = intval(substr($date, 8, 2));
|
$vars['day'] = intval(substr($date, 8, 2));
|
||||||
$force_view_url = !empty($view->date_info->block) ? TRUE : FALSE;
|
$force_view_url = !empty($view->date_info->block) ? TRUE : FALSE;
|
||||||
$vars['url'] = date_real_url($view, NULL, $date, $force_view_url);
|
$vars['url'] = date_real_url($view, NULL, $date, $force_view_url);
|
||||||
$vars['link'] = l($vars['day'], $vars['url']);
|
$vars['link'] = l($vars['day'], $vars['url']);
|
||||||
$vars['granularity'] = $view->date_info->granularity;
|
$vars['granularity'] = $view->date_info->granularity;
|
||||||
$vars['mini'] = $view->date_info->mini;
|
$vars['mini'] = $view->date_info->mini;
|
||||||
|
|
||||||
if ($view->date_info->mini) {
|
if ($view->date_info->mini) {
|
||||||
if (!empty($vars['selected'])) {
|
if (!empty($vars['selected'])) {
|
||||||
$vars['class'] = 'mini-day-on';
|
$vars['class'] = 'mini-day-on';
|
||||||
|
@ -682,11 +681,11 @@ function template_preprocess_calendar_node(&$vars) {
|
||||||
$fields = array();
|
$fields = array();
|
||||||
foreach ($view->field as $name => $field) {
|
foreach ($view->field as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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)) {
|
if (!empty($node->$field_alias)) {
|
||||||
$data = $node->$field_alias;
|
$data = $node->$field_alias;
|
||||||
$label = $field->options['label'];
|
$label = $field->options['label'];
|
||||||
|
|
||||||
// CCK has some special label options.
|
// CCK has some special label options.
|
||||||
if (!empty($field->content_field)) {
|
if (!empty($field->content_field)) {
|
||||||
switch ($field->options['label_type']) {
|
switch ($field->options['label_type']) {
|
||||||
|
@ -710,10 +709,10 @@ function template_preprocess_calendar_node(&$vars) {
|
||||||
$vars['calendar_end'] = $node->calendar_end;
|
$vars['calendar_end'] = $node->calendar_end;
|
||||||
$vars['calendar_start_date'] = $node->calendar_start_date;
|
$vars['calendar_start_date'] = $node->calendar_start_date;
|
||||||
$vars['calendar_end_date'] = $node->calendar_end_date;
|
$vars['calendar_end_date'] = $node->calendar_end_date;
|
||||||
|
|
||||||
// We added the node type to the results in the query,
|
// We added the node type to the results in the query,
|
||||||
// but it will show up as $node->node_type instead of
|
// 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.
|
// would show up on a node object.
|
||||||
$vars['node']->type = $vars['node']->node_type;
|
$vars['node']->type = $vars['node']->node_type;
|
||||||
}
|
}
|
||||||
|
@ -737,7 +736,7 @@ function template_preprocess_calendar_month_multiple_node(&$vars) {
|
||||||
$year = $parts[0];
|
$year = $parts[0];
|
||||||
$month = intval($parts[1]);
|
$month = intval($parts[1]);
|
||||||
$day = intval($parts[2]);
|
$day = intval($parts[2]);
|
||||||
|
|
||||||
// create the link to the day
|
// create the link to the day
|
||||||
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($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) {
|
function template_preprocess_calendar_week_multiple_node(&$vars) {
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
$curday = $vars['curday'];
|
$curday = $vars['curday'];
|
||||||
|
|
||||||
// get the year month and date
|
// get the year month and date
|
||||||
$parts = explode('-', substr($curday, 0, 10));
|
$parts = explode('-', substr($curday, 0, 10));
|
||||||
$year = $parts[0];
|
$year = $parts[0];
|
||||||
$month = intval($parts[1]);
|
$month = intval($parts[1]);
|
||||||
$day = intval($parts[2]);
|
$day = intval($parts[2]);
|
||||||
|
|
||||||
// create the link to the day
|
// create the link to the day
|
||||||
$vars['link'] = date_real_url($view, NULL, date_pad($year, 4) .'-'. date_pad($month) .'-'. date_pad($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'))
|
array('class' => 'calendar-legend', 'data' => t('Key'))
|
||||||
);
|
);
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$output = '';
|
$output = '';
|
||||||
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
|
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
|
||||||
if ($stripe) {
|
if ($stripe) {
|
||||||
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'"> </div>');
|
$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.
|
* The day to display.
|
||||||
*/
|
*/
|
||||||
function theme_calendar_empty_day($curday, $view) {
|
function theme_calendar_empty_day($curday, $view) {
|
||||||
|
|
||||||
if ($view->date_info->calendar_type != 'day') {
|
if ($view->date_info->calendar_type != 'day') {
|
||||||
return '<div class="calendar-empty"> </div>'."\n";
|
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
|
* 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) {
|
function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
|
||||||
|
|
||||||
// Are there any items at this depth?
|
// Are there any items at this depth?
|
||||||
if (!empty($overlapped_items)) {
|
if (!empty($overlapped_items)) {
|
||||||
|
|
||||||
// Iterate for each item as this depth and see if we overlap
|
// 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
|
// We search depth-first, so if there are children for this item, recurse into
|
||||||
// each child tree looking for an overlap
|
// each child tree looking for an overlap
|
||||||
if (!empty($entry['children'])) {
|
if (!empty($entry['children'])) {
|
||||||
$rc = _calc_indents($entry['children'], $start, $end, $item, $depth + 1);
|
$rc = _calc_indents($entry['children'], $start, $end, $item, $depth + 1);
|
||||||
|
|
||||||
// Was there an overlap in the child tree?
|
// Was there an overlap in the child tree?
|
||||||
if ($rc['overlap']) {
|
if ($rc['overlap']) {
|
||||||
if (is_object($entry['item'])) {
|
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']['indent'] = _calc_indent($entry['depth'], $rc['max_depth']);
|
||||||
$entry['item']['max_depth'] = $rc['max_depth'];
|
$entry['item']['max_depth'] = $rc['max_depth'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// There was an overlap, pop out of this depth
|
// There was an overlap, pop out of this depth
|
||||||
return $rc;
|
return $rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No, child overlap, so check if we overlap this item
|
// No, child overlap, so check if we overlap this item
|
||||||
# if ($start >= $entry['start'] && $start <= $entry['end']) {
|
# if ($start >= $entry['start'] && $start <= $entry['end']) {
|
||||||
if ($start >= $entry['start'] && $start < $entry['end']) {
|
if ($start >= $entry['start'] && $start < $entry['end']) {
|
||||||
|
|
||||||
// We overlap, create an overlapping entry
|
// We overlap, create an overlapping entry
|
||||||
$entry['children'][] = array('item' => &$item, 'depth' => $depth + 1, 'start' => $start, 'end' => $end, 'children' => array());
|
$entry['children'][] = array('item' => &$item, 'depth' => $depth + 1, 'start' => $start, 'end' => $end, 'children' => array());
|
||||||
if (is_object($entry['item'])) {
|
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['indent'] = _calc_indent($depth + 1, $max_depth);
|
||||||
$item['max_depth'] = $max_depth;
|
$item['max_depth'] = $max_depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We overlap, so pop out of this depth
|
// We overlap, so pop out of this depth
|
||||||
return array('overlap' => TRUE, 'max_depth' => $max_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
|
// If there are items at this depth, but no overlap, then return no overlap and pop
|
||||||
// out of this depth
|
// out of this depth
|
||||||
if ($depth > 0) {
|
if ($depth > 0) {
|
||||||
return array('overlap' => FALSE, 'max_depth' => 0);
|
return array('overlap' => FALSE, 'max_depth' => 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No overlap at any depth, reset the array of overlaps
|
// No overlap at any depth, reset the array of overlaps
|
||||||
if ($depth == 0) {
|
if ($depth == 0) {
|
||||||
reset($overlapped_items);
|
reset($overlapped_items);
|
||||||
|
@ -958,7 +957,7 @@ function _calc_indents(&$overlapped_items, $start, $end, &$item, $depth = 0) {
|
||||||
else {
|
else {
|
||||||
$overlapped_items[] = array('item' => &$item, 'depth' => $depth, 'start' => $start, 'end' => $end, 'children' => array());
|
$overlapped_items[] = array('item' => &$item, 'depth' => $depth, 'start' => $start, 'end' => $end, 'children' => array());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($item)) {
|
if (is_object($item)) {
|
||||||
$item->indent = _calc_indent($depth, $depth);
|
$item->indent = _calc_indent($depth, $depth);
|
||||||
$item->max_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]
|
[advanced help settings]
|
||||||
name = Calendar
|
name = Calendar
|
||||||
index name = "Calendar"
|
index name = "Calendar"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
//$Id: calendar.inc,v 1.1.2.46 2010/11/28 23:31:28 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* Build calendar
|
* Build calendar
|
||||||
*
|
*
|
||||||
|
@ -23,10 +22,10 @@ function calendar_build_calendar($view, $items) {
|
||||||
}
|
}
|
||||||
$items = $values;
|
$items = $values;
|
||||||
ksort($items);
|
ksort($items);
|
||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$curday = drupal_clone($view->date_info->min_date);
|
$curday = drupal_clone($view->date_info->min_date);
|
||||||
|
|
||||||
switch ($view->date_info->granularity) {
|
switch ($view->date_info->granularity) {
|
||||||
case 'year':
|
case 'year':
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
@ -53,7 +52,7 @@ function calendar_build_calendar($view, $items) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +89,7 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
||||||
$day_wday = date_format($curday, 'w');
|
$day_wday = date_format($curday, 'w');
|
||||||
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
date_modify($curday, '-' . strval((7 + $day_wday - $first_day) % 7) . ' days');
|
||||||
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
$curday_date = date_format($curday, DATE_FORMAT_DATE);
|
||||||
|
|
||||||
// If we're displaying the week number, add it as the
|
// If we're displaying the week number, add it as the
|
||||||
// first cell in the week.
|
// first cell in the week.
|
||||||
if (!empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', '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'])) {
|
if (!empty($view->date_info->display_types['week'])) {
|
||||||
$weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
|
$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.
|
// Do not link week numbers, if Week views are disabled.
|
||||||
$weekno = $week;
|
$weekno = $week;
|
||||||
}
|
}
|
||||||
$rows[$week][] = array(
|
$rows[$week][] = array(
|
||||||
'data' => $weekno,
|
'data' => $weekno,
|
||||||
'id' => $view->name . '-weekno-' . $curday_date,
|
'id' => $view->name . '-weekno-' . $curday_date,
|
||||||
'class' => 'week');
|
'class' => 'week');
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < 7; $i++) {
|
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] .
|
$class = strtolower($weekdays[$i] .
|
||||||
($view->date_info->mini ? ' mini' : ''));
|
($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)) {
|
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';
|
$class .= ' empty';
|
||||||
$content = array(
|
$content = array(
|
||||||
'date' => '',
|
'date' => '',
|
||||||
'datebox' => '',
|
'datebox' => '',
|
||||||
'empty' => theme('calendar_empty_day', $curday_date, $view),
|
'empty' => theme('calendar_empty_day', $curday_date, $view),
|
||||||
'link' => '',
|
'link' => '',
|
||||||
'all_day' => array(),
|
'all_day' => array(),
|
||||||
'items' => array(),
|
'items' => array(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +128,7 @@ function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {
|
||||||
($curday_date > $today ? ' future' : '') .
|
($curday_date > $today ? ' future' : '') .
|
||||||
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
|
(empty($items[$curday_date]) ? ' has-no-events' : ' has-events');
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows[$week][] = array(
|
$rows[$week][] = array(
|
||||||
'data' => $content,
|
'data' => $content,
|
||||||
'class' => $class, 'id' => $view->name . '-' . $curday_date);
|
'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);
|
$link = theme('calendar_'. $view->date_info->calendar_type .'_multiple_node', $curday_date, $count, $view, $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = array(
|
$content = array(
|
||||||
'date' => $curday_date,
|
'date' => $curday_date,
|
||||||
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
|
'datebox' => theme('calendar_datebox', $curday_date, $view, $items, $selected),
|
||||||
'empty' => $empty,
|
'empty' => $empty,
|
||||||
'link' => $link,
|
'link' => $link,
|
||||||
'all_day' => $all_day,
|
'all_day' => $all_day,
|
||||||
|
@ -200,4 +199,3 @@ function calendar_build_day($curday, $view, $items) {
|
||||||
);
|
);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
//$Id: calendar.views.inc,v 1.1.2.11 2010/11/29 11:41:58 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_views_query()
|
* Implementation of hook_views_query()
|
||||||
*
|
*
|
||||||
* Handle the date_popup calendar goto date.
|
* Handle the date_popup calendar goto date.
|
||||||
*/
|
*/
|
||||||
function calendar_views_query_alter(&$view, &$query) {
|
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) {
|
if (isset($_POST['calendar_goto']) && $_POST['view_name'] == $view->name) {
|
||||||
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_elements.inc');
|
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'));
|
$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']) {
|
switch ($_POST['calendar_type']) {
|
||||||
case 'year':
|
case 'year':
|
||||||
$arg = date_pad(date_part_extract($date, 'year'), 4);
|
$arg = date_pad(date_part_extract($date, 'year'), 4);
|
||||||
break;
|
break;
|
||||||
case 'month':
|
case 'month':
|
||||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
|
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month'));
|
||||||
break;
|
break;
|
||||||
case 'week':
|
case 'week':
|
||||||
$ww = date_day_of_week($date, DATE_ISO);
|
$ww = date_day_of_week($date, DATE_ISO);
|
||||||
$ww = variable_get('date_first_day', 1) ? ($ww == 0 ? 6 : $ww - 1) : $ww;
|
$ww = variable_get('date_first_day', 1) ? ($ww == 0 ? 6 : $ww - 1) : $ww;
|
||||||
$date = date('Y-m-d', strtotime("-$ww days", strtotime($date)));
|
$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));
|
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-W'. date_pad(date_week($date));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$arg = date_pad(date_part_extract($date, 'year'), 4) .'-'. date_pad(date_part_extract($date, 'month')) .'-'. date_pad(date_part_extract($date, 'day'));
|
$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']));
|
drupal_goto(str_replace($_POST['calendar_previous_arg'], $arg, $_POST['view_url']));
|
||||||
exit();
|
exit();
|
||||||
|
@ -40,34 +39,34 @@ function calendar_views_pre_view(&$view, &$display_id, &$args) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
*
|
*
|
||||||
* Creates calendar displays of Views results.
|
* Creates calendar displays of Views results.
|
||||||
*
|
*
|
||||||
* Create a new calendar by enabling or cloning the default calendar,
|
* Create a new calendar by enabling or cloning the default calendar,
|
||||||
* changing the date argument to use the correct date field(s), and setting
|
* 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.
|
* and fields.
|
||||||
*
|
*
|
||||||
* Unlike previous versions of the Calendar module, there is just a single
|
* Unlike previous versions of the Calendar module, there is just a single
|
||||||
* Date argument instead of year, month, and day arguments. The argument
|
* 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
|
* 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.
|
* 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
|
* multiple displays for the year, month, day, or week views. The actual
|
||||||
* displays are created by attaching calendar views that use whatever
|
* 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,
|
* Calendar views are attachments to create the year, month, day,
|
||||||
* and week displays. They can be set to use any style, either a
|
* and week displays. They can be set to use any style, either a
|
||||||
* calendar style or any other Views style, like teasers or lists.
|
* 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
|
* 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.
|
* anything. Only the attached views will show up in the calendar.
|
||||||
*
|
*
|
||||||
* A calendar block will create a calendar block for the
|
* A calendar block will create a calendar block for the
|
||||||
* view results. Attach a block view to the block and set up 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
|
* Implementation of hook_views_plugins
|
||||||
|
@ -78,7 +77,7 @@ function calendar_views_plugins() {
|
||||||
if (module_exists('calendar_multiday')) {
|
if (module_exists('calendar_multiday')) {
|
||||||
$theme_path = drupal_get_path('module', 'calendar_multiday');
|
$theme_path = drupal_get_path('module', 'calendar_multiday');
|
||||||
}
|
}
|
||||||
|
|
||||||
$views_path = drupal_get_path('module', 'views');
|
$views_path = drupal_get_path('module', 'views');
|
||||||
require_once "./$theme_path/theme/theme.inc";
|
require_once "./$theme_path/theme/theme.inc";
|
||||||
|
|
||||||
|
@ -135,7 +134,7 @@ function calendar_views_plugins() {
|
||||||
'admin' => t('Calendar page'),
|
'admin' => t('Calendar page'),
|
||||||
'help topic' => 'getting-started',
|
'help topic' => 'getting-started',
|
||||||
'js' => array(
|
'js' => array(
|
||||||
'misc/farbtastic/farbtastic.js',
|
'misc/farbtastic/farbtastic.js',
|
||||||
drupal_get_path('module', 'calendar') .'/js/calendar_colorpicker.js',
|
drupal_get_path('module', 'calendar') .'/js/calendar_colorpicker.js',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -222,13 +221,13 @@ function calendar_views_plugins() {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (module_exists('calendar_multiday')) {
|
if (module_exists('calendar_multiday')) {
|
||||||
$data['style']['calendar_style']['additional themes'] += array(
|
$data['style']['calendar_style']['additional themes'] += array(
|
||||||
'calendar_day_overlap' => 'style',
|
'calendar_day_overlap' => 'style',
|
||||||
'calendar_week_overlap' => 'style',
|
'calendar_week_overlap' => 'style',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
<?php
|
<?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
|
* Set up so it can be used as an API to create default calendars for
|
||||||
* specific date fields.
|
* specific date fields.
|
||||||
*
|
*
|
||||||
* Use variable_set() to establish criteria for default calendars.
|
* 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
|
* Example: Add a new default calendar to custom
|
||||||
* calendars that are already configured:
|
* calendars that are already configured:
|
||||||
*
|
*
|
||||||
* $options = variable_get('calendar_default_view_options', array());
|
* $options = variable_get('calendar_default_view_options', array());
|
||||||
* $option = array(
|
* $option = array(
|
||||||
* 'name' => 'example_event',
|
* 'name' => 'example_event',
|
||||||
|
@ -20,19 +19,19 @@
|
||||||
* );
|
* );
|
||||||
* $options[] = $option;
|
* $options[] = $option;
|
||||||
* variable_set('calendar_default_view_options', $options);
|
* variable_set('calendar_default_view_options', $options);
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function calendar_views_default_views() {
|
function calendar_views_default_views() {
|
||||||
$views = array();
|
$views = array();
|
||||||
|
|
||||||
// Construct the default view with default options.
|
// Construct the default view with default options.
|
||||||
$view = calendar_views_construct();
|
$view = calendar_views_construct();
|
||||||
$views[$view->name] = $view;
|
$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().
|
// using variable_get().
|
||||||
$calendar_options = variable_get('calendar_default_view_options', array());
|
$calendar_options = variable_get('calendar_default_view_options', array());
|
||||||
|
|
||||||
foreach ((array) $calendar_options as $calendar_option) {
|
foreach ((array) $calendar_options as $calendar_option) {
|
||||||
$view = calendar_views_construct($calendar_option);
|
$view = calendar_views_construct($calendar_option);
|
||||||
$views[$view->name] = $view;
|
$views[$view->name] = $view;
|
||||||
|
@ -41,31 +40,31 @@ function calendar_views_default_views() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Construct a default calendar to match specified options.
|
* 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.
|
* 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.
|
* create default calendars.
|
||||||
*
|
*
|
||||||
* Possible options include:
|
* Possible options include:
|
||||||
* @param string $name:
|
* @param string $name:
|
||||||
* The view name, if empty, defaults to 'calendar'.
|
* The view name, if empty, defaults to 'calendar'.
|
||||||
* @param string $description:
|
* @param string $description:
|
||||||
* The view description, if empty, defaults to generic description.
|
* The view description, if empty, defaults to generic description.
|
||||||
* @param string $path:
|
* @param string $path:
|
||||||
* The view url, if empty, defaults to 'calendar'.
|
* The view url, if empty, defaults to 'calendar'.
|
||||||
* @param array $types:
|
* @param array $types:
|
||||||
* Array of content types to limit the calendar to those types.
|
* Array of content types to limit the calendar to those types.
|
||||||
* If empty, defaults to no type filter.
|
* If empty, defaults to no type filter.
|
||||||
* @param array $date_fields:
|
* @param array $date_fields:
|
||||||
* Date fields used to filter the calendar.
|
* Date fields used to filter the calendar.
|
||||||
* If empty, defaults to array('changed') for node.changed.
|
* If empty, defaults to array('changed') for node.changed.
|
||||||
* @param array $display_fields:
|
* @param array $display_fields:
|
||||||
* Fields to display in the calendar.
|
* Fields to display in the calendar.
|
||||||
* If empty, defaults to title and date fields.
|
* If empty, defaults to title and date fields.
|
||||||
*
|
*
|
||||||
* @return the default calendar array.
|
* @return the default calendar array.
|
||||||
*/
|
*/
|
||||||
function calendar_views_construct($options = NULL) {
|
function calendar_views_construct($options = NULL) {
|
||||||
|
@ -76,7 +75,7 @@ $path = NULL;
|
||||||
$types = NULL;
|
$types = NULL;
|
||||||
$date_fields = NULL;
|
$date_fields = NULL;
|
||||||
$display_fields = NULL;
|
$display_fields = NULL;
|
||||||
|
|
||||||
if (empty($options)) {
|
if (empty($options)) {
|
||||||
$disabled = TRUE;
|
$disabled = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +125,7 @@ foreach ($date_fields as $key => $field_name) {
|
||||||
$cck_field = FALSE;
|
$cck_field = FALSE;
|
||||||
}
|
}
|
||||||
$fields[$alias] = $alias;
|
$fields[$alias] = $alias;
|
||||||
|
|
||||||
// Add a sort for each date field:
|
// Add a sort for each date field:
|
||||||
$sort_fields[$field_name] = array(
|
$sort_fields[$field_name] = array(
|
||||||
'order' => 'ASC',
|
'order' => 'ASC',
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
<?php
|
<?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.
|
* The plugin that handles calendar attachment displays.
|
||||||
*
|
*
|
||||||
* Adding year/month/day/week pages as attachments makes it
|
* Adding year/month/day/week pages as attachments makes it
|
||||||
* possible to use any style type, so they could be tables,
|
* possible to use any style type, so they could be tables,
|
||||||
* lists, teasers, or nodes as well as traditional calendar
|
* lists, teasers, or nodes as well as traditional calendar
|
||||||
* pages.
|
* pages.
|
||||||
*
|
*
|
||||||
* Force 'inherit_arguments' and 'inherit_filters' to TRUE,
|
* Force 'inherit_arguments' and 'inherit_filters' to TRUE,
|
||||||
* and 'attachment_position' to 'after', and don't display
|
* and 'attachment_position' to 'after', and don't display
|
||||||
* those options in the UI.
|
* 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.
|
* to choose what calendar period this display represents.
|
||||||
*/
|
*/
|
||||||
class calendar_plugin_display_attachment extends views_plugin_display_attachment {
|
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);
|
return $this->view->style_plugin->render($this->view->result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an array of possible display periods.
|
* 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();
|
$types = calendar_display_types();
|
||||||
$default = $this->get_option('calendar_type');
|
$default = $this->get_option('calendar_type');
|
||||||
if (!array_key_exists($default, $types)) $default = 'month';
|
if (!array_key_exists($default, $types)) $default = 'month';
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inspect argument and view information to see which calendar
|
* 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.
|
* if there are values.
|
||||||
*/
|
*/
|
||||||
function display_granularity($display_id) {
|
function display_granularity($display_id) {
|
||||||
|
|
||||||
$arguments = $this->view->get_items('argument', $display_id);
|
$arguments = $this->view->get_items('argument', $display_id);
|
||||||
$wildcard = '';
|
$wildcard = '';
|
||||||
$argument = '';
|
$argument = '';
|
||||||
|
@ -84,19 +83,19 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
||||||
}
|
}
|
||||||
return $view_granularity;
|
return $view_granularity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display validation.
|
* Display validation.
|
||||||
*/
|
*/
|
||||||
function validate() {
|
function validate() {
|
||||||
$errors = parent::validate();
|
$errors = parent::validate();
|
||||||
|
|
||||||
$arguments = $this->display->handler->get_option('arguments');
|
$arguments = $this->display->handler->get_option('arguments');
|
||||||
if (!in_array('date_argument', array_keys($arguments))) {
|
if (!in_array('date_argument', array_keys($arguments))) {
|
||||||
if (empty($this->view->date_info->arg_missing)) {
|
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') {
|
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||||
if (empty($this->view->date_info->arg_missing_default)) {
|
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;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attach only the appropriate displays for the current argument.
|
* Attach only the appropriate displays for the current argument.
|
||||||
*/
|
*/
|
||||||
function attach_to($display_id) {
|
function attach_to($display_id) {
|
||||||
$display_granularity = $this->calendar_type();
|
$display_granularity = $this->calendar_type();
|
||||||
$view_granularity = $this->display_granularity($display_id);
|
$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.
|
// don't attach it, just exit.
|
||||||
if ($view_granularity != $display_granularity) {
|
if ($view_granularity != $display_granularity) {
|
||||||
unset($this->display);
|
unset($this->display);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->date_info->parent_id = $display_id;
|
$this->view->date_info->parent_id = $display_id;
|
||||||
|
|
||||||
// See if we're attaching to a block rather than a page.
|
// 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_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_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'];
|
$this->view->date_info->calendar_date_link = $this->view->display[$display_id]->handler->options['calendar_date_link'];
|
||||||
}
|
}
|
||||||
parent::attach_to($display_id);
|
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->display_granularity = $this->calendar_type();
|
||||||
$this->view->date_info->calendar_type = $this->calendar_type();
|
$this->view->date_info->calendar_type = $this->calendar_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
function query() {
|
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.
|
// 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->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');
|
$this->view->query->add_field('node', 'vid');
|
||||||
}
|
}
|
||||||
parent::query();
|
parent::query();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override some of the parent options.
|
* 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_argments'] = TRUE;
|
||||||
$display['inherit_filters'] = TRUE;
|
$display['inherit_filters'] = TRUE;
|
||||||
$display['attachment_position'] = 'after';
|
$display['attachment_position'] = 'after';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add custom option definitions.
|
* 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());
|
$options['calendar_type'] = array('default' => $this->calendar_type());
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
function options_form(&$form, &$form_state) {
|
function options_form(&$form, &$form_state) {
|
||||||
// It is very important to call the parent function here:
|
// It is very important to call the parent function here:
|
||||||
parent::options_form($form, $form_state);
|
parent::options_form($form, $form_state);
|
||||||
|
|
||||||
switch ($form_state['section']) {
|
switch ($form_state['section']) {
|
||||||
case 'calendar_type':
|
case 'calendar_type':
|
||||||
$form['#title'] .= t('Calendar period');
|
$form['#title'] .= t('Calendar period');
|
||||||
|
@ -210,7 +209,7 @@ class calendar_plugin_display_attachment extends views_plugin_display_attachment
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide the summary for attachment options in the views UI.
|
* 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(
|
$categories['calendar_settings'] = array(
|
||||||
'title' => t('Calendar settings'),
|
'title' => t('Calendar settings'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$options['calendar_type'] = array(
|
$options['calendar_type'] = array(
|
||||||
'category' => 'calendar_settings',
|
'category' => 'calendar_settings',
|
||||||
'title' => t('Calendar period'),
|
'title' => t('Calendar period'),
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?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 plugin that handles a calendar block.
|
||||||
*
|
*
|
||||||
* The only style option that will be available is the calendar
|
* The only style option that will be available is the calendar
|
||||||
* style, which creates the navigation and links to other calendar
|
* style, which creates the navigation and links to other calendar
|
||||||
* displays. All options for paging, row plugins, etc. are
|
* 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) {
|
function init(&$view, &$display, $options = NULL) {
|
||||||
parent::init($view, $display, $options);
|
parent::init($view, $display, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display validation.
|
* Display validation.
|
||||||
*/
|
*/
|
||||||
function validate() {
|
function validate() {
|
||||||
$errors = parent::validate();
|
$errors = parent::validate();
|
||||||
|
|
||||||
$arguments = $this->display->handler->get_option('arguments');
|
$arguments = $this->display->handler->get_option('arguments');
|
||||||
if (!in_array('date_argument', array_keys($arguments))) {
|
if (!in_array('date_argument', array_keys($arguments))) {
|
||||||
if (empty($this->view->date_info->arg_missing)) {
|
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;
|
$this->view->date_info->arg_missing = TRUE;
|
||||||
}
|
}
|
||||||
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
elseif ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||||
if (empty($this->view->date_info->arg_missing_default)) {
|
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;
|
$this->view->date_info->arg_missing_default = TRUE;
|
||||||
}
|
}
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_style_type() { return 'calendar'; }
|
function get_style_type() { return 'calendar'; }
|
||||||
|
|
||||||
function defaultable_sections($section = NULL) {
|
function defaultable_sections($section = NULL) {
|
||||||
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
|
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -58,11 +57,11 @@ class calendar_plugin_display_block extends views_plugin_display_block {
|
||||||
$display['defaults']['items_per_page'] = FALSE;
|
$display['defaults']['items_per_page'] = FALSE;
|
||||||
$display['defaults']['row_plugin'] = FALSE;
|
$display['defaults']['row_plugin'] = FALSE;
|
||||||
$display['defaults']['row_options'] = FALSE;
|
$display['defaults']['row_options'] = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The display block handler returns the structure necessary for a block.
|
* 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
|
* TODO This can be removed when the patch at http://drupal.org/node/290328
|
||||||
* gets into an official release.
|
* gets into an official release.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
<?php
|
<?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 plugin that handles a full calendar page.
|
||||||
*
|
*
|
||||||
* The only style option that will be available is the calendar
|
* The only style option that will be available is the calendar
|
||||||
* style, which creates the navigation and links to other calendar
|
* style, which creates the navigation and links to other calendar
|
||||||
* displays. All options for paging, row plugins, etc. are
|
* displays. All options for paging, row plugins, etc. are
|
||||||
* deferred to the attachments.
|
* deferred to the attachments.
|
||||||
*/
|
*/
|
||||||
class calendar_plugin_display_page extends views_plugin_display_page {
|
class calendar_plugin_display_page extends views_plugin_display_page {
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
if (!empty($this->view->date_info->forbid)) {
|
if (!empty($this->view->date_info->forbid)) {
|
||||||
drupal_not_found();
|
drupal_not_found();
|
||||||
|
@ -23,11 +22,11 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
||||||
*/
|
*/
|
||||||
function validate() {
|
function validate() {
|
||||||
$errors = parent::validate();
|
$errors = parent::validate();
|
||||||
|
|
||||||
$arguments = $this->display->handler->get_option('arguments');
|
$arguments = $this->display->handler->get_option('arguments');
|
||||||
if (!in_array('date_argument', array_keys($arguments))) {
|
if (!in_array('date_argument', array_keys($arguments))) {
|
||||||
if (empty($this->view->date_info->arg_missing)) {
|
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;
|
$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;
|
$this->view->date_info->arg_missing_default = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_style_type() { return 'calendar'; }
|
function get_style_type() { return 'calendar'; }
|
||||||
|
|
||||||
function defaultable_sections($section = NULL) {
|
function defaultable_sections($section = NULL) {
|
||||||
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
|
if (in_array($section, array('style_plugin', 'row_options', 'row_plugin', 'items_per_page'))) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -63,11 +62,11 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
||||||
$display['defaults']['row_plugin'] = FALSE;
|
$display['defaults']['row_plugin'] = FALSE;
|
||||||
$display['defaults']['row_options'] = FALSE;
|
$display['defaults']['row_options'] = FALSE;
|
||||||
$display['defaults']['items_per_page'] = FALSE;
|
$display['defaults']['items_per_page'] = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add custom option definitions.
|
* Add custom option definitions.
|
||||||
*/
|
*/
|
||||||
function option_definition () {
|
function option_definition () {
|
||||||
$options = parent::option_definition();
|
$options = parent::option_definition();
|
||||||
$options['calendar_colors'] = array('default' => array());
|
$options['calendar_colors'] = array('default' => array());
|
||||||
|
@ -91,7 +90,7 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
||||||
$categories['calendar_settings'] = array(
|
$categories['calendar_settings'] = array(
|
||||||
'title' => theme('advanced_help_topic', 'calendar', 'settings') . t('Calendar settings'),
|
'title' => theme('advanced_help_topic', 'calendar', 'settings') . t('Calendar settings'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$colors = $this->get_option('calendar_colors');
|
$colors = $this->get_option('calendar_colors');
|
||||||
$colors_taxonomy = $this->get_option('calendar_colors_taxonomy');
|
$colors_taxonomy = $this->get_option('calendar_colors_taxonomy');
|
||||||
$options['calendar_colors'] = array(
|
$options['calendar_colors'] = array(
|
||||||
|
@ -132,15 +131,15 @@ class calendar_plugin_display_page extends views_plugin_display_page {
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function popup_options() {
|
function popup_options() {
|
||||||
return array(0 => t('No'), 1 => t('Yes'));
|
return array(0 => t('No'), 1 => t('Yes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function options_form(&$form, &$form_state) {
|
function options_form(&$form, &$form_state) {
|
||||||
// It is very important to call the parent function here:
|
// It is very important to call the parent function here:
|
||||||
parent::options_form($form, $form_state);
|
parent::options_form($form, $form_state);
|
||||||
|
|
||||||
switch ($form_state['section']) {
|
switch ($form_state['section']) {
|
||||||
case 'calendar_popup':
|
case 'calendar_popup':
|
||||||
$form['#title'] .= t('Date changer');
|
$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'),
|
'#default_value' => $this->get_option('calendar_popup'),
|
||||||
'#options' => $this->popup_options(),
|
'#options' => $this->popup_options(),
|
||||||
'#description' => t('Display a popup calendar date selector?'),
|
'#description' => t('Display a popup calendar date selector?'),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'calendar_date_link':
|
case 'calendar_date_link':
|
||||||
$form['#title'] .= t('Add new date link');
|
$form['#title'] .= t('Add new date link');
|
||||||
$form['calendar_date_link'] = array(
|
$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'),
|
'#default_value' => $this->get_option('calendar_date_link'),
|
||||||
'#options' => array('' => t('No link')) + node_get_types('names'),
|
'#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.'),
|
'#description' => t('Display a link to add a new date of the specified content type. Displayed only to users with appropriate permissions.'),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'calendar_colors':
|
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">',
|
'#prefix' => '<div class="clear-block"><div style="float:left">',
|
||||||
'#suffix' => '</div>',
|
'#suffix' => '</div>',
|
||||||
);
|
);
|
||||||
$colors = $this->get_option('calendar_colors');
|
$colors = $this->get_option('calendar_colors');
|
||||||
|
|
||||||
switch ($method) {
|
switch ($method) {
|
||||||
case 'types':
|
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'));
|
variable_set('calendar_date_link_'. $form_state['values']['calendar_date_link'], $this->display->handler->get_option('path'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
<?php
|
<?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.
|
* Style plugin to create the calendar navigation and links.
|
||||||
*
|
*
|
||||||
* Used by the main calendar page and calendar block displays.
|
* Used by the main calendar page and calendar block displays.
|
||||||
*/
|
*/
|
||||||
class calendar_plugin_style extends views_plugin_style {
|
class calendar_plugin_style extends views_plugin_style {
|
||||||
/**
|
/**
|
||||||
* Init will be called after construct, when the plugin is attached to a
|
* 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) {
|
function init(&$view, &$display, $options = NULL) {
|
||||||
parent::init($view, $display, $options);
|
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();
|
$view->date_info->display_types = $this->display_types();
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_types($granularity = NULL, $option_type = 'names') {
|
function display_types($granularity = NULL, $option_type = 'names') {
|
||||||
$ids = array();
|
$ids = array();
|
||||||
$names = array();
|
$names = array();
|
||||||
|
@ -39,7 +38,7 @@ class calendar_plugin_style extends views_plugin_style {
|
||||||
}
|
}
|
||||||
return $$option_type;
|
return $$option_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calendar argument date fields used in this view.
|
* Calendar argument date fields used in this view.
|
||||||
*/
|
*/
|
||||||
|
@ -61,7 +60,7 @@ class calendar_plugin_style extends views_plugin_style {
|
||||||
}
|
}
|
||||||
return ($date_fields);
|
return ($date_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Style validation.
|
* Style validation.
|
||||||
*/
|
*/
|
||||||
|
@ -71,11 +70,11 @@ class calendar_plugin_style extends views_plugin_style {
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
$style = $this->display->display_options['style_plugin'];
|
$style = $this->display->display_options['style_plugin'];
|
||||||
|
|
||||||
$arguments = $this->display->handler->get_option('arguments');
|
$arguments = $this->display->handler->get_option('arguments');
|
||||||
if (!in_array('date_argument', array_keys($arguments))) {
|
if (!in_array('date_argument', array_keys($arguments))) {
|
||||||
if (empty($this->view->date_info->arg_missing)) {
|
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->view->date_info->arg_missing = TRUE;
|
||||||
$this->date_info->arg_fields = array();
|
$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'];
|
$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 ($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date') {
|
||||||
if (empty($this->view->date_info->arg_missing_default)) {
|
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;
|
$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.
|
// in the calendar style.
|
||||||
if ($style == 'calendar_style') {
|
if ($style == 'calendar_style') {
|
||||||
$view_fields = date_api_fields($this->view->base_table);
|
$view_fields = date_api_fields($this->view->base_table);
|
||||||
|
@ -123,14 +122,14 @@ class calendar_plugin_style extends views_plugin_style {
|
||||||
}
|
}
|
||||||
|
|
||||||
function query() {
|
function query() {
|
||||||
|
|
||||||
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
|
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_sql.inc');
|
||||||
|
|
||||||
$style_options = $this->view->style_plugin->options;
|
$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.
|
// calendar display we need to create.
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($this->view->argument as $id => $argument) {
|
foreach ($this->view->argument as $id => $argument) {
|
||||||
if ($argument->field == 'date_argument') {
|
if ($argument->field == 'date_argument') {
|
||||||
// TODO Decide if we want to provide a date here or not.
|
// 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->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->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;
|
$this->view->date_info->forbid = isset($argument->forbid) ? $argument->forbid : FALSE;
|
||||||
|
|
||||||
// Stop after the first date argument, if there is more than one.
|
// Stop after the first date argument, if there is more than one.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -163,15 +162,15 @@ class calendar_plugin_style extends views_plugin_style {
|
||||||
$this->view->date_info->display_types = $this->display_types();
|
$this->view->date_info->display_types = $this->display_types();
|
||||||
$keys = drupal_map_assoc(array_keys(calendar_display_types()));
|
$keys = drupal_map_assoc(array_keys(calendar_display_types()));
|
||||||
$this->view->date_info->calendar_type = $keys[$this->view->date_info->granularity];
|
$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
|
// bring the node type into the query so we can use it in the theme
|
||||||
if ($this->view->base_table == 'node') {
|
if ($this->view->base_table == 'node') {
|
||||||
$this->view->query->add_field('node', 'type');
|
$this->view->query->add_field('node', 'type');
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::query();
|
parent::query();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the calendar navigation style.
|
* 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());
|
return theme($this->theme_functions(), $this->view, $this->options, array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?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.
|
* 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
|
* 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) {
|
function init(&$view, &$display, $options = NULL) {
|
||||||
parent::init($view, $display, $options);
|
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_times = calendar_groupby_times($this->options['groupby_times']);
|
||||||
}
|
}
|
||||||
$view->date_info->style_groupby_field = $this->options['groupby_field'];
|
$view->date_info->style_groupby_field = $this->options['groupby_field'];
|
||||||
|
|
||||||
// TODO make this an option setting.
|
// TODO make this an option setting.
|
||||||
$view->date_info->style_show_empty_times = !empty($this->options['groupby_times_custom']) ? TRUE : FALSE;
|
$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.
|
// Make sure views does't try to limit the number of items in this view.
|
||||||
$this->view->pager['items_per_page'] = 0;
|
$this->view->pager['items_per_page'] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set default options
|
* 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')),
|
'#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.'),
|
'#description' => t('The way day of week names should be displayed in a calendar.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['with_weekno'] = array(
|
$form['with_weekno'] = array(
|
||||||
'#title' => t('Show week numbers'),
|
'#title' => t('Show week numbers'),
|
||||||
'#default_value' => $this->options['with_weekno'],
|
'#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."),
|
'#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,
|
// 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();
|
$field_options = array();
|
||||||
$date_field_options = array();
|
$date_field_options = array();
|
||||||
$fields = $this->display->handler->get_option('fields');
|
$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."),
|
'#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,
|
'#options' => array('' => '') + $field_options,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (module_exists('calendar_multiday')) {
|
if (module_exists('calendar_multiday')) {
|
||||||
$form['multiday_theme'] = array(
|
$form['multiday_theme'] = array(
|
||||||
'#title' => t('Multi-day style'),
|
'#title' => t('Multi-day style'),
|
||||||
'#default_value' => $this->options['multiday_theme'],
|
'#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')),
|
'#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.'),
|
'#description' => t('Select whether calendar items are displayed as overlapping items.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($form as $key => $value) {
|
foreach ($form as $key => $value) {
|
||||||
if ($value['#type'] == 'value') {
|
if ($value['#type'] == 'value') {
|
||||||
$form[$key]['#value'] = $value['#default_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;
|
$this->view->date_info->hide_admin_links = TRUE;
|
||||||
return theme($this->theme_functions(), $this->view, $this->options, array());
|
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
|
name = Calendar Popup
|
||||||
description = "Replaces the links to calendar items with a javascript popup that gracefully regresses if javascript is not enabled"
|
description = "Replaces the links to calendar items with a javascript popup that gracefully regresses if javascript is not enabled"
|
||||||
dependencies[] = calendar
|
dependencies[] = calendar
|
||||||
|
@ -11,4 +10,3 @@ version = "6.x-2.4"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "calendar"
|
project = "calendar"
|
||||||
datestamp = "1294072550"
|
datestamp = "1294072550"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: jcalendar.module,v 1.1.4.17 2010/11/21 12:24:45 karens Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* jQuery Calendar UI features.
|
* jQuery Calendar UI features.
|
||||||
|
@ -87,11 +85,11 @@ function jcalendar_theme() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrideable theme for the jcalendar popup view.
|
* Overrideable theme for the jcalendar popup view.
|
||||||
*
|
*
|
||||||
* Defaults to show the standard teaser view of the node.
|
* Defaults to show the standard teaser view of the node.
|
||||||
*/
|
*/
|
||||||
function theme_jcalendar_view($node) {
|
function theme_jcalendar_view($node) {
|
||||||
$output = node_view($node, TRUE);
|
$output = node_view($node, TRUE);
|
||||||
$output .= '<div id="nodelink">'. l(t('more', array(), $node->language), calendar_get_node_link($node)) .'</div>';
|
$output .= '<div id="nodelink">'. l(t('more', array(), $node->language), calendar_get_node_link($node)) .'</div>';
|
||||||
return $output;
|
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.
|
* Implementation of hook_elements.
|
||||||
*
|
*
|
||||||
* Much of the colorpicker code was adapted from the Colorpicker module.
|
* Much of the colorpicker code was adapted from the Colorpicker module.
|
||||||
* That module has no stable release yet nor any D6 branch.
|
* That module has no stable release yet nor any D6 branch.
|
||||||
*/
|
*/
|
||||||
|
@ -9,16 +8,16 @@
|
||||||
* Bind the colorpicker event to the form element
|
* Bind the colorpicker event to the form element
|
||||||
*/
|
*/
|
||||||
Drupal.behaviors.calendarColorpicker = function (context) {
|
Drupal.behaviors.calendarColorpicker = function (context) {
|
||||||
|
|
||||||
// do we have multiple calendar_colors?
|
// do we have multiple calendar_colors?
|
||||||
if ($("div.calendar_colorpicker").size() > 0) {
|
if ($("div.calendar_colorpicker").size() > 0) {
|
||||||
|
|
||||||
// loop over each calendar_color type
|
// loop over each calendar_color type
|
||||||
$("div.calendar_colorpicker").each(function() {
|
$("div.calendar_colorpicker").each(function() {
|
||||||
|
|
||||||
// create the farbtastic colorpicker
|
// create the farbtastic colorpicker
|
||||||
var farb = $.farbtastic(this);
|
var farb = $.farbtastic(this);
|
||||||
|
|
||||||
// get the id of the current matched colorpicker wrapper div
|
// get the id of the current matched colorpicker wrapper div
|
||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
|
|
||||||
|
@ -26,7 +25,7 @@ Drupal.behaviors.calendarColorpicker = function (context) {
|
||||||
$("input.calendar_colorfield").filter("." + id).each(function () {
|
$("input.calendar_colorfield").filter("." + id).each(function () {
|
||||||
// set the background colors of all of the textfields appropriately
|
// set the background colors of all of the textfields appropriately
|
||||||
farb.linkTo(this);
|
farb.linkTo(this);
|
||||||
|
|
||||||
// when clicked, they get linked to the farbtastic colorpicker that they are associated with
|
// when clicked, they get linked to the farbtastic colorpicker that they are associated with
|
||||||
$(this).click(function () {
|
$(this).click(function () {
|
||||||
farb.linkTo(this);
|
farb.linkTo(this);
|
||||||
|
@ -37,4 +36,3 @@ Drupal.behaviors.calendarColorpicker = function (context) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?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.
|
* Template to display the date box in a calendar.
|
||||||
*
|
*
|
||||||
* - $view: The view.
|
* - $view: The view.
|
||||||
|
@ -16,4 +15,4 @@
|
||||||
* - $items: An array of items for this day.
|
* - $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
|
<?php
|
||||||
// $Id: calendar-day-node.tpl.php,v 1.2.2.4 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view item as a calendar day node.
|
* Template to display a view item as a calendar day node.
|
||||||
*
|
*
|
||||||
* $node
|
* $node
|
||||||
* A node object for this calendar item. Note this is
|
* A node object for this calendar item. Note this is
|
||||||
* not a complete node object, but it will have $node->nid
|
* not a complete node object, but it will have $node->nid
|
||||||
* that you can use to load the full object, and
|
* that you can use to load the full object, and
|
||||||
* $node->type to tell the content type of the node.
|
* $node->type to tell the content type of the node.
|
||||||
*
|
*
|
||||||
* $fields
|
* $fields
|
||||||
* An array of information for every field selected in the 'Fields'
|
* An array of information for every field selected in the 'Fields'
|
||||||
* section of this view, formatted as requested in the View setup.
|
* section of this view, formatted as requested in the View setup.
|
||||||
*
|
*
|
||||||
* Calendar info for this individual calendar item is in local time --
|
* Calendar info for this individual calendar item is in local time --
|
||||||
* the user timezone where configurable timezones are allowed and set,
|
* the user timezone where configurable timezones are allowed and set,
|
||||||
* otherwise the site timezone. If this item has extends over more than
|
* 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
|
* 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
|
* the current day and calendar_end will be no later than the end
|
||||||
* of the current day.
|
* of the current day.
|
||||||
*
|
*
|
||||||
* $calendar_start - A formatted datetime start date for this item.
|
* $calendar_start - A formatted datetime start date for this item.
|
||||||
* i.e. '2008-05-12 05:26:15'.
|
* i.e. '2008-05-12 05:26:15'.
|
||||||
* $calendar_end - A formatted datetime end date for this item,
|
* $calendar_end - A formatted datetime end date for this item,
|
||||||
* the same as the start date except for fields that have from/to
|
* 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_start_date - a PHP date object for the start time.
|
||||||
* $calendar_end_date - a PHP date object for the end 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
|
* You can use PHP date functions on the date object to display date
|
||||||
* information in other ways, like:
|
* information in other ways, like:
|
||||||
*
|
*
|
||||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_day_node.
|
* @see template_preprocess_calendar_day_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
@ -45,9 +44,9 @@
|
||||||
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
||||||
<?php if ($field['label']): ?>
|
<?php if ($field['label']): ?>
|
||||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php print $field['data']; ?>
|
<?php print $field['data']; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-day.tpl.php,v 1.7.2.10 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar day, grouped by time
|
* Template to display a view as a calendar day, grouped by time
|
||||||
* and optionally organized into columns by a field value.
|
* and optionally organized into columns by a field value.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_day.
|
* @see template_preprocess_calendar_day.
|
||||||
*
|
*
|
||||||
* $rows: The rendered data for this day.
|
* $rows: The rendered data for this day.
|
||||||
|
@ -15,17 +14,17 @@
|
||||||
* $rows['items'] - an array of timed items for the day.
|
* $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]['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]['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.
|
* items for a time period and field column.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $columns: an array of column names.
|
* $columns: an array of column names.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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
|
* 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.
|
* evenly over the remaining 90% of the table.
|
||||||
*/
|
*/
|
||||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
|
@ -57,7 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($rows['items'] as $hour): ?>
|
<?php foreach ($rows['items'] as $hour): ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -73,9 +72,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-main.tpl.php,v 1.2.2.4 2009/01/10 20:04:18 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display calendar navigation and links.
|
* Template to display calendar navigation and links.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_main.
|
* @see template_preprocess_calendar_main.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
|
@ -13,7 +12,7 @@
|
||||||
* $mini: Whether this is a mini view.
|
* $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.
|
* $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.
|
* $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('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($calendar_add_date)) print $calendar_add_date; ?>
|
||||||
<?php if (empty($block)) print theme('links', $calendar_links);?>
|
<?php if (empty($block)) print theme('links', $calendar_links);?>
|
||||||
<?php print theme('date_navigation', $view) ?>
|
<?php print theme('date_navigation', $view) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-mini.tpl.php,v 1.1.2.7 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a mini calendar month.
|
* Template to display a view as a mini calendar month.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_mini.
|
* @see template_preprocess_calendar_mini.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $day_names: An array of the day of week names for the table header.
|
||||||
|
@ -11,17 +10,17 @@
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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
|
* $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.
|
* 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);
|
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
?>
|
?>
|
||||||
<div class="calendar-calendar"><div class="month-view">
|
<div class="calendar-calendar"><div class="month-view">
|
||||||
<?php if ($view->date_info->show_title): ?>
|
<?php if ($view->date_info->show_title): ?>
|
||||||
<?php print theme('date_navigation', $view); ?>
|
<?php print theme('date_navigation', $view); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<table class="mini">
|
<table class="mini">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -44,4 +43,4 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month-multiple-node.tpl.php,v 1.1.2.6 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a summary of the days items as a calendar month node.
|
* Template to display a summary of the days items as a calendar month node.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_month_multiple_node.
|
* @see template_preprocess_calendar_month_multiple_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
@ -17,12 +16,12 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
<?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) ?>
|
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month-node.tpl.php,v 1.2.2.6 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view item as a calendar month node.
|
* Template to display a view item as a calendar month node.
|
||||||
*
|
*
|
||||||
* $node
|
* $node
|
||||||
* A node object for this calendar item. Note this is
|
* A node object for this calendar item. Note this is
|
||||||
* not a complete node object, but it will have $node->nid
|
* not a complete node object, but it will have $node->nid
|
||||||
* that you can use to load the full object, and
|
* that you can use to load the full object, and
|
||||||
* $node->type to tell the content type of the node.
|
* $node->type to tell the content type of the node.
|
||||||
*
|
*
|
||||||
* $fields
|
* $fields
|
||||||
* An array of information for every field selected in the 'Fields'
|
* An array of information for every field selected in the 'Fields'
|
||||||
* section of this view, formatted as requested in the View setup.
|
* section of this view, formatted as requested in the View setup.
|
||||||
*
|
*
|
||||||
* Calendar info for this individual calendar item is in local time --
|
* Calendar info for this individual calendar item is in local time --
|
||||||
* the user timezone where configurable timezones are allowed and set,
|
* the user timezone where configurable timezones are allowed and set,
|
||||||
* otherwise the site timezone. If this item has extends over more than
|
* 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
|
* 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
|
* the current day and calendar_end will be no later than the end
|
||||||
* of the current day.
|
* of the current day.
|
||||||
*
|
*
|
||||||
* $calendar_start - A formatted datetime start date for this item.
|
* $calendar_start - A formatted datetime start date for this item.
|
||||||
* i.e. '2008-05-12 05:26:15'.
|
* i.e. '2008-05-12 05:26:15'.
|
||||||
* $calendar_end - A formatted datetime end date for this item,
|
* $calendar_end - A formatted datetime end date for this item,
|
||||||
* the same as the start date except for fields that have from/to
|
* 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_start_date - a PHP date object for the start time.
|
||||||
* $calendar_end_date - a PHP date object for the end 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
|
* You can use PHP date functions on the date object to display date
|
||||||
* information in other ways, like:
|
* information in other ways, like:
|
||||||
*
|
*
|
||||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_month_node.
|
* @see template_preprocess_calendar_month_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
@ -45,9 +44,9 @@
|
||||||
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
||||||
<?php if ($field['label']): ?>
|
<?php if ($field['label']): ?>
|
||||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php print $field['data']; ?>
|
<?php print $field['data']; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-month.tpl.php,v 1.6.2.3 2008/06/19 22:55:56 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar month.
|
* Template to display a view as a calendar month.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_month.
|
* @see template_preprocess_calendar_month.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $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.
|
* $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.
|
* $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.
|
* $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
|
* it is in the form: calendar-nid-field_name-delta
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
//dsm('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
?>
|
?>
|
||||||
|
@ -43,4 +42,4 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week-multiple-node.tpl.php,v 1.1.2.5 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a summary of the days items as a calendar week node.
|
* Template to display a summary of the days items as a calendar week node.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week_multiple_node.
|
* @see template_preprocess_calendar_week_multiple_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="view-item view-item-<?php print $view->name ?>">
|
<div class="view-item view-item-<?php print $view->name ?>">
|
||||||
<div class="<?php print $curday; ?> calendar weekview">
|
<div class="<?php print $curday; ?> calendar weekview">
|
||||||
|
@ -16,12 +15,12 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
<div class="view-item <?php print views_css_safe('view-item-'. $view->name) ?>">
|
||||||
<?php if ($view->date_info->style_max_items_behavior != 'more'): ?>
|
<?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) ?>
|
<?php print l(t('Click to see all @count events', array('@count' => $count)), $link) ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
<div class="calendar-more"><?php print l(t('more'), $link) ?>»</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week-node.tpl.php,v 1.2.2.3 2010/11/21 13:19:37 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view item as a calendar week node.
|
* Template to display a view item as a calendar week node.
|
||||||
*
|
*
|
||||||
* $node
|
* $node
|
||||||
* A node object for this calendar item. Note this is
|
* A node object for this calendar item. Note this is
|
||||||
* not a complete node object, but it will have $node->nid
|
* not a complete node object, but it will have $node->nid
|
||||||
* that you can use to load the full object, and
|
* that you can use to load the full object, and
|
||||||
* $node->type to tell the content type of the node.
|
* $node->type to tell the content type of the node.
|
||||||
*
|
*
|
||||||
* $fields
|
* $fields
|
||||||
* An array of information for every field selected in the 'Fields'
|
* An array of information for every field selected in the 'Fields'
|
||||||
* section of this view, formatted as requested in the View setup.
|
* section of this view, formatted as requested in the View setup.
|
||||||
*
|
*
|
||||||
* Calendar info for this individual calendar item is in local time --
|
* Calendar info for this individual calendar item is in local time --
|
||||||
* the user timezone where configurable timezones are allowed and set,
|
* the user timezone where configurable timezones are allowed and set,
|
||||||
* otherwise the site timezone. If this item has extends over more than
|
* 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
|
* 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
|
* the current day and calendar_end will be no later than the end
|
||||||
* of the current day.
|
* of the current day.
|
||||||
*
|
*
|
||||||
* $calendar_start - A formatted datetime start date for this item.
|
* $calendar_start - A formatted datetime start date for this item.
|
||||||
* i.e. '2008-05-12 05:26:15'.
|
* i.e. '2008-05-12 05:26:15'.
|
||||||
* $calendar_end - A formatted datetime end date for this item,
|
* $calendar_end - A formatted datetime end date for this item,
|
||||||
* the same as the start date except for fields that have from/to
|
* 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_start_date - a PHP date object for the start time.
|
||||||
* $calendar_end_date - a PHP date object for the end 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
|
* You can use PHP date functions on the date object to display date
|
||||||
* information in other ways, like:
|
* information in other ways, like:
|
||||||
*
|
*
|
||||||
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
* print date_format($calendar_start_date, 'l, j F Y - g:ia');
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week_node.
|
* @see template_preprocess_calendar_week_node.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="view-item view-item-<?php print $view->name ?>">
|
<div class="view-item view-item-<?php print $view->name ?>">
|
||||||
<div class="<?php print $node->date_id; ?> calendar weekview">
|
<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']; ?>">
|
<div class="view-field view-data-<?php print $field['id']; ?> <?php print $field['id']; ?>">
|
||||||
<?php if ($field['label']): ?>
|
<?php if ($field['label']): ?>
|
||||||
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
<div class="view-label-<?php print $field['id'] ?>"><?php print $field['label'] ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php print $field['data']; ?>
|
<?php print $field['data']; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-week.tpl.php,v 1.5.2.6 2009/02/16 23:46:22 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar week.
|
* Template to display a view as a calendar week.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_week.
|
* @see template_preprocess_calendar_week.
|
||||||
*
|
*
|
||||||
* $day_names: An array of the day of week names for the table header.
|
* $day_names: An array of the day of week names for the table header.
|
||||||
* $rows: The rendered data for this week.
|
* $rows: The rendered data for this week.
|
||||||
*
|
*
|
||||||
* For each day of the week, you have:
|
* For each day of the week, you have:
|
||||||
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
* $rows['date'] - the date for this day, formatted as YYYY-MM-DD.
|
||||||
* $rows['datebox'] - the formatted datebox for this day.
|
* $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]['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]['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.
|
* $rows['items'][$time_period]['values'] - An array of formatted items for a time period.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $min_date_formatted: The minimum date for this calendar in the format YYYY-MM-DD HH:MM:SS.
|
* $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.
|
* $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('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
//dsm($rows);
|
//dsm($rows);
|
||||||
|
@ -55,7 +54,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($items as $time): ?>
|
<?php foreach ($items as $time): ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -71,10 +70,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: calendar-year.tpl.php,v 1.6.2.1 2008/06/14 11:38:34 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Template to display a view as a calendar year.
|
* Template to display a view as a calendar year.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_calendar_year.
|
* @see template_preprocess_calendar_year.
|
||||||
*
|
*
|
||||||
* $view: The view.
|
* $view: The view.
|
||||||
* $months: An array with a formatted month calendar for each month of the year.
|
* $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.
|
* $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.
|
* $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('Display: '. $display_type .': '. $min_date_formatted .' to '. $max_date_formatted);
|
||||||
?>
|
?>
|
||||||
|
@ -18,10 +17,10 @@
|
||||||
<div class="calendar-calendar"><div class="year-view">
|
<div class="calendar-calendar"><div class="year-view">
|
||||||
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
|
<table <?php if ($mini): ?> class="mini"<?php endif; ?>>
|
||||||
<tbody>
|
<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[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[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[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[10] ?></td><td><?php print $months[11] ?></td><td><?php print $months[12] ?></td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: theme.inc,v 1.10.2.80 2011/01/03 12:45:27 karens Exp $
|
|
||||||
/**
|
/**
|
||||||
* Display a calendar navigation and links
|
* Display a calendar navigation and links
|
||||||
*/
|
*/
|
||||||
|
@ -28,7 +27,7 @@ function template_preprocess_calendar_main(&$vars) {
|
||||||
}
|
}
|
||||||
elseif (!empty($view->date_info->week)) {
|
elseif (!empty($view->date_info->week)) {
|
||||||
$week = date_week_range($view->date_info->week, $view->date_info->year);
|
$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)) {
|
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');
|
$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.
|
// If an 'Add new ... link is provided, add it here.
|
||||||
// the query will bring the user back here after adding the node.
|
// 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'))) {
|
&& (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);
|
$name = node_get_types('name', $view->date_info->calendar_date_link);
|
||||||
$href = 'node/add/'. str_replace('_', '-', $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(
|
$vars['calendar_links']['calendar calendar-add'] = $base + array(
|
||||||
'title' => t('Add+'),
|
'title' => t('Add+'),
|
||||||
'href' => $href,
|
'href' => $href,
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$vars['view'] = $view;
|
$vars['view'] = $view;
|
||||||
$vars['mini'] = !empty($view->date_info->mini);
|
$vars['mini'] = !empty($view->date_info->mini);
|
||||||
$vars['block'] = !empty($view->date_info->block);
|
$vars['block'] = !empty($view->date_info->block);
|
||||||
$vars['block_identifier'] = date_block_identifier($view);
|
$vars['block_identifier'] = date_block_identifier($view);
|
||||||
|
@ -97,7 +96,7 @@ function template_preprocess_calendar_main(&$vars) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a view as a calendar.
|
* Display a view as a calendar.
|
||||||
*
|
*
|
||||||
* This preprocessor does all the work needed for all types of 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.
|
* views and the template takes care of displaying links to related views.
|
||||||
*/
|
*/
|
||||||
|
@ -117,7 +116,7 @@ function template_preprocess_calendar(&$vars) {
|
||||||
$fields = $view->field;
|
$fields = $view->field;
|
||||||
|
|
||||||
// Render each field into an output array. We have to do the rendering
|
// 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.
|
// handlers in the theme functions.
|
||||||
$items = array();
|
$items = array();
|
||||||
$calendar_fields = date_api_fields($view->base_table);
|
$calendar_fields = date_api_fields($view->base_table);
|
||||||
|
@ -136,7 +135,7 @@ function template_preprocess_calendar(&$vars) {
|
||||||
}
|
}
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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)) {
|
if (!empty($field) && is_object($field)) {
|
||||||
// Theme the copy instead of the original row so duplicate date
|
// Theme the copy instead of the original row so duplicate date
|
||||||
// fields each get a fresh copy of the original data to theme.
|
// fields each get a fresh copy of the original data to theme.
|
||||||
|
@ -176,7 +175,7 @@ function template_preprocess_calendar(&$vars) {
|
||||||
$vars['rows'] = $rows;
|
$vars['rows'] = $rows;
|
||||||
|
|
||||||
$view->date_info->calendar_processed = TRUE;
|
$view->date_info->calendar_processed = TRUE;
|
||||||
$vars['view'] = $view;
|
$vars['view'] = $view;
|
||||||
$vars['mini'] = !empty($view->date_info->mini);
|
$vars['mini'] = !empty($view->date_info->mini);
|
||||||
$vars['block'] = !empty($view->date_info->block);
|
$vars['block'] = !empty($view->date_info->block);
|
||||||
}
|
}
|
||||||
|
@ -265,8 +264,8 @@ function template_preprocess_calendar_year(&$vars) {
|
||||||
$view = $vars['view'];
|
$view = $vars['view'];
|
||||||
$year = date_format($view->date_info->min_date, 'Y');
|
$year = date_format($view->date_info->min_date, 'Y');
|
||||||
|
|
||||||
// Construct a calendar for each month, adjusting the $view passed
|
// Construct a calendar for each month, adjusting the $view passed
|
||||||
// to the theme so it will produce the right results.
|
// to the theme so it will produce the right results.
|
||||||
$view = drupal_clone($vars['view']);
|
$view = drupal_clone($vars['view']);
|
||||||
$rows = $vars['rows'];
|
$rows = $vars['rows'];
|
||||||
$months = array();
|
$months = array();
|
||||||
|
@ -322,7 +321,7 @@ function template_preprocess_calendar_day(&$vars) {
|
||||||
$grouped_items = array();
|
$grouped_items = array();
|
||||||
foreach ($rows['all_day'] as $item) {
|
foreach ($rows['all_day'] as $item) {
|
||||||
if (isset($item->{$grouping_field})) {
|
if (isset($item->{$grouping_field})) {
|
||||||
$column = $item->{$grouping_field};
|
$column = $item->{$grouping_field};
|
||||||
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
|
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
|
||||||
if (!in_array($column, $columns)) {
|
if (!in_array($column, $columns)) {
|
||||||
$columns[] = $column;
|
$columns[] = $column;
|
||||||
|
@ -339,7 +338,7 @@ function template_preprocess_calendar_day(&$vars) {
|
||||||
|
|
||||||
// Moved timed items into the right columns and render them.
|
// Moved timed items into the right columns and render them.
|
||||||
$start_times = $view->date_info->style_groupby_times;
|
$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';
|
$end_start_time = '23:59:59';
|
||||||
$start_time = array_shift($start_times);
|
$start_time = array_shift($start_times);
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
|
$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.
|
// slots if the option to show empty times was chosen.
|
||||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||||
if ((!empty($show_empty_times)) && !array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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)) {
|
if (!empty($show_empty_times)) {
|
||||||
while ($start_time < $end_start_time) {
|
while ($start_time < $end_start_time) {
|
||||||
if (!array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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';
|
$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']);
|
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
|
||||||
$grouped_items[$start_time]['hour'] = $heading['hour'];
|
$grouped_items[$start_time]['hour'] = $heading['hour'];
|
||||||
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
ksort($grouped_items);
|
ksort($grouped_items);
|
||||||
$vars['rows']['items'] = $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.
|
// 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';
|
$end_start_time = '23:59:59';
|
||||||
|
|
||||||
$grouped_items = array();
|
$grouped_items = array();
|
||||||
|
@ -477,15 +476,15 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
// slots if the option to show empty times was chosen.
|
// slots if the option to show empty times was chosen.
|
||||||
while ($time >= $next_start_time && $time < $end_start_time) {
|
while ($time >= $next_start_time && $time < $end_start_time) {
|
||||||
if (($show_empty_times) && !array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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';
|
$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);
|
$grouped_items[$start_time]['values'][$weekno][] = theme($theme, $item, $view);
|
||||||
$item_count++;
|
$item_count++;
|
||||||
$by_hour_count++;
|
$by_hour_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +492,7 @@ function template_preprocess_calendar_week(&$vars) {
|
||||||
if ($show_empty_times) {
|
if ($show_empty_times) {
|
||||||
while ($start_time < $end_start_time) {
|
while ($start_time < $end_start_time) {
|
||||||
if (!array_key_exists($start_time, $grouped_items)) {
|
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;
|
$start_time = $next_start_time;
|
||||||
$next_start_time = count($start_times) ? array_shift($start_times) : $end_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';
|
$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']);
|
$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]['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['day_names'] = $day_names;
|
||||||
$vars['columns'] = $columns;
|
$vars['columns'] = $columns;
|
||||||
|
@ -566,7 +565,7 @@ function template_preprocess_calendar_node(&$vars) {
|
||||||
$fields = array();
|
$fields = array();
|
||||||
foreach ($view->field as $name => $field) {
|
foreach ($view->field as $name => $field) {
|
||||||
// Some fields, like the node edit and delete links, have no alias.
|
// 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)) {
|
if (!empty($node->$field_alias)) {
|
||||||
$data = $node->$field_alias;
|
$data = $node->$field_alias;
|
||||||
$label = $field->options['label'];
|
$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,
|
// We added the node type to the results in the query,
|
||||||
// but it will show up as $node->node_type instead of
|
// 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.
|
// would show up on a node object.
|
||||||
$vars['node']->type = $vars['node']->node_type;
|
$vars['node']->type = $vars['node']->node_type;
|
||||||
}
|
}
|
||||||
|
@ -704,7 +703,7 @@ function theme_calendar_stripe_legend() {
|
||||||
array('class' => 'calendar-legend', 'data' => t('Key'))
|
array('class' => 'calendar-legend', 'data' => t('Key'))
|
||||||
);
|
);
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$output = '';
|
$output = '';
|
||||||
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
|
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
|
||||||
if($stripe){
|
if($stripe){
|
||||||
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'"> </div>');
|
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'"> </div>');
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
; $Id$
|
|
||||||
|
|
||||||
core = 6.x
|
core = 6.x
|
||||||
api = 2
|
api = 2
|
||||||
|
|
||||||
|
@ -7,4 +5,4 @@ projects[] = drupal
|
||||||
|
|
||||||
libraries[ckeditor][download][type] = "svn"
|
libraries[ckeditor][download][type] = "svn"
|
||||||
libraries[ckeditor][download][url] = "http://svn.ckeditor.com/CKEditor/releases/stable/"
|
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
|
name = Content Taxonomy
|
||||||
description = Defines a field type for taxonomy terms
|
description = Defines a field type for taxonomy terms
|
||||||
dependencies[] = content
|
dependencies[] = content
|
||||||
dependencies[] = taxonomy
|
dependencies[] = taxonomy
|
||||||
package = CCK
|
package = CCK
|
||||||
core = 6.x
|
core = 6.x
|
||||||
|
@ -12,4 +11,3 @@ version = "6.x-1.0-rc2"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "content_taxonomy"
|
project = "content_taxonomy"
|
||||||
datestamp = "1250688034"
|
datestamp = "1250688034"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: $
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
|
@ -41,16 +38,16 @@ function content_taxonomy_disable() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implemenation of hook_update_N().
|
* Implemenation of hook_update_N().
|
||||||
*
|
*
|
||||||
* updates existing fields from 5.x to 6.x
|
* updates existing fields from 5.x to 6.x
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_update_6000() {
|
function content_taxonomy_update_6000() {
|
||||||
if ($abort = content_check_update('content_taxonomy')) {
|
if ($abort = content_check_update('content_taxonomy')) {
|
||||||
return $abort;
|
return $abort;
|
||||||
}
|
}
|
||||||
|
|
||||||
drupal_load('module', 'content');
|
drupal_load('module', 'content');
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
// Get the latest cache values and schema.
|
// Get the latest cache values and schema.
|
||||||
|
@ -65,7 +62,7 @@ function content_taxonomy_update_6000() {
|
||||||
case 'content_taxonomy':
|
case 'content_taxonomy':
|
||||||
$db_info = content_database_info($field);
|
$db_info = content_database_info($field);
|
||||||
$table = $db_info['table'];
|
$table = $db_info['table'];
|
||||||
|
|
||||||
//fix old settings first and map them to the new ones.
|
//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']);
|
$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)) {
|
while ($field = db_fetch_array($result)) {
|
||||||
|
@ -76,7 +73,7 @@ function content_taxonomy_update_6000() {
|
||||||
$field['type_name'] = $type_name;
|
$field['type_name'] = $type_name;
|
||||||
$field['columns'] = $db_info['columns'];
|
$field['columns'] = $db_info['columns'];
|
||||||
content_alter_schema(array(), $field);
|
content_alter_schema(array(), $field);
|
||||||
|
|
||||||
$sql_nodes = db_query("SELECT * FROM {node} WHERE type = '%s'", $type_name);
|
$sql_nodes = db_query("SELECT * FROM {node} WHERE type = '%s'", $type_name);
|
||||||
while ($node = db_fetch_object($sql_nodes)) {
|
while ($node = db_fetch_object($sql_nodes)) {
|
||||||
$tids = content_taxonomy_install_terms_by_field($node, $field_settings);
|
$tids = content_taxonomy_install_terms_by_field($node, $field_settings);
|
||||||
|
@ -104,8 +101,8 @@ function content_taxonomy_update_6000() {
|
||||||
}
|
}
|
||||||
unset($field_settings['save']);
|
unset($field_settings['save']);
|
||||||
$field_settings['hide_taxonomy_fields'] = isset($field_settings['hide_taxonomy_fields']) ? $field_settings['hide_taxonomy_fields'] : TRUE;
|
$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();
|
$field['global_settings'] = array();
|
||||||
$setting_names = module_invoke($field['module'], 'field_settings', 'save', $field);
|
$setting_names = module_invoke($field['module'], 'field_settings', 'save', $field);
|
||||||
if (is_array($setting_names)) {
|
if (is_array($setting_names)) {
|
||||||
|
@ -117,7 +114,7 @@ function content_taxonomy_update_6000() {
|
||||||
$field['db_columns'] = $field['columns'];
|
$field['db_columns'] = $field['columns'];
|
||||||
drupal_write_record(content_field_tablename(), $field, 'field_name');
|
drupal_write_record(content_field_tablename(), $field, 'field_name');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($db_info['columns'] as $column => $attributes) {
|
foreach ($db_info['columns'] as $column => $attributes) {
|
||||||
$attributes['not null'] = FALSE;
|
$attributes['not null'] = FALSE;
|
||||||
$column = $attributes['column'];
|
$column = $attributes['column'];
|
||||||
|
@ -139,7 +136,7 @@ function content_taxonomy_update_6000() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implemenation of hook_update_N().
|
* Implemenation of hook_update_N().
|
||||||
*
|
*
|
||||||
* Renaming of the Parent setting
|
* Renaming of the Parent setting
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_update_6001() {
|
function content_taxonomy_update_6001() {
|
||||||
|
@ -167,7 +164,7 @@ function content_taxonomy_update_6001() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implemenation of hook_update_N().
|
* Implemenation of hook_update_N().
|
||||||
*
|
*
|
||||||
* Fixing parent setting
|
* Fixing parent setting
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_update_6002() {
|
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
|
$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",
|
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']);
|
$node->nid, $field['tid'], $field['vid']);
|
||||||
|
|
||||||
while ($data = db_fetch_array($result)) {
|
while ($data = db_fetch_array($result)) {
|
||||||
$terms[$data["tid"]] = $data["tid"];
|
$terms[$data["tid"]] = $data["tid"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$result = taxonomy_node_get_terms_by_vocabulary($node, $field['vid']);
|
$result = taxonomy_node_get_terms_by_vocabulary($node, $field['vid']);
|
||||||
foreach ($result as $tid => $term) {
|
foreach ($result as $tid => $term) {
|
||||||
$terms[$tid] = $tid;
|
$terms[$tid] = $tid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $terms;
|
return $terms;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// $Id: content_taxonomy.module,v 1.2.2.15.2.33 2009/08/19 12:45:58 mh86 Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Defines a field type for referencing a taxonomy term.
|
* Defines a field type for referencing a taxonomy term.
|
||||||
|
@ -63,20 +60,20 @@ function content_taxonomy_field_settings($op, $field) {
|
||||||
switch ($op) {
|
switch ($op) {
|
||||||
case 'form':
|
case 'form':
|
||||||
$form = array();
|
$form = array();
|
||||||
|
|
||||||
$form['save_term_node'] = 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).'),
|
'#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,
|
'#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();
|
$options_voc = array();
|
||||||
foreach (taxonomy_get_vocabularies() as $voc) {
|
foreach (taxonomy_get_vocabularies() as $voc) {
|
||||||
_content_taxonomy_localize_vocabulary($voc);
|
_content_taxonomy_localize_vocabulary($voc);
|
||||||
$options_voc[$voc->vid] = $voc->name;
|
$options_voc[$voc->vid] = $voc->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$form['vid'] = array(
|
$form['vid'] = array(
|
||||||
'#title' => t('Vocabulary'),
|
'#title' => t('Vocabulary'),
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
|
@ -84,13 +81,13 @@ function content_taxonomy_field_settings($op, $field) {
|
||||||
'#options' => $options_voc,
|
'#options' => $options_voc,
|
||||||
'#description' => t('Terms of the selected vocabulary get exposed to the field'),
|
'#description' => t('Terms of the selected vocabulary get exposed to the field'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['hierarchical_vocabulary'] = array(
|
$form['hierarchical_vocabulary'] = array(
|
||||||
'#type' => 'fieldset',
|
'#type' => 'fieldset',
|
||||||
'#title' => t('Advanced settings for hierarchical vocabularies'),
|
'#title' => t('Advanced settings for hierarchical vocabularies'),
|
||||||
'#collapsible' => TRUE,
|
'#collapsible' => TRUE,
|
||||||
);
|
);
|
||||||
|
|
||||||
$form['hierarchical_vocabulary']['parent'] = array(
|
$form['hierarchical_vocabulary']['parent'] = array(
|
||||||
'#title' => t('Parent Term'),
|
'#title' => t('Parent Term'),
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
|
@ -118,22 +115,22 @@ function content_taxonomy_field_settings($op, $field) {
|
||||||
'#default_value' => is_numeric($field['depth']) ? $field['depth'] : '',
|
'#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.'),
|
'#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':
|
case 'save':
|
||||||
return array('save_term_node', 'vid', 'parent', 'parent_php_code', 'depth');
|
return array('save_term_node', 'vid', 'parent', 'parent_php_code', 'depth');
|
||||||
|
|
||||||
case 'database columns':
|
case 'database columns':
|
||||||
return array(
|
return array(
|
||||||
'value' => array('type' => 'int', 'not null' => FALSE, 'sortable' => FALSE),
|
'value' => array('type' => 'int', 'not null' => FALSE, 'sortable' => FALSE),
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'views data':
|
case 'views data':
|
||||||
$data = content_views_field_views_data($field);
|
$data = content_views_field_views_data($field);
|
||||||
$table_alias = content_views_tablename($field);
|
$table_alias = content_views_tablename($field);
|
||||||
|
|
||||||
// Add a relation to the taxonomy term table.
|
// Add a relation to the taxonomy term table.
|
||||||
$data[$table_alias][$field['field_name'] .'_value']['relationship'] = array(
|
$data[$table_alias][$field['field_name'] .'_value']['relationship'] = array(
|
||||||
'handler' => 'views_handler_relationship',
|
'handler' => 'views_handler_relationship',
|
||||||
|
@ -152,7 +149,7 @@ function content_taxonomy_field_settings($op, $field) {
|
||||||
* Implementation of hook_field().
|
* Implementation of hook_field().
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
|
function content_taxonomy_field($op, &$node, $field, &$items, $teaser, $page) {
|
||||||
switch ($op) {
|
switch ($op) {
|
||||||
case 'presave':
|
case 'presave':
|
||||||
if ($field['save_term_node']) {
|
if ($field['save_term_node']) {
|
||||||
static $_content_taxonomy_array_cleared;
|
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_taxonomy_unset($node->taxonomy, array($field['vid']));
|
||||||
$_content_taxonomy_array_cleared[$node->nid][$field['vid']] = TRUE;
|
$_content_taxonomy_array_cleared[$node->nid][$field['vid']] = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($items as $key => $entry) {
|
foreach ($items as $key => $entry) {
|
||||||
if ($entry['value']) {
|
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))
|
|| (is_array($node->taxonomy) && in_array($entry['value'], $node->taxonomy))
|
||||||
|| (isset($entry['_remove']) && $entry['_remove'] == 1)) {
|
|| (isset($entry['_remove']) && $entry['_remove'] == 1)) {
|
||||||
continue;
|
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
|
// taxonomy nodeapi doesn't call taxonomy_node_save which handles removing
|
||||||
// and inserting of terms
|
// and inserting of terms
|
||||||
if (empty($node->taxonomy)) {
|
if (empty($node->taxonomy)) {
|
||||||
|
@ -251,16 +248,16 @@ function content_taxonomy_content_is_empty($item, $field) {
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_allowed_values($field) {
|
function content_taxonomy_allowed_values($field) {
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
//for opt groups call different function
|
//for opt groups call different function
|
||||||
if (isset($field['widget']['group_parent']) && $field['widget']['group_parent'] > 0) {
|
if (isset($field['widget']['group_parent']) && $field['widget']['group_parent'] > 0) {
|
||||||
return content_taxonomy_allowed_values_groups($field);
|
return content_taxonomy_allowed_values_groups($field);
|
||||||
}
|
}
|
||||||
|
|
||||||
$depth = (is_numeric($field['depth'])) ? $field['depth'] : NULL;
|
$depth = (is_numeric($field['depth'])) ? $field['depth'] : NULL;
|
||||||
|
|
||||||
$tree = taxonomy_get_tree($field['vid'], content_taxonomy_field_get_parent($field), -1, $depth);
|
$tree = taxonomy_get_tree($field['vid'], content_taxonomy_field_get_parent($field), -1, $depth);
|
||||||
|
|
||||||
if (is_array($tree)) {
|
if (is_array($tree)) {
|
||||||
foreach ($tree as $term) {
|
foreach ($tree as $term) {
|
||||||
_content_taxonomy_localize_term($term);
|
_content_taxonomy_localize_term($term);
|
||||||
|
@ -280,14 +277,14 @@ function content_taxonomy_allowed_values($field) {
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creating Opt Groups for content_taxonomy_options
|
* Creating Opt Groups for content_taxonomy_options
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_allowed_values_groups($field) {
|
function content_taxonomy_allowed_values_groups($field) {
|
||||||
$options = array();
|
$options = array();
|
||||||
$parent = content_taxonomy_field_get_parent($field);
|
$parent = content_taxonomy_field_get_parent($field);
|
||||||
$group_parent = $field['widget']['group_parent'];
|
$group_parent = $field['widget']['group_parent'];
|
||||||
|
|
||||||
//if children in no group
|
//if children in no group
|
||||||
$default_terms = taxonomy_get_children($parent, $field['vid']);
|
$default_terms = taxonomy_get_children($parent, $field['vid']);
|
||||||
foreach ($default_terms as $default_term) {
|
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);
|
_content_taxonomy_taxonomy_unset($form['taxonomy'], $_content_taxonomy_vids);
|
||||||
|
|
||||||
//hide empty 'Vocabularies' fieldsets
|
//hide empty 'Vocabularies' fieldsets
|
||||||
$empty_fieldset = TRUE;
|
$empty_fieldset = TRUE;
|
||||||
if (is_array($form['taxonomy'])) {
|
if (is_array($form['taxonomy'])) {
|
||||||
foreach ($form['taxonomy'] as $key => $value) {
|
foreach ($form['taxonomy'] as $key => $value) {
|
||||||
if (is_array($value) && !empty($value)) {
|
if (is_array($value) && !empty($value)) {
|
||||||
$empty_fieldset = FALSE;
|
$empty_fieldset = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -423,7 +420,7 @@ function content_taxonomy_views_api() {
|
||||||
*/
|
*/
|
||||||
function content_taxonomy_fields() {
|
function content_taxonomy_fields() {
|
||||||
static $ct_fields;
|
static $ct_fields;
|
||||||
|
|
||||||
if (!is_array($ct_fields)) {
|
if (!is_array($ct_fields)) {
|
||||||
$ct_fields = array();
|
$ct_fields = array();
|
||||||
foreach (content_types() as $type_name => $type) {
|
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
|
* Helper functions that returns all terms group by their vocabulary
|
||||||
*
|
*
|
||||||
* needed for some settings forms
|
* needed for some settings forms
|
||||||
|
@ -452,7 +449,7 @@ function _content_taxonomy_get_all_terms() {
|
||||||
_content_taxonomy_localize_term($term);
|
_content_taxonomy_localize_term($term);
|
||||||
$options[$voc->name][$term->tid] = str_repeat('- ', $term->depth) . $term->name;
|
$options[$voc->name][$term->tid] = str_repeat('- ', $term->depth) . $term->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
@ -489,7 +486,7 @@ function _content_taxonomy_localize_vocabulary(&$vocabulary) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* carefully unsets node or node form taxonomy items
|
* 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 $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
|
* @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) {
|
foreach ($items as $item) {
|
||||||
if (isset($item['value']) && is_numeric($item['value'])) {
|
if (isset($item['value']) && is_numeric($item['value'])) {
|
||||||
$term = taxonomy_get_term($item['value']);
|
$term = taxonomy_get_term($item['value']);
|
||||||
$return[] = $term->name;
|
$return[] = $term->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $return;
|
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
|
name = Content Taxonomy Autocomplete
|
||||||
description = Defines a autocomplete widget type for content_taxonomy
|
description = Defines a autocomplete widget type for content_taxonomy
|
||||||
dependencies[] = content
|
dependencies[] = content
|
||||||
dependencies[] = content_taxonomy
|
dependencies[] = content_taxonomy
|
||||||
dependencies[] = taxonomy
|
dependencies[] = taxonomy
|
||||||
package = CCK
|
package = CCK
|
||||||
core = 6.x
|
core = 6.x
|
||||||
|
@ -12,4 +11,3 @@ version = "6.x-1.0-rc2"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "content_taxonomy"
|
project = "content_taxonomy"
|
||||||
datestamp = "1250688034"
|
datestamp = "1250688034"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: content_taxonomy_autocomplete.install,v 1.1.2.2 2008/12/17 21:31:07 mh86 Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: content_taxonomy_autocomplete.module,v 1.2.2.4.2.17 2009/08/19 09:42:30 mh86 Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Defines a widget type for content_taxonomy with autocomplete
|
* 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(
|
$form['autocomplete']['extra_parent'] = array(
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#title' => t('Extra Parent for new terms'),
|
'#title' => t('Extra Parent for new terms'),
|
||||||
'#options' => _content_taxonomy_get_all_terms(),
|
'#options' => _content_taxonomy_get_all_terms(),
|
||||||
'#default_value' => (isset($widget['extra_parent']) && is_numeric($widget['extra_parent'])) ? $widget['extra_parent'] : 0,
|
'#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.'),
|
'#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(
|
$form['autocomplete']['maxlength'] = array(
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
'#title' => t('Maximum length of autocomplete'),
|
'#title' => t('Maximum length of autocomplete'),
|
||||||
'#default_value' => (isset($widget['maxlength']) && is_numeric($widget['maxlength'])) ? $widget['maxlength'] : 255,
|
'#default_value' => (isset($widget['maxlength']) && is_numeric($widget['maxlength'])) ? $widget['maxlength'] : 255,
|
||||||
'#element_validate' => array('_content_taxonomy_autocomplete_widget_settings_maxlength_validate'),
|
'#element_validate' => array('_content_taxonomy_autocomplete_widget_settings_maxlength_validate'),
|
||||||
'#required' => TRUE,
|
'#required' => TRUE,
|
||||||
|
@ -86,8 +84,8 @@ function content_taxonomy_autocomplete_widget_settings($op, $widget) {
|
||||||
);
|
);
|
||||||
if (module_exists('active_tags')) {
|
if (module_exists('active_tags')) {
|
||||||
$form['autocomplete']['active_tags'] = array(
|
$form['autocomplete']['active_tags'] = array(
|
||||||
'#type' => 'checkbox',
|
'#type' => 'checkbox',
|
||||||
'#title' => t('Use Active Tags style widget'),
|
'#title' => t('Use Active Tags style widget'),
|
||||||
'#default_value' => isset($widget['active_tags']) ? $widget['active_tags'] : 0,
|
'#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.'),
|
'#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(
|
return array(
|
||||||
'content_taxonomy_autocomplete' => array(
|
'content_taxonomy_autocomplete' => array(
|
||||||
'#input' => TRUE,
|
'#input' => TRUE,
|
||||||
'#columns' => array('value'),
|
'#columns' => array('value'),
|
||||||
'#delta' => 0,
|
'#delta' => 0,
|
||||||
'#process' => array('content_taxonomy_autocomplete_process'),
|
'#process' => array('content_taxonomy_autocomplete_process'),
|
||||||
'#autocomplete_path' => FALSE,
|
'#autocomplete_path' => FALSE,
|
||||||
|
@ -173,7 +171,7 @@ function content_taxonomy_autocomplete_process($element, $edit, $form_state, $fo
|
||||||
$field_name = $element['#field_name'];
|
$field_name = $element['#field_name'];
|
||||||
$field = $form['#field_info'][$field_name];
|
$field = $form['#field_info'][$field_name];
|
||||||
$field_key = $element['#columns'][0];
|
$field_key = $element['#columns'][0];
|
||||||
|
|
||||||
$element[$field_key] = array(
|
$element[$field_key] = array(
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
'#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : '',
|
'#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'],
|
'#columns' => $element['#columns'],
|
||||||
'#maxlength' => !empty($field['widget']['maxlength']) ? $field['widget']['maxlength'] : 255,
|
'#maxlength' => !empty($field['widget']['maxlength']) ? $field['widget']['maxlength'] : 255,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($element[$field_key]['#element_validate'])) {
|
if (empty($element[$field_key]['#element_validate'])) {
|
||||||
$element[$field_key]['#element_validate'] = array();
|
$element[$field_key]['#element_validate'] = array();
|
||||||
}
|
}
|
||||||
array_unshift($element[$field_key]['#element_validate'], 'content_taxonomy_autocomplete_validate');
|
array_unshift($element[$field_key]['#element_validate'], 'content_taxonomy_autocomplete_validate');
|
||||||
|
|
||||||
if (module_exists('active_tags') && $field['widget']['active_tags']) {
|
if (module_exists('active_tags') && $field['widget']['active_tags']) {
|
||||||
active_tags_enable_widget('#' . $element['#id'] . '-value-wrapper');
|
active_tags_enable_widget('#' . $element['#id'] . '-value-wrapper');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $element;
|
return $element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,16 +207,16 @@ function content_taxonomy_autocomplete_validate($element, &$form_state) {
|
||||||
$field_name = $element['#field_name'];
|
$field_name = $element['#field_name'];
|
||||||
$field = content_fields($field_name, $element['#type_name']);
|
$field = content_fields($field_name, $element['#type_name']);
|
||||||
$field_key = $element['#columns'][0];
|
$field_key = $element['#columns'][0];
|
||||||
|
|
||||||
//if the element parents array contains the field key, we have to remove it
|
//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)
|
//because otherwise form_set_value won't work. (still the question why is it in)
|
||||||
if ($element['#parents'][count($element['#parents'])-1] == $field_key) {
|
if ($element['#parents'][count($element['#parents'])-1] == $field_key) {
|
||||||
array_pop($element['#parents']);
|
array_pop($element['#parents']);
|
||||||
array_pop($element['#array_parents']);
|
array_pop($element['#array_parents']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = $element['#value'];
|
$value = $element['#value'];
|
||||||
|
|
||||||
$extracted_ids = content_taxonomy_autocomplete_tags_get_tids($value, $field['vid'], content_taxonomy_field_get_parent($field), $field['widget']['extra_parent']);
|
$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) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = content_taxonomy_autocomplete_form2data($extracted_ids, $field, $element);
|
$values = content_taxonomy_autocomplete_form2data($extracted_ids, $field, $element);
|
||||||
form_set_value($element, $values, $form_state);
|
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 (is_array($extracted_ids['non_existing_terms'])) {
|
||||||
if ($field['widget']['extra_parent']) {
|
if ($field['widget']['extra_parent']) {
|
||||||
$new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], $field['widget']['extra_parent']);
|
$new_tids = content_taxonomy_autocomplete_insert_tags($extracted_ids['non_existing_terms'], $field['widget']['extra_parent']);
|
||||||
}
|
}
|
||||||
else {
|
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)));
|
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
|
* Retrieve a pipe delimited string of autocomplete suggestions
|
||||||
*
|
*
|
||||||
* @param String Fieldname
|
* @param String Fieldname
|
||||||
* @param Integer TID of a parent (optional)
|
* @param Integer TID of a parent (optional)
|
||||||
* @param BOOLEAN whether a multiple field or not
|
* @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();
|
$content_type_info = _content_type_info();
|
||||||
$vid = $content_type_info['fields'][$field_name]['vid'];
|
$vid = $content_type_info['fields'][$field_name]['vid'];
|
||||||
$tid = content_taxonomy_field_get_parent($content_type_info['fields'][$field_name]);
|
$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 the menu system has splitted the search text because of slashes, glue it back.
|
||||||
if (func_num_args() > 2) {
|
if (func_num_args() > 2) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$string .= '/'. implode('/', array_slice($args, 2));
|
$string .= '/'. implode('/', array_slice($args, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// The user enters a comma-separated list of tags. We only autocomplete the last tag.
|
// The user enters a comma-separated list of tags. We only autocomplete the last tag.
|
||||||
$array = drupal_explode_tags($string);
|
$array = drupal_explode_tags($string);
|
||||||
|
|
||||||
|
@ -289,17 +287,17 @@ function content_taxonomy_autocomplete_load($field_name, $string = '') {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if ($last_string != '') {
|
if ($last_string != '') {
|
||||||
if ($tid) {
|
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
|
LEFT JOIN {term_synonym} s ON t.tid = s.tid
|
||||||
INNER JOIN {term_hierarchy} h ON t.tid = h.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'),
|
AND (LOWER(t.name) LIKE LOWER('%%%s%%') OR LOWER(s.name) LIKE LOWER('%%%s%%'))", 't', 'tid'),
|
||||||
$tid,$last_string,$last_string,0,10);
|
$tid,$last_string,$last_string,0,10);
|
||||||
}
|
}
|
||||||
else {
|
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
|
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'),
|
AND (LOWER(t.name) LIKE LOWER('%%%s%%') OR LOWER(s.name) LIKE LOWER('%%%s%%'))", 't', 'tid'),
|
||||||
$vid, $last_string, $last_string, 0, 10);
|
$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.
|
// formatting so to save the term into the DB as the user intends.
|
||||||
$typed_term = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $typed_term)));
|
$typed_term = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $typed_term)));
|
||||||
if ($typed_term == "") { continue; }
|
if ($typed_term == "") { continue; }
|
||||||
|
|
||||||
// See if the term exists in the chosen vocabulary
|
// See if the term exists in the chosen vocabulary
|
||||||
// and return the tid, otherwise, add a new record.
|
// and return the tid, otherwise, add a new record.
|
||||||
$possibilities = taxonomy_get_term_by_name($typed_term);
|
$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);
|
$parents = taxonomy_get_parents($possibility->tid);
|
||||||
if (in_array($parent, array_keys($parents)) || in_array($extra_parent, array_keys($parents))) {
|
if (in_array($parent, array_keys($parents)) || in_array($extra_parent, array_keys($parents))) {
|
||||||
$result['existing_tids'][$possibility->tid] = $possibility->tid;
|
$result['existing_tids'][$possibility->tid] = $possibility->tid;
|
||||||
$typed_term_tid = $possibility->tid;
|
$typed_term_tid = $possibility->tid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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
|
name = Content Taxonomy Options
|
||||||
description = Defines a option widget type for content_taxonomy for selects, radios/checkboxes
|
description = Defines a option widget type for content_taxonomy for selects, radios/checkboxes
|
||||||
dependencies[] = content
|
dependencies[] = content
|
||||||
dependencies[] = content_taxonomy
|
dependencies[] = content_taxonomy
|
||||||
dependencies[] = taxonomy
|
dependencies[] = taxonomy
|
||||||
dependencies[] = optionwidgets
|
dependencies[] = optionwidgets
|
||||||
package = CCK
|
package = CCK
|
||||||
|
@ -14,4 +13,3 @@ version = "6.x-1.0-rc2"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "content_taxonomy"
|
project = "content_taxonomy"
|
||||||
datestamp = "1250688034"
|
datestamp = "1250688034"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: content_taxonomy_options.install,v 1.1.2.2 2008/12/17 21:31:07 mh86 Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// $Id: content_taxonomy_options.module,v 1.1.4.7.2.4 2008/12/27 11:25:27 mh86 Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Defines a widget type for content_taxonomy for options
|
* Defines a widget type for content_taxonomy for options
|
||||||
|
@ -56,7 +53,7 @@ function content_taxonomy_options_widget_settings($op, $widget) {
|
||||||
'#weight' => 10,
|
'#weight' => 10,
|
||||||
);
|
);
|
||||||
$form['settings']['show_depth'] = array(
|
$form['settings']['show_depth'] = array(
|
||||||
'#type' => 'checkbox',
|
'#type' => 'checkbox',
|
||||||
'#title' => t('Indent child terms with \' - \' signs'),
|
'#title' => t('Indent child terms with \' - \' signs'),
|
||||||
'#default_value' => is_numeric($widget['show_depth']) ? $widget['show_depth'] : 1,
|
'#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'),
|
'#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).'),
|
'#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;
|
return $form;
|
||||||
|
|
||||||
case 'save':
|
case 'save':
|
||||||
return array('group_parent', 'show_depth');
|
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) {
|
function content_taxonomy_options_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
|
||||||
$element = array(
|
$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(),
|
'#default_value' => !empty($items) ? $items : array(),
|
||||||
);
|
);
|
||||||
return $element;
|
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
|
name = Content Taxonomy Tree
|
||||||
description = Defines a dynamic tree widget for Content Taxonomy
|
description = Defines a dynamic tree widget for Content Taxonomy
|
||||||
dependencies[] = content
|
dependencies[] = content
|
||||||
dependencies[] = content_taxonomy
|
dependencies[] = content_taxonomy
|
||||||
dependencies[] = taxonomy
|
dependencies[] = taxonomy
|
||||||
dependencies[] = taxonomy_manager
|
dependencies[] = taxonomy_manager
|
||||||
package = CCK
|
package = CCK
|
||||||
|
@ -13,4 +12,3 @@ version = "6.x-1.0-rc2"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "content_taxonomy"
|
project = "content_taxonomy"
|
||||||
datestamp = "1250688034"
|
datestamp = "1250688034"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: content_taxonomy_tree.install,v 1.1.2.2 2008/12/17 21:31:07 mh86 Exp $
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// $Id: content_taxonomy_tree.module,v 1.1.2.5 2009/05/14 16:58:22 mh86 Exp $
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_theme().
|
* Implementation of hook_theme().
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +40,7 @@ function content_taxonomy_tree_widget_settings($op, $widget) {
|
||||||
'#weight' => 10,
|
'#weight' => 10,
|
||||||
);
|
);
|
||||||
$form['settings']['expand_all'] = array(
|
$form['settings']['expand_all'] = array(
|
||||||
'#type' => 'checkbox',
|
'#type' => 'checkbox',
|
||||||
'#title' => t('Expand whole tree by default'),
|
'#title' => t('Expand whole tree by default'),
|
||||||
'#default_value' => isset($widget['expand_all']) ? $widget['expand_all'] : 0,
|
'#default_value' => isset($widget['expand_all']) ? $widget['expand_all'] : 0,
|
||||||
'#description' => t('Otherwise only branches, where a term is selected get expanded by default'),
|
'#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(
|
return array(
|
||||||
'content_taxonomy_tree' => array(
|
'content_taxonomy_tree' => array(
|
||||||
'#input' => TRUE,
|
'#input' => TRUE,
|
||||||
'#columns' => array('value'),
|
'#columns' => array('value'),
|
||||||
'#delta' => 0,
|
'#delta' => 0,
|
||||||
'#process' => array('content_taxonomy_tree_process'),
|
'#process' => array('content_taxonomy_tree_process'),
|
||||||
'#element_validate' => array('content_taxonomy_tree_validate'),
|
'#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['#value'] = content_taxonomy_tree_data2form($element, $element['#value'], $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
$element[$field_key] = array(
|
$element[$field_key] = array(
|
||||||
'#type' => 'taxonomy_manager_tree',
|
'#type' => 'taxonomy_manager_tree',
|
||||||
'#default_value' => isset($element['#value']) ? $element['#value'] : '',
|
'#default_value' => isset($element['#value']) ? $element['#value'] : '',
|
||||||
'#vid' => $field['vid'],
|
'#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(),
|
'#default_value' => is_array($element['#value']) ? $element['#value'] : array(),
|
||||||
'#render_whole_tree' => TRUE,
|
'#render_whole_tree' => TRUE,
|
||||||
'#pager' => FALSE,
|
'#pager' => FALSE,
|
||||||
|
@ -126,12 +121,12 @@ function content_taxonomy_tree_process($element, $edit, &$form_state, $form) {
|
||||||
'#title' => $element['#title'],
|
'#title' => $element['#title'],
|
||||||
'#description' => $element['#description'],
|
'#description' => $element['#description'],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Make sure field info will be available to the validator which
|
// Make sure field info will be available to the validator which
|
||||||
// does not get the values in $form.
|
// does not get the values in $form.
|
||||||
$form_state['#field_info'][$field['field_name']] = $field;
|
$form_state['#field_info'][$field['field_name']] = $field;
|
||||||
|
|
||||||
return $element;
|
return $element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +141,7 @@ function content_taxonomy_tree_validate($element, &$form_state) {
|
||||||
$field_key = $element['#columns'][0];
|
$field_key = $element['#columns'][0];
|
||||||
|
|
||||||
$values = content_taxonomy_tree_form2data($element, $form_state, $field);
|
$values = content_taxonomy_tree_form2data($element, $form_state, $field);
|
||||||
|
|
||||||
//check for required fields
|
//check for required fields
|
||||||
//if $element['#value'] is empty, it's validated by form.inc
|
//if $element['#value'] is empty, it's validated by form.inc
|
||||||
//otherwise we have to check this by our own
|
//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'])) {
|
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_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);
|
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)) {
|
if (!is_array($selected_terms) || !count($selected_terms)) {
|
||||||
$selected_terms[] = NULL;
|
$selected_terms[] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$form_state['#field_info'][$field['field_name']] = $field;
|
$form_state['#field_info'][$field['field_name']] = $field;
|
||||||
return content_transpose_array_rows_cols(array($element['#columns'][0] => array_values($selected_terms)));
|
return content_transpose_array_rows_cols(array($element['#columns'][0] => array_values($selected_terms)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs.admin.inc,v 1.1.2.3.2.33 2011/01/08 03:32:24 mgn Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Admin page callback file for the custom_breadcrumbs module.
|
* 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(
|
$custom_breadcrumbs_sort = variable_get('custom_breadcrumbs_sort', array(
|
||||||
'direction' => array('name' => 'asc', 'breadcrumb_type' => 'asc', 'language' => 'asc'),
|
'direction' => array('name' => 'asc', 'breadcrumb_type' => 'asc', 'language' => 'asc'),
|
||||||
'column' => 'name'));
|
'column' => 'name'));
|
||||||
$sort = $custom_breadcrumbs_sort['direction'];
|
$sort = $custom_breadcrumbs_sort['direction'];
|
||||||
$multilingual = _custom_breadcrumbs_multilingual();
|
$multilingual = _custom_breadcrumbs_multilingual();
|
||||||
$breadcrumbs = array();
|
$breadcrumbs = array();
|
||||||
// Read session variable to load breadcrumbs of type and language selected by user.
|
// Read session variable to load breadcrumbs of type and language selected by user.
|
||||||
|
@ -35,7 +34,7 @@ function custom_breadcrumbs_page() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($modules)) {
|
if (empty($modules)) {
|
||||||
$modules = module_implements('cb_breadcrumb_info');
|
$modules = module_implements('cb_breadcrumb_info');
|
||||||
}
|
}
|
||||||
foreach ($modules as $key => $module) {
|
foreach ($modules as $key => $module) {
|
||||||
$more = custom_breadcrumbs_load_breadcrumbs($module, $tables[$key], NULL, $languages);
|
$more = custom_breadcrumbs_load_breadcrumbs($module, $tables[$key], NULL, $languages);
|
||||||
|
@ -61,7 +60,7 @@ function custom_breadcrumbs_page() {
|
||||||
// Add an arrow indicating sort direction.
|
// Add an arrow indicating sort direction.
|
||||||
$image = array($order => theme('tablesort_indicator', $sort[$order]));
|
$image = array($order => theme('tablesort_indicator', $sort[$order]));
|
||||||
|
|
||||||
$headers = array();
|
$headers = array();
|
||||||
foreach ($columns as $key => $title) {
|
foreach ($columns as $key => $title) {
|
||||||
$options = array('attributes' => array('title' => t('sort by @s', array('@s' => $title))));
|
$options = array('attributes' => array('title' => t('sort by @s', array('@s' => $title))));
|
||||||
$options['query'] = 'order=' . $key . '&sort=' . $sort[$key];
|
$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));
|
$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);
|
$output .= theme('table', $headers, $rows);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
@ -105,17 +104,17 @@ function custom_breadcrumbs_page() {
|
||||||
* @param $bc2
|
* @param $bc2
|
||||||
* Second breadcrumb object.
|
* Second breadcrumb object.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* 0 if the two objects have equal ranking,
|
* 0 if the two objects have equal ranking,
|
||||||
* 1 if the first object is greater than the second,
|
* 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) {
|
function _custom_breadcrumbs_sort_cmp($bc1, $bc2) {
|
||||||
$custom_breadcrumbs_sort = variable_get('custom_breadcrumbs_sort', array(
|
$custom_breadcrumbs_sort = variable_get('custom_breadcrumbs_sort', array(
|
||||||
'direction' => array('name' => 'asc', 'breadcrumb_type' => 'asc', 'language' => 'asc'),
|
'direction' => array('name' => 'asc', 'breadcrumb_type' => 'asc', 'language' => 'asc'),
|
||||||
'column' => 'name')
|
'column' => 'name')
|
||||||
);
|
);
|
||||||
$options = array('name', 'breadcrumb_type', 'language');
|
$options = array('name', 'breadcrumb_type', 'language');
|
||||||
$first = $custom_breadcrumbs_sort['column'];
|
$first = $custom_breadcrumbs_sort['column'];
|
||||||
$keys = array_keys($options, $first);
|
$keys = array_keys($options, $first);
|
||||||
$key = array_pop($keys);
|
$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[0] == $bc2->$options[0]) {
|
||||||
if ($bc1->$options[1] == $bc2->$options[1]) {
|
if ($bc1->$options[1] == $bc2->$options[1]) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return ($bc1->$options[1] > $bc2->$options[1]) ? $sortdir[$options[1]] : -1*$sortdir[$options[1]];
|
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]];
|
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 {
|
else {
|
||||||
// If PHP is used, don't validate number of paths and titles.
|
// 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)) {
|
(strpos($form_state['values']['paths'], '<?php') !== FALSE)) {
|
||||||
$check = 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.');
|
$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')) {
|
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 ?>'));
|
$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(
|
$form['titles'] = array(
|
||||||
'#type' => 'textarea',
|
'#type' => 'textarea',
|
||||||
|
@ -538,7 +537,7 @@ function custom_breadcrumbs_admin_settings() {
|
||||||
$form['adv_settings']['module_weights']['table'] = custom_breadcrumbs_module_weight();
|
$form['adv_settings']['module_weights']['table'] = custom_breadcrumbs_module_weight();
|
||||||
if (!empty($form['adv_settings']['module_weights']['table'])) {
|
if (!empty($form['adv_settings']['module_weights']['table'])) {
|
||||||
$form['adv_settings']['module_weights']['table']['#theme'] = 'custom_breadcrumbs_module_weight';
|
$form['adv_settings']['module_weights']['table']['#theme'] = 'custom_breadcrumbs_module_weight';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unset($form['adv_settings']['module_weights']);
|
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
|
name = Custom Breadcrumbs
|
||||||
package = Custom Breadcrumbs
|
package = Custom Breadcrumbs
|
||||||
description = Allows administrators to define custom breadcrumb trails for node types.
|
description = Allows administrators to define custom breadcrumb trails for node types.
|
||||||
|
@ -12,4 +11,3 @@ version = "6.x-2.0-rc1"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "custom_breadcrumbs"
|
project = "custom_breadcrumbs"
|
||||||
datestamp = "1294462254"
|
datestamp = "1294462254"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs.install,v 1.3.2.3.2.14 2011/01/08 03:53:17 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Install file for the custom_breadcrumbs module.
|
* Install file for the custom_breadcrumbs module.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs.module,v 1.6.2.5.2.48 2011/01/02 20:51:22 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Provide custom breadcrumbs for node-type pages and base functionality
|
* Provide custom breadcrumbs for node-type pages and base functionality
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_common.inc,v 1.1.2.9 2010/05/03 22:49:15 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Common helper functions used by custom breadcrumbs submodules.
|
* Common helper functions used by custom breadcrumbs submodules.
|
||||||
|
@ -11,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* @param $curpath
|
* @param $curpath
|
||||||
* The current Drupal path.
|
* The current Drupal path.
|
||||||
* @param $breadcrumb_path
|
* @param $breadcrumb_path
|
||||||
* The path that the breadcrumb applies to.
|
* The path that the breadcrumb applies to.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
|
@ -90,7 +88,7 @@ function _custom_breadcrumbs_allowed_display($display) {
|
||||||
* The $display->handler->view->args array.
|
* The $display->handler->view->args array.
|
||||||
*
|
*
|
||||||
* @return $arg_values
|
* @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.
|
* corresponding to the views arguments.
|
||||||
*/
|
*/
|
||||||
function _custom_breadcrumbs_views_parse_args($arguments, $viewargs) {
|
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
|
name = Custom Breadcrumbs Identifiers
|
||||||
package = Custom Breadcrumbs
|
package = Custom Breadcrumbs
|
||||||
description = Provides special identifiers for custom breadcrumbs.
|
description = Provides special identifiers for custom breadcrumbs.
|
||||||
|
@ -10,4 +9,3 @@ version = "6.x-2.0-rc1"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "custom_breadcrumbs"
|
project = "custom_breadcrumbs"
|
||||||
datestamp = "1294462254"
|
datestamp = "1294462254"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_identifiers.module,v 1.1.2.7 2010/12/30 18:36:25 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Provide special identifiers for use with custom breadcrumbs.
|
* 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.
|
// Optionally wrap plain text crumb in span tag with class identifiers.
|
||||||
if (variable_get('custom_breadcrumbs_none_span', FALSE)) {
|
if (variable_get('custom_breadcrumbs_none_span', FALSE)) {
|
||||||
$class = 'custom-breadcrumbs-none';
|
$class = 'custom-breadcrumbs-none';
|
||||||
$attributes = $obj['attributes']['attributes'];
|
$attributes = $obj['attributes']['attributes'];
|
||||||
if (!empty($attributes['class'])) {
|
if (!empty($attributes['class'])) {
|
||||||
$attributes['class'] .= ' ' . $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
|
name = Custom Breadcrumbs for Panels
|
||||||
package = Custom Breadcrumbs
|
package = Custom Breadcrumbs
|
||||||
dependencies[] = custom_breadcrumbs
|
dependencies[] = custom_breadcrumbs
|
||||||
|
@ -16,4 +15,3 @@ version = "6.x-2.0-rc1"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "custom_breadcrumbs"
|
project = "custom_breadcrumbs"
|
||||||
datestamp = "1294462254"
|
datestamp = "1294462254"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_panels.install,v 1.1.2.3 2010/05/03 22:49:15 mgn Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Install file for the custom_breadcrumbs_panels module.
|
* Install file for the custom_breadcrumbs_panels module.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_panels.module,v 1.1.2.9 2010/12/30 18:36:25 mgn Exp $
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Provide custom breadcrumbs for panels pages.
|
* 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)) {
|
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');
|
module_load_include('inc', 'custom_breadcrumbs_taxonomy');
|
||||||
foreach ($contexts as $context) {
|
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
|
name = Custom Breadcrumbs for Paths
|
||||||
package = Custom Breadcrumbs
|
package = Custom Breadcrumbs
|
||||||
dependencies[] = custom_breadcrumbs
|
dependencies[] = custom_breadcrumbs
|
||||||
|
@ -13,4 +12,3 @@ version = "6.x-2.0-rc1"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "custom_breadcrumbs"
|
project = "custom_breadcrumbs"
|
||||||
datestamp = "1294462254"
|
datestamp = "1294462254"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_paths.install,v 1.1.2.7 2010/05/03 22:49:15 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Install file for the custom_breadcrumbs module.
|
* Install file for the custom_breadcrumbs module.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_paths.module,v 1.1.2.26 2010/12/30 18:36:25 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Assign custom breadcrumbs based on the Drupal path.
|
* Assign custom breadcrumbs based on the Drupal path.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_taxonomy.admin.inc,v 1.1.2.8 2010/04/25 20:52:23 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Administration pages for custom_breadcrumbs_taxonomy.
|
* Administration pages for custom_breadcrumbs_taxonomy.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_taxonomy.inc,v 1.1.2.19 2010/12/30 18:36:25 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Helper functions for custom_breadcrumbs_taxonomy.
|
* Helper functions for custom_breadcrumbs_taxonomy.
|
||||||
|
@ -179,7 +177,7 @@ function custom_breadcrumbs_taxonomy_node_get_lightest_term($node) {
|
||||||
if (!empty($terms)) {
|
if (!empty($terms)) {
|
||||||
if (count($terms) > 1) {
|
if (count($terms) > 1) {
|
||||||
foreach ($terms as $term) {
|
foreach ($terms as $term) {
|
||||||
// Only consider terms in the lightest vocabulary.
|
// Only consider terms in the lightest vocabulary.
|
||||||
if (!isset($vid)) {
|
if (!isset($vid)) {
|
||||||
$vid = $term->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
|
name = Custom Breadcrumbs for Taxonomy
|
||||||
description = "Enables taxonomy based breadcrumbs and allows for node assosciations with taxonomy terms."
|
description = "Enables taxonomy based breadcrumbs and allows for node assosciations with taxonomy terms."
|
||||||
package = Custom Breadcrumbs
|
package = Custom Breadcrumbs
|
||||||
|
@ -11,4 +10,3 @@ version = "6.x-2.0-rc1"
|
||||||
core = "6.x"
|
core = "6.x"
|
||||||
project = "custom_breadcrumbs"
|
project = "custom_breadcrumbs"
|
||||||
datestamp = "1294462254"
|
datestamp = "1294462254"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_taxonomy.install,v 1.1.2.10 2011/01/08 03:53:17 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* Install file for the custom_breadcrumbs_taxonomy module.
|
* Install file for the custom_breadcrumbs_taxonomy module.
|
||||||
|
@ -131,7 +129,7 @@ function custom_breadcrumbs_taxonomy_schema() {
|
||||||
),
|
),
|
||||||
'primary key' => array('bid'),
|
'primary key' => array('bid'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$schema['custom_breadcrumbs_taxonomy_vocabulary'] = array(
|
$schema['custom_breadcrumbs_taxonomy_vocabulary'] = array(
|
||||||
'description' => 'Stores custom breadcrumbs for taxonomy vocabularies',
|
'description' => 'Stores custom breadcrumbs for taxonomy vocabularies',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
|
@ -211,6 +209,6 @@ function custom_breadcrumbs_taxonomy_update_6200() {
|
||||||
$ret = array();
|
$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_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.'));
|
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;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id: custom_breadcrumbs_taxonomy.module,v 1.1.2.26 2010/12/30 18:36:25 mgn Exp $
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* This module implements taxonomy_based breadcrumbs using a hybrid of methods
|
* 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
|
* - The HOME breadcrumb (if present) links to the home page. The text
|
||||||
* displayed for HOME is administrator configurable on the custom_breadcrumbs
|
* displayed for HOME is administrator configurable on the custom_breadcrumbs
|
||||||
* settings page.
|
* settings page.
|
||||||
* - The VOCABULARY breadcrumb (if present) will link to an administrator
|
* - The VOCABULARY breadcrumb (if present) will link to an administrator
|
||||||
* defined page. If the VOCABULARY does not have an administrator
|
* defined page. If the VOCABULARY does not have an administrator
|
||||||
* defined page, it will not appear in the breadcrumb trail.
|
* defined page, it will not appear in the breadcrumb trail.
|
||||||
|
@ -25,8 +23,8 @@
|
||||||
* mysite >> term >> term
|
* mysite >> term >> term
|
||||||
* home >> vocabulary >> term >> term
|
* home >> vocabulary >> term >> term
|
||||||
* 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
|
* 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
|
* 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
|
* 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() {
|
function custom_breadcrumbs_taxonomy_cb_breadcrumb_info() {
|
||||||
$breadcrumb_type_info = array();
|
$breadcrumb_type_info = array();
|
||||||
$breadcrumb_type_info['taxonomy_vocabulary'] = array(
|
$breadcrumb_type_info['taxonomy_vocabulary'] = array(
|
||||||
'table' => 'custom_breadcrumbs_taxonomy_vocabulary',
|
'table' => 'custom_breadcrumbs_taxonomy_vocabulary',
|
||||||
'field' => 'vid',
|
'field' => 'vid',
|
||||||
'type' => 'taxonomy_vocabulary',
|
'type' => 'taxonomy_vocabulary',
|
||||||
'name_constructor' => '_custom_breadcrumbs_taxonomy_vocabulary_breadcrumb_name'
|
'name_constructor' => '_custom_breadcrumbs_taxonomy_vocabulary_breadcrumb_name'
|
||||||
);
|
);
|
||||||
$breadcrumb_type_info['taxonomy_term'] = array(
|
$breadcrumb_type_info['taxonomy_term'] = array(
|
||||||
'table' => 'custom_breadcrumbs_taxonomy_term',
|
'table' => 'custom_breadcrumbs_taxonomy_term',
|
||||||
'field' => 'tid',
|
'field' => 'tid',
|
||||||
'type' => 'taxonomy_term',
|
'type' => 'taxonomy_term',
|
||||||
'name_constructor' => '_custom_breadcrumbs_taxonomy_term_breadcrumb_name'
|
'name_constructor' => '_custom_breadcrumbs_taxonomy_term_breadcrumb_name'
|
||||||
);
|
);
|
||||||
|
@ -71,7 +69,7 @@ function custom_breadcrumbs_taxonomy_cb_breadcrumb_info() {
|
||||||
*
|
*
|
||||||
* @param $breadcrumb
|
* @param $breadcrumb
|
||||||
* The breadcrumb object.
|
* The breadcrumb object.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* A text string that will be used as the breadcrumb name.
|
* 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();
|
$names = array();
|
||||||
$parents = taxonomy_get_parents_all($breadcrumb->tid);
|
$parents = taxonomy_get_parents_all($breadcrumb->tid);
|
||||||
while ($parent = array_shift($parents)) {
|
while ($parent = array_shift($parents)) {
|
||||||
$names[] = $parent->name;
|
$names[] = $parent->name;
|
||||||
}
|
}
|
||||||
$term = taxonomy_get_term($breadcrumb->tid);
|
$term = taxonomy_get_term($breadcrumb->tid);
|
||||||
$vocabulary = taxonomy_vocabulary_load($term->vid);
|
$vocabulary = taxonomy_vocabulary_load($term->vid);
|
||||||
$names[] = $vocabulary->name;
|
$names[] = $vocabulary->name;
|
||||||
$names = array_reverse($names);
|
$names = array_reverse($names);
|
||||||
$output = implode('>', $names);
|
$output = implode('>', $names);
|
||||||
return $output;
|
return $output;
|
||||||
|
@ -94,7 +92,7 @@ function _custom_breadcrumbs_taxonomy_term_breadcrumb_name($breadcrumb) {
|
||||||
*
|
*
|
||||||
* @param $breadcrumb
|
* @param $breadcrumb
|
||||||
* The breadcrumb object.
|
* The breadcrumb object.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* A text string that will be used as the breadcrumb name.
|
* 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.
|
* Implements hook_cb_node_form_table.
|
||||||
*
|
*
|
||||||
* @param $node
|
* @param $node
|
||||||
* The node object being edited
|
* The node object being edited
|
||||||
*
|
*
|
||||||
* @return $breadcrumbs
|
* @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
|
* @param $nodetype
|
||||||
* The node type being considered for a custom breadcrumb.
|
* 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