Module: nagvis Branch: master Commit: 116cc0934541e680239835567897eb271c36be53 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=116cc0934541e680239835567897eb271c36be53
Author: LaMi <[email protected]> Date: Sat Jan 9 16:25:00 2010 +0100 Fixed redirection of frontend messages in nagvis-js frontend; Fixed new map deletion method --- share/frontend/nagvis-js/js/frontendMessage.js | 4 +++- share/frontend/wui/classes/WuiMainCfg.php | 18 ------------------ share/server/core/classes/CoreModMap.php | 9 +++++++-- share/server/core/classes/GlobalMapCfg.php | 20 +++++++++++++++++++- .../wui => server/core}/classes/WuiMapCfg.php | 0 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/share/frontend/nagvis-js/js/frontendMessage.js b/share/frontend/nagvis-js/js/frontendMessage.js index 1cfd9c9..c1a160e 100644 --- a/share/frontend/nagvis-js/js/frontendMessage.js +++ b/share/frontend/nagvis-js/js/frontendMessage.js @@ -171,10 +171,12 @@ function frontendMessage(oMessage, iTimeout) { var sUrl = window.location.href; // Maybe enable redirect - if(typeof oMessage.realoadUrl !== 'undefined' && oMessage.realoadUrl !== null) { + if(typeof oMessage.reloadUrl !== 'undefined' && oMessage.reloadUrl !== null) { sUrl = oMessage.reloadUrl; } + eventlog("frontendMessage", "note", "Schedule reload in "+oMessage.reloadTime+" sec. URL: "+sUrl); + // Register reload/redirect setTimeout(function() {window.location = sUrl;}, oMessage.reloadTime*1000); } diff --git a/share/frontend/wui/classes/WuiMainCfg.php b/share/frontend/wui/classes/WuiMainCfg.php index d5dd7ed..2a7a664 100644 --- a/share/frontend/wui/classes/WuiMainCfg.php +++ b/share/frontend/wui/classes/WuiMainCfg.php @@ -214,23 +214,5 @@ class WuiMainCfg extends GlobalMainCfg { return FALSE; } } - - /** - * Checks for writeable MapCfgFolder - * - * @param Boolean $printErr - * @return Boolean Is Successful? - * @author Lars Michelsen <[email protected]> - */ - function checkMapCfgFolderWriteable($printErr) { - if(file_exists(substr($this->getValue('paths', 'mapcfg'),0,-1)) && is_writable(substr($this->getValue('paths', 'mapcfg'),0,-1))) { - return TRUE; - } else { - if($printErr == 1) { - new GlobalMessage('ERROR', WuiCore::getInstance()->getLang()->getText('mapCfgDirNotWriteable','MAPPATH~'.$this->getValue('paths', 'mapcfg')), WuiCore::getInstance()->getMainCfg()->getValue('paths','htmlbase')); - } - return FALSE; - } - } } ?> diff --git a/share/server/core/classes/CoreModMap.php b/share/server/core/classes/CoreModMap.php index 97f0463..2b2c3ce 100644 --- a/share/server/core/classes/CoreModMap.php +++ b/share/server/core/classes/CoreModMap.php @@ -79,7 +79,12 @@ class CoreModMap extends CoreModule { if($aReturn !== false) { // Try to create the map if($this->doAdd($aReturn)) { - new GlobalMessage('NOTE', $this->CORE->getLang()->getText('The map has been created.')); + new GlobalMessage('NOTE', + $this->CORE->getLang()->getText('The map has been created.'), + null, + null, + 1, + $this->CORE->getMainCfg()->getValue('paths','htmlbase').'/frontend/wui/index.php?mod=Map&act=edit&show='.$aReturn['map_name']); $sReturn = ''; } else { new GlobalMessage('ERROR', $this->CORE->getLang()->getText('The map could not be created.')); @@ -137,7 +142,7 @@ class CoreModMap extends CoreModule { // Return the data return Array( 'map_name' => $FHANDLER->get('map_name'), - 'allowed_users' => $FHANDLER->get('allowed_users'), + 'allowed_user' => $FHANDLER->get('allowed_users'), 'allowed_for_config' => $FHANDLER->get('allowed_for_config'), 'iconset' => $FHANDLER->get('map_iconset'), 'map_image' => $FHANDLER->get('map_image')); diff --git a/share/server/core/classes/GlobalMapCfg.php b/share/server/core/classes/GlobalMapCfg.php index aea8820..283d311 100644 --- a/share/server/core/classes/GlobalMapCfg.php +++ b/share/server/core/classes/GlobalMapCfg.php @@ -1264,7 +1264,7 @@ class GlobalMapCfg { public function createMapConfig() { // does file exist? if(!$this->checkMapConfigReadable(FALSE)) { - if($this->CORE->getMainCfg()->checkMapCfgFolderWriteable(TRUE)) { + if($this->checkMapCfgFolderWriteable(TRUE)) { // create empty file $fp = fopen($this->configFile, 'w'); fclose($fp); @@ -1703,6 +1703,24 @@ class GlobalMapCfg { } /** + * Checks for writeable MapCfgFolder + * + * @param Boolean $printErr + * @return Boolean Is Successful? + * @author Lars Michelsen <[email protected]> + */ + function checkMapCfgFolderWriteable($printErr) { + if(file_exists(substr($this->CORE->getMainCfg()->getValue('paths', 'mapcfg'),0,-1)) && is_writable(substr($this->CORE->getMainCfg()->getValue('paths', 'mapcfg'),0,-1))) { + return TRUE; + } else { + if($printErr == 1) { + new GlobalMessage('ERROR', $this->CORE->getLang()->getText('mapCfgDirNotWriteable', Array('MAPPATH' => $this->CORE->getMainCfg()->getValue('paths', 'mapcfg'))), $this->CORE->getMainCfg()->getValue('paths','htmlbase')); + } + return FALSE; + } + } + + /** * Deletes an element of the specified type from the config array * * @param String $type diff --git a/share/frontend/wui/classes/WuiMapCfg.php b/share/server/core/classes/WuiMapCfg.php similarity index 100% rename from share/frontend/wui/classes/WuiMapCfg.php rename to share/server/core/classes/WuiMapCfg.php ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
