当前位置: 首页>>代码示例>>PHP>>正文


PHP Web\Notification类代码示例

本文整理汇总了PHP中Icinga\Web\Notification的典型用法代码示例。如果您正苦于以下问题:PHP Notification类的具体用法?PHP Notification怎么用?PHP Notification使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Notification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\Host $object */
         $childHosts = (int) $this->getElement('child_hosts')->getValue();
         $allServices = $this->getElement('all_services')->isChecked();
         if ($childHosts === 0) {
             $hostDowntime = new ScheduleHostDowntimeCommand();
             if ($allServices === true) {
                 $hostDowntime->setForAllServices();
             }
         } else {
             $hostDowntime = new PropagateHostDowntimeCommand();
             if ($childHosts === 1) {
                 $hostDowntime->setTriggered();
             }
             if ($allServices === true) {
                 foreach ($object->services as $service) {
                     $serviceDowntime = new ScheduleServiceDowntimeCommand();
                     $serviceDowntime->setObject($service);
                     $this->scheduleDowntime($serviceDowntime, $this->request);
                 }
             }
         }
         $hostDowntime->setObject($object);
         $this->scheduleDowntime($hostDowntime, $this->request);
     }
     Notification::success($this->translatePlural('Scheduling host downtime..', 'Scheduling host downtimes..', count($this->objects)));
     return true;
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:34,代码来源:ScheduleHostDowntimeCommandForm.php

示例2: deployAction

 public function deployAction()
 {
     $isApiRequest = $this->getRequest()->isApiRequest();
     $checksum = $this->params->get('checksum');
     if ($checksum) {
         $config = IcingaConfig::load(Util::hex2binary($checksum), $this->db());
     } else {
         $config = IcingaConfig::generate($this->db());
         $checksum = $config->getHexChecksum();
     }
     if ($this->api()->dumpConfig($config, $this->db())) {
         if ($isApiRequest) {
             return $this->sendJson((object) array('checksum' => $checksum));
         } else {
             $url = Url::fromPath('director/list/deploymentlog');
             Notification::success($this->translate('Config has been submitted, validation is going on'));
             $this->redirectNow($url);
         }
     } else {
         if ($isApiRequest) {
             return $this->sendJsonError('Config deployment failed');
         } else {
             $url = Url::fromPath('director/config/show', array('checksum' => $checksum));
             Notification::success($this->translate('Config deployment failed'));
             $this->redirectNow($url);
         }
     }
 }
开发者ID:plarivee,项目名称:icingaweb2-module-director,代码行数:28,代码来源:ConfigController.php

示例3: onSuccess

 public function onSuccess()
 {
     $name = $this->getValue('name');
     $this->storage->deleteProcess($name);
     $this->setRedirectUrl('businessprocess');
     Notification::success(sprintf('Process %s has been deleted', $name));
 }
开发者ID:0svald,项目名称:icingaweb2-module-businessprocess,代码行数:7,代码来源:DeleteConfigForm.php

示例4: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     $disableNotifications = new DisableNotificationsExpireCommand();
     $disableNotifications->setExpireTime($this->getElement('expire_time')->getValue()->getTimestamp());
     $this->getTransport($this->request)->send($disableNotifications);
     Notification::success($this->translate('Disabling host and service notifications..'));
     return true;
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:12,代码来源:DisableNotificationsExpireCommandForm.php

示例5: runAction

 public function runAction()
 {
     if ($runId = Sync::run(SyncRule::load($this->params->get('id'), $this->db()))) {
         Notification::success('Source has successfully been synchronized');
         $this->redirectNow('director/list/syncrule');
     } else {
     }
 }
开发者ID:dgoeger,项目名称:icingadirector,代码行数:8,代码来源:SyncruleController.php

示例6: onSuccess

 /**
  * @see Form::onSuccess()
  */
 public function onSuccess()
 {
     $this->config->setSection('security', $this->getValues());
     if ($this->save()) {
         Notification::success($this->translate('New security configuration has successfully been stored'));
     } else {
         return false;
     }
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:12,代码来源:SecurityConfigForm.php

示例7: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
         $removeAck = new RemoveAcknowledgementCommand();
         $removeAck->setObject($object);
         $this->getTransport($this->request)->send($removeAck);
     }
     Notification::success(mtp('monitoring', 'Removing problem acknowledgement..', 'Removing problem acknowledgements..', count($this->objects)));
     return true;
 }
开发者ID:JakobGM,项目名称:icingaweb2,代码行数:15,代码来源:RemoveAcknowledgementCommandForm.php

