202 {
204
205 if (!$this->certificateSettings->get('active')) {
206 $this->controller->redirect($this);
207 return;
208 }
209
212 $this->certificateLogger,
213 $this->controller,
214 $this->language->txt('certificate_no_object_title')
215 );
216
218 $data = $provider->fetchDataSet(
219 $this->
user->getId(),
220 [
221 'order_field' => explode('_', $sorting)[0],
222 'order_direction' => explode('_', $sorting)[1],
223 'language' => $this->
user->getLanguage()
224 ],
225 []
226 );
227
228 $uiComponents = [];
229
230 if (count(
$data[
'items']) > 0) {
232 $cards = [];
233
234 foreach ($this->sortationOptions as $fieldAndDirection => $lngVariable) {
236 }
237
238 $sortViewControl = $this->uiFactory
239 ->viewControl()
241 ->withLabel($this->
language->txt($this->sortationOptions[$sorting]))
242 ->withTargetURL($this->controller->getLinkTarget($this, 'applySortation'), 'sort_by');
243 $uiComponents[] = $sortViewControl;
244
245 foreach (
$data[
'items'] as $certificateData) {
246 $thumbnailImagePath = $certificateData['thumbnail_image_path'];
248 if ($thumbnailImagePath === null
249 || $thumbnailImagePath === ''
250 || !$this->filesystem->has($thumbnailImagePath)
251 ) {
253 }
254
255 $cardImage = $this->uiFactory->image()->standard(
257 $certificateData['title']
258 );
259
260
261 $sections = [];
262
263 if (strlen($certificateData['description']) > 0) {
264 $sections[] = $this->uiFactory->listing()->descriptive([
265 $this->
language->txt(
'cert_description_label') => $certificateData[
'description']
266 ]);
267 }
268
269
272 $sections[] = $this->uiFactory->listing()->descriptive([
275 )
276 ]);
278
279 $objectTypeIcon = $this->uiFactory
280 ->symbol()
281 ->icon()
282 ->standard($certificateData['obj_type'], $certificateData['obj_type'], 'small');
283
284 $objectTitle = $certificateData['title'];
286 if (count($refIds) > 0) {
287 foreach ($refIds as
$refId) {
288 if ($this->access->checkAccess(
'read',
'',
$refId)) {
289 $objectTitle = $this->uiRenderer->render(
291 );
292 break;
293 }
294 }
295 }
296
297 $sections[] = $this->uiFactory->listing()->descriptive([$this->
language->txt(
'cert_object_label') => implode(
'', [
298 $this->uiRenderer->render($objectTypeIcon),
299 $objectTitle
300 ])]);
301
302 $this->controller->setParameter($this, 'certificate_id', $certificateData['id']);
303 $downloadHref = $this->controller->getLinkTarget($this, 'download');
304 $this->controller->clearParameters($this);
305 $sections[] = $this->uiFactory->button()->standard('Download', $downloadHref);
306
307 $card = $this->uiFactory
308 ->card()
309 ->standard($certificateData['title'], $cardImage)
310 ->withSections($sections);
311
312 $cards[] = $card;
313 }
314
315 $deck = $this->uiFactory->deck($cards)->withNormalCardsSize();
316
317 $uiComponents[] = $this->uiFactory->divider()->horizontal();
318
319 $uiComponents[] = $deck;
320 } else {
322 }
323
324 $this->template->setContent($this->uiRenderer->render($uiComponents));
325 }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getAllReferences($a_id)
get all reference ids of object
static getWebspaceDir($mode="filesystem")
get webspace directory
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static signFile($path_to_file)