Commit a6e12c1a authored by Orbmancer's avatar Orbmancer
Browse files

loaded contents

parent 8eb2d849
......@@ -85,13 +85,34 @@
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button type="submit" class="btn btn-primary">Merge the awesome !</button>
<button type="submit" class="btn btn-primary">Save the awesome !</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>TD</th>
<th>Level name</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Column content</td>
</tr>
<tr>
<td>2</td>
<td>Column content</td>
</tr>
</table>
</div>
</div>
</div>
<!-- Script section -->
......
......@@ -19,4 +19,5 @@ var_dump($td);
Data::saveXML($data, $name, $x, $y, $td);
echo '<br/>';
var_dump(Data::loadXML($td));
\ No newline at end of file
var_dump(Data::loadXML($td));
......@@ -27,6 +27,20 @@ class Contents
$this->contentsRaw = $xml->Data->contents->__toString();
$contents = explode(',', $this->contentsRaw);
$line = array();
$prev_y = 1;
for($i=0; $i<count($contents); ++$i){
$tab_x = (int) floor($i / $this->$tabWidth);
$tab_y = (int) floor($i / ($this->$tabwidth * $this->$tabHeight * $this->mapwidth));
$line[] = $contents[$i];
if($prev_y != $tab_y){
$this->contents[$tab_x][$tab_y] = $line;
$line = array();
}
}
}
public function setContents($contents) {
......@@ -38,6 +52,6 @@ class Contents
}
public function getTab($x, $y) {
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment