Issue #1741154 by damiankloip | tim.plunkett: Replace ctools_include('export') and ctools_include('plugins') with Configurable Thingies.

8.0.x
damiankloip 2012-08-25 20:41:01 +02:00 committed by Tim Plunkett
parent fae4f5e98a
commit 67065496bd
4 changed files with 29 additions and 55 deletions

View File

@ -21,9 +21,7 @@ use Drupal\views\Plugin\Type\ViewsPluginManager;
* 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 @@ class View extends ViewsDbObject {
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.

View File

@ -13,32 +13,30 @@ namespace Drupal\views;
* 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);
}
function options($type, $id, $title) {
$this->display_plugin = $type;
$this->id = $id;
$this->display_title = $title;
if (!empty($display_options)) {
$this->display_plugin = $display_options['display_plugin'];
$this->id = $display_options['id'];
$this->display_title = $display_options['display_title'];
}
}
}

View File

@ -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

View File

@ -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;
}
/**