From 74461e7cb2dfd1560297edbd5bb4eb0427780979 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Wed, 23 Oct 2013 12:25:51 +0200 Subject: [PATCH] Add icons to config forms --- .../Config/Authentication/DbBackendForm.php | 12 +++++++++++- .../Config/Authentication/LdapBackendForm.php | 12 +++++++++++- .../forms/Config/Authentication/ReorderForm.php | 17 ++++++++++++----- application/forms/Config/ConfirmRemovalForm.php | 13 ++++++++++++- application/forms/Config/GeneralForm.php | 12 +++++++++++- application/forms/Config/LoggingForm.php | 12 +++++++++++- .../views/scripts/config/authentication.phtml | 14 ++++++-------- .../scripts/config/authentication/create.phtml | 5 ++++- .../scripts/config/authentication/modify.phtml | 5 ++++- .../scripts/config/authentication/remove.phtml | 5 ++++- application/views/scripts/config/index.phtml | 2 +- application/views/scripts/config/logging.phtml | 2 +- .../views/scripts/config/module/overview.phtml | 6 +++--- .../forms/Config/ConfirmRemovalForm.php | 13 ++++++++++++- 14 files changed, 103 insertions(+), 27 deletions(-) diff --git a/application/forms/Config/Authentication/DbBackendForm.php b/application/forms/Config/Authentication/DbBackendForm.php index 656f06226..97fe7d5e8 100644 --- a/application/forms/Config/Authentication/DbBackendForm.php +++ b/application/forms/Config/Authentication/DbBackendForm.php @@ -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' => ' Save Backend' + ) + ); } /** diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index 32d403491..5f578461c 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -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' => ' Save Backend' + ) + ); } /** diff --git a/application/forms/Config/Authentication/ReorderForm.php b/application/forms/Config/Authentication/ReorderForm.php index 7c5f2ffb4..6a0ea1f58 100644 --- a/application/forms/Config/Authentication/ReorderForm.php +++ b/application/forms/Config/Authentication/ReorderForm.php @@ -108,12 +108,15 @@ class ReorderForm extends Form ) ); $this->upForm->addElement( - 'submit', + 'button', 'btn_' . $this->getBackendName() . '_reorder_up', array( + 'type' => 'submit', + 'escape' => false, + 'class' => 'btn btn-cta btn-wide', + 'value' => 'btn_' . $this->getBackendName() . '_reorder_up', 'name' => 'btn_' . $this->getBackendName() . '_reorder_up', - 'label' => '{{ICON_UP}} Move up in authentication order', - + 'label' => ' Move up in authentication order', ) ); } @@ -128,11 +131,15 @@ class ReorderForm extends Form ) ); $this->downForm->addElement( - 'submit', + 'button', 'btn_' . $this->getBackendName() . '_reorder_down', array( + 'type' => 'submit', + 'escape' => false, + 'class' => 'btn btn-cta btn-wide', + 'value' => 'btn_' . $this->getBackendName() . '_reorder_down', 'name' => 'btn_' . $this->getBackendName() . '_reorder_down', - 'label' => '{{ICON_UP}} Move down in authentication order', + 'label' => ' Move down in authentication order', ) ); diff --git a/application/forms/Config/ConfirmRemovalForm.php b/application/forms/Config/ConfirmRemovalForm.php index 9ea1794d6..722dbfc47 100644 --- a/application/forms/Config/ConfirmRemovalForm.php +++ b/application/forms/Config/ConfirmRemovalForm.php @@ -77,6 +77,17 @@ class ConfirmRemovalForm extends Form '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' => ' Confirm Removal' + ) + ); } } diff --git a/application/forms/Config/GeneralForm.php b/application/forms/Config/GeneralForm.php index e634c9efc..e997a2891 100644 --- a/application/forms/Config/GeneralForm.php +++ b/application/forms/Config/GeneralForm.php @@ -348,7 +348,17 @@ class GeneralForm extends Form $this->addDateFormatSettings($global); $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' => ' Save Changes' + ) + ); } /** diff --git a/application/forms/Config/LoggingForm.php b/application/forms/Config/LoggingForm.php index b9e298a7f..9c227b2ae 100644 --- a/application/forms/Config/LoggingForm.php +++ b/application/forms/Config/LoggingForm.php @@ -168,7 +168,17 @@ class LoggingForm extends Form $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' => ' Save Changes' + ) + ); } /** diff --git a/application/views/scripts/config/authentication.phtml b/application/views/scripts/config/authentication.phtml index 9dd267da5..4bb8d947d 100644 --- a/application/views/scripts/config/authentication.phtml +++ b/application/views/scripts/config/authentication.phtml @@ -2,14 +2,13 @@ use Icinga\Web\Url; $createLdapBackend = $this->href('/config/createAuthenticationBackend', array('type' => 'ldap')); $createDbBackend = $this->href('/config/createAuthenticationBackend', array('type' => 'db')); - ?> tabs->render($this); ?> errorMessage): ?>
- {{ERROR_ICON}} + escape($this->errorMessage); ?>
@@ -17,7 +16,7 @@ $createDbBackend = $this->href('/config/createAuthenticationBackend', array('typ successMessage): ?>
- {{OK_ICON}} + escape($this->successMessage); ?>
@@ -27,10 +26,9 @@ $createDbBackend = $this->href('/config/createAuthenticationBackend', array('typ Create Authentication Provider
- {{CREATE_ICON}} Create A New LDAP Authentication Backend
- {{CREATE_ICON}} Create A New DB Authentication Backend + Create A New LDAP Authentication Backend
+ Create A New DB Authentication Backend
- backends as $backend): ?> @@ -42,12 +40,12 @@ $createDbBackend = $this->href('/config/createAuthenticationBackend', array('typ
- {{EDIT_ICON}} Edit This Authentication Provider + Edit This Authentication Provider
backends) > 1): ?> - {{REMOVE_ICON}} Remove This Authentication Provider + Remove This Authentication Provider
diff --git a/application/views/scripts/config/authentication/create.phtml b/application/views/scripts/config/authentication/create.phtml index 5aa84abbf..4980295c6 100644 --- a/application/views/scripts/config/authentication/create.phtml +++ b/application/views/scripts/config/authentication/create.phtml @@ -1,6 +1,9 @@ tabs->render($this); ?> -

{{CREATE_ICON}} Create New Authentication Backend

+

+ + Create New Authentication Backend +

errorMessage): ?>
diff --git a/application/views/scripts/config/authentication/modify.phtml b/application/views/scripts/config/authentication/modify.phtml index 7c8f6c7cf..273b8dcef 100644 --- a/application/views/scripts/config/authentication/modify.phtml +++ b/application/views/scripts/config/authentication/modify.phtml @@ -1,6 +1,9 @@ tabs->render($this); ?> -

{{CREATE_ICON}} Edit Backend "escape($this->name); ?>"

+

+ + Edit Backend "escape($this->name); ?>" +

errorMessage || $this->form->getErrorMessages()): ?>
diff --git a/application/views/scripts/config/authentication/remove.phtml b/application/views/scripts/config/authentication/remove.phtml index 3a3cc27ce..703038314 100644 --- a/application/views/scripts/config/authentication/remove.phtml +++ b/application/views/scripts/config/authentication/remove.phtml @@ -1,4 +1,7 @@ tabs->render($this); ?> -

{{REMOVE_ICON}} Remove Backend "escape($this->name); ?>"

+

+ + Remove Backend "escape($this->name); ?>" +

form ?> \ No newline at end of file diff --git a/application/views/scripts/config/index.phtml b/application/views/scripts/config/index.phtml index 603a496aa..98e227f7d 100644 --- a/application/views/scripts/config/index.phtml +++ b/application/views/scripts/config/index.phtml @@ -2,7 +2,7 @@ successMessage): ?>
- {{OK_ICON}} + escape($this->successMessage); ?>
diff --git a/application/views/scripts/config/logging.phtml b/application/views/scripts/config/logging.phtml index 98766d479..6b0b7cca3 100644 --- a/application/views/scripts/config/logging.phtml +++ b/application/views/scripts/config/logging.phtml @@ -4,7 +4,7 @@ successMessage): ?>
- {{OK_ICON}} + escape($this->successMessage); ?>
diff --git a/application/views/scripts/config/module/overview.phtml b/application/views/scripts/config/module/overview.phtml index 9eaa5357a..e7330c9c3 100644 --- a/application/views/scripts/config/module/overview.phtml +++ b/application/views/scripts/config/module/overview.phtml @@ -11,7 +11,7 @@ $modules = $this->modules->paginate(); successMessage): ?>
- {{OK_ICON}} + escape($this->successMessage); ?>
@@ -30,10 +30,10 @@ $modules = $this->modules->paginate(); enabled): ?> - {{OK_ICON}} + escape($module->name); ?> - {{REMOVE_ICON}} + escape($module->name); ?> ( 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' => ' Confirm Removal' + ) + ); } }