19 declare(strict_types=1);
    40     public function __construct(
object $a_parent_obj, 
string $a_parent_cmd)
    44         $this->
access = $DIC->access();
    45         $this->rbacreview = $DIC->rbac()->review();
    46         $this->
setId(
"registration_code");
    51             if (
$c === 
"role_local" || 
$c === 
"alimit") {
    61         $this->
setRowTemplate(
"tpl.code_list_row.html", 
"components/ILIAS/Registration");
    72         if ($this->
access->checkAccess(
"write", 
'', $a_parent_obj->ref_id)) {
    96             (
string) $this->
filter[
"code"],
    97             (
int) $this->filter[
"role"],
    98             (
string) $this->filter[
"generated"],
    99             (
string) $this->filter[
"alimit"]
   102         if (count($codes_data[
"set"]) === 0 && $this->
getOffset() > 0) {
   109                 (
string) $this->filter[
"code"],
   110                 (
int) $this->filter[
"role"],
   111                 (
string) $this->filter[
"generated"],
   112                 (
string) $this->filter[
"alimit"]
   117         $this->role_map = [];
   118         foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
   125         foreach ($codes_data[
"set"] as $k => $code) {
   126             $result[$k][
"code"] = $code[
"code"];
   127             $result[$k][
"code_id"] = $code[
"code_id"];
   134                 $result[$k][
"used"] = 
"";
   138                 $result[$k][
"role"] = $this->role_map[$code[
"role"]] ?? $this->
lng->txt(
'deleted');
   140                 $result[$k][
"role"] = 
"";
   143             if ($code[
"role_local"]) {
   145                 foreach (explode(
";", $code[
"role_local"]) as $role_id) {
   153                     $result[$k][
"role_local"] = implode(
"<br />", $local);
   156                 $result[$k][
"role_local"] = 
"";
   159             if ($code[
"alimit"]) {
   160                 switch ($code[
"alimit"]) {
   162                         $result[$k][
"alimit"] = $this->
lng->txt(
"reg_access_limitation_none");
   166                         $result[$k][
"alimit"] = $this->
lng->txt(
"reg_access_limitation_mode_absolute_target") .
   172                         $limit = unserialize($code[
"alimitdt"], [
'allowed_classes' => 
false]);
   174                             $limit_caption[] = (
int) $limit[
"d"] . 
" " . $this->
lng->txt(
"days");
   176                         if ((
int) $limit[
"m"]) {
   177                             $limit_caption[] = (
int) $limit[
"m"] . 
" " . $this->
lng->txt(
"months");
   179                         if ((
int) $limit[
"y"]) {
   180                             $limit_caption[] = (
int) $limit[
"y"] . 
" " . $this->
lng->txt(
"years");
   182                         if (count($limit_caption)) {
   183                             $result[$k][
"alimit"] = $this->
lng->txt(
"reg_access_limitation_mode_relative_target") .
   184                                 ": " . implode(
", ", $limit_caption);
   204         $ti->setSubmitFormOnEnter(
true);
   206         $ti->readFromSession();
   207         $this->
filter[
"code"] = $ti->getValue();
   211         $this->role_map = [];
   212         foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
   218         $options = [
"" => $this->
lng->txt(
"registration_roles_all")] +
   223         $si->readFromSession();
   224         $this->
filter[
"role"] = $si->getValue();
   228             "" => $this->
lng->txt(
"registration_codes_access_limitation_all"),
   229             "unlimited" => $this->
lng->txt(
"reg_access_limitation_none"),
   230             "absolute" => $this->
lng->txt(
"reg_access_limitation_mode_absolute"),
   231             "relative" => $this->
lng->txt(
"reg_access_limitation_mode_relative")
   236         $si->readFromSession();
   237         $this->
filter[
"alimit"] = $si->getValue();
   240         $options = [
"" => $this->
lng->txt(
"registration_generated_all")];
   247         $si->readFromSession();
   248         $this->
filter[
"generated"] = $si->getValue();
   254             "code" => 
"registration_code",
   255             "role" => 
"registration_codes_roles",
   256             "role_local" => 
"registration_codes_roles_local",
   257             "alimit" => 
"reg_access_limitations",
   258             "generated" => 
"registration_generated",
   259             "used" => 
"registration_used"   263     protected function fillRow(array $a_set): void
   265         $this->tpl->setVariable(
"ID", $a_set[
"code_id"]);
   267             $this->tpl->setVariable(
"VAL_" . strtoupper($c), $a_set[$c] ?? 
"");
 
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
 
setTopCommands(bool $a_val)
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
 
setEnableTitle(bool $a_enabletitle)
 
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
setResetCommand(string $a_val, string $a_caption="")
 
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
static getGenerationDates()
 
sort()
 description: > Example for rendering a Sort Glyph. 
 
getItems()
Get user items. 
 
resetOffset(bool $a_in_determination=false)
 
setExternalSorting(bool $a_val)
 
static _lookupTitle(int $obj_id)
 
setDefaultOrderField(string $a_defaultorderfield)
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
setFilterCommand(string $a_val, string $a_caption="")
 
setDefaultOrderDirection(string $a_defaultorderdirection)
 
static getCodesData(string $order_field, string $order_direction, int $offset, int $limit, string $filter_code, int $filter_role, string $filter_generated, string $filter_access_limitation)
 
TableGUI class for registration codes. 
 
setOrderField(string $a_order_field)
 
__construct(Container $dic, ilPlugin $plugin)
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
 
addMultiCommand(string $a_cmd, string $a_text)
 
__construct(object $a_parent_obj, string $a_parent_cmd)
Constructor. 
 
determineOffsetAndOrder(bool $a_omit_offset=false)
 
setEnableHeader(bool $a_enableheader)
 
setMaxCount(int $a_max_count)
set max. 
 
setExternalSegmentation(bool $a_val)