Index: branches/5.2.x/core/units/helpers/brackets_helper.php =================================================================== diff -u -N -r14244 -r14628 --- branches/5.2.x/core/units/helpers/brackets_helper.php (.../brackets_helper.php) (revision 14244) +++ branches/5.2.x/core/units/helpers/brackets_helper.php (.../brackets_helper.php) (revision 14628) @@ -1,6 +1,6 @@ getObject(); + /* @var $object kDBItem */ $temp = $this->getBrackets($event); - foreach($temp as $id => $record) - { - if( $record[$this->max_field] == '∞' ) - { + foreach ($temp as $id => $record) { + if ( $record[$this->max_field] == '∞' ) { $temp[$id][$this->max_field] = -1; } } @@ -352,23 +357,22 @@ } // sort brackets by 2nd column (Max values) - uasort($temp, Array(&$this, 'compareBrackets') ); + uasort($temp, Array (&$this, 'compareBrackets')); reset($temp); $first_item = each($temp); $first_item_key = $first_item['key']; $linked_info = $object->getLinkedInfo(); $sql = 'SELECT %s FROM %s WHERE %s = %s'; $ids = $this->Conn->GetCol( sprintf($sql, $object->IDField, $object->TableName, $linked_info['ForeignKey'], $linked_info['ParentId']) ); - if( is_array($ids) ) - { - usort($ids, Array(&$this, 'sortBracketIDs') ); + + if ( is_array($ids) ) { + usort($ids, Array (&$this, 'sortBracketIDs')); } // $min_id = min( min($ids) - 1, -1 ); - foreach($temp as $key => $record) - { + foreach ($temp as $key => $record) { $temp[$key][$this->min_field] = $start; $start = $temp[$key][$this->max_field]; } @@ -455,14 +459,18 @@ } /** - * Replate infinity mark with -1 before saving to db + * Replace infinity mark with -1 before saving to db * * @param kEvent $event */ function replaceInfinity(&$event) { $object =& $event->getObject(); - if($object->GetDBField($this->max_field) == '∞') $object->SetDBField($this->max_field, -1); + /* @var $object kDBItem */ + + if ( $object->GetDBField($this->max_field) == '∞' ) { + $object->SetDBField($this->max_field, -1); + } } } \ No newline at end of file