Replacing javascript function sm_delete by Bootstrap modal dialog
parent
52c0c93a0f
commit
d3a318b7dc
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Запиши',
|
||||
'edit' => 'Редактирай',
|
||||
'delete' => 'Изтрии',
|
||||
'deleted' => 'Записът е изтрит',
|
||||
'date' => 'Дата',
|
||||
'message' => 'Съобщебие',
|
||||
'yes' => 'Да',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Налична е нова версия ({version}). Може да я свалите от <a href="http://www.phpservermonitor.org" target="_blank">тук</a>.',
|
||||
'back_to_top' => 'Нагоре',
|
||||
'go_back' => 'Go back',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
|
||||
'mobile' => 'Мобилен телефон',
|
||||
'email' => 'Имейл',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'Информацията за потребителя е обновена.',
|
||||
'inserted' => 'Потребителят е добавен.',
|
||||
'profile' => 'Profile',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Мониторинг',
|
||||
'send_email' => 'Имейл',
|
||||
'send_sms' => 'SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Информацията за сървъра е обновена.',
|
||||
'inserted' => 'Сървърът е добвен успешно.',
|
||||
'latency' => 'Пинг',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Speichern',
|
||||
'edit' => 'Bearbeiten',
|
||||
'delete' => 'Löschen',
|
||||
'deleted' => 'Eintrag wurde gelöscht',
|
||||
'date' => 'Datum',
|
||||
'message' => 'Meldung',
|
||||
'yes' => 'Ja',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Ein neues Update ({version}) ist verfügbar auf <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Back to top',
|
||||
'go_back' => 'Go back',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
|
||||
'mobile' => 'Mobil',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'Benutzer bearbeitet.',
|
||||
'inserted' => 'Benutzer eingetragen.',
|
||||
'profile' => 'Profile',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Monitoring',
|
||||
'send_email' => 'Email',
|
||||
'send_sms' => 'SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Server aktualisiert.',
|
||||
'inserted' => 'Server eingetragen.',
|
||||
'latency' => 'Antwortzeit',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Save',
|
||||
'edit' => 'Edit',
|
||||
'delete' => 'Delete',
|
||||
'deleted' => 'Record has been deleted',
|
||||
'date' => 'Date',
|
||||
'message' => 'Message',
|
||||
'yes' => 'Yes',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'A new version ({version}) is available from <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Back to top',
|
||||
'go_back' => 'Go back',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
|
||||
'mobile' => 'Mobile',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'User updated.',
|
||||
'inserted' => 'User added.',
|
||||
'profile' => 'Profile',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Monitoring',
|
||||
'send_email' => 'Send Email',
|
||||
'send_sms' => 'Send SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Server updated.',
|
||||
'inserted' => 'Server added.',
|
||||
'latency' => 'Latency',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Guardar',
|
||||
'edit' => 'Modificar',
|
||||
'delete' => 'Eliminar',
|
||||
'deleted' => 'Registro eliminado',
|
||||
'date' => 'Fecha',
|
||||
'message' => 'Mensaje',
|
||||
'yes' => 'Si',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Hay una nueva versión ({version}) disponible en <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Back to top',
|
||||
'go_back' => 'Go back',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
|
||||
'mobile' => 'Mobil',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'Usuario actualizado.',
|
||||
'inserted' => 'Usuario ingresado.',
|
||||
'profile' => 'Profile',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Monitoreo',
|
||||
'send_email' => 'Email',
|
||||
'send_sms' => 'SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Servidor arctualizado.',
|
||||
'inserted' => 'Servidor ingresado.',
|
||||
'latency' => 'Tiempo de respuesta',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Enregistrer',
|
||||
'edit' => 'Editer',
|
||||
'delete' => 'Supprimer',
|
||||
'deleted' => 'L\'enregistrement a été supprimé',
|
||||
'date' => 'Date',
|
||||
'message' => 'Message',
|
||||
'yes' => 'Oui',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Une nouvelle version ({version}) est disponible à l\'adresse <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Haut de page',
|
||||
'go_back' => 'Retour',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Annuler',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => 'Le %e %B',
|
||||
'long_day_format' => 'Le %e %B %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => 'Les <b>Administrateurs</b> ont un accès total. Ils peuvent gérer les serveurs, les utilisateurs et éditer la configuration globale.<br/>Les <b>Utilisateurs</b> ne peuvent que voir et mettre à jour les serveurs qui leur ont été assignés.',
|
||||
'mobile' => 'Numéro de téléphone',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Supprimer un utilisateur',
|
||||
'delete_message' => 'Êtes-vous sûr de vouloir supprimer l\'utilisateur \'%1\' ?',
|
||||
'deleted' => 'Utilisateur supprimé.',
|
||||
'updated' => 'Utilisateur mis à jour.',
|
||||
'inserted' => 'Utilisateur ajouté.',
|
||||
'profile' => 'Profil',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Serveillé',
|
||||
'send_email' => 'Envoyer un email',
|
||||
'send_sms' => 'Envoyer un SMS',
|
||||
'delete_title' => 'Supprimer un serveur',
|
||||
'delete_message' => 'Êtes-vous sûr de vouloir supprimer le serveur \'%1\' ?',
|
||||
'deleted' => 'Serveur supprimé.',
|
||||
'updated' => 'Serveur mis à jour.',
|
||||
'inserted' => 'Serveur ajouté.',
|
||||
'latency' => 'Temps de réponse',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Salva',
|
||||
'edit' => 'Modifica',
|
||||
'delete' => 'Elimina',
|
||||
'deleted' => 'L\'oggetto è stato eliminato',
|
||||
'date' => 'Data',
|
||||
'message' => 'Messaggio',
|
||||
'yes' => 'Sì',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Un nuovo aggiornamento ({version}) è disponibile su <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Back to top',
|
||||
'go_back' => 'Go back',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
|
||||
'mobile' => 'Cellulare',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'Utente aggiornato.',
|
||||
'inserted' => 'Utente aggiunto.',
|
||||
'profile' => 'Profile',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Sotto Controllo',
|
||||
'send_email' => 'Invia Email',
|
||||
'send_sms' => 'Invia SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Server aggiornato.',
|
||||
'inserted' => 'Server aggiunto.',
|
||||
'latency' => 'Tempo di risposta',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => '저장',
|
||||
'edit' => '수정',
|
||||
'delete' => '삭제',
|
||||
'deleted' => '삭제되었습니다.',
|
||||
'date' => '날짜',
|
||||
'message' => '메세지',
|
||||
'yes' => '예',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => '새로운 업데이트가 있습니다 ({version}). 다음사이트를 방문 해 주십시오. <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Back to top',
|
||||
'go_back' => 'Go back',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
|
||||
'mobile' => '휴대폰',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => '수정되었습니다.',
|
||||
'inserted' => '추가되었습니다.',
|
||||
'profile' => 'Profile',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => '확인중',
|
||||
'send_email' => '메일 전송',
|
||||
'send_sms' => 'SMS 전송',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => '서버가 수정되었습니다.',
|
||||
'inserted' => '서버가 추가되었습니다.',
|
||||
'latency' => '응답',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Opslaan',
|
||||
'edit' => 'Wijzig',
|
||||
'delete' => 'Verwijder',
|
||||
'deleted' => 'Record is verwijderd',
|
||||
'date' => 'Datum',
|
||||
'message' => 'Bericht',
|
||||
'yes' => 'Ja',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Een nieuwe update ({version}) is beschikbaar op <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Terug naar boven',
|
||||
'go_back' => 'Terug',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Beheerders</b> hebben volledige toegang: ze kunnen servers en gebruiker beheren en de globale configuratie aanpassen.<br/><b>Gebruikers</b> kunnen alleen de servers bekijken en op fouten testen die aan hun zijn toegewezen.',
|
||||
'mobile' => 'Mobiel',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'Gebruiker gewijzigd.',
|
||||
'inserted' => 'Gebruiker toegevoegd.',
|
||||
'profile' => 'Profiel',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Monitoring',
|
||||
'send_email' => 'Stuur email',
|
||||
'send_sms' => 'Stuur SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Server gewijzigd.',
|
||||
'inserted' => 'Server toegevoegd.',
|
||||
'latency' => 'Response tijd',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => 'Salvar',
|
||||
'edit' => 'Editar',
|
||||
'delete' => 'Excluir',
|
||||
'deleted' => 'Registro excluído',
|
||||
'date' => 'Data',
|
||||
'message' => 'Mensagem',
|
||||
'yes' => 'Sim',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => 'Uma atualização ({version}) disponível em <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => 'Voltar ao topo',
|
||||
'go_back' => 'Voltar',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%e %m',
|
||||
'long_day_format' => '%e/%m/%Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>Administradores</b> Tem total acesso: podem gerenciar servidores, usuários e configurações globais.<br/><b>Usuários</b> só podem executar atualizações para servidores que lhe foram atribuídos.',
|
||||
'mobile' => 'Celular',
|
||||
'email' => 'Email',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => 'Usuário atualizado.',
|
||||
'inserted' => 'Usuário adicionado.',
|
||||
'profile' => 'Perfil',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => 'Monitoramento',
|
||||
'send_email' => 'Enviar Email',
|
||||
'send_sms' => 'Enviar SMS',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => 'Servidor atualizado.',
|
||||
'inserted' => 'Servidor adicionar.',
|
||||
'latency' => 'Tempo de resposta',
|
||||
|
|
|
@ -35,7 +35,6 @@ $sm_lang = array(
|
|||
'save' => '保存',
|
||||
'edit' => '编辑',
|
||||
'delete' => '删除',
|
||||
'deleted' => '纪录已删除',
|
||||
'date' => '日期',
|
||||
'message' => '消息',
|
||||
'yes' => '是',
|
||||
|
@ -46,6 +45,8 @@ $sm_lang = array(
|
|||
'update_available' => '发现新版本({version}) <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
|
||||
'back_to_top' => '返回顶部',
|
||||
'go_back' => '后退',
|
||||
'ok' => 'OK',
|
||||
'cancel' => 'Cancel',
|
||||
// date/time format according the strftime php function format parameter http://php.net/manual/function.strftime.php
|
||||
'short_day_format' => '%B %e',
|
||||
'long_day_format' => '%B %e, %Y',
|
||||
|
@ -81,6 +82,9 @@ $sm_lang = array(
|
|||
'level_description' => '<b>超级管理员</b> 拥有所有权限: 管理服务器, 用户 以及修改设置.<br/><b>普通用户</b> 只能查看及更新自己名下所属的服务器.',
|
||||
'mobile' => '手机',
|
||||
'email' => '邮件',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
'updated' => '用户已更新.',
|
||||
'inserted' => '用户已添加.',
|
||||
'profile' => '个人资料',
|
||||
|
@ -117,6 +121,9 @@ $sm_lang = array(
|
|||
'monitoring' => '监控中',
|
||||
'send_email' => '发送邮件',
|
||||
'send_sms' => '发送短信',
|
||||
'delete_title' => 'Delete Server',
|
||||
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
|
||||
'deleted' => 'Server deleted.',
|
||||
'updated' => '服务器已更新.',
|
||||
'inserted' => '服务器已添加.',
|
||||
'latency' => '延迟',
|
||||
|
|
|
@ -79,6 +79,12 @@ abstract class AbstractController implements ControllerInterface {
|
|||
*/
|
||||
protected $sidebar;
|
||||
|
||||
/**
|
||||
* Modal to add
|
||||
* @var \psm\Util\Module\ModalInterface $modal
|
||||
*/
|
||||
protected $modal;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
* @var \psm\Service\Database $db
|
||||
|
@ -176,6 +182,10 @@ abstract class AbstractController implements ControllerInterface {
|
|||
if($this->add_menu) {
|
||||
$tpl_data['html_menu'] = $this->createHTMLMenu();
|
||||
}
|
||||
// add modal dialog to page ?
|
||||
if($this->modal != null) {
|
||||
$tpl_data['html_modal'] = $this->modal->createHTML();
|
||||
}
|
||||
// add sidebar to page?
|
||||
if($this->sidebar !== null) {
|
||||
$tpl_data['html_sidebar'] = $this->sidebar->createHTML();
|
||||
|
@ -443,4 +453,14 @@ abstract class AbstractController implements ControllerInterface {
|
|||
$this->sidebar = $sidebar;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a modal dialog to the page
|
||||
* @param \psm\Util\Module\ModalInterface $modal
|
||||
* @return \psm\Module\ControllerInterface
|
||||
*/
|
||||
public function setModal(\psm\Util\Module\ModalInterface $modal) {
|
||||
$this->modal = $modal;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,12 @@ class ServerController extends AbstractServerController {
|
|||
|
||||
// check if user is admin, in that case we add the buttons
|
||||
if($this->user->getUserLevel() == PSM_USER_ADMIN) {
|
||||
$modal = new \psm\Util\Module\Modal($this->tpl, \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
|
||||
$this->setModal($modal);
|
||||
$modal->setTitle(psm_get_lang('servers', 'delete_title'));
|
||||
$modal->setMessage(psm_get_lang('servers', 'delete_message'));
|
||||
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
|
||||
|
||||
$sidebar->addButton(
|
||||
'add_new',
|
||||
psm_get_lang('system', 'add_new'),
|
||||
|
@ -229,7 +235,7 @@ class ServerController extends AbstractServerController {
|
|||
$this->db->delete(PSM_DB_PREFIX.'servers_uptime', array('server_id' => $id));
|
||||
$this->db->delete(PSM_DB_PREFIX.'servers_history', array('server_id' => $id));
|
||||
}
|
||||
$this->addMessage(psm_get_lang('system', 'deleted'), 'success');
|
||||
$this->addMessage(psm_get_lang('servers', 'deleted'), 'success');
|
||||
}
|
||||
$this->initializeAction('index');
|
||||
}
|
||||
|
@ -261,6 +267,14 @@ class ServerController extends AbstractServerController {
|
|||
$this->tpl->newTemplate($tpl_id_actions, 'server/view.tpl.html');
|
||||
$tpl_data['html_actions'] = $this->tpl->getTemplate($tpl_id_actions);
|
||||
$tpl_data['url_edit'] = psm_build_url(array('mod' => 'server', 'action' => 'edit', 'id' => $this->server_id, 'back_to' => 'view'));
|
||||
$tpl_data['url_delete'] = psm_build_url(array('mod' => 'server', 'action' => 'delete', 'id' => $this->server_id));
|
||||
$tpl_data['server_name'] = $server['label'];
|
||||
|
||||
$modal = new \psm\Util\Module\Modal($this->tpl, \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
|
||||
$this->setModal($modal);
|
||||
$modal->setTitle(psm_get_lang('servers', 'delete_title'));
|
||||
$modal->setMessage(psm_get_lang('servers', 'delete_message'));
|
||||
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
|
||||
}
|
||||
|
||||
// add all available servers to the menu
|
||||
|
|
|
@ -79,6 +79,12 @@ class UserController extends AbstractController {
|
|||
'plus icon-white', 'success'
|
||||
);
|
||||
|
||||
$modal = new \psm\Util\Module\Modal($this->tpl, \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
|
||||
$this->setModal($modal);
|
||||
$modal->setTitle(psm_get_lang('users', 'delete_title'));
|
||||
$modal->setMessage(psm_get_lang('users', 'delete_message'));
|
||||
$modal->setOKButtonLabel(psm_get_lang('system', 'delete'));
|
||||
|
||||
// build label array for the next loop
|
||||
$servers_labels = array();
|
||||
foreach ($this->servers as $server) {
|
||||
|
@ -268,7 +274,7 @@ class UserController extends AbstractController {
|
|||
|
||||
$this->db->delete(PSM_DB_PREFIX . 'users', array('user_id' => $id,));
|
||||
$this->db->delete(PSM_DB_PREFIX.'users_servers', array('user_id' => $id));
|
||||
$this->addMessage(psm_get_lang('system', 'deleted'), 'success');
|
||||
$this->addMessage(psm_get_lang('users', 'deleted'), 'success');
|
||||
} catch(\InvalidArgumentException $e) {
|
||||
$this->addMessage(psm_get_lang('users', 'error_' . $e->getMessage()), 'error');
|
||||
}
|
||||
|
|
|
@ -0,0 +1,178 @@
|
|||
<?php
|
||||
/**
|
||||
* PHP Server Monitor
|
||||
* Monitor your servers and websites.
|
||||
*
|
||||
* This file is part of PHP Server Monitor.
|
||||
* PHP Server Monitor is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PHP Server Monitor is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package phpservermon
|
||||
* @author Pepijn Over <pep@neanderthal-technology.com>
|
||||
* @author Jérôme Cabanis <jerome@lauraly.com>
|
||||
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
|
||||
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
|
||||
* @version Release: @package_version@
|
||||
* @link http://www.phpservermonitor.org/
|
||||
**/
|
||||
|
||||
namespace psm\Util\Module;
|
||||
use psm\Service\Template;
|
||||
|
||||
class Modal implements ModalInterface {
|
||||
|
||||
const MODAL_TYPE_OK = 0;
|
||||
const MODAL_TYPE_OKCANCEL = 1;
|
||||
const MODAL_TYPE_DANGER = 2;
|
||||
|
||||
/**
|
||||
* Template service
|
||||
* @var \psm\Service\Template $tpl
|
||||
*/
|
||||
protected $tpl;
|
||||
|
||||
/**
|
||||
* @var int $type Type of modal dialog
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* Modal dialog title
|
||||
* @var string $title
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* Modal dialog message
|
||||
* @var string $body
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* label of the OK button
|
||||
* @var string $ok_label
|
||||
*/
|
||||
protected $ok_label;
|
||||
|
||||
public function __construct(Template $tpl, $type = self::MODAL_TYPE_OK ) {
|
||||
$this->tpl = $tpl;
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the modal dialog type
|
||||
* @param int $type
|
||||
* @return \psm\Util\Module\Modal
|
||||
*/
|
||||
public function setType($type) {
|
||||
if(in_array($type, array(self::MODAL_TYPE_OK, self::MODAL_TYPE_OKCANCEL, self::MODAL_TYPE_DANGER))) {
|
||||
$this->type = $type;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the modal dialog title
|
||||
* @param string $title
|
||||
* @return \psm\Util\Module\Modal
|
||||
*/
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the modal dialog message
|
||||
* @param string $message
|
||||
* @return \psm\Util\Module\Modal
|
||||
*/
|
||||
public function setMessage($message) {
|
||||
$this->message = $message;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setOKButtonLabel($label) {
|
||||
$this->ok_label = $label;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function createHTML() {
|
||||
$tpl_id = 'main_modal_container';
|
||||
$this->tpl->newTemplate($tpl_id, 'main_modal.tpl.html');
|
||||
|
||||
$buttons = array();
|
||||
switch($this->type)
|
||||
{
|
||||
case self::MODAL_TYPE_OK:
|
||||
$buttons[] = array(
|
||||
'modal_button_id' => 'mainModalOKButton',
|
||||
'modal_button_type' => 'primary',
|
||||
'modal_button_dismiss' => '',
|
||||
'modal_button_label' => empty($this->ok_label) ? psm_get_lang('system', 'ok') : $this->ok_label,
|
||||
);
|
||||
break;
|
||||
|
||||
case self::MODAL_TYPE_OKCANCEL:
|
||||
$buttons[] = array(
|
||||
'modal_button_id' => 'mainModalCancelButton',
|
||||
'modal_button_type' => 'default',
|
||||
'modal_button_dismiss' => 'modal',
|
||||
'modal_button_label' => psm_get_lang('system', 'cancel'),
|
||||
);
|
||||
$buttons[] = array(
|
||||
'modal_button_id' => 'mainModalOKButton',
|
||||
'modal_button_type' => 'primary',
|
||||
'modal_button_dismiss' => '',
|
||||
'modal_button_label' => empty($this->ok_label) ? psm_get_lang('system', 'ok') : $this->ok_label,
|
||||
);
|
||||
break;
|
||||
|
||||
case self::MODAL_TYPE_DANGER:
|
||||
$buttons[] = array(
|
||||
'modal_button_id' => 'mainModalCancelButton',
|
||||
'modal_button_type' => 'default',
|
||||
'modal_button_dismiss' => 'modal',
|
||||
'modal_button_label' => psm_get_lang('system', 'cancel'),
|
||||
);
|
||||
$buttons[] = array(
|
||||
'modal_button_id' => 'mainModalOKButton',
|
||||
'modal_button_type' => 'danger',
|
||||
'modal_button_dismiss' => '',
|
||||
'modal_button_label' => empty($this->ok_label) ? psm_get_lang('system', 'ok') : $this->ok_label,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if(sizeof($buttons)) {
|
||||
$this->tpl->addTemplateDataRepeat($tpl_id, 'buttons', $buttons);
|
||||
}
|
||||
|
||||
$message = !empty($this->message) ? $this->message : '';
|
||||
$matches = array();
|
||||
if(preg_match_all('/%(\d)/', $message, $matches, PREG_SET_ORDER)) {
|
||||
foreach($matches as $match) {
|
||||
$message = str_replace($match[0], '<span class="mainModalP' . $match[1] . '"></span>', $message);
|
||||
}
|
||||
}
|
||||
|
||||
$this->tpl->addTemplateData($tpl_id, array(
|
||||
'modal_title' => !empty($this->title) ? $this->title : psm_get_lang('system', 'title'),
|
||||
'modal_body' => $message,
|
||||
));
|
||||
|
||||
|
||||
$html = $this->tpl->getTemplate($tpl_id);
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* PHP Server Monitor
|
||||
* Monitor your servers and websites.
|
||||
*
|
||||
* This file is part of PHP Server Monitor.
|
||||
* PHP Server Monitor is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PHP Server Monitor is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package phpservermon
|
||||
* @author Pepijn Over <pep@neanderthal-technology.com>
|
||||
* @author Jérôme Cabanis <jerome@lauraly.com>
|
||||
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
|
||||
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
|
||||
* @version Release: @package_version@
|
||||
* @link http://www.phpservermonitor.org/
|
||||
**/
|
||||
|
||||
namespace psm\Util\Module;
|
||||
|
||||
interface ModalInterface {
|
||||
|
||||
public function __construct(\psm\Service\Template $tpl);
|
||||
|
||||
public function createHTML();
|
||||
|
||||
}
|
|
@ -43,6 +43,7 @@
|
|||
</div>
|
||||
<!-- /navbar -->
|
||||
|
||||
{html_modal}
|
||||
<!-- container -->
|
||||
<div class="container-fluid">
|
||||
<div class="page-header">
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<!--%tpl_main_modal_container-->
|
||||
<div id="mainModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mainModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<h3 id="mainModalLabel">{modal_title}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{modal_body}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!--%tpl_repeat_buttons-->
|
||||
<a href="#" id="{modal_button_id}" class="btn btn-{modal_button_type}" data-dismiss="{modal_button_dismiss}">{modal_button_label}</a>
|
||||
<!--%%tpl_repeat_buttons-->
|
||||
{buttons}
|
||||
</div>
|
||||
</div>
|
||||
<!--%%tpl_main_modal_container-->
|
|
@ -45,7 +45,7 @@
|
|||
<a class="btn btn-small" href="index.php?mod=server&action=edit&id={server_id}" title="{label_edit}">
|
||||
<i class="icon-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-small btn-danger" href="javascript:sm_delete('{server_id}', 'server');" title="{label_delete}">
|
||||
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=server&action=delete&id={server_id}" title="{label_delete}" data-modal-param="{label}">
|
||||
<i class="icon-remove icon-white"></i>
|
||||
</a>
|
||||
<!--%%tpl_server_list_admin_actions-->
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<a class="btn btn-success" href="{url_edit}">
|
||||
<i class="icon-edit icon-white"></i> {label_edit}
|
||||
</a>
|
||||
<a class="btn btn-danger" href="javascript:sm_delete('{server_id}', 'server');">
|
||||
<a class="btn btn-danger show-modal" href="{url_delete}" data-modal-param="{server_name}">
|
||||
<i class="icon-remove icon-white"></i> {label_delete}
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<a class="btn btn-small" href="index.php?mod=user&action=edit&id={user_id}" title="{label_edit}">
|
||||
<i class="icon-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-small btn-danger" href="javascript:sm_delete('{user_id}', 'user');" title="{label_delete}">
|
||||
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=user&action=delete&id={user_id}" title="{label_delete}" data-modal-param="{user_name}">
|
||||
<i class="icon-remove icon-white"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -1,10 +1,27 @@
|
|||
function sm_delete(id, mod) {
|
||||
var del = confirm("Are you sure you want to delete this record?");
|
||||
if (del === true) {
|
||||
var loc = 'index.php?action=delete&id=' + id + '&mod=' + mod;
|
||||
window.location = loc;
|
||||
}
|
||||
}
|
||||
$().ready(function() {
|
||||
var $modal = $('#mainModal');
|
||||
if($modal.length) {
|
||||
$('.show-modal').click(function (e) {
|
||||
var $this = $(this);
|
||||
if ($this.is('a')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
var href = $this.attr('href');
|
||||
$('#mainModalOKButton').attr('href', href);
|
||||
|
||||
var param = $this.attr('data-modal-param');
|
||||
if(param) {
|
||||
var ary = param.split(',');
|
||||
for (var index = 0; index < ary.length && index < 9; ++index) {
|
||||
var value = ary[index];
|
||||
$('#mainModal span.mainModalP' + (index+1)).text(value);
|
||||
}
|
||||
}
|
||||
$modal.modal('show');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function psm_tooltips() {
|
||||
$('input[data-toggle="tooltip"]').tooltip({
|
||||
|
|
Loading…
Reference in New Issue