Esempio n. 1
0
 /**
  * 
  */
 protected function showAcceptedTermsOfService()
 {
     /**
      * @var $agree_date ilNonEditableValueGUI
      */
     $agree_date = $this->form_gui->getItemByPostVar('agree_date');
     if ($agree_date && $agree_date->getValue()) {
         $this->lng->loadLanguageModule('tos');
         require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
         /**
          * @var $entity ilTermsOfServiceAcceptanceEntity
          */
         $entity = ilTermsOfServiceHelper::getCurrentAcceptanceForUser($this->object);
         if ($entity->getId()) {
             $show_agreement_text = new ilCheckboxInputGUI($this->lng->txt('tos_show_signed_text'), 'tos_show_signed_text');
             $agreement_lang = new ilNonEditableValueGUI($this->lng->txt('language'), '');
             $agreement_lang->setValue($this->lng->txt('meta_l_' . $entity->getIso2LanguageCode()));
             $show_agreement_text->addSubItem($agreement_lang);
             require_once 'Services/TermsOfService/classes/form/class.ilTermsOfServiceSignedDocumentFormElementGUI.php';
             $agreement_document = new ilTermsOfServiceSignedDocumentFormElementGUI($this->lng->txt('tos_agreement_document'), '', $entity);
             $show_agreement_text->addSubItem($agreement_document);
             $agree_date->addSubItem($show_agreement_text);
         }
     } else {
         if ($agree_date) {
             $agree_date->setValue($this->lng->txt('tos_not_accepted_yet'));
         }
     }
 }
 /**
  * 
  */
 protected function showAcceptedTermsOfService()
 {
     /**
      * @var $agree_date ilNonEditableValueGUI
      */
     $agree_date = $this->form_gui->getItemByPostVar('agree_date');
     if ($agree_date && $agree_date->getValue()) {
         $this->lng->loadLanguageModule('tos');
         require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
         /**
          * @var $entity ilTermsOfServiceAcceptanceEntity
          */
         $entity = ilTermsOfServiceHelper::getCurrentAcceptanceForUser($this->object);
         if ($entity->getId()) {
             $show_agreement_text = new ilCheckboxInputGUI($this->lng->txt('tos_show_signed_text'), 'tos_show_signed_text');
             $agreement_lang = new ilNonEditableValueGUI($this->lng->txt('language'), '');
             $agreement_lang->setValue($this->lng->txt('meta_l_' . $entity->getIso2LanguageCode()));
             $show_agreement_text->addSubItem($agreement_lang);
             $agreement_document = new ilNonEditableValueGUI($this->lng->txt('tos_agreement_document'), '', true);
             require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
             $action = new ilAdvancedSelectionListGUI();
             $action->setId('asl_content_accepted_content');
             $action->setListTitle($this->lng->txt('tos_accepted_content'));
             $action->setHeaderIcon(ilUtil::getImagePath('icon_preview.png'));
             $action->setAsynch(true);
             $action->setAsynchUrl($this->ctrl->getLinkTarget($this, 'showAgreementTextAsynch', '', true, false));
             $agreement_document->setValue($entity->getSource() . $action->getHtml());
             $show_agreement_text->addSubItem($agreement_document);
             $agree_date->addSubItem($show_agreement_text);
         }
     } else {
         if ($agree_date) {
             $agree_date->setValue($this->lng->txt('tos_not_accepted_yet'));
         }
     }
 }