pvollenweider 2005/04/28 13:58:16 CEST
Modified files: (Branch: JAHIA-4-1-BRANCH)
src/view/jsp/include blog_entries.inc blog_list.inc
Log:
If containerlist is empty, display the "add entry" and "add blog" buttons if
user has write access on the page.
Revision Changes Path
1.1.2.24 +7 -1
corporate_portal_templates/src/view/jsp/include/blog_entries.inc
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_entries.inc.diff?r1=1.1.2.23&r2=1.1.2.24&f=h
1.1.2.2 +6 -1
corporate_portal_templates/src/view/jsp/include/blog_list.inc
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/blog_list.inc.diff?r1=1.1.2.1&r2=1.1.2.2&f=h
Index: blog_entries.inc
===================================================================
RCS file:
/home/cvs/repository/corporate_portal_templates/src/view/jsp/include/Attic/blog_entries.inc,v
retrieving revision 1.1.2.23
retrieving revision 1.1.2.24
diff -u -r1.1.2.23 -r1.1.2.24
--- blog_entries.inc 27 Apr 2005 13:13:31 -0000 1.1.2.23
+++ blog_entries.inc 28 Apr 2005 11:58:15 -0000 1.1.2.24
@@ -6,7 +6,13 @@
jData.gui().html().drawBeginActionMenu(entriesBean ,
null, null, true, "", "jahiatemplates.Corporate_portal_templates",
null, out);
- if
(entriesBean.getJahiaContainerList().checkWriteAccess(jParams.getUser())) {
+ // check if user has write access. If the containerList is empty,
+ // then check the write access of the page
+ boolean hasWriteAccess = entries.getID() == 0 ?
+ jData.page().checkWriteAccess(jParams.getUser()) :
+ entries.checkWriteAccess(jParams.getUser());
+
+ if (hasWriteAccess) {
org.jahia.engines.JahiaEngine theAddContainerEngine =
(org.jahia.engines.JahiaEngine)
org.jahia.registries.EnginesRegistry.getInstance().getEngine( "addcontainer" );
StringBuffer addContName = new StringBuffer("addContainer_");
Index: blog_list.inc
===================================================================
RCS file:
/home/cvs/repository/corporate_portal_templates/src/view/jsp/include/Attic/blog_list.inc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- blog_list.inc 28 Apr 2005 08:29:32 -0000 1.1.2.1
+++ blog_list.inc 28 Apr 2005 11:58:15 -0000 1.1.2.2
@@ -53,7 +53,12 @@
}
ContainerListBean blogsBean = (ContainerListBean)
pageContext.findAttribute("blogs");
- if
(blogsBean.getJahiaContainerList().checkWriteAccess(jParams.getUser())) {
+
+ boolean hasWriteAccess =
blogsBean.getJahiaContainerList().getID() == 0 ?
+ jData.page().checkWriteAccess(jParams.getUser()) :
+ entries.checkWriteAccess(jParams.getUser());
+
+ if (hasWriteAccess) {
org.jahia.engines.JahiaEngine theAddContainerEngine =
(org.jahia.engines.JahiaEngine)
org.jahia.registries.EnginesRegistry.getInstance().getEngine( "addcontainer" );
StringBuffer addContName = new StringBuffer("addContainer_");