dmBridge PHP API
UNLVHighlightController.php
00001 <?php
00002 #
00003 # UNLVHighlight: a dmBridge module for highlighting objects
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 UNLVHighlightController {
00014 
00018    public function highlighted() {
00019       if (!$obj = UNLVHighlightedObject::getHighlightedObject()) {
00020          header("HTTP/1.1 204 No Content");
00021          die;
00022       }
00023       $output = DMHTTPResponseFactory::getTransformer();
00024       $output->outputHeaders();
00025       die($output->transformObject($obj));
00026    }
00027 
00031    public function highlightedFeed() {
00032       if (!$obj = DMObject::getHighlighted()) {
00033          header("HTTP/1.1 204 No Content");
00034          die;
00035       }
00036       $output = DMHTTPResponseFactory::getTransformer();
00037       // highlighted object is not accessible via the DMHTMLRepresentation
00038       if ($output instanceof DMHTMLRepresentation) {
00039          $output = DMAtomRepresentation::getInstance();
00040       }
00041       $output->outputHeaders();
00042       die($output->transformObject($obj));
00043    }
00044 
00045 }
 All Data Structures Functions Variables