You are here

function hacked_report_form in Hacked! 7.3

1 string reference to 'hacked_report_form'
hacked_menu in ./hacked.module
Implementation of hook_menu().

File

./hacked.forms.inc, line 13
The forms

Code

function hacked_report_form($form, $form_state) {
  $header = [
    'project_name' => t('Project Name'),
    'version' => t('Version'),
    'changes' => t('Changes'),
    'details' => t('View details'),
    'status' => t('Status'),
  ];
  $core = [];
  $modules = [];
  $themes = [];
  foreach (_hacked_get_projects() as $project) {
    $temp = [
      'project_name' => $project['name'],
      'version' => $project['existing_version'],
      'changes' => '0 files changed, 0 files deleted, 0 files added',
      'details' => '<a href="#">' . t('View Details') . '</a>',
      'status' => 'Unchecked',
    ];
    switch ($project['project_type']) {
      case 'core':
        $core[$project['name']] = $temp;
        break;
      case 'module':
        $modules[$project['name']] = $temp;
        break;
      case 'theme':
        $themes[$project['name']] = $temp;
        break;
    }
  }
  $form['table-core'] = [
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $core,
    '#prefix' => t('Drupal core'),
  ];
  $form['table-modules'] = [
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $modules,
    '#prefix' => t('Modules'),
  ];
  $form['table-themes'] = [
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $themes,
    '#prefix' => t('Themes'),
  ];
  $form['check'] = [
    '#type' => 'submit',
    '#value' => t('Check selected'),
  ];
  $form['check_all'] = [
    '#type' => 'submit',
    '#value' => t('Check All'),
  ];
  $form['restore'] = [
    '#type' => 'submit',
    '#value' => t('Restore selected'),
  ];
  $form['restore_all'] = [
    '#type' => 'submit',
    '#value' => t('Restore All'),
  ];
  return $form;
}