Commit ce38db7e authored by slv_'s avatar slv_ Committed by tim.plunkett
Browse files

Issue #1748102 by slv_, dawehner: Move use_ajax() form plugin annotation to class property.

parent e6d8fe72
......@@ -25,7 +25,6 @@
* help = @Translation("Attachments added to other displays to achieve multiple views in the same view."),
* theme = "views_view",
* contextual_links_locations = {""},
* use_ajax = TRUE,
* use_pager = FALSE,
* use_more = TRUE,
* accept_attachments = FALSE,
......
......@@ -22,7 +22,6 @@
* theme = "views_view",
* uses_hook_block = TRUE,
* contextual_links_locations = {"block"},
* use_ajax = TRUE,
* use_pager = TRUE,
* use_more = TRUE,
* accept_attachments = TRUE,
......@@ -204,7 +203,7 @@ function options_submit(&$form, &$form_state) {
* Block views use exposed widgets only if AJAX is set.
*/
function uses_exposed() {
if ($this->use_ajax()) {
if ($this->isAJAXEnabled()) {
return parent::uses_exposed();
}
return FALSE;
......
......@@ -22,7 +22,6 @@
* theme = "views_view",
* no_ui = TRUE,
* no_remove = TRUE,
* use_ajax = TRUE,
* use_pager = TRUE,
* use_more = TRUE,
* accept_attachments = TRUE,
......
......@@ -57,6 +57,13 @@ abstract class DisplayPluginBase extends PluginBase {
*/
public $output = NULL;
/**
* Whether the display allows the use of AJAX or not.
*
* @var bool
*/
protected $usesAJAX = TRUE;
function init(&$view, &$display, $options = NULL) {
$this->view = &$view;
$this->display = &$display;
......@@ -339,10 +346,21 @@ function displays_exposed() {
}
/**
* Does the display use AJAX?
* Whether the display allows the use of AJAX or not.
*
* @return bool
*/
function usesAJAX() {
return $this->usesAJAX;
}
/**
* Whether the display is actually using AJAX or not.
*
* @return bool
*/
function use_ajax() {
if (!empty($this->definition['use_ajax'])) {
function isAJAXEnabled() {
if ($this->usesAJAX()) {
return $this->get_option('use_ajax');
}
return FALSE;
......@@ -1239,7 +1257,7 @@ function options_summary(&$categories, &$options) {
$options['row_plugin']['links']['row_options'] = t('Change settings for this style');
}
}
if (!empty($this->definition['use_ajax'])) {
if ($this->usesAJAX()) {
$options['use_ajax'] = array(
'category' => 'other',
'title' => t('Use AJAX'),
......@@ -2683,7 +2701,7 @@ function access($account = NULL) {
* overridden on an individual display.
*/
function pre_execute() {
$this->view->set_use_ajax($this->use_ajax());
$this->view->set_use_ajax($this->isAJAXEnabled());
if ($this->use_more() && !$this->use_more_always()) {
$this->view->get_total_rows = TRUE;
}
......
......@@ -24,7 +24,6 @@
* help = @Translation("Provide a display which can be embedded using the views api."),
* theme = "views_view",
* uses_hook_menu = FALSE,
* use_ajax = TRUE,
* use_pager = TRUE,
* accept_attachments = FALSE,
* help_topic = "display-embed"
......
......@@ -23,7 +23,6 @@
* title = @Translation("Feed"),
* help = @Translation("Display the view as a feed, such as an RSS feed."),
* uses_hook_menu = TRUE,
* use_ajax = FALSE,
* use_pager = FALSE,
* accept_attachments = FALSE,
* admin = @Translation("Feed"),
......@@ -32,6 +31,13 @@
*/
class Feed extends Page {
/**
* Whether the display allows the use of AJAX or not.
*
* @var bool
*/
protected $usesAJAX = FALSE;
function init(&$view, &$display, $options = NULL) {
parent::init($view, $display, $options);
......
......@@ -22,7 +22,6 @@
* uses_hook_menu = TRUE,
* contextual_links_locations = {"page"},
* theme = "views_view",
* use_ajax = TRUE,
* use_pager = TRUE,
* use_more = TRUE,
* accept_attachments = TRUE,
......
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