205 if (!$this->certificateSettings->get(
'active')) {
206 $this->controller->redirect($this);
214 $this->
language->txt(
'certificate_no_object_title')
218 $data = $provider->fetchDataSet(
219 $this->
user->getId(),
221 'order_field' => explode(
'_', $sorting)[0],
222 'order_direction' => explode(
'_', $sorting)[1],
223 'language' => $this->
user->getLanguage()
230 if (count(
$data[
'items']) > 0) {
234 foreach ($this->sortationOptions as $fieldAndDirection => $lngVariable) {
238 $sortViewControl = $this->uiFactory
241 ->withLabel($this->
language->txt($this->sortationOptions[$sorting]))
242 ->withTargetURL($this->controller->getLinkTarget($this,
'applySortation'),
'sort_by');
243 $uiComponents[] = $sortViewControl;
245 foreach (
$data[
'items'] as $certificateData) {
246 $thumbnailImagePath = $certificateData[
'thumbnail_image_path'];
248 if ($thumbnailImagePath === null
249 || $thumbnailImagePath ===
'' 250 || !$this->filesystem->has($thumbnailImagePath)
255 $cardImage = $this->uiFactory->image()->standard(
257 $certificateData[
'title']
263 if (strlen($certificateData[
'description']) > 0) {
264 $sections[] = $this->uiFactory->listing()->descriptive([
265 $this->
language->txt(
'cert_description_label') => $certificateData[
'description']
272 $sections[] = $this->uiFactory->listing()->descriptive([
279 $objectTypeIcon = $this->uiFactory
282 ->standard($certificateData[
'obj_type'], $certificateData[
'obj_type'],
'small');
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(
297 $sections[] = $this->uiFactory->listing()->descriptive([$this->
language->txt(
'cert_object_label') => implode(
'', [
298 $this->uiRenderer->render($objectTypeIcon),
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);
307 $card = $this->uiFactory
309 ->standard($certificateData[
'title'], $cardImage)
310 ->withSections($sections);
315 $deck = $this->uiFactory->deck($cards)->withNormalCardsSize();
317 $uiComponents[] = $this->uiFactory->divider()->horizontal();
319 $uiComponents[] = $deck;
324 $this->
template->setContent($this->uiRenderer->render($uiComponents));
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _getAllReferences($a_id)
get all reference ids of object
static useRelativeDates()
check if relative dates are used
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)
static getWebspaceDir($mode="filesystem")
get webspace directory
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")