Skip to content
Snippets Groups Projects
Commit a91c4c23 authored by srosse's avatar srosse
Browse files

OO-570: don't allow invitee to close their unique tab

parent 5cf8449f
No related branches found
No related tags found
No related merge requests found
......@@ -135,11 +135,17 @@ public class BaseFullWebappController extends BasicController implements Generic
private Panel initialPanel;
private DTabs myDTabsImpl;
private static Integer MAX_TAB;
private boolean invitee = false;
public BaseFullWebappController(UserRequest ureq, WindowControl ouisc_wControl,
BaseFullWebappControllerParts baseFullWebappControllerParts) {
// only-use-in-super-call, since we define our own
super(ureq, null);
if(ureq.getUserSession() != null && ureq.getUserSession().getRoles() != null) {
invitee = ureq.getUserSession().getRoles().isInvitee();
}
this.baseFullWebappControllerParts = baseFullWebappControllerParts;
......@@ -1029,7 +1035,7 @@ public class BaseFullWebappController extends BasicController implements Generic
/**
*
* [used by velocity
* [used by velocity]
*
* @return
*/
......@@ -1037,6 +1043,17 @@ public class BaseFullWebappController extends BasicController implements Generic
return curDTab != null && dtab == curDTab;
}
/**
* Invitee have only one dynamic tab. They are not allowed
* to close it.
* [used by velocity]
*
* @return
*/
public boolean isCanCloseDTab(DTab dtab) {
return !invitee && !(sites == null || sites.isEmpty());
}
private void setCurrent(SiteInstance site, DTab tab) {
curSite = site;
curDTab = tab;
......
......@@ -28,7 +28,9 @@
<li class="b_nav_tab b_nav_active $!navel.getIconCSSClass()">
<div> ## div used for tab icon
$r.render("a$postfix")
$r.render("cp$postfix") ## close link has class b_nav_tab_close
#if($tabhelper.isCanCloseDTab($dtab))
$r.render("cp$postfix") ## close link has class b_nav_tab_close
#end
</div>
</li>
#else
......
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