By CmdrGravy on
Can anyone tell me where the HTML which generates the logs under the Admin section is generated ? I have looked through admin.module, watchdog.module and statistics.module but can't seem to find anything likely in any of those.
What I want to do is add a CSS class to the initial
Comments
Found it
I think I've answered my own question, watchdog etc call theme_table which creates the tables so I will need to alter those to also include a class attribute to that function.
menu.module and menu.inc
Look for theme_menu* functions. That way you do not need to hack into core.
And if this solved you problem, would you be so kind to report back that it helped? This will help others whom are looking for the same solution.
[Ber | Drupal Services webschuur.com]
Thanks
Thanks for the reply. I've had a look at the theme_menu functions but unfortunately couldn't really see how I could use them because the things I wanted to format weren't really menus - it was the actual tables created by the statistics and watchdog modules. I have only had a brief look though - I'll look again when I have had some sleep tomorrow.
As it happened I had already gone ahead and hacked into the statistics and watchdog modules and altered every
theme('table', $header, $rows);I came across to say
theme('table', $header, $rows,array('class'=>'watchdog'));Instead which has worked perfectly for what I wanted it to do. To avoid making this hack I could have instead themed all the seperate tr and th entries instead but the amount of work involved there put me off !
This is the first time I have got around to building my own theme and I very impressed with how easy it is to achieve using all the theme_* functions, the only problems I have had is when modules don't seem to have any way of overiding certain behaviours in this way ( some things in the book module for instance I had to change in the actual book module ). When I have got more of a feel for how things work together I'd like to take all the hacking out of the actual modules and make more themable parts for them instead but as yet I can't work out how that is done.
Use style.css
There's an easier way. Your theme's `style.css` trumps `drupal.css`, so you can add something like this to style.css:
This works well for me, but I don't have every module installed that might apply the `.dark` and `.light`classes to table rows. Your mileage may vary. As the good Commander says, it would be better if there were an empty `class` hook for the various kinds of table output. Would allow for more-specific descendant selectors.