function display_page_header($module, $document, $id, $metadata, $current_version, $options = array())
{
    $is_archive = $document->isArchive();
    $mobile_version = c2cTools::mobileVersion();
    $content_class = $module . '_content';
    $lang = $document->getCulture();
    $version = $is_archive ? $document->getVersion() : NULL;
    $slug = '';
    $prepend = _option($options, 'prepend', '');
    $separator = _option($options, 'separator', '');
    $nav_options = _option($options, 'nav_options');
    $item_type = _option($options, 'item_type', '');
    $nb_comments = _option($options, 'nb_comments');
    $creator_id = _option($options, 'creator_id');
    if (!$is_archive) {
        if ($module != 'users') {
            $slug = get_slug($document);
            $url = "@document_by_id_lang_slug?module={$module}&id={$id}&lang={$lang}&slug={$slug}";
        } else {
            $url = "@document_by_id_lang?module={$module}&id={$id}&lang={$lang}";
        }
    } else {
        $url = "@document_by_id_lang_version?module={$module}&id={$id}&lang={$lang}&version={$version}";
    }
    if (!empty($prepend)) {
        $prepend .= $separator;
    }
    echo display_title($prepend . $document->get('name'), $module, true, 'default_nav', $url);
    if (!$mobile_version) {
        echo '<div id="nav_space">&nbsp;</div>';
        sfLoader::loadHelpers('WikiTabs');
        $tabs = tabs_list_tag($id, $lang, $document->isAvailable(), 'view', $version, $slug, $nb_comments);
        echo $tabs;
        // liens internes vers les sections repliables du document
        if ($nav_options == null) {
            include_partial("{$module}/nav_anchor");
        } else {
            include_partial("{$module}/nav_anchor", array('section_list' => $nav_options));
        }
        // boutons vers des fonctions annexes et de gestion du document
        include_partial("{$module}/nav", isset($creator_id) ? array('id' => $id, 'document' => $document, 'creator_id' => $creator_id) : array('id' => $id, 'document' => $document));
        if ($module != 'users') {
            sfLoader::loadHelpers('Button');
            echo '<div id="nav_share" class="nav_box">' . button_share() . '</div>';
        }
    }
    echo display_content_top('doc_content', $item_type);
    echo start_content_tag($content_class);
    if ($merged_into = $document->get('redirects_to')) {
        include_partial('documents/merged_warning', array('merged_into' => $merged_into));
    }
    if ($is_archive) {
        include_partial('documents/versions_browser', array('id' => $id, 'document' => $document, 'metadata' => $metadata, 'current_version' => $current_version));
    }
}
<?php

use_helper('Viewer', 'MyForm', 'Button');
echo display_title();
echo display_content_top('no_nav');
echo start_content_tag();
?>
    <h1><?php 
echo __('404_error');
?>
</h1>
    <p><?php 
echo __('The page you are trying to reach is no longer available.');
?>
</p>

    <p><?php 
echo __('You can:');
?>
</p>

    <ul class="list404">
        <li><?php 
echo __('Try a site search:');
?>
&nbsp;<?php 
include_partial('common/search_form', array('autocomplete' => false, 'prefix' => '_404'));
?>
</li>
        <li><?php 
echo link_to(__('Go to the homepage'), '@homepage');
<?php

