示例#1
0
             $pMonitoringComponent->getFromDB($_POST['id']);
             if (empty($pMonitoringComponent->fields['perfname']) and empty($pMonitoringComponent->fields['perfnameinvert']) and empty($pMonitoringComponent->fields['perfnamecolor'])) {
                 $a_perfnames = array();
                 $a_perfnames = PluginMonitoringServicegraph::getperfdataNames($_POST['graph_template']);
                 foreach ($a_perfnames as $name) {
                     $a_perfnames[$name] = 1;
                 }
                 $_POST['perfname'] = exportArrayToDB($a_perfnames);
             }
         }
     }
     $pMonitoringComponent->update($_POST);
     Html::back();
 } else {
     if (isset($_POST["delete"])) {
         $pMonitoringComponent->delete($_POST);
         $pMonitoringComponent->redirectToList();
     } else {
         if (isset($_POST['updateperfdata'])) {
             $a_perfname = array();
             if (isset($_POST['perfname'])) {
                 foreach ($_POST['perfname'] as $perfname) {
                     $a_perfname[$perfname] = '1';
                 }
             }
             $a_perfnameinvert = array();
             if (isset($_POST['perfnameinvert'])) {
                 foreach ($_POST['perfnameinvert'] as $perfname) {
                     $a_perfnameinvert[$perfname] = '1';
                 }
             }