diff options
author | Simon Rettberg | 2016-09-07 17:44:49 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-09-07 17:44:49 +0200 |
commit | 1b25334f090f6b9ba84188b514ab5dcf99f961d3 (patch) | |
tree | fd85a619a346bbe0f76b78a5675f0e249e4575ac /modules-available/sysconfig | |
parent | Update translations (diff) | |
download | slx-admin-1b25334f090f6b9ba84188b514ab5dcf99f961d3.tar.gz slx-admin-1b25334f090f6b9ba84188b514ab5dcf99f961d3.tar.xz slx-admin-1b25334f090f6b9ba84188b514ab5dcf99f961d3.zip |
[sysconfig] Confirm dialog for deletion; show success message after deleting a config
Diffstat (limited to 'modules-available/sysconfig')
10 files changed, 21 insertions, 16 deletions
diff --git a/modules-available/sysconfig/lang/de/messages.json b/modules-available/sysconfig/lang/de/messages.json index e6203d3d..15af1c33 100644 --- a/modules-available/sysconfig/lang/de/messages.json +++ b/modules-available/sysconfig/lang/de/messages.json @@ -1,5 +1,6 @@ { "config-activated": "Konfiguration {{0}} wurde aktiviert", + "config-deleted": "Konfiguration {{0}} wurde gel\u00f6scht", "config-invalid": "Konfiguration mit ID {{0}} existiert nicht", "invalid-action": "Ung\u00fcltige Aktion: {{0}}", "missing-file": "Es wurde keine Datei ausgew\u00e4hlt!", diff --git a/modules-available/sysconfig/lang/de/template-tags.json b/modules-available/sysconfig/lang/de/template-tags.json index 71666449..3944a91c 100644 --- a/modules-available/sysconfig/lang/de/template-tags.json +++ b/modules-available/sysconfig/lang/de/template-tags.json @@ -25,6 +25,7 @@ "lang_configurationChoose": "Bitte w\u00e4hlen Sie, welche Module f\u00fcr diese Konfiguration verwendet werden sollen.", "lang_configurationModuleNotFound": "Keine Konfigurationsmodule gefunden!", "lang_configurationSuccess": "Die Konfiguration wurde erfolgreich erstellt.", + "lang_confirmDeleteQuestion": "Wollen Sie dieses Element wirklich l\u00f6schen?", "lang_connectionWait": "\u00dcberpr\u00fcfe Verbindung, bitte warten", "lang_continueAnyway": "Trotzdem weiter", "lang_customCertificate": "Zur Validierung zus\u00e4tzlich erforderliche (Intermediate-)Zertifikate", diff --git a/modules-available/sysconfig/lang/en/messages.json b/modules-available/sysconfig/lang/en/messages.json index a4aa8dc1..888b2e6b 100644 --- a/modules-available/sysconfig/lang/en/messages.json +++ b/modules-available/sysconfig/lang/en/messages.json @@ -1,5 +1,6 @@ { "config-activated": "Configuration {{0}} has been activated", + "config-deleted": "Deleted configuration {{0}}", "config-invalid": "Configuration with id {{0}} does not exist", "invalid-action": "Invalid action: {{0}}", "missing-file": "There was no file selected!", diff --git a/modules-available/sysconfig/lang/en/template-tags.json b/modules-available/sysconfig/lang/en/template-tags.json index 9da17ad8..512a787d 100644 --- a/modules-available/sysconfig/lang/en/template-tags.json +++ b/modules-available/sysconfig/lang/en/template-tags.json @@ -25,6 +25,7 @@ "lang_configurationChoose": "Please select which modules will be used for this configuration.", "lang_configurationModuleNotFound": "Configuration module not found!", "lang_configurationSuccess": "The configuration has been successfully created.", + "lang_confirmDeleteQuestion": "Are you sure you want to delete this entry?", "lang_connectionWait": "Checking connection, please wait", "lang_continueAnyway": "Continue anyway", "lang_customCertificate": "Additional (intermediate) certificates required for certificate validation", diff --git a/modules-available/sysconfig/page.inc.php b/modules-available/sysconfig/page.inc.php index 353d51db..511cc3e4 100644 --- a/modules-available/sysconfig/page.inc.php +++ b/modules-available/sysconfig/page.inc.php @@ -153,6 +153,7 @@ class Page_SysConfig extends Page if ($this->currentLoc === 0) { Render::addTemplate('list-legend', array('showLocationBadge' => $this->haveOverriddenLocations)); } + Render::addTemplate('js'); // Make this js snippet a template so i18n works return; case 'module': $listid = Request::post('list'); @@ -439,7 +440,9 @@ class Page_SysConfig extends Page Message::addError('config-invalid', $configid); Util::redirect('?do=sysconfig&locationid=' . $this->currentLoc); } - $config->delete(); + if ($config->delete() !== false) { + Message::addSuccess('config-deleted', $config->title()); + } Util::redirect('?do=sysconfig&locationid=' . $this->currentLoc); } diff --git a/modules-available/sysconfig/templates/ad_ldap-homedir.html b/modules-available/sysconfig/templates/ad_ldap-homedir.html index c6250175..de64e49e 100644 --- a/modules-available/sysconfig/templates/ad_ldap-homedir.html +++ b/modules-available/sysconfig/templates/ad_ldap-homedir.html @@ -66,12 +66,6 @@ <label class="control-label"><input type="checkbox" name="shareRemapCreate" {{shareRemapCreate_c}}> {{lang_shareMapCreate}}</label> </div> </div> - <!--hr> - <div class="slx-bold">{{lang_additionalFolders}}</div> - <div><i>{{lang_addFoldersInfo}}</i></div> - - <br> - <div><i>{{lang_driveLetterNote}}</i></div--> <div class="pull-right"> <button type="submit" class="btn btn-primary">{{lang_next}} »</button> </div> diff --git a/modules-available/sysconfig/templates/js.html b/modules-available/sysconfig/templates/js.html new file mode 100644 index 00000000..9e5da884 --- /dev/null +++ b/modules-available/sysconfig/templates/js.html @@ -0,0 +1,11 @@ +<script type="application/javascript"><!-- +document.addEventListener("DOMContentLoaded", function () { + checkBuildStatus(); + $('[data-toggle="tooltip"]').tooltip(); + $('.confirm-delete').click(function (event) { + if (!confirm('{{lang_confirmDeleteQuestion}}')) { + event.preventDefault(); + } + }); +}, false); +// --></script>
\ No newline at end of file diff --git a/modules-available/sysconfig/templates/list-configs.html b/modules-available/sysconfig/templates/list-configs.html index 222ac43c..99db96bd 100644 --- a/modules-available/sysconfig/templates/list-configs.html +++ b/modules-available/sysconfig/templates/list-configs.html @@ -60,7 +60,7 @@ <td class="text-nowrap"> {{^locationid}} <a class="btn btn-success btn-xs" href="?do=SysConfig&action=addconfig&edit={{configid}}" title="{{lang_edit}}"><span class="glyphicon glyphicon-edit"></span></a> - <button class="btn btn-danger btn-xs" name="del" value="{{configid}}" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></button> + <button class="btn btn-danger btn-xs confirm-delete" name="del" value="{{configid}}" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></button> {{/locationid}} </td> </tr> diff --git a/modules-available/sysconfig/templates/list-legend.html b/modules-available/sysconfig/templates/list-legend.html index 4a46a6a0..809a0449 100644 --- a/modules-available/sysconfig/templates/list-legend.html +++ b/modules-available/sysconfig/templates/list-legend.html @@ -33,10 +33,3 @@ {{/showLocationBadge}} </div> </div> - -<script type="application/javascript"><!-- -document.addEventListener("DOMContentLoaded", function () { - checkBuildStatus(); - $('[data-toggle="tooltip"]').tooltip(); -}, false); -// --></script>
\ No newline at end of file diff --git a/modules-available/sysconfig/templates/list-modules.html b/modules-available/sysconfig/templates/list-modules.html index 585b3522..e7a3b26c 100644 --- a/modules-available/sysconfig/templates/list-modules.html +++ b/modules-available/sysconfig/templates/list-modules.html @@ -29,7 +29,7 @@ {{/needRebuild}} name="rebuild" value="{{id}}" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></button> <a class="btn btn-success btn-xs" href="?do=SysConfig&action=addmodule&step={{moduleType}}_Start&edit={{id}}" title="{{lang_edit}}"><span class="glyphicon glyphicon-edit"></span></a> - <button class="btn btn-danger btn-xs" name="del" value="{{id}}" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></button> + <button class="btn btn-danger btn-xs confirm-delete" name="del" value="{{id}}" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></button> </td> </tr> {{/modules}} |