Exemplo n.º 1
0
<?php
$docRoot = getenv("DOCUMENT_ROOT");

require_once $docRoot . "/mobi-config/mobi_web_constants.php";
require WEBROOT . "page_builder/page_header.php";
require LIBDIR . "mit_calendar.php";
require WEBROOT . "calendar/calendar_lib.php";

$category = MIT_Calendar::Category($_REQUEST['id']);
$categorys = MIT_Calendar::subCategorys($category);

if(count($categorys) == 0) {
  header("Location: " . categoryURL($category));
}

require "$page->branch/sub-categorys.html";
$page->output();

?>
   }

   $data['events'] = $event_data;

   break;

 case 'categories': // get full listing of categories
   // this structure just reflects what the web looks like
   // final structure will depend on how we present the UI
   $categories = MIT_Calendar::Categorys();
   foreach ($categories as $categoryObject) {
     $name = ucwordswrapper($categoryObject->name);
     $catid = $categoryObject->catid;
     $catData = array('name' => $name,
		      'catid' => $catid);
     $subcategories = MIT_Calendar::subCategorys($categoryObject);
     if (count($subcategories) > 0) {
       $catData['subcategories'] = array();
       foreach ($subcategories as $subcatObject) {
	 $catData['subcategories'][] = array('name' => ucwordswrapper($subcatObject->name),
					     'catid' => $subcatObject->catid);
       }
     }
     $data[] = $catData;
   }
   break;

 case 'holidays': case 'academic':
   // TODO: see whether any of this code can be consolidated with
   // mobi-web/calendar/academic.php and mobi-web/calendar/holidays.php
   require_once LIBDIR . "AcademicCalendar.php";