예제 #1
0
파일: view.php 프로젝트: rair/yacs
    $context['page_title'] = i18n::s('Documentation:') . ' ' . $script;
} else {
    $context['page_title'] = i18n::s('View PHP documentation');
}
// no script has been provided -- help web crawlers
if (!$script) {
    Safe::header('Status: 404 Not Found', TRUE, 404);
    Logger::error(i18n::s('No script has been provided'));
    // the script has to be there
} elseif (!$row) {
    Safe::header('Status: 404 Not Found', TRUE, 404);
    Logger::error(i18n::s('Script does not exist'));
    // display script content
} else {
    $context['text'] = Codes::beautify($row['content']);
    // referrals, if any
    $context['components']['referrals'] =& Skin::build_referrals(Scripts::get_url($script));
    // update the menu bar
    if ($script != 'todo' && $script != 'authors' && $script != 'testers' && $script != 'licenses') {
        // browsing is safe
        $context['page_tools'][] = Skin::build_link(Scripts::get_url($script, 'browse'), i18n::s('Browse the source of this script'));
        // protect from spammers and robots
        if (Surfer::is_logged()) {
            $context['page_tools'][] = Skin::build_link(Scripts::get_url($script, 'fetch'), i18n::s('Fetch the script file'));
        }
    }
    // back to the index
    $context['page_tools'][] = Skin::build_link('scripts/', i18n::s('Server software'));
}
// render the skin
render_skin();
예제 #2
0
파일: index.php 프로젝트: rair/yacs
    }
    // offer to upgrade
    $context['text'] .= '<p>' . Skin::build_link('scripts/stage.php', i18n::s('Update the software')) . "</p>\n";
}
// get the page from the php documentation, if any
include_once 'phpdoc.php';
$item = PhpDoc::get('index');
if ($item) {
    // the list of things to do
    $context['page_tools'][] = Skin::build_link(Scripts::get_url('todo'), i18n::s('To do'), 'basic');
    // the list of testers
    $context['page_tools'][] = Skin::build_link(Scripts::get_url('testers'), i18n::s('Testers'), 'basic');
    // the list of authors
    $context['page_tools'][] = Skin::build_link(Scripts::get_url('authors'), i18n::s('Authors'), 'basic');
    // the list of licenses
    $context['page_tools'][] = Skin::build_link(Scripts::get_url('licenses'), i18n::s('Licenses'), 'basic');
    // splash message
    $text = '<p>' . i18n::s('Click on any link below to access the documentation extracted from each script (phpDoc).') . "</p>\n";
    // tree of links to documentation pages
    $text .= Codes::beautify($item['content']);
    // link to some other server
} else {
    $text = '<p>' . i18n::s('The complete documentation is available at the following server:') . '</p>';
    // link to the existing reference server, or to the original server
    if (!isset($context['reference_server']) || !$context['reference_server']) {
        $context['reference_server'] = i18n::s('www.yacs.fr');
    }
    $text .= '<p>' . Skin::build_link('http://' . $context['reference_server'] . '/', $context['reference_server'], 'external') . "</p>\n";
}
// documentation box
$context['text'] .= Skin::build_box(i18n::s('On-line Documentation'), $text);