Example #1
0
 /**
  * load items
  *
  * @return html with items
  */
 private function loadItems($options, $tags)
 {
     $tagColors = $this->convertTagsToAssocArray($tags);
     $itemDao = new \daos\Items();
     $itemsHtml = "";
     foreach ($itemDao->get($options) as $item) {
         // parse tags and assign tag colors
         $itemsTags = explode(",", $item['tags']);
         $item['tags'] = array();
         foreach ($itemsTags as $tag) {
             $tag = trim($tag);
             if (strlen($tag) > 0 && isset($tagColors[$tag])) {
                 $item['tags'][$tag] = $tagColors[$tag];
             }
         }
         $this->view->item = $item;
         $itemsHtml .= $this->view->render('templates/item.phtml');
     }
     if (strlen($itemsHtml) == 0) {
         $itemsHtml = '<div class="stream-empty">' . \F3::get('lang_no_entries') . '</div>';
     } else {
         if ($itemDao->hasMore()) {
             $itemsHtml .= '<div class="stream-more"><span>' . \F3::get('lang_more') . '</span></div>';
         }
         $itemsHtml .= '<div class="mark-these-read"><span>' . \F3::get('lang_markread') . '</span></div>';
     }
     return $itemsHtml;
 }