Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
dce06ab1
Commit
dce06ab1
authored
Jul 28, 2010
by
Richard Mansfield
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow html export to include static images from plugins
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
4483ed5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
htdocs/export/html/lib.php
htdocs/export/html/lib.php
+7
-3
No files found.
htdocs/export/html/lib.php
View file @
dce06ab1
...
@@ -203,7 +203,11 @@ class PluginExportHtml extends PluginExport {
...
@@ -203,7 +203,11 @@ class PluginExportHtml extends PluginExport {
$copyproxy
=
HtmlExportCopyProxy
::
singleton
();
$copyproxy
=
HtmlExportCopyProxy
::
singleton
();
$copydata
=
$copyproxy
->
get_copy_data
();
$copydata
=
$copyproxy
->
get_copy_data
();
foreach
(
$copydata
as
$from
=>
$to
)
{
foreach
(
$copydata
as
$from
=>
$to
)
{
if
(
!
copy
(
$from
,
$this
->
get
(
'exportdir'
)
.
'/'
.
$this
->
get
(
'rootdir'
)
.
$to
))
{
$to
=
$this
->
get
(
'exportdir'
)
.
'/'
.
$this
->
get
(
'rootdir'
)
.
$to
;
if
(
!
check_dir_exists
(
dirname
(
$to
)))
{
throw
new
SystemException
(
"Could not create directory
$todir
"
);
}
if
(
!
copy
(
$from
,
$to
))
{
throw
new
SystemException
(
"Could not copy static file
$from
"
);
throw
new
SystemException
(
"Could not copy static file
$from
"
);
}
}
}
}
...
@@ -544,7 +548,7 @@ class HtmlExportOutputFilter {
...
@@ -544,7 +548,7 @@ class HtmlExportOutputFilter {
// Images out of the theme directory
// Images out of the theme directory
$html
=
preg_replace_callback
(
$html
=
preg_replace_callback
(
'#(?<=[\'"])('
.
$wwwroot
.
'
)?/?
theme/([a-zA-Z0-9_.-]+)/static/images/([a-z0-9_.-]+)#'
,
'#(?<=[\'"])('
.
$wwwroot
.
'
|/)?((?:[a-z]+/)*)
theme/([a-zA-Z0-9_.-]+)/static/images/([a-z0-9_.-]+)#'
,
array
(
$this
,
'replace_theme_image_link'
),
array
(
$this
,
'replace_theme_image_link'
),
$html
$html
);
);
...
@@ -668,7 +672,7 @@ class HtmlExportOutputFilter {
...
@@ -668,7 +672,7 @@ class HtmlExportOutputFilter {
* Callback
* Callback
*/
*/
private
function
replace_theme_image_link
(
$matches
)
{
private
function
replace_theme_image_link
(
$matches
)
{
$file
=
'
/
theme/'
.
$matches
[
2
]
.
'/static/images/'
.
$matches
[
3
];
$file
=
$matches
[
2
]
.
'theme/'
.
$matches
[
3
]
.
'/static/images/'
.
$matches
[
4
];
$this
->
htmlexportcopyproxy
->
add
(
$this
->
htmlexportcopyproxy
->
add
(
get_config
(
'docroot'
)
.
$file
,
get_config
(
'docroot'
)
.
$file
,
'/static/'
.
$file
'/static/'
.
$file
...
...
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