4 * @file classes/help/HelpToc.inc.php
6 * Copyright (c) 2000-2009 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
13 * @brief Help table of contents class.
14 * A HelpToc object is associated with zero or more HelpTopic objects.
17 // $Id: HelpToc.inc.php,v 1.3 2009/04/08 21:34:54 asmecher Exp $
20 class HelpToc
extends DataObject
{
22 /** The list of topics belonging to this toc */
25 /** The list of breadcrumbs belonging to this toc */
33 $this->topics
= array();
34 $this->breadcrumbs
= array();
42 * Get toc ID (a unique six-digit string).
46 return $this->getData('id');
50 * Set toc ID (a unique six-digit string).
54 $this->setData('id', $id);
62 return $this->getData('title');
67 * @param $title string
69 function setTitle($title) {
70 $this->setData('title', $title);
74 * Get the ID of the topic one-level up from this one.
77 function getParentTopicId() {
78 return $this->getData('parentTopicId');
82 * Set the ID of the topic one-level up from this one.
83 * @param $parentTopicId string
85 function setParentTopicId($parentTopicId) {
86 $this->setData('parentTopicId', $parentTopicId);
90 * Get the set of topics in this table of contents.
91 * @return array the topics in order of appearance
93 function &getTopics() {
98 * Associate a topic with this toc.
99 * Topics are added in the order they appear in the toc (i.e., FIFO).
100 * @param $topic HelpTopic
102 function addTopic(&$topic) {
103 $this->topics
[] = $topic;
110 function &getBreadcrumbs() {
111 return $this->breadcrumbs
;
116 * @param $name string
119 function addBreadcrumb($name,$url) {
120 $this->breadcrumbs
[$name] = $url;