示例8: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\Service $object */
         $check = new ScheduleServiceCheckCommand();
         $check->setObject($object);
         $this->scheduleCheck($check, $this->request);
     }
     Notification::success($this->translatePlural('Scheduling service check..', 'Scheduling service checks..', count($this->objects)));
     return true;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:15,代码来源:ScheduleServiceCheckCommandForm.php

示例9: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\Service $object */
         $downtime = new ScheduleServiceDowntimeCommand();
         $downtime->setObject($object);
         $this->scheduleDowntime($downtime, $this->request);
     }
     Notification::success($this->translatePlural('Scheduling service downtime..', 'Scheduling service downtimes..', count($this->objects)));
     return true;
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:15,代码来源:ScheduleServiceDowntimeCommandForm.php

示例10: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\Host $object */
         $check = new ScheduleHostCheckCommand();
         $check->setObject($object)->setOfAllServices($this->getElement('all_services')->isChecked());
         $this->scheduleCheck($check, $this->request);
     }
     Notification::success($this->translatePlural('Scheduling host check..', 'Scheduling host checks..', count($this->objects)));
     return true;
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:15,代码来源:ScheduleHostCheckCommandForm.php

示例11: onSuccess

 /**
  * {@inheritdoc}
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
         $notification = new SendCustomNotificationCommand();
         $notification->setObject($object)->setComment($this->getElement('comment')->getValue())->setAuthor($this->request->getUser()->getUsername())->setForced($this->getElement('forced')->isChecked())->setBroadcast($this->getElement('broadcast')->isChecked());
         $this->getTransport($this->request)->send($notification);
     }
     Notification::success($this->translatePlural('Sending custom notification..', 'Sending custom notifications..', count($this->objects)));
     return true;
 }
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:14,代码来源:SendCustomNotificationCommandForm.php

示例12: loadModifiedBpConfig

 protected function loadModifiedBpConfig()
 {
     $bp = $this->loadBpConfig();
     $changes = ProcessChanges::construct($bp, $this->session());
     if ($this->params->get('dismissChanges')) {
         Notification::success(sprintf($this->translate('%d pending change(s) have been dropped'), $changes->count()));
         $changes->clear();
         $this->redirectNow($this->url()->without('dismissChanges')->without('unlocked'));
     }
     $bp->applyChanges($changes);
     return $bp;
 }
开发者ID:0svald,项目名称:icingaweb2-module-businessprocess,代码行数:12,代码来源:Controller.php

示例13: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     $cmd = new DeleteCommentCommand();
     $cmd->setIsService($this->getElement('comment_is_service')->getValue())->setCommentId($this->getElement('comment_id')->getValue());
     $this->getTransport($this->request)->send($cmd);
     $redirect = $this->getElement('redirect')->getValue();
     if (!empty($redirect)) {
         $this->setRedirectUrl($redirect);
     }
     Notification::success($this->translate('Deleting comment..'));
     return true;
 }
开发者ID:kain64,项目名称:icingaweb2,代码行数:16,代码来源:DeleteCommentCommandForm.php

示例14: runAction

 public function runAction()
 {
     $id = $this->params->get('id');
     $import = new Import(ImportSource::load($id, $this->db()));
     if ($runId = $import->run()) {
         Notification::success('Import succeeded');
         $this->redirectNow(Url::fromPath('director/importrun', array('id' => $runId)));
     } else {
         Notification::success('Import skipped, no changes detected');
         $this->redirectNow('director/list/importrun');
     }
 }
开发者ID:dgoeger,项目名称:icingadirector,代码行数:12,代码来源:ImportsourceController.php

示例15: onSuccess

 /**
  * (non-PHPDoc)
  * @see \Icinga\Web\Form::onSuccess() For the method documentation.
  */
 public function onSuccess()
 {
     foreach ($this->objects as $object) {
         /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
         $ack = new AcknowledgeProblemCommand();
         $ack->setObject($object)->setComment($this->getElement('comment')->getValue())->setAuthor($this->request->getUser()->getUsername())->setPersistent($this->getElement('persistent')->isChecked())->setSticky($this->getElement('sticky')->isChecked())->setNotify($this->getElement('notify')->isChecked());
         if ($this->getElement('expire')->isChecked()) {
             $ack->setExpireTime($this->getElement('expire_time')->getValue()->getTimestamp());
         }
         $this->getTransport($this->request)->send($ack);
     }
     Notification::success($this->translatePlural('Acknowledging problem..', 'Acknowledging problems..', count($this->objects)));
     return true;
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:18,代码来源:AcknowledgeProblemCommandForm.php


注:本文中的Icinga\Web\Notification类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。