src/bekanntmacher/boxmaker-bundle/src/Module/HeaderCart.php line 64

Open in your IDE?
  1. <?php
  2. /*
  3.  * Copyright Bekanntmacher
  4.  *
  5.  * @author Simon Wohler <s.wohler@bekanntmacher.ch>
  6.  * @license    commercial
  7.  */
  8. namespace Bekanntmacher\BoxmakerBundle\Module;
  9. use Bekanntmacher\BoxmakerBundle\Classes\Config;
  10. use Bekanntmacher\BoxmakerBundle\Classes\UserInput;
  11. use Bekanntmacher\BoxmakerBundle\Model\FarbeModel;
  12. use Bekanntmacher\BoxmakerBundle\Model\TypeModel;
  13. use Bekanntmacher\BoxmakerBundle\Model\ConfigModel;
  14. use Bekanntmacher\BoxmakerBundle\Model\WelleModel;
  15. use Bekanntmacher\BoxmakerBundle\Model\TypeOptionModel;
  16. use Mpdf;
  17. use Contao\File;
  18. use Haste\Form\Form;
  19. /**
  20.  * Boxmaker Typelist
  21.  */
  22. class HeaderCart extends TypeUtil
  23. {
  24.     /**
  25.      * @var string Template
  26.      */
  27.     protected $strTemplate 'mod_boxmaker_headercart';
  28.     /**
  29.      * Display a wildcard in the back end
  30.      * @return string
  31.      */
  32.     public function generate()
  33.     {
  34.         // Display a wildcard in the back end
  35.         if (TL_MODE === 'BE')
  36.         {
  37.             $template =new \BackendTemplate('be_wildcard');
  38.             $template->wildcard '### BOXMAKER HEADER CART ###';
  39.             $template->title $this->name;
  40.             $template->id $this->id;
  41.             $template->link $this->name;
  42.             $template->href 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' $this->id;
  43.         }
  44.         return parent::generate();
  45.     }
  46.     /**
  47.      * Generate the module
  48.      */
  49.     protected function compile()
  50.     {
  51.         // Link zum Warenkorb
  52.         $session = \System::getContainer()->get('session');
  53.         $objJumpToCart = \PageModel::findByPk($this->boxmaker_jumpToCart);
  54.         if($objJumpToCart !== null) {
  55.             $this->Template->boxmaker_jumpToCart $objJumpToCart->getFrontendUrl();
  56.         }
  57.         $this->Template->cartCount count((array)$session->get('mybox_cart'));
  58.     }
  59. }