Is there a way to know the type of output inside a template file? I am making a website for both WAP and smartphone browser, and I am using two themes to display WML and HTML. Now I have a problem to show a &lt;anchor&gt; link. The pseudo-code for the code I would use in the template file is the following one: 

if (HTML_THEME) {
  print '&lt;a href = "history.go(-1)"&gt;BACK&lt;/a&gt;';
} 
else{
  print '&lt;anchor&gt;BACK&lt;prev/&gt;&lt;/anchor&gt;';
}


Could anybody tell me how to implement this?
I think you're looking for the $theme_key global, which gives you the:


  Name of the active theme.


You can use it like so:

global $theme_key;
if ($theme_key == 'mobile_theme') {
  // ...
}
else {
  // ...
}