system/modules/47_CustomModule/library/CustomModule/Frontend/Modules/AffilliateDetectId.php line 54

Open in your IDE?
  1. <?php
  2. /**
  3.  * Studienkreis Tourismus | Custom Module for Contao Open Source CMS
  4.  *
  5.  * Copyright (C) 2017 47GradNord - Agentur für Internetlösungen
  6.  *
  7.  * @license    commercial
  8.  * @author     Holger Neuner
  9.  */
  10. namespace CustomModule\Frontend\Modules;
  11. use Contao\FilesModel;
  12. use Contao\Module;
  13. use Contao\PageModel;
  14. use CustomModule\AffilliatePartner\SessionService;
  15. class AffilliateDetectId extends Module
  16. {
  17.     /** @var bool|string */
  18.     protected $affilliateId false;
  19.     /**
  20.      * Display a wildcard in the back end
  21.      *
  22.      * @return string
  23.      */
  24.     public function generate()
  25.     {
  26.         if (TL_MODE == 'BE')
  27.         {
  28.             /** @var \BackendTemplate|object $objTemplate */
  29.             $objTemplate = new \BackendTemplate('be_wildcard');
  30.             $objTemplate->wildcard '### ' utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['47_ModAffilliateDetectId'][0]) . ' ###';
  31.             $objTemplate->title $this->headline;
  32.             $objTemplate->id $this->id;
  33.             $objTemplate->link $this->name;
  34.             $objTemplate->href 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' $this->id;
  35.             return $objTemplate->parse();
  36.         }
  37.         $this->affilliateId = \Input::get('partner');
  38.         return parent::generate();
  39.     }
  40.     /**
  41.      * Generate the module
  42.      */
  43.     protected function compile()
  44.     {
  45.         $affilliatePartner = new SessionService($this->affilliateId);
  46.         if ( $affilliatePartner->getAffilliateId() )
  47.         {
  48.              // $GLOBALS['TL_HEAD'][] = '<link rel="stylesheet" href="'.FilesModel::findByUuid($affilliatePartner->getAffilliatePartner()->style)->path.'">';
  49.             
  50.         }
  51.     }
  52. }