Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
1b281dcc
Commit
1b281dcc
authored
Apr 23, 2009
by
Nigel McNie
Browse files
Copy smilies from tinyMCE into the export so they can be linked to.
parent
864cf577
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/export/html/lib.php
View file @
1b281dcc
...
...
@@ -57,7 +57,7 @@ class PluginExportHtml extends PluginExport {
$this
->
rootdir
=
'portfolio-for-'
.
preg_replace
(
'#[^a-zA-Z0-9_-]+#'
,
'-'
,
$user
->
get
(
'username'
));
// Create basic required directories
foreach
(
array
(
'files'
,
'views'
,
'static'
)
as
$directory
)
{
foreach
(
array
(
'files'
,
'views'
,
'static'
,
'static/smilies'
)
as
$directory
)
{
$directory
=
"
{
$this
->
exportdir
}
/
{
$this
->
rootdir
}
/
{
$directory
}
/"
;
if
(
!
check_dir_exists
(
$directory
))
{
throw
new
SystemException
(
"Couldn't create the temporary export directory
$directory
"
);
...
...
@@ -221,12 +221,20 @@ class PluginExportHtml extends PluginExport {
*/
private
function
copy_static_files
()
{
$staticdir
=
$this
->
get
(
'exportdir'
)
.
'/'
.
$this
->
get
(
'rootdir'
)
.
'/static/'
;
foreach
(
new
RecursiveDirectoryIterator
(
get_config
(
'docroot'
)
.
'export/html/static/'
)
as
$fileinfo
)
{
if
(
!
$fileinfo
->
isFile
()
||
substr
(
$fileinfo
->
getFilename
(),
0
,
1
)
==
'.'
)
{
continue
;
}
if
(
!
copy
(
$fileinfo
->
getPathname
(),
$staticdir
.
$fileinfo
->
getFilename
()))
{
throw
new
SystemException
(
"Could not copy static file "
.
$fileinfo
->
getPathname
());
$directoriestocopy
=
array
(
get_config
(
'docroot'
)
.
'export/html/static/'
=>
$staticdir
,
get_config
(
'docroot'
)
.
'js/tinymce/plugins/emotions/images'
=>
$staticdir
.
'smilies/'
,
);
foreach
(
$directoriestocopy
as
$from
=>
$to
)
{
foreach
(
new
RecursiveDirectoryIterator
(
$from
)
as
$fileinfo
)
{
if
(
!
$fileinfo
->
isFile
()
||
substr
(
$fileinfo
->
getFilename
(),
0
,
1
)
==
'.'
)
{
continue
;
}
if
(
!
copy
(
$fileinfo
->
getPathname
(),
$to
.
$fileinfo
->
getFilename
()))
{
throw
new
SystemException
(
"Could not copy static file "
.
$fileinfo
->
getPathname
());
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment