$sorted = false;
if (method_exists($x, 'applySort')) {
- $sorted = $x->applySort($this->authUser, $sort, $dir, array_values($this->cols));
+ $sorted = $x->applySort($this->authUser, $sort, $dir, array_keys($this->cols));
}
if ($sorted === false) {
if (strlen($sort) && isset($cols[$sort]) ) {
$sort = $x->tableName() .'.'.$sort . ' ' . $dir ;
$x->orderBy($sort );
- } else if (in_array($sort, array_values($this->cols))) {
+ } else if (in_array($sort, array_keys($this->cols))) {
$sort = $sort . ' ' . $dir ;
$x->orderBy($sort );
}// else other formatas?
$this->cols = array();
foreach($xx as $k) {
- $this->cols[$do->tableName(). '.' . $k] = $k;
+ $this->cols[$k] = $do->tableName(). '.' . $k;
}
foreach($xx as $k) {
- $this->cols[$tab.'.'.$k] = sprintf($ocl.'_%s', $k);
+ $this->cols[sprintf($ocl.'_%s', $k)] = $tab.'.'.$k;
}
if (is_array($val)) {
continue;
}
- if ($key[0] == '!' && in_array(substr($key, 1), array_values($this->cols))) {
+ if ($key[0] == '!' && in_array(substr($key, 1), array_keys($this->cols))) {
$x->whereAdd( $x->tableName() .'.' .substr($key, 1) . ' != ' .
(is_numeric($val) ? $val : "'". $x->escape($val) . "'")