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