function ADEIServiceGetUpdateInfo(REQUEST $req) { if ($req->CheckData()) { if ($req->GetProp("target", false)) { $query = $req->GetQueryString($extra = array("time_format" => "text")); } else { $query = $req->GetQueryString($extra = array("target" => "status", "time_format" => "text")); } return array("xml" => "services/control.php?{$query}", "xslt" => "controlinfo"); } return false; }
function Search($search_string, $module, SEARCHFilter $filter = NULL, $opts = false) { global $ADEI; $xml = $this->GetOption("xml", $opts); $xslt = $this->GetOption("xslt", $opts, "null"); $noprops = $this->GetOption("noprops", $opts); $nolimits = $this->GetOption("nolimits", $opts); $searchprop = $this->GetOption("searchprop", $opts, false); if ($xml) { if (preg_match("/^(services\\/)?([\\w\\d_]+\\.php)(\\?(.*))?\$/", $xml, $m)) { $adei_url = $ADEI->GetBaseURL(); $xml_url = "{$adei_url}services/" . $m[2]; $xml_props = $m[4]; } else { if ($opts && $opts['xml']) { throw new ADEIException(translate("Proxy-search is allowed to ADEI-services only")); } else { list($xml_url, $xml_props) = preg_split("/\\?/", $xml, 2); } } } else { throw new ADEIException(translate("The proxy URL is required by search module")); } if ($noprops) { $props = array(); } else { $props = $this->req->GetProps(); unset($props['search']); unset($props['search_modules']); } if ($filter && !$nolimits) { $ivl_filter = $filter->GetLimit('interval'); if ($ivl_filter) { $props['window'] = $ivl_filter; } } if ($searchprop === false) { $props['search'] = $search_string; } else { if ($searchprop) { $props[$searchprop] = $search_string; } } if ($props) { $req = new REQUEST($props); $xml_props = $req->GetQueryString($xml_props); $xml = $xml_url . "?" . $xml_props; } else { if ($xml_props) { $xml = $xml_url . "?" . $xml_props; } else { $xml = $xml_url; } } $html = $ADEI->TransformXML($xslt, $xml); $result = new SEARCHResults(NULL, $this, $module, ""); $result->Append(preg_replace("/^\\s*<\\?xml.*\$/m", "", $html)); return $result; }
function ADEIServiceGetUpdateInfo(REQUEST $req) { if ($req->CheckData()) { $query = $req->GetQueryString($extra = array("target" => "alarms_summary", "time_format" => "text")); return array("xml" => "services/control.php?{$query}", "xslt" => "alarms"); } return false; }
function ADEIServiceGetUpdateInfo(REQUEST $req) { $query = $req->GetQueryString($extra = array("target" => "get")); $mod = $req->GetProp("infomod"); if ($mod) { return array("xml" => "services/view.php?{$query}", "xslt" => "views/{$mod}"); } return false; }
function ADEIServiceGetUpdateInfo(REQUEST $req) { global $ADEI; $xslt_file = $ADEI->GetXSLTFile($req->props['module']); if (file_exists($xslt_file)) { $xslt = $req->props['module']; } else { $xslt = "null"; } $query = $req->GetQueryString(); return array("xml" => "services/" . $req->props['module'] . ".php?{$query}", "xslt" => $xslt); }
function GetQueryString(REQUEST $sreq) { global $ADEI_SETUP; $req = $sreq->GetQueryString(); if ($req) $req .= "&"; else $req = ""; $req .= "setup=" . $ADEI_SETUP; return $req; }
function ADEIServiceGetUpdateInfo(REQUEST $req) { $query = $req->GetQueryString(); return array("xml" => "services/" . $req->props['module'] . ".php?{$query}", "xslt" => "settings"); }
$title = xml_escape($mod['title']); $title = "title=\"{$title}\""; } else { $title = ""; } fwrite($out, "<module name=\"{$mod['module']}\" {$title}>"); if ($mod['description']) { fwrite($out, "<description>"); fwrite($out, $mod['description']); fwrite($out, "</description>"); } if ($mod['results']) { fwrite($out, "<results>"); foreach ($mod['results'] as &$r) { $rreq = new REQUEST($r['props']); $props = xml_escape($rreq->GetQueryString()); if ($r['title']) { $title = xml_escape($r['title']); } else { $title = preg_replace("/&/", ",", $props); } $extra = ""; if ($r['certain']) { $extra = " certain=\"1\""; } fwrite($out, "<Value title=\"{$title}\" props=\"{$props}\"{$extra}>"); if ($r['description']) { fwrite($out, "<description>"); fwrite($out, $r['description']); fwrite($out, "</description>"); }