*/ require_once 'includes/IEInit.php'; $oPage->onlyForLogged(); $stemplate = new IEStemplate($oPage->getRequestValue('stemplate_id', 'int')); switch ($oPage->getRequestValue('action')) { case 'new': $stemplate->setDataValue($stemplate->nameColumn, _('Nová předloha')); $stemplate->insertToSQL(); $stemplate->setDataValue($stemplate->nameColumn, _('Nová předloha') . ' #' . $stemplate->getId()); $stemplate->updateToMySQL(); break; case 'copyhost': $host = new IEHost($oPage->getRequestValue('host_id', 'int')); $stemplate->setDataValue($stemplate->nameColumn, $host->getName()); $stemplate->setDataValue('services', $host->getServices()); if ($stemplate->saveToSQL()) { $stemplate->addStatusMessage(sprintf(_('Vytvořena nová předloha sledovaných služeb: %s'), $stemplate->getName()), 'success'); } else { $stemplate->addStatusMessage(sprintf(_('Nebyla vytvořena nová předloha')), 'warning'); } break; case 'export': $stemplate->transfer($oPage->getRequestValue('destination')); break; default: if ($oPage->isPosted()) { $stemplate->takeData($_POST); if (!$stemplate->getName()) { $oUser->addStatusMessage(_('Není zadán název'), 'warning'); } $stemplateID = $stemplate->saveToMySQL();