models/ModulesManager.php
protected static function fixDynModulesCache($cache)
    {
        $result = [];
        foreach ($cache as $numMid => $info) {
            $expParentUid = $parentNumber = $info['parent_uid'];
            while (!empty($parentNumber)) {
                //if (preg_match('/\{\d+\}/', $parentNumber, $matches) == 0) break;
                //$idx = $matches[0];
                //if (empty($cache[$idx]['parent_uid'])) break;
                //else $parentNumber = $cache[$idx]['parent_uid'];

                if (empty($cache[$parentNumber]['parent_uid'])) break;
                else $parentNumber = $cache[$parentNumber]['parent_uid'];
                $expParentUid = $parentNumber . '/' . $expParentUid;
            }

            $cache[$numMid]['parent_uid_expanded'] = $expParentUid;
            $cache[$numMid]['module_uid_expanded'] = (empty($expParentUid) ? '' : ($expParentUid . '/')) . $numMid;
            $idx = static::fromnumberModuleUniqueId($cache[$numMid]['module_uid_expanded']);
            $result[$idx] = $cache[$numMid];
        }
        return $result;
    }
protected static function fixDynModulesCache($cache)
    {
        $result = [];
        foreach ($cache as $numMid => $info) {
            $expParentUid = $parentNumber = $info['parent_uid'];
            while (!empty($parentNumber)) {
                //if (preg_match('/\{\d+\}/', $parentNumber, $matches) == 0) break;
                //$idx = $matches[0];
                //if (empty($cache[$idx]['parent_uid'])) break;
                //else $parentNumber = $cache[$idx]['parent_uid'];

                if (empty($cache[$parentNumber]['parent_uid'])) break;
                else $parentNumber = $cache[$parentNumber]['parent_uid'];
                $expParentUid = $parentNumber . '/' . $expParentUid;
            }

            $cache[$numMid]['parent_uid_expanded'] = $expParentUid;
            $cache[$numMid]['module_uid_expanded'] = (empty($expParentUid) ? '' : ($expParentUid . '/')) . $numMid;
            $idx = static::fromnumberModuleUniqueId($cache[$numMid]['module_uid_expanded']);
            $result[$idx] = $cache[$numMid];
        }
        return $result;
    }
protected static function fixDynModulesCache ( $ cache ) { $ result = [ ] ; foreach ( $ cache as $ numMid => $ info ) { $ expParentUid = $ parentNumber = $ info [ 'parent_uid' ] ; while ( ! empty ( $ parentNumber ) ) { //if (preg_match('/\{\d+\}/', $parentNumber, $matches) == 0) break; //$idx = $matches[0]; //if (empty($cache[$idx]['parent_uid'])) break; //else $parentNumber = $cache[$idx]['parent_uid']; if ( empty ( $ cache [ $ parentNumber ] [ 'parent_uid' ] ) ) break ; else $ parentNumber = $ cache [ $ parentNumber ] [ 'parent_uid' ] ; $ expParentUid = $ parentNumber . '/' . $ expParentUid ; } $ cache [ $ numMid ] [ 'parent_uid_expanded' ] = $ expParentUid ; $ cache [ $ numMid ] [ 'module_uid_expanded' ] = ( empty ( $ expParentUid ) ? '' : ( $ expParentUid . '/' ) ) . $ numMid ; $ idx = static :: fromnumberModuleUniqueId ( $ cache [ $ numMid ] [ 'module_uid_expanded' ] ) ; $ result [ $ idx ] = $ cache [ $ numMid ] ; } return $ result ; }
Expand one-number module's uniqueId into chain
Expand one - number module s uniqueId into chain