]> git.ozlabs.org Git - ccan/blob - web/static-configuration
take: add labels when CCAN_TAKE_DEBUG set, return in taken_any().
[ccan] / web / static-configuration
1 <?php
2 //temp folder for uploads
3 $tempfolder = "/home/ccan/upload-temp/";
4
5 //location of upload script (for posting uploads)
6 $uploadscript = "http://ccodearchive.net/uploader.php";
7
8 //ccan admin
9 $ccanadmin = "rusty@rustcorp.com.au";
10
11 //email from 
12 $frommail = "ccan@ozlabs.org";
13
14 //tar home dir
15 $tar_dir = 'tarballs';
16
17 //where repo is: attach module name to browse
18 $repo_base = 'http://git.ozlabs.org/?p=ccan;a=tree;f=ccan/';
19
20 function extract_field($field,$module)
21 {
22    return htmlspecialchars(shell_exec('tools/doc_extract '.$field.' '.$module.'/_info'));
23 }
24
25 // Convert double line breaks into paragraphs, and blank spaces into preformat.
26 function htmlize_field($field,$module)
27 {
28    $state="inpara";
29    $result="<p>";
30    $raw=extract_field($field,$module);
31    foreach (explode("\n", $raw) as $line) {
32       if ($line == "") {
33          switch ($state) {
34          case "inpara":
35             $state="endpara";
36             $result .= "</p>";
37             break;
38          }
39       } else if ($line[0] == " " || $line[0] == "\t") {
40          switch ($state) {
41          case "literal":
42             break;
43          case "inpara":
44             $result .= "</p>";
45          case "endpara":
46             $result .= "<pre>";
47             $state = "literal";
48          }
49       } else {
50          switch ($state) {
51          case "literal":
52             $result .= "</pre>";
53          case "endpara":
54             $result .= "<p>";
55             $state = "inpara";
56          }
57       }
58       $result .= $line . "\n";
59    }
60
61    switch ($state) {
62       case "literal":
63          $result .= "</pre>";
64          break;
65       case "inpara":
66          $result .= "</p>";
67          break;
68    }
69    return $result;
70 }   
71 ?>