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"> </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)); } }
$use_camo = (bool) sfConfig::get('app_camo_use'); $camo_url = sfConfig::get('app_camo_url'); $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 . __(' :') . ' ' . $document_name : $document_name; echo display_title($document_name, $module); if (!$mobile_version) { echo '<div id="nav_space"> </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]); } } }
<?php use_helper('Date', 'History', 'MyForm', 'Language', 'Viewer', 'WikiTabs', 'SmartFormat', 'sfBBCode'); use_javascript('/static/js/diff.js', 'last'); use_javascript('/static/js/history_tools.js', 'last'); $is_moderator = $sf_user->hasCredential(sfConfig::get('app_credentials_moderator')); $module = $sf_context->getModuleName(); $model = c2cTools::module2model($module); $i18n_archive = $model . 'I18nArchive'; $lang = $sf_params->get('lang'); $id = $sf_params->get('id'); $table_list_even_odd = 0; $slug = make_slug($document[$i18n_archive]['name']); echo display_title(isset($title_prefix) ? $title_prefix . __(' :') . ' ' . $document_name : $document_name, $module); echo '<div id="nav_space"> </div>'; echo tabs_list_tag($id, $lang, $exists_in_lang, 'history', null, $slug, $nb_comments); echo display_content_top('doc_content'); echo start_content_tag($module . '_content'); ?> <p><?php echo __('Viewing history from %1% in %2%', array('%1%' => $document_name, '%2%' => format_language_c2c($lang))); ?> </p> <p><?php echo __('Legend:') . ' * = ' . __('current version') . ', <strong>' . __('minor_tag') . '</strong> = ' . __('minor modification'); ?> </p> <?php echo form_tag("@document_diff_post?module={$module}&id={$id}&lang={$lang}", array('method' => 'post'));
include_partial('documents/welcome', array('sf_cache_key' => $id . '_' . $culture . '_' . $lang, 'title' => $title, 'description' => $abstract, 'default_open' => true)); include_partial('documents/wizard_button', array('sf_cache_key' => ($is_connected ? 'connected' : 'not_connected') . '_' . $culture)); if ($has_images && $has_map) { $image_url_params = $sf_data->getRaw('image_url_params'); $image_url_params = implode('&', $image_url_params); $custom_title_link = 'images/list'; $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');
<?php use_helper('Diff', 'Date', 'Language', 'Viewer', 'WikiTabs', 'SmartFormat', 'sfBBCode'); $version = $new_document->getVersion() != $current_version ? $new_document->getVersion() : NULL; $id = $sf_params->get('id'); $lang = $sf_params->get('lang'); $module = $sf_context->getModuleName(); $mobile_version = c2cTools::mobileVersion(); echo display_title(isset($title_prefix) ? $title_prefix . __(' :') . ' ' . $new_document->get('name') : $new_document->get('name'), $module); if (!$mobile_version) { echo '<div id="nav_space"> </div>'; echo tabs_list_tag($id, $lang, 1, 'history', null, get_slug($new_document), $nb_comments); } echo display_content_top('doc_content'); echo start_content_tag($module . '_content'); ?> <p> <?php echo __('Diffing versions of %1% in %2%.', array('%1%' => isset($title_prefix) ? $title_prefix . __(' :') . ' ' . $new_document->get('name') : $new_document->get('name'), '%2%' => format_language_c2c($new_document->getCulture()))); echo ' <strong>' . __('minor_tag') . '</strong> = ' . __('minor modification'); ?> </p> <?php $documents = array('old' => $old_document, 'new' => $new_document); $metadatas = array('old' => $old_metadata, 'new' => $new_metadata); ?> <table class="diff_metas"> <tr> <?php
$linked_name = $linked_doc->get('name'); $linked_module = $linked_doc->get('module'); } else { $linked_with = 0; } if (!$new_document) { echo display_title(isset($title_prefix) ? $title_prefix . __(' :') . ' ' . $document_name : $document_name, $module); if (!$mobile_version) { echo '<div id="nav_space"> </div>'; echo tabs_list_tag($id, $lang, $document->isAvailable(), 'edit', $version, get_slug($document), $nb_comments); } } else { echo display_title(__("Creating new {$module}"), $module); if (!$mobile_version) { echo '<div id="nav_space"> </div>'; echo tabs_list_tag($id, $document->getCulture(), $document->isAvailable(), '', NULL, get_slug($document), 0); } } echo display_content_top('doc_content'); echo start_content_tag($module . '_content'); // display warning if editing from an archive version if (!empty($editing_archive)) { echo '<p class="warning_message">', __('Warning: you are editing an archive version!'), '</p>'; } if ($new_document && $linked_with) { ?> <p class="warning_message"> <?php echo smart_format(__("This new {$module} will be linked with {$linked_module} '[[{$linked_module}/%2%|%1%]]' (document %2%)", array('%1%' => $linked_name, '%2%' => $linked_with))); ?> </p>