Settings to turn webdav on/off (or eqivilent)

This commit is contained in:
Daniel Munn 2012-06-15 12:50:41 +01:00
parent 39947104fe
commit e223b22a6c
6 changed files with 29 additions and 4 deletions

View File

@ -81,6 +81,20 @@
<% end
end %>
<p>
<%=content_tag(:label, l(:label_webdav) + ":") %>
<%=select_tag("settings[dmsf_webdav]",
options_for_select([
[l(:select_option_deactivated), nil],
[l(:select_option_activated), "1"]],
:selected => @settings["dmsf_webdav"])) %><br/>
(<%=l(:label_default)%>: <%=l(:select_option_activated)%>)
<br/>
<%= l(:note_webdav).html_safe %>
</p>
<hr />
<% begin
require 'xapian'

View File

@ -181,4 +181,7 @@ en-GB:
:error_max_email_filesize_exceeded: "You've exceeded the maximum filesize for sending via email. (%{number} MB)"
:note_maximum_email_filesize: "Limits maximum filesize that can be sent via email. 0 means unlimited. Number is in MB."
:label_maximum_email_filesize: "Maximum email attachment size"
:parent_directory: "Parent Directory"
:note_webdav: "Webdav once enabled can be found at http://.../dmsf/webdav/"
:label_webdav: "Webdav functionality"

View File

@ -181,4 +181,6 @@ en-IS:
:error_max_email_filesize_exceeded: "You've exceeded the maximum filesize for sending via email. (%{number} MB)"
:note_maximum_email_filesize: "Limits maximum filesize that can be sent via email. 0 means unlimited. Number is in MB."
:label_maximum_email_filesize: "Maximum email attachment size"
:parent_directory: "Parent Directory"
:note_webdav: "Webdav once enabled can be found at http://.../dmsf/webdav/"
:label_webdav: "Webdav functionality"

View File

@ -189,4 +189,5 @@ en:
:header_minimum_filesize: "File Error."
:error_minimum_filesize: "The file %{file} is 0 bytes and will not be attached."
:parent_directory: "Parent Directory"
:note_webdav: "Webdav once enabled can be found at http://.../dmsf/webdav/"
:label_webdav: "Webdav functionality"

View File

@ -39,7 +39,8 @@ Redmine::Plugin.register :redmine_dmsf do
"dmsf_zip_encoding" => "utf-8",
"dmsf_index_database" => Rails.root.join("files/dmsf_index").to_s,
"dmsf_stemming_lang" => "english",
"dmsf_stemming_strategy" => "STEM_NONE"
"dmsf_stemming_strategy" => "STEM_NONE",
"dmsf_webdav" => 1
}
menu :project_menu, :dmsf, { :controller => "dmsf", :action => "show" }, :caption => :menu_dmsf, :before => :documents, :param => :id

View File

@ -22,6 +22,10 @@ module RedmineDmsf
include Redmine::I18n
include ActionView::Helpers::NumberHelper
def initialize(*args)
raise NotFound if Setting.plugin_redmine_dmsf["dmsf_webdav"].empty?
super(*args)
end
DIR_FILE = "<tr><td class=\"name\"><a href=\"%s\">%s</a></td><td class=\"size\">%s</td><td class=\"type\">%s</td><td class=\"mtime\">%s</td></tr>"