trabajo-afectivo/app/controllers/translations_controller.rb

44 lines
1 KiB
Ruby
Raw Normal View History

2014-02-03 19:24:49 +00:00
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
2012-05-18 14:24:00 +00:00
class TranslationsController < ApplicationController
before_filter :authentication_check, :except => [:load]
# GET /translations/lang/:locale
2012-05-18 14:24:00 +00:00
def load
2013-08-06 08:18:50 +00:00
render :json => Translation.list( params[:locale] )
2012-05-18 14:24:00 +00:00
end
# GET /translations/admin/lang/:locale
def admin
return if deny_if_not_role(Z_ROLENAME_ADMIN)
render :json => Translation.list( params[:locale], true )
end
2012-05-18 14:24:00 +00:00
# GET /translations
def index
model_index_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# GET /translations/1
def show
model_show_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# POST /translations
def create
return if deny_if_not_role(Z_ROLENAME_ADMIN)
model_create_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# PUT /translations/1
def update
return if deny_if_not_role(Z_ROLENAME_ADMIN)
model_update_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
# DELETE /translations/1
def destroy
return if deny_if_not_role(Z_ROLENAME_ADMIN)
model_destory_render(Translation, params)
2012-05-18 14:24:00 +00:00
end
end