File: index.php

package info (click to toggle)
moodle 1.4.4.dfsg.1-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,876 kB
  • ctags: 29,496
  • sloc: php: 271,617; sql: 5,084; xml: 702; perl: 638; sh: 403; java: 283; makefile: 42; pascal: 21
file content (50 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?PHP  // $Id: index.php,v 1.11.8.2 2004/12/12 07:00:29 moodler Exp $

    require("../config.php");

    $file  = optional_param('file', "", PARAM_FILE);  // docs file to view straight
    $frame = optional_param('frame', "", PARAM_FILE); // docs file to view in frame
    $sub   = optional_param('sub', "", PARAM_CLEAN);  // sub-section (named anchor)

    if ($CFG->forcelogin) {
        require_login();
    }

    if (!empty($sub)) {
        $sub = "#$sub";
    } else {
        $sub = "";
    }

    if (empty($file)) {
        $include = false;
        if (empty($frame)) {
            $file = "intro.html";
        } else {
            $file = $frame;
        }
    } else {
        $include = true;
    }

    if (! document_file($file, $include)) {
        error("Error 404 - File Not Found");
    }

    if ($include) {
        exit;
    }

?>

<head>
    <title><?php print_string("documentation")?></title>
</head>

<frameset rows="70,*">
    <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$sub"; ?>">
    </frameset>
</frameset>