diff --git a/plugins/views_plugin_display.inc b/plugins/views_plugin_display.inc index 40aecb2..9774c1d 100644 --- a/plugins/views_plugin_display.inc +++ b/plugins/views_plugin_display.inc @@ -411,6 +411,7 @@ class views_plugin_display extends views_plugin { 'css_class' => array('css_class'), 'use_ajax' => array('use_ajax'), 'hide_attachment_summary' => array('hide_attachment_summary'), + 'hide_admin_links' => array('hide_admin_links'), 'group_by' => array('group_by'), 'query' => array('query'), 'use_more' => array('use_more', 'use_more_always', 'use_more_text'), @@ -473,6 +474,7 @@ class views_plugin_display extends views_plugin { 'display_description' => FALSE, 'use_ajax' => TRUE, 'hide_attachment_summary' => TRUE, + 'hide_admin_links' => FALSE, 'pager' => TRUE, 'pager_options' => TRUE, 'use_more' => TRUE, @@ -532,6 +534,10 @@ class views_plugin_display extends views_plugin { 'default' => FALSE, 'bool' => TRUE, ), + 'hide_admin_links' => array( + 'default' => FALSE, + 'bool' => TRUE, + ), // This is legacy code: // Items_per/offset/use_pager is moved to the pager plugin // but the automatic update path needs this items defined, so don't remove it. @@ -1210,6 +1216,14 @@ class views_plugin_display extends views_plugin { 'desc' => t('Change whether or not to display attachments when displaying a contextual filter summary.'), ); } + if (!empty($this->definition['contextual links locations'])) { + $options['hide_admin_links'] = array( + 'category' => 'other', + 'title' => t('Hide contextual links'), + 'value' => $this->get_option('hide_admin_links') ? t('Yes') : t('No'), + 'desc' => t('Change whether or not to display contextual links for this view.'), + ); + } $pager_plugin = $this->get_plugin('pager'); if (!$pager_plugin) { @@ -1477,6 +1491,14 @@ class views_plugin_display extends views_plugin { '#default_value' => $this->get_option('hide_attachment_summary') ? 1 : 0, ); break; + case 'hide_admin_links': + $form['#title'] .= t('Hide contextual links on this view.'); + $form['hide_admin_links'] = array( + '#type' => 'radios', + '#options' => array(1 => t('Yes'), 0 => t('No')), + '#default_value' => $this->get_option('hide_admin_links') ? 1 : 0, + ); + break; case 'use_more': $form['#title'] .= t('Add a more link to the bottom of the display.'); $form['use_more'] = array( @@ -2326,6 +2348,7 @@ class views_plugin_display extends views_plugin { break; case 'use_ajax': case 'hide_attachment_summary': + case 'hide_admin_links': $this->set_option($section, (bool)$form_state['values'][$section]); break; case 'use_more': @@ -2625,6 +2648,10 @@ class views_plugin_display extends views_plugin { foreach ($this->extender as $extender) { $extender->pre_execute(); } + + if ($this->get_option('hide_admin_links')) { + $this->view->hide_admin_links = TRUE; + } } /**