Stud.IP
5.4
|
Public Member Functions | |
__construct () | |
getCourses () | |
countCourses () | |
fetchCourses (?int $limit=null) | |
getCoursesForAdminWidget (string $order_by='name') | |
Static Public Member Functions | |
static | get ($reset_settings=false) |
Data Fields | |
$query = null | |
$max_show_courses = 500 | |
$settings = [] | |
Protected Member Functions | |
initSettings () | |
Static Protected Attributes | |
static | $instance = null |
Class AdminCourseFilter
The main class to filter all courses for admins. It's a singleton class, so you better call it with AdminCourseFilter::get(). The whole class is created to provide a nice hook for plugins to add special filters into the admin-area of Stud.IP.
To add a filter with a plugin, listen to the notification "AdminCourseFilterWillQuery" like this:
NotificationCenter::addObserver($this, "addMyFilter", "AdminCourseFilterWillQuery");
Where $this is an object and "addMyFilter" a method. Such a method might look like this:
public function addLectureshipFilter($event, $filter) { if ($GLOBALS['user']->cfg->getValue("LECTURESHIP_FILTER")) { $filter->query->join('lehrauftrag', 'seminare.Seminar_id = lehrauftrag.seminar_id'); } }
Within this method you alter the public $filter->query object. That query object is of type SQLQuery.
__construct | ( | ) |
Constructor of the singleton-object.
countCourses | ( | ) |
fetchCourses | ( | ?int | $limit = null | ) |
int | null | $limit |
|
static |
returns an AdminCourseFilter singleton object
getCourses | ( | ) |
Returns the data of the resultset of the AdminCourseFilter. Also saves the settings in the session. Note that a notification AdminCourseFilterWillQuery will be posted, before the result is computed. Plugins may register at this event to fully alter this AdminCourseFilter-object and so the resultset.
getCoursesForAdminWidget | ( | string | $order_by = 'name' | ) |
Returns the data of the resultset of the AdminCourseFilter.
string | $order_by | possible values name or number |
Note that a notification AdminCourseFilterWillQuery will be posted, before the result is computed. Plugins may register at this event to fully alter this AdminCourseFilter-object and so the resultset.
|
protected |
|
staticprotected |
$max_show_courses = 500 |
$query = null |
$settings = [] |