camaleon_cms 2.2.1 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -3
  3. data/app/apps/plugins/attack/admin_controller.rb +1 -9
  4. data/app/apps/plugins/attack/attack_helper.rb +1 -9
  5. data/app/apps/plugins/attack/config/custom_models.rb +1 -1
  6. data/app/apps/plugins/attack/models/attack.rb +1 -10
  7. data/app/apps/plugins/authoring_post/authoring_post_helper.rb +51 -0
  8. data/app/apps/plugins/authoring_post/config/config.json +24 -0
  9. data/app/apps/plugins/front_cache/admin_controller.rb +0 -8
  10. data/app/apps/plugins/front_cache/config/initializer.rb +1 -1
  11. data/app/apps/plugins/front_cache/front_cache_helper.rb +0 -8
  12. data/app/apps/plugins/visibility_post/visibility_post_helper.rb +1 -9
  13. data/app/apps/themes/camaleon_first/main_helper.rb +1 -9
  14. data/app/apps/themes/default/default_helper.rb +1 -9
  15. data/app/apps/themes/default/views/partials/_forms.html.erb +1 -1
  16. data/app/apps/themes/new/custom_helper.rb +1 -9
  17. data/app/assets/javascripts/camaleon_cms/admin/_custom_fields.js +3 -3
  18. data/app/controllers/camaleon_cms/admin/appearances/nav_menus_controller.rb +2 -10
  19. data/app/controllers/camaleon_cms/admin/appearances/themes_controller.rb +0 -8
  20. data/app/controllers/camaleon_cms/admin/appearances/widgets/assign_controller.rb +1 -9
  21. data/app/controllers/camaleon_cms/admin/appearances/widgets/main_controller.rb +2 -10
  22. data/app/controllers/camaleon_cms/admin/appearances/widgets/sidebar_controller.rb +2 -10
  23. data/app/controllers/camaleon_cms/admin/categories_controller.rb +2 -12
  24. data/app/controllers/camaleon_cms/admin/comments_controller.rb +0 -8
  25. data/app/controllers/camaleon_cms/admin/installers_controller.rb +1 -9
  26. data/app/controllers/camaleon_cms/admin/media_controller.rb +2 -10
  27. data/app/controllers/camaleon_cms/admin/plugins_controller.rb +0 -8
  28. data/app/controllers/camaleon_cms/admin/post_tags_controller.rb +2 -12
  29. data/app/controllers/camaleon_cms/admin/posts/drafts_controller.rb +2 -10
  30. data/app/controllers/camaleon_cms/admin/posts_controller.rb +7 -15
  31. data/app/controllers/camaleon_cms/admin/sessions_controller.rb +2 -10
  32. data/app/controllers/camaleon_cms/admin/settings/custom_fields_controller.rb +5 -12
  33. data/app/controllers/camaleon_cms/admin/settings/post_types_controller.rb +1 -9
  34. data/app/controllers/camaleon_cms/admin/settings/sites_controller.rb +2 -10
  35. data/app/controllers/camaleon_cms/admin/settings_controller.rb +1 -9
  36. data/app/controllers/camaleon_cms/admin/user_roles_controller.rb +2 -10
  37. data/app/controllers/camaleon_cms/admin/users_controller.rb +3 -11
  38. data/app/controllers/camaleon_cms/admin_controller.rb +0 -8
  39. data/app/controllers/camaleon_cms/apps/plugins_admin_controller.rb +0 -8
  40. data/app/controllers/camaleon_cms/apps/plugins_front_controller.rb +0 -8
  41. data/app/controllers/camaleon_cms/apps/themes_admin_controller.rb +0 -8
  42. data/app/controllers/camaleon_cms/apps/themes_front_controller.rb +0 -8
  43. data/app/controllers/camaleon_cms/camaleon_controller.rb +0 -8
  44. data/app/controllers/camaleon_cms/frontend_controller.rb +17 -27
  45. data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +2 -10
  46. data/app/decorators/camaleon_cms/application_decorator.rb +1 -9
  47. data/app/decorators/camaleon_cms/category_decorator.rb +0 -8
  48. data/app/decorators/camaleon_cms/custom_field_decorator.rb +0 -8
  49. data/app/decorators/camaleon_cms/custom_fields_concern.rb +1 -9
  50. data/app/decorators/camaleon_cms/metas_decorator_methods.rb +1 -9
  51. data/app/decorators/camaleon_cms/nav_menu_item_decorator.rb +0 -8
  52. data/app/decorators/camaleon_cms/plugin_decorator.rb +0 -8
  53. data/app/decorators/camaleon_cms/post_comment_decorator.rb +0 -8
  54. data/app/decorators/camaleon_cms/post_decorator.rb +0 -8
  55. data/app/decorators/camaleon_cms/post_tag_decorator.rb +0 -8
  56. data/app/decorators/camaleon_cms/post_type_decorator.rb +0 -8
  57. data/app/decorators/camaleon_cms/site_decorator.rb +0 -8
  58. data/app/decorators/camaleon_cms/term_taxonomy_decorator.rb +0 -8
  59. data/app/decorators/camaleon_cms/theme_decorator.rb +0 -8
  60. data/app/decorators/camaleon_cms/user_decorator.rb +0 -8
  61. data/app/decorators/camaleon_cms/widget_decorator.rb +0 -8
  62. data/app/helpers/camaleon_cms/admin/application_helper.rb +1 -9
  63. data/app/helpers/camaleon_cms/admin/breadcrumb_helper.rb +1 -9
  64. data/app/helpers/camaleon_cms/admin/category_helper.rb +1 -9
  65. data/app/helpers/camaleon_cms/admin/custom_fields_helper.rb +1 -9
  66. data/app/helpers/camaleon_cms/admin/menus_helper.rb +0 -8
  67. data/app/helpers/camaleon_cms/admin/post_type_helper.rb +1 -9
  68. data/app/helpers/camaleon_cms/camaleon_helper.rb +0 -8
  69. data/app/helpers/camaleon_cms/captcha_helper.rb +0 -8
  70. data/app/helpers/camaleon_cms/comment_helper.rb +1 -1
  71. data/app/helpers/camaleon_cms/content_helper.rb +1 -9
  72. data/app/helpers/camaleon_cms/frontend/application_helper.rb +0 -8
  73. data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +0 -8
  74. data/app/helpers/camaleon_cms/frontend/seo_helper.rb +0 -8
  75. data/app/helpers/camaleon_cms/frontend/site_helper.rb +0 -8
  76. data/app/helpers/camaleon_cms/hooks_helper.rb +0 -8
  77. data/app/helpers/camaleon_cms/html_helper.rb +0 -8
  78. data/app/helpers/camaleon_cms/plugins_helper.rb +12 -16
  79. data/app/helpers/camaleon_cms/session_helper.rb +0 -8
  80. data/app/helpers/camaleon_cms/short_code_helper.rb +0 -8
  81. data/app/helpers/camaleon_cms/site_helper.rb +0 -8
  82. data/app/helpers/camaleon_cms/theme_helper.rb +0 -8
  83. data/app/helpers/camaleon_cms/uploader_helper.rb +0 -8
  84. data/app/helpers/camaleon_cms/user_roles_helper.rb +1 -9
  85. data/app/mailers/camaleon_cms/html_mailer.rb +0 -8
  86. data/app/models/camaleon_cms/ability.rb +6 -8
  87. data/app/models/camaleon_cms/category.rb +0 -8
  88. data/app/models/camaleon_cms/custom_field.rb +1 -9
  89. data/app/models/camaleon_cms/custom_field_group.rb +0 -8
  90. data/app/models/camaleon_cms/custom_fields_relationship.rb +1 -9
  91. data/app/models/camaleon_cms/meta.rb +1 -9
  92. data/app/models/camaleon_cms/nav_menu.rb +0 -8
  93. data/app/models/camaleon_cms/nav_menu_item.rb +1 -9
  94. data/app/models/camaleon_cms/plugin.rb +0 -8
  95. data/app/models/camaleon_cms/post.rb +1 -9
  96. data/app/models/camaleon_cms/post_comment.rb +1 -10
  97. data/app/models/camaleon_cms/post_default.rb +6 -14
  98. data/app/models/camaleon_cms/post_relationship.rb +1 -9
  99. data/app/models/camaleon_cms/post_tag.rb +0 -8
  100. data/app/models/camaleon_cms/post_type.rb +1 -9
  101. data/app/models/camaleon_cms/site.rb +2 -10
  102. data/app/models/camaleon_cms/term_relationship.rb +0 -9
  103. data/app/models/camaleon_cms/term_taxonomy.rb +3 -11
  104. data/app/models/camaleon_cms/theme.rb +0 -8
  105. data/app/models/camaleon_cms/user.rb +3 -13
  106. data/app/models/camaleon_cms/user_relationship.rb +1 -9
  107. data/app/models/camaleon_cms/user_role.rb +0 -8
  108. data/app/models/camaleon_cms/widget.rb +1 -9
  109. data/app/models/camaleon_cms/widget/assigned.rb +1 -9
  110. data/app/models/camaleon_cms/widget/main.rb +1 -9
  111. data/app/models/camaleon_cms/widget/sidebar.rb +0 -8
  112. data/app/models/concerns/camaleon_cms/categories_tags_for_posts.rb +1 -9
  113. data/app/models/concerns/camaleon_cms/custom_fields_read.rb +2 -10
  114. data/app/models/concerns/camaleon_cms/metas.rb +6 -14
  115. data/app/models/plugins.rb +0 -8
  116. data/app/models/themes.rb +0 -8
  117. data/app/uploaders/camaleon_cms_aws_uploader.rb +1 -1
  118. data/app/uploaders/camaleon_cms_local_uploader.rb +2 -2
  119. data/app/uploaders/camaleon_cms_uploader.rb +1 -1
  120. data/app/views/camaleon_cms/admin/posts/form.html.erb +1 -1
  121. data/app/views/camaleon_cms/admin/sessions/forgot.html.erb +1 -1
  122. data/app/views/camaleon_cms/admin/sessions/login.html.erb +1 -1
  123. data/app/views/camaleon_cms/admin/sessions/register.html.erb +1 -1
  124. data/app/views/camaleon_cms/admin/users/form.html.erb +1 -1
  125. data/app/views/camaleon_cms/default_theme/partials/_forms.html.erb +1 -1
  126. data/app/views/layouts/camaleon_cms/admin.html.erb +1 -1
  127. data/app/views/layouts/camaleon_cms/admin/_ajax.html.erb +1 -1
  128. data/config/initializers/action_view.rb +33 -17
  129. data/config/initializers/active_record_extension.rb +0 -8
  130. data/config/initializers/assets.rb +2 -9
  131. data/config/initializers/custom_initializers.rb +0 -8
  132. data/config/locales/camaleon_cms/admin/en.yml +12 -12
  133. data/db/migrate/20150611161134_post_table_into_utf8.rb +22 -14
  134. data/db/migrate/20151212095328_add_confirm_token_to_users.rb +3 -3
  135. data/db/migrate/20160504155653_move_first_name_of_users.rb +3 -3
  136. data/lib/camaleon_cms/engine.rb +1 -2
  137. data/lib/camaleon_cms/version.rb +1 -1
  138. data/lib/plugin_routes.rb +1 -2
  139. metadata +4 -30
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::Apps::PluginsFrontController < CamaleonCms::FrontendController
10
2
  before_action :init_plugin
11
3
  layout Proc.new { |controller| "themes/#{current_theme.slug}/views/layouts/index" }
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::Apps::ThemesAdminController < CamaleonCms::AdminController
10
2
  before_action :init_theme
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::Apps::ThemesFrontController < CamaleonCms::FrontendController
10
2
  before_action :init_theme
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::CamaleonController < ApplicationController
10
2
  add_flash_types :warning
11
3
  add_flash_types :error
@@ -1,17 +1,8 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
10
2
  before_action :init_frontent
11
3
  include CamaleonCms::FrontendConcern
12
4
  include CamaleonCms::Frontend::ApplicationHelper
13
5
  layout Proc.new { |controller| params[:cama_ajax_request].present? ? "cama_ajax" : 'index' }
14
-
15
6
  before_action :before_hooks
16
7
  after_action :after_hooks
17
8
  # rescue_from ActiveRecord::RecordNotFound, with: :page_not_found
@@ -22,9 +13,8 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
22
13
  if @_site_options[:home_page].present?
23
14
  render_post(@_site_options[:home_page].to_i)
24
15
  else
25
- r = {layout: (self.send :_layout), render: "index"}
26
- hooks_run("on_render_index", r)
27
- render r[:render], layout: r[:layout]
16
+ r = {layout: nil, render: "index"}; hooks_run("on_render_index", r)
17
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
28
18
  end
29
19
  end
30
20
 
@@ -44,9 +34,9 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
44
34
  r_file = lookup_context.template_exists?("categories/#{@category.the_slug}") ? "categories/#{@category.the_slug}" : 'category' unless r_file.present? # default template category for all categories for all posttypes
45
35
 
46
36
  layout_ = lookup_context.template_exists?("layouts/post_types/#{@post_type.the_slug}/category") ? "post_types/#{@post_type.the_slug}/category" : nil unless layout_.present? # layout for all categories within a posttype
47
- layout_ = lookup_context.template_exists?("layouts/categories/#{@category.the_slug}") ? "categories/#{@category.the_slug}" : (self.send :_layout) unless layout_.present? # layout for categories for all post types
37
+ layout_ = lookup_context.template_exists?("layouts/categories/#{@category.the_slug}") ? "categories/#{@category.the_slug}" : nil unless layout_.present? # layout for categories for all post types
48
38
  r = {category: @category, layout: layout_, render: r_file}; hooks_run("on_render_category", r)
49
- render r[:render], layout: r[:layout]
39
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
50
40
  end
51
41
 
52
42
  # render contents from post type
@@ -61,16 +51,16 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
61
51
  @categories = @post_type.categories.no_empty.eager_load(:metas).decorate
62
52
  @post_tags = @post_type.post_tags.eager_load(:metas)
63
53
  r_file = lookup_context.template_exists?("post_types/#{@post_type.the_slug}") ? "post_types/#{@post_type.the_slug}" : "post_type"
64
- layout_ = lookup_context.template_exists?("layouts/post_types/#{@post_type.the_slug}") ? "post_types/#{@post_type.the_slug}" : (self.send :_layout)
54
+ layout_ = lookup_context.template_exists?("layouts/post_types/#{@post_type.the_slug}") ? "post_types/#{@post_type.the_slug}" : nil
65
55
  r = {post_type: @post_type, layout: layout_, render: r_file}; hooks_run("on_render_post_type", r)
66
- render r[:render], layout: r[:layout]
56
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
67
57
  end
68
58
 
69
59
  # render contents for the post tag
70
60
  def post_tag
71
61
  begin
72
62
  if params[:post_tag_slug].present?
73
- @post_tag = current_site.post_tags.find_by_slug(params[:post_tag_id]).decorate
63
+ @post_tag = current_site.post_tags.find_by_slug(params[:post_tag_slug]).decorate
74
64
  else
75
65
  @post_tag = current_site.post_tags.find(params[:post_tag_id]).decorate
76
66
  end
@@ -81,9 +71,9 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
81
71
  @cama_visited_tag = @post_tag
82
72
  @posts = @post_tag.the_posts.paginate(:page => params[:page], :per_page => current_site.front_per_page).eager_load(:metas)
83
73
  r_file = lookup_context.template_exists?("post_types/#{@post_type.the_slug}/post_tag") ? "post_types/#{@post_type.the_slug}/post_tag" : 'post_tag'
