mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
parent
6f51f40fc0
commit
7a406b313f
@ -599,6 +599,14 @@ class Form extends Zend_Form
|
|||||||
{
|
{
|
||||||
parent::addElement($element, $name, $options);
|
parent::addElement($element, $name, $options);
|
||||||
$el = $name ? $this->getElement($name) : $element;
|
$el = $name ? $this->getElement($name) : $element;
|
||||||
|
|
||||||
|
// Do not add structural elements to invisible elements
|
||||||
|
// which produces ugly views
|
||||||
|
if (strpos(strtolower(get_class($el)), 'hidden') !== false) {
|
||||||
|
$el->setDecorators(array('ViewHelper'));
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
if ($el) {
|
if ($el) {
|
||||||
$el->removeDecorator('HtmlTag');
|
$el->removeDecorator('HtmlTag');
|
||||||
$el->removeDecorator('Label');
|
$el->removeDecorator('Label');
|
||||||
|
@ -22,7 +22,6 @@ class Zend_View_Helper_CommandForm extends Zend_View_Helper_Abstract
|
|||||||
private function simpleForm($commandName, array $arguments = array())
|
private function simpleForm($commandName, array $arguments = array())
|
||||||
{
|
{
|
||||||
$form = new Form();
|
$form = new Form();
|
||||||
|
|
||||||
$form->setIgnoreChangeDiscarding(true);
|
$form->setIgnoreChangeDiscarding(true);
|
||||||
$form->setAttrib('data-icinga-component', 'app/ajaxPostSubmitForm');
|
$form->setAttrib('data-icinga-component', 'app/ajaxPostSubmitForm');
|
||||||
|
|
||||||
@ -33,6 +32,8 @@ class Zend_View_Helper_CommandForm extends Zend_View_Helper_Abstract
|
|||||||
$hiddenField = new Zend_Form_Element_Hidden($elementName);
|
$hiddenField = new Zend_Form_Element_Hidden($elementName);
|
||||||
$hiddenField->setValue($elementValue);
|
$hiddenField->setValue($elementValue);
|
||||||
$form->addElement($hiddenField);
|
$form->addElement($hiddenField);
|
||||||
|
|
||||||
|
$hiddenField = $form->getElement($elementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
@ -72,6 +73,7 @@ class Zend_View_Helper_CommandForm extends Zend_View_Helper_Abstract
|
|||||||
public function labelSubmitForm($submitLabel, $submitTitle, $cls, $commandName, array $arguments = array())
|
public function labelSubmitForm($submitLabel, $submitTitle, $cls, $commandName, array $arguments = array())
|
||||||
{
|
{
|
||||||
$form = $this->simpleForm($commandName, $arguments);
|
$form = $this->simpleForm($commandName, $arguments);
|
||||||
|
|
||||||
$button = new Zend_Form_Element_Button(
|
$button = new Zend_Form_Element_Button(
|
||||||
array(
|
array(
|
||||||
'name' => 'btn_submit',
|
'name' => 'btn_submit',
|
||||||
@ -84,10 +86,11 @@ class Zend_View_Helper_CommandForm extends Zend_View_Helper_Abstract
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$button->setDecorators(array('ViewHelper'));
|
|
||||||
|
|
||||||
$form->addElement($button);
|
$form->addElement($button);
|
||||||
|
|
||||||
|
// Because of implicit added decorators
|
||||||
|
$form->getElement('btn_submit')->setDecorators(array('ViewHelper'));
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$o = $this->object;
|
$o = $this->object;
|
||||||
|
|
||||||
|
/** @var Zend_View_Helper_CommandForm $cf */
|
||||||
|
$cf = $this->getHelper('CommandForm');
|
||||||
?>
|
?>
|
||||||
<div>
|
<div>
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
@ -16,7 +19,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Passive Checks</td>
|
<td>Passive Checks</td>
|
||||||
<td><div class="icon-table-hint icon-edit pull-left"></div></td>
|
<td><div class="icon-table-hint icon-edit pull-left"></div></td>
|
||||||
<td><input type="checkbox" id="#" name="#" class="pull-right" <?= ($o->passive_checks_enabled === '1') ? 'checked="true"' : '' ?> /></td>
|
<td>
|
||||||
|
<input type="checkbox" id="#" name="#" class="pull-right" <?= ($o->passive_checks_enabled === '1') ? 'checked="true"' : '' ?> />
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -83,6 +83,13 @@ a {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.button {
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.btn-small {
|
||||||
|
height: 25px;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Address `outline` inconsistency between Chrome and other browsers.
|
* Address `outline` inconsistency between Chrome and other browsers.
|
||||||
*/
|
*/
|
||||||
@ -239,6 +246,9 @@ td {
|
|||||||
Forms
|
Forms
|
||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
|
.panel-row form {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
.form-inline .form-group {
|
.form-inline .form-group {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -258,11 +268,7 @@ label {
|
|||||||
.input-sm {
|
.input-sm {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
|
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-right: 15px;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.form-control {
|
.form-control {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user