commit 537710c0d93549502bbe3fac84e20f73f7b79d9d
Author: Franck Deroche <defr@ows.fr>
Date:   Thu Dec 6 19:09:25 2012 +0100

    Timeline: Get exported views to work

diff --git a/timeline/includes/Timeline.class.inc b/timeline/includes/Timeline.class.inc
index 9b26bdd..453530b 100644
--- a/timeline/includes/Timeline.class.inc
+++ b/timeline/includes/Timeline.class.inc
@@ -41,20 +41,21 @@ class Timeline {
     $this->data['events'] = $this->getEvents();
     $this->data['id'] = $this->view->name;
     $this->data['orientation'] = 0;
-    $this->data['initial_focus'] = $this->getDefinedDateField($view->style_options['bands']['focus'], $view->style_options['bands']['focus_custom']);
+    $view_options = $view->style_plugin->options;
+    $this->data['initial_focus'] = $this->getDefinedDateField($view_options['bands']['focus'], $view_options['bands']['focus_custom']);
     $this->data['timezone'] = 0; // missing
     $this->data['controls'] = FALSE; // missing
     $this->data['bands'] = $this->getBands();
-    $this->data['summary'] = drupal_strtoupper($view->style_options['bands']['band2_unit']);
-    $this->data['band1_unit_width'] = $view->style_options['bands']['band1_unit_width'];
-    $this->data['band2_unit_width'] = $view->style_options['bands']['band2_unit_width'];
+    $this->data['summary'] = drupal_strtoupper($view_options['bands']['band2_unit']);
+    $this->data['band1_unit_width'] = $view_options['bands']['band1_unit_width'];
+    $this->data['band2_unit_width'] = $view_options['bands']['band2_unit_width'];
 
     // startsOn ?!? ether.js on line 22 -fd
     //$this->data['timeline_start'] = $this->get_defined_date_field($view->style_options['limit']['start'], $view->style_options['limit']['custom_start']);
     //$this->data['timeline_end'] = $this->get_defined_date_field($view->style_options['limit']['end'], $view->style_options['limit']['custom_end']);
-    $this->data['theme'] = $view->style_options['display']['appearance']['theme'];
-    $this->data['bubble_max_height'] = $view->style_options['display']['appearance']['bubble_height'];
-    $this->data['bubble_width'] = $view->style_options['display']['appearance']['bubble_width'];
+    $this->data['theme'] = $view_options['display']['appearance']['theme'];
+    $this->data['bubble_max_height'] = $view_options['display']['appearance']['bubble_height'];
+    $this->data['bubble_width'] = $view_options['display']['appearance']['bubble_width'];
   }
 
   function timeline_to_json() {
@@ -77,7 +78,7 @@ class Timeline {
       foreach ($this->sets as $k => $set) {
         $css_selector = $this->generateCssSelector();
         $color = FALSE;
-        if (isset($this->view->style_options['grouping']) && $this->view->style_options['grouping'] != '') {
+        if (isset($this->view->style_plugin->options['grouping']) && $this->view->style_plugin->options['grouping'] != '') {
           $color = $this->getColor();
         }
 
@@ -98,7 +99,7 @@ class Timeline {
 
   function getBands() {
     $bands = array();
-    $bands[] = drupal_strtoupper($this->view->style_options['bands']['band1_unit']);
+    $bands[] = drupal_strtoupper($this->view->style_plugin->options['bands']['band1_unit']);
     return $bands;
   }
 
@@ -162,8 +163,8 @@ class Timeline {
     );
 
     // Override color information if specified
-    if (isset($this->view->style_options['colors']['values']) && $this->view->style_options['colors']['values'] != '') {
-      $colors = preg_split("/\r\n|\n/", $this->view->style_options['colors']['values']);
+    if (isset($this->view->style_plugin->options['colors']['values']) && $this->view->style_plugin->options['colors']['values'] != '') {
+      $colors = preg_split("/\r\n|\n/", $this->view->style_plugin->options['colors']['values']);
     }
 
     $tmp = $this->color_id;
diff --git a/timeline/includes/TimelineEvent.class.inc b/timeline/includes/TimelineEvent.class.inc
index e5c5766..b54997d 100644
--- a/timeline/includes/TimelineEvent.class.inc
+++ b/timeline/includes/TimelineEvent.class.inc
@@ -48,7 +48,7 @@ class TimelineEvent {
         $data = array();
         $tmp = $this->getDefinedFieldUsage('title');
         $data['title'] = theme('timeline_bubble_title', array('row' => $row, 'alias' => $tmp['alias']));
-        $data['link'] = theme('timeline_bubble_url', array('row' => $row, 'link_enabled' => $this->view->style_options['fields']['link']));
+        $data['link'] = theme('timeline_bubble_url', array('row' => $row, 'link_enabled' => $this->view->style_plugin->options['fields']['link']));
 
         $events_validated = $this->logic($row);
         $data['start'] = $events_validated['start']['formated'];
@@ -165,7 +165,7 @@ class TimelineEvent {
   function getDefinedFieldUsage($type) {
 
 
-    if ($timeline_settings_fields = $this->view->style_options['fields']) {
+    if ($timeline_settings_fields = $this->view->style_plugin->options['fields']) {
       if (isset($timeline_settings_fields[$type])) {
         if (is_string($timeline_settings_fields[$type])) {
           $fieldname = $timeline_settings_fields[$type];
@@ -215,7 +215,7 @@ class TimelineEvent {
     if (isset($path)) {
       // push path through imagecache, if activated.
       if (module_exists('imagecache') &&
-        $imagecache_namespace = $this->view->style_options['fields']['advanced']['imagecache_icon']) {
+        $imagecache_namespace = $this->view->style_plugin->options['fields']['advanced']['imagecache_icon']) {
         return base_path() . imagecache_create_path($imagecache_namespace, $path);
       }
       else {
diff --git a/timeline/timeline_views_plugin_style.inc b/timeline/timeline_views_plugin_style.inc
index acdcc96..4418086 100644
--- a/timeline/timeline_views_plugin_style.inc
+++ b/timeline/timeline_views_plugin_style.inc
@@ -33,8 +33,11 @@ class timeline_views_plugin_style extends views_plugin_style {
     );
     $options['bands']['contains'] = array(
       'focus' => array('default' => 'today'),
+      'focus_custom' => array('default' => ''),
       'band1_unit' => array('default' => 'day'),
+      'band1_unit_width' => array('default' => 50),
       'band2_unit' => array('default' => 'month'),
+      'band2_unit_width' => array('default' => 50),
     );
     $options['misc']['contains'] = array('controls' => array('default' => FALSE), );
     $options['fields']['contains'] = array(
@@ -77,7 +80,7 @@ class timeline_views_plugin_style extends views_plugin_style {
     $form['display']['width'] = array(
       '#type' => 'textfield',
       '#title' => t('Width'),
-      '#default_value' => isset($this->options['display']['width']) ? $this->options['display']['width'] : variable_get('timeline_default_width', '100%'),
+      '#default_value' => $this->options['display']['width'],
       '#size' => 6,
       '#maxlength' => 6,
       '#description' => t('The width of the timeline (in units of em, px or %), e.g. 600px or 90%. Leave blank to use default value.'),
@@ -85,7 +88,7 @@ class timeline_views_plugin_style extends views_plugin_style {
     $form['display']['height'] = array(
       '#type' => 'textfield',
       '#title' => t('Height'),
-      '#default_value' => isset($this->options['display']['height']) ? $this->options['display']['height'] : variable_get('timeline_default_height', '400px'),
+      '#default_value' => $this->options['display']['height'],
       '#size' => 6,
       '#maxlength' => 6,
       '#description' => t('The height of the timeline (in units of em, px or %), e.g. 400px. Leave blank to use default value.'),
@@ -394,8 +397,8 @@ class timeline_views_plugin_style extends views_plugin_style {
     // options that are used for template preprocessor
     $this->options['timeline'] = array(
       'class' => $this->view->name . '_' . $delta,
-      'width' => _timeline_to_dim($this->view->style_options['display']['width']),
-      'height' => _timeline_to_dim($this->view->style_options['display']['height']),
+      'width' => _timeline_to_dim($this->options['display']['width']),
+      'height' => _timeline_to_dim($this->options['display']['height']),
       'align' => '',
       'data_count' => count($timeline->data['events']['events']),
       'controls' => FALSE, // $this->view->style_options['misc']['controls'],
