/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to services/update.php

  • Committer: Suren A. Chilingaryan
  • Date: 2009-01-31 04:54:46 UTC
  • Revision ID: csa@dside.dyndns.org-20090131045446-e2u52332uayw5u9m
Various fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
            $no_data = true;
25
25
        }
26
26
     break;
27
 
     case "alarms":
28
 
        if ($req->CheckData()) {
29
 
            $query = $req->GetQueryString($extra = array(
30
 
                "target" => "alarms_summary",
31
 
                "time_format" => "text"
32
 
            ));
33
 
        
34
 
            $info = array(
35
 
                "xml" => "services/control.php?$query",
36
 
                "xslt" => "alarms"
37
 
            );
38
 
        }
39
 
     break;
40
 
     case "slowcontrol":
41
 
        if ($req->CheckData()) {
42
 
            $query = $req->GetQueryString($extra = array(
43
 
                "target" => "status",
44
 
                "time_format" => "text"
45
 
            ));
46
 
        
47
 
            $info = array(
48
 
                "xml" => "services/control.php?$query",
49
 
                "xslt" => "controlinfo"
50
 
            );
51
 
        }
52
 
     break;
53
 
     case "wiki":
54
 
        $query = $req->GetQueryString();
55
 
        $info = array(
56
 
            "xml" => "services/wiki.php?$query",
57
 
            "xslt" => "wiki"
58
 
        );
59
 
     break;
 
27
     default:
 
28
        if ($req->props['module']) {
 
29
            $code = $ADEI_ROOTDIR . "services/update/" . $req->props['module'] . ".php";
 
30
            if (file_exists($code)) {
 
31
                if (!include_once($code)) {
 
32
                    throw new ADEIException(translate("Failed to load update code for module (%s)", $req->props['module']));
 
33
                }
 
34
                
 
35
                if (!function_exists("ADEIServiceGetUpdateInfo")) {
 
36
                    throw new ADEIException(translate("Update code for module (%s) does not provide any suitable interface"));
 
37
                }
 
38
                
 
39
                $info = ADEIServiceGetUpdateInfo($req);
 
40
            }
 
41
        }
60
42
    }
61
43
} catch(ADEIException $e) {
62
44
    $error = $e->getInfo();