Файл: contao-3.5.8/system/modules/comments/modules/ModuleComments.php
Строк: 49
<?php
/**
* Contao Open Source CMS
*
* Copyright (c) 2005-2016 Leo Feyer
*
* @license LGPL-3.0+
*/
namespace Contao;
/**
* Class ModuleComments
*
* @author Leo Feyer <https://github.com/leofeyer>
*/
class ModuleComments extends Module
{
/**
* Template
* @var string
*/
protected $strTemplate = 'ce_comments';
/**
* Display a wildcard in the back end
*
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE')
{
/** @var BackendTemplate|object $objTemplate */
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['comments'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
return parent::generate();
}
/**
* Generate the module
*/
protected function compile()
{
/** @var PageModel $objPage */
global $objPage;
$this->import('Comments');
$objConfig = new stdClass();
$objConfig->perPage = $this->perPage;
$objConfig->order = $this->com_order;
$objConfig->template = $this->com_template;
$objConfig->requireLogin = $this->com_requireLogin;
$objConfig->disableCaptcha = $this->com_disableCaptcha;
$objConfig->bbcode = $this->com_bbcode;
$objConfig->moderate = $this->com_moderate;
$this->Comments->addCommentsToTemplate($this->Template, $objConfig, 'tl_page', $objPage->id, $GLOBALS['TL_ADMIN_EMAIL']);
}
}