Removed obsolete $ in source files
This commit is contained in:
parent
a39c010e06
commit
e5f2b64d98
146 changed files with 836 additions and 1081 deletions
|
@ -1,15 +1,14 @@
|
|||
<?php
|
||||
//$Id: calendar.views_default.inc,v 1.1.2.23 2010/11/28 23:31:28 karens Exp $
|
||||
/**
|
||||
* Set up so it can be used as an API to create default calendars for
|
||||
* specific date fields.
|
||||
*
|
||||
*
|
||||
* Use variable_set() to establish criteria for default calendars.
|
||||
* Set the variable in custom modules or in settings.
|
||||
*
|
||||
* Set the variable in custom modules or in settings.
|
||||
*
|
||||
* Example: Add a new default calendar to custom
|
||||
* calendars that are already configured:
|
||||
*
|
||||
*
|
||||
* $options = variable_get('calendar_default_view_options', array());
|
||||
* $option = array(
|
||||
* 'name' => 'example_event',
|
||||
|
@ -20,19 +19,19 @@
|
|||
* );
|
||||
* $options[] = $option;
|
||||
* variable_set('calendar_default_view_options', $options);
|
||||
*
|
||||
*
|
||||
*/
|
||||
function calendar_views_default_views() {
|
||||
$views = array();
|
||||
|
||||
|
||||
// Construct the default view with default options.
|
||||
$view = calendar_views_construct();
|
||||
$views[$view->name] = $view;
|
||||
|
||||
// Then see if there are any custom calendars to be created
|
||||
|
||||
// Then see if there are any custom calendars to be created
|
||||
// using variable_get().
|
||||
$calendar_options = variable_get('calendar_default_view_options', array());
|
||||
|
||||
|
||||
foreach ((array) $calendar_options as $calendar_option) {
|
||||
$view = calendar_views_construct($calendar_option);
|
||||
$views[$view->name] = $view;
|
||||
|
@ -41,31 +40,31 @@ function calendar_views_default_views() {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Construct a default calendar to match specified options.
|
||||
* Views calls it without options, so the basic
|
||||
* Views calls it without options, so the basic
|
||||
* default view will use the default values.
|
||||
*
|
||||
* @param $options: an optional array of options to
|
||||
*
|
||||
* @param $options: an optional array of options to
|
||||
* create default calendars.
|
||||
*
|
||||
*
|
||||
* Possible options include:
|
||||
* @param string $name:
|
||||
* @param string $name:
|
||||
* The view name, if empty, defaults to 'calendar'.
|
||||
* @param string $description:
|
||||
* @param string $description:
|
||||
* The view description, if empty, defaults to generic description.
|
||||
* @param string $path:
|
||||
* @param string $path:
|
||||
* The view url, if empty, defaults to 'calendar'.
|
||||
* @param array $types:
|
||||
* Array of content types to limit the calendar to those types.
|
||||
* @param array $types:
|
||||
* Array of content types to limit the calendar to those types.
|
||||
* If empty, defaults to no type filter.
|
||||
* @param array $date_fields:
|
||||
* @param array $date_fields:
|
||||
* Date fields used to filter the calendar.
|
||||
* If empty, defaults to array('changed') for node.changed.
|
||||
* @param array $display_fields:
|
||||
* @param array $display_fields:
|
||||
* Fields to display in the calendar.
|
||||
* If empty, defaults to title and date fields.
|
||||
*
|
||||
*
|
||||
* @return the default calendar array.
|
||||
*/
|
||||
function calendar_views_construct($options = NULL) {
|
||||
|
@ -76,7 +75,7 @@ $path = NULL;
|
|||
$types = NULL;
|
||||
$date_fields = NULL;
|
||||
$display_fields = NULL;
|
||||
|
||||
|
||||
if (empty($options)) {
|
||||
$disabled = TRUE;
|
||||
}
|
||||
|
@ -126,7 +125,7 @@ foreach ($date_fields as $key => $field_name) {
|
|||
$cck_field = FALSE;
|
||||
}
|
||||
$fields[$alias] = $alias;
|
||||
|
||||
|
||||
// Add a sort for each date field:
|
||||
$sort_fields[$field_name] = array(
|
||||
'order' => 'ASC',
|
||||
|
|
Reference in a new issue