~ko-de-r-de/zabbix/precise

« back to all changes in this revision

Viewing changes to frontends/php/include/actions.inc.php

  • Committer: ivo
  • Date: 2013-08-02 13:27:53 UTC
  • Revision ID: svn-v4:f4e7fd02-d210-4e34-a1e0-d4093fb66cc2:trunk:37534
A.F....... [ZBX-6808] fixed "Host metadata" field in actions; improved validation for action conditions; improved functions to get list of discovery objects and trigger values; minor coding style fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
        }
100
100
}
101
101
 
102
 
function discovery_object2str($object) {
103
 
        switch ($object) {
104
 
                case EVENT_OBJECT_DHOST:
105
 
                        return _('Device');
106
 
                case EVENT_OBJECT_DSERVICE:
107
 
                        return _('Service');
108
 
                default:
109
 
                        return _('Unknown');
 
102
function discovery_object2str($object = null) {
 
103
        $discoveryObjects = array(
 
104
                EVENT_OBJECT_DHOST => _('Device'),
 
105
                EVENT_OBJECT_DSERVICE => _('Service')
 
106
        );
 
107
 
 
108
        if ($object === null) {
 
109
                return $discoveryObjects;
 
110
        }
 
111
        elseif (isset($discoveryObjects[$object])) {
 
112
                return $discoveryObjects[$object];
 
113
        }
 
114
        else {
 
115
                return _('Unknown');
110
116
        }
111
117
}
112
118