Add icons to config forms

This commit is contained in:
Marius Hein 2013-10-23 12:25:51 +02:00
parent 685976bb6c
commit 74461e7cb2
14 changed files with 103 additions and 27 deletions

View File

@ -90,7 +90,17 @@ class DbBackendForm extends BaseBackendForm
) )
); );
$this->setSubmitLabel('{{SAVE_ICON}} Save Backend'); $this->addElement(
'button',
'btn_submit',
array(
'type' => 'submit',
'value' => '1',
'escape' => false,
'class' => 'btn btn-cta btn-wide',
'label' => '<i class="icinga-icon-save"></i> Save Backend'
)
);
} }
/** /**

View File

@ -129,7 +129,17 @@ class LdapBackendForm extends BaseBackendForm
) )
); );
$this->setSubmitLabel('{{SAVE_ICON}} Save Backend'); $this->addElement(
'button',
'btn_submit',
array(
'type' => 'submit',
'value' => '1',
'escape' => false,
'class' => 'btn btn-cta btn-wide',
'label' => '<i class="icinga-icon-save"></i> Save Backend'
)
);
} }
/** /**

View File

@ -108,12 +108,15 @@ class ReorderForm extends Form
) )
); );
$this->upForm->addElement( $this->upForm->addElement(
'submit', 'button',
'btn_' . $this->getBackendName() . '_reorder_up', 'btn_' . $this->getBackendName() . '_reorder_up',
array( array(
'type' => 'submit',
'escape' => false,
'class' => 'btn btn-cta btn-wide',
'value' => 'btn_' . $this->getBackendName() . '_reorder_up',
'name' => 'btn_' . $this->getBackendName() . '_reorder_up', 'name' => 'btn_' . $this->getBackendName() . '_reorder_up',
'label' => '{{ICON_UP}} Move up in authentication order', 'label' => '<i class="icinga-icon-up"></i> Move up in authentication order',
) )
); );
} }
@ -128,11 +131,15 @@ class ReorderForm extends Form
) )
); );
$this->downForm->addElement( $this->downForm->addElement(
'submit', 'button',
'btn_' . $this->getBackendName() . '_reorder_down', 'btn_' . $this->getBackendName() . '_reorder_down',
array( array(
'type' => 'submit',
'escape' => false,
'class' => 'btn btn-cta btn-wide',
'value' => 'btn_' . $this->getBackendName() . '_reorder_down',
'name' => 'btn_' . $this->getBackendName() . '_reorder_down', 'name' => 'btn_' . $this->getBackendName() . '_reorder_down',
'label' => '{{ICON_UP}} Move down in authentication order', 'label' => '<i class="icinga-icon-down"></i> Move down in authentication order',
) )
); );

View File

@ -77,6 +77,17 @@ class ConfirmRemovalForm extends Form
'required' => true 'required' => true
) )
); );
$this->setSubmitLabel('{{REMOVE_ICON}} Confirm Removal');
$this->addElement(
'button',
'btn_submit',
array(
'type' => 'submit',
'escape' => false,
'value' => '1',
'class' => 'btn btn-cta btn-common',
'label' => '<i class="icinga-icon-remove"></i> Confirm Removal'
)
);
} }
} }

View File

@ -348,7 +348,17 @@ class GeneralForm extends Form
$this->addDateFormatSettings($global); $this->addDateFormatSettings($global);
$this->addUserPreferencesDialog($preferences); $this->addUserPreferencesDialog($preferences);
$this->setSubmitLabel('{{SAVE_ICON}} Save Changes'); $this->addElement(
'button',
'btn_submit',
array(
'type' => 'submit',
'escape' => false,
'value' => '1',
'class' => 'btn btn-cta btn-common',
'label' => '<i class="icinga-icon-save"></i> Save Changes'
)
);
} }
/** /**

View File

@ -168,7 +168,17 @@ class LoggingForm extends Form
$this->enableAutoSubmit(array('logging_debug_enable')); $this->enableAutoSubmit(array('logging_debug_enable'));
$this->setSubmitLabel('{{SAVE_ICON}} Save Changes'); $this->addElement(
'button',
'btn_submit',
array(
'type' => 'submit',
'escape' => false,
'value' => '1',
'class' => 'btn btn-cta btn-common',
'label' => '<i class="icinga-icon-save"></i> Save Changes'
)
);
} }
/** /**

View File

@ -2,14 +2,13 @@
use Icinga\Web\Url; use Icinga\Web\Url;
$createLdapBackend = $this->href('/config/createAuthenticationBackend', array('type' => 'ldap')); $createLdapBackend = $this->href('/config/createAuthenticationBackend', array('type' => 'ldap'));
$createDbBackend = $this->href('/config/createAuthenticationBackend', array('type' => 'db')); $createDbBackend = $this->href('/config/createAuthenticationBackend', array('type' => 'db'));
?> ?>
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<?php if ($this->errorMessage): ?> <?php if ($this->errorMessage): ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
<i>{{ERROR_ICON}}</i> <i class="icinga-icon-error"></i>
<strong><?= $this->escape($this->errorMessage); ?></strong> <strong><?= $this->escape($this->errorMessage); ?></strong>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -17,7 +16,7 @@ $createDbBackend = $this->href('/config/createAuthenticationBackend', array('typ
<?php if ($this->successMessage): ?> <?php if ($this->successMessage): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<i>{{OK_ICON}}</i> <i class="icinga-icon-success"></i>
<strong><?= $this->escape($this->successMessage); ?></strong> <strong><?= $this->escape($this->successMessage); ?></strong>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -27,10 +26,9 @@ $createDbBackend = $this->href('/config/createAuthenticationBackend', array('typ
Create Authentication Provider Create Authentication Provider
</div> </div>
<div class="panel-body"> <div class="panel-body">
<a href="<?= $createLdapBackend ?>">{{CREATE_ICON}} Create A New LDAP Authentication Backend</a><br/> <a href="<?= $createLdapBackend ?>"><i class="icinga-icon-create"></i> Create A New LDAP Authentication Backend</a><br/>
<a href="<?= $createDbBackend ?>">{{CREATE_ICON}} Create A New DB Authentication Backend</a> <a href="<?= $createDbBackend ?>"><i class="icinga-icon-create"></i> Create A New DB Authentication Backend</a>
</div> </div>
</div> </div>
<?php foreach ($this->backends as $backend): ?> <?php foreach ($this->backends as $backend): ?>
@ -42,12 +40,12 @@ $createDbBackend = $this->href('/config/createAuthenticationBackend', array('typ
</div> </div>
<div class="panel-body"> <div class="panel-body">
<a href="<?= $this->href('config/editAuthenticationBackend', array('auth_backend' => $backend->name));?>"> <a href="<?= $this->href('config/editAuthenticationBackend', array('auth_backend' => $backend->name));?>">
{{EDIT_ICON}} Edit This Authentication Provider <i class="icinga-icon-edit"></i> Edit This Authentication Provider
</a> </a>
<br/> <br/>
<?php if (count($this->backends) > 1): ?> <?php if (count($this->backends) > 1): ?>
<a href="<?= $this->href('config/removeAuthenticationBackend', array('auth_backend' => $backend->name));?>"> <a href="<?= $this->href('config/removeAuthenticationBackend', array('auth_backend' => $backend->name));?>">
{{REMOVE_ICON}} Remove This Authentication Provider <i class="icinga-icon-remove"></i> Remove This Authentication Provider
</a> </a>
<br/> <br/>
<?php endif; ?> <?php endif; ?>

View File

@ -1,6 +1,9 @@
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<h4>{{CREATE_ICON}} Create New Authentication Backend</h4> <h4>
<i class="icinga-icon-create"></i>
Create New Authentication Backend
</h4>
<?php if ($this->errorMessage): ?> <?php if ($this->errorMessage): ?>
<div class="alert alert-danger"> <div class="alert alert-danger">

View File

@ -1,6 +1,9 @@
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<h4>{{CREATE_ICON}} Edit Backend "<?= $this->escape($this->name); ?>"</h4> <h4>
<i class="icinga-icon-edit"></i>
Edit Backend "<?= $this->escape($this->name); ?>"
</h4>
<?php if ($this->errorMessage || $this->form->getErrorMessages()): ?> <?php if ($this->errorMessage || $this->form->getErrorMessages()): ?>
<div class="alert alert-danger"> <div class="alert alert-danger">

View File

@ -1,4 +1,7 @@
<?= $this->tabs->render($this); ?> <?= $this->tabs->render($this); ?>
<h4>{{REMOVE_ICON}} Remove Backend "<?= $this->escape($this->name); ?>"</h4> <h4>
<i class="icinga-icon-remove"></i>
Remove Backend "<?= $this->escape($this->name); ?>"
</h4>
<?= $this->form ?> <?= $this->form ?>

View File

@ -2,7 +2,7 @@
<?php if ($this->successMessage): ?> <?php if ($this->successMessage): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<i>{{OK_ICON}}</i> <i class="icinga-icon-success"></i>
<strong><?= $this->escape($this->successMessage); ?></strong> <strong><?= $this->escape($this->successMessage); ?></strong>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -4,7 +4,7 @@
<?php if ($this->successMessage): ?> <?php if ($this->successMessage): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<i>{{OK_ICON}}</i> <i class="icinga-icon-success"></i>
<strong><?= $this->escape($this->successMessage); ?></strong> <strong><?= $this->escape($this->successMessage); ?></strong>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -11,7 +11,7 @@ $modules = $this->modules->paginate();
<?php if ($this->successMessage): ?> <?php if ($this->successMessage): ?>
<div class="alert alert-success"> <div class="alert alert-success">
<i>{{OK_ICON}}</i> <i class="icinga-icon-success"></i>
<strong><?= $this->escape($this->successMessage); ?></strong> <strong><?= $this->escape($this->successMessage); ?></strong>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -30,10 +30,10 @@ $modules = $this->modules->paginate();
<tr> <tr>
<td> <td>
<? if ($module->enabled): ?> <? if ($module->enabled): ?>
<i>{{OK_ICON}}</i> <i class="icinga-icon-success"></i>
<a href="<?= $disableUrl ?>" data-icinga-target="main"><?= $this->escape($module->name); ?></a> <a href="<?= $disableUrl ?>" data-icinga-target="main"><?= $this->escape($module->name); ?></a>
<? else: ?> <? else: ?>
<i>{{REMOVE_ICON}}</i> <i class="icinga-icon-remove"></i>
<a href="<?= $enableUrl ?>" data-icinga-target="main"><?= $this->escape($module->name); ?></a> <a href="<?= $enableUrl ?>" data-icinga-target="main"><?= $this->escape($module->name); ?></a>
<? endif ?> <? endif ?>
(<?= (<?=

View File

@ -76,6 +76,17 @@ class ConfirmRemovalForm extends Form
'required' => true 'required' => true
) )
); );
$this->setSubmitLabel('{{REMOVE_ICON}} Confirm Removal');
$this->addElement(
'button',
'btn_submit',
array(
'type' => 'submit',
'escape' => false,
'value' => '1',
'class' => 'btn btn-cta btn-common',
'label' => '<i class="icinga-icon-remove"></i> Confirm Removal'
)
);
} }
} }