<?php
$groups = $modx->db->select("name, documentgroup", "`modx_member_groups` as g INNER JOIN `modx_membergroup_names` as n ON g.user_group = n.id INNER JOIN modx_membergroup_access as a ON g.user_group = a.membergroup", "g.member = ".$_SESSION['mgrInternalKey'], "n.name");
$numgroups = mysql_numrows($groups);
$i = 0;
while($i < $numgroups) {
$docgroup = mysql_result($groups,$i,"documentgroup");
$name = mysql_result($groups,$i,"name");
$documents = $modx->db->select("document, pagetitle", "modx_document_groups INNER JOIN modx_site_content ON document = modx_site_content.id", "document_group = ".$docgroup);
$numdocuments = mysql_numrows($documents);
echo $name . '<ul>';
$x = 0;
while ($x < $numdocuments) {
$docid = mysql_result($documents,$x,"document");
$title = mysql_result($documents,$x,"pagetitle");
echo '<li><a href="[~'.$docid.'~]">'.$title.'</a></li>';
$x++;
}
echo '</ul>';
$i++;
}
?>
As it says on the box, just outputs a list of all the pages the logged in manager has access to grouped by document group.clicking on those links will open the document (ready to edit)?
There’s no error checking, so it will throw a parse error if you’re not logged in, however I’m using this as part of a ManagerLogin tpl, so it only shows when the manager is logged in
however I’m using this as part of a ManagerLogin tpl, so it only shows when the manager is logged in.these threads could be interesting for you:
OnManagerWelcomePrerender -> before the contenthttp://modxcms.com/forums/index.php/topic,43572.msg260167.html#msg260167
OnManagerWelcomeHome -> in the home tab
OnManagerWelcomeRender -> after the content
Just add the manager action TO a href="...[~’.$docid.’~]...ah, sure...i tottally need to play with this

echo '<li><a href="[~'.$docid.'~]?a=27">'.$title.'</a></li>';

// <?php
$e = &$modx->Event;
$output ='';
switch($e->name) {
case 'OnManagerWelcomeHome':
$groups = $modx->db->select("name, documentgroup", "`modx_member_groups` as g INNER JOIN `modx_membergroup_names` as n ON g.user_group = n.id INNER JOIN modx_membergroup_access as a ON g.user_group = a.membergroup", "g.member = ".$_SESSION['mgrInternalKey'], "n.name");
$numgroups = mysql_numrows($groups);
$i = 0;
while($i < $numgroups) {
$docgroup = mysql_result($groups,$i,"documentgroup");
$name = mysql_result($groups,$i,"name");
$documents = $modx->db->select("document, pagetitle", "modx_document_groups INNER JOIN modx_site_content ON document = modx_site_content.id", "document_group = ".$docgroup);
$numdocuments = mysql_numrows($documents);
$output = $output . $name . '<ul>';
$x = 0;
while ($x < $numdocuments) {
$docid = mysql_result($documents,$x,"document");
$title = mysql_result($documents,$x,"pagetitle");
$output = $output . '<li><a href="index.php?a=27&id='.$docid.'">'.$title.'</a></li>';
$x++;
}
$output = $output . '</ul>';
$i++;
}
break;
default:
$output = '';
break;
}
$e->output($output);
return;