Removed obsolete $ in source files

This commit is contained in:
Manuel Cillero 2017-08-29 14:13:02 +02:00
parent a39c010e06
commit e5f2b64d98
146 changed files with 836 additions and 1081 deletions

View file

@ -1,5 +1,4 @@
<?php
// $Id: calendar-view-ical.tpl.php,v 1.1.2.5 2010/11/21 12:25:12 karens Exp $
/**
* $calname
* The name of the calendar.
@ -7,7 +6,7 @@
* The name of the site timezone.
* $events
* An array with the following information about each event:
*
*
* $event['uid'] - a unique id for the event (usually the url).
* $event['summary'] - the name of the event.
* $event['start'] - the formatted start date of the event.
@ -17,10 +16,10 @@
* $event['url'] - the url for the event.
* $event['location'] - the name of the event location.
* $event['description'] - a description of the event.
*
*
* Note that there are empty spaces after RRULE, URL, LOCATION, etc
* that are needed to make sure we get the required line break.
*
*
*/
?>

View file

@ -1,4 +1,3 @@
; $Id: calendar_ical.info,v 1.1.2.1 2008/09/05 11:03:42 karens Exp $
name = Calendar iCal
description = Adds ical functionality to Calendar views.
dependencies[] = views
@ -14,4 +13,3 @@ version = "6.x-2.4"
core = "6.x"
project = "calendar"
datestamp = "1294072550"

View file

@ -1,6 +1,4 @@
<?php
// $Id: calendar_ical.install,v 1.1.2.6 2010/02/28 14:23:48 karens Exp $
/**
* Implementation of hook_install().
*/
@ -13,7 +11,7 @@ function calendar_ical_install() {
*/
function calendar_ical_uninstall() {
$displays = array(
'ical',
'ical',
);
db_query("DELETE FROM {views_display} WHERE display_plugin IN ('". implode("','", $displays) ."')");
db_query("DELETE FROM {cache_views}");
@ -51,4 +49,4 @@ function calendar_ical_update_6000() {
$ret[] = array('success' => TRUE, 'query' => 'Updated calendar ical displays to use new handlers and ids.');
views_invalidate_cache();
return $ret;
}
}

View file

@ -1,6 +1,4 @@
<?php
// $Id: calendar_ical.module,v 1.1.2.6 2008/11/24 15:48:15 karens Exp $
/**
* Implementation of hook_views_api().
*
@ -29,4 +27,4 @@ function theme_calendar_ical_icon($url) {
if ($image = theme('image', drupal_get_path('module', 'date_api') .'/images/ical16x16.gif', t('Add to calendar'), t('Add to calendar'))) {
return '<div style="text-align:right"><a href="'. check_url($url) .'" class="ical-icon" title="ical">'. $image .'</a></div>';
}
}
}

View file

@ -1,6 +1,4 @@
<?php
//$Id: calendar_ical.views.inc,v 1.1.2.6 2009/02/16 23:46:22 karens Exp $
//views_include_handlers();
/**
* Implementation of hook_views_plugins
*/
@ -79,4 +77,4 @@ function calendar_ical_views_plugins() {
),
);
return $data;
}
}

View file

