Commit e5a4ab8a authored by aspilicious's avatar aspilicious Committed by tim.plunkett

Issue #1705714 by aspilicious: Convert views CMI settings to new standard.

parent f632baa2
# Basic settings
views_ui_show_listing_filters: '0'
views_ui_show_advanced_help_warning: '1'
views_ui_show_master_display: '0'
views_ui_show_advanced_column: '0'
views_ui_display_embed: '0'
views_ui_custom_theme: '_default'
views_exposed_filter_any_label: 'new_any'
views_ui_always_live_preview: '1'
views_ui_show_preview_information: '1'
views_ui_show_sql_query_where: 'above'
views_ui_show_sql_query: '0'
views_ui_show_performance_statistics: '0'
views_show_additional_queries: '0'
# Advanced settings
views_skip_cache: '0'
views_sql_signature: '0'
views_no_javascript: '0'
views_devel_output: '0'
views_localization_plugin: ''
views_devel_region: 'footer'
views_display_extenders: { }
debug:
output: '0'
region: 'footer'
display_extenders: { }
localization_plugin: ''
no_javascript: '0'
skip_cache: '0'
sql_signature: '0'
ui:
show:
additional_queries: '0'
advanced_help_warning: '1'
advanced_column: '0'
listing_filters: '0'
master_display: '0'
performance_statistics: '0'
preview_information: '1'
sql_query:
enabled: '0'
where: 'above'
display_embed: '0'
custom_theme: '_default'
always_live_preview: '1'
always_live_preview_button: '1'
exposed_filter_any_label: 'new_any'
......@@ -237,18 +237,19 @@ function views_revert_view($view) {
*/
function views_development_settings() {
config('views.settings')
->set('views_ui_show_listing_filters', TRUE)
->set('views_ui_show_master_display', TRUE)
->set('views_ui_show_advanced_column', TRUE)
->set('views_ui_always_live_preview', FALSE)
->set('views_ui_always_live_preview_button', TRUE)
->set('views_ui_show_preview_information', TRUE)
->set('views_ui_show_sql_query', TRUE)
->set('views_ui_show_performance_statistics', TRUE)
->set('views_show_additional_queries', TRUE)
->set('views_devel_output', TRUE)
->set('views_devel_region', 'message')
->set('views_ui_display_embed', TRUE)
->set('ui.show.listing_filters', TRUE)
->set('ui.show.master_display', TRUE)
->set('ui.show.advanced_column', TRUE)
->set('ui.always_live_preview', FALSE)
->set('ui.always_live_preview_button', TRUE)
->set('ui.show.preview_information', TRUE)
->set('ui.show.sql_query.enabled', TRUE)
->set('ui.show.sql_query.where', 'above')
->set('ui.show.performance_statistics', TRUE)
->set('ui.show.additional_queries', TRUE)
->set('debug.output', TRUE)
->set('debug.region', 'message')
->set('ui.show.display_embed', TRUE)
->save();
$message = dt('Setup the new views settings.');
......
This diff is collapsed.
......@@ -123,7 +123,7 @@ function _views_fetch_plugin_data($type = NULL, $id = NULL, $reset = FALSE) {
* If TRUE, the data will be cached specific to the currently active language.
*/
function views_cache_set($cid, $data, $use_language = FALSE) {
if (config('views.settings')->get('views_skip_cache')) {
if (config('views.settings')->get('skip_cache')) {
return;
}
if ($use_language) {
......@@ -147,7 +147,7 @@ function views_cache_set($cid, $data, $use_language = FALSE) {
* The cache or FALSE on failure.
*/
function views_cache_get($cid, $use_language = FALSE) {
if (config('views.settings')->get('views_skip_cache')) {
if (config('views.settings')->get('skip_cache')) {
return FALSE;
}
if ($use_language) {
......
......@@ -16,7 +16,7 @@
* @ingroup views_display_plugins
*
* @todo: Wait until annotations/plugins support access mehtods.
* no ui => !config('views.settings')->get('views_ui_display_embed'),
* no ui => !config('views.settings')->get('ui.show.display_embed'),
*/
/**
......
......@@ -124,7 +124,7 @@ function value_form(&$form, &$form_state) {
}
// If we're configuring an exposed filter, add an <Any> option.
if (empty($form_state['exposed']) || empty($this->options['expose']['required'])) {
$any_label = config('views.settings')->get('views_exposed_filter_any_label') == 'old_any' ? '<Any>' : t('- Any -');
$any_label = config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? '<Any>' : t('- Any -');
if ($form['value']['#type'] != 'select') {
$any_label = check_plain($any_label);
}
......
......@@ -540,7 +540,7 @@ function exposed_translate(&$form, $type) {
}
if ($type == 'value' && empty($this->always_required) && empty($this->options['expose']['required']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
$any_label = config('views.settings')->get('views_exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -');
$any_label = config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -');
$form['#options'] = array('All' => $any_label) + $form['#options'];
$form['#default_value'] = 'All';
}
......
......@@ -31,7 +31,7 @@ public static function getInfo() {
protected function setUp() {
parent::setUp();
config('views.settings')->set('views_localization_plugin', 'test_localization')->save();
config('views.settings')->set('localization_plugin', 'test_localization')->save();
// Reset the plugin data.
views_fetch_plugin_data(NULL, NULL, TRUE);
$this->strings = array(
......
......@@ -42,7 +42,7 @@ function testViewsListing() {
// Configure to hide listing filters.
$edit = array(
'views_ui_show_listing_filters' => FALSE,
'ui_show_listing_filters' => FALSE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
$this->drupalGet('admin/structure/views');
......@@ -51,7 +51,7 @@ function testViewsListing() {
// Configure to show listing filters.
$edit = array(
'views_ui_show_listing_filters' => TRUE,
'ui_show_listing_filters' => TRUE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
$this->drupalGet('admin/structure/views');
......@@ -67,7 +67,7 @@ function testAdvancedHelpMessage() {
// Configure to hide the advanced help message.
$edit = array(
'views_ui_show_advanced_help_warning' => FALSE,
'ui_show_advanced_help_warning' => FALSE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
$this->drupalGet('admin/structure/views');
......@@ -76,7 +76,7 @@ function testAdvancedHelpMessage() {
// Configure to show the advanced help message.
$edit = array(
'views_ui_show_advanced_help_warning' => TRUE,
'ui_show_advanced_help_warning' => TRUE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
$this->drupalGet('admin/structure/views');
......@@ -92,7 +92,7 @@ function testEditUi() {
// Configure to always show the master display.
$edit = array(
'views_ui_show_master_display' => TRUE,
'ui_show_master_display' => TRUE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
......@@ -111,7 +111,7 @@ function testEditUi() {
// If you have a view without a page or block the master display should be
// still shown.
$edit = array(
'views_ui_show_master_display' => FALSE,
'ui_show_master_display' => FALSE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
......@@ -131,14 +131,14 @@ function testEditUi() {
// Configure to show the embedable display.
$edit = array(
'views_ui_display_embed' => TRUE,
'ui_show_display_embed' => TRUE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
$this->drupalPost('admin/structure/views/add', $view, t('Continue & edit'));
$this->assertFieldById('edit-displays-top-add-display-embed');
$edit = array(
'views_ui_display_embed' => FALSE,
'ui_show_display_embed' => FALSE,
);
$this->drupalPost('admin/structure/views/settings', $edit, t('Save configuration'));
views_invalidate_cache();
......
......@@ -1046,7 +1046,7 @@ function build($display_id = NULL) {
$exposed_form->query();
}
if (config('views.settings')->get('views_sql_signature')) {
if (config('views.settings')->get('sql_signature')) {
$this->query->add_signature($this);
}
......@@ -1196,7 +1196,7 @@ function render($display_id = NULL) {
$this->response = new Response('', 200);
$start = microtime(TRUE);
if (!empty($this->live_preview) && $config->get('views_show_additional_queries')) {
if (!empty($this->live_preview) && $config->get('ui.show.additional_queries')) {
$this->start_query_capture();
}
......@@ -1285,7 +1285,7 @@ function render($display_id = NULL) {
$function($this, $this->display_handler->output, $cache);
}
if (!empty($this->live_preview) && $config->get('views_show_additional_queries')) {
if (!empty($this->live_preview) && $config->get('ui.show.additional_queries')) {
$this->end_query_capture();
}
$this->render_time = microtime(TRUE) - $start;
......
......@@ -69,7 +69,7 @@ function load_item($item_name) {
function list_form(&$form, &$form_state) {
$row_class = 'container-inline';
if (!config('views.settings')->get('views_ui_show_listing_filters')) {
if (!config('views.settings')->get('ui.show.listing_filters')) {
$row_class .= " element-invisible";
}
......
......@@ -639,25 +639,26 @@ function views_update_7301() {
*/
function views_update_8000() {
update_variables_to_config('views.settings', array(
'views_ui_show_listing_filters' => 'views_ui_show_listing_filters',
'views_ui_show_advanced_help_warning' => 'views_ui_show_advanced_help_warning',
'views_ui_show_master_display' => 'views_ui_show_master_display',
'views_ui_show_advanced_column' => 'views_ui_show_advanced_column',
'views_ui_display_embed' => 'views_ui_display_embed',
'views_ui_custom_theme' => 'views_ui_custom_theme',
'views_exposed_filter_any_label' => 'views_exposed_filter_any_label',
'views_ui_always_live_preview' => 'views_ui_always_live_preview',
'views_ui_show_preview_information' => 'views_ui_show_preview_information',
'views_ui_show_sql_query_where' => 'views_ui_show_sql_query_where',
'views_ui_show_sql_query' => 'views_ui_show_sql_query',
'views_ui_show_performance_statistics' => 'views_ui_show_performance_statistics',
'views_show_additional_queries' => 'views_show_additional_queries',
'views_skip_cache' => 'views_skip_cache',
'views_sql_signature' => 'views_sql_signature',
'views_no_javascript' => 'views_no_javascript',
'views_devel_output' => 'views_devel_output',
'views_localization_plugin' => 'views_localization_plugin',
'views_devel_region' => 'views_devel_region',
'views_display_extenders' => 'views_display_extenders',
'views_ui_show_listing_filters' => 'ui.show.listing_filters',
'views_ui_show_advanced_help_warning' => 'ui.show.advanced_help_warning',
'views_ui_show_master_display' => 'ui.show.master_display',
'views_ui_show_advanced_column' => 'ui.show.advanced_column',
'views_ui_display_embed' => 'ui.show.display_embed',
'views_ui_custom_theme' => 'ui.custom_theme',
'views_exposed_filter_any_label' => 'exposed_filter_any_label',
'views_ui_always_live_preview' => 'ui.always_live_preview',
'views_ui_always_live_preview_button' => 'ui.always_live_preview_button',
'views_ui_show_preview_information' => 'ui.show.preview_information',
'views_ui_show_sql_query_where' => 'ui.show.sql_query.where',
'views_ui_show_sql_query' => 'ui.show_sql.query.enabled',
'views_ui_show_performance_statistics' => 'ui.show.performance_statistics',
'views_show_additional_queries' => 'ui.show.additional_queries',
'views_skip_cache' => 'skip_cache',
'views_sql_signature' => 'sql_signature',
'views_no_javascript' => 'no_javascript',
'views_devel_output' => 'debug.output',
'views_localization_plugin' => 'localization_plugin',
'views_devel_region' => 'debug.region',
'views_display_extenders' => 'display_extenders',
));
}
......@@ -1172,7 +1172,7 @@ function views_add_css($file) {
*/
function views_add_js($file) {
// If javascript has been disabled by the user, never add js files.
if (config('views.settings')->get('views_no_javascript')) {
if (config('views.settings')->get('no_javascript')) {
return;
}
static $base = TRUE, $ajax = TRUE;
......@@ -1388,7 +1388,7 @@ function views_get_plugin($type, $id, $reset = FALSE) {
* @return The name of the localization plugin.
*/
function views_get_localization_plugin() {
$plugin = config('views.settings')->get('views_localization_plugin');
$plugin = config('views.settings')->get('localization_plugin');
// Provide sane default values for the localization plugin.
if (empty($plugin)) {
if (module_exists('locale')) {
......@@ -1406,7 +1406,7 @@ function views_get_localization_plugin() {
* Get enabled display extenders.
*/
function views_get_enabled_display_extenders() {
$enabled = array_filter((array) config('views.settings')->get('views_display_extenders'));
$enabled = array_filter((array) config('views.settings')->get('display_extenders'));
$options = views_fetch_plugin_names('display_extender');
foreach ($options as $name => $plugin) {
$enabled[$name] = $name;
......@@ -1767,8 +1767,8 @@ function views_debug($message, $placeholders = array()) {
$output = '<pre>' . var_export($message, TRUE) . '</pre>';
}
$config = config('views.settings');
if (module_exists('devel') && $config->get('views_devel_output') && user_access('access devel information')) {
$devel_region = $config->get('views_devel_region');
if (module_exists('devel') && $config->get('debug.output') && user_access('access devel information')) {
$devel_region = $config->get('debug.region');
if ($devel_region == 'watchdog') {
$output = $message;
watchdog('views_logging', $output, $placeholders);
......
......@@ -248,7 +248,7 @@ function views_ui_theme() {
* Impements hook_custom_theme()
*/
function views_ui_custom_theme() {
$theme = config('views.settings')->get('views_ui_custom_theme');
$theme = config('views.settings')->get('ui.custom_theme');
if ($theme != '_default') {
$available = list_themes();
......
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