Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions codebase/base_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ public function render(){
$this->set_relation();

if ($this->live_update !== false && $this->updating!==false) {
$this->apply_filters();
$this->live_update->get_updates();
} else {
if ($this->editing){
Expand All @@ -501,10 +502,7 @@ public function render(){
$this->event->trigger("beforeSort",$wrap);
$wrap->store();

$wrap = new FilterInterface($this->request);
$this->apply_filters($wrap);
$this->event->trigger("beforeFilter",$wrap);
$wrap->store();
$this->apply_filters();

if ($this->model && method_exists($this->model, "get")){
$this->sql = new ArrayDBDataWrapper();
Expand Down Expand Up @@ -887,11 +885,14 @@ public function clear_filter() {
$this->request->set_filters(array());
}

protected function apply_filters($wrap) {
protected function apply_filters() {
$wrap = new FilterInterface($this->request);
for ($i = 0; $i < count($this->filters); $i++) {
$f = $this->filters[$i];
$wrap->add($f['name'], $f['value'], $f['operation']);
}
$this->event->trigger("beforeFilter",$wrap);
$wrap->store();
}

public function sort($name, $direction = false) {
Expand Down Expand Up @@ -953,4 +954,4 @@ public function render(){
}
}

?>
?>