Skip navigation.
Home

The evils of organically grown code...

Wonky Code

Thanks to Tit Petric for sending in this WTF. He's a courageous guy for submitting this because he wrote it himself. This code uses session variables to keep the last used menu item open when the user navigates to a page that isn't on the menu.

While not apparent, this WTF is a good example of what happens to code that grows to fulfill requirements that were not part of the original design. The original code was written to handle a single tier menu system. Then it grew to handle 2-tiers, 3-tiers, 4-tiers, etc. Right now the production code is sitting at 5-tiers *shudder*.

Anonymous Comment turned off due to Spam.

Announcements

I decided to turn off Anonymous comments due to the spam that was recently posted. It was easy enough to delete them all but commenting is now limited to registered users *SORRY*, until I can find a drupal module that protects against the spam solution a little better.