<?php
if (in_array($data['fileTypeInfo']['extension'], array("odt", "ods", "odp"))) {
	$customAction = "webodf";
} else {
	$customAction = "google_docs_viewer";
}

//forward the request to a "custom action"
global $str, $config;
$url = $config['url']['root']."/?module=custom_actions&action=".$customAction;
$url .= "&path=".$str->forURL($str->forHTML($_REQUEST['path']));
$url .= "&filename=".$str->forURL($str->forHTML($data['fileName']));
header("Location: ".$url);