Class: Tr8n::Admin::DomainController
- Inherits:
-
BaseController
- Object
- BaseController
- Tr8n::Admin::DomainController
- Defined in:
- app/controllers/tr8n/admin/domain_controller.rb
Overview
– Copyright © 2010-2011 Michael Berkovich, tr8n.net
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++
Instance Method Summary collapse
- #delete ⇒ Object
- #delete_key_source ⇒ Object
- #delete_source ⇒ Object
- #index ⇒ Object
- #key_sources ⇒ Object
- #lb_caller ⇒ Object
- #sources ⇒ Object
Instance Method Details
#delete ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 30 def delete params[:domains] = [params[:domain_id]] if params[:domain_id] if params[:domains] params[:domains].each do |domain_id| domain = Tr8n::TranslationDomain.find_by_id(domain_id) domain.destroy if domain end end redirect_to_source end |
#delete_key_source ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 60 def delete_key_source params[:key_sources] = [params[:key_source_id]] if params[:key_source_id] if params[:key_sources] params[:key_sources].each do |key_source_id| key_source = Tr8n::TranslationKeySource.find_by_id(key_source_id) key_source.destroy if key_source end end redirect_to_source end |
#delete_source ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 45 def delete_source params[:sources] = [params[:source_id]] if params[:source_id] if params[:sources] params[:sources].each do |source_id| source = Tr8n::TranslationSource.find_by_id(source_id) source.destroy if source end end redirect_to_source end |
#index ⇒ Object
26 27 28 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 26 def index @domains = Tr8n::TranslationDomain.filter(:params => params, :filter => Tr8n::TranslationDomainFilter) end |
#key_sources ⇒ Object
56 57 58 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 56 def key_sources @key_sources = Tr8n::TranslationKeySource.filter(:params => params, :filter => Tr8n::TranslationKeySourceFilter) end |
#lb_caller ⇒ Object
71 72 73 74 75 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 71 def lb_caller @key_source = Tr8n::TranslationKeySource.find(params[:key_source_id]) @caller = @key_source.details[params[:caller_key]] render :layout => false end |
#sources ⇒ Object
41 42 43 |
# File 'app/controllers/tr8n/admin/domain_controller.rb', line 41 def sources @sources = Tr8n::TranslationSource.filter(:params => params, :filter => Tr8n::TranslationSourceFilter) end |