Show tabs iff a user is authenticated

This commit is contained in:
jvelilla
2015-07-30 17:36:14 -03:00
parent 500f8f78a4
commit 863a1e7b98
2 changed files with 27 additions and 20 deletions

View File

@@ -12,6 +12,8 @@ deferred class
inherit
CMS_API_ACCESS
CMS_REQUEST_UTIL
feature {NONE} -- Initialization
make (a_type: like content_type)

View File

@@ -265,6 +265,11 @@ feature -- Output
node_api := a_response.node_api
a_response.add_variable (a_node, "node")
-- Show tabs only if a user is authenticated.
if
attached current_user (a_response.request) as l_user
then
lnk := a_response.node_local_link (a_node, a_response.translation ("View", Void))
lnk.set_weight (1)
a_response.add_to_primary_tabs (lnk)
@@ -290,7 +295,7 @@ feature -- Output
a_response.add_to_primary_tabs (lnk)
end
end
end
create s.make_empty
s.append ("<div class=%"info%"> ")
if attached a_node.author as l_author then