Lines Matching refs:toc
80 $toc = $this->buildToc($data);
82 if (!empty($toc)) {
83 $this->compressToc($toc);
84 $this->normalizeToc($toc);
85 $this->renderToc($renderer, $toc);
105 $toc = array();
117 $toc[] = $item;
122 return $toc;
128 private function compressToc(&$toc) { argument
131 foreach ($toc as $item) {
140 foreach ($toc as $item) {
157 foreach ($toc as &$item) {
165 private function normalizeToc(&$toc) { argument
168 for ($i = 0; $toc[$i]['level'] > 1; $i++) {
169 if (($toc[$i]['level'] - $offset) < 1) {
170 $offset = $toc[$i]['level'] - 1;
173 $toc[$i]['level'] -= $offset;
180 private function renderToc($renderer, $toc) { argument
182 $this->renderList($renderer, $toc, 0);
189 private function renderList($renderer, $toc, $index) { argument
190 $items = count( $toc );
191 $level = $toc[$index]['level'];
195 for ($i = $index; ($i < $items) && ($toc[$i]['level'] == $level); $i++) {
198 $renderer->doc .= '<span class="qna-toc-' . $toc[$i]['class'] . '">';
199 $renderer->internallink($toc[$i]['link'], $toc[$i]['title']);
203 if ((($i + 1) < $items) && ($toc[$i + 1]['level'] > $level)) {
204 $i = $this->renderList($renderer, $toc, $i + 1);