Here is something you can use if you want to have you Drupal fieldsets collapsed in some context, but not in others.
In this example, we want normal users to have uncollapsed fieldsets (because they have only one, categories, and you may as well not force them to click on it), and administrators (who have many fieldsets) to have them collapsed.
1. In your page.tpl.php (or equivalent if you are not using phpTemplate) :
/* Assume you have a variable $is_logged which is true when a user is logged, and a variable
$is_admin which is true when a user is the administrator */
<head>
<title><?php print $head_title ?></title>
<?php print $head ?>
<?php print $styles ?>
<? if ($is_logged && !$is_admin) { ?>
<script type="text/javascript" src="/themes/mytheme/js/uncollapse.js"></script>
<? } ?>
</head>
[...]
2. This is uncollapse.js :
if (isJsEnabled()) {
addLoadEvent(uncollapse);
}
function uncollapse() {
var fieldsets = document.getElementsByTagName('fieldset');
for (var i = 0; fieldset = fieldsets[i]; i++) {
if (!hasClass(fieldset, 'collapsible')) continue;
if (hasClass(fieldset, 'collapsed')) {
removeClass(fieldset, 'collapsed');
}
}
}
Their may be a better way (rather than let drupal collapse the elements, and uncollapse them afterwards), but I could not see it.