browsercms 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/cms/connectors_controller.rb +1 -1
- data/app/helpers/cms/application_helper.rb +2 -19
- data/app/helpers/cms/form_builder.rb +8 -5
- data/app/helpers/cms/menu_helper.rb +19 -5
- data/app/helpers/cms/page_helper.rb +9 -1
- data/app/helpers/cms/template_support.rb +21 -0
- data/app/models/abstract_file_block.rb +4 -0
- data/app/models/connector.rb +7 -3
- data/app/models/dynamic_view.rb +2 -4
- data/app/models/portlet.rb +22 -9
- data/app/models/section.rb +7 -5
- data/app/views/cms/blocks/_toolbar_for_member.html.erb +4 -4
- data/app/views/cms/blocks/index.html.erb +1 -1
- data/app/views/cms/blocks/usages.html.erb +44 -34
- data/app/views/cms/connectors/new.html.erb +2 -2
- data/app/views/cms/dynamic_views/_form.html.erb +1 -1
- data/app/views/cms/dynamic_views/index.html.erb +7 -3
- data/app/views/cms/email_messages/index.html.erb +3 -5
- data/app/views/cms/form_builder/_cms_datetime_select.html.erb +12 -0
- data/app/views/cms/form_builder/_cms_text_editor.html.erb +2 -2
- data/app/views/cms/form_builder/_cms_text_field.html.erb +1 -2
- data/app/views/cms/groups/_permissions.html.erb +1 -0
- data/app/views/cms/groups/_sections.html.erb +1 -0
- data/app/views/cms/groups/index.html.erb +3 -5
- data/app/views/cms/page_routes/index.html.erb +13 -7
- data/app/views/cms/page_routes/show.html.erb +4 -4
- data/app/views/cms/pages/_edit_connector.html.erb +4 -1
- data/app/views/cms/pages/_edit_container.html.erb +4 -1
- data/app/views/cms/redirects/index.html.erb +12 -7
- data/app/views/cms/routes/index.html.erb +11 -7
- data/app/views/cms/sections/_form.html.erb +4 -5
- data/app/views/cms/users/_groups.html.erb +1 -0
- data/app/views/layouts/_cms_toolbar.html.erb +37 -4
- data/app/views/layouts/_page_toolbar.html.erb +2 -2
- data/browsercms.gemspec +381 -3
- data/db/demo/data.rb +2 -1
- data/doc/app/classes/AbstractFileBlock.html +146 -0
- data/doc/app/classes/ActiveRecord.html +105 -0
- data/doc/app/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html +242 -0
- data/doc/app/classes/ActiveSupport.html +111 -0
- data/doc/app/classes/ActiveSupport/Cache.html +111 -0
- data/doc/app/classes/ActiveSupport/Cache/FileStore.html +146 -0
- data/doc/app/classes/ActsAsList.html +147 -0
- data/doc/app/classes/ActsAsList/ClassMethods.html +202 -0
- data/doc/app/classes/ActsAsList/InstanceMethods.html +510 -0
- data/doc/app/classes/ApplicationController.html +119 -0
- data/doc/app/classes/ApplicationHelper.html +112 -0
- data/doc/app/classes/Attachment.html +726 -0
- data/doc/app/classes/Category.html +230 -0
- data/doc/app/classes/CategoryType.html +214 -0
- data/doc/app/classes/Cms.html +638 -0
- data/doc/app/classes/Cms/Acts.html +111 -0
- data/doc/app/classes/Cms/Acts/ContentBlock.html +146 -0
- data/doc/app/classes/Cms/Acts/ContentBlock/MacroMethods.html +165 -0
- data/doc/app/classes/Cms/Acts/ContentBlock/MacroMethods/InstanceMethods.html +140 -0
- data/doc/app/classes/Cms/ApplicationController.html +418 -0
- data/doc/app/classes/Cms/ApplicationHelper.html +814 -0
- data/doc/app/classes/Cms/AttachmentsController.html +154 -0
- data/doc/app/classes/Cms/Authentication.html +116 -0
- data/doc/app/classes/Cms/Authentication/Controller.html +702 -0
- data/doc/app/classes/Cms/Authentication/Model.html +165 -0
- data/doc/app/classes/Cms/Authentication/Model/ClassMethods.html +246 -0
- data/doc/app/classes/Cms/Authentication/Model/InstanceMethods.html +412 -0
- data/doc/app/classes/Cms/BaseController.html +113 -0
- data/doc/app/classes/Cms/Behaviors.html +235 -0
- data/doc/app/classes/Cms/Behaviors/Archiving.html +147 -0
- data/doc/app/classes/Cms/Behaviors/Archiving/InstanceMethods.html +220 -0
- data/doc/app/classes/Cms/Behaviors/Archiving/MacroMethods.html +175 -0
- data/doc/app/classes/Cms/Behaviors/Attaching.html +160 -0
- data/doc/app/classes/Cms/Behaviors/Attaching/InstanceMethods.html +670 -0
- data/doc/app/classes/Cms/Behaviors/Attaching/MacroMethods.html +188 -0
- data/doc/app/classes/Cms/Behaviors/Categorizing.html +148 -0
- data/doc/app/classes/Cms/Behaviors/Categorizing/ClassMethods.html +105 -0
- data/doc/app/classes/Cms/Behaviors/Categorizing/InstanceMethods.html +140 -0
- data/doc/app/classes/Cms/Behaviors/Categorizing/MacroMethods.html +178 -0
- data/doc/app/classes/Cms/Behaviors/ClassMethods.html +272 -0
- data/doc/app/classes/Cms/Behaviors/Connecting.html +148 -0
- data/doc/app/classes/Cms/Behaviors/Connecting/ClassMethods.html +188 -0
- data/doc/app/classes/Cms/Behaviors/Connecting/InstanceMethods.html +312 -0
- data/doc/app/classes/Cms/Behaviors/Connecting/MacroMethods.html +184 -0
- data/doc/app/classes/Cms/Behaviors/DynamicAttributes.html +285 -0
- data/doc/app/classes/Cms/Behaviors/DynamicAttributes/InstanceMethods.html +181 -0
- data/doc/app/classes/Cms/Behaviors/DynamicAttributes/MacroMethods.html +243 -0
- data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange.html +178 -0
- data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange/InstanceMethods.html +142 -0
- data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange/MacroMethods.html +175 -0
- data/doc/app/classes/Cms/Behaviors/Hiding.html +148 -0
- data/doc/app/classes/Cms/Behaviors/Hiding/ClassMethods.html +105 -0
- data/doc/app/classes/Cms/Behaviors/Hiding/InstanceMethods.html +220 -0
- data/doc/app/classes/Cms/Behaviors/Hiding/MacroMethods.html +176 -0
- data/doc/app/classes/Cms/Behaviors/InstanceMethods.html +234 -0
- data/doc/app/classes/Cms/Behaviors/Pagination.html +151 -0
- data/doc/app/classes/Cms/Behaviors/Pagination/ClassMethods.html +252 -0
- data/doc/app/classes/Cms/Behaviors/Pagination/Collection.html +437 -0
- data/doc/app/classes/Cms/Behaviors/Pagination/InvalidPage.html +146 -0
- data/doc/app/classes/Cms/Behaviors/Publishing.html +179 -0
- data/doc/app/classes/Cms/Behaviors/Publishing/ClassMethods.html +105 -0
- data/doc/app/classes/Cms/Behaviors/Publishing/InstanceMethods.html +333 -0
- data/doc/app/classes/Cms/Behaviors/Publishing/MacroMethods.html +180 -0
- data/doc/app/classes/Cms/Behaviors/Rendering.html +179 -0
- data/doc/app/classes/Cms/Behaviors/Rendering/MacroMethods.html +186 -0
- data/doc/app/classes/Cms/Behaviors/Searching.html +147 -0
- data/doc/app/classes/Cms/Behaviors/Searching/ClassMethods.html +164 -0
- data/doc/app/classes/Cms/Behaviors/Searching/MacroMethods.html +188 -0
- data/doc/app/classes/Cms/Behaviors/SoftDeleting.html +148 -0
- data/doc/app/classes/Cms/Behaviors/SoftDeleting/ClassMethods.html +217 -0
- data/doc/app/classes/Cms/Behaviors/SoftDeleting/InstanceMethods.html +247 -0
- data/doc/app/classes/Cms/Behaviors/SoftDeleting/MacroMethods.html +205 -0
- data/doc/app/classes/Cms/Behaviors/Taggable.html +148 -0
- data/doc/app/classes/Cms/Behaviors/Taggable/ClassMethods.html +164 -0
- data/doc/app/classes/Cms/Behaviors/Taggable/InstanceMethods.html +197 -0
- data/doc/app/classes/Cms/Behaviors/Taggable/MacroMethods.html +182 -0
- data/doc/app/classes/Cms/Behaviors/Userstamping.html +148 -0
- data/doc/app/classes/Cms/Behaviors/Userstamping/ClassMethods.html +105 -0
- data/doc/app/classes/Cms/Behaviors/Userstamping/InstanceMethods.html +143 -0
- data/doc/app/classes/Cms/Behaviors/Userstamping/MacroMethods.html +181 -0
- data/doc/app/classes/Cms/Behaviors/Versioning.html +148 -0
- data/doc/app/classes/Cms/Behaviors/Versioning/ClassMethods.html +237 -0
- data/doc/app/classes/Cms/Behaviors/Versioning/InstanceMethods.html +685 -0
- data/doc/app/classes/Cms/Behaviors/Versioning/MacroMethods.html +290 -0
- data/doc/app/classes/Cms/CacheController.html +174 -0
- data/doc/app/classes/Cms/Caching.html +171 -0
- data/doc/app/classes/Cms/CategoriesController.html +113 -0
- data/doc/app/classes/Cms/CategoryTypesController.html +148 -0
- data/doc/app/classes/Cms/ConnectorsController.html +215 -0
- data/doc/app/classes/Cms/ContentBlockController.html +1175 -0
- data/doc/app/classes/Cms/ContentController.html +313 -0
- data/doc/app/classes/Cms/ContentTypesController.html +148 -0
- data/doc/app/classes/Cms/DashboardController.html +151 -0
- data/doc/app/classes/Cms/DataLoader.html +182 -0
- data/doc/app/classes/Cms/DynamicViewsController.html +359 -0
- data/doc/app/classes/Cms/EmailMessagesController.html +172 -0
- data/doc/app/classes/Cms/ErrorHandling.html +172 -0
- data/doc/app/classes/Cms/Errors.html +111 -0
- data/doc/app/classes/Cms/Errors/AccessDenied.html +146 -0
- data/doc/app/classes/Cms/Extensions.html +140 -0
- data/doc/app/classes/Cms/Extensions/ActionView.html +111 -0
- data/doc/app/classes/Cms/Extensions/ActionView/Base.html +141 -0
- data/doc/app/classes/Cms/Extensions/ActiveRecord.html +116 -0
- data/doc/app/classes/Cms/Extensions/ActiveRecord/Base.html +144 -0
- data/doc/app/classes/Cms/Extensions/ActiveRecord/Errors.html +140 -0
- data/doc/app/classes/Cms/Extensions/Hash.html +175 -0
- data/doc/app/classes/Cms/Extensions/Integer.html +146 -0
- data/doc/app/classes/Cms/Extensions/NilClass.html +212 -0
- data/doc/app/classes/Cms/Extensions/String.html +212 -0
- data/doc/app/classes/Cms/FileBlocksController.html +113 -0
- data/doc/app/classes/Cms/FormBuilder.html +312 -0
- data/doc/app/classes/Cms/FormTagHelper.html +245 -0
- data/doc/app/classes/Cms/GroupsController.html +225 -0
- data/doc/app/classes/Cms/HomeController.html +148 -0
- data/doc/app/classes/Cms/HtmlBlocksController.html +113 -0
- data/doc/app/classes/Cms/ImageBlocksController.html +113 -0
- data/doc/app/classes/Cms/LinksController.html +341 -0
- data/doc/app/classes/Cms/MenuHelper.html +330 -0
- data/doc/app/classes/Cms/PageHelper.html +292 -0
- data/doc/app/classes/Cms/PageRouteConditionsController.html +113 -0
- data/doc/app/classes/Cms/PageRouteOptionsController.html +355 -0
- data/doc/app/classes/Cms/PageRouteRequirementsController.html +113 -0
- data/doc/app/classes/Cms/PageRoutesController.html +284 -0
- data/doc/app/classes/Cms/PagesController.html +331 -0
- data/doc/app/classes/Cms/PathHelper.html +268 -0
- data/doc/app/classes/Cms/PortletController.html +150 -0
- data/doc/app/classes/Cms/PortletsController.html +301 -0
- data/doc/app/classes/Cms/RedirectsController.html +172 -0
- data/doc/app/classes/Cms/ResourceController.html +616 -0
- data/doc/app/classes/Cms/Routes.html +303 -0
- data/doc/app/classes/Cms/RoutesController.html +164 -0
- data/doc/app/classes/Cms/SectionNodesController.html +272 -0
- data/doc/app/classes/Cms/SectionNodesHelper.html +145 -0
- data/doc/app/classes/Cms/SectionsController.html +542 -0
- data/doc/app/classes/Cms/SessionsController.html +270 -0
- data/doc/app/classes/Cms/TagsController.html +152 -0
- data/doc/app/classes/Cms/TasksController.html +221 -0
- data/doc/app/classes/Cms/ToolbarController.html +153 -0
- data/doc/app/classes/Cms/UsersController.html +405 -0
- data/doc/app/classes/Connector.html +350 -0
- data/doc/app/classes/ContentType.html +448 -0
- data/doc/app/classes/ContentTypeGroup.html +111 -0
- data/doc/app/classes/DynamicPortlet.html +148 -0
- data/doc/app/classes/DynamicView.html +411 -0
- data/doc/app/classes/EmailMessage.html +228 -0
- data/doc/app/classes/EmailMessageMailer.html +150 -0
- data/doc/app/classes/EmailPagePortlet.html +184 -0
- data/doc/app/classes/FileBlock.html +202 -0
- data/doc/app/classes/Group.html +170 -0
- data/doc/app/classes/GroupPermission.html +111 -0
- data/doc/app/classes/GroupSection.html +111 -0
- data/doc/app/classes/GroupType.html +111 -0
- data/doc/app/classes/GroupTypePermission.html +111 -0
- data/doc/app/classes/GuestUser.html +347 -0
- data/doc/app/classes/HtmlBlock.html +170 -0
- data/doc/app/classes/ImageBlock.html +202 -0
- data/doc/app/classes/InitialData.html +171 -0
- data/doc/app/classes/Link.html +249 -0
- data/doc/app/classes/LoginPortlet.html +151 -0
- data/doc/app/classes/Page.html +954 -0
- data/doc/app/classes/PagePartial.html +201 -0
- data/doc/app/classes/PageRoute.html +335 -0
- data/doc/app/classes/PageRouteCondition.html +113 -0
- data/doc/app/classes/PageRouteOption.html +111 -0
- data/doc/app/classes/PageRouteRequirement.html +113 -0
- data/doc/app/classes/PageTemplate.html +278 -0
- data/doc/app/classes/Permission.html +111 -0
- data/doc/app/classes/Portlet.html +738 -0
- data/doc/app/classes/Redirect.html +111 -0
- data/doc/app/classes/Section.html +580 -0
- data/doc/app/classes/SectionNode.html +410 -0
- data/doc/app/classes/Sequence.html +146 -0
- data/doc/app/classes/Site.html +253 -0
- data/doc/app/classes/Tag.html +292 -0
- data/doc/app/classes/TagCloudPortlet.html +176 -0
- data/doc/app/classes/Tagging.html +146 -0
- data/doc/app/classes/Task.html +288 -0
- data/doc/app/classes/User.html +618 -0
- data/doc/app/classes/UserGroupMembership.html +111 -0
- data/doc/app/created.rid +1 -0
- data/doc/app/files/app/controllers/application_controller_rb.html +109 -0
- data/doc/app/files/app/controllers/cms/application_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/attachments_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/base_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/cache_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/categories_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/category_types_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/connectors_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/content_block_controller_rb.html +107 -0
- data/doc/app/files/app/controllers/cms/content_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/content_types_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/dashboard_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/dynamic_views_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/email_messages_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/error_handling_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/file_blocks_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/groups_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/home_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/html_blocks_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/image_blocks_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/links_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/page_route_conditions_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/page_route_options_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/page_route_requirements_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/page_routes_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/pages_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/portlet_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/portlets_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/redirects_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/resource_controller_rb.html +108 -0
- data/doc/app/files/app/controllers/cms/routes_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/section_nodes_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/sections_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/sessions_controller_rb.html +107 -0
- data/doc/app/files/app/controllers/cms/tags_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/tasks_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/toolbar_controller_rb.html +101 -0
- data/doc/app/files/app/controllers/cms/users_controller_rb.html +101 -0
- data/doc/app/files/app/helpers/application_helper_rb.html +108 -0
- data/doc/app/files/app/helpers/cms/application_helper_rb.html +107 -0
- data/doc/app/files/app/helpers/cms/form_builder_rb.html +101 -0
- data/doc/app/files/app/helpers/cms/form_tag_helper_rb.html +101 -0
- data/doc/app/files/app/helpers/cms/menu_helper_rb.html +101 -0
- data/doc/app/files/app/helpers/cms/page_helper_rb.html +101 -0
- data/doc/app/files/app/helpers/cms/path_helper_rb.html +101 -0
- data/doc/app/files/app/helpers/cms/section_nodes_helper_rb.html +101 -0
- data/doc/app/files/app/models/abstract_file_block_rb.html +101 -0
- data/doc/app/files/app/models/attachment_rb.html +109 -0
- data/doc/app/files/app/models/category_rb.html +101 -0
- data/doc/app/files/app/models/category_type_rb.html +101 -0
- data/doc/app/files/app/models/connector_rb.html +101 -0
- data/doc/app/files/app/models/content_type_group_rb.html +101 -0
- data/doc/app/files/app/models/content_type_rb.html +101 -0
- data/doc/app/files/app/models/dynamic_view_rb.html +101 -0
- data/doc/app/files/app/models/email_message_mailer_rb.html +101 -0
- data/doc/app/files/app/models/email_message_rb.html +101 -0
- data/doc/app/files/app/models/file_block_rb.html +101 -0
- data/doc/app/files/app/models/group_permission_rb.html +101 -0
- data/doc/app/files/app/models/group_rb.html +101 -0
- data/doc/app/files/app/models/group_section_rb.html +101 -0
- data/doc/app/files/app/models/group_type_permission_rb.html +101 -0
- data/doc/app/files/app/models/group_type_rb.html +101 -0
- data/doc/app/files/app/models/guest_user_rb.html +101 -0
- data/doc/app/files/app/models/html_block_rb.html +101 -0
- data/doc/app/files/app/models/image_block_rb.html +101 -0
- data/doc/app/files/app/models/link_rb.html +101 -0
- data/doc/app/files/app/models/page_partial_rb.html +101 -0
- data/doc/app/files/app/models/page_rb.html +101 -0
- data/doc/app/files/app/models/page_route_condition_rb.html +101 -0
- data/doc/app/files/app/models/page_route_option_rb.html +101 -0
- data/doc/app/files/app/models/page_route_rb.html +101 -0
- data/doc/app/files/app/models/page_route_requirement_rb.html +101 -0
- data/doc/app/files/app/models/page_template_rb.html +101 -0
- data/doc/app/files/app/models/permission_rb.html +101 -0
- data/doc/app/files/app/models/portlet_rb.html +101 -0
- data/doc/app/files/app/models/redirect_rb.html +101 -0
- data/doc/app/files/app/models/section_node_rb.html +101 -0
- data/doc/app/files/app/models/section_rb.html +101 -0
- data/doc/app/files/app/models/site_rb.html +101 -0
- data/doc/app/files/app/models/tag_rb.html +101 -0
- data/doc/app/files/app/models/tagging_rb.html +101 -0
- data/doc/app/files/app/models/task_rb.html +101 -0
- data/doc/app/files/app/models/user_group_membership_rb.html +101 -0
- data/doc/app/files/app/models/user_rb.html +108 -0
- data/doc/app/files/app/portlets/dynamic_portlet_rb.html +101 -0
- data/doc/app/files/app/portlets/email_page_portlet_rb.html +101 -0
- data/doc/app/files/app/portlets/login_portlet_rb.html +101 -0
- data/doc/app/files/app/portlets/tag_cloud_portlet_rb.html +101 -0
- data/doc/app/files/doc/README_FOR_APP.html +127 -0
- data/doc/app/files/lib/acts_as_list_rb.html +101 -0
- data/doc/app/files/lib/browsercms_rb.html +113 -0
- data/doc/app/files/lib/cms/acts/content_block_rb.html +101 -0
- data/doc/app/files/lib/cms/authentication/controller_rb.html +101 -0
- data/doc/app/files/lib/cms/authentication/model_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/archiving_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/attaching_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/categorizing_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/connecting_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/dynamic_attributes_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/flush_cache_on_change_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/hiding_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/pagination_rb.html +107 -0
- data/doc/app/files/lib/cms/behaviors/publishing_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/rendering_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/searching_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/soft_deleting_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/taggable_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/userstamping_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors/versioning_rb.html +101 -0
- data/doc/app/files/lib/cms/behaviors_rb.html +147 -0
- data/doc/app/files/lib/cms/caching_rb.html +101 -0
- data/doc/app/files/lib/cms/data_loader_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/action_view/base_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/active_record/base_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/active_record/errors_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/active_support/cache/file_store_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/hash_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/integer_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/nil_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions/string_rb.html +101 -0
- data/doc/app/files/lib/cms/extensions_rb.html +101 -0
- data/doc/app/files/lib/cms/init_rb.html +101 -0
- data/doc/app/files/lib/cms/routes_rb.html +101 -0
- data/doc/app/files/lib/initial_data_rb.html +101 -0
- data/doc/app/files/lib/sequence_rb.html +101 -0
- data/doc/app/fr_class_index.html +205 -0
- data/doc/app/fr_file_index.html +152 -0
- data/doc/app/fr_method_index.html +738 -0
- data/doc/app/index.html +24 -0
- data/doc/app/rdoc-style.css +208 -0
- data/doc/guides/html/build_it_yourself.html +175 -0
- data/doc/guides/html/deployment_guide.html +181 -0
- data/doc/guides/html/designer_guide.html +153 -0
- data/doc/guides/html/developer_guide.html +266 -0
- data/doc/guides/html/files/javascripts/code_highlighter.js +188 -0
- data/doc/guides/html/files/javascripts/guides.js +7 -0
- data/doc/guides/html/files/javascripts/highlighters.js +90 -0
- data/doc/guides/html/files/stylesheets/main.css +441 -0
- data/doc/guides/html/files/stylesheets/reset.css +43 -0
- data/doc/guides/html/files/stylesheets/style.css +13 -0
- data/doc/guides/html/files/stylesheets/syntax.css +31 -0
- data/doc/guides/html/getting_started.html +181 -0
- data/doc/guides/html/images/bg.png +0 -0
- data/doc/guides/html/images/bottom_cap.png +0 -0
- data/doc/guides/html/images/browsercms_logo.png +0 -0
- data/doc/guides/html/images/dot.png +0 -0
- data/doc/guides/html/images/icons/README +5 -0
- data/doc/guides/html/images/icons/callouts/1.png +0 -0
- data/doc/guides/html/images/icons/callouts/10.png +0 -0
- data/doc/guides/html/images/icons/callouts/11.png +0 -0
- data/doc/guides/html/images/icons/callouts/12.png +0 -0
- data/doc/guides/html/images/icons/callouts/13.png +0 -0
- data/doc/guides/html/images/icons/callouts/14.png +0 -0
- data/doc/guides/html/images/icons/callouts/15.png +0 -0
- data/doc/guides/html/images/icons/callouts/2.png +0 -0
- data/doc/guides/html/images/icons/callouts/3.png +0 -0
- data/doc/guides/html/images/icons/callouts/4.png +0 -0
- data/doc/guides/html/images/icons/callouts/5.png +0 -0
- data/doc/guides/html/images/icons/callouts/6.png +0 -0
- data/doc/guides/html/images/icons/callouts/7.png +0 -0
- data/doc/guides/html/images/icons/callouts/8.png +0 -0
- data/doc/guides/html/images/icons/callouts/9.png +0 -0
- data/doc/guides/html/images/icons/caution.png +0 -0
- data/doc/guides/html/images/icons/example.png +0 -0
- data/doc/guides/html/images/icons/home.png +0 -0
- data/doc/guides/html/images/icons/important.png +0 -0
- data/doc/guides/html/images/icons/next.png +0 -0
- data/doc/guides/html/images/icons/note.png +0 -0
- data/doc/guides/html/images/icons/prev.png +0 -0
- data/doc/guides/html/images/icons/tip.png +0 -0
- data/doc/guides/html/images/icons/up.png +0 -0
- data/doc/guides/html/images/icons/warning.png +0 -0
- data/doc/guides/html/images/top_cap.png +0 -0
- data/doc/guides/html/images/top_cap_content.png +0 -0
- data/doc/guides/html/index.html +168 -0
- data/doc/guides/html/installing_modules.html +181 -0
- data/doc/guides/html/user_guide.html +266 -0
- data/lib/cms/behaviors/attaching.rb +1 -1
- data/lib/cms/behaviors/rendering.rb +1 -1
- data/lib/cms/behaviors/taggable.rb +2 -1
- data/lib/cms/behaviors/versioning.rb +1 -1
- data/lib/cms/init.rb +4 -4
- data/lib/tasks/cms.rake +16 -42
- data/public/images/cms/buttons/button_cap_off_middle.gif +0 -0
- data/public/images/cms/buttons/button_left_bg.png +0 -0
- data/public/images/cms/buttons/button_off_middle.png +0 -0
- data/public/images/cms/nav_admin.gif +0 -0
- data/public/images/cms/nav_admin_h.gif +0 -0
- data/public/images/cms/nav_admin_on.gif +0 -0
- data/public/images/cms/nav_content_library.gif +0 -0
- data/public/images/cms/nav_content_library_h.gif +0 -0
- data/public/images/cms/nav_content_library_on.gif +0 -0
- data/public/images/cms/nav_dash.gif +0 -0
- data/public/images/cms/nav_dash_h.gif +0 -0
- data/public/images/cms/nav_dash_on.gif +0 -0
- data/public/images/cms/nav_sitemap.gif +0 -0
- data/public/images/cms/nav_sitemap_h.gif +0 -0
- data/public/images/cms/nav_sitemap_on.gif +0 -0
- data/public/stylesheets/cms/administration.css +91 -91
- data/public/stylesheets/cms/block.css +25 -25
- data/public/stylesheets/cms/buttons.css +120 -111
- data/public/stylesheets/cms/content_library.css +2 -1
- data/public/stylesheets/cms/content_types.css +3 -3
- data/public/stylesheets/cms/dashboard.css +118 -118
- data/public/stylesheets/cms/data_table.css +155 -155
- data/public/stylesheets/cms/form_layout.css +269 -269
- data/public/stylesheets/cms/jquery.contextMenu.css +61 -61
- data/public/stylesheets/cms/login.css +77 -77
- data/public/stylesheets/cms/menu.css +116 -116
- data/public/stylesheets/cms/nav.css +98 -111
- data/public/stylesheets/cms/page_toolbar.css +134 -134
- data/public/stylesheets/cms/sitemap.css +31 -15
- data/rails_generators/content_block/content_block_generator.rb +4 -9
- data/rails_generators/content_block/templates/_form.html.erb +3 -1
- data/rails_generators/portlet/portlet_generator.rb +2 -6
- data/rails_generators/portlet/templates/_form.html.erb +1 -0
- data/templates/blank.rb +30 -0
- data/templates/demo.rb +28 -0
- data/templates/module.rb +945 -0
- data/test/functional/cms/connectors_controller_test.rb +12 -1
- data/test/functional/cms/portlets_controller_test.rb +10 -0
- data/test/unit/behaviors/taggable_test.rb +19 -0
- data/test/unit/helpers/menu_helper_test.rb +72 -1
- data/test/unit/lib/generators_test.rb +21 -3
- data/test/unit/models/connector_test.rb +16 -0
- data/test/unit/models/sections_test.rb +4 -0
- metadata +380 -2
@@ -0,0 +1,437 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Cms::Behaviors::Pagination::Collection</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Cms::Behaviors::Pagination::Collection</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/cms/behaviors/pagination_rb.html">
|
59
|
+
lib/cms/behaviors/pagination.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Array
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000399">create</a>
|
90
|
+
<a href="#M000398">new</a>
|
91
|
+
<a href="#M000403">next_page</a>
|
92
|
+
<a href="#M000401">offset</a>
|
93
|
+
<a href="#M000400">out_of_bounds?</a>
|
94
|
+
<a href="#M000402">previous_page</a>
|
95
|
+
<a href="#M000405">replace</a>
|
96
|
+
<a href="#M000404">total_entries=</a>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
|
105
|
+
<div id="section">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<div id="attribute-list">
|
112
|
+
<h3 class="section-bar">Attributes</h3>
|
113
|
+
|
114
|
+
<div class="name-list">
|
115
|
+
<table>
|
116
|
+
<tr class="top-aligned-row context-row">
|
117
|
+
<td class="context-item-name">current_page</td>
|
118
|
+
<td class="context-item-value"> [R] </td>
|
119
|
+
<td class="context-item-desc"></td>
|
120
|
+
</tr>
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">per_page</td>
|
123
|
+
<td class="context-item-value"> [R] </td>
|
124
|
+
<td class="context-item-desc"></td>
|
125
|
+
</tr>
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">total_entries</td>
|
128
|
+
<td class="context-item-value"> [R] </td>
|
129
|
+
<td class="context-item-desc"></td>
|
130
|
+
</tr>
|
131
|
+
<tr class="top-aligned-row context-row">
|
132
|
+
<td class="context-item-name">total_pages</td>
|
133
|
+
<td class="context-item-value"> [R] </td>
|
134
|
+
<td class="context-item-desc"></td>
|
135
|
+
</tr>
|
136
|
+
</table>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<!-- if method_list -->
|
143
|
+
<div id="methods">
|
144
|
+
<h3 class="section-bar">Public Class methods</h3>
|
145
|
+
|
146
|
+
<div id="method-M000399" class="method-detail">
|
147
|
+
<a name="M000399"></a>
|
148
|
+
|
149
|
+
<div class="method-heading">
|
150
|
+
<a href="#M000399" class="method-signature">
|
151
|
+
<span class="method-name">create</span><span class="method-args">(page, per_page, total = nil) {|pager| ...}</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p>
|
157
|
+
Just like <tt><a href="Collection.html#M000398">new</a></tt>, but yields
|
158
|
+
the object after instantiation and returns it afterwards. This is very
|
159
|
+
useful for manual pagination:
|
160
|
+
</p>
|
161
|
+
<pre>
|
162
|
+
@entries = WillPaginate::Collection.create(1, 10) do |pager|
|
163
|
+
result = Post.find(:all, :limit => pager.per_page, :offset => pager.offset)
|
164
|
+
# inject the result array into the paginated collection:
|
165
|
+
pager.replace(result)
|
166
|
+
|
167
|
+
unless pager.total_entries
|
168
|
+
# the pager didn't manage to guess the total count, do it manually
|
169
|
+
pager.total_entries = Post.count
|
170
|
+
end
|
171
|
+
end
|
172
|
+
</pre>
|
173
|
+
<p>
|
174
|
+
The possibilities with this are endless. For another example, here is how
|
175
|
+
WillPaginate used to define pagination for Array instances:
|
176
|
+
</p>
|
177
|
+
<pre>
|
178
|
+
Array.class_eval do
|
179
|
+
def paginate(page = 1, per_page = 15)
|
180
|
+
WillPaginate::Collection.create(page, per_page, size) do |pager|
|
181
|
+
pager.replace self[pager.offset, pager.per_page].to_a
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
</pre>
|
186
|
+
<p>
|
187
|
+
The Array#paginate API has since then changed, but this still serves as a
|
188
|
+
fine example of WillPaginate::Collection usage.
|
189
|
+
</p>
|
190
|
+
<p><a class="source-toggle" href="#"
|
191
|
+
onclick="toggleCode('M000399-source');return false;">[Source]</a></p>
|
192
|
+
<div class="method-source-code" id="M000399-source">
|
193
|
+
<pre>
|
194
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 59</span>
|
195
|
+
59: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">per_page</span>, <span class="ruby-identifier">total</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
196
|
+
60: <span class="ruby-identifier">pager</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">per_page</span>, <span class="ruby-identifier">total</span>)
|
197
|
+
61: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">pager</span>
|
198
|
+
62: <span class="ruby-identifier">pager</span>
|
199
|
+
63: <span class="ruby-keyword kw">end</span>
|
200
|
+
</pre>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div id="method-M000398" class="method-detail">
|
206
|
+
<a name="M000398"></a>
|
207
|
+
|
208
|
+
<div class="method-heading">
|
209
|
+
<a href="#M000398" class="method-signature">
|
210
|
+
<span class="method-name">new</span><span class="method-args">(page, per_page, total = nil)</span>
|
211
|
+
</a>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div class="method-description">
|
215
|
+
<p>
|
216
|
+
Arguments to the constructor are the current page number, per-page limit
|
217
|
+
and the total number of entries. The last argument is optional because it
|
218
|
+
is best to do lazy counting; in other words, count <b>conditionally</b>
|
219
|
+
after populating the collection using the <tt><a
|
220
|
+
href="Collection.html#M000405">replace</a></tt> method.
|
221
|
+
</p>
|
222
|
+
<p><a class="source-toggle" href="#"
|
223
|
+
onclick="toggleCode('M000398-source');return false;">[Source]</a></p>
|
224
|
+
<div class="method-source-code" id="M000398-source">
|
225
|
+
<pre>
|
226
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 23</span>
|
227
|
+
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">per_page</span>, <span class="ruby-identifier">total</span> = <span class="ruby-keyword kw">nil</span>)
|
228
|
+
24: <span class="ruby-ivar">@current_page</span> = <span class="ruby-identifier">page</span>.<span class="ruby-identifier">to_i</span>
|
229
|
+
25: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidPage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">page</span>, <span class="ruby-ivar">@current_page</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@current_page</span> <span class="ruby-operator"><</span> <span class="ruby-value">1</span>
|
230
|
+
26: <span class="ruby-ivar">@per_page</span> = <span class="ruby-identifier">per_page</span>.<span class="ruby-identifier">to_i</span>
|
231
|
+
27: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"`per_page` setting cannot be less than 1 (#{@per_page} given)"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@per_page</span> <span class="ruby-operator"><</span> <span class="ruby-value">1</span>
|
232
|
+
28:
|
233
|
+
29: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_entries</span> = <span class="ruby-identifier">total</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">total</span>
|
234
|
+
30: <span class="ruby-keyword kw">end</span>
|
235
|
+
</pre>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
241
|
+
|
242
|
+
<div id="method-M000403" class="method-detail">
|
243
|
+
<a name="M000403"></a>
|
244
|
+
|
245
|
+
<div class="method-heading">
|
246
|
+
<a href="#M000403" class="method-signature">
|
247
|
+
<span class="method-name">next_page</span><span class="method-args">()</span>
|
248
|
+
</a>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div class="method-description">
|
252
|
+
<p>
|
253
|
+
current_page + 1 or nil if there is no next page
|
254
|
+
</p>
|
255
|
+
<p><a class="source-toggle" href="#"
|
256
|
+
onclick="toggleCode('M000403-source');return false;">[Source]</a></p>
|
257
|
+
<div class="method-source-code" id="M000403-source">
|
258
|
+
<pre>
|
259
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 86</span>
|
260
|
+
86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">next_page</span>
|
261
|
+
87: <span class="ruby-identifier">current_page</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">total_pages</span> <span class="ruby-value">? </span>(<span class="ruby-identifier">current_page</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
262
|
+
88: <span class="ruby-keyword kw">end</span>
|
263
|
+
</pre>
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div id="method-M000401" class="method-detail">
|
269
|
+
<a name="M000401"></a>
|
270
|
+
|
271
|
+
<div class="method-heading">
|
272
|
+
<a href="#M000401" class="method-signature">
|
273
|
+
<span class="method-name">offset</span><span class="method-args">()</span>
|
274
|
+
</a>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div class="method-description">
|
278
|
+
<p>
|
279
|
+
Current <a href="Collection.html#M000401">offset</a> of the paginated
|
280
|
+
collection. If we‘re on the first page, it is always 0. If
|
281
|
+
we‘re on the 2nd page and there are 30 entries per page, the <a
|
282
|
+
href="Collection.html#M000401">offset</a> is 30. This property is useful if
|
283
|
+
you want to render ordinals besides your records: simply start with <a
|
284
|
+
href="Collection.html#M000401">offset</a> + 1.
|
285
|
+
</p>
|
286
|
+
<p><a class="source-toggle" href="#"
|
287
|
+
onclick="toggleCode('M000401-source');return false;">[Source]</a></p>
|
288
|
+
<div class="method-source-code" id="M000401-source">
|
289
|
+
<pre>
|
290
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 76</span>
|
291
|
+
76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">offset</span>
|
292
|
+
77: (<span class="ruby-identifier">current_page</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">*</span> <span class="ruby-identifier">per_page</span>
|
293
|
+
78: <span class="ruby-keyword kw">end</span>
|
294
|
+
</pre>
|
295
|
+
</div>
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
<div id="method-M000400" class="method-detail">
|
300
|
+
<a name="M000400"></a>
|
301
|
+
|
302
|
+
<div class="method-heading">
|
303
|
+
<a href="#M000400" class="method-signature">
|
304
|
+
<span class="method-name">out_of_bounds?</span><span class="method-args">()</span>
|
305
|
+
</a>
|
306
|
+
</div>
|
307
|
+
|
308
|
+
<div class="method-description">
|
309
|
+
<p>
|
310
|
+
Helper method that is true when someone tries to fetch a page with a larger
|
311
|
+
number than the last page. Can be used in combination with flashes and
|
312
|
+
redirecting.
|
313
|
+
</p>
|
314
|
+
<p><a class="source-toggle" href="#"
|
315
|
+
onclick="toggleCode('M000400-source');return false;">[Source]</a></p>
|
316
|
+
<div class="method-source-code" id="M000400-source">
|
317
|
+
<pre>
|
318
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 68</span>
|
319
|
+
68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">out_of_bounds?</span>
|
320
|
+
69: <span class="ruby-identifier">current_page</span> <span class="ruby-operator">></span> <span class="ruby-identifier">total_pages</span>
|
321
|
+
70: <span class="ruby-keyword kw">end</span>
|
322
|
+
</pre>
|
323
|
+
</div>
|
324
|
+
</div>
|
325
|
+
</div>
|
326
|
+
|
327
|
+
<div id="method-M000402" class="method-detail">
|
328
|
+
<a name="M000402"></a>
|
329
|
+
|
330
|
+
<div class="method-heading">
|
331
|
+
<a href="#M000402" class="method-signature">
|
332
|
+
<span class="method-name">previous_page</span><span class="method-args">()</span>
|
333
|
+
</a>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
<div class="method-description">
|
337
|
+
<p>
|
338
|
+
current_page - 1 or nil if there is no previous page
|
339
|
+
</p>
|
340
|
+
<p><a class="source-toggle" href="#"
|
341
|
+
onclick="toggleCode('M000402-source');return false;">[Source]</a></p>
|
342
|
+
<div class="method-source-code" id="M000402-source">
|
343
|
+
<pre>
|
344
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 81</span>
|
345
|
+
81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">previous_page</span>
|
346
|
+
82: <span class="ruby-identifier">current_page</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> (<span class="ruby-identifier">current_page</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
347
|
+
83: <span class="ruby-keyword kw">end</span>
|
348
|
+
</pre>
|
349
|
+
</div>
|
350
|
+
</div>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
<div id="method-M000405" class="method-detail">
|
354
|
+
<a name="M000405"></a>
|
355
|
+
|
356
|
+
<div class="method-heading">
|
357
|
+
<a href="#M000405" class="method-signature">
|
358
|
+
<span class="method-name">replace</span><span class="method-args">(array)</span>
|
359
|
+
</a>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
<div class="method-description">
|
363
|
+
<p>
|
364
|
+
This is a magic wrapper for the original Array#replace method. It serves
|
365
|
+
for populating the paginated collection after initialization.
|
366
|
+
</p>
|
367
|
+
<p>
|
368
|
+
Why magic? Because it tries to guess the total number of entries judging by
|
369
|
+
the size of given array. If it is shorter than <tt>per_page</tt> limit,
|
370
|
+
then we know we‘re on the last page. This trick is very useful for
|
371
|
+
avoiding unnecessary hits to the database to do the counting after we
|
372
|
+
fetched the data for the current page.
|
373
|
+
</p>
|
374
|
+
<p>
|
375
|
+
However, after using <tt><a href="Collection.html#M000405">replace</a></tt>
|
376
|
+
you should always test the value of <tt>total_entries</tt> and set it to a
|
377
|
+
proper value if it‘s <tt>nil</tt>. See the example in <tt><a
|
378
|
+
href="Collection.html#M000399">create</a></tt>.
|
379
|
+
</p>
|
380
|
+
<p><a class="source-toggle" href="#"
|
381
|
+
onclick="toggleCode('M000405-source');return false;">[Source]</a></p>
|
382
|
+
<div class="method-source-code" id="M000405-source">
|
383
|
+
<pre>
|
384
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 107</span>
|
385
|
+
107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replace</span>(<span class="ruby-identifier">array</span>)
|
386
|
+
108: <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">super</span>
|
387
|
+
109:
|
388
|
+
110: <span class="ruby-comment cmt"># The collection is shorter then page limit? Rejoice, because</span>
|
389
|
+
111: <span class="ruby-comment cmt"># then we know that we are on the last page!</span>
|
390
|
+
112: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">total_entries</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">length</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">per_page</span> <span class="ruby-keyword kw">and</span> (<span class="ruby-identifier">current_page</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>)
|
391
|
+
113: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">total_entries</span> = <span class="ruby-identifier">offset</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">length</span>
|
392
|
+
114: <span class="ruby-keyword kw">end</span>
|
393
|
+
115:
|
394
|
+
116: <span class="ruby-identifier">result</span>
|
395
|
+
117: <span class="ruby-keyword kw">end</span>
|
396
|
+
</pre>
|
397
|
+
</div>
|
398
|
+
</div>
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div id="method-M000404" class="method-detail">
|
402
|
+
<a name="M000404"></a>
|
403
|
+
|
404
|
+
<div class="method-heading">
|
405
|
+
<a href="#M000404" class="method-signature">
|
406
|
+
<span class="method-name">total_entries=</span><span class="method-args">(number)</span>
|
407
|
+
</a>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
<div class="method-description">
|
411
|
+
<p><a class="source-toggle" href="#"
|
412
|
+
onclick="toggleCode('M000404-source');return false;">[Source]</a></p>
|
413
|
+
<div class="method-source-code" id="M000404-source">
|
414
|
+
<pre>
|
415
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 90</span>
|
416
|
+
90: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">total_entries=</span>(<span class="ruby-identifier">number</span>)
|
417
|
+
91: <span class="ruby-ivar">@total_entries</span> = <span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span>
|
418
|
+
92: <span class="ruby-ivar">@total_pages</span> = (<span class="ruby-ivar">@total_entries</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">per_page</span>.<span class="ruby-identifier">to_f</span>).<span class="ruby-identifier">ceil</span>
|
419
|
+
93: <span class="ruby-keyword kw">end</span>
|
420
|
+
</pre>
|
421
|
+
</div>
|
422
|
+
</div>
|
423
|
+
</div>
|
424
|
+
|
425
|
+
|
426
|
+
</div>
|
427
|
+
|
428
|
+
|
429
|
+
</div>
|
430
|
+
|
431
|
+
|
432
|
+
<div id="validator-badges">
|
433
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
434
|
+
</div>
|
435
|
+
|
436
|
+
</body>
|
437
|
+
</html>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Cms::Behaviors::Pagination::InvalidPage</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Cms::Behaviors::Pagination::InvalidPage</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/cms/behaviors/pagination_rb.html">
|
59
|
+
lib/cms/behaviors/pagination.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
ArgumentError
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000397">new</a>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if includes -->
|
97
|
+
|
98
|
+
<div id="section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
<div id="methods">
|
109
|
+
<h3 class="section-bar">Public Class methods</h3>
|
110
|
+
|
111
|
+
<div id="method-M000397" class="method-detail">
|
112
|
+
<a name="M000397"></a>
|
113
|
+
|
114
|
+
<div class="method-heading">
|
115
|
+
<a href="#M000397" class="method-signature">
|
116
|
+
<span class="method-name">new</span><span class="method-args">(page, page_num)</span>
|
117
|
+
</a>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="method-description">
|
121
|
+
<p><a class="source-toggle" href="#"
|
122
|
+
onclick="toggleCode('M000397-source');return false;">[Source]</a></p>
|
123
|
+
<div class="method-source-code" id="M000397-source">
|
124
|
+
<pre>
|
125
|
+
<span class="ruby-comment cmt"># File lib/cms/behaviors/pagination.rb, line 12</span>
|
126
|
+
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">page</span>, <span class="ruby-identifier">page_num</span>)
|
127
|
+
13: <span class="ruby-keyword kw">super</span> <span class="ruby-node">"#{page.inspect} given as value, which translates to '#{page_num}' as page number"</span>
|
128
|
+
14: <span class="ruby-keyword kw">end</span>
|
129
|
+
</pre>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
<div id="validator-badges">
|
142
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
</body>
|
146
|
+
</html>
|