src/ArchiveAdmin.php
public function getManagedModelTabs()
    {
        $forms = ArrayList::create();
        $mainModels = $this->getVersionedModels('main', true);

        foreach ($mainModels as $class => $title) {
            $classInst = Injector::inst()->get($class);
            if (ClassInfo::hasMethod($classInst, 'isArchiveFieldEnabled')
                && $classInst->isArchiveFieldEnabled()
            ) {
                $forms->push(ArrayData::create([
                    'Title' => $title,
                    'ClassName' => $class,
                    'Link' => $this->Link($this->sanitiseClassName($class)),
                    'LinkOrCurrent' => ($class === $this->modelClass) ? 'current' : 'link'
                ]));
            }
        }

        $otherModels = $this->getVersionedModels('other', true);
        if ($otherModels) {
            $isOtherActive = (
                $this->request->getVar('others') !== null ||
                array_key_exists($this->modelClass, $otherModels)
            );
            $forms->push(ArrayData::create([
                'Title' => _t(__CLASS__ . '.TAB_OTHERS', 'Others'),
                'ClassName' => 'Others',
                'Link' => $this->Link('?others=1'),
                'LinkOrCurrent' => ($isOtherActive ? 'current' : 'link')
            ]));
        }

        $forms->first()->LinkOrCurrent = 'link';

        return $forms;
    }
public function getManagedModelTabs()
    {
        $forms = ArrayList::create();
        $mainModels = $this->getVersionedModels('main', true);

        foreach ($mainModels as $class => $title) {
            $classInst = Injector::inst()->get($class);
            if (ClassInfo::hasMethod($classInst, 'isArchiveFieldEnabled')
                && $classInst->isArchiveFieldEnabled()
            ) {
                $forms->push(ArrayData::create([
                    'Title' => $title,
                    'ClassName' => $class,
                    'Link' => $this->Link($this->sanitiseClassName($class)),
                    'LinkOrCurrent' => ($class === $this->modelClass) ? 'current' : 'link'
                ]));
            }
        }

        $otherModels = $this->getVersionedModels('other', true);
        if ($otherModels) {
            $isOtherActive = (
                $this->request->getVar('others') !== null ||
                array_key_exists($this->modelClass, $otherModels)
            );
            $forms->push(ArrayData::create([
                'Title' => _t(__CLASS__ . '.TAB_OTHERS', 'Others'),
                'ClassName' => 'Others',
                'Link' => $this->Link('?others=1'),
                'LinkOrCurrent' => ($isOtherActive ? 'current' : 'link')
            ]));
        }

        $forms->first()->LinkOrCurrent = 'link';

        return $forms;
    }
public function getManagedModelTabs ( ) { $ forms = ArrayList :: create ( ) ; $ mainModels = $ this -> getVersionedModels ( 'main' , true ) ; foreach ( $ mainModels as $ class => $ title ) { $ classInst = Injector :: inst ( ) -> get ( $ class ) ; if ( ClassInfo :: hasMethod ( $ classInst , 'isArchiveFieldEnabled' ) && $ classInst -> isArchiveFieldEnabled ( ) ) { $ forms -> push ( ArrayData :: create ( [ 'Title' => $ title , 'ClassName' => $ class , 'Link' => $ this -> Link ( $ this -> sanitiseClassName ( $ class ) ) , 'LinkOrCurrent' => ( $ class === $ this -> modelClass ) ? 'current' : 'link' ] ) ) ; } } $ otherModels = $ this -> getVersionedModels ( 'other' , true ) ; if ( $ otherModels ) { $ isOtherActive = ( $ this -> request -> getVar ( 'others' ) !== null || array_key_exists ( $ this -> modelClass , $ otherModels ) ) ; $ forms -> push ( ArrayData :: create ( [ 'Title' => _t ( __CLASS__ . '.TAB_OTHERS' , 'Others' ) , 'ClassName' => 'Others' , 'Link' => $ this -> Link ( '?others=1' ) , 'LinkOrCurrent' => ( $ isOtherActive ? 'current' : 'link' ) ] ) ) ; } $ forms -> first ( ) -> LinkOrCurrent = 'link' ; return $ forms ; }
Add the special 'Others' tab

@return ArrayList An ArrayList of all managed models to build the tabs for this ModelAdmin
Add the special Others tab