@ -1,5 +1,4 @@
<?php
//$Id: calendar_ical_admin.inc,v 1.1.2.2 2008/10/02 20:23:49 karens Exp $
/**
* @file
* Setup and admin functions.

View file

@ -1,16 +1,15 @@
<?php
// $Id: calendar_plugin_display_ical.inc,v 1.1.2.5 2008/11/25 16:12:36 karens Exp $
/**
* The plugin that handles a feed, such as RSS or atom.
*
* For the most part, feeds are page displays but with some subtle differences.
*/
class calendar_plugin_display_ical extends views_plugin_display_page {
function get_style_type() { return 'ical'; }
function uses_breadcrumb() { return FALSE; }
/**
* Feeds do not go through the normal page theming mechanism. Instead, they
* go through their own little theme function and then return NULL so that
@ -188,23 +187,23 @@ class calendar_plugin_display_ical extends views_plugin_display_page {
$plugin->attach_to($display_id, $this->get_path(), $clone->get_title());
}
}
/**
* Display validation.
*/
function validate() {
$errors = parent::validate();
$arguments = $this->display->handler->get_option('arguments');
$filters = $this->display->handler->get_option('filters');
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
if (empty($this->view->date_info->arg_missing)) {
$errors[] = t("A Calendar period display will not work without a Date argument or a Date filter.");
$errors[] = t("A Calendar period display will not work without a Date argument or a Date filter.");
}
$this->view->date_info->arg_missing = TRUE;
$this->view->date_info->arg_missing = TRUE;
}
if (array_key_exists('date_argument', $arguments) &&
if (array_key_exists('date_argument', $arguments) &&
($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date')) {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
@ -213,6 +212,5 @@ class calendar_plugin_display_ical extends views_plugin_display_page {
}
return $errors;
}
}
}

View file

@ -1,5 +1,4 @@
<?php
// $Id: calendar_plugin_style_ical.inc,v 1.1.2.17 2009/04/28 22:47:29 karens Exp $
/**
* Default style plugin to render an iCal feed.
*/
@ -9,14 +8,14 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
$fields = $display->handler->default_display->options['fields'];
$this->options['fields'] = $fields;
}
function query() {
// We need these values for the iCal feed.
$this->view->query->add_field('node', 'title');
$this->view->query->add_field('node', 'type');
parent::query();
}
function attach_to($display_id, $path, $title) {
$display = $this->view->display[$display_id]->handler;
$url_options = array();
@ -24,7 +23,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
if ($input) {
$url_options['query'] = $input;
}
// TODO adjust this to pick up default values when no arg is set?
$url = url($this->view->get_url(NULL, $path), $url_options);
if (empty($this->view->feed_icon)) {
@ -50,14 +49,14 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
$options['location_field'] = '';
$options['fields'] = array();
}
function option_definition() {
$options = parent::option_definition();
$options['summary_field'] = array('default' => '', 'translatable' => TRUE);
$options['description_field'] = array('default' => '', 'translatable' => TRUE);
$options['location_field'] = array('default' => '', 'translatable' => TRUE);
return $options;
}
@ -68,7 +67,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
$options[$field['field']] = $handler->ui_name();
}
$form['#prefix'] = '<div class="form-item">'. t("Map the View fields to the values they should represent in the iCal feed. Only fields that have been added to the view are available to use in this way. You can add additional fields to the view and mark them 'Exclude from display' if you only want them in the iCal feed.") .'</div>';
$form['summary_field'] = array(
'#type' => 'select',
'#title' => t('Title'),
@ -88,7 +87,7 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
'#default_value' => $this->options['location_field'],
'#options' => $options,
);
}
/**
@ -96,30 +95,30 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
*/
function validate() {
$errors = parent::validate();
$style = $this->display->display_options['style_plugin'];
$arguments = $this->display->handler->get_option('arguments');
$filters = $this->display->handler->get_option('filters');
if (!array_key_exists('date_argument', $arguments) && !array_key_exists('date_filter', $filters)) {
if (empty($this->view->date_info->arg_missing)) {
$errors[$style] = t("The @style style requires a Date argument or a Date filter.", array('@style' => $style));
$errors[$style] = t("The @style style requires a Date argument or a Date filter.", array('@style' => $style));
}
$this->view->date_info->arg_missing = TRUE;
}
if (array_key_exists('date_argument', $arguments) &&
if (array_key_exists('date_argument', $arguments) &&
($arguments['date_argument']['default_action'] != 'default' || $arguments['date_argument']['default_argument_type'] != 'date')) {
if (empty($this->view->date_info->arg_missing_default)) {
$errors[] = calendar_errors('missing_argument_default');
$errors[] = calendar_errors('missing_argument_default');
}
$this->view->date_info->arg_missing_default = TRUE;
}
if (empty($this->options['summary_field'])) {
$errors[] = $errors[$style] = t("The @style style requires a Title field for the iCal export.", array('@style' => $style));
}
// Make sure date fields are not set up to 'Group multiple values'
// Make sure date fields are not set up to 'Group multiple values'
// in the calendar style.
if ($style == 'calendar_style') {
$view_fields = date_api_fields($this->view->base_table);
@ -138,20 +137,20 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
}
return $errors;
}
function render() {
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
// Transfer the style options to the view object so they
// can be easily accessed in the theme.
$style_options = $this->options;
$this->view->date_info->summary_field = $style_options['summary_field'];
$this->view->date_info->description_field = $style_options['description_field'];
$this->view->date_info->location_field = $style_options['location_field'];
// Evaluate our argument values and figure out which
// Evaluate our argument values and figure out which
// calendar display we need to create.
$i = 0;
$i = 0;
foreach ($this->view->argument as $id => $argument) {
if ($argument->field == 'date_argument') {
// TODO Decide if we want to provide a date here or not.
@ -172,13 +171,13 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
$this->view->date_info->week = isset($argument->week) ? $argument->week : NULL;
$this->view->date_info->min_date = $argument->min_date;
$this->view->date_info->max_date = $argument->max_date;
// Stop after the first date argument, if there is more than one.
break;
}
$i++;
}
// The ical display might have date filters instead of arguments.
// If we missed getting a min date from date arguments, try date filters.
if (empty($this->view->date_info->min_date)) {
@ -204,19 +203,19 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
$this->view->date_info->date_fields = array();
}
$this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, array_keys($filter->options['date_fields']));
// Stop after the first date filter, if there is more than one.
break;
}
}
$i++;
}
// Render each field into an output array.
$items = array();
$calendar_fields = date_api_fields($this->view->base_table);
$calendar_fields = array_keys($calendar_fields['alias']);
foreach ($this->view->result as $num => $row) {
$items[$num] = $row;
// Store the raw date values before formatting the results.
@ -227,17 +226,17 @@ class calendar_plugin_style_ical extends views_plugin_style_rss {
}
foreach ($this->view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($field) && is_object($field)) {
$field_output = $field->theme($row);
$items[$num]->{$field_alias} = $field_output;
}
}
}
// Massage the resulting items into formatted calendar items.
$items = calendar_build_nodes($this->view, $items);
// Merge in items from other sources.
foreach (module_implements('calendar_add_items') as $module) {
$function = $module .'_calendar_add_items';

View file

@ -1,16 +1,15 @@
<?php
// $Id: theme.inc,v 1.1.2.15 2010/11/21 11:00:56 karens Exp $
/**
* Preprocess an ical feed
*/
function template_preprocess_calendar_view_ical(&$vars) {
global $base_url;
global $language;
$view = &$vars['view'];
$options = &$vars['options'];
$items = &$vars['rows'];
$style = &$view->style_plugin;
// Figure out which display which has a path we're using for this feed. If there isn't
@ -24,18 +23,18 @@ function template_preprocess_calendar_view_ical(&$vars) {
// Keep devel module from appending queries to ical export.
$GLOBALS['devel_shutdown'] = FALSE;
drupal_set_header('Content-Type: text/calendar; charset=utf-8');
drupal_set_header('Content-Disposition: attachment; filename="calendar.ics"; ');
require_once('./'. drupal_get_path('module', 'date_api') .'/date_api_ical.inc');
require_once('./'. drupal_get_path('module', 'date_api') .'/theme/theme.inc');
require_once('./'. drupal_get_path('module', 'calendar') .'/includes/calendar.inc');
$events = array();
// Get the alias name for each of our data fields.
foreach ($view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
foreach (array('summary_field', 'description_field', 'location_field') as $data) {
if ($field->field == $view->date_info->$data) {
$$data = $field_alias;
@ -70,11 +69,11 @@ function template_preprocess_calendar_view_ical(&$vars) {
date_timezone_set($event['start'], timezone_open('UTC'));
date_timezone_set($event['end'], timezone_open('UTC'));
}
$headertitle = filter_xss_admin($view->get_title());
$title = variable_get('site_name', 'Drupal');
$description = $headertitle . ($title ? ' | '. $title : '');
$vars['calname'] = $description;
$vars['events'] = $events;
template_preprocess_date_vcalendar($vars);