Commit abb798ed authored by Robert Rollins's avatar Robert Rollins

Final cleanup pass.

parent 32126161
<?php
/**
* @file
* Install, update and uninstall functions for the date_ical module.
*
*/
/**
......
......@@ -206,7 +206,7 @@ function date_ical_feeds_processor_targets_alter(&$targets, $entity_type, $bundl
* converted to "\n\n" and link tags converted to footnotes), and uneeded
* whitespace will be cleaned up.
*
* @param $text
* @param string $text
* The text to be sanitized.
*/
function date_ical_sanitize_text($text = '') {
......@@ -244,7 +244,8 @@ function date_ical_feeds_set_rrule($source, $entity, $target, $feed_element) {
return;
}
// Add the RRULE value to the field in $entity.
list($field_name, $trash) = explode(':', $target, 2);
$exploded = explode(':', $target, 2);
$field_name = $exploded[0];
module_load_include('inc', 'date_api', 'date_api_ical');
$info = field_info_field($field_name);
foreach ($entity->{$field_name} as $lang => $field_array) {
......@@ -283,7 +284,7 @@ function date_ical_get_location_fields($base = 'node', $reset = FALSE) {
* This is a cut down version of _date_views_fields() from
* date_views_fields.inc in date_views module.
*
* @return
* @return array
* array with fieldname, type, and table.
*
* @see date_views_date_views_fields()
......@@ -367,10 +368,10 @@ function date_ical_get_summary_fields($base = 'node', $reset = FALSE) {
* This is a cut down version of _date_views_fields() from
* date_views_fields.inc in date_views module.
*
* @return
* @return array
* Array with fieldname, type, and table.
*
* @see date_views_date_views_fields()
* @see date_views_date_views_fields()
*/
function _date_ical_get_summary_fields($base = 'node') {
// Make sure $base is never empty.
......@@ -441,7 +442,7 @@ function _date_ical_convert_rrule_for_icalcreator($rrule) {
continue;
}
if (strtoupper($key) == 'UNTIL') {
// iCalcreator expects the 'timestamp' to be array key for UNTIL
// iCalcreator expects the 'timestamp' to be array key for UNTIL.
$value['timestamp'] = strtotime($value['datetime']);
}
if (strtoupper($key) == 'BYDAY') {
......
......@@ -53,7 +53,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
'rel' => 'alternate',
'type' => 'text/calendar',
'title' => $tooltip,
'href' => $url
'href' => $url,
));
}
}
......@@ -127,7 +127,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
public function render() {
if (empty($this->row_plugin) || !in_array($this->row_plugin->plugin_name, array('date_ical', 'date_ical_fields'))) {
debug('date_ical_plugin_style_ical_feed: This style plugin supports only the "iCal Entity" and "iCal Fields" row plugins.', NULL, TRUE);
return t('To enable iCal output, this view\'s Format must be configured to Show: iCal Entity or iCal Fields.');
return t('To enable iCal output, the view Format must be configured to Show: iCal Entity or iCal Fields.');
}
if ($this->row_plugin->plugin_name == 'date_ical_fields' && empty($this->row_plugin->options['date_field'])) {
// Because the Date field is required by the form, this error state will
......
......@@ -264,7 +264,7 @@ class ParserVcalendar {
// NOTE TO MAINTAINERS:
// This will not work properly if the site is configured to allow users
// to set their own timezone. Unfortunately, there isn't anything that
// Date iCal can do about that, as far as I can tell. -- coredumperror
// Date iCal can do about that, as far as I can tell.
$datetimezone = new DateTimeZone(date_default_timezone_get());
}
else {
......@@ -349,7 +349,7 @@ class ParserVcalendar {
// values, so we need to manually pare it down to only the first one.
$vcalendar_component->rrule = array($vcalendar_component->rrule[0]);
}
foreach ($vcalendar_component->rrule as $ndx => &$rrule_data) {
foreach ($vcalendar_component->rrule as &$rrule_data) {
// RRULEs must have an INTERVAL, or Date Repeat will throw errors.
if (!isset($rrule_data['value']['INTERVAL'])) {
$rrule_data['value']['INTERVAL'] = '1';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment