Class: Lcms::Engine::Admin::AdminController
Direct Known Subclasses
AccessCodesController, AssociationPickerController, BatchReimportsController, CurriculumsController, DocumentsController, MaterialsController, ResourceBulkEditsController, ResourcePickerController, ResourcesController, SettingsController, SketchCompilersController, StandardsController, UsersController, WelcomeController
Constant Summary
collapse
- RE_GOOGLE_FOLDER =
%r{/drive/(.*/)?folders/}.freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.document_path(*args) ⇒ Object
29
30
31
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 29
def document_path(*args)
host_engine_path(:document_path, *args).presence || url_helpers.document_path(*args)
end
|
.engine_klass ⇒ Object
25
26
27
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 25
def engine_klass
@engine_klass ||= settings[:engine]&.constantize || ::Lcms::Engine::Engine
end
|
.host_engine_path(key, *args) ⇒ Object
41
42
43
44
45
46
47
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 41
def host_engine_path(key, *args)
if (host_route = settings.dig(:redirect, :host, key)).present?
Rails.application.routes.url_helpers.send(host_route, *args)
elsif (engine_route = settings.dig(:redirect, :engine, key)).present?
engine_klass.routes.url_helpers.send(engine_route, *args)
end
end
|
.material_path(*args) ⇒ Object
33
34
35
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 33
def material_path(*args)
host_engine_path(:material_path, *args).presence || url_helpers.material_path(*args)
end
|
.root_path ⇒ Object
37
38
39
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 37
def root_path
host_engine_path(:root_path).presence || url_helpers.root_path
end
|
.settings ⇒ Object
21
22
23
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 21
def settings
@settings ||= DEFAULTS.merge((YAML.load_file(CONFIG_PATH) || {}).deep_symbolize_keys)
end
|
Instance Method Details
#whoami ⇒ Object
56
57
58
|
# File 'app/controllers/lcms/engine/admin/admin_controller.rb', line 56
def whoami
render text: "stack=#{ENV['CLOUD66_STACK_NAME']}<br/>env=#{ENV['CLOUD66_STACK_ENVIRONMENT']}"
end
|