You are here

function views1_convert_style in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 includes/convert.inc \views1_convert_style()
1 call to views1_convert_style()
views1_import in includes/convert.inc
Convert a Views 1 view to a Views 2 view.

File

includes/convert.inc, line 392
convert.inc

Code

function views1_convert_style(&$view, &$handler, $type) {
  switch ($type) {
    case 'list':
      $handler
        ->set_option('style_plugin', 'list');
      $handler
        ->set_option('style_options', array(
        'type' => 'ul',
      ));
      $handler
        ->set_option('row_plugin', 'fields');
      break;
    case 'node':
      $handler
        ->set_option('row_plugin', 'node');
      $handler
        ->set_option('row_options', array(
        'teaser' => FALSE,
        'links' => TRUE,
      ));
      break;
    case 'teaser':
      $handler
        ->set_option('row_plugin', 'node');
      $handler
        ->set_option('row_options', array(
        'teaser' => TRUE,
        'links' => TRUE,
      ));
      break;
    case 'table':
      $options = array();
      $options['columns'] = array();
      $options['default'] = '';
      $options['info'] = array();
      $options['override'] = FALSE;
      $options['order'] = 'asc';
      $handler
        ->set_option('style_plugin', 'table');
      $handler
        ->set_option('style_options', $options);
      break;
    default:

      // Ask around if anybody else knows.
      foreach (module_implements('views_convert') as $module) {
        module_invoke($module, 'views_convert', $handler->display->id, 'style', $view, $type);
      }
  }
}