Module: Cms
- Extended by:
- Caching
- Defined in:
- lib/cms/version.rb,
lib/cms/init.rb,
lib/cms/caching.rb,
lib/cms/data_loader.rb,
lib/cms/domain_support.rb,
lib/cms/extensions/nil.rb,
lib/cms/extensions/hash.rb,
lib/cms/behaviors/hiding.rb,
lib/cms/acts/content_page.rb,
lib/cms/extensions/string.rb,
lib/cms/acts/content_block.rb,
lib/cms/behaviors/taggable.rb,
lib/cms/extensions/integer.rb,
app/helpers/cms/menu_helper.rb,
app/helpers/cms/page_helper.rb,
app/helpers/cms/path_helper.rb,
lib/cms/behaviors/archiving.rb,
lib/cms/behaviors/attaching.rb,
lib/cms/behaviors/rendering.rb,
lib/cms/behaviors/searching.rb,
lib/cms/authentication/model.rb,
lib/cms/behaviors/connecting.rb,
lib/cms/behaviors/pagination.rb,
lib/cms/behaviors/publishing.rb,
lib/cms/behaviors/versioning.rb,
lib/cms/behaviors/categorizing.rb,
lib/cms/behaviors/userstamping.rb,
app/helpers/cms/form_tag_helper.rb,
lib/cms/behaviors/soft_deleting.rb,
app/helpers/cms/rendering_helper.rb,
app/helpers/cms/template_support.rb,
lib/cms/authentication/controller.rb,
lib/cms/content_rendering_support.rb,
app/controllers/cms/error_handling.rb,
app/helpers/cms/application_helper.rb,
lib/cms/extensions/action_view/base.rb,
app/helpers/cms/section_nodes_helper.rb,
lib/cms/behaviors/dynamic_attributes.rb,
lib/cms/extensions/active_record/base.rb,
lib/cms/behaviors/flush_cache_on_change.rb,
lib/cms/extensions/active_record/errors.rb
Overview
Methods added to this helper will be available to all templates in the cms.
Defined Under Namespace
Modules: Acts, ApplicationHelper, Authentication, Behaviors, Caching, ContentRenderingSupport, DataLoader, DomainSupport, ErrorHandling, Errors, Extensions, FormTagHelper, MenuHelper, PageHelper, PathHelper, RenderingHelper, Routes, SectionNodesHelper, TemplateSupport
Classes: ApplicationController, AttachmentsController, BaseController, CacheController, CategoriesController, CategoryTypesController, ConnectorsController, ContentBlockController, ContentController, ContentTypesController, DashboardController, DynamicViewsController, EmailMessagesController, FileBlocksController, FormBuilder, GroupsController, HomeController, HtmlBlocksController, ImageBlocksController, LinksController, PageRouteConditionsController, PageRouteOptionsController, PageRouteRequirementsController, PageRoutesController, PagesController, PortletController, PortletsController, RedirectsController, ResourceController, RoutesController, SectionNodesController, SectionsController, SessionsController, TagsController, TasksController, ToolbarController, UsersController
Constant Summary
collapse
- VERSION =
"3.1.0"
Class Attribute Summary collapse
Class Method Summary
collapse
Methods included from Caching
caching_enabled?, flush_cache
Class Attribute Details
.attachment_file_permission ⇒ Object
Returns the value of attribute attachment_file_permission.
9
10
11
|
# File 'lib/cms/init.rb', line 9
def attachment_file_permission
@attachment_file_permission
end
|
Class Method Details
.add_generator_paths(src_root, *files) ⇒ Object
This is used by CMS modules to register with the CMS generator which files should be copied over to the app when the CMS generator is run. src_root is the absolute path to the root of the files, then each argument after that is a Dir.glob pattern string.
44
45
46
|
# File 'lib/cms/init.rb', line 44
def add_generator_paths(src_root, *files)
generator_paths << [src_root, files]
end
|
.add_to_rails_paths(path) ⇒ Object
52
53
54
|
# File 'lib/cms/init.rb', line 52
def add_to_rails_paths(path)
ActiveSupport::Dependencies.load_paths << File.join(path, "app", "portlets")
end
|
.add_to_routes(route) ⇒ Object
56
57
58
|
# File 'lib/cms/init.rb', line 56
def add_to_routes(route)
routes << route
end
|
.build_number ⇒ Object
15
|
# File 'lib/cms/init.rb', line 15
def build_number; 252 end
|
.generator_paths ⇒ Object
48
49
50
|
# File 'lib/cms/init.rb', line 48
def generator_paths
@generator_paths ||= []
end
|
.init ⇒ Object
This is called after the environment is ready
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/cms/init.rb', line 22
def init
ActionController::Routing::RouteSet::Mapper.send :include, Cms::Routes
ActiveSupport::Dependencies.load_paths += %W( #{RAILS_ROOT}/app/portlets )
ActiveSupport::Dependencies.load_paths += %W( #{RAILS_ROOT}/app/portlets/helpers )
ActionController::Base.append_view_path DynamicView.base_path
ActionView::Base.default_form_builder = Cms::FormBuilder
require 'jdbc_adapter' if defined?(JRUBY_VERSION)
DynamicView.write_all_to_disk! if DynamicView.table_exists?
end
|
.load_rake_tasks ⇒ Object
17
18
19
|
# File 'lib/cms/init.rb', line 17
def load_rake_tasks
load "#{Cms.root}/lib/tasks/cms.rake"
end
|
.markdown? ⇒ Boolean
71
72
73
|
# File 'lib/cms/init.rb', line 71
def markdown?
Object.const_defined?("Markdown")
end
|
.reserved_paths ⇒ Object
75
76
77
|
# File 'lib/cms/init.rb', line 75
def reserved_paths
@reserved_paths ||= ["/cms", "/cache"]
end
|
.routes ⇒ Object
59
60
61
|
# File 'lib/cms/init.rb', line 59
def routes
@routes ||=[]
end
|
.scrub_path(path) ⇒ Object
This next ‘hack’ is to allow script/generate browser_cms to work on Windows machines. I’m not sure why this is necessary.
This Generator is adding an absolute file path to the manifest, which is file (like a .js or migration) in the gem directory on the developers’s machine, rather than just a relative path with the rails_generator directory. On windows, this will mean you are basically doing this.
m.file “C:/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js”, “testing/jquery-ui.js”
When the generator hits this command during playback, it will throw an error like this:
Pattern 'c' matches more than one generator: content_block, controller
The generator then fails and stops copying. Stripping the C: off the front seems to fix this problem. I.e. This command correctly copies the file on Windows XP.
m.file "/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"
93
94
95
96
|
# File 'lib/cms/init.rb', line 93
def scrub_path(path)
windows_drive_pattern = /\b[A-Za-z]:\// scrubbed_source_file_name = path.gsub(windows_drive_pattern, "/")
end
|
.version ⇒ Object
11
12
13
|
# File 'lib/cms/init.rb', line 11
def version
@version = SPEC.version.version
end
|
.wysiwig_js ⇒ Object
63
64
65
|
# File 'lib/cms/init.rb', line 63
def wysiwig_js
@wysiwig_js ||= ['/bcms/ckeditor/ckeditor.js', '/bcms/ckeditor/editor.js']
end
|
.wysiwig_js=(path_array) ⇒ Object
67
68
69
|
# File 'lib/cms/init.rb', line 67
def wysiwig_js=(path_array)
@wysiwig_js = path_array
end
|