Skip to content
GitLab
Menu
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
4a2e4ed3
Commit
4a2e4ed3
authored
Oct 02, 2014
by
Son Nguyen
Committed by
Gerrit Code Review
Oct 02, 2014
Browse files
Merge "Passing in oldextension variable when doing import or zip extraction" into 1.9_STABLE
parents
87ddefc2
feccff40
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/import/leap/lib.php
View file @
4a2e4ed3
...
...
@@ -420,6 +420,7 @@ class LeapImportBlog extends LeapImportArtefactPlugin {
'title'
=>
(
string
)
$blogpostentry
->
title
.
' '
.
get_string
(
'attachment'
,
'artefact.blog'
),
'owner'
=>
$importer
->
get
(
'usr'
),
);
$data
->
oldextension
=
end
(
explode
(
'.'
,
$data
->
title
));
return
ArtefactTypeFile
::
save_file
(
$pathname
,
$data
,
$importer
->
get
(
'usrobj'
),
true
);
}
...
...
htdocs/artefact/file/import/leap/lib.php
View file @
4a2e4ed3
...
...
@@ -459,7 +459,7 @@ class LeapImportFile extends LeapImportArtefactPlugin {
else
{
$usr
=
$importer
->
get
(
'usrobj'
);
}
$data
->
oldextension
=
end
(
explode
(
'.'
,
$data
->
title
));
// This API sucks, but that's not my problem
if
(
!
$id
=
ArtefactTypeFile
::
save_file
(
$data
->
pathname
,
$data
,
$usr
,
true
))
{
$importer
->
trace
(
"WARNING: the file for entry
$entryid
does not exist in the import (path=
{
$data
->
pathname
}
)"
);
...
...
htdocs/artefact/file/lib.php
View file @
4a2e4ed3
...
...
@@ -2395,6 +2395,7 @@ class ArtefactTypeArchive extends ArtefactTypeFile {
// set the file extension for later use (eg by flowplayer)
$this
->
data
[
'template'
]
->
extension
=
pathinfo
(
$this
->
data
[
'template'
]
->
title
,
PATHINFO_EXTENSION
);
$this
->
data
[
'template'
]
->
oldextension
=
$this
->
data
[
'template'
]
->
extension
;
if
(
substr
(
$name
,
-
1
)
==
'/'
)
{
$this
->
create_folder
(
$folder
);
...
...
@@ -2441,6 +2442,7 @@ class ArtefactTypeArchive extends ArtefactTypeFile {
// set the file extension for later use (eg by flowplayer)
$this
->
data
[
'template'
]
->
extension
=
pathinfo
(
$this
->
data
[
'template'
]
->
title
,
PATHINFO_EXTENSION
);
$this
->
data
[
'template'
]
->
oldextension
=
$this
->
data
[
'template'
]
->
extension
;
if
(
substr
(
$name
,
-
1
)
!=
'/'
)
{
$h
=
fopen
(
$tempfile
,
'w'
);
...
...
htdocs/import/file/lib.php
View file @
4a2e4ed3
...
...
@@ -99,6 +99,7 @@ class PluginImportFile extends PluginImport {
try
{
$data
=
(
object
)
array
(
'title'
=>
$f
->
wantsfilename
,
'oldextension'
=>
end
(
explode
(
'.'
,
$f
->
wantsfilename
)),
'description'
=>
$f
->
wantsfilename
.
' ('
.
get_string
(
'importedfrom'
,
'mahara'
,
$this
->
get
(
'importertransport'
)
->
get_description
())
.
')'
,
'parent'
=>
$this
->
importdir
,
'owner'
=>
$this
->
get
(
'usr'
),
...
...
htdocs/import/leap/lib.php
View file @
4a2e4ed3
...
...
@@ -1977,6 +1977,7 @@ class PluginImportLeap extends PluginImport {
'title'
=>
(
string
)
$entry
->
title
.
' '
.
get_string
(
'attachment'
),
'owner'
=>
$this
->
get
(
'usr'
),
);
$data
->
oldextension
=
end
(
explode
(
'.'
,
$data
->
title
));
return
ArtefactTypeFile
::
save_file
(
$pathname
,
$data
,
$this
->
get
(
'usrobj'
),
true
);
}
...
...
Write
Preview
Supports
Markdown
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