Module: Cms

Defined in:
app/models/cms/templates.rb,
app/models/cms/tag.rb,
app/models/cms/site.rb,
app/models/cms/task.rb,
app/models/cms/user.rb,
app/models/cms/portlet.rb,
app/models/cms/section.rb,
app/models/cms/tagging.rb,
app/models/cms/category.rb,
app/models/cms/redirect.rb,
app/models/cms/connector.rb,
app/models/cms/attachment.rb,
app/models/cms/file_block.rb,
app/models/cms/group_type.rb,
app/models/cms/guest_user.rb,
app/models/cms/html_block.rb,
app/models/cms/permission.rb,
app/models/cms/image_block.rb,
app/helpers/cms/menu_helper.rb,
app/helpers/cms/page_helper.rb,
app/helpers/cms/path_helper.rb,
app/models/cms/content_type.rb,
app/models/cms/dynamic_view.rb,
app/models/cms/page_partial.rb,
app/models/cms/view_context.rb,
app/models/cms/category_type.rb,
app/models/cms/email_message.rb,
app/models/cms/group_section.rb,
app/models/cms/page_template.rb,
app/helpers/cms/mobile_helper.rb,
app/helpers/cms/form_tag_helper.rb,
app/models/cms/group_permission.rb,
app/helpers/cms/rendering_helper.rb,
app/helpers/cms/template_support.rb,
app/models/cms/page_route_option.rb,
app/models/cms/content_type_group.rb,
app/controllers/cms/error_handling.rb,
app/helpers/cms/application_helper.rb,
app/helpers/cms/ui_elements_helper.rb,
app/models/cms/abstract_file_block.rb,
app/controllers/cms/base_controller.rb,
app/controllers/cms/home_controller.rb,
app/controllers/cms/tags_controller.rb,
app/models/cms/email_message_mailer.rb,
app/models/cms/page_route_condition.rb,
app/controllers/cms/cache_controller.rb,
app/controllers/cms/links_controller.rb,
app/controllers/cms/pages_controller.rb,
app/controllers/cms/tasks_controller.rb,
app/controllers/cms/users_controller.rb,
app/helpers/cms/content_block_helper.rb,
app/helpers/cms/section_nodes_helper.rb,
app/models/cms/group_type_permission.rb,
app/models/cms/user_group_membership.rb,
app/controllers/cms/groups_controller.rb,
app/controllers/cms/routes_controller.rb,
app/models/cms/forgot_password_mailer.rb,
app/models/cms/page_route_requirement.rb,
app/controllers/cms/content_controller.rb,
app/controllers/cms/portlet_controller.rb,
app/controllers/cms/toolbar_controller.rb,
app/controllers/cms/portlets_controller.rb,
app/controllers/cms/resource_controller.rb,
app/controllers/cms/sections_controller.rb,
app/controllers/cms/sessions_controller.rb,
app/controllers/cms/dashboard_controller.rb,
app/controllers/cms/redirects_controller.rb,
app/controllers/cms/categories_controller.rb,
app/controllers/cms/connectors_controller.rb,
app/controllers/cms/application_controller.rb,
app/controllers/cms/attachments_controller.rb,
app/controllers/cms/file_blocks_controller.rb,
app/controllers/cms/html_blocks_controller.rb,
app/controllers/cms/page_routes_controller.rb,
app/controllers/cms/image_blocks_controller.rb,
app/controllers/cms/content_block_controller.rb,
app/controllers/cms/content_types_controller.rb,
app/controllers/cms/dynamic_views_controller.rb,
app/controllers/cms/section_nodes_controller.rb,
app/controllers/cms/category_types_controller.rb,
app/controllers/cms/email_messages_controller.rb,
app/controllers/cms/page_route_options_controller.rb,
app/controllers/cms/page_route_conditions_controller.rb,
app/controllers/cms/page_route_requirements_controller.rb,
lib/cms/engine.rb,
lib/cms/module.rb,
lib/cms/caching.rb,
lib/cms/version.rb,
lib/cms/addressable.rb,
lib/cms/data_loader.rb,
lib/cms/date_picker.rb,
lib/cms/error_pages.rb,
lib/cms/mobile_aware.rb,
lib/cms/acts/cms_user.rb,
lib/cms/configuration.rb,
lib/cms/engine_helper.rb,
lib/cms/domain_support.rb,
lib/cms/extensions/nil.rb,
lib/cms/extensions/hash.rb,
lib/cms/upgrades/v3_4_0.rb,
lib/cms/upgrades/v3_5_0.rb,
lib/cms/behaviors/hiding.rb,
lib/cms/behaviors/naming.rb,
lib/cms/commands/actions.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/default_accessible.rb,
lib/cms/extensions/integer.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/installation_actions.rb,
lib/cms/behaviors/namespacing.rb,
lib/cms/behaviors/categorizing.rb,
lib/cms/behaviors/userstamping.rb,
lib/cms/behaviors/soft_deleting.rb,
lib/cms/attachments/configuration.rb,
lib/cms/authentication/controller.rb,
lib/cms/content_rendering_support.rb,
lib/cms/extensions/action_view/base.rb,
lib/cms/behaviors/dynamic_attributes.rb,
lib/cms/extensions/active_record/base.rb,
lib/cms/attachments/attachment_serving.rb,
lib/cms/behaviors/flush_cache_on_change.rb,
lib/cms/extensions/active_record/errors.rb,
lib/generators/cms/install/install_generator.rb,
lib/generators/cms/portlet/portlet_generator.rb,
lib/generators/cms/template/template_generator.rb,
lib/generators/cms/content_block/content_block_generator.rb

