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
  module CamaleonCms::Admin::BreadcrumbHelper
10
2
  # draw the title for the admin admin panel according the breadcrumb
11
3
  def cama_admin_title_draw
@@ -20,4 +12,4 @@ module CamaleonCms::Admin::BreadcrumbHelper
20
12
  # DEPRECATED
21
13
  def admin_breadcrumb_add(label, url = "")
22
14
  end
23
- end
15
+ 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
  #encoding: utf-8
10
2
  module CamaleonCms::Admin::CategoryHelper
11
3
 
@@ -22,4 +14,4 @@ module CamaleonCms::Admin::CategoryHelper
22
14
  options
23
15
  end
24
16
 
25
- end
17
+ 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
  #encoding: utf-8
10
2
  module CamaleonCms::Admin::CustomFieldsHelper
11
3
  def cama_custom_field_elements
@@ -338,4 +330,4 @@ module CamaleonCms::Admin::CustomFieldsHelper
338
330
  def cf_add_model(model_class)
339
331
  @_extra_models_for_fields << model_class
340
332
  end
341
- end
333
+ 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::Admin::MenusHelper
10
2
  include CamaleonCms::Admin::BreadcrumbHelper
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
  #encoding: utf-8
10
2
  module CamaleonCms::Admin::PostTypeHelper
11
3
 
@@ -72,4 +64,4 @@ module CamaleonCms::Admin::PostTypeHelper
72
64
  html += "</ul><div id='validation_error_list_#{name}'></div>"
73
65
  return html
74
66
  end
75
- end
67
+ 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::CamaleonHelper
10
2
  # create the html link with the url passed
11
3
  # verify if current user is logged in, if not, then return nil
@@ -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::CaptchaHelper
10
2
 
11
3
  # build a captcha image
@@ -45,4 +45,4 @@ module CamaleonCms::CommentHelper
45
45
  end
46
46
  res
47
47
  end
48
- end
48
+ 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::ContentHelper
10
2
  # initialize content variables
11
3
  def cama_content_init
@@ -34,4 +26,4 @@ module CamaleonCms::ContentHelper
34
26
  def cama_content_after_draw
35
27
  @_after_content.join("") rescue ""
36
28
  end
37
- end
29
+ 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::Frontend::ApplicationHelper
10
2
  include CamaleonCms::Frontend::SiteHelper
11
3
  include CamaleonCms::Frontend::NavMenuHelper
@@ -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::Frontend::NavMenuHelper
10
2
  # draw nav menu as html list
11
3
  # key: slug for nav menu
@@ -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::Frontend::SeoHelper
10
2
  # add seo attributes to your page
11
3
  # you can pass custom data to overwrite default data generated by the system
@@ -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::Frontend::SiteHelper
10
2
  # return full current visited url
11
3
  def site_current_url
@@ -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::HooksHelper
10
2
  # execute hooks for plugin_key with action name hook_key
11
3
  # non public method
@@ -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
  #encoding: utf-8
10
2
  module CamaleonCms::HtmlHelper
11
3
  def cama_html_helpers_init
@@ -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::PluginsHelper
10
2
  # load all plugins + theme installed for current site
11
3
  # METHOD IGNORED (is a partial solution to avoid load helpers and cache it for all sites)
@@ -36,14 +28,18 @@ module CamaleonCms::PluginsHelper
36
28
  # plugin_key: key of the plugin
37
29
  # return model of the plugin
38
30
  def plugin_install(plugin_key)
39
- plugin_model = current_site.plugins.where(slug: plugin_key).first_or_create!
40
- plugin_model.installed_version= plugin_model.settings["version"]
41
- return plugin_model if plugin_model.active?
42
- plugin_model.active
43
- PluginRoutes.reload
44
- # plugins_initialize(self)
45
- hook_run(plugin_model.settings, "on_active", plugin_model)
46
- plugin_model
31
+ if PluginRoutes.plugin_info(plugin_key).nil?
32
+ Rails.logger.info "=========== Plugin not found: #{plugin_key}"
33
+ else
34
+ plugin_model = current_site.plugins.where(slug: plugin_key).first_or_create!
35
+ plugin_model.installed_version= plugin_model.settings["version"]
36
+ return plugin_model if plugin_model.active?
37
+ plugin_model.active
38
+ PluginRoutes.reload
39
+ # plugins_initialize(self)
40
+ hook_run(plugin_model.settings, "on_active", plugin_model)
41
+ plugin_model
42
+ end
47
43
  end
48
44
 
49
45
  # uninstall a plugin from current site
@@ -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::SessionHelper
10
2
  # log in the user in to system
11
3
  # user: User model
@@ -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::ShortCodeHelper
10
2
  # Internal method
11
3
  def shortcodes_init
@@ -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::SiteHelper
10
2
  # return current site or assign a site as a current site
11
3
  def current_site(site = nil)
@@ -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::ThemeHelper
10
2
  def theme_init()
11
3
  @_front_breadcrumb = []
@@ -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::UploaderHelper
10
2
  include ActionView::Helpers::NumberHelper
11
3
  # upload a file into server
@@ -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
  #encoding: utf-8
10
2
  module CamaleonCms::UserRolesHelper
11
3
  def cama_get_roles_values
@@ -16,4 +8,4 @@ module CamaleonCms::UserRolesHelper
16
8
  args = {roles_list: roles_list}; hooks_run("available_user_roles_list", args)
17
9
  args[:roles_list]
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::HtmlMailer < ActionMailer::Base
10
2
  include CamaleonCms::SiteHelper
11
3
  include CamaleonCms::HooksHelper
@@ -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::Ability
10
2
  include CanCan::Ability
11
3
 
@@ -40,6 +32,12 @@ class CamaleonCms::Ability
40
32
  can :publish_post, CamaleonCms::PostType do |pt|
41
33
  ids_publish.to_i.include?(pt.id) rescue false
42
34
  end
35
+ can :edit_other, CamaleonCms::PostType do |pt|
36
+ ids_edit_other.to_i.include?(pt.id) rescue false
37
+ end
38
+ can :edit_publish, CamaleonCms::PostType do |pt|
39
+ ids_edit_publish.to_i.include?(pt.id) rescue false
40
+ end
43
41
 
44
42
  can :categories, CamaleonCms::PostType do |pt|
45
43
  @roles_post_type[:manage_categories].to_i.include?(pt.id) rescue false
@@ -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::Category < CamaleonCms::TermTaxonomy
10
2
  alias_attribute :site_id, :term_group
11
3
  alias_attribute :post_type_id, :status
@@ -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::CustomField < ActiveRecord::Base
10
2
  self.primary_key = :id
11
3
  include CamaleonCms::Metas
@@ -13,7 +5,7 @@ class CamaleonCms::CustomField < ActiveRecord::Base
13
5
  self.table_name = "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields"
14
6
  default_scope {order("#{CamaleonCms::CustomField.table_name}.field_order ASC")}
15
7
  # status: nil -> visible on list group fields
16
- attr_accessible :object_class, :objectid, :description, :parent_id, :count, :name, :slug, :field_order, :status, :is_repeat
8
+ # attr_accessible :object_class, :objectid, :description, :parent_id, :count, :name, :slug, :field_order, :status, :is_repeat
17
9
  validates :name, :object_class, presence: true
18
10
  has_many :values, :class_name => "CamaleonCms::CustomFieldsRelationship", :foreign_key => :custom_field_id, dependent: :destroy
19
11
  belongs_to :custom_field_group, class_name: "CamaleonCms::CustomFieldGroup"
@@ -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::CustomFieldGroup < CamaleonCms::CustomField
10
2
  self.primary_key = :id
11
3
  # attrs required: name, slug, description
@@ -1,14 +1,6 @@
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::CustomFieldsRelationship < ActiveRecord::Base
10
2
  self.table_name = "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships"
11
- attr_accessible :objectid, :custom_field_id, :term_order, :value, :object_class, :custom_field_slug, :group_number
3
+ # attr_accessible :objectid, :custom_field_id, :term_order, :value, :object_class, :custom_field_slug, :group_number
12
4
  default_scope {order("#{CamaleonCms::CustomFieldsRelationship.table_name}.term_order ASC")}
13
5
  # relations
14
6
  belongs_to :custom_fields, :class_name => "CamaleonCms::CustomField", foreign_key: :custom_field_id