ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExAssignmentTypesGUI Class Reference

Assignment types gui. More...

+ Collaboration diagram for ilExAssignmentTypesGUI:

Public Member Functions

 getById ($a_id)
 Get type gui object by id. More...
 
 getByClassName ($a_class_name)
 Get type gui object by classname. More...
 
 isExAssTypeGUIClass ($a_string)
 Checks if a class name is a valid exercise assignment type GUI class (case insensitive, since ilCtrl uses lower keys due to historic reasons) More...
 
 getIdForClassName ($a_string)
 Get type id for class name. More...
 

Static Public Member Functions

static getInstance ()
 Get instance. More...
 

Protected Member Functions

 __construct ()
 Constructor. More...
 

Protected Attributes

 $class_names
 

Detailed Description

Assignment types gui.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 11 of file class.ilExAssignmentTypesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentTypesGUI::__construct ( )
protected

Constructor.

Definition at line 25 of file class.ilExAssignmentTypesGUI.php.

26  {
27  }

Member Function Documentation

◆ getByClassName()

ilExAssignmentTypesGUI::getByClassName (   $a_class_name)

Get type gui object by classname.

Parameters

Definition at line 93 of file class.ilExAssignmentTypesGUI.php.

References $id, getById(), and getIdForClassName().

94  {
95  $id = $this->getIdForClassName($a_class_name);
96  return $this->getById($id);
97  }
if(!array_key_exists('StateId', $_REQUEST)) $id
getById($a_id)
Get type gui object by id.
getIdForClassName($a_string)
Get type id for class name.
+ Here is the call graph for this function:

◆ getById()

ilExAssignmentTypesGUI::getById (   $a_id)

Get type gui object by id.

Centralized ID management is still an issue to be tackled in the future and caused by initial consts definition.

Parameters
int$a_idtype id
Returns
ilExAssignmentTypeGUIInterface

Definition at line 48 of file class.ilExAssignmentTypesGUI.php.

References ilExAssignment\TYPE_BLOG, ilExAssignment\TYPE_PORTFOLIO, ilExAssignment\TYPE_TEXT, ilExAssignment\TYPE_UPLOAD, ilExAssignment\TYPE_UPLOAD_TEAM, and ilExAssignment\TYPE_WIKI_TEAM.

Referenced by getByClassName().

49  {
50  // @todo: check id
51 
52  switch ($a_id) {
54  include_once("./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssTypeUploadGUI.php");
55  return new ilExAssTypeUploadGUI();
56  break;
57 
59  include_once("./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssTypeBlogGUI.php");
60  return new ilExAssTypeBlogGUI();
61  break;
62 
64  include_once("./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssTypePortfolioGUI.php");
65  return new ilExAssTypePortfolioGUI();
66  break;
67 
69  include_once("./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssTypeUploadTeamGUI.php");
70  return new ilExAssTypeUploadTeamGUI();
71  break;
72 
74  include_once("./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssTypeTextGUI.php");
75  return new ilExAssTypeTextGUI();
76  break;
77 
79  include_once("./Modules/Exercise/AssignmentTypes/GUI/classes/class.ilExAssTypeWikiTeamGUI.php");
80  return new ilExAssTypeWikiTeamGUI();
81  break;
82  }
83 
84  // we should throw some exception here
85  }
Text type gui implementations.
Team upload type gui implementations.
Upload type gui implementations.
Blog type gui implementations.
Team wiki type gui implementations.
Portfolio type gui implementations.
+ Here is the caller graph for this function:

◆ getIdForClassName()

ilExAssignmentTypesGUI::getIdForClassName (   $a_string)

Get type id for class name.

Parameters
$a_string
Returns
null|int

Definition at line 123 of file class.ilExAssignmentTypesGUI.php.

Referenced by getByClassName().

124  {
125  foreach ($this->class_names as $k => $cn) {
126  if (strtolower($cn) == strtolower($a_string)) {
127  return $k;
128  }
129  }
130  return null;
131  }
+ Here is the caller graph for this function:

◆ getInstance()

static ilExAssignmentTypesGUI::getInstance ( )
static

Get instance.

Returns
ilExAssignmentTypesGUI

Definition at line 34 of file class.ilExAssignmentTypesGUI.php.

Referenced by ilExSubmissionBaseGUI\__construct(), ilExSubmissionGUI\__construct(), and ilExAssignmentEditorGUI\__construct().

35  {
36  return new self();
37  }
+ Here is the caller graph for this function:

◆ isExAssTypeGUIClass()

ilExAssignmentTypesGUI::isExAssTypeGUIClass (   $a_string)

Checks if a class name is a valid exercise assignment type GUI class (case insensitive, since ilCtrl uses lower keys due to historic reasons)

Parameters
string
Returns
bool

Definition at line 107 of file class.ilExAssignmentTypesGUI.php.

108  {
109  foreach ($this->class_names as $cn) {
110  if (strtolower($cn) == strtolower($a_string)) {
111  return true;
112  }
113  }
114  return false;
115  }

Field Documentation

◆ $class_names

ilExAssignmentTypesGUI::$class_names
protected
Initial value:
= array(
ilExAssignment::TYPE_UPLOAD => "ilExAssTypeUploadGUI",
ilExAssignment::TYPE_BLOG => "ilExAssTypeBlogGUI",
ilExAssignment::TYPE_PORTFOLIO => "ilExAssTypePortfolioGUI",
ilExAssignment::TYPE_UPLOAD_TEAM => "ilExAssTypeUploadTeamGUI",
ilExAssignment::TYPE_TEXT => "ilExAssTypeTextGUI",
ilExAssignment::TYPE_WIKI_TEAM => "ilExAssTypeWikiTeamGUI"
)

Definition at line 13 of file class.ilExAssignmentTypesGUI.php.


The documentation for this class was generated from the following file: