You are here

function import_finished_page in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

Same name and namespace in other branches
  1. 6.2 import/merci_import.php \import_finished_page()
1 call to import_finished_page()
merci_import.php in import/merci_import.php
Administrative page for adding MERCI bucket/resource content types and items.

File

import/merci_import.php, line 461
Administrative page for adding MERCI bucket/resource content types and items.

Code

function import_finished_page($success) {
  drupal_set_title('MERCI import');
  $links[] = '<a href="' . base_path() . '">Main page</a>';
  $links[] = '<a href="' . base_path() . '?q=admin">Administration pages</a>';

  // Report end result
  if ($success) {
    $output = '<p>Importing data was attempted. If you see no errors listed, you should remove merci_import.php from your Drupal root directory. Otherwise, you may need to update your database manually. All errors have been <a href="index.php?q=admin/logs/watchdog">logged</a>.</p>';
  }
  else {
    $output = '<p class="error">The import process was aborted prematurely. All other errors have been <a href="index.php?q=admin/logs/watchdog">logged</a>. You may need to check the <code>watchdog</code> database table manually.</p>';
    $output .= '<p class="error">This has most likely occurred because the CSV files are not in the correct format.</p>';
  }
  $output .= theme('item_list', $links);
  if ($success) {
    $output .= "<h4>Some things to take care of now:</h4>\n";
    $output .= "<ul>\n";
    $output .= "<li>Follow the instructions in MERCI's INSTALL.txt for setting up proper permissions for the bucket/resource content types that you added.</li>\n";
    $output .= "</ul>\n";
  }
  return $output;
}