now also displays the room information inside a modal and does not redirect to the content site

This commit is contained in:
SimonGschnell
2024-06-18 15:03:36 +02:00
parent b3dfcdc295
commit 6230aa47ae
5 changed files with 117 additions and 7 deletions
@@ -33,7 +33,8 @@ class Ort extends FHCAPI_Controller
{
// NOTE(chris): additional permission checks will be done in SearchBarLib
parent::__construct([
'ContentID' => self::PERM_LOGGED
'ContentID' => self::PERM_LOGGED,
'getOrtKurzbzContent' => self::PERM_LOGGED,
]);
$this->load->model('ressource/Ort_model', 'OrtModel');
@@ -67,5 +68,28 @@ class Ort extends FHCAPI_Controller
$this->terminateWithSuccess($result->content_id ?? NULL);
}
/**
* @param int $version
* @param string $sprache
* @param boolean $sichtbar
*
* @return $content
*/
public function getOrtKurzbzContent($version = null, $sprache = null, $sichtbar = true)
{
$content_id = $this->input->get("content_id",TRUE);
$this->load->library('CmsLib');
$content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar);
if (isError($content))
$this->terminateWithError(getError($content), self::ERROR_TYPE_GENERAL);
$content = hasData($content) ? getData($content) : null;
$this->terminateWithSuccess($content);
}
}