Just typing aloud here, so to speak...
Looks like the template selector's wrapped into a custom head tag function in comprofiler.class.php (around line 1431):
[code:1]
function selectTemplate($ui) {
global $mosConfig_live_site, $ueConfig;
if ($ui==1) $templatedir=$ueConfig;
else $templatedir="luna";
return $mosConfig_live_site . '/components/com_comprofiler/plugin/templates/'.$templatedir.'/';
}
[/code:1]
Then there are two functions right after it that append the stylesheet to either the page header or where the component starts, depending on whether you need the page to be XHTML compliant or not...
[code:1]
function addCbHeadTag($ui,$text) {
global $mainframe, $ueConfig;
if ($ui==1 && method_exists($mainframe,"addCustomHeadTag"«») && isset($ueConfig) && $ueConfig) {
$mainframe->addCustomHeadTag($text);
} else {
echo $text;
}
}
function outputCbTemplate($ui) {
addCbHeadTag($ui, '<link type="text/css" rel="stylesheet" href="' . selectTemplate($ui) . 'template.css" />');
}
[/code:1]
Simple enough, but that selectTemplate() function is hard-coded to retrieve a particular template from the component's configuration, and not a user-defined field or parameter. That might make a plugin for controlling template output a little tricky without a core change.