Improved subsite-admin search to support unit testing

This commit is contained in:
Sam Minnee 2007-08-17 05:49:19 +00:00
parent 5e9b67216f
commit b64b14554c

View File

@ -21,15 +21,14 @@ class SubsiteAdmin extends GenericDataAdmin {
return $this->getLink();
}
function Results() {
function Results($data, $form) {
$where = '';
if(isset($_REQUEST['action_getResults']) && $_REQUEST['action_getResults']) {
$SQL_name = Convert::raw2sql($_REQUEST['Name']);
if(isset($data['Name']) && $data['Name']) {
$SQL_name = Convert::raw2sql($data['Name']);
$where = "`Title` LIKE '%$SQL_name%'";
}
$intranets = DataObject::get('Intranet', $where);
$intranets = DataObject::get('Subsite', $where);
if(!$intranets)
return null;