File: howto.php

package info (click to toggle)
php-doc 20100521-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 59,992 kB
  • ctags: 4,085
  • sloc: xml: 796,833; php: 21,338; cpp: 500; sh: 117; makefile: 58; awk: 28
file content (44 lines) | stat: -rw-r--r-- 1,727 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
<?php
/*  $Id: howto.php 264335 2008-08-06 20:30:52Z bjori $ */

require_once $ROOT . '/themes/php/phpweb.php';
class howto extends phpweb {
    private $tmp = "";
    public function __construct(array $IDs, $filename, $ext = "php") {
        phpdotnet::__construct($IDs, array(), $ext, true);
        $this->outputdir = $GLOBALS['OPTIONS']['output_dir'] . 'howto' . DIRECTORY_SEPARATOR;
        if(!file_exists($this->outputdir) || is_file($this->outputdir)) {
            mkdir($this->outputdir) or die("Can't create the cache directory");
        }
    }

    public function header($id) {
        $title = PhDHelper::getDescription($id, true);
        $parent = PhDHelper::getParent($id);
        $next = $prev = $up = array(null, null);
        if ($parent && $parent != "ROOT") {
            $siblings = PhDHelper::getChildren($parent);
            $prev = phpweb::createPrev($id, $parent, $siblings);
            $next = phpweb::createNext($id, $parent, $siblings);
            $up = array($parent.".php", PhDHelper::getDescription($parent, false));
        }

        $this->tmp = <<< NAV
<div style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="{$prev[0]}">{$prev[1]}</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="{$next[0]}">{$next[1]}</a></div>
 <div class="up"><a href="{$up[0]}">{$up[1]}</a></div>
</div>
NAV;
        return "<?php include_once '../include/init.inc.php'; echo site_header('$title');?>\n" . $this->tmp . "<hr />\n";
    }
    public function footer($id) {
        return "<hr />\n" . $this->tmp . "<br />\n<?php echo site_footer(); ?>\n";
    }
}

/*
* vim600: sw=4 ts=4 fdm=syntax syntax=php et
* vim<600: sw=4 ts=4
*/