You are here

function themekey_views_vid2getq in ThemeKey 7

get the views id (vid) by given path

Parameters

unknown_type $get_q:

unknown_type $parameters:

1 string reference to 'themekey_views_vid2getq'
themekey_views_themekey_properties in modules/themekey.views.inc
@file themekey.views.inc Provides some views properties

File

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

Code

function themekey_views_vid2getq($get_q, $parameters) {
  $vid = NULL;
  $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) {
        $vid = $view->vid;
        break;
      }
    }
  }
  return $vid;
}