vendor/terminal42/contao-node/src/FrontendModule/NodesModule.php line 39

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * Node Bundle for Contao Open Source CMS.
  5.  *
  6.  * @copyright  Copyright (c) 2019, terminal42 gmbh
  7.  * @author     terminal42 <https://terminal42.ch>
  8.  * @license    MIT
  9.  */
  10. namespace Terminal42\NodeBundle\FrontendModule;
  11. use Contao\Module;
  12. use Contao\StringUtil;
  13. use Contao\System;
  14. use Terminal42\NodeBundle\ContentElement\NodesContentElement;
  15. class NodesModule extends Module
  16. {
  17.     /**
  18.      * Template.
  19.      *
  20.      * @var string
  21.      */
  22.     protected $strTemplate 'mod_nodes';
  23.     /**
  24.      * @var array
  25.      */
  26.     protected $nodes;
  27.     /**
  28.      * Display a wildcard in the back end.
  29.      *
  30.      * @return string
  31.      */
  32.     public function generate()
  33.     {
  34.         if (=== \count($ids StringUtil::deserialize($this->objModel->nodestrue))) {
  35.             return '';
  36.         }
  37.         // Display the backend wildcard
  38.         if (TL_MODE === 'BE') {
  39.             return NodesContentElement::generateBackendWildcard($this->arrData$ids);
  40.         }
  41.         $this->nodes System::getContainer()->get('terminal42_node.manager')->generateMultiple($ids);
  42.         if (=== \count($this->nodes)) {
  43.             return '';
  44.         }
  45.         return parent::generate();
  46.     }
  47.     /**
  48.      * Generate the module.
  49.      */
  50.     protected function compile(): void
  51.     {
  52.         $this->Template->nodes $this->nodes;
  53.     }
  54. }