Beispiel #1
0
 /**
  *
  */
 protected function compile()
 {
     global $objPage;
     $f_display_mode = deserialize($this->f_display_mode);
     $page_taxonomy = deserialize($objPage->page_taxonomy);
     $this->strOrderBy = $this->f_orderby ? mb_strtoupper($this->f_orderby, 'UTF-8') : '';
     $taxonomyFromFE = is_array($f_display_mode) ? $f_display_mode : array();
     $taxonomyFromPage = is_array($page_taxonomy) ? $page_taxonomy : array();
     $tablename = $this->f_select_module;
     $wrapperID = $this->f_select_wrapper;
     $doNotSetByID = array('orderBy', 'sorting_fields', 'pagination');
     $doNotSetByType = array('legend_end', 'legend_start', 'wrapper_field');
     $moduleDB = $this->Database->prepare('SELECT tl_fmodules.id AS moduleID, tl_fmodules.*, tl_fmodules_filters.*  FROM tl_fmodules LEFT JOIN tl_fmodules_filters ON tl_fmodules.id = tl_fmodules_filters.pid WHERE tablename = ? ORDER BY tl_fmodules_filters.sorting')->execute($tablename);
     $arrFields = array();
     $fieldWidgets = array();
     $this->tablename = $tablename;
     $mapFields = array();
     $geoLocatorValues = array();
     $arrCleanOptions = array();
     // map view settings
     $mapSettings = array();
     if ($this->fm_addMap) {
         $mapSettings['mapZoom'] = $this->fm_mapZoom;
         $mapSettings['mapMarker'] = $this->fm_mapMarker;
         $mapSettings['mapInfoBox'] = $this->fm_mapInfoBox;
         $mapSettings['mapType'] = $this->fm_mapType;
         $mapSettings['mapStyle'] = $this->fm_mapStyle;
         $mapSettings['mapScrollWheel'] = $this->fm_mapScrollWheel ? 'true' : 'false';
         $mapSettings['lat'] = $this->fm_center_lat ? $this->fm_center_lat : '0';
         $mapSettings['lng'] = $this->fm_center_lng ? $this->fm_center_lng : '0';
     }
     // get wrapper
     $wrapperDB = $this->Database->prepare('SELECT addDetailPage, title, id, rootPage FROM ' . $tablename . ' WHERE id = ?')->execute($wrapperID)->row();
     // taxonomies
     $blnDetailView = false;
     if (\Input::get('auto_item')) {
         $taxonomyItemDB = $this->Database->prepare('SELECT * FROM ' . $tablename . '_data WHERE published = "1" AND pid = ? AND (alias = ? OR id = ?)')->limit(1)->execute($wrapperID, \Input::get('auto_item'), (int) \Input::get('auto_item'));
         if ($taxonomyItemDB->count()) {
             $blnDetailView = true;
         }
     }
     // set params variables
     $this->strAutoItem = !$blnDetailView ? '' : \Input::get('auto_item');
     $this->strSpecie = !$blnDetailView ? \Input::get('auto_item') : \Input::get('specie');
     $this->strTag = !$blnDetailView ? \Input::get('specie') : \Input::get('tags');
     while ($moduleDB->next()) {
         $arrModule = $moduleDB->row();
         if (in_array($arrModule['fieldID'], $doNotSetByID) || in_array($arrModule['type'], $doNotSetByType)) {
             continue;
         }
         $getFilter = $this->getFilter($arrModule['fieldID'], $arrModule['type']);
         $arrModule['value'] = $getFilter['value'];
         $arrModule['operator'] = $getFilter['operator'];
         $arrModule['overwrite'] = null;
         $arrModule['active'] = null;
         // set auto_page values
         if ($arrModule['fieldID'] == 'auto_page' || $arrModule['autoPage']) {
             $arrModule = $this->setValuesForAutoPageAttribute($arrModule);
         }
         // taxonomies >>
         // set specie value
         if ($arrModule['dataFromTaxonomy'] == '1' && !\Config::get('taxonomyDisable')) {
             $arrModule['type'] = 'taxonomy_field';
             // dyn type
             $arrModule = $this->setValuesForTaxonomySpecieAttribute($arrModule);
         }
         // set tags value
         if ($arrModule['reactToTaxonomy'] == '1' && !\Config::get('taxonomyDisable')) {
             $arrModule['type'] = 'taxonomy_field';
             // dyn type
             $arrModule = $this->setValuesForTaxonomyTagsAttribute($arrModule);
         }
         // << end taxonomies
         $val = QueryModel::isValue($arrModule['value'], $arrModule['type']);
         if ($val) {
             $arrModule['enable'] = true;
         }
         // check if has an wrapper
         if ($arrModule['type'] === 'search_field' && $arrModule['isInteger'] || $arrModule['type'] === 'date_field') {
             $btw = Input::get($arrModule['fieldID'] . '_btw') ? Input::get($arrModule['fieldID'] . '_btw') : '';
             $btwHasValue = QueryModel::isValue($btw, $arrModule['type']);
             if ($btwHasValue && !$val) {
                 $arrModule['enable'] = true;
                 $arrModule['value'] = 0;
             }
         }
         // map
         if ($arrModule['type'] == 'map_field') {
             // set map settings
             $mapFields[] = HelperModel::setGoogleMap($arrModule);
             // set loadMapScript to true
             $this->loadMapScript = true;
             // load map libraries
             if (!$GLOBALS['loadGoogleMapLibraries']) {
                 $GLOBALS['loadGoogleMapLibraries'] = $arrModule['mapInfoBox'] ? true : false;
             }
         }
         // field
         if ($arrModule['type'] == 'widget') {
             $tplName = $arrModule['widgetTemplate'];
             $tpl = '';
             if (!$tplName) {
                 $tplNameType = explode('.', $arrModule['widget_type'])[0];
                 $tplNameArr = $this->getTemplateGroup('fm_field_' . $tplNameType);
                 $tpl = current($tplNameArr);
                 $tpl = $this->parseTemplateName($tpl);
             }
             $fieldWidgets[$arrModule['fieldID']] = array('fieldID' => $arrModule['fieldID'], 'widgetType' => $arrModule['widget_type'], 'widgetTemplate' => $arrModule['widgetTemplate'] ? $arrModule['widgetTemplate'] : $tpl);
         }
         // has options
         if ($arrModule['type'] == 'simple_choice' || $arrModule['type'] == 'multi_choice') {
             $dcaHelper = new DCAHelper();
             $arrCleanOptions[$arrModule['fieldID']] = $dcaHelper->getOptions($arrModule, $tablename, $wrapperID);
         }
         // compass
         if ($arrModule['type'] == 'geo_locator') {
             if ($arrModule['value']) {
                 $geoLocatorValues[$arrModule['locatorType']] = $arrModule['value'];
             }
             // get delimiter
             if ($arrModule['locatorType'] == 'geo_distance') {
                 $geoLocatorValues['geoDistanceDelimiter'] = $arrModule['geoDistanceDelimiter'] ? $arrModule['geoDistanceDelimiter'] : ',';
             }
             continue;
         }
         $arrFields[$arrModule['fieldID']] = $arrModule;
     }
     if (!empty($taxonomyFromFE) || !empty($taxonomyFromPage)) {
         $arrFields = $this->setFilterValues($taxonomyFromFE, $taxonomyFromPage, $arrFields);
     }
     // compass
     $arrLongLatCords = array();
     $strDistanceField = "";
     $strHavingQuery = "";
     if ($geoLocatorValues['geo_street'] || $geoLocatorValues['geo_zip'] || $geoLocatorValues['geo_city']) {
         $this->blnLocatorInvoke = true;
         $strFECountry = $this->fm_geoLocatorCountry ? $this->fm_geoLocatorCountry : '';
         $strCountry = $geoLocatorValues['geo_country'] ? $geoLocatorValues['geo_country'] : $strFECountry;
         $strGeoAddress = sprintf('%s %s %s %s, %s', $geoLocatorValues['geo_street'] ? $geoLocatorValues['geo_street'] : '', $geoLocatorValues['geo_zip'] ? $geoLocatorValues['geo_zip'] : '', $geoLocatorValues['geo_city'] ? $geoLocatorValues['geo_city'] : '', $geoLocatorValues['geo_state'] ? $geoLocatorValues['geo_state'] : '', $strCountry);
         $strGeoAddress = trim($strGeoAddress);
         if (!empty($strGeoAddress)) {
             $objGeoCords = GeoCoding::getInstance();
             $arrLongLatCords = $objGeoCords->getGeoCords($strGeoAddress, $strCountry);
         }
         if ($arrLongLatCords['lat'] == '0' && $arrLongLatCords['lng'] == '0') {
             $arrLongLatCords = array();
         }
         if (!empty($arrLongLatCords)) {
             $strDistance = $geoLocatorValues['geo_distance'] ? $geoLocatorValues['geo_distance'] : '';
             if (\Input::get('_distance')) {
                 $strDistance = \Input::get('_distance');
             }
             if ($this->fm_adaptiveZoomFactor && !empty($mapSettings)) {
                 $intDistance = (int) $strDistance;
                 $strZoom = '12';
                 if ($intDistance >= 25 && $intDistance <= 50) {
                     $strZoom = '10';
                 }
                 if ($intDistance > 50 && $intDistance <= 100) {
                     $strZoom = '8';
                 }
                 if ($intDistance > 100) {
                     $strZoom = '7';
                 }
                 $mapSettings['mapZoom'] = $strDistance ? $strZoom : $mapSettings['mapZoom'];
                 $mapSettings['lat'] = (string) $arrLongLatCords['lat'];
                 $mapSettings['lng'] = (string) $arrLongLatCords['lng'];
             }
             $strDistanceField = "3956 * 1.6 * 2 * ASIN(SQRT( POWER(SIN((" . $arrLongLatCords['lat'] . "-abs(geo_latitude)) * pi()/180 / 2),2) + COS(" . $arrLongLatCords['lat'] . " * pi()/180 ) * COS( abs(geo_latitude) *  pi()/180) * POWER(SIN((" . $arrLongLatCords['lng'] . "-geo_longitude) *  pi()/180 / 2), 2) )) AS _distance";
             $strHavingQuery = $strDistance ? " HAVING _distance < " . $strDistance . "" : "";
         }
     }
     $selectedFields = $strDistanceField ? '*, ' . $strDistanceField : '*';
     $qResult = HelperModel::generateSQLQueryFromFilterArray($arrFields);
     $qStr = $qResult['qStr'];
     $qTextSearch = $qResult['isFulltextSearch'] ? $qResult['$qTextSearch'] : '';
     //get text search results
     $textSearchResults = array();
     if ($qTextSearch) {
         $textSearchResults = QueryModel::getTextSearchResult($qTextSearch, $tablename, $wrapperID, $qResult['searchSettings']);
     }
     // get list view
     $addDetailPage = $wrapperDB['addDetailPage'];
     $rootDB = $this->Database->prepare('SELECT * FROM ' . $tablename . ' JOIN tl_page ON tl_page.id = ' . $tablename . '.rootPage WHERE ' . $tablename . '.id = ?')->execute($wrapperID)->row();
     $qOrderByStr = $this->getOrderBy();
     $qProtectedStr = ' AND published = "1"';
     //  preview mode
     if (HelperModel::previewMode()) {
         $qProtectedStr = '';
     }
     // get all items
     $listDB = $this->Database->prepare('SELECT ' . $selectedFields . ' FROM ' . $tablename . '_data WHERE pid = ' . $wrapperID . $qProtectedStr . $qStr . $strHavingQuery . $qOrderByStr)->query();
     // image size
     $imgSize = false;
     // Override the default image size
     if ($this->imgSize != '') {
         $size = deserialize($this->imgSize);
         if ($size[0] > 0 || $size[1] > 0 || is_numeric($size[2])) {
             $imgSize = $this->imgSize;
         }
     }
     $arrItems = array();
     while ($listDB->next()) {
         $arrItem = $listDB->row();
         if (HelperModel::sortOutProtected($arrItem, $this->User->groups)) {
             continue;
         }
         if (!HelperModel::outSideScope($arrItem['start'], $arrItem['stop'])) {
             continue;
         }
         // image
         $imagePath = $this->generateSingeSrc($listDB);
         if ($imagePath) {
             $arrItem['singleSRC'] = $imagePath;
         }
         if ($imgSize) {
             $arrItem['size'] = $imgSize;
         }
         // create href
         $arrItem['href'] = null;
         if ($addDetailPage == '1' && $listDB->source == 'default') {
             // reset target
             $arrItem['target'] = '';
             $arrItem['href'] = $this->generateUrl($rootDB, $arrItem['alias']);
             // $listDB->alias
         }
         if ($arrItem['source'] == 'external') {
             $arrItem['href'] = $arrItem['url'];
         }
         if ($arrItem['source'] == 'internal') {
             // reset target
             $arrItem['target'] = '';
             $jumpToDB = $this->Database->prepare('SELECT * FROM tl_page WHERE id = ?')->execute($listDB->jumpTo)->row();
             $strTaxonomyUrl = \Config::get('taxonomyDisable') ? '' : $this->generateTaxonomyUrl();
             $arrItem['href'] = $this->generateFrontendUrl($jumpToDB, $strTaxonomyUrl);
         }
         // check for text search
         if ($qTextSearch) {
             if (!$textSearchResults[$arrItem['id']]) {
                 continue;
             }
         }
         //
         $arrItems[] = $arrItem;
     }
     // set random
     if ($this->strOrderBy == 'RAND') {
         shuffle($arrItems);
     }
     //pagination
     $strPagination = '';
     $total = count($arrItems);
     $strPagination = $this->createPagination($total);
     $this->Template->pagination = $strPagination;
     $strResults = '';
     $template = $this->fm_addMap ? $this->fm_map_template : $this->f_list_template;
     $objTemplate = new FrontendTemplate($template);
     for ($i = $this->listViewOffset; $i < $this->listViewLimit; $i++) {
         $item = $arrItems[$i];
         // parse value if map is enabled
         if ($this->fm_addMap) {
             $item['geo_latitude'] = $item['geo_latitude'] ? $item['geo_latitude'] : '0';
             $item['geo_longitude'] = $item['geo_longitude'] ? $item['geo_longitude'] : '0';
             $item['title'] = mb_convert_encoding($item['title'], 'UTF-8');
             $item['description'] = mb_convert_encoding($item['description'], 'UTF-8');
             $item['info'] = mb_convert_encoding($item['info'], 'UTF-8');
         }
         if ($item['addGallery'] && $item['multiSRC'] && !$this->fm_disableGallery) {
             $objGallery = new GalleryGenerator();
             $objGallery->id = $item['id'];
             $objGallery->sortBy = $item['sortBy'];
             $objGallery->orderSRC = $item['orderSRC'];
             $objGallery->metaIgnore = $item['metaIgnore'];
             $objGallery->numberOfItems = $item['numberOfItems'];
             $objGallery->perPage = $item['perPageGallery'];
             $objGallery->perRow = $item['perRow'];
             $objGallery->size = $item['size'];
             $objGallery->fullsize = $item['fullsize'];
             $objGallery->galleryTpl = $item['galleryTpl'];
             $objGallery->getAllImages($item['multiSRC']);
             $item['gallery'] = $objGallery->renderGallery();
         }
         // set css and id
         $item['cssID'] = deserialize($item['cssID']);
         $item['itemID'] = $item['cssID'][0];
         $item['itemCSS'] = $item['cssID'][1] ? ' ' . $item['cssID'][1] : '';
         // set date format
         $date = date('Y-m-d', $item['date']);
         $time = date('H:i', $item['time']);
         $dateTime = $time ? $date . ' ' . $time : $date;
         $item['dateTime'] = $dateTime;
         $item['date'] = $item['date'] ? date($objPage->dateFormat, $item['date']) : '';
         $item['time'] = $item['time'] ? date($objPage->timeFormat, $item['time']) : '';
         // distance
         if ($item['_distance']) {
             $item['_distance'] = number_format($item['_distance'], 2, $geoLocatorValues['geoDistanceDelimiter'], $geoLocatorValues['geoDistanceDelimiter']);
             $item['_distanceLabel'] = $GLOBALS['TL_LANG']['MSC']['fm_distance'];
         }
         // set more
         $item['more'] = $GLOBALS['TL_LANG']['MSC']['more'];
         // get list view ce
         $objCte = ContentModelExtend::findPublishedByPidAndTable($item['id'], $tablename . '_data', array('fview' => 'list'));
         $arrElements = array();
         if ($objCte !== null) {
             $intCount = 0;
             $intLast = $objCte->count() - 1;
             while ($objCte->next()) {
                 $arrCss = array();
                 $objRow = $objCte->current();
                 if ($intCount == 0 || $intCount == $intLast) {
                     if ($intCount == 0) {
                         $arrCss[] = 'first';
                     }
                     if ($intCount == $intLast) {
                         $arrCss[] = 'last';
                     }
                 }
                 $objRow->classes = $arrCss;
                 $arrElements[] = $this->getContentElement($objRow, $this->strColumn);
                 ++$intCount;
             }
         }
         $item['teaser'] = $arrElements;
         // set odd and even classes
         $item['cssClass'] = $i % 2 ? ' even' : ' odd';
         //field
         if (!empty($fieldWidgets)) {
             $arrayAsValue = array('list.blank', 'list.keyValue', 'table.blank');
             foreach ($fieldWidgets as $widget) {
                 $id = $widget['fieldID'];
                 $tplName = $widget['widgetTemplate'];
                 $type = $widget['widgetType'];
                 $value = $item[$id];
                 if (in_array($type, $arrayAsValue)) {
                     $value = deserialize($value);
                 }
                 // unserialize
                 $objFieldTemplate = new FrontendTemplate($tplName);
                 $objFieldTemplate->setData(array('value' => $value, 'type' => $type, 'item' => $item));
                 $item[$id] = $objFieldTemplate->parse();
             }
         }
         // set last first classes
         if ($i == 0) {
             $item['cssClass'] .= ' first';
         }
         if ($i == $this->listViewLimit - 1) {
             $item['cssClass'] .= ' last';
         }
         // create marker path
         if ($item['addMarker'] && $item['markerSRC']) {
             if ($this->markerCache[$item['markerSRC']]) {
                 $item['markerSRC'] = $this->markerCache[$item['markerSRC']];
             } else {
                 $markerDB = $this->Database->prepare('SELECT * FROM tl_files WHERE uuid = ?')->execute($item['markerSRC']);
                 if ($markerDB->count()) {
                     $pathInfo = $markerDB->row()['path'];
                     if ($pathInfo) {
                         $this->markerCache[$item['markerSRC']] = $pathInfo;
                         $item['markerSRC'] = $pathInfo;
                     }
                 }
             }
         }
         // map settings from field
         if (!empty($mapFields)) {
             foreach ($mapFields as $map) {
                 $objMapTemplate = new FrontendTemplate($map['template']);
                 $item['mapSettings'] = $map;
                 $objMapTemplate->setData($item);
                 $item[$map['fieldID']] = $objMapTemplate->parse();
             }
         }
         // mapSettings
         if (!empty($mapSettings)) {
             $item['mapSettings'] = $mapSettings;
         }
         // set fe view id
         $item['feViewID'] = $this->feViewID;
         // set clean options
         if (!empty($arrCleanOptions)) {
             $item['cleanOptions'] = $arrCleanOptions;
             // overwrite clean options
             foreach ($arrCleanOptions as $fieldID => $options) {
                 if ($item[$fieldID] && is_string($item[$fieldID])) {
                     $arrValues = explode(',', $item[$fieldID]);
                     $arrValuesAsString = array();
                     $arrValuesAsArray = array();
                     if (is_array($arrValues)) {
                         foreach ($arrValues as $val) {
                             $arrValuesAsArray[$val] = $options[$val];
                             $arrValuesAsString[] = $options[$val];
                         }
                     }
                     $item[$fieldID . 'AsArray'] = $arrValuesAsArray;
                     $item[$fieldID] = implode(', ', $arrValuesAsString);
                 }
             }
         }
         // floating class
         $item['floatClass'] = 'float_' . $item['floating'];
         //set data
         $objTemplate->setData($item);
         $strTitle = $item['title'];
         //set image
         if ($item['addImage']) {
             $this->addImageToTemplate($objTemplate, array('singleSRC' => $item['singleSRC'], 'alt' => $item['alt'], 'title' => $item['imgTitle'], 'size' => $item['size'], 'fullsize' => $item['fullsize'], 'caption' => $item['caption']));
         }
         // set enclosure
         $objTemplate->enclosure = array();
         if ($item['addEnclosure']) {
             $this->addEnclosuresToTemplate($objTemplate, $item);
         }
         $objTemplate->title = $strTitle;
         // fix title bug
         $objTemplate->addBefore = $item['floatClass'] == 'float_below' ? false : true;
         $strResults .= $objTemplate->parse();
     }
     // set map settings
     if (!empty($mapSettings)) {
         // set map settings array to template
         $this->Template->mapSettings = $mapSettings;
         // set loadMapScript to true
         $this->loadMapScript = true;
         // load map libraries
         if (!$GLOBALS['loadGoogleMapLibraries']) {
             $GLOBALS['loadGoogleMapLibraries'] = $mapSettings['mapInfoBox'] ? true : false;
         }
     }
     // set js files
     if ($this->loadMapScript) {
         $language = $objPage->language ? $objPage->language : 'en';
         $GLOBALS['TL_HEAD']['mapJS'] = DiverseFunction::setMapJs($language);
     }
     $this->Template->feViewID = $this->feViewID;
     $this->Template->results = $total < 1 ? '<p class="no-results">' . $GLOBALS['TL_LANG']['MSC']['noResult'] . '</p>' : $strResults;
 }
