示例#1
0
 * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
 * current_top_level_page    string                           full url to the current top level page in "top_leve_pages"
 * current_sub_level_page    string                           full url to the current sub level page in the "sub_level_pages"
 * sub_level_pages           array(array('url', 'title'))     the sub level pages.
 * is_mobile_device          true or false                    the request is from a mobile device or a desktop device
 * mobile_device_type        One of the constants: IPOD_DEVICE, BLACKBERRY_DEVICE, ANDROID_DEVICE, UNKNOWN_DEVICE (@see include/lib/constants.inc.php)
 */
// will have to be moved to the header.inc.php
global $system_courses, $_custom_css, $db, $_base_path, $contentManager;
// 1. any click on the page closes the content menu but the link "content_link" itself
// 2. the click on link "content_link" opens the content menu
require 'TeraWurflRemoteClient.php';
$wurflObj = new TeraWurflRemoteClient('http://wurfl.thesedays.com/webservice.php');
$capabilities = array("product_info");
$data_format = TeraWurflRemoteClient::$FORMAT_JSON;
$wurflObj->getCapabilitiesFromAgent(null, $capabilities, $data_format);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php 
echo $this->lang_code;
?>
"> 

<head>
	<title><?php 
echo SITE_NAME;
?>
 : <?php 
echo $this->page_title;
?>
示例#2
0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Remote Tera-WURFL Remote Client Example</title>
</head>
<body>
<?php 
$start = microtime(true);
require_once realpath(dirname(__FILE__) . '/../../TeraWurflRemoteClient.php');
// NOTE: You must use $FORMAT_XML to communicate with Tera-WURFL 2.1.1 and earlier!
$data_format = TeraWurflRemoteClient::$FORMAT_JSON;
$wurflObj = new TeraWurflRemoteClient('http://localhost/Tera-Wurfl/webservice.php', $data_format);
$capabilities = array("product_info", "fake_capability");
$wurflObj->getCapabilitiesFromAgent(null, $capabilities);
$time = round(microtime(true) - $start, 6);
echo "<h3>Response from Tera-WURFL " . $wurflObj->getAPIVersion() . "</h3>";
echo "<pre>" . var_export($wurflObj->capabilities, true) . "</pre>";
if ($wurflObj->errors) {
    foreach ($wurflObj->errors as $name => $error) {
        echo "{$name}: {$error}<br/>";
    }
}
echo "<hr/>Total Time: {$time}";
?>
</body>
</html>