$bid)); drupal_set_message("batch ". $bid." deleted"); if($redirect) drupal_goto('admin/config/system/batch'); } function batch_ui_config_form($form, &$form_state){ $ops = db_query("SELECT bid, timestamp, batch FROM {batch} ORDER BY bid"); $batch = array(); foreach ($ops as $op) { if($b = unserialize($op->batch)){ //krumo($b); $row = array(); $row[] = $op->bid; $row[] = 'source : '.l($b['source_url'],$b['source_url']).'
redirect : '.l($b['redirect'],$b['redirect']); $row[] = date('Y-m-d', $op->timestamp); $sets = array(); foreach($b['sets'] as $k=>$s){ $sets[] = 'Set '.$k.' : '.round($s['sandbox']['progress']/$s['sandbox']['max']*100,1).'%'; //dsm($s); } $row[] = theme('item_list', array('items'=>$sets)); $row[] = theme('item_list', array('items'=>array( l('Open', 'batch', array('query'=>array('op'=>'start', 'id'=>$op->bid))), l('Delete', 'admin/config/system/batch/delete/'.$op->bid) ))); $batch[] = $row; } } $form['batch'] = array( '#markup'=>theme('table', array( 'header'=>array('bid', 'path', 'date', 'process', 'operation'), 'rows'=>$batch, 'sticky'=>true ) ), ); return $form; } function batch_ui_config_form_validate($form, &$form_state){ } function batch_ui_config_form_submit($form, &$form_state){ }