Beispiel #1
0
function header_load($doc = null)
{
  $id = '';
  $onload = '';
  if($doc != null) 
  {
    $timestamp = time();
    $id = $doc->getId();
    $sig = Vuzit_Service::signature("show", $doc->getId(), $timestamp, get("p"));
    $onload = "initialize()";
  }
?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title>Vuzit <?php echo get("c") ?> Command Example</title>
      <link href="<?php echo Vuzit_Service::getServiceUrl(); ?>/stylesheets/Vuzit-2.9.css" 
            rel="Stylesheet" type="text/css" />
      <script src="<?php echo Vuzit_Service::getServiceUrl(); ?>/javascripts/Vuzit-2.9.js" 
              type="text/javascript"></script>
      <script type="text/javascript">
        // Called when the page is loaded.  
        function initialize()  {
          vuzit.Base.apiKeySet("<?php echo Vuzit_Service::getPublicKey(); ?>"); 
          vuzit.Base.webServerSet({ host: '<?php echo domain(); ?>', port: '80' });
          vuzit.Base.imageServerSet({ host: '<?php echo domain(); ?>', port: '80' });

          var options = { signature: '<?php echo rawurlencode($sig); ?>', 
                          <?php if(get("p") != null) { ?>
                          includedPages: '<?php echo get("p"); ?>', 
                          <?php } ?>
                          timestamp: '<?php echo $timestamp ?>'}
          var viewer = vuzit.Viewer.fromId("<?php echo $id; ?>", options);
          
          viewer.display(document.getElementById("vuzit_viewer"), { zoom: 1 });
        }
      </script>
    </head>

    <body onload="<?php echo $onload; ?>"> 

    <h2>Command: <?php echo get("c"); ?></h2>
<?php
}
Beispiel #2
0
 protected static function postParameters($method, $params, $id = '')
 {
     if ($params == null) {
         $params = array();
     }
     $params['method'] = $method;
     $params['key'] = Vuzit_Service::getPublicKey();
     // Signature variables
     $timestamp = time();
     $params['timestamp'] = sprintf("%d", $timestamp);
     $pages = '';
     if (array_key_exists("included_pages", $params)) {
         $pages = $params["included_pages"];
     }
     $label = '';
     // Create the signature
     $sig = Vuzit_Service::signature($method, $id, $timestamp, $pages, $label);
     $params['signature'] = $sig;
     return $params;
 }
Beispiel #3
0
 protected static function postParameters($method, $params, $id = '')
 {
     if ($params == null) {
         $params = array();
     }
     $params['method'] = $method;
     $params['key'] = Vuzit_Service::getPublicKey();
     // Signature variables
     $timestamp = time();
     $params['timestamp'] = sprintf("%d", $timestamp);
     $sig = Vuzit_Service::signature($method, $id, $timestamp, $params);
     $params['signature'] = $sig;
     return $params;
 }