_sModule = 'bx_courses'; $this->_oModule = BxDolModule::getInstance($this->_sModule); parent::__construct($aInfo, $oTemplate); $this->_iParentId = 0; $this->_iLevel = 0; $this->_iLevelMax = $this->_oModule->_oConfig->getContentLevelMax(); $this->_aLevelMaxInputs = ['text', 'passing']; if(isset($this->aInputs['passing'])) $this->aInputs['passing']['values'] = [ ['key' => BX_COURSES_CND_PASSING_ALL, 'value' => _t('_bx_courses_form_content_node_input_passing_all')], ['key' => BX_COURSES_CND_PASSING_ALTERNATE, 'value' => _t('_bx_courses_form_content_node_input_passing_alternate')] ]; } public function setData($iParentId, $iLevel = 0) { $this->_iParentId = $iParentId; if(!$iLevel) { $aParent = $this->_oModule->_oDb->getContentStructure([ 'sample' => 'node_id', 'node_id' => $this->_iParentId ]); $iLevel = $this->_oModule->getNodeLevelByParent($aParent); } $this->_iLevel = $iLevel; } public function initChecker($aValues = [], $aSpecificValues = []) { if($this->_iLevel != $this->_iLevelMax) $this->aInputs = array_diff_key($this->aInputs, array_flip($this->_aLevelMaxInputs)); parent::initChecker ($aValues, $aSpecificValues); } } /** @} */