ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLicenseOverviewGUI Class Reference
+ Collaboration diagram for ilLicenseOverviewGUI:

Public Member Functions

 ilLicenseOverviewGUI (&$a_parent_gui, $a_mode=LIC_MODE_REPOSITORY)
 Constructor public. More...
 
executeCommand ()
 Execute a command (main entry point) public. More...
 
 showLicenses ()
 Show the license list public. More...
 
 getItemHTML ($item=array())
 get the html code for the list items More...
 
getItemListGUI ($a_type)
 get item list gui class for type More...
 

Detailed Description

Definition at line 20 of file class.ilLicenseOverviewGUI.php.

Member Function Documentation

◆ executeCommand()

& ilLicenseOverviewGUI::executeCommand ( )

Execute a command (main entry point) public.

Definition at line 42 of file class.ilLicenseOverviewGUI.php.

References $cmd, and $ilErr.

43  {
44  global $rbacsystem, $ilErr;
45 
46  // access to all functions in this class are only allowed if read is granted
47  if (!$rbacsystem->checkAccess("read",$this->parent_gui->object->getRefId()))
48  {
49  $ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->MESSAGE);
50  }
51 
52  $cmd = $this->ctrl->getCmd("showLicenses");
53  $this->$cmd();
54 
55  return true;
56  }
$cmd
Definition: sahs_server.php:35

◆ getItemHTML()

ilLicenseOverviewGUI::getItemHTML (   $item = array())

get the html code for the list items

Definition at line 111 of file class.ilLicenseOverviewGUI.php.

References getItemListGUI().

Referenced by showLicenses().

112  {
113  $item_list_gui =& $this->getItemListGUI($item["type"]);
114  $item_list_gui->enableCommands(true);
115  $item_list_gui->enableDelete(false);
116  $item_list_gui->enableCut(false);
117  $item_list_gui->enableCopy(false);
118  $item_list_gui->enablePayment(false);
119  $item_list_gui->enableLink(false);
120  $item_list_gui->enableProperties(false);
121  $item_list_gui->enableDescription(false);
122  $item_list_gui->enablePreconditions(false);
123  $item_list_gui->enableSubscribe(false);
124  $item_list_gui->enableInfoScreen(false);
125 
126  return $item_list_gui->getListItemHTML($item["ref_id"],
127  $item["obj_id"], $item["title"], $item["description"]);
128  }
& getItemListGUI($a_type)
get item list gui class for type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemListGUI()

& ilLicenseOverviewGUI::getItemListGUI (   $a_type)

get item list gui class for type

Definition at line 133 of file class.ilLicenseOverviewGUI.php.

References $location.

Referenced by getItemHTML().

134  {
135  global $objDefinition;
136  if (!is_object($this->item_list_guis[$a_type]))
137  {
138  $class = $objDefinition->getClassName($a_type);
139  $location = $objDefinition->getLocation($a_type);
140  $full_class = "ilObj".$class."ListGUI";
141  include_once($location."/class.".$full_class.".php");
142  $item_list_gui = new $full_class();
143  $this->item_list_guis[$a_type] =& $item_list_gui;
144  }
145  else
146  {
147  $item_list_gui =& $this->item_list_guis[$a_type];
148  }
149  return $item_list_gui;
150  }
$location
Definition: buildRTE.php:44
+ Here is the caller graph for this function:

◆ ilLicenseOverviewGUI()

ilLicenseOverviewGUI::ilLicenseOverviewGUI ( $a_parent_gui,
  $a_mode = LIC_MODE_REPOSITORY 
)

Constructor public.

Definition at line 26 of file class.ilLicenseOverviewGUI.php.

References $ilCtrl, $lng, and $tpl.

27  {
28  global $ilCtrl, $tpl, $lng;
29 
30  $this->mode = $a_mode;
31  $this->ctrl =& $ilCtrl;
32  $this->tpl =& $tpl;
33  $this->lng =& $lng;
34  $this->lng->loadLanguageModule("license");
35  $this->parent_gui =& $a_parent_gui;
36  }
global $ilCtrl
Definition: ilias.php:18
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40

◆ showLicenses()

ilLicenseOverviewGUI::showLicenses ( )

Show the license list public.

Definition at line 62 of file class.ilLicenseOverviewGUI.php.

References $data, ilLicense\_getLicensedChildObjects(), ilLicense\_getLicensedObjects(), getItemHTML(), and LIC_MODE_ADMINISTRATION.

63  {
64  include_once './Services/Table/classes/class.ilTableGUI.php';
65 
66  if ($this->mode == LIC_MODE_ADMINISTRATION)
67  {
68  $objects = ilLicense::_getLicensedObjects();
69  }
70  else
71  {
72  $objects = ilLicense::_getLicensedChildObjects($this->parent_gui->object->getRefId());
73  }
74 
75  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.lic_show_licenses.html',"Services/License");
76 
77  foreach ($objects as $data)
78  {
79  $license =& new ilLicense($data["obj_id"]);
80  $licenses = strval($license->getLicenses());
81  $remarks = $license->getRemarks();
82  $used_licenses = strval($license->getAccesses());
83  $remaining_licenses = $licenses == "0" ? $this->lng->txt("arbitrary") : strval($license->getRemainingLicenses());
84  $potential_accesses = strval($license->getPotentialAccesses());
85 
86  $this->tpl->setCurrentBlock("table_row");
87  $this->tpl->setVariable("TITLE", $this->getItemHTML($data));
88  $this->tpl->setVariable("REMARKS", $remarks);
89  $this->tpl->setVariable("LICENSES", $licenses);
90  $this->tpl->setVariable("USED_LICENSES", $used_licenses);
91  $this->tpl->setVariable("REMAINING_LICENSES", $remaining_licenses);
92  $this->tpl->setVariable("POTENTIAL_ACCESSES", $potential_accesses);
93  $this->tpl->parseCurrentBlock();
94  }
95 
96  $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
97  $this->tpl->setVariable("TXT_REMARKS", $this->lng->txt("comment"));
98  $this->tpl->setVariable("TXT_EXISTING_LICENSES", $this->lng->txt("existing_licenses"));
99  $this->tpl->setVariable("TXT_USED_LICENSES", $this->lng->txt("used_licenses"));
100  $this->tpl->setVariable("TXT_REMAINING_LICENSES", $this->lng->txt("remaining_licenses"));
101  $this->tpl->setVariable("TXT_POTENTIAL_ACCESSES", $this->lng->txt("potential_accesses"));
102  $this->tpl->setVariable("TXT_USED_LICENSES_EXPLANATION", $this->lng->txt("used_licenses_explanation"));
103  $this->tpl->setVariable("TXT_REMAINING_LICENSES_EXPLANATION", $this->lng->txt("remaining_licenses_explanation"));
104  $this->tpl->setVariable("TXT_POTENTIAL_ACCESSES_EXPLANATION", $this->lng->txt("potential_accesses_explanation"));
105  }
getItemHTML($item=array())
get the html code for the list items
_getLicensedObjects()
Get a list of all objects with activated licensing.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
_getLicensedChildObjects($a_ref_id)
Get a list of all sub objects with activated licensing.
const LIC_MODE_ADMINISTRATION
+ Here is the call graph for this function:

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