Course Outliner Documentation (Version 0.4)
Course Outliner is designed to:
- read an outline.txt file that defines the topics for the course.
- create a hyperlinked table showing the outline of topics for the course.
- display the content of each topic in the outline and create the navigation links to go to the previous or next topics in the outline.
There are six essential files used by Course Outliner. They are:
- This is a tab-delimited text file that defines the outline of topics. Each topic is a separate line in the file. Tabs are used to indent the topic as desired.
- This preferences file is used to specify the course name, professor's name, etc.
- This is the introductory page.
- This page serves the content pages.
- This is a tab-delimited text file that defines dates and topics to be covered (or events).
- This page displays the dates and events defined in calendar.txt on a navigable calendar.
The first four files should be in the same directory. Also in this directory is a calendar directory that has cal.php and calendar.txt. Also in this directory are the content folders. In each content folder is its associated content file. Content files are html files with no <html>, <head>, or <body> tags.
Many PHP functions are contained in the file outliner.php. PHP functions for the feedback form are in feedback.php. Style classes are defined in outliner.css.
The outline.txt file defines the outline for the course. Each line corresponds to a topic; each topic corresponds to an associated content page. Topics are indented in the outline using tabs. Consider the following example outline.txt file.
change in momentum
uniform circular motion
The preferences.php file specifies variable names such as the course prefix, course name, professor's name, etc.
The index.php file is the starting page for the course. It generates the outline table and provides an introduction to the course. For the outline above, the table generated by the index.php file would look something like this (Note that the links will not work in this example.):
The content.php file can be thought of as the content server. It takes the content for a single topic (this is stored in a content page) and puts it into the page template. It formats the outline table to indicate the topic from the outline that is being shown. It also creates navigation links to go to the previous and next topics.
Its big benefit is that the content pages only contain the content being shown. Thus, you can modify the look of all content pages by merely modifying the content.php file.
Please note the following formatting rules:
- One content page should be created for each topic in the outline.
- A content page should have the same name (with same capitalization) as the topic, but with an underscore (_) in place of each space ( ) that is in the topic.
- Each content page should end with the extension ".php".
- Each content page should be in its own folder with the same name, without the ".php" extension.
- The root of the content folders should be the same as the course outline.
The screen capture below shows one content file within the folder hierarchy that corresponds to the topics listed in the outline above.
./calendar/, there is a file
calendar.txt that defines dates and topics to be covered (or events). The file is tab delimited and is in the format
For example, the calendar.txt file in the example is
1/10/2006 Course Introduction
1/11/2006 Math Review
Modify this file to add events and dates.
A feedback form can be displayed at the bottom of each content page. Feedback is stored in a folder called
feedback. When feedback is first submitted on a particular content page, a feedback file called
feedback.txt is created in the feedback folder in a subfolder corresponding to the topic.
The folder tree used in the feedback folder corresponds to the course outline, just like the content files.
Be default, a feedback form will be shown for each content page. To modify the default behavior, change the following line to TRUE in the file outliner.php.
You can repress the feedback on any content page by including the following line in the content page.
<? $repressFeedback=TRUE; ?>
You can modify the style of the pages by editing index.php and content.php. It will be easiest to simply modify the css definitions. However, you can also modify the HTML. You can also very easily change the location of things like the navigation links and the topic heading.
To help you understand the files, here's a brief overview of some of the parts.
The main body of PHP functions are between the
?> tags. The functions include:
- This function takes a section (i.e. topic) name and converts it to a filename by replacing spaces with underscores and appending a .html extension.
- This function takes a section (i.e. topic) name and converts it to a folder name by replacing spaces with underscores.
- This function converts a section name (i.e. topic) and converts it to a full path name, including the filename.
- This function takes a filename (of a content file) and converts it to a section (i.e. topic) name by replacing underscores with spaces, removing the file's path, and removing the .html extension.
- This function takes a section name, determines the path to the file, including the filename, and returns the filename.
- This function takes a section name, determines the path to the feedback file.
- This function takes a section name, determines the path to the file, and returns the path. It's useful for easily creating relative links within content files.
- This function reads the outline.txt file and returns a two-dimensional array. Each element of the array is a 3-dimensional array storing  the level of the topic (1 is highest level, then 2, or 3 for lower levels),  the name of the topic, and  the parent's name of the topic (null string for top-level topic).
- This function takes the 2-D array created by readOutline, converts it HTML code, and returns the HTML as a string. It's best to leave this function as it is and simply modify the css classes that are used by this HTML code.
- This function takes the outline array as created by readOutline and the current section. It returns the HTML code for the navigation links to the previous and next topics in the outline.
In version 0.4, functions to convert the content number (which is an index for a content file in outline.txt) to a filename and a section number to a content number were added so that the content number rather than filename would be displayed in the URL.
If you edit the HTML of the page, you should know that the outline is displayed in the page at the location of:
The navigation links are displayed at the location of
The topic name is displayed at the location of
The content of the html file served by content.php is displayed at the location of