Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 2197 Bytes
1 | # The filters added to this controller will be run for all controllers in the application. |
2 | # Likewise will all the methods added be available for all controllers. |
3 | class ApplicationController < ActionController::Base |
4 | |
5 | # Hub single sign-on support. |
6 | |
7 | require 'hub_sso_lib' |
8 | include HubSsoLib::Core |
9 | before_filter :hubssolib_beforehand |
10 | after_filter :hubssolib_afterwards |
11 | |
12 | # Standard Typo gubbins follows, including its own admin login system. |
13 | |
14 | include LoginSystem |
15 | before_filter :reset_local_cache, :fire_triggers |
16 | after_filter :reset_local_cache |
17 | |
18 | # Extra filter to prime URL writing so that it doesn't make invalid |
19 | # assumptions about protocol or port |
20 | |
21 | before_filter :prime_url_writer |
22 | |
23 | protected |
24 | |
25 | def prime_url_writer |
26 | $url_writer_request_information = request; |
27 | end |
28 | |
29 | def fire_triggers |
30 | Trigger.fire |
31 | end |
32 | |
33 | def reset_local_cache |
34 | CachedModel.cache_reset |
35 | session[:user].reload if session[:user] |
36 | end |
37 | |
38 | # Axe? |
39 | def server_url |
40 | this_blog.base_url |
41 | end |
42 | |
43 | def cache |
44 | $cache ||= SimpleCache.new 1.hour |
45 | end |
46 | |
47 | @@blog_id_for = Hash.new |
48 | |
49 | # The Blog object for the blog that matches the current request. This is looked |
50 | # up using Blog.find_blog and cached for the lifetime of the controller instance; |
51 | # generally one request. |
52 | def this_blog |
53 | @blog ||= if @@blog_id_for[blog_base_url] |
54 | Blog.find(@@blog_id_for[blog_base_url]) |
55 | else |
56 | returning(Blog.find_blog(blog_base_url)) do |blog| |
57 | @@blog_id_for[blog_base_url] = blog.id |
58 | end |
59 | end |
60 | end |
61 | helper_method :this_blog |
62 | |
63 | # The base URL for this request, calculated by looking up the URL for the main |
64 | # blog index page. This is matched with Blog#base_url to determine which Blog |
65 | # is supposed to handle this URL |
66 | def blog_base_url |
67 | url_for(:controller => '/articles').gsub(%r{/$},'') |
68 | end |
69 | |
70 | def self.include_protected(*modules) |
71 | modules.reverse.each do |mod| |
72 | included_methods = mod.public_instance_methods.reject do |meth| |
73 | self.method_defined?(meth) |
74 | end |
75 | self.send(:include, mod) |
76 | included_methods.each do |meth| |
77 | protected meth |
78 | end |
79 | end |
80 | end |
81 | end |
82 |