Issue 1602372 by aspilicious: Follow up: Convert missing usages of the variables.
parent
67fc03f3aa
commit
51ab7a50ea
|
|
@ -512,7 +512,7 @@ class views_handler_filter extends views_handler {
|
|||
}
|
||||
|
||||
if ($type == 'value' && empty($this->always_required) && empty($this->options['expose']['required']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
|
||||
$any_label = variable_get('views_exposed_filter_any_label', 'new_any') == 'old_any' ? t('<Any>') : t('- Any -');
|
||||
$any_label = config('views.settings')->get('views_exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -');
|
||||
$form['#options'] = array('All' => $any_label) + $form['#options'];
|
||||
$form['#default_value'] = 'All';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class views_handler_filter_boolean_operator extends views_handler_filter {
|
|||
}
|
||||
// If we're configuring an exposed filter, add an <Any> option.
|
||||
if (empty($form_state['exposed']) || empty($this->options['expose']['required'])) {
|
||||
$any_label = variable_get('views_exposed_filter_any_label', 'new_any') == 'old_any' ? '<Any>' : t('- Any -');
|
||||
$any_label = config('views.settings')->get('views_exposed_filter_any_label') == 'old_any' ? '<Any>' : t('- Any -');
|
||||
if ($form['value']['#type'] != 'select') {
|
||||
$any_label = check_plain($any_label);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ function views_ui_add_admin_css() {
|
|||
* be useful.
|
||||
*/
|
||||
function views_ui_check_advanced_help() {
|
||||
if (!variable_get('views_ui_show_advanced_help_warning', TRUE)) {
|
||||
if (!config('views.settings')->get('views_ui_show_advanced_help_warning')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -115,13 +115,14 @@ function views_ui_preview($view, $display_id, $args = array()) {
|
|||
$old_q = current_path();
|
||||
|
||||
// Determine where the query and performance statistics should be output.
|
||||
$show_query = variable_get('views_ui_show_sql_query', FALSE);
|
||||
$show_info = variable_get('views_ui_show_preview_information', FALSE);
|
||||
$show_location = variable_get('views_ui_show_sql_query_where', 'above');
|
||||
$config = config('views.settings');
|
||||
$show_query = $config->get('views_ui_show_sql_query');
|
||||
$show_info = $config->get('views_ui_show_preview_information');
|
||||
$show_location = $config->get('views_ui_show_sql_query_where');
|
||||
|
||||
$show_stats = variable_get('views_ui_show_performance_statistics', FALSE);
|
||||
$show_stats = $config->get('views_ui_show_performance_statistics');
|
||||
if ($show_stats) {
|
||||
$show_stats = variable_get('views_ui_show_sql_query_where', 'above');
|
||||
$show_stats = $config->get('views_ui_show_sql_query_where');
|
||||
}
|
||||
|
||||
$combined = $show_query && $show_stats;
|
||||
|
|
@ -1508,7 +1509,7 @@ function views_ui_edit_page_display_tabs($view, $display_id = NULL) {
|
|||
*/
|
||||
function views_ui_show_default_display($view) {
|
||||
// Always show the default display for advanced users who prefer that mode.
|
||||
$advanced_mode = variable_get('views_ui_show_master_display', FALSE);
|
||||
$advanced_mode = config('views.settings')->get('views_ui_show_master_display');
|
||||
// For other users, show the default display only if there are no others, and
|
||||
// hide it if there's at least one "real" display.
|
||||
$additional_displays = (count($view->display) == 1);
|
||||
|
|
@ -1687,7 +1688,7 @@ function views_ui_get_display_tab_details($view, $display) {
|
|||
// recollapse the column.
|
||||
$build['columns']['third']['#attributes']['id'] = 'views-ui-advanced-column-' . $view->name;
|
||||
// Collapse the div by default.
|
||||
if (!variable_get('views_ui_show_advanced_column', FALSE)) {
|
||||
if (!config('views.settings')->get('views_ui_show_advanced_column')) {
|
||||
$build['columns']['third']['#attributes']['class'][] = 'ctools-collapsed';
|
||||
}
|
||||
$build['columns']['third']['advanced'] = array('#markup' => '<h3 class="ctools-collapsible-handle"><a href="">' . t('Advanced') . '</a></h3>',);
|
||||
|
|
@ -4744,7 +4745,7 @@ function views_ui_admin_settings_basic() {
|
|||
// $form['live_preview']['views_ui_always_live_preview_button'] = array(
|
||||
// '#type' => 'checkbox',
|
||||
// '#title' => t('Always show the preview button, even when the automatically update option is checked'),
|
||||
// '#default_value' => variable_get('views_ui_always_live_preview_button', FALSE),
|
||||
// '#default_value' => $config->get('views_ui_always_live_preview_button'),
|
||||
// );
|
||||
|
||||
$form['live_preview']['views_ui_show_preview_information'] = array(
|
||||
|
|
@ -4818,10 +4819,10 @@ function views_ui_admin_settings_basic() {
|
|||
}
|
||||
|
||||
/**
|
||||
+ * Form builder submit handler; Handle submission the basic views settings.
|
||||
+ * @ingroup forms
|
||||
+ * @see system_settings_form()
|
||||
+ */
|
||||
* Form builder submit handler; Handle submission the basic views settings.
|
||||
* @ingroup forms
|
||||
* @see system_settings_form()
|
||||
*/
|
||||
function views_ui_admin_settings_basic_submit(&$form, &$form_state) {
|
||||
config('views.settings')
|
||||
->set('views_ui_show_listing_filters', $form_state['values']['views_ui_show_listing_filters'])
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ function _views_fetch_plugin_data($type = NULL, $plugin = 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 (variable_get('views_skip_cache', FALSE)) {
|
||||
if (config('views.settings')->get('views_skip_cache')) {
|
||||
return;
|
||||
}
|
||||
if ($use_language) {
|
||||
|
|
@ -152,7 +152,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 (variable_get('views_skip_cache', FALSE)) {
|
||||
if (config('views.settings')->get('views_skip_cache')) {
|
||||
return FALSE;
|
||||
}
|
||||
if ($use_language) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ function views_views_plugins() {
|
|||
'use pager' => TRUE,
|
||||
'accept attachments' => FALSE,
|
||||
'admin' => t('Embed'),
|
||||
'no ui' => !variable_get('views_ui_display_embed', FALSE),
|
||||
'no ui' => !config('views.settings')->get('views_ui_display_embed'),
|
||||
),
|
||||
),
|
||||
'display_extender' => array(
|
||||
|
|
|
|||
|
|
@ -1027,7 +1027,7 @@ class view extends views_db_object {
|
|||
$exposed_form->query();
|
||||
}
|
||||
|
||||
if (variable_get('views_sql_signature', FALSE)) {
|
||||
if (config('views.settings')->get('views_sql_signature')) {
|
||||
$this->query->add_signature($this);
|
||||
}
|
||||
|
||||
|
|
@ -1168,9 +1168,10 @@ class view extends views_db_object {
|
|||
}
|
||||
|
||||
drupal_theme_initialize();
|
||||
$config = config('views.settings');
|
||||
|
||||
$start = microtime(TRUE);
|
||||
if (!empty($this->live_preview) && variable_get('views_show_additional_queries', FALSE)) {
|
||||
if (!empty($this->live_preview) && $config->get('views_show_additional_queries')) {
|
||||
$this->start_query_capture();
|
||||
}
|
||||
|
||||
|
|
@ -1259,7 +1260,7 @@ class view extends views_db_object {
|
|||
$function($this, $this->display_handler->output, $cache);
|
||||
}
|
||||
|
||||
if (!empty($this->live_preview) && variable_get('views_show_additional_queries', FALSE)) {
|
||||
if (!empty($this->live_preview) && $config->get('views_show_additional_queries')) {
|
||||
$this->end_query_capture();
|
||||
}
|
||||
$this->render_time = microtime(TRUE) - $start;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class views_ui extends ctools_export_ui {
|
|||
|
||||
function list_form(&$form, &$form_state) {
|
||||
$row_class = 'container-inline';
|
||||
if (!variable_get('views_ui_show_listing_filters', FALSE)) {
|
||||
if (!config('views.settings')->get('views_ui_show_listing_filters')) {
|
||||
$row_class .= " element-invisible";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class ViewsTranslatableTest extends ViewsSqlTest {
|
|||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
variable_set('views_localization_plugin', 'test');
|
||||
config('views.settings')->set('views_localization_plugin', 'test')->save();
|
||||
// Reset the plugin data.
|
||||
views_fetch_plugin_data(NULL, NULL, TRUE);
|
||||
$this->strings = array('Master1', 'Apply1', 'Sort By1', 'Asc1', 'Desc1', 'more1', 'Reset1', 'Offset1', 'Master1', 'title1', 'Items per page1', 'fieldlabel1', 'filterlabel1');
|
||||
|
|
|
|||
|
|
@ -1052,7 +1052,7 @@ function views_add_css($file) {
|
|||
*/
|
||||
function views_add_js($file) {
|
||||
// If javascript has been disabled by the user, never add js files.
|
||||
if (variable_get('views_no_javascript', FALSE)) {
|
||||
if (config('views.settings')->get('views_no_javascript')) {
|
||||
return;
|
||||
}
|
||||
static $base = TRUE, $ajax = TRUE;
|
||||
|
|
@ -1606,8 +1606,9 @@ function views_debug($message, $placeholders = array()) {
|
|||
if (!is_string($message)) {
|
||||
$output = '<pre>' . var_export($message, TRUE) . '</pre>';
|
||||
}
|
||||
if (module_exists('devel') && variable_get('views_devel_output', FALSE) && user_access('access devel information')) {
|
||||
$devel_region = variable_get('views_devel_region', 'footer');
|
||||
$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 ($devel_region == 'watchdog') {
|
||||
$output = $message;
|
||||
watchdog('views_logging', $output, $placeholders);
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ function views_ui_theme() {
|
|||
* Impements hook_custom_theme()
|
||||
*/
|
||||
function views_ui_custom_theme() {
|
||||
$theme = variable_get('views_ui_custom_theme', '_default');
|
||||
$theme = config('views.settings')->get('views_ui_custom_theme');
|
||||
|
||||
if ($theme != '_default') {
|
||||
$available = list_themes();
|
||||
|
|
|
|||
Loading…
Reference in New Issue