baseline
[omp.pkp.sfu.ca.git] / lib / pkp / classes / help / HelpToc.inc.php
blobc414044d8e03219453c5451e31d8aa32ba2c40b0
1 <?php
3 /**
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.
9 * @class HelpToc
10 * @ingroup help
11 * @see HelpTocDAO
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 */
23 var $topics;
25 /** The list of breadcrumbs belonging to this toc */
26 var $breadcrumbs;
28 /**
29 * Constructor.
31 function HelpToc() {
32 parent::DataObject();
33 $this->topics = array();
34 $this->breadcrumbs = array();
38 // Get/set methods
41 /**
42 * Get toc ID (a unique six-digit string).
43 * @return string
45 function getId() {
46 return $this->getData('id');
49 /**
50 * Set toc ID (a unique six-digit string).
51 * @param $id int
53 function setId($id) {
54 $this->setData('id', $id);
57 /**
58 * Get toc title.
59 * @return string
61 function getTitle() {
62 return $this->getData('title');
65 /**
66 * Set toc title.
67 * @param $title string
69 function setTitle($title) {
70 $this->setData('title', $title);
73 /**
74 * Get the ID of the topic one-level up from this one.
75 * @return string
77 function getParentTopicId() {
78 return $this->getData('parentTopicId');
81 /**
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);
89 /**
90 * Get the set of topics in this table of contents.
91 * @return array the topics in order of appearance
93 function &getTopics() {
94 return $this->topics;
97 /**
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;
107 * Get breadcrumbs.
108 * @return array
110 function &getBreadcrumbs() {
111 return $this->breadcrumbs;
115 * Set breadcrumbs.
116 * @param $name string
117 * @param $url string
119 function addBreadcrumb($name,$url) {
120 $this->breadcrumbs[$name] = $url;