How to preprocess view accordion
You want to use template_preprocess_views_view (see views theme functions)

function MYTHEME_preprocess_views_view(&amp;$variables) {
  $view = $variables['view'];
  if ($view-&gt;name == 'my_view_name') {
    // add your variables here
    $variables['YOUR_VARIABLE'] = 'value';
  }
}


$YOUR_VARIABLE should be available in your template file.