src/Admin/MultisitesModelAdminExtension.php
public function updateSearchForm($form){
		if($this->modelIsMultiSitesAware()) {
			$managedSites = Multisites::inst()->sitesManagedByMember();

			$source = Site::get()->filter('ID', Multisites::inst()->sitesManagedByMember())->map('ID', 'Title')->toArray();
			$plural = singleton($this->owner->modelClass)->plural_name();
			if(count($source)){
				$activeSite = $this->getActiveSite();
				$form->Fields()->push(DropdownField::create(
					'SiteID', 
					"Site: ", 
					$source,
					$activeSite ? $activeSite->ID : null
				));
			}
		}
	}
public function updateSearchForm($form){
		if($this->modelIsMultiSitesAware()) {
			$managedSites = Multisites::inst()->sitesManagedByMember();

			$source = Site::get()->filter('ID', Multisites::inst()->sitesManagedByMember())->map('ID', 'Title')->toArray();
			$plural = singleton($this->owner->modelClass)->plural_name();
			if(count($source)){
				$activeSite = $this->getActiveSite();
				$form->Fields()->push(DropdownField::create(
					'SiteID', 
					"Site: ", 
					$source,
					$activeSite ? $activeSite->ID : null
				));
			}
		}
	}
public function updateSearchForm ( $ form ) { if ( $ this -> modelIsMultiSitesAware ( ) ) { $ managedSites = Multisites :: inst ( ) -> sitesManagedByMember ( ) ; $ source = Site :: get ( ) -> filter ( 'ID' , Multisites :: inst ( ) -> sitesManagedByMember ( ) ) -> map ( 'ID' , 'Title' ) -> toArray ( ) ; $ plural = singleton ( $ this -> owner -> modelClass ) -> plural_name ( ) ; if ( count ( $ source ) ) { $ activeSite = $ this -> getActiveSite ( ) ; $ form -> Fields ( ) -> push ( DropdownField :: create ( 'SiteID' , "Site: " , $ source , $ activeSite ? $ activeSite -> ID : null ) ) ; } } }
Provide a Site filter
Provide a Site filter