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
Normand Erwan
VVVVVV_level_merger
Commits
037959d6
Commit
037959d6
authored
Jun 01, 2015
by
Erwan Normand
Browse files
Download the merged file
parent
6646caf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.php
View file @
037959d6
...
...
@@ -105,14 +105,14 @@
<h3>
Merge levels
</h3>
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<form
class=
"form-horizontal"
action=
"
upload
.php"
method=
"POST"
>
<form
class=
"form-horizontal"
action=
"
merge
.php"
method=
"POST"
>
<fieldset>
<div
class=
"form-group"
>
<label
for=
"td"
class=
"col-lg-2 control-label"
>
Which level group ?
</label>
<div
class=
"col-lg-10"
>
<select
class=
"form-control"
name=
"td"
id=
"td"
>
<option>
TD 1 (13h15-16h15)
</option>
<option>
TD 2 (16h30-19h30)
</option>
<option>
1
</option>
<option>
2
</option>
</select>
</div>
</div>
...
...
merge.php
View file @
037959d6
...
...
@@ -6,19 +6,25 @@ ini_set('display_errors', 1);
require_once
'model/Data.class.php'
;
require_once
'model/Tabs.class.php'
;
$td
=
$_
GE
T
[
'td'
];
$td
=
$_
POS
T
[
'td'
];
$levels
=
Data
::
loadXML
(
$td
);
//
$levels = Data::loadXML($td);
$finalTabs
=
new
Tabs
();
$finalTabs
->
fillBlank
();
$final
=
new
Tabs
();
$final
->
fillBlank
();
foreach
(
$levels
as
$level
){
$myContent
=
new
Tabs
();
$myContent
->
importXML
(
$level
[
'data'
]);
$final
->
setTab
(
$myContent
->
getTab
(),
$level
[
'x'
],
$level
[
'y'
]);
foreach
(
$levels
as
$level
)
{
$currentTab
=
new
Tabs
();
$currentTab
->
importXML
(
$level
[
'data'
]);
$finalTabs
->
setTab
(
$currentTab
->
getTab
(),
$level
[
'x'
],
$level
[
'y'
]);
}
echo
$final
->
toString
();
$finalFile
=
simplexml_load_file
(
'data/level_layout.vvvvvv'
);
$finalFile
->
Data
->
contents
=
$finalTabs
->
toString
();
header
(
'Content-type: text/xml'
);
header
(
'Content-Disposition: attachment; filename=VVVVVV_level_merged.vvvvvvv'
);
header
(
'Expires: 0'
);
header
(
'Cache-Control: must-revalidate'
);
header
(
'Pragma: public'
);
print
(
$finalFile
->
asXML
());
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