- <?php
- * @addtogroup updates-7.x-to-1.x
- * @{
- */
-
- * Update Views UI variables to use configuration files.
- */
- function views_ui_update_1000() {
- $update_variables = array(
- 'views_ui_show_default_display' => FALSE,
- 'views_ui_show_sql_query' => FALSE,
- 'views_ui_show_preview_information' => FALSE,
- 'views_ui_show_sql_query_where' => 'above',
- 'views_ui_show_performance_statistics' => FALSE,
- 'views_ui_always_live_preview' => TRUE,
- 'views_ui_display_embed' => FALSE,
- 'views_ui_custom_theme' => '_default',
- );
-
-
- $config = config('views_ui.settings');
- foreach ($update_variables as $name => $default) {
- $value = update_variable_get($name, $default);
- $name = str_replace('views_ui_', '', $name);
- $config->set($name, $value);
- }
- $config->save();
-
-
- $delete_variables = array_keys($update_variables);
- $delete_variables[] = 'views_ui_show_listing_filters';
- db_delete('variable')
- ->condition('name', $delete_variables, 'IN')
- ->execute();
- }
-
- * Add new default display(s) setting.
- */
- function views_ui_update_1001() {
- $config = config('views_ui.settings');
- $config->set('wizard_default_display.page', 'page');
- $config->set('wizard_default_display.block', 0);
- $config->save();
- }
-
- * Rename the setting that allows showing the default display.
- */
- function views_ui_update_1002() {
- $config = config('views_ui.settings');
-
-
- $value = $config->get('views_ui_show_master_display');
- if (!is_null($value)) {
- $config->set('views_ui_show_default_display', $value);
-
- $config->clear('views_ui_show_master_display');
- $config->save();
- }
- }
-
- * @} End of "addtogroup updates-7.x-to-1.x"
- * The next series of updates should start at 2000.
- */