use_helper('Pagination', 'Field', 'Viewer');
$id = $sf_params->get('id');
$lang = $sf_params->get('lang');
$module = $sf_context->getModuleName();
echo display_title(__($module . ' list'), $module, false);
echo '<div id="nav_space">&nbsp;</div>';
include_partial("{$module}/nav4list");
echo display_content_top('list_content');
echo start_content_tag($module . '_content');
if (!isset($items) || count($items) == 0) {
    echo __('there is no %1% to show', array('%1%' => __('outings')));
} else {
    $pager_navigation = pager_navigation($pager);
    echo $pager_navigation;
    ?>
<ul class="clear">
    <?php 
    foreach ($items as $item) {
        ?>
    <li><?php 
        include_partial($module . '/list_full', array('item' => $item));
        ?>
    </li>
    <?php 
    }
    ?>
</ul>
<?php 
    echo $pager_navigation;
$camo_key = sfConfig::get('app_camo_key');
// load needed strings from PunBB
@(include PUN_ROOT . 'lang/' . __('meta_language_forum') . '/common.php');
$module = $sf_context->getModuleName();
$lang = $sf_params->get('lang');
$id = $sf_params->get('id');
$mobile_version = c2cTools::mobileVersion();
require_once PUN_ROOT . 'include/parser.php';
$nb_comments = $comments->count();
$document_name = isset($title_prefix) ? $title_prefix . __('&nbsp;:') . ' ' . $document_name : $document_name;
echo display_title($document_name, $module);
if (!$mobile_version) {
    echo '<div id="nav_space">&nbsp;</div>';
    echo tabs_list_tag($id, $lang, $exists_in_lang, 'comments', NULL, $module != 'users' ? make_slug($document_name) : '', $nb_comments);
}
echo display_content_top('doc_content');
echo start_content_tag($module . '_content');
if ($nb_comments > 0) {
    $topic_id = $comments->getFirst()->topic_id;
    $uri_anchor = explode('#', $_SERVER['REQUEST_URI'], 2);
    $post_id = 0;
    if (count($uri_anchor) > 1) {
        $post_anchor = $uri_anchor[1];
        if (strpos($post_anchor, 'p') === 0) {
            if (preg_match('#p([0-9]+)#si', $post_anchor, $post_id_match)) {
                $post_id = intval($post_id_match[1]);
            }
        }
    }
    $is_new = $post_id > 0 && isset($_GET['new']);
    $bg_switch = true;
        $custom_rss_link = 'images/rss';
        if (!empty($image_url_params)) {
            $custom_title_link .= '?' . $image_url_params;
            $custom_rss_link .= '?' . $image_url_params;
        }
        include_partial('images/latest', array('items' => $latest_images, 'culture' => $culture, 'default_open' => true, 'custom_title_link' => $custom_title_link, 'custom_rss_link' => $custom_rss_link, 'home_section' => false));
    }
    include_partial('documents/prepare', array('sf_cache_key' => $culture, 'default_open' => true));
    if ($is_moderator) {
        $tabs = tabs_list_tag($id, $document->getCulture(), $document->isAvailable(), 'view', $is_not_archive ? NULL : $document->getVersion(), get_slug($document), $nb_comments);
        echo $tabs;
    }
    include_partial('portals/nav', array('id' => $id, 'document' => $document));
    echo '<div id="nav_share" class="nav_box">' . button_share() . '</div>';
}
echo display_content_top('home');
echo start_content_tag('portals_content', true);
if ($merged_into = $document->get('redirects_to')) {
    include_partial('documents/merged_warning', array('merged_into' => $merged_into));
}
if (!$is_not_archive) {
    include_partial('documents/versions_browser', array('id' => $id, 'document' => $document, 'metadata' => $metadata, 'current_version' => $current_version));
}
if ($has_map && !$mobile_version) {
    $map_filter = $sf_data->getRaw('map_filter');
    include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document, 'layers_list' => $map_filter['objects'], 'center' => $map_filter['center'], 'height' => $map_filter['height'], 'show_map' => true, 'has_geom' => $has_geom));
} elseif ($has_images) {
    echo '<div id="last_images">';
    $image_url_params = $sf_data->getRaw('image_url_params');
    $image_url_params = implode('&', $image_url_params);
    $custom_title_link = 'images/list';
<div id="nav_tools">
    <div id="nav_tools_top"></div>
    <div id="nav_tools_content">
        <ul>
            <li><?php 
    echo link_to(__('Back to list'), "@default_index?module={$module}", array('class' => 'action_back nav_edit'));
    ?>
            </li>
        </ul>
    </div>
    <div id="nav_tools_down"></div>
</div>

<?php 
}
echo display_content_top('filter_content');
echo start_content_tag($module . '_content');
echo form_tag("/{$module}/filterredirect", array('id' => 'filterform'));
$perso = c2cPersonalization::getInstance();
$personalization_applied = false;
$perso_on = $perso->isMainFilterSwitchOn();
$has_perso_activities = !count($activities) && count($perso->getActivitiesFilter());
$has_perso_areas = !count($selected_areas) && !count($coords) && count($perso->getPlacesFilter());
switch ($module) {
    // We use activities and areas personalization for the following modules
    case 'books':
    case 'huts':
    case 'routes':
    case 'outings':
    case 'users':
        if ($perso_on) {
<?php

use_helper('Pagination', 'Form', 'Language', 'MyForm', 'Viewer');
$module = $sf_context->getModuleName();
echo display_title(__('Search a ' . $module), $module);
if (!c2cTools::mobileVersion()) {
    echo '<div id="nav_space">&nbsp;</div>';
    include_partial('documents/nav4list');
}
echo display_content_top();
echo start_content_tag($module . '_content');
// TODO simplify this
echo format_number_choice('[0] No result found|(1,+Inf]Found %nb_result% results for %researched_word%', array('%nb_result%' => 0, '%researched_word%' => '"' . $sf_params->get('q') . '"'), 0);
include_partial('common/search_form', array('autocomplete' => false, 'prefix' => '_'));
echo '<br /><p>' . link_to(__('Advanced search'), '@filter?module=' . $module) . '</p>';
include_partial("documents/google_result", array('module' => $module, 'query_string' => $query_string));
echo end_content_tag();
include_partial('common/content_bottom');