You are here

function themekey_views_get_simple_property_by_getq in ThemeKey 7.3

Same name and namespace in other branches
  1. 7.2 modules/themekey.views.inc \themekey_views_get_simple_property_by_getq()

Helper function to to get the value of a simple view property by the view's drupal path

Parameters

$get_q: a drupal path

$property: name of a "simple" view property

Return value

string or NULL if no value could be mapped

3 calls to themekey_views_get_simple_property_by_getq()
themekey_views_getq2human_name in modules/themekey.views.inc
ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
themekey_views_getq2machine_name in modules/themekey.views.inc
ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
themekey_views_getq2vid in modules/themekey.views.inc
ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).

File

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

Code

function themekey_views_get_simple_property_by_getq($get_q, $property) {
  static $all_views = NULL;
  if (is_null($all_views)) {
    $all_views = views_get_all_views();
  }
  if (!empty($all_views)) {
    foreach ($all_views as $views_name => $view) {

      // IF VIEW HAS A PATH WHICH IS EQUAL
      if ($view
        ->get_url() == $get_q) {
        return $view->{$property};
      }
    }
  }
  return NULL;
}