Module: Cms

Extended by:
Caching
Defined in:
lib/cms/behaviors/pagination.rb,
lib/cms/init.rb,
lib/cms/caching.rb,
lib/cms/data_loader.rb,
lib/cms/extensions/nil.rb,
lib/cms/extensions/hash.rb,
lib/cms/behaviors/hiding.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/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,
lib/cms/authentication/controller.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, DataLoader, ErrorHandling, Errors, Extensions, FormTagHelper, MenuHelper, PageHelper, PathHelper, Routes, SectionNodesHelper Classes: ApplicationController, AttachmentsController, BaseController, CacheController, CategoriesController, CategoryTypesController, ConnectorsController, ContentBlockController, ContentController, ContentTypesController, DashboardController, DynamicViewsController, EmailMessagesController, EmailPagePortletController, FileBlocksController, FormBuilder, GroupsController, HomeController, HtmlBlocksController, ImageBlocksController, LinksController, MissingAssetController, PageRouteConditionsController, PageRouteOptionsController, PageRouteRequirementsController, PageRoutesController, PagesController, PortletController, PortletsController, RedirectsController, ResourceController, RoutesController, SectionNodesController, SectionsController, SessionsController, TagsController, TasksController, ToolbarController, UsersController

Class Method Summary collapse

Methods included from Caching

caching_enabled?, flush_cache

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.



43
44
45
# File 'lib/cms/init.rb', line 43

def add_generator_paths(src_root, *files)
  generator_paths << [src_root, files]
end

.add_to_rails_paths(path) ⇒ Object



51
52
53
# File 'lib/cms/init.rb', line 51

def add_to_rails_paths(path)
  ActiveSupport::Dependencies.load_paths << File.join(path, "app", "portlets")
end

.build_numberObject



16
17
18
# File 'lib/cms/init.rb', line 16

def build_number
  @build_number = spec_version.last
end

.generator_pathsObject



47
48
49
# File 'lib/cms/init.rb', line 47

def generator_paths
  @generator_paths ||= []
end

.initObject

This is called after the environment is ready



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cms/init.rb', line 25

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
  
  # This is jsut to be safe
  # dynamic views are stored in a tmp dir
  # so they could be blown away on a server restart or something
  # so this just makes sure they get written out
  DynamicView.write_all_to_disk! if DynamicView.table_exists?
end

.load_rake_tasksObject



20
21
22
# File 'lib/cms/init.rb', line 20

def load_rake_tasks
  load "#{Cms.root}/lib/tasks/cms.rake"
end

.markdown?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/cms/init.rb', line 55

def markdown?
  Object.const_defined?("Markdown")
end

.reserved_pathsObject



59
60
61
# File 'lib/cms/init.rb', line 59

def reserved_paths
  @reserved_paths ||= ["/cms", "/cache"]
end

.spec_versionObject



8
9
10
# File 'lib/cms/init.rb', line 8

def spec_version
  SPEC.version.respond_to?(:parts) ? SPEC.version.parts : SPEC.version.ints
end

.versionObject



12
13
14
# File 'lib/cms/init.rb', line 12

def version
  @version = spec_version[0,3].join('.')
end