84
- layout_ = lookup_context.template_exists?("layouts/post_tag") ? "post_tag" : (self.send :_layout)
74
+ layout_ = lookup_context.template_exists?("layouts/post_tag") ? "post_tag" : nil
85
75
  r = {post_tag: @post_tag, layout: layout_, render: r_file}; hooks_run("on_render_post_tag", r)
86
- render r[:render], layout: r[:layout]
76
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
87
77
  end
88
78
 
89
79
  # search contents
@@ -92,22 +82,22 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
92
82
  items = params[:post_type_slugs].present? ? current_site.the_posts(params[:post_type_slugs].split(',')) : current_site.the_posts
93
83
  @cama_visited_search = true
94
84
  @param_search = params[:q]
95
- layout_ = lookup_context.template_exists?("layouts/search") ? "search" : (self.send :_layout)
85
+ layout_ = lookup_context.template_exists?("layouts/search") ? "search" : nil
96
86
  r = {layout: layout_, render: "search", posts: nil}; hooks_run("on_render_search", r)
97
87
  params[:q] = (params[:q] || '').downcase
98
88
  @posts = r[:posts] != nil ? r[:posts] : items.where("LOWER(title) LIKE ? OR LOWER(content_filtered) LIKE ?", "%#{params[:q]}%", "%#{params[:q]}%")
99
89
  @posts_size = @posts.size
100
90
  @posts = @posts.paginate(:page => params[:page], :per_page => current_site.front_per_page)
101
- render r[:render], layout: r[:layout]
91
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
102
92
  end
103
93
 
104
94
  # ajax requests
105
95
  def ajax
106
- r = {render_file: nil, render_text: "", layout: (self.send :_layout) }
96
+ r = {render_file: nil, render_text: "", layout: nil }
107
97
  @cama_visited_ajax = true
108
98
  hooks_run("on_ajax", r)
109
99
  if r[:render_file]
110
- render r[:render_file], layout: r[:layout]
100
+ render r[:render_file], (!r[:layout].nil? ? {layout: r[:layout]} : {})
111
101
  else
112
102
  render inline: r[:render_text]
113
103
  end
@@ -130,9 +120,9 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
130
120
  return page_not_found
131
121
  end
132
122
  @cama_visited_profile = true
133
- layout_ = lookup_context.template_exists?("layouts/profile") ? "profile" : (self.send :_layout)
123
+ layout_ = lookup_context.template_exists?("layouts/profile") ? "profile" : nil
134
124
  r = {user: @user, layout: layout_, render: "profile"}; hooks_run("on_render_profile", r)
135
- render r[:render], layout: r[:layout]
125
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
136
126
  end
137
127
 
138
128
  private
@@ -186,12 +176,12 @@ class CamaleonCms::FrontendController < CamaleonCms::CamaleonController
186
176
  r_file = "single"
187
177
  end
188
178
 
189
- layout_ = self.send :_layout
179
+ layout_ = nil
190
180
  meta_layout = @post.get_layout(@post_type)
191
181
  layout_ = meta_layout if meta_layout.present? && lookup_context.template_exists?("layouts/#{meta_layout}")
192
182
  r = {post: @post, post_type: @post_type, layout: layout_, render: r_file}
193
183
  hooks_run("on_render_post", r) if from_url
194
- render r[:render], layout: r[:layout]
184
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
195
185
  end
196
186
  end
197
187
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  module CamaleonCms::FrontendConcern extend ActiveSupport::Concern
10
2
  # visiting sitemap.xml
11
3
  # With hook "on_render_sitemap" you can skip post_types, categories, tags or posts
@@ -13,10 +5,10 @@ module CamaleonCms::FrontendConcern extend ActiveSupport::Concern
13
5
  # you can add custom sitemap elements in the attr "custom", like: https://github.com/owen2345/camaleon-cms/issues/106#issuecomment-146232211
14
6
  # you can customize your content for html or xml format
15
7
  def sitemap
16
- r = {layout: (params[:format] == "html" ? (self.send :_layout) : false), render: "sitemap", custom: {}, format: params[:format], skip_post_ids: [], skip_posttype_ids: [], skip_cat_ids: [], skip_tag_ids: []}
8
+ r = {layout: (params[:format] == "html" ? nil : false), render: "sitemap", custom: {}, format: params[:format], skip_post_ids: [], skip_posttype_ids: [], skip_cat_ids: [], skip_tag_ids: []}
17
9
  hooks_run("on_render_sitemap", r)
18
10
  @r = r
19
- render r[:render], layout: r[:layout]
11
+ render r[:render], (!r[:layout].nil? ? {layout: r[:layout]} : {})
20
12
  end
21
13
 
22
14
  # accessing for robots.txt
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::ApplicationDecorator < Draper::Decorator
10
2
  delegate_all
11
3
  @_deco_locale = nil
@@ -59,4 +51,4 @@ class CamaleonCms::ApplicationDecorator < Draper::Decorator
59
51
  _l = (_l || @_deco_locale || (h.cama_get_i18n_frontend rescue false) || I18n.locale).to_s
60
52
  "_#{_l}"
61
53
  end
62
- end
54
+ end
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::CategoryDecorator < CamaleonCms::TermTaxonomyDecorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::CustomFieldDecorator < Draper::Decorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  module CamaleonCms::CustomFieldsConcern
10
2
  # ======================CUSTOM FIELDS=====================================
11
3
  # render as html the custom fields marked for frontend
@@ -76,4 +68,4 @@ module CamaleonCms::CustomFieldsConcern
76
68
  end
77
69
  r
78
70
  end
79
- end
71
+ end
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  module CamaleonCms::MetasDecoratorMethods
10
2
  # return meta value translated for key in this model
11
3
  def the_meta(key)
@@ -16,4 +8,4 @@ module CamaleonCms::MetasDecoratorMethods
16
8
  def the_option(key)
17
9
  object.get_option(key, "").translate(@_deco_locale)
18
10
  end
19
- end
11
+ end
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::NavMenuItemDecorator < Draper::Decorator
10
2
  include CamaleonCms::CustomFieldsConcern
11
3
  delegate_all
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::PluginDecorator < CamaleonCms::TermTaxonomyDecorator
10
2
  delegate_all
11
3
  end
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::PostCommentDecorator < Draper::Decorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::PostDecorator < CamaleonCms::ApplicationDecorator
10
2
  include CamaleonCms::CustomFieldsConcern
11
3
  delegate_all
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::PostTagDecorator < CamaleonCms::TermTaxonomyDecorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::PostTypeDecorator < CamaleonCms::TermTaxonomyDecorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::SiteDecorator < CamaleonCms::TermTaxonomyDecorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::TermTaxonomyDecorator < CamaleonCms::ApplicationDecorator
10
2
  include CamaleonCms::CustomFieldsConcern
11
3
  delegate_all
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::ThemeDecorator < CamaleonCms::TermTaxonomyDecorator
10
2
  delegate_all
11
3
 
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::UserDecorator < CamaleonCms::ApplicationDecorator
10
2
  include CamaleonCms::CustomFieldsConcern
11
3
  delegate_all
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  class CamaleonCms::WidgetDecorator < Draper::Decorator
10
2
  include CamaleonCms::CustomFieldsConcern
11
3
  delegate_all
@@ -1,11 +1,3 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
1
  module CamaleonCms::Admin::ApplicationHelper
10
2
  # include CamaleonCms::Admin::ApiHelper
11
3
  include CamaleonCms::Admin::MenusHelper
@@ -54,4 +46,4 @@ module CamaleonCms::Admin::ApplicationHelper
54
46
  def cama_shortcode_print(code)
55
47
  "<input onmousedown=\"this.clicked = 1;\" readonly onfocus=\"if (!this.clicked) this.select(); else this.clicked = 2;\" onclick=\"if (this.clicked == 2) this.select(); this.clicked = 0;\" class='code_style' tabindex='-1' value=\"#{code}\">"
56
48
  end
57
- end
49
+ end