mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-07-01 08:59:37 +02:00
Improved subsite-admin search to support unit testing
This commit is contained in:
parent
5e9b67216f
commit
b64b14554c
|
@ -21,15 +21,14 @@ class SubsiteAdmin extends GenericDataAdmin {
|
||||||
return $this->getLink();
|
return $this->getLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
function Results() {
|
function Results($data, $form) {
|
||||||
$where = '';
|
$where = '';
|
||||||
|
if(isset($data['Name']) && $data['Name']) {
|
||||||
if(isset($_REQUEST['action_getResults']) && $_REQUEST['action_getResults']) {
|
$SQL_name = Convert::raw2sql($data['Name']);
|
||||||
$SQL_name = Convert::raw2sql($_REQUEST['Name']);
|
|
||||||
$where = "`Title` LIKE '%$SQL_name%'";
|
$where = "`Title` LIKE '%$SQL_name%'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$intranets = DataObject::get('Intranet', $where);
|
$intranets = DataObject::get('Subsite', $where);
|
||||||
if(!$intranets)
|
if(!$intranets)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user