comments-bundle/src/Resources/contao/dca/tl_comments.php
public function listComments($arrRow)
	{
		$title = $GLOBALS['TL_LANG']['tl_comments'][$arrRow['source']] . ' ' . $arrRow['parent'];

		switch ($arrRow['source'])
		{
			case 'tl_content':
				$objParent = $this->Database->prepare("SELECT id, title FROM tl_article WHERE id=(SELECT pid FROM tl_content WHERE id=?)")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=article&amp;table=tl_content&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>';
				}
				break;

			case 'tl_page':
				$objParent = $this->Database->prepare("SELECT id, title FROM tl_page WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=page&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>';
				}
				break;

			case 'tl_news':
				$objParent = $this->Database->prepare("SELECT id, headline FROM tl_news WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=news&amp;table=tl_news&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->headline . '</a>';
				}
				break;

			case 'tl_faq':
				$objParent = $this->Database->prepare("SELECT id, question FROM tl_faq WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=faq&amp;table=tl_faq&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->question . '</a>';
				}
				break;

			case 'tl_calendar_events':
				$objParent = $this->Database->prepare("SELECT id, title FROM tl_calendar_events WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=calendar&amp;table=tl_calendar_events&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>';
				}
				break;

			default:
				// HOOK: support custom modules
				if (isset($GLOBALS['TL_HOOKS']['listComments']) && \is_array($GLOBALS['TL_HOOKS']['listComments']))
				{
					foreach ($GLOBALS['TL_HOOKS']['listComments'] as $callback)
					{
						$this->import($callback[0]);

						if ($tmp = $this->{$callback[0]}->{$callback[1]}($arrRow))
						{
							$title .= $tmp;
							break;
						}
					}
				}
				break;
		}

		$key = ($arrRow['published'] ? 'published' : 'unpublished') . ($arrRow['addReply'] ? ' replied' : '');

		return '
<div class="comment_wrap">
<div class="cte_type ' . $key . '"><a href="mailto:' . Contao\Idna::decodeEmail($arrRow['email']) . '" title="' . Contao\StringUtil::specialchars(Contao\Idna::decodeEmail($arrRow['email'])) . '">' . $arrRow['name'] . '</a>' . (($arrRow['website'] != '') ? ' (<a href="' . $arrRow['website'] . '" title="' . Contao\StringUtil::specialchars($arrRow['website']) . '" target="_blank" rel="noreferrer noopener">' . $GLOBALS['TL_LANG']['MSC']['com_website'] . '</a>)' : '') . ' – ' . Contao\Date::parse(Contao\Config::get('datimFormat'), $arrRow['date']) . ' – IP ' . Contao\StringUtil::specialchars($arrRow['ip']) . '<br>' . $title . '</div>
<div class="limit_height mark_links' . (!Contao\Config::get('doNotCollapse') ? ' h38' : '') . '">
' . $arrRow['comment'] . '
</div>
</div>' . "\n    ";
	}
public function listComments($arrRow)
	{
		$title = $GLOBALS['TL_LANG']['tl_comments'][$arrRow['source']] . ' ' . $arrRow['parent'];

		switch ($arrRow['source'])
		{
			case 'tl_content':
				$objParent = $this->Database->prepare("SELECT id, title FROM tl_article WHERE id=(SELECT pid FROM tl_content WHERE id=?)")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=article&amp;table=tl_content&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>';
				}
				break;

			case 'tl_page':
				$objParent = $this->Database->prepare("SELECT id, title FROM tl_page WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=page&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>';
				}
				break;

			case 'tl_news':
				$objParent = $this->Database->prepare("SELECT id, headline FROM tl_news WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=news&amp;table=tl_news&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->headline . '</a>';
				}
				break;

			case 'tl_faq':
				$objParent = $this->Database->prepare("SELECT id, question FROM tl_faq WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=faq&amp;table=tl_faq&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->question . '</a>';
				}
				break;

			case 'tl_calendar_events':
				$objParent = $this->Database->prepare("SELECT id, title FROM tl_calendar_events WHERE id=?")
											->execute($arrRow['parent']);

				if ($objParent->numRows)
				{
					$title .= ' – <a href="contao/main.php?do=calendar&amp;table=tl_calendar_events&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>';
				}
				break;

			default:
				// HOOK: support custom modules
				if (isset($GLOBALS['TL_HOOKS']['listComments']) && \is_array($GLOBALS['TL_HOOKS']['listComments']))
				{
					foreach ($GLOBALS['TL_HOOKS']['listComments'] as $callback)
					{
						$this->import($callback[0]);

						if ($tmp = $this->{$callback[0]}->{$callback[1]}($arrRow))
						{
							$title .= $tmp;
							break;
						}
					}
				}
				break;
		}

		$key = ($arrRow['published'] ? 'published' : 'unpublished') . ($arrRow['addReply'] ? ' replied' : '');

		return '
<div class="comment_wrap">
<div class="cte_type ' . $key . '"><a href="mailto:' . Contao\Idna::decodeEmail($arrRow['email']) . '" title="' . Contao\StringUtil::specialchars(Contao\Idna::decodeEmail($arrRow['email'])) . '">' . $arrRow['name'] . '</a>' . (($arrRow['website'] != '') ? ' (<a href="' . $arrRow['website'] . '" title="' . Contao\StringUtil::specialchars($arrRow['website']) . '" target="_blank" rel="noreferrer noopener">' . $GLOBALS['TL_LANG']['MSC']['com_website'] . '</a>)' : '') . ' – ' . Contao\Date::parse(Contao\Config::get('datimFormat'), $arrRow['date']) . ' – IP ' . Contao\StringUtil::specialchars($arrRow['ip']) . '<br>' . $title . '</div>
<div class="limit_height mark_links' . (!Contao\Config::get('doNotCollapse') ? ' h38' : '') . '">
' . $arrRow['comment'] . '
</div>
</div>' . "\n    ";
	}
