You are here

cookie_content_blocker.variable.inc in Cookie Content Blocker 7

Contains the variables used by Cookie content blocker, mainly for settings.

This file is used by the Variable module, but also read in as fallback when this module is not available. We do this like this to optionally support translations via the 'Variable translation' module.

Note: Not all settings are exposed to the variable module.

File

cookie_content_blocker.variable.inc
View source
<?php

/**
 * @file
 * Contains the variables used by Cookie content blocker, mainly for settings.
 *
 * This file is used by the Variable module, but also read in as fallback when
 * this module is not available. We do this like this to optionally support
 * translations via the 'Variable translation' module.
 *
 * Note: Not all settings are exposed to the variable module.
 */

/**
 * Implements hook_variable_info().
 */
function cookie_content_blocker_variable_info($options) {
  $variables = array();
  $variables['cookie_content_blocker_blocked_message'] = array(
    'type' => 'text',
    'title' => t('Default message for blocked content', array(), $options),
    'description' => t('When content is blocked and a message is shown, this message will be shown by default. Leave empty to use the default. Some basic HTML can be used.', array(), $options),
    'default' => t('You have not yet given permission to place the required cookies. Accept the required cookies to view this content.', array(), $options),
    'group' => 'cookie_content_blocker',
    'localize' => TRUE,
  );
  $variables['cookie_content_blocker_show_button'] = array(
    'type' => 'boolean',
    'title' => t('Show a button to change cookie consent below the message for blocked content', array(), $options),
    'description' => t('When the button is shown the click event to change cookie consent will be turned on.', array(), $options),
    'default' => TRUE,
    'group' => 'cookie_content_blocker',
  );
  $variables['cookie_content_blocker_button_text'] = array(
    'type' => 'string',
    'title' => t('The change cookie consent button text', array(), $options),
    'description' => t('Leave empty to use the default value.', array(), $options),
    'default' => 'Show content',
    'group' => 'cookie_content_blocker',
    'localize' => TRUE,
  );
  $variables['cookie_content_blocker_enable_click_consent_change'] = array(
    'type' => 'boolean',
    'title' => t('Enable changing consent by clicking on the blocked content', array(), $options),
    'description' => t('To show the blocked content, consent to the placement of cookies has to be given. By enabling this setting clicking on the blocked content wrapper will let the user change consent.', array(), $options),
    'default' => TRUE,
    'group' => 'cookie_content_blocker',
  );
  return $variables;
}

/**
 * Implements hook_variable_group_info().
 */
function cookie_content_blocker_variable_group_info() {
  $groups = array();
  $groups['cookie_content_blocker'] = array(
    'title' => t('Cookie content blocker'),
    'description' => t('Cookie content blocker settings'),
    'access' => 'administer cookie content blocker',
    'path' => array(
      'admin/config/system/cookie_content_blocker',
    ),
  );
  return $groups;
}