Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 381
- Log:
Radiant is now packaged as a Gem - see Changeset #373, Changeset #374,
Changeset #375, Changeset #376, Changeset #377, Changeset #378,
Changeset #379 and Changeset #380. The application part of Radiant is
now mostly empty; it exists to provide a structure which hooks into the
gem and which provides a framework for extensions. Included in this big
changeset are all the deletions, additions and changes needed to go from
the old ROOL customised Radiant to a new ROOL customised Radiant, which
includes several custom extensions adapted from the old Radiant
modifications and requires Radiant 0.9.1 to be installed as a gem.
- Author:
- rool
- Date:
- Mon Mar 21 14:01:18 +0000 2011
- Size:
- 1775 Bytes
1 | # Radiant ERB (Embedded Ruby) filter |
2 | # ================================== |
3 | # |
4 | # Provides ERB support for Radiant content. For more about Radiant see |
5 | # "http://radiantcms.org/". |
6 | # |
7 | # |
8 | # History |
9 | # ------- |
10 | # |
11 | # 2006-07-14 (ADH): Created. |
12 | # 2006-07-15 (ADH): Added 'description' field, currently commented out |
13 | # until wider support in Filters is present. |
14 | # 2006-07-25 (ADH): Extended models/behavior.rb to call an extended |
15 | # filter interface including a hash of instance |
16 | # variables. Implemented that interface here, using |
17 | # the ActionView-derived magic first implemented in |
18 | # the ERB Behavior code to define the hash variables |
19 | # in the context of the ERB interpreter. |
20 | # 2011-03-08 (ADH): Imported into Radiant 0.9.1 as an Extension. |
21 | |
22 | require_dependency 'application_controller' |
23 | |
24 | class ErbFilterExtension < Radiant::Extension |
25 | version "2.0" |
26 | description "Allows the use of ERB within pages, with support for Rails request and session details" |
27 | url "http://pond.org.uk/" |
28 | |
29 | def activate |
30 | |
31 | ApplicationController.class_eval do |
32 | around_filter :break_mvc_for_erb_filter_use_in_view_via_radiant_model |
33 | |
34 | def break_mvc_for_erb_filter_use_in_view_via_radiant_model |
35 | methods = ["session", "request"] |
36 | |
37 | methods.each do |method| |
38 | value = send(method) |
39 | unless (ErbFilter.new.respond_to?(method)) |
40 | ErbFilter.send(:define_method, method, proc { value }) |
41 | end |
42 | end |
43 | |
44 | yield |
45 | |
46 | methods.each do |method| |
47 | if (ErbFilter.new.respond_to?(method)) |
48 | ErbFilter.send( :remove_method, method ) |
49 | end |
50 | end |
51 | |
52 | end |
53 | end |
54 | |
55 | ErbFilter |
56 | Page.send :include, ErbTags |
57 | end |
58 | end |