public function listComments ( $ arrRow ) { $ title = $ GLOBALS [ 'TL_LANG' ] [ 'tl_comments' ] [ $ arrRow [ 'source' ] ] . ' ' . $ arrRow [ 'parent' ] ; switch ( $ arrRow [ 'source' ] ) { case 'tl_content' : $ objParent = $ this -> Database -> prepare ( "SELECT id, title FROM tl_article WHERE id=(SELECT pid FROM tl_content WHERE id=?)" ) -> execute ( $ arrRow [ 'parent' ] ) ; if ( $ objParent -> numRows ) { $ title .= ' – <a href="contao/main.php?do=article&amp;table=tl_content&amp;id=' . $ b jParent-> id  . ' amp;rt=' . R QUEST_TOKEN . ' >' . $ b jParent-> ti tle . ' /a>'; } break ; case 'tl_page' : $ objParent = $ this -> Database -> prepare ( "SELECT id, title FROM tl_page WHERE id=?" ) -> execute ( $ arrRow [ 'parent' ] ) ; if ( $ objParent -> numRows ) { $ title .= ' – <a href="contao/main.php?do=page&amp;act=edit&amp;id=' . $ b jParent-> id  . ' amp;rt=' . R QUEST_TOKEN . ' >' . $ b jParent-> ti tle . ' /a>'; } break ; case 'tl_news' : $ objParent = $ this -> Database -> prepare ( "SELECT id, headline FROM tl_news WHERE id=?" ) -> execute ( $ arrRow [ 'parent' ] ) ; if ( $ objParent -> numRows ) { $ title .= ' – <a href="contao/main.php?do=news&amp;table=tl_news&amp;act=edit&amp;id=' . $ b jParent-> id  . ' amp;rt=' . R QUEST_TOKEN . ' >' . $ b jParent-> he adline . ' /a>'; } break ; case 'tl_faq' : $ objParent = $ this -> Database -> prepare ( "SELECT id, question FROM tl_faq WHERE id=?" ) -> execute ( $ arrRow [ 'parent' ] ) ; if ( $ objParent -> numRows ) { $ title .= ' – <a href="contao/main.php?do=faq&amp;table=tl_faq&amp;act=edit&amp;id=' . $ b jParent-> id  . ' amp;rt=' . R QUEST_TOKEN . ' >' . $ b jParent-> qu estion . ' /a>'; } break ; case 'tl_calendar_events' : $ objParent = $ this -> Database -> prepare ( "SELECT id, title FROM tl_calendar_events WHERE id=?" ) -> execute ( $ arrRow [ 'parent' ] ) ; if ( $ objParent -> numRows ) { $ title .= ' – <a href="contao/main.php?do=calendar&amp;table=tl_calendar_events&amp;act=edit&amp;id=' . $ b jParent-> id  . ' amp;rt=' . R QUEST_TOKEN . ' >' . $ b jParent-> ti tle . ' /a>'; } break ; default : // HOOK: support custom modules if ( isset ( $ GLOBALS [ 'TL_HOOKS' ] [ 'listComments' ] ) && \ is_array ( $ GLOBALS [ 'TL_HOOKS' ] [ 'listComments' ] ) ) { foreach ( $ GLOBALS [ 'TL_HOOKS' ] [ 'listComments' ] as $ callback ) { $ this -> import ( $ callback [ 0 ] ) ; if ( $ tmp = $ this -> { $ callback [ 0 ] } -> { $ callback [ 1 ] } ( $ arrRow ) ) { $ title .= $ tmp ; break ; } } } break ; } $ key = ( $ arrRow [ 'published' ] ? 'published' : 'unpublished' ) . ( $ arrRow [ 'addReply' ] ? ' replied' : '' ) ; return '
<div class="comment_wrap">
<div class="cte_type ' . $ key . '"><a href="mailto:' . Contao \ Idna :: decodeEmail ( $ arrRow [ 'email' ] ) . '" title="' . Contao \ StringUtil :: specialchars ( Contao \ Idna :: decodeEmail ( $ arrRow [ 'email' ] ) ) . '">' . $ arrRow [ 'name' ] . '</a>' . ( ( $ arrRow [ 'website' ] != '' ) ? ' (<a href="' . $ arrRow [ 'website' ] . '" title="' . Contao \ StringUtil :: specialchars ( $ arrRow [ 'website' ] ) . '" target="_blank" rel="noreferrer noopener">' . $ GLOBALS [ 'TL_LANG' ] [ 'MSC' ] [ 'com_website' ] . '</a>)' : '' ) . ' – ' . C ntao\D a te:: pa rse(C o ntao\C o nfig:: ge t(' d atimFormat'), $ r rRow[' d ate']) . ' – IP ' . C n ao\Str i ngUtil::sp ec ialchars($ar r R ow['ip ' ]) . ' b >' . $ i l e . ' / iv>
<div class="limit_height mark_links' . ( ! Contao \ Config :: get ( 'doNotCollapse' ) ? ' h38' : '' ) . '">
' . $ arrRow [ 'comment' ] . '
</div>
</div>' . "\n    " ; }
List a particular record

@param array $arrRow

@return string
List a particular record