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: theme.inc,v 1.10.2.80 2011/01/03 12:45:27 karens Exp $
/**
* Display a calendar navigation and links
*/
@ -28,7 +27,7 @@ function template_preprocess_calendar_main(&$vars) {
}
elseif (!empty($view->date_info->week)) {
$week = date_week_range($view->date_info->week, $view->date_info->year);
$current_date = $week[0];
$current_date = $week[0];
}
elseif (!empty($view->date_info->month)) {
$current_date = date_make_date($view->date_info->year .'-'. date_pad($view->date_info->month) .'-01 00:00:00');
@ -76,19 +75,19 @@ function template_preprocess_calendar_main(&$vars) {
// If an 'Add new ... link is provided, add it here.
// the query will bring the user back here after adding the node.
if (!empty($view->date_info->calendar_date_link)
if (!empty($view->date_info->calendar_date_link)
&& (user_access("administer nodes") || user_access('create '. $view->date_info->calendar_date_link .' content'))) {
$name = node_get_types('name', $view->date_info->calendar_date_link);
$href = 'node/add/'. str_replace('_', '-', $view->date_info->calendar_date_link);
$query = 'destination='. $view->date_info->url;
$query = 'destination='. $view->date_info->url;
$vars['calendar_links']['calendar calendar-add'] = $base + array(
'title' => t('Add+'),
'href' => $href,
'title' => t('Add+'),
'href' => $href,
'query' => $query,
);
}
$vars['view'] = $view;
$vars['view'] = $view;
$vars['mini'] = !empty($view->date_info->mini);
$vars['block'] = !empty($view->date_info->block);
$vars['block_identifier'] = date_block_identifier($view);
@ -97,7 +96,7 @@ function template_preprocess_calendar_main(&$vars) {
/**
* Display a view as a calendar.
*
*
* This preprocessor does all the work needed for all types of calendar
* views and the template takes care of displaying links to related views.
*/
@ -117,7 +116,7 @@ function template_preprocess_calendar(&$vars) {
$fields = $view->field;
// Render each field into an output array. We have to do the rendering
// here because we don't apppear to have full access to the view
// here because we don't apppear to have full access to the view
// handlers in the theme functions.
$items = array();
$calendar_fields = date_api_fields($view->base_table);
@ -136,7 +135,7 @@ function template_preprocess_calendar(&$vars) {
}
foreach ($fields as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($field) && is_object($field)) {
// Theme the copy instead of the original row so duplicate date
// fields each get a fresh copy of the original data to theme.
@ -176,7 +175,7 @@ function template_preprocess_calendar(&$vars) {
$vars['rows'] = $rows;
$view->date_info->calendar_processed = TRUE;
$vars['view'] = $view;
$vars['view'] = $view;
$vars['mini'] = !empty($view->date_info->mini);
$vars['block'] = !empty($view->date_info->block);
}
@ -265,8 +264,8 @@ function template_preprocess_calendar_year(&$vars) {
$view = $vars['view'];
$year = date_format($view->date_info->min_date, 'Y');
// Construct a calendar for each month, adjusting the $view passed
// to the theme so it will produce the right results.
// Construct a calendar for each month, adjusting the $view passed
// to the theme so it will produce the right results.
$view = drupal_clone($vars['view']);
$rows = $vars['rows'];
$months = array();
@ -322,7 +321,7 @@ function template_preprocess_calendar_day(&$vars) {
$grouped_items = array();
foreach ($rows['all_day'] as $item) {
if (isset($item->{$grouping_field})) {
$column = $item->{$grouping_field};
$column = $item->{$grouping_field};
$item->{$grouping_field} = ''; // Remove the grouping field from the results.
if (!in_array($column, $columns)) {
$columns[] = $column;
@ -339,7 +338,7 @@ function template_preprocess_calendar_day(&$vars) {
// Moved timed items into the right columns and render them.
$start_times = $view->date_info->style_groupby_times;
$show_empty_times = $view->date_info->style_show_empty_times;
$show_empty_times = $view->date_info->style_show_empty_times;
$end_start_time = '23:59:59';
$start_time = array_shift($start_times);
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
@ -361,7 +360,7 @@ function template_preprocess_calendar_day(&$vars) {
// slots if the option to show empty times was chosen.
while ($time >= $next_start_time && $time < $end_start_time) {
if ((!empty($show_empty_times)) && !array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'] = array();
$grouped_items[$start_time]['values'] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
@ -377,7 +376,7 @@ function template_preprocess_calendar_day(&$vars) {
if (!empty($show_empty_times)) {
while ($start_time < $end_start_time) {
if (!array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'] = array();
$grouped_items[$start_time]['values'] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
@ -391,8 +390,8 @@ function template_preprocess_calendar_day(&$vars) {
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $rows['date']);
$grouped_items[$start_time]['hour'] = $heading['hour'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
$i++;
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
$i++;
}
ksort($grouped_items);
$vars['rows']['items'] = $grouped_items;
@ -444,7 +443,7 @@ function template_preprocess_calendar_week(&$vars) {
}
// Moved timed items into the right columns and render them.
$show_empty_times = $view->date_info->style_show_empty_times;
$show_empty_times = $view->date_info->style_show_empty_times;
$end_start_time = '23:59:59';
$grouped_items = array();
@ -477,15 +476,15 @@ function template_preprocess_calendar_week(&$vars) {
// slots if the option to show empty times was chosen.
while ($time >= $next_start_time && $time < $end_start_time) {
if (($show_empty_times) && !array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'][$weekno] = array();
$grouped_items[$start_time]['values'][$weekno] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
}
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_'. $view->date_info->granularity .'_node';
$grouped_items[$start_time]['values'][$weekno][] = theme($theme, $item, $view);
$item_count++;
$by_hour_count++;
$item_count++;
$by_hour_count++;
}
}
@ -493,7 +492,7 @@ function template_preprocess_calendar_week(&$vars) {
if ($show_empty_times) {
while ($start_time < $end_start_time) {
if (!array_key_exists($start_time, $grouped_items)) {
$grouped_items[$start_time]['values'][$weekno] = array();
$grouped_items[$start_time]['values'][$weekno] = array();
}
$start_time = $next_start_time;
$next_start_time = count($start_times) ? array_shift($start_times) : $end_start_time;
@ -509,10 +508,10 @@ function template_preprocess_calendar_week(&$vars) {
$next_start_time = array_key_exists($i + 1, $start_times) ? $start_times[$i + 1] : '23:59:59';
$heading = theme('calendar_time_row_heading', $start_time, $next_start_time, $row['data']['date']);
$grouped_items[$start_time]['hour'] = $heading['hour'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
}
$vars['items'] = $grouped_items;
$vars['items'] = $grouped_items;
$vars['day_names'] = $day_names;
$vars['columns'] = $columns;
@ -566,7 +565,7 @@ function template_preprocess_calendar_node(&$vars) {
$fields = array();
foreach ($view->field as $name => $field) {
// Some fields, like the node edit and delete links, have no alias.
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
$field_alias = $field->field_alias != 'unknown' ? $field->field_alias : $name;
if (!empty($node->$field_alias)) {
$data = $node->$field_alias;
$label = $field->options['label'];
@ -597,7 +596,7 @@ function template_preprocess_calendar_node(&$vars) {
// We added the node type to the results in the query,
// but it will show up as $node->node_type instead of
// $node->type. Rename it to match the normal way it
// $node->type. Rename it to match the normal way it
// would show up on a node object.
$vars['node']->type = $vars['node']->node_type;
}
@ -704,7 +703,7 @@ function theme_calendar_stripe_legend() {
array('class' => 'calendar-legend', 'data' => t('Key'))
);
$rows = array();
$output = '';
$output = '';
foreach ((array) $GLOBALS['calendar_stripes'] as $label => $stripe) {
if($stripe){
$rows[] = array($label, '<div style="background-color:'. $stripe .';color:'. $stripe .'" class="stripe" title="Key: '. $label .'">&nbsp;</div>');