Skip to content
Snippets Groups Projects
Commit 025495b1 authored by strentini's avatar strentini
Browse files

non-jira : a few fixes, layout/theme related

parent 8c6b1ed3
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</property> </property>
</bean> </bean>
<!-- Portfolio admin. panel --> <!-- vitero admin. panel -->
<bean class="org.olat.core.extensions.action.GenericActionExtension" init-method="initExtensionPoints"> <bean class="org.olat.core.extensions.action.GenericActionExtension" init-method="initExtensionPoints">
<property name="actionController"> <property name="actionController">
<bean class="org.olat.core.gui.control.creator.FactoryControllerCreator" scope="prototype"> <bean class="org.olat.core.gui.control.creator.FactoryControllerCreator" scope="prototype">
...@@ -64,6 +64,6 @@ ...@@ -64,6 +64,6 @@
<value>org.olat.admin.SystemAdminMainController</value> <value>org.olat.admin.SystemAdminMainController</value>
</list> </list>
</property> </property>
<property name="order" value="39" />
</bean> </bean>
</beans> </beans>
\ No newline at end of file
...@@ -87,15 +87,7 @@ public class LayoutAdminController extends FormBasicController { ...@@ -87,15 +87,7 @@ public class LayoutAdminController extends FormBasicController {
if(!themesDir.exists()){ if(!themesDir.exists()){
logWarn("Themes dir not found: "+staticAbsPath, null); logWarn("Themes dir not found: "+staticAbsPath, null);
} }
File[] themes = themesDir.listFiles(new FilenameFilter() { File[] themes = themesDir.listFiles(new ThemesFileNameFilter());
public boolean accept(File dir, String name) {
// remove files - only accept dirs
if ( ! new File(dir, name).isDirectory()) return false;
// remove unwanted meta-dirs
if (name.equalsIgnoreCase("CVS")) return false;
else if (name.equalsIgnoreCase(".DS_Store")) return false;
else return true;
}});
String[] themesStr = new String[themes.length]; String[] themesStr = new String[themes.length];
for (int i = 0; i < themes.length; i++) { for (int i = 0; i < themes.length; i++) {
...@@ -132,5 +124,24 @@ public class LayoutAdminController extends FormBasicController { ...@@ -132,5 +124,24 @@ public class LayoutAdminController extends FormBasicController {
protected void formOK(UserRequest ureq) { protected void formOK(UserRequest ureq) {
// saving already done in formInnerEvent method - no submit button // saving already done in formInnerEvent method - no submit button
} }
/**
* just a simple fileNameFilter that skips OS X .DS_Store , CVS and .sass-cache directories
*
* @author strentini
*/
protected class ThemesFileNameFilter implements FilenameFilter {
@Override
public boolean accept(File dir, String name) {
// remove files - only accept dirs
if ( ! new File(dir, name).isDirectory()) return false;
// remove unwanted meta-dirs
if (name.equalsIgnoreCase("CVS")) return false;
else if (name.equalsIgnoreCase(".DS_Store")) return false;
else if (name.equalsIgnoreCase(".sass-cache")) return false;
else return true;
}
}
} }
...@@ -936,6 +936,7 @@ public class FormUIFactory { ...@@ -936,6 +936,7 @@ public class FormUIFactory {
*/ */
public FormLink addFormLink(String name, String i18nLink, String i18nLabel, FormItemContainer formLayout, int presentation){ public FormLink addFormLink(String name, String i18nLink, String i18nLabel, FormItemContainer formLayout, int presentation){
FormLinkImpl fte = new FormLinkImpl(name,name,i18nLink,presentation); FormLinkImpl fte = new FormLinkImpl(name,name,i18nLink,presentation);
fte.setI18nKey(i18nLink);
setLabelIfNotNull(i18nLabel, fte); setLabelIfNotNull(i18nLabel, fte);
formLayout.add(fte); formLayout.add(fte);
return fte; return fte;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment