Show
Ignore:
Timestamp:
02/04/10 13:22:09 (3 years ago)
Author:
gbastien
Message:

* Bug fix: when creating new nodes and node groups, they are now automatically added as children of the network in the new hierarchy structure.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/HotspotGraphElement.php

    r1436 r1444  
    116116     * @access public 
    117117     */ 
    118     public static function createNewObject($element_id, $element_type) 
     118    public static function createNewObject($element_id, $element_type, $parent_element = null) 
    119119    { 
    120120        $db = AbstractDb::getObject(); 
     
    130130        } 
    131131        $object = self::getObject($element_id, $element_type); 
     132         
     133        if (!is_null($parent_element)) { 
     134            if (method_exists($parent_element, 'getHgeId')) { 
     135                $parentid = $parent_element->getHgeId(); 
     136                $childid = $object->getHgeId(); 
     137                HotspotGraph::addRelation($parentid, $childid); 
     138            } 
     139        } 
     140         
    132141        return $object; 
    133142    }