You are here

function sgrid_save_order in Sortable Grid Views Plugin 7

1 string reference to 'sgrid_save_order'
sgrid_menu in ./sgrid.module

File

./sgrid.module, line 14

Code

function sgrid_save_order($view, $display, $reset = FALSE) {
  db_delete('sgrid')
    ->condition('view_display', $view . '_' . $display)
    ->execute();
  if (!$reset) {
    foreach ($_GET['sgrid_item'] as $index => $name) {
      db_insert('sgrid')
        ->fields(array(
        'nid' => $name,
        'rank' => $index,
        'view_display' => $view . '_' . $display,
      ))
        ->execute();
    }
  }
  print t("Order saved");
}