function data_node_add_page in Data 6
Page callback for adding.
@todo: add tokenizing drupal_valid_token/drupal_get_token to prevent XSS
1 string reference to 'data_node_add_page'
- data_node_menu in data_node/
data_node.module - Implementation of hook_menu().
File
- data_node/
data_node.module, line 229 - Hooks and API functions for Data Node module.
Code
function data_node_add_page($table, $id, $nid, $token) {
if (drupal_valid_token($token, _data_node_hash($table, $id, $nid))) {
data_node_remove($table, $id, $nid);
data_node_add($table, $id, $nid);
}
// Handle AJAX requests
if (isset($_GET['ajax'])) {
$response = array(
'status' => TRUE,
'table' => $table
->get('name'),
'id' => $id,
'nid' => $nid,
'labels' => data_node_render_labels($table, $id),
'add_link' => data_node_render_remove_link($table, $id, $nid),
'remove_link' => data_node_render_add_link($table, $id, $nid),
);
drupal_json($response);
exit;
}
drupal_goto($_GET['q']);
}