<?php
namespace App\Controller;
use Pimcore\Controller\FrontendController;
use Pimcore\Model\DataObject;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DocumentController extends FrontendController
{
/**
* @Template
*/
public function defaultAction(Request $request)
{
return [];
}
public function cardCarouselFolderAction(Request $request): Response
{
$params = ["layoutMode" => $request->get("layoutMode")];
$dataObjectId = $request->get('id');
if ($dataObjectId && $request->get('type') === DataObject::OBJECT_TYPE_OBJECT && $request->get('subtype') === DataObject::OBJECT_TYPE_FOLDER) {
$params['dataObjectFolder'] = DataObject\Folder::getById($dataObjectId);
}
return $this->render("document/card-carousel/carousel.html.twig", $params);
}
public function staffMembersAction(Request $request): Response
{
$params = [];
$dataObjectId = $request->get('id');
if ($dataObjectId && $request->get('type') === DataObject::OBJECT_TYPE_OBJECT && $request->get('subtype') === DataObject::OBJECT_TYPE_FOLDER) {
$params['dataObjectFolder'] = DataObject\Folder::getById($dataObjectId);
}
return $this->render("document/staff-members/staff-members.html.twig", $params);
}
public function staffMemberBios(Request $request): Response
{
$params = [];
$dataObjectId = $request->get('id');
if ($dataObjectId && $request->get('type') === DataObject::OBJECT_TYPE_OBJECT && $request->get('subtype') === DataObject::OBJECT_TYPE_FOLDER) {
$params['dataObjectFolder'] = DataObject\Folder::getById($dataObjectId);
}
return $this->render("document/staff-members/staff-member-bios.html.twig", $params);
}
public function torqServiceAction(Request $request): Response
{
$params = ["layoutMode" => $request->get("layoutMode")];
$dataObjectId = $request->get('id');
if ($dataObjectId && $request->get('type') === DataObject::OBJECT_TYPE_OBJECT && $request->get('subtype') === DataObject::OBJECT_TYPE_FOLDER) {
$params['dataObjectFolder'] = DataObject\Folder::getById($dataObjectId);
}
return $this->render("document/data-object-cards/data-object-cards.html.twig", $params);
}
}