From 2b7440ecf873d468e912b4c90671b23641ef68ce Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Tue, 5 Mar 2013 23:55:09 +0100 Subject: [PATCH] corrected typos --- includes/class.itemset.php | 17 ++++++----------- includes/utilities.php | 1 + 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/includes/class.itemset.php b/includes/class.itemset.php index 1212130d..e4e200ed 100644 --- a/includes/class.itemset.php +++ b/includes/class.itemset.php @@ -17,19 +17,17 @@ class ItemsetList extends BaseType parent::__construct($data); // post processing - foreach ($this->templates as $this->curTpl) + while ($this->iterate()) { - $Id = $this->curTpl['id']; - - $this->templates[$Id]['classes'] = []; - $this->templates[$Id]['pieces'] = []; + $this->templates[$this->id]['classes'] = []; + $this->templates[$this->id]['pieces'] = []; for ($i = 1; $i < 12; $i++) { if ($this->curTpl['classMask'] & (1 << $i)) { $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]) { $this->pieces[] = $piece; - $this->templates[$Id]['pieces'][] = $piece; + $this->templates[$this->id]['pieces'][] = $piece; $this->pieceToSet[$piece] = $this->id; } } } + $this->reset(); $this->classes = array_unique($this->classes); $this->pieces = array_unique($this->pieces); $this->pieceToSet = array_unique($this->pieceToSet); - - - // AAARG TODO! - $this->curTpl = reset($this->templates); // restore 'iterator' } public function getListviewData() diff --git a/includes/utilities.php b/includes/utilities.php index 92546cf3..28fcd686 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -104,6 +104,7 @@ abstract class BaseType $linking = $c == 'AND' ? ' AND ' : ' OR '; else if (is_int($c)) $limit = $c > 0 ? ' LIMIT '.$c : ''; + else continue; // ignore other possibilities }