loadProfile($ps_profile_name, $ps_profile_dirpath); } # ------------------------------------------------------------------------------------------------ public function loadProfile($ps_profile_name, $ps_profile_dirpath) { $this->opa_profile_list = array(); do { $o_profile = Configuration::load($ps_profile_dirpath.'/'.$ps_profile_name.'.profile'); array_push($this->opa_profile_list, $o_profile); $ps_profile_name = $o_profile->get('profile_base'); } while($ps_profile_name); $this->opa_profile_list = array_reverse($this->opa_profile_list); return true; } # ------------------------------------------------------------------------------------------------ public function getLocales() { return $this->_mergeAssocValues('locales'); } # ------------------------------------------------------------------------------------------------ public function getLists() { return $this->_mergeAssocValues('lists'); } # ------------------------------------------------------------------------------------------------ public function getMetadataElementSets() { return $this->_mergeAssocValues('element_sets'); } # ------------------------------------------------------------------------------------------------ public function getUIs() { return $this->_mergeAssocValues('uis'); } # ------------------------------------------------------------------------------------------------ public function getRelationshipTypes() { return $this->_mergeAssocValues('relationship_types'); } # ------------------------------------------------------------------------------------------------ public function getRoles() { return $this->_mergeAssocValues('roles'); } # ------------------------------------------------------------------------------------------------ public function getGroups() { return $this->_mergeAssocValues('groups'); } # ------------------------------------------------------------------------------------------------ public function getBundleDisplays() { return $this->_mergeAssocValues('bundle_displays'); } # ------------------------------------------------------------------------------------------------ public function getBundleMappings() { return $this->_mergeAssocValues('bundle_mappings'); } # ------------------------------------------------------------------------------------------------ public function profileIsLoaded() { return sizeof($this->opa_profile_list) ? true : false; } # ------------------------------------------------------------------------------------------------ private function _mergeAssocValues($ps_key) { $va_value = array(); foreach($this->opa_profile_list as $o_profile) { if (is_array($va_value_to_merge = $o_profile->getAssoc($ps_key))) { $va_value = array_merge($va_value, $va_value_to_merge); } } return $va_value; } # ------------------------------------------------------------------------------------------------ } ?>