webmcp

diff framework/env/slot/__init.lua @ 260:f491011ebe16

Work on __init.lua files to support handling multiple requests per connect
author jbe
date Sun Mar 15 01:20:06 2015 +0100 (2015-03-15)
parents 9fdfb27f8e67
children c3d539e33710
line diff
     1.1 --- a/framework/env/slot/__init.lua	Sun Mar 15 01:14:21 2015 +0100
     1.2 +++ b/framework/env/slot/__init.lua	Sun Mar 15 01:20:06 2015 +0100
     1.3 @@ -1,10 +1,10 @@
     1.4 -slot._data_metatable = {}
     1.5 -function slot._data_metatable:__index(key)
     1.6 -  self[key] = { string_fragments = {}, state_table = {} }
     1.7 -  return self[key]
     1.8 +request.add_variable(slot, "_active_slot", "default")
     1.9 +request.add_variable(slot, "_current_layout", "default")
    1.10 +request.add_variable(slot, "_content_type", nil)
    1.11 +
    1.12 +request.add_initializer(function()
    1.13 +
    1.14 +  slot._data = nil
    1.15 +  slot.reset_all()
    1.16 +
    1.17  end
    1.18 -slot._active_slot = 'default'
    1.19 -slot._current_layout = 'default'
    1.20 -slot._content_type = nil
    1.21 -
    1.22 -slot.reset_all()

Impressum / About Us