Commit 101b67b0 authored by Penny Leach's avatar Penny Leach Committed by Nigel McNie
Browse files

ajax add and remove column now seems to work

parent 0032563e
......@@ -67,20 +67,22 @@ case 'blocktype_list':
break;
case 'add_column':
$column = param_integer('column');
if (view_add_column($view->get('id'), $column)) {
try {
$view->addcolumn(array('before' => $column));
json_reply(false, array('message' => false, 'data' => view_build_column($view, $column, true)));
}
else {
json_reply(true, 'Failed to add column');
catch (Exception $e) {
json_reply(true, 'Failed to add column: ' . $e->getMessage());
}
case 'remove_column':
$column = param_integer('column');
if (view_remove_column($view->get('id'), $column)) {
try {
$view->removecolumn(array('column' => $column));
// Just do it - no message
json_reply(false, false);
}
else {
json_reply(true, 'Failed to remove column');
catch (Exception $e) {
json_reply(true, 'Failed to remove column: ' . $e->getMessage());
}
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment