--- modules/openlayers_views/views/openlayers_views_style_data.inc Tue Jun 15 02:36:35 2010 +++ modules/openlayers_views/views/openlayers_views_style_data.inc Wed Jun 23 22:18:29 2010 @@ -22,6 +22,7 @@ function option_definition() { $options = parent::option_definition(); $options['data_source'] = array('default' => array()); + $options['data_source']['popup_content_source'] = array('default' => 'use_title_description'); return $options; } @@ -158,6 +159,17 @@ '#options' => array_merge(array('' => ''), $fields), '#default_value' => $this->options['data_source']['description_field'], ); + $form['data_source']['popup_content_source'] = array( + '#type' => 'select', + '#title' => t('In popup, show'), + '#description' => t('Choose what will be displayed in popups.'), + '#options' => array( + 'use_title_description' => t('Title and Description'), + 'use_row' => t('The Views row'), + ), + '#multiple' => FALSE, + '#default_value' => $this->options['data_source']['popup_content_source'], + ); // Attributes and variable styling description $form['attributes'] = array( @@ -380,6 +392,21 @@ } else { $feature['attributes']['description'] = ''; + } + + // Build the content that will be displayed in a popup + if ($data_source['popup_content_source']['use_row']) { + $feature['attributes']['popup_content'] = + "
" . + $this->row_plugin->render($record) . "
"; + } + else { + // The default is to use the title & description + $feature['attributes']['popup_content'] = + "
" . + $feature['attributes']['name'] . "
" . + "
" . + $feature['attributes']['description'] . "
"; } // Fill in attributes that are not: