Advertisement
Denkstream

Untitled

Apr 2nd, 2019
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.26 KB | None | 0 0
  1. <?php
  2. $transitcodes = $data->transitcode()->split(); // this gives us an array of the transit codes
  3. $items = page('datenbank')->children()->filterBy('template', 'document')->filter(function($item) use($transitcodes) {
  4.   // within the callback, we check of the item's identifier is in the array and return if true
  5.   return in_array($item->documentidentifiercode(), $transitcodes);};
  6. foreach($items as $item): ?>
  7.     <?= $item->title()->html() ?>
  8.     <span class="color-<?php if($item->documenttype() == 'Arbeitshilfe'): ?>a<?php endif; ?><?php if($item->documenttype() == 'Formular'): ?>b<?php endif; ?><?php if($item->documenttype() == 'MitgeltendeUnterlagen'): ?>c<?php endif; ?><?php if($item->documenttype() == 'Intern'): ?>d<?php endif; ?><?php if($item->documenttype() == 'Verfahrensbeschreibung'): ?>e<?php endif; ?>">
  9.     <?php if($item->documenttype() == 'Verfahrensbeschreibung'): ?>
  10.         <i class="fas fa-exclamation-circle"></i></span>
  11.     <?php else: ?>
  12.         <i class="fas fa-circle"></i></span>
  13.     <?php endif; ?>
  14.             <?php if($item->documenttype() == 'Arbeitshilfe'): ?>Arbeitshilfe<?php endif; ?>
  15.             <?php if($item->documenttype() == 'Formular'): ?>Formular<?php endif; ?>
  16.             <?php if($item->documenttype() == 'MitgeltendeUnterlagen'): ?>Mitgeltende Unterlagen<?php endif; ?>
  17.             <?php if($item->documenttype() == 'Intern'): ?>Intern<?php endif; ?>
  18.             <?php if($item->documenttype() == 'Verfahrensbeschreibung'): ?>Verfahrensbeschreibung<?php endif; ?>
  19.             <a href="<?php if($file = $item->documentselect()->toFile()) {echo $file->url();} ?>"><button class="btn is-download"><i class="fas fa-arrow-down"></i></button></a>
  20.         </li>
  21.         <?php if($item->documentlastchange() == 'delete'): ?>
  22.         <li class="line-three"></li>
  23.         <?php else: ?>
  24.         <li class="line-three">
  25.            
  26.             <?php if ($item->documentdescription()->isNotEmpty()): ?>
  27.                 <button class="btn is-detail"><i class="fas fa-info-circle"></i> Info </button>
  28.             <div class="content-expanded">
  29.                 <?= $item->documentdescription()->kt()?>
  30.             </div>
  31.             <?php else: ?>
  32.             <?php endif; ?>
  33.         <?php endif; ?>  
  34.         </li>
  35.     </ul>
  36.  
  37. <?php endforeach ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement