Helper function to convert %-style View arguments from the URL into an array

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, $ajax = 0) {
    foreach ($tabs as $key => $tab) {
        if ($tab['type'] == 'view') {
            if ($ajax) {
                views_add_js('ajax_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;
}