src/Admin/MultisitesCmsMainExtension.php
public function updateSearchForm(Form $form) {
		$cms = $this->owner;
		$req = $cms->getRequest();

		$sites = Site::get()->sort(array(
			'IsDefault' => 'DESC',
			'Title'     => 'ASC'
		));

		$site = new DropdownField(
			'q[SiteID]',
			_t('Multisites.SITE', 'Site'),
			$sites->map(),
			isset($req['q']['SiteID']) ? $req['q']['SiteID'] : null
		);
		$site->setEmptyString(_t('Multisites.ALLSITES', 'All sites'));

		$form->Fields()->insertAfter($site, 'q[Term]');
	}
public function updateSearchForm(Form $form) {
		$cms = $this->owner;
		$req = $cms->getRequest();

		$sites = Site::get()->sort(array(
			'IsDefault' => 'DESC',
			'Title'     => 'ASC'
		));

		$site = new DropdownField(
			'q[SiteID]',
			_t('Multisites.SITE', 'Site'),
			$sites->map(),
			isset($req['q']['SiteID']) ? $req['q']['SiteID'] : null
		);
		$site->setEmptyString(_t('Multisites.ALLSITES', 'All sites'));

		$form->Fields()->insertAfter($site, 'q[Term]');
	}
public function updateSearchForm ( Form $ form ) { $ cms = $ this -> owner ; $ req = $ cms -> getRequest ( ) ; $ sites = Site :: get ( ) -> sort ( array ( 'IsDefault' => 'DESC' , 'Title' => 'ASC' ) ) ; $ site = new DropdownField ( 'q[SiteID]' , _t ( 'Multisites.SITE' , 'Site' ) , $ sites -> map ( ) , isset ( $ req [ 'q' ] [ 'SiteID' ] ) ? $ req [ 'q' ] [ 'SiteID' ] : null ) ; $ site -> setEmptyString ( _t ( 'Multisites.ALLSITES' , 'All sites' ) ) ; $ form -> Fields ( ) -> insertAfter ( $ site , 'q[Term]' ) ; }
Adds a dropdown field to the search form to filter searches by Site
Adds a dropdown field to the search form to filter searches by Site