Пример #1
0
 /**
  *
  */
 public function runsAction()
 {
     $runs = $run = $this->profiler->getStorage()->getRuns();
     // Table attributes
     $attributes = array('id' => 'xhprof-runs-table');
     // Table header
     $header = array();
     $header[] = array('data' => t('View'));
     $header[] = array('data' => t('Path'), 'field' => 'path');
     $header[] = array('data' => t('Date'), 'field' => 'date', 'sort' => 'desc');
     // Table rows
     $rows = array();
     foreach ($runs as $run) {
         $row = array();
         $row[] = $this->l($run['run_id'], new Url('xhprof.run', array('run' => $run['run_id'])));
         $row[] = isset($run['path']) ? $run['path'] : '';
         $row[] = format_date($run['date'], 'small');
         $rows[] = $row;
     }
     $build['table'] = array('#type' => 'table', '#header' => $header, '#rows' => $rows, '#attributes' => $attributes);
     return $build;
 }