Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/units/helpers/sections_helper.php
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | |||||
if ( !defined('IS_INSTALL') || !IS_INSTALL ) { | if ( !defined('IS_INSTALL') || !IS_INSTALL ) { | ||||
// don't reread all configs during install, because they are reread on every install step | // don't reread all configs during install, because they are reread on every install step | ||||
$this->Application->UnitConfigReader->ReReadConfigs(); | $this->Application->UnitConfigReader->ReReadConfigs(); | ||||
} | } | ||||
$this->Tree = Array (); | $this->Tree = Array (); | ||||
// 1. build base tree (don't update parent with children list yet) | // 1. build base tree (don't update parent with children list yet) | ||||
foreach ( $this->Application->UnitConfigReader->getUnitConfigsWithoutPriority() as $prefix ) { | |||||
// 1.1. process prefixes without priority | |||||
$prioritized_prefixes = Array (); | |||||
$prefixes = $this->Application->UnitConfigReader->getPrefixes(); | |||||
foreach ($prefixes as $prefix) { | |||||
$config = $this->Application->getUnitConfig($prefix); | |||||
if ( $config->getConfigPriority() !== false ) { | |||||
$prioritized_prefixes[$prefix] = $config->getConfigPriority(); | |||||
continue; | |||||
} | |||||
$this->_processPrefixSections($prefix); | $this->_processPrefixSections($prefix); | ||||
} | } | ||||
// 2. process prefixes with priority | foreach ( $this->Application->UnitConfigReader->getUnitConfigsWithPriority() as $prefix ) { | ||||
asort($prioritized_prefixes); | |||||
foreach ($prioritized_prefixes as $prefix => $priority) { | |||||
$this->_processPrefixSections($prefix); | $this->_processPrefixSections($prefix); | ||||
} | } | ||||
// 2. apply section adjustments | // 2. apply section adjustments | ||||
foreach ($prefixes as $prefix) { | foreach ( $this->Application->UnitConfigReader->getPrefixes() as $prefix ) { | ||||
$config = $this->Application->getUnitConfig($prefix); | $config = $this->Application->getUnitConfig($prefix); | ||||
$section_adjustments = $config->getSectionAdjustments(); | $section_adjustments = $config->getSectionAdjustments(); | ||||
if ( !$section_adjustments ) { | if ( !$section_adjustments ) { | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | |||||
if ($section_data && isset($section_data['perm_prefix'])) { | if ($section_data && isset($section_data['perm_prefix'])) { | ||||
// this section uses other section permissions | // this section uses other section permissions | ||||
$ret = $this->Application->getUnitConfig($section_data['perm_prefix'])->getPermSectionByName('main'); | $ret = $this->Application->getUnitConfig($section_data['perm_prefix'])->getPermSectionByName('main'); | ||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |