Commit 5790ff98 authored by lkmorlan's avatar lkmorlan
Browse files

Coding standards

parent ddad9812
......@@ -54,9 +54,9 @@
<?php if (!$label_hidden): ?>
<div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>&nbsp;</div>
<?php endif; ?>
<div class="field-data <?php if(count($items)>1) {print 'multiple';} ?>"<?php print $content_attributes; ?>>
<div class="field-data <?php if (count($items)>1): print 'multiple'; endif; ?>"<?php print $content_attributes; ?>>
<?php foreach ($items as $delta => $item): ?>
<div<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
<?php endforeach; ?>
</div>
</div>
\ No newline at end of file
</div>
......@@ -6,7 +6,7 @@
*/
/**
* Implementation of hook_install()
* Implements hook_install().
*/
function uw_ct_event_install() {
......@@ -18,7 +18,7 @@ function uw_ct_event_install() {
// this prevents the workbench moderation array from being added to the node object, and everything falls apart
// Do one variable_set for every content type using workbench moderation
variable_set('node_options_uw_event', array(0 => 'moderation',1 => 'revision'));
variable_set('node_options_uw_event', array(0 => 'moderation', 1 => 'revision'));
}
......
......@@ -27,7 +27,7 @@ function uw_ct_event_rdf_namespaces() {
'xsd' => 'http://www.w3.org/2001/XMLSchema#',
);
}
*/
*/
/**
* Implements hook_disable().
......@@ -75,7 +75,7 @@ function uw_ct_event_form_uw_event_node_form_alter(&$form, &$form_state, $form_i
// the location of that site is in a Drupal variable, uw_location_data_json_url, and defaults to the current site if it is not set
// (see the $settings array below)
$form['#attached']['js'][] = drupal_get_path('module', 'uw_ct_event') . '/js/location-ajax.js';
// settings used in location-ajax.js
global $base_url;
$settings = array(
......@@ -85,14 +85,14 @@ function uw_ct_event_form_uw_event_node_form_alter(&$form, &$form_state, $form_i
'url' => variable_get('uw_location_data_json_url', $base_url . '/location/json'),
'selectid' => 'populate-location-data',
);
$form['#attached']['js'][] = array(
'data' => array('uw_ct_event' => $settings),
'type' => 'setting',
);
// */
// Remove the 'delete this location' checkbox on the edit form
$form['field_event_location']['und'][0]['#after_build'][] = 'uw_ct_event_remove_location_delete';
......@@ -135,10 +135,10 @@ function uw_ct_event_block_info() {
function uw_ct_event_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'events_by_date':
// get years and number of events in each year
$result_year = db_query("
SELECT YEAR(STR_TO_DATE(field_data_field_event_date.field_event_date_value, '%Y-%m-%dT%T')) AS year, COUNT(YEAR(STR_TO_DATE(field_data_field_event_date.field_event_date_value, '%Y-%m-%dT%T'))) as count
......@@ -146,9 +146,9 @@ function uw_ct_event_block_view($delta = '') {
WHERE node.type = 'uw_event' AND node.status = 1
GROUP BY year ORDER BY year DESC
");
$links = array();
foreach ($result_year as $record_year) {
$year_link = l($record_year->year, 'events/archive/' . $record_year->year) . ' (' . $record_year->count . ')';
......@@ -173,7 +173,7 @@ function uw_ct_event_block_view($delta = '') {
);
}
//setup array to be used by theme_item_list
$content = array(
'items' => $links,
......@@ -183,13 +183,13 @@ function uw_ct_event_block_view($delta = '') {
);
$block['subject'] = t('Events archive');
$block['content'] = theme_item_list($content);
$block['content'] = theme_item_list($content);
break;
}
return $block;
return $block;
}
......@@ -218,20 +218,20 @@ function uw_ct_event_page_build() {
if (isset($node) && is_object($node) && $node->type == 'uw_event') {
$breadcrumb = drupal_get_breadcrumb();
$breadcrumb[1] = l('Events', 'events');
// TODO: determine how to handle repeating dates (edge case)
// currently we only check the very first start date
$start_date = strtotime($node->field_event_date[$node->language][0]['value']);
$year = date('Y', $start_date);
$month_name = date('F', $start_date);
$month_number = date('m', $start_date);
$breadcrumb[2] = l($year, 'events/archive/'.$year);
$breadcrumb[3] = l($month_name, 'events/archive/'.$year.'-'.$month_number);
$breadcrumb[2] = l($year, 'events/archive/' . $year);
$breadcrumb[3] = l($month_name, 'events/archive/' . $year . '-' . $month_number);
drupal_set_breadcrumb($breadcrumb);
}
break;
case 'events':
if (isset($path[1])) {
$breadcrumb = drupal_get_breadcrumb();
......@@ -285,7 +285,7 @@ function uw_ct_event_theme($existing, $type, $theme, $path) {
'preprocess functions' => array(
'template_preprocess',
'template_preprocess_views_view_unformatted',
),
),
),
);
}
Supports Markdown
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