mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-22 01:19:54 -04:00
Added progress bar and pause and continue functionality to rearrange
This commit is contained in:
@@ -28,13 +28,10 @@ class organize_task_Core {
|
||||
|
||||
try {
|
||||
$stop = $context["position"] + $context["batch"];
|
||||
$sql = "";
|
||||
for (; $context["position"] < $stop; $context["position"]++ ) {
|
||||
$id = $context["items"][$context["position"]];
|
||||
$sql .= "Update {items} set weight = {$context["position"]} where id=$id;";
|
||||
}
|
||||
if (!empty($sql)) {
|
||||
$db = Database::instance()->query($sql);
|
||||
Database::instance()
|
||||
->query("Update {items} set weight = {$context["position"]} where id=$id;");
|
||||
}
|
||||
$task->state = "success";
|
||||
} catch(Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user