code/pagetypes/BrowseCataloguePage.php
/**
     * Ouputs the XML for a record in a catalogue as a download.
     *
     * @param  SS_HTTPRequest $request
     * @return text/xml
     */
Ouputs the XML for a record in a catalogue as a download.
@param  SS_HTTPRequest $request
@return text/xml
Ouputs the XML for a record in a catalogue as a download . @param SS_HTTPRequest $request @return text / xml
public function xml(SS_HTTPRequest $request)
    {
        $id = $request->getVar('id');
        if ($id) {
            $record = $this->getRecordByID($id, true);
            $resp = $this->getResponse();
            $resp->addHeader("Content-Type", "text/xml");
            $resp->addHeader('Content-Disposition', "attachment; filename=\"" . $id . ".xml\";");
            return $record;
        }
    }
public function xml ( SS_HTTPRequest $ request ) { $ id = $ request -> getVar ( 'id' ) ; if ( $ id ) { $ record = $ this -> getRecordByID ( $ id , true ) ; $ resp = $ this -> getResponse ( ) ; $ resp -> addHeader ( " Content-Type " , " text/xml " ) ; $ resp -> addHeader ( 'Content-Disposition' , " attachment; filename= \" " . $ id . " .xml \" ; " ) ; return $ record ; } }
Ouputs the XML for a record in a catalogue as a download.
Ouputs the XML for a record in a catalogue as a download .