File: contents.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 (38 lines) | stat: -rwxr-xr-x 933 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
<?PHP  // $Id: contents.php,v 1.8 2005/01/27 05:20:31 defacer Exp $

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

    if (! $info = document_file("files.php", false)) {
        error("404 - File Not Found");
    }

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

    include($info->filepath);

    print_header();

    $ulopen = false;

    foreach ($string as $file => $filename) {
        if (substr($file,0,1) == "-") {
            if($ulopen) {
                echo '</ul>';
            }
            echo '<h1>'.$filename.'</h1><ul>';
            $ulopen = true;
        } else {
            echo '<li><a target="main" href="'.$CFG->wwwroot.'/doc/?file='.$file.'">'.$filename.'</a></li>';
        }
    }
    if($ulopen) {
        echo '</ul>';
    }

    // Sloppy way to produce valid markup... there should be a print_footer_minimal().
    echo '</div></div></body></html>';
    
?>