Skip to content

Commit

Permalink
Also remove tl_calendar_events::getArticleAlias
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Nov 22, 2023
1 parent ed2f822 commit 47ea4c1
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions calendar-bundle/contao/dca/tl_calendar_events.php
Expand Up @@ -786,58 +786,6 @@ public function listEvents($arrRow)
return '<div class="tl_content_left">' . $arrRow['title'] . ' <span class="label-info">[' . $date . ']</span></div>';
}

/**
* Get all articles and return them as array
*
* @param DataContainer $dc
*
* @return array
*/
public function getArticleAlias(DataContainer $dc)
{
$arrPids = array();
$arrAlias = array();

$db = Database::getInstance();
$user = BackendUser::getInstance();

if (!$user->isAdmin)
{
foreach ($user->pagemounts as $id)
{
$arrPids[] = array($id);
$arrPids[] = $db->getChildRecords($id, 'tl_page');
}

if (!empty($arrPids))
{
$arrPids = array_merge(...$arrPids);
}
else
{
return $arrAlias;
}

$objAlias = $db->execute("SELECT a.id, a.title, a.inColumn, p.title AS parent FROM tl_article a LEFT JOIN tl_page p ON p.id=a.pid WHERE a.pid IN(" . implode(',', array_map('\intval', array_unique($arrPids))) . ") ORDER BY parent, a.sorting");
}
else
{
$objAlias = $db->execute("SELECT a.id, a.title, a.inColumn, p.title AS parent FROM tl_article a LEFT JOIN tl_page p ON p.id=a.pid ORDER BY parent, a.sorting");
}

if ($objAlias->numRows)
{
System::loadLanguageFile('tl_article');

while ($objAlias->next())
{
$arrAlias[$objAlias->parent][$objAlias->id] = $objAlias->title . ' (' . ($GLOBALS['TL_LANG']['COLS'][$objAlias->inColumn] ?? $objAlias->inColumn) . ', ID ' . $objAlias->id . ')';
}
}

return $arrAlias;
}

/**
* Add the source options depending on the allowed fields (see #5498)
*
Expand Down

0 comments on commit 47ea4c1

Please sign in to comment.