171 if (!$this->certificateSettings->get(
'active',
'0')) {
172 $this->
ctrl->redirect($this);
178 $this->
language->txt(
'certificate_no_object_title')
183 $this->
user->getId(),
185 'order_field' => explode(
'_', $sorting)[0],
186 'order_direction' => explode(
'_', $sorting)[1],
187 'language' => $this->
user->getLanguage()
194 if (count(
$data[
'items']) > 0) {
198 foreach ($this->sortationOptions as $fieldAndDirection => $lngVariable) {
202 $sortViewControl = $this->uiFactory
205 ->withLabel($this->
language->txt($this->sortationOptions[$sorting]))
206 ->withTargetURL($this->
ctrl->getLinkTarget($this,
'applySortation'),
'sort_by');
207 $uiComponents[] = $sortViewControl;
209 foreach (
$data[
'items'] as $certificateData) {
210 $thumbnailImagePath = $certificateData[
'thumbnail_image_path'];
212 if ($thumbnailImagePath === null
213 || $thumbnailImagePath ===
'' 214 || !$this->
filesystem->has($thumbnailImagePath)
219 $cardImage = $this->uiFactory->image()->standard(
221 $certificateData[
'title']
226 if ($certificateData[
'description'] !==
'') {
227 $sections[] = $this->uiFactory->listing()->descriptive([
228 $this->
language->txt(
'cert_description_label') => $certificateData[
'description']
234 $sections[] = $this->uiFactory->listing()->descriptive([
241 $objectTypeIcon = $this->uiFactory
244 ->standard($certificateData[
'obj_type'], $certificateData[
'obj_type']);
246 $objectTitle = $certificateData[
'title'];
248 if (count($refIds) > 0) {
249 foreach ($refIds as
$refId) {
250 if ($this->
access->checkAccess(
'read',
'', $refId)) {
251 $objectTitle = $this->uiRenderer->render(
259 $sections[] = $this->uiFactory->listing()->descriptive([$this->
language->txt(
'cert_object_label') => implode(
262 $this->uiRenderer->render($objectTypeIcon),
268 $this->
ctrl->setParameter($this,
'certificate_id', $certificateData[
'id']);
269 $downloadHref = $this->
ctrl->getLinkTarget($this,
'download');
270 $this->
ctrl->clearParameters($this);
271 $sections[] = $this->uiFactory->button()->standard(
'Download', $downloadHref);
273 $card = $this->uiFactory
275 ->standard($certificateData[
'title'], $cardImage)
276 ->withSections($sections);
281 $deck = $this->uiFactory->deck($cards)->withSmallCardsSize();
283 $uiComponents[] = $this->uiFactory->divider()->horizontal();
285 $uiComponents[] = $deck;
287 $this->
template->setOnScreenMessage(
'info', $this->
language->txt(
'cert_currently_no_certs'));
290 $this->
template->setContent($this->uiRenderer->render($uiComponents));
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static _getAllReferences(int $id)
get all reference ids for object ID
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static useRelativeDates()
ilLogger $certificateLogger
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
static signFile(string $path_to_file)
static setUseRelativeDates(bool $a_status)
set use relative dates