function corpus_article_handler($atts, $contents)
{
    return make_tag('corpus-articles', $atts, $contents);
}
Beispiel #2
0
        }
    } else {
        if ($_REQUEST['action'] == "get_connkey") {
            print make_tag("connkey", generateConnKey());
        } else {
            if ($_REQUEST['action'] == "event_stats") {
                if (!canView("Events")) {
                    ajaxError('Unrecognised action or insufficient permissions');
                }
                $eid = validInt($_REQUEST['eid']);
                $stats = dbFetchAll("select S.*,E.*,Z.Name as ZoneName,Z.Units,Z.Area,M.Name as MonitorName,M.Width,M.Height from Stats as S left join Events as E on S.EventId = E.Id left join Zones as Z on S.ZoneId = Z.Id left join Monitors as M on E.MonitorId = M.Id where S.EventId = '" . $eid . "' order by S.FrameId, S.ZoneId");
                for ($i = 0; $i < count($stats); $i++) {
                    $stat = $stats[$i];
                    $stat_str = "";
                    $stat_str .= make_tag("FrameId", $stat["FrameId"]);
                    $stat_str .= make_tag("PixelDiff", $stat["PixelDiff"]);
                    $stat_str .= make_tag("AlarmPixels", $stat["AlarmPixels"]);
                    $stat_str .= make_tag("FilterPixels", $stat["FilterPixels"]);
                    $stat_str .= make_tag("BlobPixels", $stat["BlobPixels"]);
                    $stat_str .= make_tag("Blobs", $stat["Blobs"]);
                    $stat_str .= make_tag("ZoneName", $stat["ZoneName"]);
                    $stat_str .= make_tag("Score", $stat["Score"]);
                    print make_tag("stat", $stat_str);
                }
            }
        }
    }
}
?>
</response>
function make_cdatatag($tagname, $text)
{
    return make_tag($tagname, make_cdata($text));
}
function envelopes_to_xml($envelopes, $sentorreceived)
{
    $messagexml = '';
    foreach ($envelopes as $headerinfo) {
        $subject = $headerinfo["subject"];
        $imapdate = $headerinfo["date"];
        $phpdate = strtotime($imapdate);
        $date = date('Y-m-d H:i:s', $phpdate);
        $from = $headerinfo["from"];
        $fromcomponents = $from[0];
        $fromaddress = $fromcomponents["address"];
        $fromdisplay = $fromcomponents["display"];
        $sourcefolder = $sentorreceived;
        $to = $headerinfo["to"];
        $cc = $headerinfo["cc"];
        $bcc = $headerinfo["bcc"];
        $contenttext = "";
        $contenthtml = "";
        $sourceuid = $headerinfo['messageuid'];
        $messagexml .= "<message>\n";
        $messagexml .= make_tag("messageuid", uniqid("", TRUE));
        $messagexml .= make_cdatatag("sourceuid", $sourceuid);
        $messagexml .= make_cdatatag("subject", $subject);
        $messagexml .= make_cdatatag("fromaddress", $fromaddress);
        $messagexml .= make_cdatatag("fromdisplay", $fromdisplay);
        $messagexml .= make_tag("deliverytime", $date);
        $messagexml .= "<recipients>\n";
        $messagexml .= create_envelope_recipients_xml($to, "to");
        $messagexml .= create_envelope_recipients_xml($cc, "cc");
        $messagexml .= create_envelope_recipients_xml($bcc, "bcc");
        $messagexml .= "</recipients>\n";
        $messagexml .= make_cdatatag("contenttext", $contenttext);
        $messagexml .= make_cdatatag("contenthtml", $contenthtml);
        $messagexml .= make_tag("sourcefolder", $sourcefolder);
        $messagexml .= "</message>\n";
    }
    return $messagexml;
}
function message_headers_to_xml($headers, $sentorreceived)
{
    $messagexml = '';
    foreach ($headers as $messageindex => $headermap) {
        $subject = ifsetor($headermap['subject'], '');
        $imapdate = ifsetor($headermap['date'], '');
        $phpdate = strtotime($imapdate);
        $date = date('Y-m-d H:i:s', $phpdate);
        $fromstring = ifsetor($headerinfo['from'], '');
        $fromparts = extract_address_from_string($fromstring);
        $fromaddress = $fromparts['address'];
        $fromdisplay = $fromparts['display'];
        $sourcefolder = $sentorreceived;
        $to = ifsetor($headermap["to"], '');
        $cc = ifsetor($headermap["cc"], '');
        $bcc = ifsetor($headermap["bcc"], '');
        $contenttext = '';
        $contenthtml = '';
        $sourceuid = $messageindex;
        $messagexml .= "<message>\n";
        $messagexml .= make_tag("messageuid", uniqid("", TRUE));
        $messagexml .= make_cdatatag("sourceuid", $sourceuid);
        $messagexml .= make_cdatatag("subject", $subject);
        $messagexml .= make_cdatatag("fromaddress", $fromaddress);
        $messagexml .= make_cdatatag("fromdisplay", $fromdisplay);
        $messagexml .= make_tag("deliverytime", $date);
        $messagexml .= "<recipients>\n";
        $messagexml .= create_header_recipients_xml($to, "to");
        $messagexml .= create_header_recipients_xml($cc, "cc");
        $messagexml .= create_header_recipients_xml($bcc, "bcc");
        $messagexml .= "</recipients>\n";
        $messagexml .= make_cdatatag("contenttext", $contenttext);
        $messagexml .= make_cdatatag("contenthtml", $contenthtml);
        $messagexml .= make_tag("sourcefolder", $sourcefolder);
        $messagexml .= "</message>\n";
    }
    return $messagexml;
}
Beispiel #6
0
function glyph($g)
{
    return make_tag("span", "glyphicon glyphicon-" . $g);
}
Beispiel #7
0
         } else {
             if ($innavigation) {
                 $value = count(safe_rows('*', $table_name, "public='yes' and in_navigation='yes' order by post_order asc")) + 1;
             } else {
                 $value = $value;
             }
         }
     } else {
         $value = 0;
     }
 }
 // validate and clean input
 $value = str_replace('|', '&#124;', $value);
 $nullf = explode(" ", $af[$j]);
 if ($an[$j] == 'tags') {
     $value = make_tag($value);
 }
 if (get_magic_quotes_gpc() == 0) {
     $value = addslashes($value);
 }
 if ($at[$j] == 'varchar') {
     sterilise(strip_tags($value));
 }
 if ($an[$j] == 'url' or $an[$j] == 'website') {
     if ($nullf[0] == 'not_null') {
         $check->validateURL($value, $lang['url_error'] . ' ');
     } else {
         if ($value != "") {
             $check->validateURL($value, $lang['url_error'] . ' ');
         }
     }