Explorar o código

fix #1854 hide label setting

Shinsuke Sugaya %!s(int64=6) %!d(string=hai) anos
pai
achega
21f697c08c

+ 1 - 0
src/main/java/org/codelibs/fess/app/web/admin/fileconfig/AdminFileconfigAction.java

@@ -314,6 +314,7 @@ public class AdminFileconfigAction extends FessAdminAction {
     }
 
     protected void registerRolesAndLabels(final RenderData data) {
+        RenderDataUtil.register(data, "labelSettingEnabled", fessConfig.isFormAdminLabelInConfigEnabled());
         RenderDataUtil.register(data, "roleTypeItems", roleTypeService.getRoleTypeList());
         RenderDataUtil.register(data, "labelTypeItems", labelTypeService.getLabelTypeList());
     }

+ 1 - 0
src/main/java/org/codelibs/fess/app/web/admin/webconfig/AdminWebconfigAction.java

@@ -321,6 +321,7 @@ public class AdminWebconfigAction extends FessAdminAction {
     }
 
     protected void registerRolesAndLabels(final RenderData data) {
+        RenderDataUtil.register(data, "labelSettingEnabled", fessConfig.isFormAdminLabelInConfigEnabled());
         RenderDataUtil.register(data, "roleTypeItems", roleTypeService.getRoleTypeList());
         RenderDataUtil.register(data, "labelTypeItems", labelTypeService.getLabelTypeList());
     }

+ 26 - 0
src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java

@@ -776,6 +776,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. 4000 */
     String FORM_ADMIN_MAX_INPUT_SIZE = "form.admin.max.input.size";
 
+    /** The key of the configuration. e.g. false */
+    String FORM_ADMIN_LABEL_IN_CONFIG_ENABLED = "form.admin.label.in.config.enabled";
+
     /** The key of the configuration. e.g. admin */
     String AUTHENTICATION_ADMIN_USERS = "authentication.admin.users";
 
@@ -3721,6 +3724,20 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
     Integer getFormAdminMaxInputSizeAsInteger();
 
+    /**
+     * Get the value for the key 'form.admin.label.in.config.enabled'. <br>
+     * The value is, e.g. false <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     */
+    String getFormAdminLabelInConfigEnabled();
+
+    /**
+     * Is the property for the key 'form.admin.label.in.config.enabled' true? <br>
+     * The value is, e.g. false <br>
+     * @return The determination, true or false. (if not found, exception but basically no way)
+     */
+    boolean isFormAdminLabelInConfigEnabled();
+
     /**
      * Get the value for the key 'authentication.admin.users'. <br>
      * The value is, e.g. admin <br>
@@ -7061,6 +7078,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return getAsInteger(FessConfig.FORM_ADMIN_MAX_INPUT_SIZE);
         }
 
+        public String getFormAdminLabelInConfigEnabled() {
+            return get(FessConfig.FORM_ADMIN_LABEL_IN_CONFIG_ENABLED);
+        }
+
+        public boolean isFormAdminLabelInConfigEnabled() {
+            return is(FessConfig.FORM_ADMIN_LABEL_IN_CONFIG_ENABLED);
+        }
+
         public String getAuthenticationAdminUsers() {
             return get(FessConfig.AUTHENTICATION_ADMIN_USERS);
         }
@@ -8460,6 +8485,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
                     .put(FessConfig.LOGGING_SEARCH_DOCS_FIELDS,
                             "filetype,created,click_count,title,doc_id,url,score,site,filename,host,digest,boost,mimetype,favorite_count,_id,lang,last_modified,content_length,timestamp");
             defaultMap.put(FessConfig.FORM_ADMIN_MAX_INPUT_SIZE, "4000");
+            defaultMap.put(FessConfig.FORM_ADMIN_LABEL_IN_CONFIG_ENABLED, "false");
             defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_USERS, "admin");
             defaultMap.put(FessConfig.AUTHENTICATION_ADMIN_ROLES, "admin");
             defaultMap.put(FessConfig.ROLE_SEARCH_DEFAULT_PERMISSIONS, "");

+ 1 - 0
src/main/resources/fess_config.properties

@@ -411,6 +411,7 @@ logging.search.docs.fields=filetype,created,click_count,title,doc_id,url,score,s
 #                                                                                     Web
 #                                                                                    =====
 form.admin.max.input.size=4000
+form.admin.label.in.config.enabled=false
 
 # ----------------------------------------------------------
 #                                                 Permission

+ 2 - 2
src/main/webapp/WEB-INF/view/admin/fileconfig/admin_fileconfig_details.jsp

@@ -122,9 +122,9 @@
 												<td>${f:br(f:h(virtualHosts))}<la:hidden
 														property="virtualHosts" /></td>
 											</tr>
-											<tr>
+											<tr<c:if test="${!labelSettingEnabled}"> style="display:none"</c:if>>
 												<th><la:message key="labels.label_type" /></th>
-												<td><c:forEach var="l" varStatus="s"
+												<td>${labelSettingEnabled}<c:forEach var="l" varStatus="s"
 														items="${labelTypeItems}">
 														<c:forEach var="ltid" varStatus="s"
 															items="${labelTypeIds}">

+ 1 - 1
src/main/webapp/WEB-INF/view/admin/fileconfig/admin_fileconfig_edit.jsp

@@ -174,7 +174,7 @@
 												rows="5" />
 										</div>
 									</div>
-									<div class="form-group">
+									<div class="form-group"<c:if test="${!labelSettingEnabled}"> style="display:none"</c:if>>
 										<label for="labelTypeIds" class="col-sm-3 control-label"><la:message
 												key="labels.label_type" /></label>
 										<div class="col-sm-9">

+ 1 - 1
src/main/webapp/WEB-INF/view/admin/webconfig/admin_webconfig_details.jsp

@@ -126,7 +126,7 @@
 												<td>${f:br(f:h(virtualHosts))}<la:hidden
 														property="virtualHosts" /></td>
 											</tr>
-											<tr>
+											<tr<c:if test="${!labelSettingEnabled}"> style="display:none"</c:if>>
 												<th><la:message key="labels.label_type" /></th>
 												<td><c:forEach var="l" varStatus="s"
 														items="${labelTypeItems}">

+ 1 - 1
src/main/webapp/WEB-INF/view/admin/webconfig/admin_webconfig_edit.jsp

@@ -182,7 +182,7 @@
 												rows="5" />
 										</div>
 									</div>
-									<div class="form-group">
+									<div class="form-group"<c:if test="${!labelSettingEnabled}"> style="display:none"</c:if>>
 										<label for="labelTypeIds" class="col-sm-3 control-label"><la:message
 												key="labels.label_type" /></label>
 										<div class="col-sm-9">