dmBridge PHP API
UNLVSpatialJSONPOutputV1.php
00001 <?php
00002 #
00003 # UNLVSpatial: a dmBridge module for spatial content
00004 #
00005 # Copyright © 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00013 class UNLVSpatialJSONPRepresentationV1 extends UNLVSpatialJSONRepresentationV1 implements DMHTTPRepresentationTransformer {
00014 
00015    private $callback = "dmBridgeRequest";
00016 
00017 
00018    public function __construct() {
00019       parent::__construct();
00020       $callback = DMHTTPRequest::getCurrent()->getURI()->getQueryValue("callback");
00021       $this->setMediaType(new DMMediaType("text", "javascript"));
00022       if ($callback) {
00023          $this->callback = substr($callback, 0, 30);
00024          $this->callback = DMString::paranoid($this->callback, array("_"));
00025       }
00026    }
00027 
00028    protected function output() {
00029       return sprintf("%s(%s)", $this->callback, parent::output());
00030    }
00031 
00032 }
 All Data Structures Functions Variables