Module: nagvis
Branch: master
Commit: 8d244d37abf6dffd8f16ac89ac8c03c6560ea309
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=8d244d37abf6dffd8f16ac89ac8c03c6560ea309

Author: LaMi <l...@vertical-visions.de>
Date:   Wed Jan  6 22:12:50 2010 +0100

 #156 Added new object "line" to the WUI

---

 share/frontend/wui/classes/WuiCore.php |    3 ++-
 share/frontend/wui/classes/WuiMap.php  |    7 ++++---
 share/frontend/wui/js/addmodify.js     |    6 +++---
 share/frontend/wui/js/jsdomenu.inc.js  |    2 ++
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/share/frontend/wui/classes/WuiCore.php 
b/share/frontend/wui/classes/WuiCore.php
index 624f34e..cd00633 100644
--- a/share/frontend/wui/classes/WuiCore.php
+++ b/share/frontend/wui/classes/WuiCore.php
@@ -153,7 +153,8 @@ class WuiCore extends GlobalCore {
                        'map' => $this->getLang()->getText('map'),
                        'textbox' => $this->getLang()->getText('textbox'),
                        'shape' => $this->getLang()->getText('shape'),
-                       'manage' => $this->getLang()->getText('manage'));
+                       'manage' => $this->getLang()->getText('manage'),
+                       'stateless' => $this->getLang()->getText('Stateless'));
                
                return json_encode($langMenu);
        }
diff --git a/share/frontend/wui/classes/WuiMap.php 
b/share/frontend/wui/classes/WuiMap.php
index cd9bc1b..5ab0a01 100644
--- a/share/frontend/wui/classes/WuiMap.php
+++ b/share/frontend/wui/classes/WuiMap.php
@@ -118,7 +118,7 @@ class WuiMap extends GlobalMap {
                                        $this->moveable .= 
"\"box_".$obj['type']."_".$obj['id']."\",";
                                break;
                                default:
-                                       if(isset($obj['view_type']) && 
$obj['view_type'] == 'line') {
+                                       if($obj['type'] == 'line' || 
(isset($obj['view_type']) && $obj['view_type'] == 'line')) {
                                                list($pointa_x,$pointb_x) = 
explode(",", $obj['x']);
                                                list($pointa_y,$pointb_y) = 
explode(",", $obj['y']);
                                                $ret .= "<script 
type=\"text/javascript\">myshape_background.drawLine(".$pointa_x.",".$pointa_y.",".$pointb_x.",".$pointb_y.");</script>";
@@ -343,6 +343,7 @@ class WuiMap extends GlobalMap {
                $objects = 
array_merge($objects,$this->getObjectsOfType('servicegroup',$mergeWithGlobals));
                $objects = 
array_merge($objects,$this->getObjectsOfType('textbox',$mergeWithGlobals));
                $objects = 
array_merge($objects,$this->getObjectsOfType('shape',$mergeWithGlobals));
+               $objects = 
array_merge($objects,$this->getObjectsOfType('line',$mergeWithGlobals));
                
                return $objects;
        }
@@ -381,7 +382,7 @@ class WuiMap extends GlobalMap {
                                // add default state to the object
                                $obj = array_merge($obj,$objState);
                                
-                               if($obj['type'] != 'textbox' && $obj['type'] != 
'shape') {
+                               if($obj['type'] != 'textbox' && $obj['type'] != 
'shape' && $obj['type'] != 'line') {
                                        $obj['icon'] = $this->getIcon($obj);
                                }
                                
@@ -523,7 +524,7 @@ class WuiMap extends GlobalMap {
                
                // Position/Size link on textboxes/lines
                //$tooltipText .= "&nbsp;".$positionSizeText;
-               if(isset($obj['view_type']) && $obj['view_type'] == 'line') {
+               if($obj['type'] == 'line' || (isset($obj['view_type']) && 
$obj['view_type'] == 'line')) {
                        $tooltipText .= "<li><a 
style=\'background-image:url(".$this->CORE->getMainCfg()->getValue('paths','htmlbase')."/frontend/wui/images/internal/move.png)\'"
                                                ." 
href=javascript:objid=".$obj['id'].";get_click(\'".$obj['type']."\',2,\'modify\');>"
                                                
."<span>".$this->CORE->getLang()->getText('positionSize')."</span></a></li>";   
                
diff --git a/share/frontend/wui/js/addmodify.js 
b/share/frontend/wui/js/addmodify.js
index 119fb65..499907d 100644
--- a/share/frontend/wui/js/addmodify.js
+++ b/share/frontend/wui/js/addmodify.js
@@ -155,7 +155,7 @@ function validateMapCfgForm() {
        }
        
        // we make some post tests (concerning the line_type and iconset values)
-       if(document.addmodify.view_type && document.addmodify.view_type.value 
== 'line') {
+       if((document.addmodify.view_type && document.addmodify.view_type.value 
== 'line') || document.addmodify.type == 'line') {
                // we verify that the current line_type is valid
                var valid_list = new Array("10","11","12");
                for(var j = 0, len = valid_list.length; valid_list[j] != 
document.addmodify.line_type.value && j < len; j++) {
@@ -195,7 +195,7 @@ function validateMapCfgForm() {
                        alert(printLang(lang["only1or2coordsX"],'COORD~X'));
                        return false;
                } else {
-                       if(document.addmodify.view_type.value != 'line') {
+                       if(document.addmodify.type != 'line' && 
document.addmodify.view_type && document.addmodify.view_type.value != 'line') {
                                
alert(printLang(lang["viewTypeWrong"],'COORD~X'));
                                return false;
                        }
@@ -212,7 +212,7 @@ function validateMapCfgForm() {
                        alert(printLang(lang["only1or2coordsY"],'COORD~Y'));
                        return false;
                } else {
-                       if(document.addmodify.view_type.value != 'line') {
+                       if(document.addmodify.type != 'line' && 
document.addmodify.view_type && document.addmodify.view_type.value != 'line') {
                                
alert(printLang(lang["viewTypeWrong"],'COORD~Y'));
                                return false;
                        }
diff --git a/share/frontend/wui/js/jsdomenu.inc.js 
b/share/frontend/wui/js/jsdomenu.inc.js
index b8a53ee..21944f6 100644
--- a/share/frontend/wui/js/jsdomenu.inc.js
+++ b/share/frontend/wui/js/jsdomenu.inc.js
@@ -77,6 +77,8 @@ function createjsDOMenu() {
                addMenuItem(new menuItem(get_label('service'), "", 
"code:get_click('service',2,'add');"));
                addMenuItem(new menuItem(get_label('hostgroup'), "", 
"code:get_click('hostgroup',2,'add');"));
                addMenuItem(new menuItem(get_label('servicegroup'), "", 
"code:get_click('servicegroup',2,'add');"));
+               addMenuItem(new menuItem("-"));
+               addMenuItem(new menuItem(get_label('stateless'), "", 
"code:get_click('line',2,'add');"));
        }
        
        var submenu_addobject_special = new jsDOMenu(140);


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
Nagvis-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to