'Load the current active configuration for the context
@param context: the current S3DashboardContext'

def load(self, context):

    if (not self.configurable):
        return
    table = current.s3db.s3_dashboard
    query = ((((table.controller == context.controller) & (table.function == context.function)) & (table.active == True)) & (table.deleted != True))
    row = current.db(query).select(table.id, table.layout, table.title, table.version, table.next_id, table.widgets, limitby=(0, 1)).first()
    if row:
        self.version = row.version
        if row.next_id:
            self.next_id = row.next_id
        self.layout = row.layout
        if row.title:
            self.title = row.title
        widgets = row.widgets
        if (type(widgets) is list):
            self.active_widgets = widgets
        self.config_id = row.id
    self.loaded = True
