Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
b6471fca
Commit
b6471fca
authored
Sep 09, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_xhtml_style: do not use getToolByName to access tools
Also some code refactoring.
parent
ee64d50c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.py
...TemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.py
+13
-15
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.py
View file @
b6471fca
"Modified version for ERP5 to append the default action (/view) in the URL."
from
Products.CMFCore.utils
import
getToolByName
ptool
=
getToolByName
(
script
,
'portal_properties'
)
utool
=
getToolByName
(
script
,
'portal_url'
)
portal
=
context
.
getPortalObject
()
utool
=
portal
.
portal_url
portal_url
=
utool
()
result
=
[]
param
=
int
(
context
.
REQUEST
.
get
(
'ignore_layout'
,
0
))
and
'?ignore_layout:int=1'
or
''
param
=
'?ignore_layout:int=1'
if
int
(
portal
.
REQUEST
.
get
(
'ignore_layout'
,
0
))
else
''
if
include_root
:
result
.
append
(
{
'id'
:
'root'
,
'title'
:
ptool
.
title
()
,
'url'
:
'%s/view%s'
%
(
portal_url
,
param
)
}
)
relative
=
utool
.
getRelativeContentPath
(
context
)
portal
=
utool
.
getPortalObject
()
result
=
[{
'id'
:
'root'
,
'title'
:
portal
.
portal_properties
.
title
(),
'url'
:
'%s/view%s'
%
(
portal_url
,
param
),
}]
else
:
result
=
[]
obj
=
portal
now
=
[]
for
name
in
relative
:
for
name
in
utool
.
getRelativeContentPath
(
context
)
:
obj
=
obj
.
restrictedTraverse
(
name
)
now
.
append
(
name
)
title
=
(
getattr
(
obj
,
"getCompactTranslatedTitle"
,
lambda
:
None
)()
or
obj
.
getTitle
()
or
obj
.
getId
()
)
if
n
ot
name
=
=
'talkback'
:
if
n
ame
!
=
'talkback'
:
result
.
append
(
{
'id'
:
name
,
'title'
:
title
,
'url'
:
'%s/%s/view%s'
%
(
portal_url
,
'/'
.
join
(
now
),
param
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment