com web/doc: First step of site design unification: .gitignore include/lib_general.inc.php templates/all/www/shared/fo oter.tpl.php
templates/all/www/shared/header.tpl.php templates/all/www/shared/nav_languages.tpl.php templ ates/all/www/shared/nav_links.tpl.php templates/all/www
/shared/nav_projects.tpl.php

From: Date: Wed, 19 Mar 2014 05:35:57 +0000
Subject: com web/doc: First step of site design unification: .gitignore include/lib_general.inc.php templates/all/www/shared/fo oter.tpl.php
templates/all/www/shared/header.tpl.php templates/all/www/shared/nav_languages.tpl.php templ ates/all/www/shared/nav_links.tpl.php templates/all/www
/shared/nav_projects.tpl.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-2314@lists.php.net to get a copy of this message
Commit: dd349b519bdea16f89467dcdd8ab30663b83a547 Author: Sobak <msobaczewski@gmail.com> Wed, 19 Mar 2014 06:35:57 +0100 Parents: 47f7007318ea0c47a943ab569fa3cfa7b41cbac2 Branches: master Link: http://git.php.net/?p=web/doc.git;a=commitdiff;h=dd349b519bdea16f89467dcdd8ab30663b83a547 Log: First step of site design unification Changed paths: M .gitignore M include/lib_general.inc.php D templates/all/www/shared/footer.tpl.php D templates/all/www/shared/header.tpl.php D templates/all/www/shared/nav_languages.tpl.php D templates/all/www/shared/nav_links.tpl.php D templates/all/www/shared/nav_projects.tpl.php

