Ejemplo n.º 1
0
    $template = Template::create('admin_frame');
    $template->parse($content);
}
/*
 * When first loading the page, show options.
 */
if (count($_POST) === 0) {
    if (count($_GET) === 0) {
        $body = '<iframe id="content" src="?page=parse&amp;noframe=1"></iframe>';
    } elseif ($_GET['page'] == 'parse') {
        $body = show_admin_forms();
    }
} elseif ($_POST['action'] == 'empty') {
    echo 'Emptying the database<br />';
    flush();
    $parser->clear_db();
    echo 'Emptying the index<br />';
    flush();
    $parser->clear_index();
    echo 'Done<br />';
} elseif ($_POST['action'] == 'parse') {
    define('EXPORT_IN_PROGRESS', true);
    echo 'Beginning import<br />';
    flush();
    ob_flush();
    /*
     * Step through each parser method.
     */
    if ($parser->test_environment() !== FALSE) {
        echo 'Environment test succeeded<br />';
        if ($parser->populate_db() !== FALSE) {