1
0
mirror of synced 2025-02-01 13:01:45 +03:00
This commit is contained in:
zYne 2007-02-23 19:41:42 +00:00
parent 83677290e8
commit 7de3e31a32
5 changed files with 58 additions and 14 deletions

View File

@ -112,16 +112,17 @@
while($count--) {
array_shift($p);
}
print "<div class=level" . $l . '><font class=level' . $l . '>';
?>
<a href=documentation2.php?chapter=<?php print urlencode($i[$x]['name']) . '>' . end($p); ?></a>
</font></div>
<?php
if (strncmp($i[$x]['name'], $_GET['chapter'], strlen($_GET['chapter'])) !== 0) {
break;
if ( ! empty($p)) {
print "<div class=level" . $l . '><font class=level' . $l . '>' . $i[$x]['index'];
?>
<a href=documentation2.php?chapter=<?php print urlencode($i[$x]['name']) . '>' . end($p); ?></a>
</font></div>
<?php
if (strncmp($i[$x]['name'], $_GET['chapter'], strlen($_GET['chapter'])) !== 0) {
break;
}
}
}
}

View File

@ -42,7 +42,37 @@ function render($title,$t,$e) {
}
print "<br>";
}
/**
public function parseIndex($index, $path = array(), $counters = array())
{
$ret = array();
foreach ($index as $k => $v) {
$i = count($path) - 1;
$counters[$i]++;
if (is_array($v)) {
if ( ! is_numeric($k)) {
$tmp = $path;
$tmp[] = $k;
$chapterName = ( ! empty($path)) ? implode(' - ', $path) . ' - ' . $k : $k;
$ret[] = array('index' => implode('.', $counters),
'name' => $chapterName);
}
$ret = array_merge($ret, $this->parseIndex($v, $tmp, $counters));
} else {
$chapterName = ( ! empty($path)) ? implode(' - ', $path) . ' - ' . $v : $v;
$ret[] = array('index' => implode('.', $counters),
'name' => $chapterName);
}
}
return $ret;
}*/
function render_block($name) {
if(file_exists("docs/$name.php")) {

View File

@ -1,22 +1,32 @@
<?php
include("top.php");
require_once("highlight.php");
error_reporting(E_ALL | E_STRICT);
error_reporting(E_ALL);
set_include_path(dirname(__FILE__) . '/../vendor/');
$f = file_get_contents('menu.php');
$a = explode(PHP_EOL, $f);
$res = array();
$curr = false;
require_once('Text/Wiki.php');
require_once('Text/Wiki/MediaWiki.php');
class DocTool
{
private $index;
protected $highlighter;
protected $wiki;
public function __construct()
{
$this->highlighter = new PHP_Highlight;
$this->wiki = new Text_Wiki;
}
public function parseIndex2($index)
{
@ -74,7 +84,7 @@ class DocTool
if(substr($c, 0, 5) == "<?php") {
include("docs/$name.php");
} else {
print $c."<br><br>";
print $this->wiki->transform($c) . "<br><br>";
}
}
if(file_exists("codes/$name.php")) {

View File

@ -339,7 +339,7 @@ class PHP_Highlight
// Format code
$source = $this->toArray($funcref);
$out = "<div class='code'>\n";
$out = "<div class='code'>";
foreach ($source as $i => $line) {
$out .= ' ';
@ -350,7 +350,7 @@ class PHP_Highlight
$out .= empty($line) ? '&nbsp;' : $line;
$out .= "<br />\n";
}
$out .= "</div>\n";
$out .= "</div>";
if ($return === true) {
return $out;

View File

@ -106,6 +106,9 @@ font-size: 14 px;
i {
color: #367FAC;
}
em {
color: #367FAC;
}
a {
color: #367FAC;
}