Show tabs iff a user is authenticated
This commit is contained in:
@@ -12,6 +12,8 @@ deferred class
|
|||||||
inherit
|
inherit
|
||||||
CMS_API_ACCESS
|
CMS_API_ACCESS
|
||||||
|
|
||||||
|
CMS_REQUEST_UTIL
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (a_type: like content_type)
|
make (a_type: like content_type)
|
||||||
|
|||||||
@@ -265,6 +265,11 @@ feature -- Output
|
|||||||
node_api := a_response.node_api
|
node_api := a_response.node_api
|
||||||
|
|
||||||
a_response.add_variable (a_node, "node")
|
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 := a_response.node_local_link (a_node, a_response.translation ("View", Void))
|
||||||
lnk.set_weight (1)
|
lnk.set_weight (1)
|
||||||
a_response.add_to_primary_tabs (lnk)
|
a_response.add_to_primary_tabs (lnk)
|
||||||
@@ -290,7 +295,7 @@ feature -- Output
|
|||||||
a_response.add_to_primary_tabs (lnk)
|
a_response.add_to_primary_tabs (lnk)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
create s.make_empty
|
create s.make_empty
|
||||||
s.append ("<div class=%"info%"> ")
|
s.append ("<div class=%"info%"> ")
|
||||||
if attached a_node.author as l_author then
|
if attached a_node.author as l_author then
|
||||||
|
|||||||
Reference in New Issue
Block a user