/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

Viewing changes to setups/katrin/classes/readers/katrinzeusreader.php

  • Committer: Suren A. Chilingaryan
  • Date: 2014-01-25 16:38:03 UTC
  • Revision ID: csa@dside.dyndns.org-20140125163803-mhmpyk4dpzz7qabw
Detach setups

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
require_once($GLOBALS['ADEI_ROOTDIR'] . "/classes/readers/zeus.php");
4
 
 
5
 
class KATRINZEUSReader extends ZEUS {
6
 
/*
7
 
 function __construct(&$props) {
8
 
    parent::__construct($props);
9
 
 }
10
 
*/
11
 
 
12
 
 function GetDatabaseList($flags = 0) {
13
 
    $filter = $this->GetDatabaseFilter($flags);
14
 
    $res = $this->SortDatabaseList($this->db->GetDatabaseList($filter));
15
 
    
16
 
    foreach ($res as &$item) {
17
 
        if (preg_match("/(.*)[._](\d{8})$/", $item['name'], $m)) {
18
 
//          $item['name'] = gettext($m[1]) . ", " . translate("Archive of %s", $m[2]);
19
 
            $item['name'] = translate("%s Archive", $m[2]);
20
 
       } else {
21
 
            $item['name'] = gettext($item['name']);
22
 
       }
23
 
    }
24
 
 
25
 
    return $res;
26
 
 }
27
 
 
28
 
 function GetItemList(LOGGROUP $grp = NULL, MASK $mask = NULL, $flags = 0) {
29
 
    $list = parent::GetItemList($grp, $mask, $flags);
30
 
//    return $list;    
31
 
    foreach ($list as &$item) {
32
 
        if (preg_match("/^\s*(\d{3}-\w{3}-\d-\d{4}(-\d{4})?)\s*(\[([\w\d_\/]+)\])?\s*(.*)$/", $item["chan_name"], $m)) {
33
 
            if ($m[5]) {
34
 
                $item['name'] = "{$m[5]} [{$m[1]}]";
35
 
            } else {
36
 
                $item['name'] = "{$item['block_name']} [{$m[1]}]";
37
 
            }
38
 
            if ($m[4]) {
39
 
                $item['axis'] = $m[4];
40
 
            }
41
 
            $item['uid'] = $m[1];
42
 
        } else {
43
 
            if (preg_match("/^(.*[^\s])\s*\[([^[]+)\]\s*$/", $item["name"], $m)) {
44
 
                $item['name'] = "{$m[1]}, {$m[2]}";
45
 
            }
46
 
//          $item['name'] .= " [???-???-?-????-????]";
47
 
        }
48
 
    }
49
 
    
50
 
    return $list;
51
 
 }
52
 
}
53
 
 
54
 
?>
 
 
b'\\ No newline at end of file'