ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjSCORMVerificationGUI Class Reference

GUI class for scorm verification. More...

+ Inheritance diagram for ilObjSCORMVerificationGUI:
+ Collaboration diagram for ilObjSCORMVerificationGUI:

Public Member Functions

 getType ()
 
 create ()
 
 save ()
 
 deliver ()
 
 render (bool $a_return=false, string $a_url='')
 
 downloadFromPortfolioPage (ilPortfolioPage $a_page)
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 getRequestValue (string $key, mixed $default=null)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjSCORMVerificationGUI::_goto ( string  $a_target)
static

Definition at line 162 of file class.ilObjSCORMVerificationGUI.php.

References $DIC, and ilObjectGUI\$id.

162  : void
163  {
164  global $DIC;
165  $id = explode("_", $a_target);
166 
167  $DIC->ctrl->setParameterByClass(
168  "ilsharedresourceGUI",
169  "wsp_id",
170  $id[0]
171  );
172  $DIC->ctrl->redirectByClass(ilSharedResourceGUI::class);
173  }
global $DIC
Definition: shib_login.php:22

◆ create()

ilObjSCORMVerificationGUI::create ( )
Exceptions
ilCtrlException

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

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

Referenced by save().

36  : void
37  {
38  global $DIC;
39  $ilTabs = $DIC->tabs();
40 
41  $this->lng->loadLanguageModule("scov");
42 
43  $ilTabs->setBackTarget(
44  $this->lng->txt("back"),
45  $this->ctrl->getLinkTarget($this, "cancel")
46  );
47 
48  $table = new ilSCORMVerificationTableGUI($this, "create");
49  $this->tpl->setContent($table->getHTML());
50  }
List all completed learning modules for current user.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deliver()

ilObjSCORMVerificationGUI::deliver ( )

Definition at line 102 of file class.ilObjSCORMVerificationGUI.php.

References ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\object().

Referenced by downloadFromPortfolioPage(), and render().

102  : void
103  {
104  $file = $this->object->getFilePath();
105  if ($file) {
106  ilFileDelivery::deliverFileLegacy($file, $this->object->getTitle() . ".pdf");
107  }
108  }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadFromPortfolioPage()

ilObjSCORMVerificationGUI::downloadFromPortfolioPage ( ilPortfolioPage  $a_page)

Definition at line 150 of file class.ilObjSCORMVerificationGUI.php.

References $DIC, $ilErr, deliver(), ilPCVerification\isInPortfolioPage(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

150  : void
151  {
152  global $DIC;
153  $ilErr = $DIC['ilErr'];
154 
155  if (ilPCVerification::isInPortfolioPage($a_page, $this->object->getType(), $this->object->getId())) {
156  $this->deliver();
157  }
158 
159  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
160  }
static isInPortfolioPage(ilPortfolioPage $a_page, string $a_type, int $a_id)
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getRequestValue()

ilObjSCORMVerificationGUI::getRequestValue ( string  $key,
mixed  $default = null 
)
protected

Definition at line 175 of file class.ilObjSCORMVerificationGUI.php.

References null.

Referenced by save().

175  : mixed
176  {
177  if (isset($this->request->getQueryParams()[$key])) {
178  return $this->request->getQueryParams()[$key];
179  }
180 
181  return $this->request->getParsedBody()[$key] ?? $default ?? null;
182  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getType()

ilObjSCORMVerificationGUI::getType ( )

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

28  : string
29  {
30  return "scov";
31  }

◆ render()

ilObjSCORMVerificationGUI::render ( bool  $a_return = false,
string  $a_url = '' 
)

Definition at line 110 of file class.ilObjSCORMVerificationGUI.php.

References ilObject2GUI\$access_handler, $DIC, ilObject2GUI\$lng, $message, ilObjectGUI\$tree, $valid, deliver(), ilObject2GUI\getAccessHandler(), ILIAS\Repository\object(), and ilLanguage\txt().

110  : string
111  {
112  global $DIC;
113  $ilUser = $DIC->user();
114  $lng = $DIC->language();
115 
116  if (!$a_return) {
117  $this->deliver();
118  } else {
119  $tree = new ilWorkspaceTree($ilUser->getId());
120  $wsp_id = $tree->lookupNodeId($this->object->getId());
121 
122  $caption = $lng->txt("wsp_type_scov") . ' "' . $this->object->getTitle() . '"';
123 
124  $valid = true;
125  $message = '';
126  if (!file_exists($this->object->getFilePath())) {
127  $valid = false;
128  $message = $lng->txt("url_not_found");
129  } elseif (!$a_url) {
131  if (!$access_handler->checkAccess("read", "", $wsp_id)) {
132  $valid = false;
133  $message = $lng->txt("permission_denied");
134  }
135  }
136 
137  if ($valid) {
138  if (!$a_url) {
139  $a_url = $this->getAccessHandler()->getGotoLink($wsp_id, $this->object->getId());
140  }
141  return '<div><a href="' . $a_url . '">' . $caption . '</a></div>';
142  }
143 
144  return '<div>' . $caption . ' (' . $message . ')</div>';
145  }
146 
147  return "";
148  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$valid
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

◆ save()

ilObjSCORMVerificationGUI::save ( )
Exceptions
JsonException
ilCtrlException
ilException

Definition at line 57 of file class.ilObjSCORMVerificationGUI.php.

References $DIC, ilObject2GUI\$node_id, ilObject2GUI\$parent_id, ilObjectGUI\afterSave(), create(), ilCertificateVerificationFileService\createFile(), getRequestValue(), ILIAS\Repository\int(), ILIAS\Repository\lng(), null, and ilObject2GUI\putObjectInTree().

57  : void
58  {
59  global $DIC;
60 
61  $ilUser = $DIC->user();
62 
63  $objectId = $this->getRequestValue("lm_id");
64  if ($objectId) {
65  $certificateVerificationFileService = new ilCertificateVerificationFileService(
66  $DIC->language(),
67  $DIC->database(),
68  $DIC->logger()->root(),
70  );
71 
72  $userCertificateRepository = new ilUserCertificateRepository();
73 
74  $userCertificatePresentation = $userCertificateRepository->fetchActiveCertificateForPresentation(
75  (int) $ilUser->getId(),
76  (int) $objectId
77  );
78 
79  try {
80  $newObj = $certificateVerificationFileService->createFile($userCertificatePresentation);
81  } catch (\Exception $exception) {
82  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('error_creating_certificate_pdf'));
83  $this->create();
84  }
85 
86  $newObj = null;
87  if ($newObj) {
89  $this->node_id = null;
90  $this->putObjectInTree($newObj, $parent_id);
91 
92  $this->afterSave($newObj);
93  } else {
94  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_failed"));
95  }
96  } else {
97  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
98  }
99  $this->create();
100  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRequestValue(string $key, mixed $default=null)
createFile(ilUserCertificatePresentation $userCertificatePresentation)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
afterSave(ilObject $new_object)
Post (successful) object creation hook.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

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