diff --git a/.gitignore b/.gitignore index 54ef412..70df279 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ diff .project project.index sqlite/*sqlite +shared \ No newline at end of file diff --git a/include/lib_general.inc.php b/include/lib_general.inc.php index d027ac9..99e5116 100644 --- a/include/lib_general.inc.php +++ b/include/lib_general.inc.php @@ -37,85 +37,30 @@ function get_svn_dir($project) return $GLOBALS['PROJECTS'][$project][1] . '/'; } -function site_header($title = '', $style = array()) +function site_header($full_screen = false) { - define('IN_HEAD', true); - $lang = 'en'; //LANGC; - $encoding = 'UTF-8'; - $page_title = ($title ? $GLOBALS['Language']->get($title) . ' - ' : '') . $GLOBALS['Language']->get('docweb.common.title.default'); - $h1 = ($title ? $GLOBALS['Language']->get($title) : $GLOBALS['Language']->get('docweb.common.title.default')); - list($page_h1) = explode("\n", wordwrap($h1, 50, "...\n")); - - $languages = site_nav_langs(); - $projects = site_nav_projects(); - - $langdisplay = $GLOBALS['LANGUAGES'][LANGC]; - $projdisplay = $GLOBALS['PROJECTS'][SITE][0]; - // this will prevent 404 errors - $project = (in_array(SITE, array('www', 'phd')) ? 'php' : SITE); - $locallinks = site_nav_provider(); - $extlinks = ext_nav_provider(); - - $extra_style = ''; - // prevent errors - $guess_style = (SITE == 'www') ? '' : SITE . '.css'; - $styles = array_filter(($style ? array($style) : array($guess_style))); - - // Set proper encoding with HTTP header first - header("Content-type: text/html; charset=$encoding"); - - // bugs for count - if ($bugs = get_bug_count()) { - $showBugs = true; - $bugCount = $bugs['count']; - $bugsLink = $bugs['link']; - } else { - $showBugs = $bugCount = $bugsLink = false; - } - - return DocWeb_Template::get( - 'shared/header.tpl.php', - array( - 'encoding' => $encoding, - 'lang' => $lang, - 'project' => $project, - 'page_h1' => $page_h1, - 'styles' => $styles, - 'projects' => $projects, - 'languages' => $languages, - 'projdisplay' => $projdisplay, - 'langdisplay' => $langdisplay, - 'locallinks' => $locallinks, - 'extlinks' => $extlinks, - 'page_title' => $page_title, - 'showBugs' => $showBugs, - 'bugCount' => $bugCount, - 'bugsLink' => $bugsLink, - ) + $TITLE = 'Documentation Tools'; + $SUBDOMAIN = 'doc'; + $LINKS = array( + array('href' => '/revcheck.php', 'text' => 'Documentation Tools'), + array('href' => '/dochowto/', 'text' => 'Documentation Howto'), + array('href' => '/phd/', 'text' => 'PhD Homepage'), ); -} -function site_nav_projects() -{ - return DocWeb_Template::get('shared/nav_projects.tpl.php'); -} + require __DIR__ . '/../shared/templates/header.inc'; -function site_nav_langs() -{ - return DocWeb_Template::get( - 'shared/nav_languages.tpl.php', - array('languages' => $GLOBALS['LANGUAGES']) - ); + if ($full_screen) { + echo '<section class="fullscreen">'; + } + else { + echo '<section class="mainscreen">'; + } } -function site_footer($svn_version = NULL) +function site_footer($SECONDSCREEN = false) { - $master = get_insite_address(NULL, NULL, ''); - return DocWeb_Template::get( - 'shared/footer.tpl.php', - array('master' => $master, - 'svn_version' => $svn_version) - ); + echo '</section>'; + require __DIR__ . '/../shared/templates/footer.inc'; } // Format email address for spam protection @@ -174,66 +119,6 @@ function get_resource_url($url = '') return "/$url"; } -// This function provides the relevant insite navigation options for the -// particular page the user is viewing currently -function site_nav_provider() -{ - $links['subsite-homepage'] = BASE_URL . '/'; - if (in_array(SITE, array('gtk', 'pear', 'php'))) { - $links['rev-check'] = BASE_URL .'/revcheck.php'; - } - if (SITE == 'php') { - $links['doc-howto'] = BASE_URL . '/dochowto/index.php'; -// FIXME: Disabled until livedocs requirement is removed -// $links['entities'] = BASE_URL . '/entities.php'; - } - - switch(SITE) { - case 'php': - case 'pear': - case 'gtk': - $links['checkent'] = BASE_URL . '/checkent.php'; - break; - } - - // English only - if ((LANGC == 'all' || LANGC == 'en') && SITE == 'php') { - $links['orphan-notes'] = BASE_URL . '/orphan_notes.php'; - $links['notes-stats'] = BASE_URL . '/notes_stats.php'; - $links['undoc-functions'] = BASE_URL . '/undoc_functions.php'; - $links['missing-examples'] = BASE_URL . '/missing_examples.php'; - $links['phpt-generator'] = BASE_URL . '/phpt_generator.php'; - } - - return DocWeb_Template::get( - 'shared/nav_links.tpl.php', - array('links' => $links, 'Language' => &$GLOBALS['Language']) - ); -} - -// This function provides the relevant offsite navigation options for the -// particular page the user is viewing currently -function ext_nav_provider() -{ - $links = array(); - switch (SITE) { - case 'php': - switch (LANGC) { - case 'hu': - $links['translation-info'] = 'http://wfsz.njszt.hu/projektek_phpdoc.php'; - break; - case 'it': - $links['translation-info'] = 'http://cortesi.com/php/'; - break; - } - break; - } - return DocWeb_Template::get( - 'shared/nav_links.tpl.php', - array('links' => $links, 'Language' => &$GLOBALS['Language']) - ); -} - function get_bug_count ($project=SITE) { $localFile = FILES_DIR . "bugs_{$project}.count"; diff --git a/templates/all/www/shared/footer.tpl.php b/templates/all/www/shared/footer.tpl.php deleted file mode 100644 index b1d41bc..0000000 --- a/templates/all/www/shared/footer.tpl.php +++ /dev/null @@ -1,17 +0,0 @@ - </div> - <div id="footer"> - <p> - <a href="http://php.net/copyright.php">&docweb.common.footer.copyright;</a> 2004-2014 &docweb.common.footer.copyright-text;. - </p> - <?php - if(isset($cvs_version)) { - echo "<p>\n $cvs_version\n </p>\n "; - } - ?><p> - <a href="http://php.net/credits.php">&docweb.common.footer.credits;</a> - | - <a href="http://php.net/contact.php">&docweb.common.footer.contact;</a> - </p> - </div> -</body> -</html> diff --git a/templates/all/www/shared/header.tpl.php b/templates/all/www/shared/header.tpl.php deleted file mode 100644 index c3ea735..0000000 --- a/templates/all/www/shared/header.tpl.php +++ /dev/null @@ -1,45 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" lang="<?php echo $lang; ?>"> -<head> - <title><?php echo $page_title; ?></title> - <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $encoding; ?>" /> - <link rel="icon" href="/images/favicon/<?php echo $project; ?>/favicon.ico" /> - <link rel="stylesheet" type="text/css" href="/style/site.css" /> - <?php - foreach ($styles as $style_file) { - echo '<link rel="stylesheet" type="text/css" href="/style/' . $style_file . '" />' . "\n"; - } - ?> -</head> -<body> - <div id="header"> - <h1><?php echo $page_h1; ?></h1> - <div id="logos"> - <?php echo $projects; ?> - </div> - </div> - <div id="langs"> - <?php echo $languages; ?> - </div> - <div id="page"> - <div id="sidebar"> - <div class="sidebox"> - <dl> - <dt>&docweb.common.header.currently-focused;</dt> - <dd><?php echo $projdisplay; ?> | <?php echo $langdisplay; - if (LANGC != 'all') { - echo '&nbsp;<span class="Flag"><img src="/images/flags/' . - LANGC .'.png" alt="'. LANGD . '" title="' . LANGD . '" /></span>'; - } - ?></dd> - <dt>&docweb.common.header.insite-context-nav;</dt> - <dd><?php echo $locallinks; ?></dd> - <dt>&docweb.common.header.offsite-context-nav;</dt> - <dd><?php echo $extlinks; ?></dd> - <?php if ($showBugs) { ?> - <dt>&docweb.common.header.project-doc-bugs;</dt> - <dd><a href="<?php echo $bugsLink; ?>"><?php echo $bugCount; ?> &docweb.common.header.open-bugs;</a></dd> - <?php } ?> - </dl> - </div> - </div> diff --git a/templates/all/www/shared/nav_languages.tpl.php b/templates/all/www/shared/nav_languages.tpl.php deleted file mode 100644 index ed59efe..0000000 --- a/templates/all/www/shared/nav_languages.tpl.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -echo "&nbsp;"; // required for proper positioning of the active background -foreach ($languages as $code => $name) { - - if (LANGC == $code) { - echo '<span class="active"></span><a class="active" '; - } else { - echo '<a '; - } - - if ($code == 'all') { - echo 'href="' . get_insite_address(NULL, 'all') . '">&docweb.common.all;</a>&nbsp;'."\n"; - } - else { - - // Show specific country flags when language/country codes differ - $alt_flags = array( - 'fa' => 'ir', - ); - $flag_code = isset($alt_flags[$code]) ? $alt_flags[$code] : $code; - - // @@@ TODO: translate/entity names - - echo 'href="' . get_insite_address(NULL, $code) . '" title="' . $name . '" ><img src="/images/flags/' . $flag_code . '.png" alt="' . $name . '" /></a>'."\n"; - } -} -?> \ No newline at end of file diff --git a/templates/all/www/shared/nav_links.tpl.php b/templates/all/www/shared/nav_links.tpl.php deleted file mode 100644 index f432e45..0000000 --- a/templates/all/www/shared/nav_links.tpl.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -if ($links) { - foreach ($links AS $linkName => $url) { - echo '<a href="'. $url ."\">&docweb.common.linkname.$linkName;</a><br />\n"; - } -} else { - echo "&docweb.common.n-a;<br />\n"; -} -?> \ No newline at end of file diff --git a/templates/all/www/shared/nav_projects.tpl.php b/templates/all/www/shared/nav_projects.tpl.php deleted file mode 100644 index 603bf1d..0000000 --- a/templates/all/www/shared/nav_projects.tpl.php +++ /dev/null @@ -1,3 +0,0 @@ - <a href="<?php echo get_insite_address('www'); ?>" class="logo logo-all">&docweb.common.all;</a> - <a href="<?php echo get_insite_address('php'); ?>" class="logo logo-php">&docweb.common.project.php;</a> - <a href="<?php echo get_insite_address('phd'); ?>" class="logo logo-phd">&docweb.common.project.phd;</a>
« previous php.doc.web (#2314) next »