http://www.atutor.ca/atutor/mantis/view.php?id=2603
authorjoel kronenberg <joel.kronenberg@utoronto.ca>
Fri, 30 Jun 2006 14:41:59 +0000 (14:41 -0000)
committerjoel kronenberg <joel.kronenberg@utoronto.ca>
Fri, 30 Jun 2006 14:41:59 +0000 (14:41 -0000)
docs/include/classes/ContentManager.class.php
docs/include/lib/output.inc.php

index a257f05..3847159 100644 (file)
@@ -457,6 +457,16 @@ class ContentManager
                global $_base_path;
 
                $sequence_links = array();
+
+               $first = $this->getNextContent(0); // get first
+               if ($_SESSION['prefs']['PREF_NUMBERING'] && $first) {
+                       $first['title'] = $this->getNumbering($first['content_id']).' '.$first['title'];
+               }
+               if ($first) {
+                       $first['url'] = $_base_path.'content.php?cid='.$first['content_id'];
+                       $sequence_links['first'] = $first;
+               }
+
                if (!$cid && $_SESSION['s_cid']) {
                        $resume['title'] = $this->_menu_info[$_SESSION['s_cid']]['title'];
 
index 70b69cd..3c42dd9 100644 (file)
@@ -584,6 +584,9 @@ function myCodes($text, $html = false) {
        if (isset($sequence_links['resume']) && $sequence_links['resume']['url']) {
                $text = str_replace('[nid]', $sequence_links['resume']['url'], $text);
        }
+       if (isset($sequence_links['first']) && $sequence_links['first']['url']) {
+               $text = str_replace('[fid]', $sequence_links['first']['url'], $text);
+       }
 
        /* contributed by Thomas M. Duffey <tduffey at homeboyz.com> */
        $html = !$html ? 0 : 1;