function ewiki_mpi_multimedia($action = "html", $args, &$iii, &$s) { switch ($action) { case "doc": return "The <b>multimedia</b> plugin allows to reference multimedia objects which are no plain images (like videos, flash, applets)."; case "desc": return "reference multimedia files"; default: $a_url = array("href", 0, "url", "src"); $a_std = array("width", "height", "type"); $a_forb = array_merge(array("_"), $a_url, $a_std); #-- href foreach ($a_url as $i) { if ($href = $args[$i]) { break; } } #-- <object> tag, std args $o .= '<object data="' . $href . '"'; foreach ($a_std as $i) { if ($v = $args[$i]) { $o .= " {$i}=\"" . htmlentitites($v) . '"'; } } $o .= '>'; #-- <param> args foreach ($args as $i => $v) { if (!in_array($i, $a_forb)) { $o .= '<param name="' . htmlentities($i) . '" value="' . htmlentities($v) . '">'; } } $o .= "Your browser cannot view this multimedia object."; #<off># $o .= '<embed src="' . $href . '"></embed>'; $o .= "</object>"; } return $o; }
function load($id) { $id = intval($id); $class = get_class($this); $r = Am_Di::getInstance()->db->selectRow("SELECT * FROM ?_saved_search\n WHERE saved_search_id=?d and class=?", $id, $class); if ($r) { $this->clearConditions(); $this->setName($r['name']); $this->saved_search_id = $r['saved_search_id']; $this->unserialize($r['search']); if (!$this->getConditions()) { throw new Am_Exception_InternalError("Could not load search [{$id},{$class}] - empty conditions"); } } else { throw new Am_Exception_InputError("Could not load query, not found [" . htmlentitites($id) . ",{$class}]"); } return $this; }
/** * This method translates the request to an XML document String based on the * <code>SessionRequest</code> DTD described above. The ID of the session * to be destroyed has to be set for method <code>DestroySession</code>. * The notification URL has to be set for both methods * <code>AddSessionListener</code> and * <code>AddSessionListenerOnAllSessions</code>. otherwise, the returns * <code>null</code>. * * @return An XML String representing the request. */ public function toXMLString() { $xml = ""; $xml = $xml . "<SessionRequest vers=" . SessionRequest::QUOTE . $this->requestVersion . SessionRequest::QUOTE . " reqid=" . SessionRequest::QUOTE . $this->requestID . SessionRequest::QUOTE; if ($this->requester != null) { $data = base64_encode($this->requester); $xml = $xml . " requester=" . SessionRequest::QUOTE . $data . SessionRequest::QUOTE; } $xml = $xml . ">" . SessionRequest::NL; switch ($this->methodID) { case GetSession: $xml = $xml . "<GetSession reset="; if ($this->resetFlag) { $xml = $xml . SessionRequest::QUOTE . "true" . SessionRequest::QUOTE . ">" . SessionRequest::NL; } else { $xml = $xml . SessionRequest::QUOTE . "false" . SessionRequest::QUOTE . ">" . SessionRequest::NL; } $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "</GetSession>" . SessionRequest::NL; break; case GetValidSessions: $xml = $xml . "<GetValidSessions>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; if ($this->pattern != null) { $xml = $xml . "<Pattern>" . $this->pattern . "</Pattern>" . SessionRequest::NL; } $xml = $xml . "</GetValidSessions>" . SessionRequest::NL; break; case DestroySession: if ($this->destroySessionID == null) { return null; } $xml = $xml . "<DestroySession>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "<DestroySessionID>" . $this->destroySessionID . "</DestroySessionID>" . SessionRequest::NL; $xml = $xml . "</DestroySession>" . SessionRequest::NL; break; case Logout: $xml = $xml . "<Logout>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "</Logout>" . SessionRequest::NL; break; case AddSessionListener: if ($this->notificationURL == null) { return null; } $xml = $xml . "<AddSessionListener>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "<URL>" . $this->notificationURL . "</URL>" . SessionRequest::NL; $xml = $xml . "</AddSessionListener>" . SessionRequest::NL; break; case AddSessionListenerOnAllSessions: if ($this->notificationURL == null) { return null; } $xml = $xml . "<AddSessionListenerOnAllSessions>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "<URL>" . $this->notificationURL . "</URL>" . SessionRequest::NL; $xml = $xml . "</AddSessionListenerOnAllSessions>" . SessionRequest::NL; break; case SetProperty: if ($this->propertyName == null || $this->propertyValue == null) { return null; } $xml = $xml . "<SetProperty>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "<Property name=" . SessionRequest::QUOTE . htmlentitites($this->propertyName, ENT_COMPAT, "UTF-8") . SessionRequest::QUOTE . " value=" . SessionRequest::QUOTE . htmlentities($this->propertyValue, ENT_COMPAT, "UTF-8") . SessionRequest::QUOTE . ">" . "</Property>" . SessionRequest::NL; $xml = $xml . "</SetProperty>" . SessionRequest::NL; break; case GetSessionCount: $xml = $xml . "<GetSessionCount>" . SessionRequest::NL; $xml = $xml . "<SessionID>" . $this->sessionID->__toString() . "</SessionID>" . SessionRequest::NL; $xml = $xml . "<UUID>" . $this->uuid . "</UUID>" . SessionRequest::NL; $xml = $xml . "</GetSessionCount>" . SessionRequest::NL; break; default: return null; } $xml = $xml . "</SessionRequest>"; return $xml; }