lib/components/types/Module.php
public function getSection($parentWidget = null, $settings = [])
    {
        $name = $this->systemId;
        $parent = false;
        $child = false;
        if (isset($settings['relationship']) && isset($settings['queryRole'])) {
            if ($settings['relationship']->companionRole($settings['queryRole']) === 'parent') {
                $parent = $settings['relationship']->parent;
            } else {
                $child = $settings['relationship']->child;
            }
        }
        if (($parent && $parent->systemId === $this->systemId) || ($child && $child->systemId === $this->systemId)) {
            $sectionId = $settings['relationship']->systemId . '-' . $this->systemId;
            $section = Yii::$app->collectors['sections']->getOne($sectionId);
            $section->title = '%%relationship%% %%type.' . $this->systemId . '.title.upperPlural%%';
            $section->icon = $this->icon;
            $section->systemId = $sectionId;
            if (empty($section->object)) {
                $sectionConfig = ['class' => $this->sectionSingleWidgetClass, 'section' => $section];
                $section->priority = $this->priority + 10000;
                $section->object = Yii::createObject($sectionConfig);
            }

            return $section;
        }
        $sectionClass = $this->sectionSingleWidgetClass;
        $sectionItemClass = $this->sectionItemClass;
        $newSectionTitle = '%%type.' . $this->systemId . '.title.upperPlural%%';
        $sectionId = $this->systemId;
        if (!is_null($this->sectionName)) {
            $sectionId = $sectionItemClass::generateSectionId($this->sectionName);
            if (Yii::$app->collectors['sections']->has($sectionId)) {
                return Yii::$app->collectors['sections']->getOne($sectionId);
            }
            $newSectionTitle = $this->sectionName;
            $sectionClass = $this->sectionWidgetClass;
        }
        $section = Yii::$app->collectors['sections']->getOne($sectionId);
        if (empty($section->object)) {
            $section->title = $newSectionTitle;
            $section->priority = $this->priority;
            $section->icon = $this->icon;
            $sectionConfig = ['class' => $sectionClass, 'section' => $section];
            $section->object = Yii::createObject($sectionConfig);
        }

        return $section;
    }
public function getSection($parentWidget = null, $settings = [])
    {
        $name = $this->systemId;
        $parent = false;
        $child = false;
        if (isset($settings['relationship']) && isset($settings['queryRole'])) {
            if ($settings['relationship']->companionRole($settings['queryRole']) === 'parent') {
                $parent = $settings['relationship']->parent;
            } else {
                $child = $settings['relationship']->child;
            }
        }
        if (($parent && $parent->systemId === $this->systemId) || ($child && $child->systemId === $this->systemId)) {
            $sectionId = $settings['relationship']->systemId . '-' . $this->systemId;
            $section = Yii::$app->collectors['sections']->getOne($sectionId);
            $section->title = '%%relationship%% %%type.' . $this->systemId . '.title.upperPlural%%';
            $section->icon = $this->icon;
            $section->systemId = $sectionId;
            if (empty($section->object)) {
                $sectionConfig = ['class' => $this->sectionSingleWidgetClass, 'section' => $section];
                $section->priority = $this->priority + 10000;
                $section->object = Yii::createObject($sectionConfig);
            }

            return $section;
        }
        $sectionClass = $this->sectionSingleWidgetClass;
        $sectionItemClass = $this->sectionItemClass;
        $newSectionTitle = '%%type.' . $this->systemId . '.title.upperPlural%%';
        $sectionId = $this->systemId;
        if (!is_null($this->sectionName)) {
            $sectionId = $sectionItemClass::generateSectionId($this->sectionName);
            if (Yii::$app->collectors['sections']->has($sectionId)) {
                return Yii::$app->collectors['sections']->getOne($sectionId);
            }
            $newSectionTitle = $this->sectionName;
            $sectionClass = $this->sectionWidgetClass;
        }
        $section = Yii::$app->collectors['sections']->getOne($sectionId);
        if (empty($section->object)) {
            $section->title = $newSectionTitle;
            $section->priority = $this->priority;
            $section->icon = $this->icon;
            $sectionConfig = ['class' => $sectionClass, 'section' => $section];
            $section->object = Yii::createObject($sectionConfig);
        }

        return $section;
    }
public function getSection ( $ parentWidget = null , $ settings = [ ] ) { $ name = $ this -> systemId ; $ parent = false ; $ child = false ; if ( isset ( $ settings [ 'relationship' ] ) && isset ( $ settings [ 'queryRole' ] ) ) { if ( $ settings [ 'relationship' ] -> companionRole ( $ settings [ 'queryRole' ] ) === 'parent' ) { $ parent = $ settings [ 'relationship' ] -> parent ; } else { $ child = $ settings [ 'relationship' ] -> child ; } } if ( ( $ parent && $ parent -> systemId === $ this -> systemId ) || ( $ child && $ child -> systemId === $ this -> systemId ) ) { $ sectionId = $ settings [ 'relationship' ] -> systemId . '-' . $ this -> systemId ; $ section = Yii :: $ app -> collectors [ 'sections' ] -> getOne ( $ sectionId ) ; $ section -> title = '%%relationship%% %%type.' . $ this -> systemId . '.title.upperPlural%%' ; $ section -> icon = $ this -> icon ; $ section -> systemId = $ sectionId ; if ( empty ( $ section -> object ) ) { $ sectionConfig = [ 'class' => $ this -> sectionSingleWidgetClass , 'section' => $ section ] ; $ section -> priority = $ this -> priority + 10000 ; $ section -> object = Yii :: createObject ( $ sectionConfig ) ; } return $ section ; } $ sectionClass = $ this -> sectionSingleWidgetClass ; $ sectionItemClass = $ this -> sectionItemClass ; $ newSectionTitle = '%%type.' . $ this -> systemId . '.title.upperPlural%%' ; $ sectionId = $ this -> systemId ; if ( ! is_null ( $ this -> sectionName ) ) { $ sectionId = $ sectionItemClass :: generateSectionId ( $ this -> sectionName ) ; if ( Yii :: $ app -> collectors [ 'sections' ] -> has ( $ sectionId ) ) { return Yii :: $ app -> collectors [ 'sections' ] -> getOne ( $ sectionId ) ; } $ newSectionTitle = $ this -> sectionName ; $ sectionClass = $ this -> sectionWidgetClass ; } $ section = Yii :: $ app -> collectors [ 'sections' ] -> getOne ( $ sectionId ) ; if ( empty ( $ section -> object ) ) { $ section -> title = $ newSectionTitle ; $ section -> priority = $ this -> priority ; $ section -> icon = $ this -> icon ; $ sectionConfig = [ 'class' => $ sectionClass , 'section' => $ section ] ; $ section -> object = Yii :: createObject ( $ sectionConfig ) ; } return $ section ; }
Get section.

@param [[@doctodo param_type:parentWidget]] $parentWidget [[@doctodo param_description:parentWidget]] [optional]
@param unknown                              $settings     (optional)

@return unknown
Get section .