Here's a practical example of where theme development runs into trouble
from module theme functions: overusing theme functions or using the
wrong theme functions. <br>
<br>
In theme.inc (core) is the function theme_form_element which is roughly this (may be old code):<br>
<br>
function theme_form_element($title, $value, $description = NULL, $id = NULL, $required = FALSE, $error = FALSE) {<br>
<br>
$output = "<div class=\"form-item\">\n";<br>
$required = $required ? '<span class="form-required">*</span>' : '';<br>
<br>
if ($title) {<br>
if ($id) {<br>
$output .= " <label for=\"$id\">$title:</label>$required<br />\n";<br>
}<br>
else {<br>
$output .= " <label>$title:</label>$required<br />\n";<br>
}<br>
}<br>
<br>
Now, the <br /> tags _aren't_ the big problem here.<br>
<br>
The problem is that modules (including core modules like
profile.module) call this function for both form input _and_ form
output. From a design/theme p.o.v., those are two distinct things
and should be treated as such.<br>
<br>
Is this a _really big deal_ that causes Drupal to break? Probably
not. But imagine my surprise when I used PHPTemplate to override
this theme function, and all the form elements on my entire site
changed instantly (and broke).<br>
<br>