示例#1
0
<?php

// get config files
require_once 'config.php';
require_once ABSPATH . '/users.php';
// get classes
require_once INC . '/user.class.php';
$user = new User();
// log in if form is being submitted
if (isset($_POST['login'])) {
    $user = new User($_POST['username'], $_POST['password']);
}
require_once INC . '/resources.class.php';
$resources = new Resources();
require_once INC . '/theme.class.php';
$theme = new Theme();
require_once INC . '/file-system.class.php';
require_once INC . '/markdown.class.php';
require_once INC . '/markdown-wiki.class.php';
require_once INC . '/functions.php';
register_default_resources();
if (file_exists(THEME . '/functions.php')) {
    include THEME . '/functions.php';
}
$wiki = new MarkdownWiki();
$wiki->handle_request();
        return Markdown($action->post->text, array($this, 'wikiLink'));
    }
    protected function renderEditForm($action)
    {
        if (!empty($action->post)) {
            $form = array('raw' => $action->post->text, 'updated' => $action->post->updated);
        } else {
            $form = array('raw' => $action->model->content, 'updated' => $action->model->updated);
        }
        return <<<HTML
<form action="{$action->base}{$action->page}" method="post">
\t<fieldset>
\t\t<legend>Editing</legend>
\t\t<label for="text">Content:</label><br>\t
\t\t<textarea cols="78" rows="20" name="text" id="text">{$form['raw']}</textarea>
\t\t<br>

\t\t<input type="submit" name="preview" value="Preview">
\t\t<input type="submit" name="save" value="Save">
\t\t<input type="hidden" name="updated" value="{$form['updated']}">
\t</fieldset>
</form>
HTML;
    }
}
if (!empty($_SERVER['REQUEST_URI'])) {
    # Dealing with a web request
    $wiki = new MarkdownWiki($config);
    $wiki->handleRequest();
    //print_r($wiki);
}