| 
    Stud.IP
    trunk Revision
    
   | 
  


Public Member Functions | |
| __construct ($data) | |
| countSeminars () | |
| getSlotModule ($slot) | |
| setSlotModule ($slot, $module) | |
| getModuleMetadata ($modulename) | |
| setModules ($module_array) | |
| getModules () | |
| isModuleActivated ($modulename) | |
| isModuleAllowed ($modulename) | |
| isModuleMandatory ($module) | |
| isSlotMandatory ($slot) | |
| isSlotModule ($module) | |
| getModule ($slot_or_plugin) | |
| getNavigationForSlot ($slot, $course_id=null) | |
| 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) | 
| static | getSlots () | 
Protected Attributes | |
| $data = [] | |
Static Protected Attributes | |
| static | $slots | 
| static | $core_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 | 

| countSeminars | ( | ) | 
Returns the number of seminars of this sem_class in Stud.IP


| 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.

      
  | 
  static | 
Returns an array of all SemClasses in Stud.IP. Equivalent to global $SEM_CLASS variable. This variable is statically stored in this class.


      
  | 
  static | 
Generates a dummy SemClass for institutes of this type (as defined in config.inc.php).
| integer | $type | institute type | 

      
  | 
  static | 

      
  | 
  static | 
Checks if any SemClasses exist that provide grouping functionality.


| getModule | ( | $slot_or_plugin | ) | 
returns an instance of the module of a given slotname or pluginclassname
| string | $slot_or_plugin | 


| getModuleMetadata | ( | $modulename | ) | 
Returns the metadata of a module regarding this sem_class object.
| string | $modulename | 
| getModules | ( | ) | 
Returns all metadata of the modules at once.
| getNavigationForSlot | ( | $slot, | |
$course_id = null  | 
        |||
| ) | 
Returns an array of navigation-objects. Those are for the tabs. And yes, a slot can contain more than one tab, but usually contains only one. The keys of the array are the names within the navigation-tree.
| string | $slot | 

| getSemTypes | ( | ) | 

| getSlotModule | ( | $slot | ) | 
Returns the name of the module of the slot or the module itself, if it is a plugin.
| string | $slot | 

      
  | 
  static | 
Returns an array of all slot-names.

| 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 | 

| isModuleMandatory | ( | $module | ) | 
Returns if a module is mandatory for this sem_class.
| string | $module | 

| isSlotMandatory | ( | $slot | ) | 
Returns if the slot is mandatory, which it is if the module in this slot is mandatory.
| string | $slot | 

| isSlotModule | ( | $module | ) | 
Returns if a module is a slot module. Good for plugins that should be displayed on a specific place only if they are no slot modules.
| string | $module | 

      
  | 
  static | 
Static method to recursively transform an object into an associative array.
| mixed | $obj, | should be of class StdClass | 

| offsetExists | ( | $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)), ...) | 
| setSlotModule | ( | $slot, | |
| $module | |||
| ) | 
Defines a module for a slot and overwrites previous module.
| string | $slot | |
| string | $module | (coremodule or classname of plugin) | 
| store | ( | ) | 
stores all data in the database

      
  | 
  staticprotected | 
      
  | 
  protected | 
      
  | 
  staticprotected | 
      
  | 
  staticprotected |