ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExportLimitation Class Reference

Export limitation checker. More...

+ Collaboration diagram for ilExportLimitation:

Public Member Functions

 __construct ()
 
 getLimitationMode ()
 
 getLimitationNumber ()
 
 checkLimitation (int $ref_id, array $options)
 

Data Fields

const SET_EXPORT_DISABLED = 1
 
const SET_EXPORT_LIMITED = 0
 

Protected Attributes

const SET_LIMIT_NUMBER = "rep_export_limit_number"
 
const SET_LIMITATION = "rep_export_limitation"
 
ilTree $tree
 
ilSetting $settings
 
ilLanguage $lng
 

Detailed Description

Export limitation checker.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExportLimitation::__construct ( )

Definition at line 36 of file class.ilExportLimitation.php.

37 {
38 global $DIC;
39
40 $this->tree = $DIC->repositoryTree();
41 $this->settings = $DIC->settings();
42 $this->lng = $DIC->language();
43 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\lng(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkLimitation()

ilExportLimitation::checkLimitation ( int  $ref_id,
array  $options 
)

Definition at line 55 of file class.ilExportLimitation.php.

55 : void
56 {
57 $max = (int) $this->settings->get(self::SET_LIMIT_NUMBER);
58
61 $this->lng->txt("exp_error_disabled")
62 );
63 }
64
65 $cnt = 0;
66 foreach ($this->tree->getSubTree($root = $this->tree->getNodeData($ref_id)) as $node) {
67 if (isset($options[$node["child"]]) && (in_array((int) $options[$node["child"]]["type"], [1, 2]))) {
68 $cnt++;
69 }
70 }
71 if ($max > 0 && $cnt > $max) {
72 throw new ilExportLimitationExceptionException(str_replace(
73 "%1",
74 (string) $max,
75 $this->lng->txt("exp_error_too_many_objects")
76 ));
77 }
78 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66

References $ref_id, getLimitationMode(), ILIAS\Repository\int(), ILIAS\Repository\lng(), SET_EXPORT_DISABLED, and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ getLimitationMode()

ilExportLimitation::getLimitationMode ( )

Definition at line 45 of file class.ilExportLimitation.php.

45 : int
46 {
47 return (int) $this->settings->get(self::SET_LIMITATION);
48 }

References ILIAS\Repository\settings().

Referenced by checkLimitation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLimitationNumber()

ilExportLimitation::getLimitationNumber ( )

Definition at line 50 of file class.ilExportLimitation.php.

50 : int
51 {
52 return (int) $this->settings->get(self::SET_LIMIT_NUMBER);
53 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilExportLimitation::$lng
protected

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

◆ $settings

ilSetting ilExportLimitation::$settings
protected

Definition at line 33 of file class.ilExportLimitation.php.

◆ $tree

ilTree ilExportLimitation::$tree
protected

Definition at line 32 of file class.ilExportLimitation.php.

◆ SET_EXPORT_DISABLED

const ilExportLimitation::SET_EXPORT_DISABLED = 1

◆ SET_EXPORT_LIMITED

const ilExportLimitation::SET_EXPORT_LIMITED = 0

◆ SET_LIMIT_NUMBER

const ilExportLimitation::SET_LIMIT_NUMBER = "rep_export_limit_number"
protected

Definition at line 27 of file class.ilExportLimitation.php.

◆ SET_LIMITATION

const ilExportLimitation::SET_LIMITATION = "rep_export_limitation"
protected

Definition at line 28 of file class.ilExportLimitation.php.


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