File: index.php

package info (click to toggle)
moodle 1.6.3-2%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 37,172 kB
  • ctags: 51,688
  • sloc: php: 231,916; sql: 5,631; xml: 2,688; sh: 1,185; perl: 638; makefile: 48; pascal: 36
file content (54 lines) | stat: -rw-r--r-- 1,452 bytes parent folder | download | duplicates (2)
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
51
52
53
54
<?PHP  // $Id: index.php,v 1.15.2.1 2006/08/29 20:39:24 skodak 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 = '#'.s($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;
    }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title><?php print_string("documentation")?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo current_charset(); ?>" />
</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>
</html>