Stud.IP
6.0
|
Public Member Functions | |
__construct ($data) | |
activateModuleInCourses ($module) | |
deActivateModuleInCourses ($module) | |
countSeminars () | |
isModuleForbidden ($modulename) | |
getModuleMetadata ($modulename) | |
setModules ($module_array) | |
getModules () | |
getModuleObjects () | |
getActivatedModules () | |
getActivatedModuleObjects () | |
getAdminModuleObject () | |
isModuleActivated ($modulename) | |
isModuleAllowed ($modulename) | |
isModuleMandatory ($module) | |
getSemTypes () | |
isGroup () | |
store () | |
delete () | |
set ($offset, $value) | |
offsetSet ($offset, $value) | |
offsetGet ($offset) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
Static Public Member Functions | |
static | getDefaultSemClass () |
static | getDefaultInstituteClass ($type) |
static | getGroupClasses () |
static | getClasses () |
static | refreshClasses () |
static | object2array ($obj) |
Protected Attributes | |
$data = [] | |
Static Protected Attributes | |
static | $studygroup_forbidden_modules |
static | $sem_classes = null |
Class to define and manage attributes of seminar classes (or seminar categories). Usually all sem-classes are stored in a global variable $SEM_CLASS which is an array of SemClass objects.
SemClass::getClasses() gets you all seminar classes in an array.
You can access the attributes of a sem-class like an associative array with $sem_class['default_read_level']. The uinderlying data is stored in the database in the table sem_classes.
If you want to have a name of a sem-class like "Lehre", please use $sem_class['name'] and you will get a fully localized name and not the pure database entry.
This class manages also which modules are contained in which course-slots, like "what module is used as a forum in my seminars". In the database stored is the name of the module like "CoreForum" or a classname of a plugin or null if the forum is completely disabled by root for this sem-class. Core-modules can only be used within a standard slot. Plugins may also be used as optional modules not contained in a slot.
In the field 'modules' in the database is for each modules stored in a json-string if the module is activatable by the teacher or not and if it is activated as a default. Please use the methods SemClass::isSlotModule, SemClass::getSlotModule, SemClass::isModuleAllowed, SemClass::isModuleMandatory, SemClass::isSlotMandatory or even more simple SemClass::getNavigationForSlot (see documentation there).
__construct | ( | $data | ) |
Constructor can be set with integer of sem_class_id or an array of the old $SEM_CLASS style.
integer | array | $data |
activateModuleInCourses | ( | $module | ) |
string | $module |
countSeminars | ( | ) |
Returns the number of seminars of this sem_class in Stud.IP
deActivateModuleInCourses | ( | $module | ) |
string | $module |
delete | ( | ) |
Deletes the sem_class-object and all its sem_types. Will only delete, if there are no seminars in this sem_class. Remember to refresh the global $SEM_CLASS and $SEM_TYPE array.
getActivatedModuleObjects | ( | ) |
getActivatedModules | ( | ) |
getAdminModuleObject | ( | ) |
|
static |
|
static |
|
static |
|
static |
Checks if any SemClasses exist that provide grouping functionality.
getModuleMetadata | ( | $modulename | ) |
Returns the metadata of a module regarding this sem_class object.
string | $modulename |
getModuleObjects | ( | ) |
getModules | ( | ) |
Returns all metadata of the modules at once.
getSemTypes | ( | ) |
isGroup | ( | ) |
Checks if the current sem class is usable for course grouping.
isModuleActivated | ( | $modulename | ) |
Returns true if a module is activated on default for this sem_class.
string | $modulename |
isModuleAllowed | ( | $modulename | ) |
Returns if a module is allowed to be displayed for this sem_class.
string | $modulename |
isModuleForbidden | ( | $modulename | ) |
string | $modulename |
isModuleMandatory | ( | $module | ) |
Returns if a module is mandatory for this sem_class.
string | $module |
|
static |
Static method to recursively transform an object into an associative array.
mixed | $obj, | should be of class StdClass |
offsetExists | ( | $offset | ) |
ArrayAccess method to check if an attribute exists.
int | $offset |
offsetGet | ( | $offset | ) |
Compatibility function with old $SEM_CLASS variable for plugins. Maps the new array-structure to the old boolean values.
integer | $offset, | name of attribute |
offsetSet | ( | $offset, | |
$value | |||
) |
deprecated, does nothing, should not be used
string | $offset | |
mixed | $value |
offsetUnset | ( | $offset | ) |
deprecated, does nothing, should not be used
string | $offset |
|
static |
Refreshes the internal $sem_classes cache-variable.
set | ( | $offset, | |
$value | |||
) |
Sets an attribute of sem_class->data
string | $offset | |
mixed | $value |
setModules | ( | $module_array | ) |
Sets the metadata for each module at once.
array | $module_array, | array($module_name => array('sticky' => (bool), 'activated' => (bool)), ...) |
store | ( | ) |
stores all data in the database
|
protected |
|
staticprotected |
|
staticprotected |