Example #1
0
 /**
  * getOverview
  * @author Thomas Schedler <*****@*****.**>
  * @return string
  */
 public function getOverview($strImageFolderCol1 = '220x', $strImageFolderCol2 = '180x', $strImageFolderList = '80x80')
 {
     $strReturn = '';
     $arrOverview = $this->objPage->getOverviewContainer();
     $strReturn = '';
     if (count($arrOverview) > 0) {
         $strReturn .= '
     <div class="overview">';
         foreach ($arrOverview as $key => $objPageContainer) {
             if (count($objPageContainer) > 0) {
                 $arrDestinationSpecifics = array();
                 if ($objPageContainer->getContainerTitle() != '') {
                     $strReturn .= '
             <h3>' . htmlentities($objPageContainer->getContainerTitle(), ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</h3>';
                 }
                 $arrPageEntries = $objPageContainer->getEntries();
                 switch ($objPageContainer->getEntryViewType()) {
                     case $this->core->config->viewtypes->col1->id:
                         foreach ($arrPageEntries as $objPageEntry) {
                             $strDescription = '';
                             if ($objPageEntry->shortdescription != '') {
                                 $strDescription = nl2br(htmlentities($objPageEntry->shortdescription, ENT_COMPAT, $this->core->sysConfig->encoding->default));
                             } else {
                                 if ($objPageEntry->description != '') {
                                     if (strlen($objPageEntry->description) > 300) {
                                         $strDescription = strip_tags(substr($objPageEntry->description, 0, strpos($objPageEntry->description, ' ', 300))) . ' ...';
                                     } else {
                                         $strDescription = strip_tags($objPageEntry->description);
                                     }
                                 }
                             }
                             $strItem = '
               <div class="item pBottom20">
                 <div class="headline"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . htmlentities($objPageEntry->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</a></div>
                 <div class="text">';
                             if ($strDescription != '') {
                                 $strItem .= '<p>' . $strDescription . '</p>';
                             }
                             $strItem .= '
                   &raquo; <a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . $this->objTranslate->_('more_information') . '</a>                
                 </div>
                 <div class="clear"></div>
               </div>';
                             $strReturn .= $strItem;
                         }
                         break;
                     case $this->core->config->viewtypes->col1_img->id:
                         foreach ($arrPageEntries as $objPageEntry) {
                             $strDescription = '';
                             if ($objPageEntry->shortdescription != '') {
                                 $strDescription = nl2br(htmlentities($objPageEntry->shortdescription, ENT_COMPAT, $this->core->sysConfig->encoding->default));
                             } else {
                                 if ($objPageEntry->description != '') {
                                     if (strlen($objPageEntry->description) > 300) {
                                         $strDescription = strip_tags(substr($objPageEntry->description, 0, strpos($objPageEntry->description, ' ', 300))) . ' ...';
                                     } else {
                                         $strDescription = strip_tags($objPageEntry->description);
                                     }
                                 }
                             }
                             $strItem = '
               <div class="item pBottom20">
                 <div class="headline"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . htmlentities($objPageEntry->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</a></div>';
                             if ($objPageEntry->filename != '') {
                                 $strItem .= '
                 <div class="icon"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '><img src="' . $this->core->config->domains->static->components . $this->core->sysConfig->media->paths->imgbase . $objPageEntry->filepath . $strImageFolderCol1 . '/' . $objPageEntry->filename . '?v=' . $objPageEntry->fileversion . '" alt="' . $objPageEntry->filetitle . '" title="' . $objPageEntry->filetitle . '"/></a></div>';
                             }
                             $strItem .= '
                 <div class="text">';
                             if ($strDescription != '') {
                                 $strItem .= '<p>' . $strDescription . '</p>';
                             }
                             $strItem .= '
                   &raquo; <a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . $this->objTranslate->_('more_information') . '</a>
                 </div>
                 <div class="clear"></div>
               </div>';
                             $strReturn .= $strItem;
                         }
                         break;
                     case $this->core->config->viewtypes->col2->id:
                         $strReturn .= '
               <div class="col2">';
                         $counter = 0;
                         foreach ($arrPageEntries as $objPageEntry) {
                             $strDescription = '';
                             if ($objPageEntry->shortdescription != '') {
                                 $strDescription = nl2br(htmlentities($objPageEntry->shortdescription, ENT_COMPAT, $this->core->sysConfig->encoding->default));
                             } else {
                                 if ($objPageEntry->description != '') {
                                     if (strlen($objPageEntry->description) > 300) {
                                         $strDescription = strip_tags(substr($objPageEntry->description, 0, strpos($objPageEntry->description, ' ', 300))) . ' ...';
                                     } else {
                                         $strDescription = strip_tags($objPageEntry->description);
                                     }
                                 }
                             }
                             $strItem = '
               <div class="item pBottom20' . ($counter % 2 == 0 ? ' pRight100' : '') . '">
                 <div class="headline"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . htmlentities($objPageEntry->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</a></div>
                 <div class="text">';
                             if ($strDescription != '') {
                                 $strItem .= '<p>' . $strDescription . '</p>';
                             }
                             $strItem .= '
                   &raquo; <a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . $this->objTranslate->_('more_information') . '</a>
                 </div>
                 <div class="clear"></div>
               </div>';
                             if ($counter % 2 == 1) {
                                 $strItem .= '
                 <div class="clear"></div>';
                             }
                             $strReturn .= $strItem;
                             $counter++;
                         }
                         $strReturn .= '
                 <div class="clear"></div>
               </div>';
                         break;
                     case $this->core->config->viewtypes->col2_img->id:
                         $strReturn .= '
               <div class="col2">';
                         $counter = 0;
                         foreach ($arrPageEntries as $objPageEntry) {
                             $strDescription = '';
                             if ($objPageEntry->shortdescription != '') {
                                 $strDescription = nl2br(htmlentities($objPageEntry->shortdescription, ENT_COMPAT, $this->core->sysConfig->encoding->default));
                             } else {
                                 if ($objPageEntry->description != '') {
                                     if (strlen($objPageEntry->description) > 300) {
                                         $strDescription = strip_tags(substr($objPageEntry->description, 0, strpos($objPageEntry->description, ' ', 300))) . ' ...';
                                     } else {
                                         $strDescription = strip_tags($objPageEntry->description);
                                     }
                                 }
                             }
                             $strItem = '
               <div class="item pBottom20' . ($counter % 2 == 0 ? ' pRight100' : '') . '">
                 <div class="headline"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . htmlentities($objPageEntry->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</a></div>';
                             if ($objPageEntry->filename != '') {
                                 $strItem .= '
                 <div class="icon"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '><img src="' . $this->core->config->domains->static->components . $this->core->sysConfig->media->paths->imgbase . $objPageEntry->filepath . $strImageFolderCol2 . '/' . $objPageEntry->filename . '?v=' . $objPageEntry->fileversion . '" alt="' . $objPageEntry->filetitle . '" title="' . $objPageEntry->filetitle . '"/></a></div>';
                             }
                             $strItem .= '
                 <div class="text">';
                             if ($strDescription != '') {
                                 $strItem .= '<p>' . $strDescription . '</p>';
                             }
                             $strItem .= '
                   &raquo; <a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . $this->objTranslate->_('more_information') . '</a>
                 </div>
                 <div class="clear"></div>
               </div>';
                             if ($counter % 2 == 1) {
                                 $strItem .= '
                 <div class="clear"></div>';
                             }
                             $strReturn .= $strItem;
                             $counter++;
                         }
                         $strReturn .= '
                 <div class="clear"></div>
               </div>';
                         break;
                     case $this->core->config->viewtypes->list->id:
                         $strReturn .= '
               <div class="list">';
                         foreach ($arrPageEntries as $objPageEntry) {
                             $strItem = '
                 <div class="item">                    
                   &raquo; <a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . htmlentities($objPageEntry->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</a>
                 </div>';
                             $strReturn .= $strItem;
                         }
                         $strReturn .= '
               </div>';
                         break;
                     case $this->core->config->viewtypes->list_img->id:
                         $strReturn .= '
               <div class="list">';
                         foreach ($arrPageEntries as $objPageEntry) {
                             $strItem = '
                 <div class="item">';
                             if ($objPageEntry->filename != '') {
                                 $strItem .= '
                   <div class="icon"><a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '><img src="' . $this->core->sysConfig->media->paths->imgbase . $objPageEntry->filepath . $strImageFolderList . '/' . $objPageEntry->filename . '?v=' . $objPageEntry->fileversion . '" alt="' . $objPageEntry->filetitle . '" title="' . $objPageEntry->filetitle . '"/></a></div>';
                             }
                             $strItem .= '
                   <div class="text">
                     <a href="' . $objPageEntry->url . '"' . ($objPageEntry->target !== false ? ' target="' . $objPageEntry->target . '"' : '') . '>' . htmlentities($objPageEntry->title, ENT_COMPAT, $this->core->sysConfig->encoding->default) . '</a>
                   </div>
                   <div class="clear"></div>
                 </div>';
                             $strReturn .= $strItem;
                         }
                         $strReturn .= '
                 <div class="clear"></div>
               </div>';
                         break;
                 }
             }
         }
         $strReturn .= '
       <div class="clear"></div>
     </div>';
     }
     return $strReturn;
 }