have_perm(Config::get()->SEM_VISIBILITY_PERM)) { $condition .= " AND s.`visible` = 1"; } if ($sem_class) { $condition .= " AND s.`status` IN (:types)"; $parameters['types'] = array_map( function ($type) { return $type['id']; }, array_filter( SemType::getTypes(), function ($t) use ($sem_class) { return $t['class'] === $sem_class; } ) ); } if ($searchterm) { $condition .= " AND s.`Name` LIKE :searchterm"; $parameters['searchterm'] = '%' . trim($searchterm) . '%'; } if ($courses) { $condition .= " AND {$alias}.`seminar_id` IN (:courses)"; $parameters['courses'] = $courses; } if (Config::get()->IMPORTANT_SEMNUMBER) { $order_by[] = 's.`VeranstaltungsNummer`'; } $order_by[] = 's.`Name`'; return [$condition, $parameters, $order_by]; } }