but if anyone had got any ideas on how to make it a OnManger plugin event that would be cool. // load template file
$tplFile = $base_path.'manager/media/style/'.$manager_theme.'/welcome.html';
$handle = fopen($tplFile, "r");
$tpl = fread($handle, filesize($tplFile));
fclose($handle);
// merge placeholders
$tpl = $modx->mergePlaceholderContent($tpl);
$tpl = preg_replace('~\[\+(.*?)\+\]~', '', $tpl); //cleanup
//echo $tpl;// Welcome page switch - START
$role = $_SESSION['mgrRole'];
// Mod welcome
$tplWelcomeMod = $base_path.'manager/media/style/'.$manager_theme.'/welcome_mod.html';
$handle1 = fopen($tplWelcomeMod, "r");
$tplMod = fread($handle1, filesize($tplWelcomeMod));
fclose($handle1);
$tplMod = $modx->mergePlaceholderContent($tplMod);
$tplMod = preg_replace('~\[\+(.*?)\+\]~', '', $tplMod); //cleanup
$tplFile = $base_path.'manager/media/style/'.$manager_theme.'/welcome.html';
$handle2 = fopen($tplFile, "r");
$tpl = fread($handle2, filesize($tplFile));
fclose($handle2);
$tpl = $modx->mergePlaceholderContent($tpl);
$tpl = preg_replace('~\[\+(.*?)\+\]~', '', $tpl); //cleanup
if ( $role != '1' )
echo $tplMod;
else
echo $tpl;
// Welcome page switch - END
//<?php
GLOBAL $manager_theme,$action;
$e = & $modx->Event;
switch ($e->name) {
case 'OnManagerPageInit':
$role = $_SESSION['mgrRole'];
if($action==2 && $role!=1){
$manager_theme .= '/nonadmin';
}
break;
}
Not without it's perils, but here's a start.
Plugin event: OnManagerPageInit
//<!--?php GLOBAL $manager_theme,$action; $e = & $modx--->Event; switch ($e->name) { case 'OnManagerPageInit': $role = $_SESSION['mgrRole']; if($action==2 && $role!=1){ $manager_theme .= '/nonadmin'; } break; }
This should change the theme ($manager_theme) folder for the welcome page only and only for non-admin manager users.
Create a 'nonadmin' folder underneath each theme and place a custom welcome.html (and any related style/image files) in there. A warning though. You'll have to figure out what styles and images are affected and which are not.
}
else {
$target = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
$welcome_tpl = file_get_contents($target);
}