Logo Search packages:      
Sourcecode: nagvis version File versions  Download package

WuiMap::loadPermissions (  ) 

Loads and parses permissions of alle maps in js array

Author:
Lars Michelsen <lars@vertical-visions.de>

Definition at line 42 of file WuiMap.php.

References getMaps().

Referenced by WuiMap().

                                 {
            if (DEBUG&&DEBUGLEVEL&1) debug('Start method WuiMap::LoadPermissions()');
            $mapOptions = '[ ';
            $a = 0;
            foreach($this->getMaps() AS $map) {
                  if($a > 0) {
                        $mapOptions .= ', ';    
                  }
                  
                  $MAPCFG1 = new WuiMapCfg($this->MAINCFG,$map);
                  $MAPCFG1->readMapConfig(0);
                  $mapOptions .= '{ mapName:\''.$map.'\'';
                  
                  // map alias
                  $mapOptions .= ', mapAlias:\''.$MAPCFG1->getValue('global', '0', 'alias').'\'';
                  
                  // used image
                  $mapOptions .= ', mapImage:\''.$MAPCFG1->getValue('global', '0', 'map_image').'\'';
                  
                  // permited users for writing
                  $mapOptions .= ', allowedForConfig:[ ';
                  $arr = $MAPCFG1->getValue('global', '0', 'allowed_for_config');
                  for($i = 0; count($arr) > $i; $i++) {
                        if($i > 0) {
                              $mapOptions .= ',';     
                        }
                        $mapOptions .= '\''.$arr[$i].'\' ';
                  }
                  $mapOptions .= ' ]';
                  
                  // permited users for viewing the map
                  $mapOptions .= ', allowedUsers:[ ';
                  $arr = $MAPCFG1->getValue('global', '0', 'allowed_user');
                  for($i = 0; count($arr) > $i; $i++) {
                        if($i > 0) {
                              $mapOptions .= ',';     
                        }
                        $mapOptions .= '\''.$arr[$i].'\' ';
                  }
                  $mapOptions .= ' ]';
                  
                  // linked maps
                  $mapOptions .= ', linkedMaps:[ ';
                  $i = 0;
                  foreach($MAPCFG1->getDefinitions('map') AS $key => $obj) {
                        if($i > 0) {
                              $mapOptions .= ',';
                        }
                        $mapOptions .= '\''.$obj['map_name'].'\' ';
                        $i++;
                  }
                  $mapOptions .= ' ]';

                  // used shapes
                  $mapOptions .= ', usedShapes:[ ';
                  $i = 0;
                  foreach($MAPCFG1->getDefinitions('shape') AS $key => $obj) {
                        if($i > 0) {
                              $mapOptions .= ',';
                        }
                        $mapOptions .= '\''.$obj['icon'].'\' ';
                        $i++;
                  }
                  $mapOptions .= ' ]';
                  
                  $mapOptions .= ' }';
                  $a++;
            }
            $mapOptions .= ' ]';
            $this->MAINCFG->setRuntimeValue('mapOptions',$mapOptions);
            if (DEBUG&&DEBUGLEVEL&1) debug('End method WuiMap::LoadPermissions()');
      }


Generated by  Doxygen 1.6.0   Back to index