/**
  * Generate the module
  */
 protected function compile()
 {
     global $objPage;
     $this->Template->client = '';
     $this->Template->referer = 'javascript:history.go(-1)';
     $this->Template->back = $GLOBALS['TL_LANG']['MSC']['goBack'];
     // Get the clients item
     $objClient = \PortfolioClientModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->portfolio_client_categories);
     if ($objClient === null) {
         // Do not index or cache the page
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         // Send a 404 header
         header('HTTP/1.1 404 Not Found');
         $this->Template->clients = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>';
         return;
     }
     $arrClient = $this->parseClient($objClient);
     $this->Template->clients = $arrClient;
     // Get the projects items
     $objProjects = \PortfolioProjectModel::findPublishedByClientId($objClient->id);
     $this->Template->projects = '';
     if ($objProjects !== null) {
         $arrProjects = $this->parseProjects($objProjects);
         $this->Template->projects = $arrProjects;
     }
     // Overwrite the page title (see #2853 and #4955)
     if ($objClient->title != '') {
         $objPage->pageTitle = strip_tags(strip_insert_tags($objClient->title));
     }
 }