You are here

function themekey_views_themekey_properties in ThemeKey 7.2

Same name and namespace in other branches
  1. 7.3 modules/themekey.views.inc \themekey_views_themekey_properties()
  2. 7 modules/themekey.views.inc \themekey_views_themekey_properties()

@file themekey.views.inc Provides some views properties

File

modules/themekey.views.inc, line 8
themekey.views.inc Provides some views properties

Code

function themekey_views_themekey_properties() {

  // Attributes of properties
  $attributes = array();
  if (module_exists('views')) {
    $attributes['views:vid'] = array(
      'description' => t('Views: VID - The vid of a view (vid)'),
      'validator' => 'themekey_validator_ctype_digit',
      'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
    );
    $attributes['views:machine_name'] = array(
      'description' => t('Views: Machine Name - The machine name of a view'),
      'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
    );
    $attributes['views:human_name'] = array(
      'description' => t('Views: Human Name - The (human readable) name of a view'),
      'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
    );

    // Mapping functions
    $maps = array();
    $maps[] = array(
      'src' => 'drupal:get_q',
      'dst' => 'views:vid',
      'callback' => 'themekey_views_getq2vid',
    );
    $maps[] = array(
      'src' => 'drupal:get_q',
      'dst' => 'views:machine_name',
      'callback' => 'themekey_views_getq2machine_name',
    );
    $maps[] = array(
      'src' => 'drupal:get_q',
      'dst' => 'views:human_name',
      'callback' => 'themekey_views_getq2human_name',
    );
    $return = array(
      'attributes' => $attributes,
      'maps' => $maps,
    );
  }
  return $return;
}