Overview

This module can be added to Controllers to provide support for rendering CMS content pages.

Defined Under Namespace

Modules: Acts, Addressable, ApplicationHelper, Attachments, Authentication, Authoring, Behaviors, Caching, Commands, ContentBlockHelper, ContentRenderingSupport, DataLoader, DefaultAccessible, DefaultCaches, DomainSupport, EngineHelper, ErrorHandling, ErrorPages, Errors, Extensions, FormTagHelper, Generators, InstallationActions, MenuHelper, MobileAware, MobileHelper, Module, Namespacing, PageHelper, PathHelper, RenderingHelper, RouteExtensions, SectionNodesHelper, TemplateSupport, Templates, UiElementsHelper, Upgrades Classes: AbstractFileBlock, ApplicationController, Attachment, AttachmentsController, BaseController, Cache, CacheController, CategoriesController, Category, CategoryType, CategoryTypesController, Connector, ConnectorsController, ContentBlockController, ContentController, ContentType, ContentTypeGroup, ContentTypesController, DashboardController, DatePicker, DynamicView, DynamicViewsController, EmailMessage, EmailMessageMailer, EmailMessagesController, Engine, EngineAwarePathBuilder, FileBlock, FileBlocksController, ForgotPasswordMailer, FormBuilder, Group, GroupPermission, GroupSection, GroupType, GroupTypePermission, GroupsController, GuestUser, HomeController, HtmlBlock, HtmlBlocksController, IgnoreSanitizer, ImageBlock, ImageBlocksController, InstallGenerator, Link, LinksController, ModuleInstallation, Page, PagePartial, PageRoute, PageRouteCondition, PageRouteConditionsController, PageRouteOption, PageRouteOptionsController, PageRouteRequirement, PageRouteRequirementsController, PageRoutesController, PageTemplate, PagesController, Permission, Portlet, PortletController, PortletsController, Redirect, RedirectsController, ResourceController, RoutesController, Section, SectionNode, SectionNodesController, SectionsController, SessionsController, Site, Tag, Tagging, TagsController, Task, TasksController, ToolbarController, User, UserGroupMembership, UsersController, ViewContext

Constant Summary collapse

VERSION =
"3.5.7"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.attachment_file_permissionObject

Returns the value of attribute attachment_file_permission.



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

def attachment_file_permission
  @attachment_file_permission
end

Class Method Details

.content_editorObject

Determines which WYSIWYG editor is the ‘default’ for a BrowserCMS project

bcms modules can changes this by overriding it in their configuration.



13
14
15
16
# File 'lib/cms/configuration.rb', line 13

def content_editor
  # CKEditor is the default.
  @wysiwig_editor ||= ['bcms/ckeditor_load', 'ckeditor-jquery']
end

.content_editor=(editor) ⇒ Object



18
19
20
# File 'lib/cms/configuration.rb', line 18

def content_editor=(editor)
  @wysiwig_editor = editor
end

.markdown?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/cms/configuration.rb', line 22

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

.reserved_pathsObject



26
27
28
# File 'lib/cms/configuration.rb', line 26

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

.table_name_prefixObject

By setting this, ActiveRecord will automatically prefix all tables in the Cms

module to start with the value of prefix_

Defaults to “” if not specified.



25
26
27
# File 'lib/cms/behaviors/namespacing.rb', line 25

def self.table_name_prefix
  self.table_prefix ? self.table_prefix : ""
end

.table_prefixString

Returns the table name prefix for models in the Cms

Namespace

Prefer calling table_name_prefix to this methods

Returns:

  • (String)

    nil if no namespace has been set.



19
20
21
# File 'lib/cms/behaviors/namespacing.rb', line 19

def self.table_prefix
  @table_prefix
end

.table_prefix=(prefix) ⇒ Object

Provides a global configuration setting to set a table prefix for all CMS tables.

For example, Cms.table_prefix = “cms_” would create tables like:

cms_html_blocks cms_pages

rather than

html_blocks pages


10
11
12
# File 'lib/cms/behaviors/namespacing.rb', line 10

def self.table_prefix=(prefix)
  @table_prefix = prefix
end

.versionObject

Return the current version of the CMS.



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

def self.version
  VERSION
end