corrected typos

This commit is contained in:
Sarjuuk
2013-03-05 23:55:09 +01:00
parent c2d258fe73
commit 2b7440ecf8
2 changed files with 7 additions and 11 deletions

View File

@@ -17,19 +17,17 @@ class ItemsetList extends BaseType
parent::__construct($data); parent::__construct($data);
// post processing // post processing
foreach ($this->templates as $this->curTpl) while ($this->iterate())
{ {
$Id = $this->curTpl['id']; $this->templates[$this->id]['classes'] = [];
$this->templates[$this->id]['pieces'] = [];
$this->templates[$Id]['classes'] = [];
$this->templates[$Id]['pieces'] = [];
for ($i = 1; $i < 12; $i++) for ($i = 1; $i < 12; $i++)
{ {
if ($this->curTpl['classMask'] & (1 << $i)) if ($this->curTpl['classMask'] & (1 << $i))
{ {
$this->classes[] = $i + 1; $this->classes[] = $i + 1;
$this->templates[$Id]['classes'][] = $i + 1; $this->templates[$this->id]['classes'][] = $i + 1;
} }
} }
@@ -38,19 +36,16 @@ class ItemsetList extends BaseType
if ($piece = $this->curTpl['item'.$i]) if ($piece = $this->curTpl['item'.$i])
{ {
$this->pieces[] = $piece; $this->pieces[] = $piece;
$this->templates[$Id]['pieces'][] = $piece; $this->templates[$this->id]['pieces'][] = $piece;
$this->pieceToSet[$piece] = $this->id; $this->pieceToSet[$piece] = $this->id;
} }
} }
} }
$this->reset();
$this->classes = array_unique($this->classes); $this->classes = array_unique($this->classes);
$this->pieces = array_unique($this->pieces); $this->pieces = array_unique($this->pieces);
$this->pieceToSet = array_unique($this->pieceToSet); $this->pieceToSet = array_unique($this->pieceToSet);
// AAARG TODO!
$this->curTpl = reset($this->templates); // restore 'iterator'
} }
public function getListviewData() public function getListviewData()

View File

@@ -104,6 +104,7 @@ abstract class BaseType
$linking = $c == 'AND' ? ' AND ' : ' OR '; $linking = $c == 'AND' ? ' AND ' : ' OR ';
else if (is_int($c)) else if (is_int($c))
$limit = $c > 0 ? ' LIMIT '.$c : ''; $limit = $c > 0 ? ' LIMIT '.$c : '';
else
continue; // ignore other possibilities continue; // ignore other possibilities
} }