Class: CamaleonCms::Admin::SettingsController
- Inherits:
-
CamaleonCms::AdminController
- Object
- CamaleonCms::AdminController
- CamaleonCms::Admin::SettingsController
- Defined in:
- app/controllers/camaleon_cms/admin/settings_controller.rb
Overview
Camaleon CMS is a content management system
Copyright (C) 2015 by Owen Peredo Diaz
Email: [email protected]
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.
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.
See the GNU Affero General Public License (GPLv3) for more details.
Direct Known Subclasses
CamaleonCms::Admin::Settings::CustomFieldsController, CamaleonCms::Admin::Settings::PostTypesController, CamaleonCms::Admin::Settings::SitesController
Instance Method Summary collapse
- #index ⇒ Object
-
#languages ⇒ Object
list available languages.
-
#save_languages ⇒ Object
save language customizations.
-
#shortcodes ⇒ Object
render the list of shortcodes.
- #site ⇒ Object
- #site_saved ⇒ Object
Instance Method Details
#index ⇒ Object
13 14 15 |
# File 'app/controllers/camaleon_cms/admin/settings_controller.rb', line 13 def index redirect_to cama_admin_dashboard_path end |
#languages ⇒ Object
list available languages
39 40 41 |
# File 'app/controllers/camaleon_cms/admin/settings_controller.rb', line 39 def languages I18n.t("camaleon_cms.admin.sidebar.languages") end |
#save_languages ⇒ Object
save language customizations
49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/camaleon_cms/admin/settings_controller.rb', line 49 def save_languages current_site.("languages_site", params[:lang]) current_site.set_admin_language(params[:admin_language]) I18n.locale = current_site.get_admin_language PluginRoutes.reload flash[:notice] = t('camaleon_cms.admin.settings.message.language_updated', locale: current_site.get_admin_language) redirect_to action: :languages end |
#shortcodes ⇒ Object
render the list of shortcodes
44 45 46 |
# File 'app/controllers/camaleon_cms/admin/settings_controller.rb', line 44 def shortcodes I18n.t("camaleon_cms.admin.sidebar.shortcodes") end |
#site ⇒ Object
17 18 19 20 |
# File 'app/controllers/camaleon_cms/admin/settings_controller.rb', line 17 def site I18n.t("camaleon_cms.admin.sidebar.general_site") @site = current_site end |
#site_saved ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/camaleon_cms/admin/settings_controller.rb', line 22 def site_saved @site = current_site if @site.update(params[:site]) @site.(params[:meta]) if params[:meta].present? @site.(params[:options]) @site.set_field_values(params[:field_options]) theme = @site.get_theme.decorate theme.set_field_values(params[:theme_fields]) if params[:theme_fields].present? flash[:notice] = t('camaleon_cms.admin.settings.message.site_updated') hook_run(theme.settings, "on_theme_settings", theme) redirect_to action: :site else render 'site' end end |