You are here

public function CaseTrackerCaseUIController::addPage in Case Tracker 7.2

Create the markup for the add CaseTrackerCase Entities page within the class so it can easily be extended/overriden.

File

includes/controller/ui/CaseTrackerCaseUIController.inc, line 90

Class

CaseTrackerCaseUIController
UI controller.

Code

public function addPage() {
  $item = menu_get_item();
  $content = system_admin_menu_block($item);
  if (count($content) == 0) {
    drupal_set_message(t('There isn\'t any Case Type configured. To setup now, go to the <a href="@link">@link_text</a>.', array(
      '@link' => base_path() . 'admin/structure/casetracker/case-types',
      '@link_text' => 'administrative page',
    )), 'error');
  }
  elseif (count($content) == 1) {
    $item = array_shift($content);

    // Check to see if a project is being referenced, to pass the reference
    $project_ref = arg(5);
    if (is_numeric($project_ref)) {
      drupal_goto($item['href'] . '/' . $project_ref);
    }
    else {
      drupal_goto($item['href']);
    }
  }
  return theme('casetracker_case_add_list', array(
    'content' => $content,
  ));
}