diff --git a/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java b/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java index 06ca204f17fb7b270d56d7a0d12c0c53c1cf406c..e14333882851bc33698978a35d19a9f5a62e75c7 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java +++ b/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java @@ -108,6 +108,8 @@ import org.springframework.beans.factory.annotation.Autowired; * @author Florian Gnägi */ public class FileUploadController extends FormBasicController { + + private static final String[] resizeKeys = new String[]{"resize"}; private int status = FolderCommandStatus.STATUS_SUCCESS; private VFSContainer currentContainer; @@ -266,11 +268,11 @@ public class FileUploadController extends FormBasicController { } formLayout.add(resizeCont); - String[] keys = new String[]{"resize"}; String[] values = new String[]{translate("resize_image")}; - resizeEl = uifactory.addCheckboxesHorizontal("resize_image", resizeCont, keys, values); + resizeEl = uifactory.addCheckboxesHorizontal("resize_image", resizeCont, resizeKeys, values); resizeEl.setLabel(null, null); - resizeEl.select("resize", true); + resizeEl.select(resizeKeys[0], true); + resizeEl.setVisible(false); } // Check remaining quota @@ -311,19 +313,29 @@ public class FileUploadController extends FormBasicController { fileEl.reset(); fileEl.setDeleteEnabled(false); fileEl.clearError(); - } else if(metaDataCtr != null) { + resizeEl.setVisible(false); + } else { String filename = fileEl.getUploadFileName(); - if(filename == null) { - metaDataCtr.getFilenameEl().setExampleKey("mf.filename.warning", null); - } else if(!FileUtils.validateFilename(filename)) { - String suffix = FileUtils.getFileSuffix(filename); - if(suffix != null && suffix.length() > 0) { - filename = filename.substring(0, filename.length() - suffix.length() - 1); + if(metaDataCtr != null) { + if(filename == null) { + metaDataCtr.getFilenameEl().setExampleKey("mf.filename.warning", null); + } else if(!FileUtils.validateFilename(filename)) { + String suffix = FileUtils.getFileSuffix(filename); + if(suffix != null && suffix.length() > 0) { + filename = filename.substring(0, filename.length() - suffix.length() - 1); + } + filename = FileUtils.normalizeFilename(filename) + "." + suffix; + metaDataCtr.getFilenameEl().setExampleKey("mf.filename.warning", null); } - filename = FileUtils.normalizeFilename(filename) + "." + suffix; - metaDataCtr.getFilenameEl().setExampleKey("mf.filename.warning", null); + metaDataCtr.setFilename(filename); + } + + boolean isImg = false; + if(resizeImg && filename != null) { + isImg = imageExtPattern.matcher(filename.toLowerCase()).find(); } - metaDataCtr.setFilename(filename); + resizeEl.setVisible(isImg); + resizeEl.select(resizeKeys[0], true); } } super.formInnerEvent(ureq, source, event); diff --git a/src/main/java/org/olat/core/commons/modules/bc/_content/file_upload.html b/src/main/java/org/olat/core/commons/modules/bc/_content/file_upload.html index 625c7954f73e9588c5a00557926ce43893c9b781..63fb0bb29f18423d8c7ed94d172afd329ff45f1c 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/_content/file_upload.html +++ b/src/main/java/org/olat/core/commons/modules/bc/_content/file_upload.html @@ -25,34 +25,11 @@ </div> #end -#if($resizeImg) - <div id="resize_image_wrapper" style="display:none;"> - $r.render("resize_image_wrapper") - </div> -#end + $r.render("resize_image_wrapper") #if ($showMetadata) $r.render("metadata") #end $r.render("buttons") </fieldset> - - -#if($resizeImg) -<script type="text/javascript"> -/* <|(jpg)|(png)$'); - var name = jQuery(this).val(); - if(name != null && name.toLowerCase().match(re)) { - jQuery('#resize_image_wrapper').show(); - } else { - jQuery('#resize_image_wrapper').hide(); - } - }); -}); -/* ]]> */ -</script> -#end </div> \ No newline at end of file diff --git a/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java b/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java index e82cc870cdf8e386d073a5a511b6433659db9620..b7ba2c2d397603154b2ae7dd58fb79d1f63ca79e 100644 --- a/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java +++ b/src/main/java/org/olat/modules/webFeed/manager/FeedNotificationsHandler.java @@ -80,13 +80,12 @@ public abstract class FeedNotificationsHandler implements NotificationsHandler { try { RepositoryEntry re = repoManager.lookupRepositoryEntry( OresHelper.createOLATResourceableInstance(p.getResName(), p.getResId()), false); + if (re.getAccess() == RepositoryEntry.DELETED || re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) { + return notificationsManager.getNoSubscriptionInfo(); + } String displayName = re.getDisplayname(); if("CourseModule".equals(p.getResName())) { - if (re.getRepositoryEntryStatus().isClosed() || re.getRepositoryEntryStatus().isUnpublished()) { - return notificationsManager.getNoSubscriptionInfo(); - } else { - title = translator.translate(NOTIFICATIONS_HEADER_COURSE, new String[]{displayName}); - } + title = translator.translate(NOTIFICATIONS_HEADER_COURSE, new String[]{displayName}); } else { title = getHeader(translator, displayName); } diff --git a/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java b/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java index 2f305e2da43c9ed2f430b6130e77e037bbe7c02f..5083eba944717883e6e5cec7d1fa80df09e3d8e4 100644 --- a/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java +++ b/src/main/java/org/olat/modules/wiki/WikiPageChangeOrCreateNotificationHandler.java @@ -213,6 +213,7 @@ public class WikiPageChangeOrCreateNotificationHandler implements NotificationsH private boolean courseStatus(ICourse course) { return course != null + && course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getAccess() != RepositoryEntry.DELETED && !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isUnpublished() && !course.getCourseEnvironment().getCourseGroupManager().getCourseEntry().getRepositoryEntryStatus().isClosed(); } diff --git a/src/main/java/org/olat/repository/ui/author/AuthorListController.java b/src/main/java/org/olat/repository/ui/author/AuthorListController.java index dc1e936ba4eed01322cd25ee4c0f0254d52f97e7..7103a5b0c9ec0d80f088a964314be73899bea9e1 100644 --- a/src/main/java/org/olat/repository/ui/author/AuthorListController.java +++ b/src/main/java/org/olat/repository/ui/author/AuthorListController.java @@ -182,7 +182,7 @@ public class AuthorListController extends FormBasicController implements Activat isOlatAdmin = roles.isOLATAdmin() || roles.isInstitutionalResourceManager(); hasAuthorRight = roles.isAuthor() || roles.isInstitutionalResourceManager() || roles.isOLATAdmin(); - dataSource = new AuthoringEntryDataSource(searchParams, this); + dataSource = new AuthoringEntryDataSource(searchParams, this, !withSearch); initForm(ureq); stackPanel = new TooledStackedPanel(i18nName, getTranslator(), this); diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java index 3d6abacf05946e3e47aa4c8e815d8fb67b25f702..16edc01aaccfe514c8c08cb4e71f92f14f9dceb8 100644 --- a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java +++ b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataSource.java @@ -63,11 +63,13 @@ public class AuthoringEntryDataSource implements FlexiTableDataSourceDelegate<Au private final RepositoryService repositoryService; private final AuthoringEntryDataSourceUIFactory uifactory; private Integer count; + private final boolean useFilters; public AuthoringEntryDataSource(SearchAuthorRepositoryEntryViewParams searchParams, - AuthoringEntryDataSourceUIFactory uifactory) { + AuthoringEntryDataSourceUIFactory uifactory, boolean useFilters) { this.searchParams = searchParams; this.uifactory = uifactory; + this.useFilters = useFilters; acService = CoreSpringFactory.getImpl(ACService.class); acModule = CoreSpringFactory.getImpl(AccessControlModule.class); @@ -103,6 +105,8 @@ public class AuthoringEntryDataSource implements FlexiTableDataSourceDelegate<Au } else { searchParams.setResourceTypes(null); } + } else if(useFilters) { + searchParams.setResourceTypes(null); } if(orderBy != null && orderBy.length > 0 && orderBy[0] != null) {