]> git.mjollnir.org Git - moodle.git/commitdiff
Framed docs can now select a named anchor in a page
authormoodler <moodler>
Mon, 6 Jan 2003 08:23:36 +0000 (08:23 +0000)
committermoodler <moodler>
Mon, 6 Jan 2003 08:23:36 +0000 (08:23 +0000)
doc/index.php

index 2a5a302270cc0578f3f792f5d38ed1c833aa50b9..1e4d03b4704c92a148aae5219071c6a0b7c0d695 100644 (file)
@@ -2,15 +2,20 @@
 
     require("../config.php");
 
-    optional_variable($file, "");    // docs file to view
+    optional_variable($file, "");     // docs file to view
     optional_variable($frame, "");    // docs file to view
-    optional_variable($lang, "");    // override current language
+    optional_variable($sub, "");      // sub-section (named anchor)
+    optional_variable($lang, "");     // override current language
 
     if (!empty($lang)) {
         $SESSION->doclang = $lang;
         save_session("SESSION");
     }
 
+    if (!empty($sub)) {
+        $sub = "#$sub";
+    }
+
     if (empty($file)) {
         $include = false;
         if (empty($frame)) {
@@ -38,6 +43,6 @@
     <FRAME NAME="top" SRC="top.php">
     <FRAMESET COLS="200,*">
         <FRAME NAME="contents" SRC="contents.php">
-        <FRAME NAME="main" SRC="index.php?file=<?PHP echo "$file"; ?>">
+        <FRAME NAME="main" SRC="index.php?file=<?PHP echo "$file$sub"; ?>">
     </FRAMESET>
 </FRAMESET>