Commit 5b94c846 authored by Jonathan.Wage's avatar Jonathan.Wage

Removed manual module and redirected to existing manual.

parent 93f452cd
......@@ -17,7 +17,7 @@ download:
manual:
url: /documentation/manual
param: { module: manual, action: index }
param: { module: main, action: manual }
api_documentation:
url: /documentation/api
......
......@@ -18,6 +18,11 @@ class mainActions extends sfActions
{
}
public function executeManual()
{
$this->redirect('http://doctrine.pengus.net/doctrine_trunk/manual/new');
}
public function executeAbout()
{
......
<?php
/**
* manual actions.
*
* @package doctrine_website
* @subpackage manual
* @author Your name here
* @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
*/
class manualActions extends sfActions
{
/**
* Executes index action
*
*/
public function executeIndex()
{
error_reporting(E_ALL);
$trunk = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
$vendorPath = $trunk.DIRECTORY_SEPARATOR.'vendor';
$manualPath = $trunk.DIRECTORY_SEPARATOR.'manual';
$includePath = $vendorPath.PATH_SEPARATOR.$manualPath.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.'lib';
set_include_path($includePath);
require_once('Sensei/Sensei.php');
require_once('DocTool.php');
require_once('Cache.php');
spl_autoload_register(array('Sensei', 'autoload'));
// Executes the 'svn info' command for the current directory and parses the last
// changed revision.
$revision = 0;
exec('svn info .', $output);
foreach ($output as $line) {
if (preg_match('/^Last Changed Rev: ([0-9]+)$/', $line, $matches)) {
$revision = $matches[1];
break;
}
}
$cacheDir = './cache/';
$cacheRevFile = $cacheDir . 'revision.txt';
$cacheRev = 0;
$cache = new Cache($cacheDir, 'cache');
// Checks the revision cache files were created from
if (file_exists($cacheRevFile)) {
$cacheRev = (int) file_get_contents($cacheRevFile);
}
// Empties the cache directory and saves the current revision to a file, if SVN
// revision is greater than cache revision
if ($revision > $cacheRev) {
$cache->clear();
@file_put_contents($cacheRevFile, $revision);
}
if ($cache->begin()) {
$this->tool = new DocTool($manualPath.'/new/docs/en.txt');
// $this->tool->setOption('clean-url', true);
$baseUrl = '';
$title = 'Doctrine Manual';
$section = null;
if (isset($_GET['chapter'])) {
$section = $this->tool->findByPath($_GET['chapter']);
if ($this->tool->getOption('clean-url')) {
$baseUrl = '../';
}
}
if (isset($_GET['one-page'])) {
$this->tool->setOption('one-page', true);
$this->tool->setOption('max-level', 0);
$section = null;
$baseUrl = '';
}
if ($section) {
while ($section->getLevel() > 1) {
$section = $section->getParent();
}
$this->tool->setOption('section', $section);
$title .= ' - Chapter ' . $section->getIndex() . ' ' . $section->getName();
}
if ($this->tool->getOption('clean-url')) {
$this->tool->setOption('base-url', $baseUrl);
}
$cache->end();
}
}
}
\ No newline at end of file
default:
stylesheets: [main, layout, manual]
javascripts: [manual_toc, manual_tree, mootools.v1.11]
\ No newline at end of file
<?php if( $tool->getOption('section') || $tool->getOption('one-page') ): ?>
<h1>Table of Contents</h1>
<?php $tool->renderToc(); ?>
<p>
<?php if($tool->getOption('one-page')): ?>
<a href="<?php echo ($tool->getOption('clean-url') ? "chapter/" : '?chapter=') . $tool->findByIndex('1.')->getPath(); ?>">View one chapter per page</a>
<?php else: ?>
<a href="<?php echo ($tool->getOption('clean-url') ? "one-page" : '?one-page=1') . '#' . $tool->getOption('section')->getPath(); ?>">View all in one page</a>
<?php endif; ?>
</p>
<?php else: ?>
<p>
You can view this manual online as
<ul>
<li><a href="<?php echo $tool->getOption('clean-url') ? "one-page" : '?one-page=1'; ?>">everything on a single page</a></li>
<li><a href="<?php echo $tool->makeUrl($tool->findByIndex('1.')->getPath()); ?>">one chapter per page</a></li>
</ul>
</p>
<?php endif; ?>
\ No newline at end of file
<div id="manual">
<?php if( $tool->getOption('section') || $tool->getOption('one-page') ): ?>
<?php $tool->render(); ?>
<?php else: ?>
<h1>Table of Contents</h1>
<?php $tool->renderToc(); ?>
<?php endif; ?>
</div>
<?php slot('right'); ?>
<?php echo get_partial('table_of_contents', array('tool' => $tool)); ?>
<?php end_slot(); ?>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment