◆ __construct()
__construct |
( |
|
$course_id = NULL | ) |
|
This constructor can be called with or without a course ID. If a course ID has been sent, the selected areas are populated by that course's already chosen study areas. If no course ID is given, it is assumed that you are creating a new course at the moment.
- Parameters
-
string | optional; the ID of the course to prepopulate the form with |
- Returns
- void
◆ add()
This method adds an area to the selected study areas.
- Parameters
-
string | the MD5ish ID of the study area to add |
- Returns
- object this instance
◆ clearSearchResult()
Clears the current search result.
- Returns
- object this instance
◆ getAreaIDs()
Returns all the IDs of the selected study areas.
- Returns
- array an array of MD5ish strings representing the IDs of the selected study areas
◆ getAreas()
Returns all the selected study areas.
- Returns
- array an array of StudipStudyArea representing the selected study areas
◆ getSearchKey()
- Returns
- string the current search term
◆ getSearchResult()
Returns an array of search results. This result is memoized for performance though setting the search key anew clears the memo again.
- Returns
- array an array of search results
◆ getSelected()
- Returns
- object the currently selected study area
◆ getShowAll()
- Returns
- bool returns TRUE if the subtrees should be expanded completely or FALSE otherwise
◆ getTrail()
Returns the trail – the path from the root of the tree of study areas down to the currently selected area.
TODO (mlunzena) this has to be refactored as well
- Returns
- array an array of study areas; currently each item is an hashmap containing the ID of each area using the key 'id' and the name of the study area using the key 'name'
◆ includes()
- Parameters
-
mixed | the MD5ish ID of a study area or the area object itself |
- Returns
- bool returns TRUE if this area is selected, FALSE otherwise
◆ remove()
This method removes an area from the selected study areas.
- Parameters
-
string | the MD5ish ID of the study area to add |
- Returns
- object this instance
◆ searched()
- Returns
- bool returns TRUE if the search key was set meaning that we are currently searching; returns FALSE otherwise
◆ setAreas()
Sets the study areas of this selection. One can provide either MD5ish ID strings or instances of StudipStudyArea.
- Parameters
-
array | an array of either MD5ish ID strings or StudipStudyAreas |
- Returns
- object the called instance itself
◆ setSearchKey()
setSearchKey |
( |
|
$searchKey | ) |
|
- Parameters
-
- Returns
- object this instance
◆ setSelected()
- Parameters
-
mixed | either an MD5ish ID of the study area to select or the area object itself |
- Returns
- object this instance
◆ setShowAll()
- Parameters
-
bool | the new state of the expansion of subtrees |
- Returns
- object this instance
◆ size()
- Returns
- integer returns the number of the selected study areas
◆ sortSearchResult()
static sortSearchResult |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
|
static |
◆ toggleShowAll()
Toggles the state of the expansion of subtrees.
- Returns
- object this instance
The documentation for this class was generated from the following file: