private function createC4gForumResult($objLayer, $secondFetch) { $stringClass = $GLOBALS['con4gis']['stringClass']; // ToDo: evtl. in con4gis_forum auslagern $arrReturn = array(); /*$arrReturn['type'] = 'c4gforum'; $arrReturn['entries'] = array();*/ $layers = C4gMapsModel::findAll(); $layerNames = array(); while ($layers->next()) { $layerNames[] = $layers->name; } $arrBoards = deserialize($objLayer->forums, true); $objBoardPosts = \Database::getInstance()->prepare("SELECT tl_c4g_forum_post.*,\n tl_c4g_forum_thread.name as threadName,\n tl_c4g_forum.map_tooltip as tooltipSource\n FROM tl_c4g_forum_post\n LEFT JOIN tl_c4g_forum_thread ON tl_c4g_forum_thread.id = tl_c4g_forum_post.pid\n LEFT JOIN tl_c4g_forum ON tl_c4g_forum.id = forum_id\n WHERE forum_id IN(" . implode(',', $arrBoards) . ")")->execute(); if ($objBoardPosts->numRows) { while ($objBoardPosts->next()) { // skip layers, when an explicit layer is requested, since the skipped layers have been reassigned already if ($secondFetch && in_array($objBoardPosts->threadName, $layerNames)) { continue; } // check tooltip switch ($objBoardPosts->tooltipSource) { case 'SUBJ': $mapTooltip = $objBoardPosts->subject; break; case 'LINK': $mapTooltip = $objBoardPosts->linkname; break; case 'CUST': $mapTooltip = $objBoardPosts->loc_tooltip; break; case 'OFF': // fallthrough // fallthrough default: // no tootltip $mapTooltip = ''; break; } $objAsLayer = (object) array('location_type' => 'single', 'loc_geox' => $objBoardPosts->loc_geox, 'loc_geoy' => $objBoardPosts->loc_geoy, 'id' => $objBoardPosts->id, 'tooltip' => $mapTooltip); $arrReturn[] = array("id" => "tl_c4g_forum_post_" . $objBoardPosts->id, "type" => "GeoJSON", "threadName" => $stringClass::decodeEntities($objBoardPosts->threadName), "format" => "GeoJSON", "origType" => "c4gforum:single", "locationStyle" => $objBoardPosts->locstyle, "data" => $this->createGeoJsonResult($objAsLayer, 'tl_c4g_forum_post')); } } return $arrReturn; }