Eldy wrote:
>
> I developped a theme for webmin and usermin that offer to use
> webmin/usermin with a frame
> on left (from idea of gehrigal theme with some enhancement and a more
> professional look).
> It also add the graphical icon in the header of modules page making them
> all pages nicer.
> The theme works on webmin and usermin, however I need to add, in my
> theme code, some
> different codes for webmin or usermin page (Change icon in left frame,
> change color to help
> login users to differentiate if they are in an admin or user area,
> etc...). I didn't find in "building
> a theme documentation" an API to know if theme is running on webmin OR
> usermin.
>
> Is there a trick I can use to differentiate them ?
What I usually do is have two different versions of the theme.info
file, one for Usermin and one for Webmin. The Usermin file has a
usermin=1 line, which you can check for with code like :
%tinfo = &get_theme_info($current_theme);
if ($tinfo{'usermin'}) {
# whatever ..
}
Currently, Webmin does not enforce the rule that Usermin themes have a
usermin=1 line in their theme.info files, as it does with modules.
However, this may change in future to prevent themes from one program
being installed into the other ..
- Jamie
|