Make l() themable
Xano - October 8, 2008 - 17:36
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Xano |
| Status: | needs work |
Description
This patch creates theme_l() that can be overriden by themes. The original l() stays, because it is used for 'administrative' actions. The patch doesn't work yet, since for some reason theme('l'); doesn't actually call theme_l(). I need to look into this problem a little closer, but perhaps somebody can give me a nudge in the right direction.
| Attachment | Size |
|---|---|
| theme_l_00.patch | 1.48 KB |
| Testbed results | ||
|---|---|---|
| theme_l_00.patch | failed | Failed: 6715 passes, 212 fails, 29 exceptions Detailed results |

#1
Well, it makes sense and is a step toward a non-HTML output for Drupal. You will have to register 'theme_l' in a hook_theme().
#2
I thought so too, but in what hook_theme() implementation? I cannot find where the theme functions inside theme.inc are registered.
#3
Although I'd keep l() the same, I'd rather use theme_link to go along with the naming of theme_links.
I'd also rather pass in the straight $attributes array instead of the HTML for the attributes from drupal_attributes.
#4
What's yaman about?
+function theme_l($path, $attributes, $text) {return '<strong>yaman</strong>';+ return '<a href="' . $path . '"' . $attributes . '>' . $text . '</a>';
+}
Debugging code?
#5
Err, yes, that was debugging code. Must have overlooked it for some reason :S
#6
#7
The last submitted patch failed testing.
#8
According to swentel This patch still applies without problem. We both cannot figure out why the PHP filter tests failed. Could somebody please a look at this problem?
#9
I've looked at it and identified the
l()in the following line in php.install as the bad guy:<?phpdrupal_set_message(t('A %php-code input format has been created.', array('%php-code' => l('PHP code', 'admin/settings/filters/' . $format))));
?>
If the l() is replaced/removed, the all PHP Filter tests run without fails.
Seeing that only the simpletest environment and not the drupal installation itself shows any errors, leads me to think that the problem lies not with the patch, but within Simpletest. How and why, I am not sure, but I believe it has something to do with the cache/theme registry, because a single PHP.test case runs fine directly after clearing the cache.
#10
Requesting re-test.
#11
Patch passes. I'd like to see some more reviews! :D
#12
The last submitted patch failed testing.
#13
Requesting re-test. Testing server only says the tests failed, but all tests look OK.
#14
Requesting re-test. Testing server only says the tests failed, but all tests look OK.
#15
The last submitted patch failed testing.
#16
Come on, testing bot. Convince me.
#17
The last submitted patch failed testing.