Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
b0c5616f
Commit
b0c5616f
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix in the way markdown README and ChangeLog are output on module page.
parent
1eee7297
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/admin/modulehelp.php
+29
-14
29 additions, 14 deletions
htdocs/admin/modulehelp.php
htdocs/core/modules/DolibarrModules.class.php
+50
-1
50 additions, 1 deletion
htdocs/core/modules/DolibarrModules.class.php
with
79 additions
and
15 deletions
htdocs/admin/modulehelp.php
+
29
−
14
View file @
b0c5616f
...
...
@@ -225,20 +225,6 @@ asort($orders);
//var_dump($modules);
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/modulehelp.php?id="
.
$id
.
'&mode=desc'
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Description"
);
$head
[
$h
][
2
]
=
'desc'
;
$h
++
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/modulehelp.php?id="
.
$id
.
'&mode=feature'
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"TechnicalServicesProvided"
);
$head
[
$h
][
2
]
=
'feature'
;
$h
++
;
$i
=
0
;
foreach
(
$orders
as
$tmpkey
=>
$tmpvalue
)
{
...
...
@@ -257,6 +243,28 @@ $special = $objMod->special;
$tab
=
explode
(
'_'
,
$value
);
$familyposition
=
$tab
[
0
];
$familykey
=
$tab
[
1
];
$module_position
=
$tab
[
2
];
$numero
=
$tab
[
3
];
$h
=
0
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/modulehelp.php?id="
.
$id
.
'&mode=desc'
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"Description"
);
$head
[
$h
][
2
]
=
'desc'
;
$h
++
;
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/modulehelp.php?id="
.
$id
.
'&mode=feature'
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"TechnicalServicesProvided"
);
$head
[
$h
][
2
]
=
'feature'
;
$h
++
;
if
(
$objMod
->
isCoreOrExternalModule
()
==
'external'
)
{
$head
[
$h
][
0
]
=
DOL_URL_ROOT
.
"/admin/modulehelp.php?id="
.
$id
.
'&mode=changelog'
;
$head
[
$h
][
1
]
=
$langs
->
trans
(
"ChangeLog"
);
$head
[
$h
][
2
]
=
'changelog'
;
$h
++
;
}
// Check filters
$modulename
=
$objMod
->
getName
();
$moduledesc
=
$objMod
->
getDesc
();
...
...
@@ -536,6 +544,13 @@ if ($mode == 'feature')
}
if
(
$mode
==
'changelog'
)
{
$changelog
=
$objMod
->
getChangeLog
();
if
(
$changelog
)
$text
.
=
'<div class="moduledesclong">'
.
$changelog
.
'<div>'
;
else
$text
.
=
'<div class="moduledesclong">'
.
$langs
->
trans
(
"NotAvailable"
)
.
'</div>'
;
}
print
$text
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/modules/DolibarrModules.class.php
+
50
−
1
View file @
b0c5616f
...
...
@@ -652,7 +652,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
if
((
float
)
DOL_VERSION
>=
6.0
)
{
@
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/parsemd.lib.php'
;
$content
=
dolMd2Html
(
$content
,
'parsedown'
,
array
(
'doc/'
=>
dol_buildpath
(
'cabinetmed
/doc/'
,
1
)));
$content
=
dolMd2Html
(
$content
,
'parsedown'
,
array
(
'doc/'
=>
dol_buildpath
(
strtolower
(
$this
->
name
)
.
'
/doc/'
,
1
)));
}
else
{
...
...
@@ -678,6 +678,55 @@ class DolibarrModules // Can not be abstract, because we need to insta
return
$content
;
}
/**
* Gives the changelog. First check ChangeLog-la_LA.md then ChangeLog.md
*
* @return string Content of ChangeLog
*/
function
getChangeLog
()
{
global
$langs
;
$langs
->
load
(
"admin"
);
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/files.lib.php'
;
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/geturl.lib.php'
;
$filefound
=
false
;
// Define path to file README.md.
// First check README-la_LA.md then README.md
$pathoffile
=
dol_buildpath
(
strtolower
(
$this
->
name
)
.
'/ChangeLog-'
.
$langs
->
defaultlang
.
'.md'
,
0
);
if
(
dol_is_file
(
$pathoffile
))
{
$filefound
=
true
;
}
if
(
!
$filefound
)
{
$pathoffile
=
dol_buildpath
(
strtolower
(
$this
->
name
)
.
'/ChangeLog.md'
,
0
);
if
(
dol_is_file
(
$pathoffile
))
{
$filefound
=
true
;
}
}
if
(
$filefound
)
// Mostly for external modules
{
$content
=
file_get_contents
(
$pathoffile
);
if
((
float
)
DOL_VERSION
>=
6.0
)
{
@
include_once
DOL_DOCUMENT_ROOT
.
'/core/lib/parsemd.lib.php'
;
$content
=
dolMd2Html
(
$content
,
'parsedown'
,
array
(
'doc/'
=>
dol_buildpath
(
strtolower
(
$this
->
name
)
.
'/doc/'
,
1
)));
}
else
{
$content
=
nl2br
(
$content
);
}
}
return
$content
;
}
/**
* Gives the publisher name
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment