public function loadModalContent()
	{
		global $objPage;

		$id = \Input::get('modal');

		if($id == '')
		{
			return;
		}

		$page = \Input::get('page');

		// load layout because we need to initiate bootstrap
		/** @var \PageModel $objPage */
		$objPage = \PageModel::findByPk($page);
		$objPage->loadDetails();

		if($objPage === null)
		{
			$this->log(sprintf('Page ID %s not found', $page), 'Netzmacht\Bootstrap\Ajax::loadModalContent', TL_ERROR);
			exit;
		}

		$objLayout = $this->getPageLayout($objPage);

		// Set the layout template and template group
		$objPage->template = $objLayout->template ?: 'fe_page';
		$objPage->templateGroup = $objLayout->getRelated('pid')->templates;

		// trigger getPageLayout hook so
		if(isset($GLOBALS['TL_HOOKS']['getPageLayout']) && is_array($GLOBALS['TL_HOOKS']['getPageLayout']))
		{
			foreach($GLOBALS['TL_HOOKS']['getPageLayout'] as $hook)
			{
				$this->import($hook[0]);
				$this->{$hook[0]}->{$hook[1]}($objPage, $objLayout, $this);
			}
		}

		$model = \ModuleModel::findOneBy('type="bootstrap_modal" AND tl_module.id', $id);

		if($model === null)
		{
			exit;
		}

		$model->isAjax = true;
		$this->output($this->getFrontendModule($model));
	}
public function loadModalContent()
	{
		global $objPage;

		$id = \Input::get('modal');

		if($id == '')
		{
			return;
		}

		$page = \Input::get('page');

		// load layout because we need to initiate bootstrap
		/** @var \PageModel $objPage */
		$objPage = \PageModel::findByPk($page);
		$objPage->loadDetails();

		if($objPage === null)
		{
			$this->log(sprintf('Page ID %s not found', $page), 'Netzmacht\Bootstrap\Ajax::loadModalContent', TL_ERROR);
			exit;
		}

		$objLayout = $this->getPageLayout($objPage);

		// Set the layout template and template group
		$objPage->template = $objLayout->template ?: 'fe_page';
		$objPage->templateGroup = $objLayout->getRelated('pid')->templates;

		// trigger getPageLayout hook so
		if(isset($GLOBALS['TL_HOOKS']['getPageLayout']) && is_array($GLOBALS['TL_HOOKS']['getPageLayout']))
		{
			foreach($GLOBALS['TL_HOOKS']['getPageLayout'] as $hook)
			{
				$this->import($hook[0]);
				$this->{$hook[0]}->{$hook[1]}($objPage, $objLayout, $this);
			}
		}

		$model = \ModuleModel::findOneBy('type="bootstrap_modal" AND tl_module.id', $id);

		if($model === null)
		{
			exit;
		}

		$model->isAjax = true;
		$this->output($this->getFrontendModule($model));
	}
public function loadModalContent ( ) { global $ objPage ; $ id = \ Input :: get ( 'modal' ) ; if ( $ id == '' ) { return ; } $ page = \ Input :: get ( 'page' ) ; // load layout because we need to initiate bootstrap /** @var \PageModel $objPage */ $ objPage = \ PageModel :: findByPk ( $ page ) ; $ objPage -> loadDetails ( ) ; if ( $ objPage === null ) { $ this -> log ( sprintf ( 'Page ID %s not found' , $ page ) , 'Netzmacht\Bootstrap\Ajax::loadModalContent' , TL_ERROR ) ; exit ; } $ objLayout = $ this -> getPageLayout ( $ objPage ) ; // Set the layout template and template group $ objPage -> template = $ objLayout -> template ? : 'fe_page' ; $ objPage -> templateGroup = $ objLayout -> getRelated ( 'pid' ) -> templates ; // trigger getPageLayout hook so if ( isset ( $ GLOBALS [ 'TL_HOOKS' ] [ 'getPageLayout' ] ) && is_array ( $ GLOBALS [ 'TL_HOOKS' ] [ 'getPageLayout' ] ) ) { foreach ( $ GLOBALS [ 'TL_HOOKS' ] [ 'getPageLayout' ] as $ hook ) { $ this -> import ( $ hook [ 0 ] ) ; $ this -> { $ hook [ 0 ] } -> { $ hook [ 1 ] } ( $ objPage , $ objLayout , $ this ) ; } } $ model = \ ModuleModel :: findOneBy ( 'type="bootstrap_modal" AND tl_module.id' , $ id ) ; if ( $ model === null ) { exit ; } $ model -> isAjax = true ; $ this -> output ( $ this -> getFrontendModule ( $ model ) ) ; }
load modal content
load modal content