$app->tpl->assign('block', $block); $app->tpl->assign('collection', $app->collection); $app->tpl->assign('collection_title', $app->collection_title); $app->tpl->assign('request_title', $app->request_title); $app->tpl->assign('route', $app->route); $app->tpl->assign('route_single', $app->route_single); }); /** * move a checklist item */ respond('POST', '/checklist-item/reorder/?', function ($request, $response, $app) { $items = $request->param('items'); $success = TRUE; \PSU::db('banner')->StartTrans(); foreach ($items as $child => $parent) { $checklist_item = new TeacherCert\ChecklistItem($child); $gate = new TeacherCert\Gate($parent); if ($checklist_item->id && $gate->id) { $checklist_item->gate_id = $gate->id; if (!$checklist_item->save()) { $success = FALSE; } //end if } //end if } //end foreach \PSU::db('banner')->CompleteTrans($success); die($success ? 'success' : 'error'); }); /**
/** * Underlying checklist item. */ public function checklist_item() { return TeacherCert\ChecklistItem::get($this->checklist_item_id()); }