19declare(strict_types=1);
 
   36    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   41        $this->
lng = $DIC->language();
 
   42        $this->
error = $DIC[
'ilErr'];
 
   46        $this->
lng->loadLanguageModule(
'tos');
 
   47        $this->
lng->loadLanguageModule(
'meta');
 
   59        $nextClass = $this->
ctrl->getNextClass($this);
 
   60        $cmd = $this->
ctrl->getCmd();
 
   63        $tableDataProviderFactory->setDatabaseAdapter($this->dic->database());
 
   65        switch (strtolower($nextClass)) {
 
   66            case strtolower(ilTermsOfServiceDocumentGUI::class):
 
   71                    $this->dic[
'tos.criteria.type.factory'],
 
   72                    $this->dic->ui()->mainTemplate(),
 
   75                    $this->dic->language(),
 
   76                    $this->dic->rbac()->system(),
 
   78                    $this->dic->logger()->tos(),
 
   79                    $this->dic->toolbar(),
 
   81                    $this->dic->ui()->factory(),
 
   82                    $this->dic->ui()->renderer(),
 
   83                    $this->dic->filesystem(),
 
   85                    $tableDataProviderFactory,
 
   87                    $this->dic->refinery()
 
   89                $this->
ctrl->forwardCommand($documentGui);
 
   92            case strtolower(ilTermsOfServiceAcceptanceHistoryGUI::class):
 
   97                    $this->dic[
'tos.criteria.type.factory'],
 
   98                    $this->dic->ui()->mainTemplate(),
 
  100                    $this->dic->language(),
 
  101                    $this->dic->rbac()->system(),
 
  104                    $this->dic->refinery(),
 
  105                    $this->dic->ui()->factory(),
 
  106                    $this->dic->ui()->renderer(),
 
  107                    $tableDataProviderFactory,
 
  109                $this->
ctrl->forwardCommand($documentGui);
 
  112            case strtolower(ilPermissionGUI::class):
 
  114                $this->
ctrl->forwardCommand($perm_gui);
 
  118                if ($cmd === 
null || $cmd === 
'' || $cmd === 
'view' || !method_exists($this, $cmd)) {
 
  128        if ($this->rbac_system->checkAccess(
'read', $this->object->getRefId())) {
 
  129            $this->tabs_gui->addTarget(
 
  130                'tos_agreement_documents_tab_label',
 
  131                $this->
ctrl->getLinkTargetByClass(ilTermsOfServiceDocumentGUI::class),
 
  133                [strtolower(ilTermsOfServiceDocumentGUI::class)]
 
  137        if ($this->rbac_system->checkAccess(
'read', $this->object->getRefId())) {
 
  138            $this->tabs_gui->addTarget(
 
  140                $this->
ctrl->getLinkTarget($this, 
'settings'),
 
  142                [strtolower(self::class)]
 
  147            (defined(
'USER_FOLDER_ID') && $this->rbac_system->checkAccess(
'read', 
USER_FOLDER_ID)) &&
 
  148            $this->rbac_system->checkAccess(
'read', $this->object->getRefId())
 
  150            $this->tabs_gui->addTarget(
 
  151                'tos_acceptance_history',
 
  152                $this->
ctrl->getLinkTargetByClass(ilTermsOfServiceAcceptanceHistoryGUI::class),
 
  154                [strtolower(ilTermsOfServiceAcceptanceHistoryGUI::class)]
 
  158        if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
 
  159            $this->tabs_gui->addTarget(
 
  161                $this->
ctrl->getLinkTargetByClass([self::class, ilPermissionGUI::class], 
'perm'),
 
  163                [strtolower(ilPermissionGUI::class), strtolower(ilObjectPermissionStatusGUI::class)]
 
  174            $this->
ctrl->getFormAction($this, 
'saveSettings'),
 
  176            $this->rbac_system->checkAccess(
'write', $this->object->getRefId())
 
  190        if (!$this->rbac_system->checkAccess(
'write', $this->object->getRefId())) {
 
  191            $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  194        $form = $this->getSettingsForm();
 
  195        if ($form->saveObject()) {
 
  196            $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'), 
true);
 
  197            $this->
ctrl->redirect($this, 
'settings');
 
  198        } elseif ($form->hasTranslatedError()) {
 
  199            $this->tpl->setOnScreenMessage(
'failure', $form->getTranslatedError());
 
  202        $this->tpl->setContent($form->getHTML());
 
  207        if ($this->
object->getStatus()) {
 
  212            $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'tos_no_documents_exist'));
 
  218        if (!$this->rbac_system->checkAccess(
'read', $this->object->getRefId())) {
 
  219            $this->
error->raiseError($this->
lng->txt(
'permission_denied'), $this->error->MESSAGE);
 
  224        $form = $this->getSettingsForm();
 
  225        $this->tpl->setContent($form->getHTML());
 
static where($where, $operator=null)
 
Customizing of pimple-DIC for ILIAS.
 
Error Handling & global info handling uses PEAR error class.
 
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 
getType()
Functions that must be overwritten.
 
getAdminTabs()
administration tabs show only permissions and trash folder
 
New implementation of ilObjectGUI.
 
executeCommand()
execute command
 
prepareOutput(bool $show_sub_objects=true)
 
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
 
Class ilTermsOfServiceAcceptanceHistoryGUI.
 
Class ilTermsOfServiceDocumentGUI.
 
Class ilTermsOfServiceDocumentHtmlPurifier.
 
Class ilTermsOfServiceTableDataProviderFactory.
 
Class ilTermsOfServiceTrimmedDocumentPurifier.
 
Interface ilTermsOfServiceControllerEnabled.
 
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc