/**
  * Das Modul generieren.
  *
  * Werte für das Template bereitstellen.
  *
  * @return void
  */
 protected function compile()
 {
     // Suche in Datenbank nach einem Modul des Typs 'nlsh_easy_Piwik_Module',
     $objPiwikModule = \ModuleModel::findOneBy('type', 'nlsh_easy_Piwik_Counter');
     // Wenn Modul vorhanden
     if ($objPiwikModule !== NULL) {
         // Impressumstext hinzufügen
         $arrEasyPiwikImpressum['impressumtext'] = $objPiwikModule->nlsh_piwik_impressum;
         // Abschalten einbinden, falls erwünscht und URL vorhanden
         if ($objPiwikModule->nlsh_piwik_noscan == TRUE && $objPiwikModule->nlsh_piwik_domain == TRUE) {
             // Pfad zur Website mit scheme "http://" vorbelegen,
             // falls scheme nicht vorhanden
             $parseUrl = parse_url($objPiwikModule->nlsh_piwik_domain);
             if (!$parseUrl['scheme']) {
                 $objPiwikModule->nlsh_piwik_domain = 'http://' . $objPiwikModule->nlsh_piwik_domain;
             }
             // Pfad zur CSS- Datei hinzufügen
             $urlCssOptOut = $this->Environment->url . $GLOBALS['TL_CONFIG']['websitePath'] . '/files/nlsh_piwik_counter_' . $objPiwikModule->id . '.css';
             // HTML- String für das iframe erzeugen und hinzufügen
             $arrEasyPiwikImpressum['piwiknoscan'] = sprintf("<iframe class =\"piwikiframe\" frameborder=\"0\" src=\"%s/index.php?module=CoreAdminHome&amp;action=optOut&amp;language=%s&amp;css=%s\"></iframe>", $objPiwikModule->nlsh_piwik_domain, $GLOBALS['TL_LANGUAGE'], $urlCssOptOut);
         }
     } else {
         // Fehlermeldung, wenn kein PIWIK- Modul vorhanden
         $arrEasyPiwikImpressum['nopiwikmodul'] = $GLOBALS['TL_LANG']['MSC']['nlsh_easy_Piwik_ContentImpressum']['nopiwikmodul'];
     }
     // und ab in das Template
     $this->Template->piwikimpressum = (object) $arrEasyPiwikImpressum;
 }
Example #2
0
 /**
  * load modal content
  */
 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));
 }
Example #3
0
 /**
  * Generate the order details view when editing an order
  *
  * @param object $dc
  *
  * @return string
  */
 public function generateOrderDetails($dc)
 {
     $objOrder = Order::findByPk($dc->id);
     if ($objOrder === null) {
         return '';
     }
     $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/print.min.css|print');
     // Try to find a order details module or create a dummy FE module model
     if (($objModuleModel = \ModuleModel::findOneBy('type', 'iso_orderdetails')) === null) {
         $objModuleModel = new \ModuleModel();
         $objModuleModel->type = 'iso_orderdetails';
         $objModuleModel->iso_collectionTpl = 'iso_collection_default';
     }
     // Generate a regular order details module
     \Input::setGet('uid', $objOrder->uniqid);
     $objModule = new OrderDetails($objModuleModel);
     return Haste::getInstance()->call('replaceInsertTags', $objModule->generate(true));
 }