mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Comment Overview: Implement delete comment inline command [wip]
refs #4714
This commit is contained in:
parent
d109f370cd
commit
d7f6dcb3ce
35
modules/monitoring/application/views/helpers/CommandForm.php
Normal file
35
modules/monitoring/application/views/helpers/CommandForm.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// @codingStandardsIgnoreStart
|
||||
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
use Icinga\Module\Monitoring\Form\Command\CommandForm;
|
||||
use Icinga\Application\Icinga;
|
||||
|
||||
/**
|
||||
* Helper to build inline html command forms
|
||||
*/
|
||||
class Zend_View_Helper_CommandForm extends Zend_View_Helper_Abstract
|
||||
{
|
||||
/**
|
||||
* Creates a simple form without additional input fields
|
||||
*
|
||||
* @param string $commandName Name of command
|
||||
* @param string $submitLabel Label of submit button
|
||||
* @param array $arguments Add parameter as hidden fields
|
||||
*
|
||||
* @return string Html form content
|
||||
*/
|
||||
public function simpleForm($commandName, $submitLabel, array $arguments = array())
|
||||
{
|
||||
$form = new CommandForm();
|
||||
$form->setRequest(Icinga::app()->getFrontController()->getRequest());
|
||||
$form->setView($this->view);
|
||||
$form->setAction($this->view->href('monitoring/command/' . $commandName));
|
||||
$form->setSubmitLabel($submitLabel);
|
||||
return $form->render();
|
||||
}
|
||||
}
|
||||
|
||||
// @codingStandardsIgnoreStop
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$dateHelper = $this->getHelper('DateFormat');
|
||||
$commandHelper = $this->getHelper('CommandForm');
|
||||
?>
|
||||
<?= $this->tabs->render($this); ?>
|
||||
|
||||
@ -101,7 +102,15 @@ $viewHelper = $this->getHelper('MonitoringState');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
{{{REMOVE_ICON}}}
|
||||
<?=
|
||||
$commandHelper->simpleForm(
|
||||
'removecomment',
|
||||
'Remove',
|
||||
array(
|
||||
'commentid' => $comment->comment_id
|
||||
)
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user