Storing icon set states for different themes in the database

ximo - June 13, 2008 - 21:25
Project:Icon
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:ximo
Status:closed
Description

I realised that the module shouldn't store the state (enabled/disabled) of icon sets in the systems table, as that would mean all enabled icon sets would be made available to all enabled themes. That's not always what people want.. I'm seeing a loooong list of possible icons to choose from, when you really only want to choose from 3 sets in one theme.

So I'm thinking of creating a new table, icon_sets, that stores the states of all icon sets on a per-theme basis. All available icon sets (with their info, etc.) should still be stored in the system table.

icon_sets
varchar(255) iconset <- links to name of icon set in system table
varchar(255) theme <- links to name of theme in system table
int(11) status <- 1 or 0

I'm no database expert, so my concern is whether this is a good idea or not? This would require joins when fetching iconsets per theme. But as this is only done when configuring icon sets and manually selecting icons, and then cached, I have a feeling it doesn't matter. Still, I'd like someone who knows SQL well to tell me what's the best way forward.

Or should I keep it simple and make enabled icon sets available to all enabled themes?

#1

ximo - June 18, 2008 - 21:17
Assigned to:Anonymous» ximo

After talking to someone who are good at databases, I went with using an iconsets table, with the following fields:

varchar(255) iconset
varchar(255) theme
int(11) status
int(11) weight

The status for icon sets in the system table now act as a "global status", in case we want to allow the user to select icon sets that should be globally enabled throughout all themes.

#2

ximo - July 5, 2008 - 15:12
Status:active» fixed

#3

Anonymous (not verified) - July 23, 2008 - 10:56
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.