Module: nagvis Branch: master Commit: 504a6240a63b83919923b4de78410dab8fa070f7 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=504a6240a63b83919923b4de78410dab8fa070f7
Author: LaMi <[email protected]> Date: Thu Feb 4 19:17:11 2010 +0100 #174 Setting hover_childs_limit to -1 disables the limitation of the hover childs --- docs/en_US/map_config_format_description.html | 12 ++++++------ share/frontend/nagvis-js/js/hover.js | 4 ++-- share/server/core/classes/GlobalMainCfg.php | 2 +- share/server/core/classes/GlobalMapCfg.php | 12 ++++++------ share/server/core/classes/objects/NagVisObject.php | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/en_US/map_config_format_description.html b/docs/en_US/map_config_format_description.html index 835ae57..861bf3e 100644 --- a/docs/en_US/map_config_format_description.html +++ b/docs/en_US/map_config_format_description.html @@ -132,7 +132,7 @@ <td> hover_childs_show </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Enable/Disable displaying child objects </td> </tr> <tr> - <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Number of maximum children to be displayed </td> + <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Number of maximum children to be displayed. Set to -1 to disable the limit.</td> </tr> <tr> <td> hover_childs_order </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Order direction of child objects </td> @@ -240,7 +240,7 @@ <td> hover_childs_order </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Order direction of child objects </td> </tr> <tr> - <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Maximum number of children to be displayed </td> + <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Maximum number of children to be displayed. Set to -1 to disable the limit.</td> </tr> <tr> <td> iconset </td><td> inherited (<a href="#global">global</a>) </td><td> Special iconset. Is inherited from global paragraph if not specified. </td> @@ -365,7 +365,7 @@ <td> hover_childs_order </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Order direction of child objects </td> </tr> <tr> - <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Maximum number of children to be displayed </td> + <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Maximum number of children to be displayed. Set to -1 to disable the limit. </td> </tr> <tr> <td> iconset </td><td> inherited (<a href="#global">global</a>) </td><td> Special iconset. Is inherited from global paragraph if not specified. </td> @@ -472,7 +472,7 @@ <td> hover_childs_order </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Order direction of child objects </td> </tr> <tr> - <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Maximum number of children to be displayed </td> + <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Maximum number of children to be displayed. Set to -1 to disable the limit. </td> </tr> <tr> <td> iconset </td><td> inherited (<a href="#global">global</a>) </td><td> Special iconset. Is inherited from global paragraph if not specified. </td> @@ -582,7 +582,7 @@ <td> hover_childs_order </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Order direction of child objects </td> </tr> <tr> - <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Number of maximum children to be displayed </td> + <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Number of maximum children to be displayed. Set to -1 to disable the limit. </td> </tr> <tr> <td> iconset </td><td> inherited (<a href="#global">global</a>) </td><td> Special iconset. Is inherited from global paragraph if not specified. </td> @@ -686,7 +686,7 @@ <td> hover_childs_order </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Order direction of child objects </td> </tr> <tr> - <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Number of maximum children to be displayed </td> + <td> hover_childs_limit </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Number of maximum children to be displayed. Set to -1 to disable the limit. </td> </tr> <tr> <td> iconset </td><td> inherited (<a href="#global">global</a>) </td><td> Special iconset. Is inherited from global paragraph if not specified. </td> diff --git a/share/frontend/nagvis-js/js/hover.js b/share/frontend/nagvis-js/js/hover.js index 368cfba..79646ec 100644 --- a/share/frontend/nagvis-js/js/hover.js +++ b/share/frontend/nagvis-js/js/hover.js @@ -60,8 +60,8 @@ function replaceHoverTemplateChildMacros(oObj, sTemplateCode) { if(rowHtmlCode != '' && oObj.members && oObj.members.length > 0) { // Loop all child objects until all looped or the child limit is reached - for(var i = 0, len1 = oObj.conf.hover_childs_limit, len2 = oObj.members.length; i <= len1 && i < len2; i++) { - if(i < oObj.conf.hover_childs_limit) { + for(var i = 0, len1 = oObj.conf.hover_childs_limit, len2 = oObj.members.length; (len1 == -1 || (len1 >= 0 && i <= len1)) && i < len2; i++) { + if(len1 == -1 || (len1 >= 0 && i < len1)) { // Try to catch some error if(!oObj.members[i].conf) { eventlog("hover-parsing", "critical", "Problem while parsing child in hover template (t:" & oObj.conf.type & " n:" & oObj.conf.name &")"); diff --git a/share/server/core/classes/GlobalMainCfg.php b/share/server/core/classes/GlobalMainCfg.php index 903cd4f..57ef66a 100644 --- a/share/server/core/classes/GlobalMainCfg.php +++ b/share/server/core/classes/GlobalMainCfg.php @@ -247,7 +247,7 @@ class GlobalMainCfg { 'default' => '10', 'depends_on' => 'hovermenu', 'depends_value' => 1, - 'match' => MATCH_INTEGER), + 'match' => MATCH_INTEGER_PRESIGN), 'hoverchildsorder' => Array('must' => 0, 'editable' => 1, 'default' => 'asc', diff --git a/share/server/core/classes/GlobalMapCfg.php b/share/server/core/classes/GlobalMapCfg.php index 367f39c..a66c80a 100644 --- a/share/server/core/classes/GlobalMapCfg.php +++ b/share/server/core/classes/GlobalMapCfg.php @@ -191,7 +191,7 @@ class GlobalMapCfg { 'depends_value' => '1'), 'hover_childs_limit' => Array('must' => 0, 'default' => $this->CORE->getMainCfg()->getValue('defaults', 'hoverchildslimit'), - 'match' => MATCH_INTEGER, + 'match' => MATCH_INTEGER_PRESIGN, 'depends_on' => 'hover_menu', 'depends_value' => '1'), 'hover_childs_order' => Array('must' => 0, @@ -371,7 +371,7 @@ class GlobalMapCfg { 'depends_value' => '1'), 'hover_childs_limit' => Array('must' => 0, 'default' => '', - 'match' => MATCH_INTEGER, + 'match' => MATCH_INTEGER_PRESIGN, 'depends_on' => 'hover_menu', 'depends_value' => '1'), @@ -524,7 +524,7 @@ class GlobalMapCfg { 'depends_value' => '1'), 'hover_childs_limit' => Array('must' => 0, 'default' => '', - 'match' => MATCH_INTEGER, + 'match' => MATCH_INTEGER_PRESIGN, 'depends_on' => 'hover_menu', 'depends_value' => '1'), @@ -694,7 +694,7 @@ class GlobalMapCfg { 'depends_value' => '1'), 'hover_childs_limit' => Array('must' => 0, 'default' => '', - 'match' => MATCH_INTEGER, + 'match' => MATCH_INTEGER_PRESIGN, 'depends_on' => 'hover_menu', 'depends_value' => '1'), @@ -842,7 +842,7 @@ class GlobalMapCfg { 'depends_value' => '1'), 'hover_childs_limit' => Array('must' => 0, 'default' => '', - 'match' => MATCH_INTEGER, + 'match' => MATCH_INTEGER_PRESIGN, 'depends_on' => 'hover_menu', 'depends_value' => '1'), @@ -984,7 +984,7 @@ class GlobalMapCfg { 'depends_value' => '1'), 'hover_childs_limit' => Array('must' => 0, 'default' => '', - 'match' => MATCH_INTEGER, + 'match' => MATCH_INTEGER_PRESIGN, 'depends_on' => 'hover_menu', 'depends_value' => '1'), diff --git a/share/server/core/classes/objects/NagVisObject.php b/share/server/core/classes/objects/NagVisObject.php index 05f923f..afd21e2 100644 --- a/share/server/core/classes/objects/NagVisObject.php +++ b/share/server/core/classes/objects/NagVisObject.php @@ -366,7 +366,7 @@ class NagVisObject { $iNumObjects = count($aTmpMembers); // Loop all child object until all looped or the child limit is reached - for($i = 0, $iEnum = 0; $iEnum <= $this->hover_childs_limit && $i < $iNumObjects; $i++) { + for($i = 0, $iEnum = 0; (($this->hover_childs_limit >= 0 && $iEnum <= $this->hover_childs_limit) || $this->hover_childs_limit == -1) && $i < $iNumObjects; $i++) { $arr[] = $aTmpMembers[$i]; // Only count objects which are added to the list for checking ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
