Skip to content

Instantly share code, notes, and snippets.

@dmolsen
Created December 15, 2010 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmolsen/742389 to your computer and use it in GitHub Desktop.
Save dmolsen/742389 to your computer and use it in GitHub Desktop.
This shows an example implementation of content adapters at the module level.
<?php
/**
* Copyright (c) 2008 Massachusetts Institute of Technology
*
* Licensed under the MIT License
* Redistributions of files must retain the above copyright notice.
*
*/
// various copy includes
require_once "../../config.gen.inc.php";
require_once "data/data.inc.php";
// records stats
require_once "../page_builder/page_header.php";
// figures out from info.yml which adapter to use and requires it
$adapter = ModuleAdapter::find();
require_once "adapters/".$adapter."/adapter.php";
// libs
require_once "lib/calendar.lib.php";
require_once "lib/textformat.lib.php";
$id = $_REQUEST['id'];
// use the getCategoryEvents() to find all events for this category
$eventFeed = CalendarAdapter::getCategoryEvents($calendars[$id]['user']);
require "templates/$prefix/category.html";
$page->output();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment