Skip to content

Commit 0cff087

Browse files
committed
New: Support for refresh option in Editor's e-type form-options.
1 parent 2afe02f commit 0cff087

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Editor.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public static function action($http, $name = 'action')
111111
return self::ACTION_SEARCH;
112112
case 'upload':
113113
return self::ACTION_UPLOAD;
114+
case 'read':
115+
return self::ACTION_READ;
114116
default:
115117
throw new \Exception('Unknown Editor action: ' . $http[$name]);
116118
}
@@ -1152,10 +1154,24 @@ private function _get($id = null, $http = null)
11521154
$query->left_join($this->_leftJoin);
11531155
$ssp = $this->_ssp_query($query, $http);
11541156

1157+
// Limit to a single id (after update)
11551158
if ($id !== null) {
11561159
$query->where($this->pkeyToArray($id, true));
11571160
}
11581161

1162+
// Limit to specific ids submitted from the client-side
1163+
if (isset($http['ids'])) {
1164+
$httpIds = $http['ids'];
1165+
1166+
$query->where(function ($q) use ($httpIds) {
1167+
for ($i=0 ; $i<count($httpIds) ; $i++) {
1168+
$id = str_replace($this->_idPrefix, '', $httpIds[$i]);
1169+
1170+
$q->or_where($this->pkeyToArray($id, true));
1171+
}
1172+
});
1173+
}
1174+
11591175
$res = $query->exec();
11601176
$out = [];
11611177

0 commit comments

Comments
 (0)