$rs = $DB->select(K_TBL_PAGES, array('template_id'), "id = '" . $DB->sanitize($draft_id) . "'"); $_tpl_id = $rs[0]['template_id']; } else { $_tpl_id = $tpl_id; } $PAGE = new KWebpage($_tpl_id, $draft_id); if ($PAGE->error) { ob_end_clean(); die('ERROR in deletion: ' . $PAGE->err_msg); } // execute action if ($_POST['bulk-action'] == 'delete') { $PAGE->delete(1); } elseif ($_POST['bulk-action'] == 'apply') { $DB->begin(); $res = $PAGE->update_parent(); if ($FUNCS->is_error($res)) { ob_end_clean(); die($res->err_msg); } $PAGE->delete(1); $DB->commit(1); } } } } } // list all available drafts $_p = array(); $_p['module'] = 'drafts'; $_p['title'] = $FUNCS->t('drafts');