Danke Andreas.
Ich habe es jetzt so gelöst. Da diese Redakteure nur einen (vielleicht einmal ein wenig mehr) Artikel bearbeiten dürfen, ist das übersichtlich genug.
In einer eigenen tl_article.php:
PHP-Code:
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
if ($this->Input->get('do')=='article' && !($this->Input->get('table'))) {
// 1 = Group id of "Kreis Redakteur"; Special article listing only for this User Group
if (in_array('1', $this->User->groups, true))
{
// change sorting mode for this UserGroup
$GLOBALS['TL_DCA']['tl_article']['list']['sorting']['mode'] = 0;
$showOnlyMaincolumn = new tl_article_main;
$GLOBALS['TL_DCA']['tl_article']['list']['sorting']['root'] = $showOnlyMaincolumn->getArticlesMaincolumn();
}
}
class tl_article_main extends tl_article
{
public function getArticlesMaincolumn()
/* returns ids of Articles in Column "main" of Pagemounts from Current User */
{
$objArticle = $this->Database->execute("SELECT id FROM tl_article WHERE pid IN(".implode(',', $this->User->pagemounts).") AND inColumn='main' ORDER BY sorting");
if ($objArticle->numRows > 0)
{
$rows = $objArticle->fetchAllAssoc();
foreach ($rows as $row) {
$ids[] = $row['id'];
}
}
return ($ids);
}
} ?>
Das Ganze in einem onload_callback hat nicht funktioniert. (warum?)
im Code hat sich ein kleiner Fehler eingeschlichen: if ($objArticle->numRows > 1) ausgebessert in: if ($objArticle->numRows > 0) (geändert am 10.5.2013)
Lesezeichen