Beispiel #2
0
 /**
  * @param $viewDB
  * @param $tablename
  * @return mixed
  */
 private function parseItem($viewDB, $tablename)
 {
     global $objPage;
     // cast item obj to array
     $item = $viewDB->row();
     // check permission
     if (HelperModel::sortOutProtected($item, $this->User->groups)) {
         return false;
     }
     // check scope
     if (!HelperModel::outSideScope($item['start'], $item['stop'])) {
         return false;
     }
     // parse href
     $url = '';
     if ($item['source'] == 'default' || $item['source'] == 'internal') {
         // get site
         $jumpTo = '';
         if ($item['source'] == 'internal') {
             $jumpTo = $item['jumpTo'];
         }
         if ($item['source'] == 'default') {
             $arrJumpTo = $this->Database->prepare('SELECT * FROM ' . $tablename . ' WHERE id = ?')->execute($viewDB->pid)->row();
             $jumpTo = $arrJumpTo['addDetailPage'] ? $arrJumpTo['rootPage'] : '';
         }
         // get href
         if ($jumpTo) {
             $objParent = \PageModel::findWithDetails($jumpTo);
             $domain = ($objParent->rootUseSSL ? 'https://' : 'http://') . ($objParent->domain ?: \Environment::get('host')) . TL_PATH . '/';
             $strUrl = $domain . $this->generateFrontendUrl($objParent->row(), \Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/%s' : '/items/%s', $objParent->language);
             $url = HelperModel::getLink($viewDB, $strUrl);
         }
         $item['target'] = '';
     }
     if ($item['source'] == 'external') {
         $url = $item['url'];
     }
     // parse cssID
     $cssID = deserialize($item['cssID']);
     $item['cssID'] = $cssID;
     // parse date
     $date = date('Y-m-d', $item['date']);
     $time = date('H:i', $item['time']);
     $dateTime = $time ? $date . ' ' . $time : $date;
     $item['dateTime'] = $dateTime;
     $item['date'] = $item['date'] ? date($objPage->dateFormat, $item['date']) : '';
     $item['time'] = $item['time'] ? date($objPage->timeFormat, $item['time']) : '';
     // parse href
     $item['href'] = $url;
     // parse details
     $objCte = ContentModelExtend::findPublishedByPidAndTable($item['id'], $tablename . '_data', array('fview' => 'detail'));
     $detailStr = '';
     if ($objCte !== null) {
         $intCount = 0;
         $intLast = $objCte->count() - 1;
         while ($objCte->next()) {
             $arrCss = array();
             $objRow = $objCte->current();
             if ($intCount == 0 || $intCount == $intLast) {
                 if ($intCount == 0) {
                     $arrCss[] = 'first';
                 }
                 if ($intCount == $intLast) {
                     $arrCss[] = 'last';
                 }
             }
             $objRow->classes = $arrCss;
             $detailStr .= $this->getContentElement($objRow, $this->strColumn);
             ++$intCount;
         }
     }
     $item['detail'] = $detailStr;
     // parse list
     $objCte = ContentModelExtend::findPublishedByPidAndTable($item['id'], $tablename . '_data', array('fview' => 'list'));
     $teaserStr = '';
     if ($objCte !== null) {
         $intCount = 0;
         $intLast = $objCte->count() - 1;
         while ($objCte->next()) {
             $arrCss = array();
             $objRow = $objCte->current();
             if ($intCount == 0 || $intCount == $intLast) {
                 if ($intCount == 0) {
                     $arrCss[] = 'first';
                 }
                 if ($intCount == $intLast) {
                     $arrCss[] = 'last';
                 }
             }
             $objRow->classes = $arrCss;
             $teaserStr .= $this->getContentElement($objRow, $this->strColumn);
             ++$intCount;
         }
     }
     $item['teaser'] = $teaserStr;
     // parse image
     $imagePath = $this->generateSingeSrc($viewDB);
     if ($imagePath) {
         $item['singleSRC'] = $imagePath;
     }
     // parse Gallery
     if ($item['addGallery']) {
         $objGallery = new GalleryGenerator();
         $objGallery->id = $item['id'];
         $objGallery->sortBy = $item['sortBy'];
         $objGallery->orderSRC = $item['orderSRC'];
         $objGallery->metaIgnore = $item['metaIgnore'];
         $objGallery->numberOfItems = $item['numberOfItems'];
         $objGallery->perPage = $item['perPageGallery'];
         $objGallery->perRow = $item['perRow'];
         $objGallery->size = $item['size'];
         $objGallery->fullsize = $item['fullsize'];
         $objGallery->galleryTpl = $item['galleryTpl'];
         $objGallery->getAllImages($item['multiSRC']);
         $item['gallery'] = $objGallery->renderGallery();
     }
     // parse marker
     if ($item['addMarker'] && $item['markerSRC']) {
         $markerDB = $this->Database->prepare('SELECT * FROM tl_files WHERE uuid = ?')->execute($item['markerSRC']);
         if ($markerDB->count()) {
             $pathInfo = $markerDB->row()['path'];
             if ($pathInfo) {
                 $item['markerSRC'] = $pathInfo;
             }
         }
     }
     // parse more
     $item['more'] = $GLOBALS['TL_LANG']['MSC']['more'];
     return $item;
 }