mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
Some more tweaks to documentation php code
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@572 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -4,8 +4,8 @@ require_once('./modules/mse-drupal-modules/autoformat.inc');
|
|||||||
|
|
||||||
global $nice_ff_names;
|
global $nice_ff_names;
|
||||||
$nice_ff_names = array(
|
$nice_ff_names = array(
|
||||||
'function' => 'Functions',
|
'Function' => 'Functions',
|
||||||
'type' => 'Types'
|
'Type' => 'Types'
|
||||||
);
|
);
|
||||||
|
|
||||||
define('FROMFILE_DIR', 'doc');
|
define('FROMFILE_DIR', 'doc');
|
||||||
@@ -55,8 +55,19 @@ function fromfile_page() {
|
|||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$file = implode('/', $args);
|
$file = implode('/', $args);
|
||||||
|
|
||||||
|
$file = str_replace('..','',$file);
|
||||||
// open file
|
// open file
|
||||||
$file = str_replace('.','',$file);
|
if (preg_match("/\.(png|jpg|gif)$/",$file,$type) && file_exists("$path/$file")) {
|
||||||
|
$type = $type[1];
|
||||||
|
if ($type == 'jpg') $type = 'jpeg';
|
||||||
|
header("Content-Type: image/$type");
|
||||||
|
if ($fd = fopen("$path/$file", 'rb')) {
|
||||||
|
fpassthru($fd);
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
echo "ERROR Opening image file";
|
||||||
|
}
|
||||||
|
}
|
||||||
$file1 = "$path/$file.txt";
|
$file1 = "$path/$file.txt";
|
||||||
$file2 = "$path/$file/index.txt";
|
$file2 = "$path/$file/index.txt";
|
||||||
$file1 = str_replace('//','/',$file1);
|
$file1 = str_replace('//','/',$file1);
|
||||||
@@ -80,7 +91,7 @@ function fromfile_page() {
|
|||||||
$breadcrumbs = array(l(t('Home'), NULL));
|
$breadcrumbs = array(l(t('Home'), NULL));
|
||||||
$path = FROMFILE_DIR;
|
$path = FROMFILE_DIR;
|
||||||
for ($i = -1 ; $i < count($args) ; ++$i) {
|
for ($i = -1 ; $i < count($args) ; ++$i) {
|
||||||
$path .= '/' . $args[$i];
|
if ($i != -1) $path .= '/' . $args[$i];
|
||||||
if ($i == count($args) - 1) {
|
if ($i == count($args) - 1) {
|
||||||
$name = $title;
|
$name = $title;
|
||||||
$name = preg_replace("/.*: ?/","",$name);
|
$name = preg_replace("/.*: ?/","",$name);
|
||||||
|
|||||||
@@ -139,6 +139,12 @@ function autoformat__handle(&$i, $prefix, $first, $fail_same = false) {
|
|||||||
$text .= "\n</pre>";
|
$text .= "\n</pre>";
|
||||||
$state = ']';
|
$state = ']';
|
||||||
|
|
||||||
|
// Html
|
||||||
|
} elseif (preg_match("@^</?(pre|ul|ol|li|div|blockquote|>)@", $line)) {
|
||||||
|
$line = preg_replace("@^<>@","",$line);
|
||||||
|
$text .= $line;
|
||||||
|
$state = '';
|
||||||
|
|
||||||
// Just text
|
// Just text
|
||||||
} else if ($fail_same && $autoformat__lines[$i-1]{$len-1} != ' ' && $text != '') {
|
} else if ($fail_same && $autoformat__lines[$i-1]{$len-1} != ' ' && $text != '') {
|
||||||
// consecutive * and # lines are different items
|
// consecutive * and # lines are different items
|
||||||
|
|||||||
Reference in New Issue
Block a user