You are here

function _quicktabs_prepare_views_args in Quick Tabs 6.2

Same name and namespace in other branches
  1. 6.3 quicktabs.module \_quicktabs_prepare_views_args()
  2. 7.2 quicktabs.module \_quicktabs_prepare_views_args()

Helper function to use view arguments from the URL.

1 call to _quicktabs_prepare_views_args()
quicktabs_render in ./quicktabs.module
Render quicktabs.

File

./quicktabs.module, line 671

Code

function _quicktabs_prepare_views_args($tabs) {
  foreach ($tabs as $key => $tab) {
    if ($tab['type'] == 'view') {
      $url_args = arg();
      $args = $tab['args'];
      foreach ($url_args as $id => $arg) {
        $args = str_replace("%{$id}", $arg, $args);
      }
      $args = preg_replace(',/?(%\\d),', '', $args);
      $args = $args ? explode('/', $args) : array();
      $tab['args'] = $args;
      $tabs[$key] = $tab;
    }
  }
  return $tabs;
}