Commit a0ce67d1 authored by Robert Rollins's avatar Robert Rollins

Issue [#2046935]: Added support for "long text" and "long text and summary"...

Issue [#2046935]: Added support for "long text" and "long text and summary" for the LOCATION and SUMMARY fields.
parent 20f293e3
......@@ -209,7 +209,7 @@ function date_ical_sanitize_text($text = '') {
// Replace instances of more than one space with exactly one space. This
// cleans up the whitespace mess that gets left behind by drupal_html_to_text().
$text = preg_replace("/ +/", " ", $text);
// The call to drupal_html_to_text() above converted <p> to /n/n, and also
// The call to drupal_html_to_text() above converted <p> to \n\n, and also
// shoved a \n into the string every 80 characters. We don't want those
// single \n's lying around, because iCalcreator will properly "fold" long
// text fields for us. So, we need to remove all instances of \n which
......@@ -392,7 +392,7 @@ function _date_ical_get_location_fields($base = 'node') {
// Skip unsupported field types and fields that weren't defined through
// the Field module.
$info = field_info_field($field_name);
if (!$info || !in_array($info['type'], array('text', 'node_reference', 'addressfield'))) {
if (!$info || !in_array($info['type'], array('text', 'text_long', 'text_with_summary', 'node_reference', 'addressfield'))) {
continue;
}
......@@ -469,7 +469,7 @@ function _date_ical_get_summary_fields($base = 'node') {
// Skip unsupported field types and fields that weren't defined through
// the Field module.
$info = field_info_field($field_name);
if (!$info || !in_array($info['type'], array('text', 'node_reference', 'taxonomy_term_reference'))) {
if (!$info || !in_array($info['type'], array('text', 'text_long', 'text_with_summary', 'node_reference', 'taxonomy_term_reference'))) {
continue;
}
......
......@@ -275,21 +275,22 @@ class date_ical_plugin_row_ical_entity extends views_plugin_row {
// Make sure this Node Reference actually references a node.
if ($summary_field['nid']) {
$node = node_load($summary_field['nid']);
$summary = check_plain($node->title);
$summary = $node->title;
}
}
elseif ($summary_info['type'] == 'taxonomy_term_reference') {
$terms = taxonomy_term_load_multiple($items);
// Make sure that there are terms that were loaded
if ($terms) {
$term_names = array();
foreach ($terms as $term) {
$summary .= check_plain($term->name) . ', ';
$term_names[] = $term->name;
}
$summary = implode(', ', $term_names);
}
$summary = trim($summary);
}
else {
$summary = check_plain($summary_field['value']);
$summary = trim($summary_field['value']);
}
$data['summary'] = $summary ? $summary : $data['summary'];
}
......
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