Commit 67065496 authored by damiankloip's avatar damiankloip Committed by tim.plunkett
Browse files

Issue #1741154 by damiankloip | tim.plunkett: Replace ctools_include('export')...

Issue #1741154 by damiankloip | tim.plunkett: Replace ctools_include('export') and ctools_include('plugins') with Configurable Thingies.
parent fae4f5e9
......@@ -21,9 +21,7 @@
* An object to contain all of the data to generate a view, plus the member
* functions to build the view query, execute the query and render the output.
*/
class View extends ViewsDbObject {
var $db_table = 'views_view';
class View extends ViewStorage {
var $base_table = 'node';
......@@ -36,13 +34,6 @@ class View extends ViewsDbObject {
*/
var $name = "";
/**
* The id of the view, which is used only for views in the database.
*
* @var number
*/
var $vid;
/**
* The description of the view, which is used only in the interface.
*
......@@ -275,17 +266,6 @@ class View extends ViewsDbObject {
*/
protected $response = NULL;
/**
* Constructor
*/
function __construct() {
parent::init();
// Make sure all of our sub objects are arrays.
foreach ($this->db_objects() as $key => $object) {
$this->$key = array();
}
}
/**
* Perform automatic updates when loading or importing a view.
*
......@@ -308,14 +288,6 @@ function display_objects() {
return array('argument', 'field', 'sort', 'filter', 'relationship', 'header', 'footer', 'empty');
}
/**
* Returns the complete list of dependent objects in a view, for the purpose
* of initialization and loading/saving to/from the database.
*/
static function db_objects() {
return array('display' => 'Display');
}
/**
* Set the arguments that come to this view. Usually from the URL
* but possibly from elsewhere.
......
......@@ -13,32 +13,30 @@
* This is just the database storage mechanism, and isn't terribly important
* to the behavior of the display at all.
*/
class ViewsDisplay extends ViewsDbObject {
class ViewsDisplay {
/**
* The display handler itself, which has all the methods.
*
* @var views_plugin_display
*/
var $handler;
public $handler;
/**
* Stores all options of the display, like fields, filters etc.
*
* @var array
*/
var $display_options;
public $display_options;
var $db_table = 'views_display';
function __construct(array $display_options = array()) {
$this->display_options = $display_options;
function __construct($init = TRUE) {
parent::init($init);
if (!empty($display_options)) {
$this->display_plugin = $display_options['display_plugin'];
$this->id = $display_options['id'];
$this->display_title = $display_options['display_title'];
}
function options($type, $id, $title) {
$this->display_plugin = $type;
$this->id = $id;
$this->display_title = $title;
}
}
......@@ -4,6 +4,7 @@ package = Views
core = 8.x
php = 5.2
dependencies[] = ctools
dependencies[] = config
; Always available CSS
stylesheets[all][] = css/views.base.css
......@@ -75,25 +75,28 @@ function views_temp_store() {
}
/**
* Implements hook_ctools_exportable_info().
* Implements hook_entity_info().
*/
function views_ctools_exportable_info() {
return array(
function views_entity_info() {
$return = array(
'view' => array(
'controller class' => 'Drupal\ctools\DatabaseExportableController',
'key' => 'name',
'identifier' => 'view',
'default hook' => 'views_default_views',
'bulk export' => TRUE,
'api' => array(
'owner' => 'views',
'api' => 'views_default',
'minimum_version' => '2',
'current_version' => '3.0',
'label' => t('View'),
'entity class' => 'Drupal\views\View',
'controller class' => 'Drupal\views\ViewStorageController',
'form controller class' => array(
'default' => 'Drupal\node\NodeFormController',
),
'config prefix' => 'views.view',
'fieldable' => FALSE,
'entity keys' => array(
'id' => 'name',
'label' => 'human_name',
'uuid' => 'uuid',
),
'schema' => 'views_view',
),
);
return $return;
}
/**
......
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