/** * find objects matching the given string */ function find_objects($type, $string, $action_name = null) { switch ($type) { case 'course': return StudipLog::searchSeminar(addslashes($string)); case 'institute': return StudipLog::searchInstitute(addslashes($string)); case 'user': return StudipLog::searchUser(addslashes($string)); case 'resource': return StudipLog::searchResource(addslashes($string)); case 'other': return StudipLog::searchObjectByAction($string, $action_name); } return NULL; }