Author:   Lars Michelsen <[email protected]>
Date:     Sat Apr  2 11:22:20 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sat Apr  2 11:22:20 2011 +0200

Added confirm dialog to object deletion in regular frontend

---

 share/server/core/classes/NagVisContextMenu.php |    4 ++++
 share/userfiles/templates/default.context.html  |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/share/server/core/classes/NagVisContextMenu.php 
b/share/server/core/classes/NagVisContextMenu.php
index 24fd648..e417efb 100644
--- a/share/server/core/classes/NagVisContextMenu.php
+++ b/share/server/core/classes/NagVisContextMenu.php
@@ -98,6 +98,10 @@ class NagVisContextMenu {
         */
        private function replaceStaticMacros() {
                // Replace the static macros (language, paths)
+               if(strpos($this->code,'[lang_confirm_delete]') !== FALSE) {
+                       $this->code = str_replace('[lang_confirm_delete]', 
$this->CORE->getLang()->getText('confirmDelete'), $this->code);
+               }
+
                if(strpos($this->code,'[lang_connect_by_ssh]') !== FALSE) {
                        $this->code = 
str_replace('[lang_connect_by_ssh]',$this->CORE->getLang()->getText('contextConnectBySsh'),$this->code);
                }
diff --git a/share/userfiles/templates/default.context.html 
b/share/userfiles/templates/default.context.html
index 64b2640..22171d3 100644
--- a/share/userfiles/templates/default.context.html
+++ b/share/userfiles/templates/default.context.html
@@ -7,7 +7,7 @@
        <li><a href="#" onClick="toggleLineMidLock('[obj_id]'); 
contextHide();">[lang_toggle_line_mid]</a></li>
        <!-- END line_two_parts -->
        <!-- END line -->
-       <li><a href="#" onClick="removeMapObject('[obj_id]'); 
contextHide();">Remove object</a></li>
+       <li><a href="#" 
onClick="if(confirm('[lang_confirm_delete]')){removeMapObject('[obj_id]');} 
contextHide();">Remove object</a></li>
        <!-- END not_automap -->
        <!-- BEGIN host -->
        <li class="spacer"></li>


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to