function action_add($_) { global $conf; if (isset($_['uid'])) { foreach ($this->predefined_commands('action.php') as $cmd) { if ($_['uid'] == $cmd['uid']) { $marantz = new MarantzCmd(); $marantz->setName($cmd['name']); $marantz->setCmd($cmd['command']); $marantz->setParametre($cmd['parametre']); $marantz->setConfidence($cmd['confidence']); $marantz->setZone($conf->get('zone', 'marantz')); $marantz->setReponses($cmd['reponses']); $marantz->setVocal(true); $marantz->save(); } } } else { $marantz = new MarantzCmd(); $marantz->setName($_['name']); $marantz->setCmd($_['cmd']); $marantz->setParametre($_['parametre']); $marantz->setConfidence($_['confidence']); $marantz->setReponses($_['reponses']); $marantz->setZone($conf->get('zone', 'marantz')); $marantz->setVocal(true); $marantz->save(); } header('location:setting.php?section=' . $this->section . '&block=new&save=ok'); }