Update of /cvsroot/fink/experimental/babayoshihiko/web
In directory sc8-pr-cvs17:/tmp/cvs-serv12175

Modified Files:
        header.inc 
Added Files:
        fink.i18n.js finkdoc-website.i18n.xsl finkdoc.dtd finkfaq.dtd 
        i18n_form.php 
Log Message:
new translation support system

--- NEW FILE: i18n_form.php ---
<?
/* $Id: i18n_form.php,v 1.1 2007/06/03 11:05:42 babayoshihiko Exp $ */
// +--------------------------------------------------------------------------+
// | i18n_form.php                                                            |
// +--------------------------------------------------------------------------+
// | Copyright (c)                                                            |
// +--------------------------------------------------------------------------+
// | License:  GNU/GPL - http://www.gnu.org/copyleft/gpl.html                 |
// +--------------------------------------------------------------------------+
// | Used by all the PHP files at http://www.finkproject.org                  |
// |    to produce the headers (incl HTML headers and top parts)              |
// |                                                                          |
// | usage:    1. read the comments                                           |
// |           2. include this file before outputting anything                |
// +--------------------------------------------------------------------------+
// | issues:                                                                  |
// |                                                                          |
// |                                                                          |
// +--------------------------------------------------------------------------+

function WriteLog($translated){
        // Save log in the server
        $File = 
"/private/var/tmp/translation_$document_$chapter_$section.$lang.$id.txt"; 
        $Handle = fopen($File, 'w');
        
        fwrite($Handle, "$translated\n");
        fclose($Handle);
}

function SendEmail($translated){
// Email to fink-i18n
// Your email address
$toemail = "[EMAIL PROTECTED]";
$subject = "[Translated] ($tr_lang)";
$message = $translated;

mail($toemail, $subject, $message, "From: [EMAIL PROTECTED]");
}


$document = $_POST["document"];
$chapter = $_POST["chapter"];
$section = $_POST["section"];
$tr_lang = $_POST["lang"];
$id = $_POST["id"];
$original = $_POST["original"];
$translated = $_POST["translated"];

?>

<html>
<head>
<meta http-equiv="refresh" content="5;url=<? echo $_SERVER["HTTP_REFERER"];?>">
</head><body>

<p>
Thank you for your effort! We will check and update as soon as possible. (Fink 
Translation Team)
</p>

</body></html>

--- NEW FILE: finkdoc-website.i18n.xsl ---
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.1">

<!-- set the variables used throughout the document -->
<xsl:variable name="lang-ext" ><xsl:value-of select="document/@lang" 
/></xsl:variable>

<!-- just a dummy, everything is written with xsl:document -->
<xsl:output method="text"/>

<!-- ***** whole document (renders contents page) ***** -->

<xsl:template match="document">

<xsl:document href="[EMAIL PROTECTED]" method="html" indent="no" 
encoding="utf-8">
<xsl:text disable-output-escaping="yes">&lt;? include_once 
"</xsl:text><xsl:value-of select="@fsroot"/><xsl:text 
disable-output-escaping="yes">phpLang.inc.php"; ?&gt;</xsl:text>
</xsl:document>

<xsl:document href="[EMAIL PROTECTED]" method="html" indent="no" 
encoding="utf-8">
<html><head>
<title><xsl:value-of select="shorttitle"/></title>
<link rel="contents" href="[EMAIL PROTECTED]" title="{shorttitle} Contents" />
<link rel="next" href="{chapter/@filename}.php?phpLang={$lang-ext}" 
title="{chapter/title}" />
</head><body>
<xsl:text disable-output-escaping="yes">&lt;!--?
include_once "header.</xsl:text><xsl:value-of select="$lang-ext"/><xsl:text 
disable-output-escaping="yes">.inc";
?--&gt;
</xsl:text>

<h1><xsl:value-of select="title"/></h1>

<xsl:apply-templates select="preface" />

<!-- start TOC -->

<h2><xsl:text>{FINK_CONTENTS}</xsl:text></h2>

<ul><xsl:text>
        </xsl:text>
        <xsl:for-each select="chapter">
        <li>
                <a><xsl:attribute name="href"><xsl:value-of 
select="@filename"/><xsl:text>.php?phpLang=</xsl:text><xsl:value-of 
select="$lang-ext" /></xsl:attribute>
                        <b><xsl:number format="1 " /><xsl:value-of 
select="title" /></b>
                </a>
                <ul>
                <xsl:for-each select="faqentry|section">
                        <li>
                        <a><xsl:attribute name="href">
                        <xsl:value-of select="../@filename" 
/><xsl:text>.php?phpLang=</xsl:text><xsl:value-of select="$lang-ext" 
/><xsl:text>#</xsl:text><xsl:value-of select="@name" />
                        </xsl:attribute>
                        <xsl:number count="chapter" format="1." /><xsl:number 
format="1 " />
                                <xsl:for-each select="question/p">
                                <xsl:if test='position() = 
1'><xsl:call-template name="plain"/></xsl:if>
                                </xsl:for-each>
                                <xsl:value-of select="title" />
                        </a>
                        </li>
                </xsl:for-each>
                </ul>
        </li>
        </xsl:for-each>
</ul>

<!-- end TOC -->

<xsl:apply-templates select="cvsid" />

<xsl:apply-templates select="chapter" />

<xsl:text disable-output-escaping="yes">
&lt;!--? include_once "</xsl:text><xsl:value-of select="@fsroot"/><xsl:text 
disable-output-escaping="yes">footer.inc"; ?--&gt;</xsl:text>
</body></html>
</xsl:document>

<!-- Generate language specific header include file -->
<xsl:document href="[EMAIL PROTECTED]:base}header.{$lang-ext}.inc" 
method="text" indent="no" encoding="utf-8">
<xsl:text disable-output-escaping="yes">&lt;?</xsl:text><xsl:text> 
/* This file is generated, do not edit manually! */

$section = "</xsl:text><xsl:value-of select="@section"/><xsl:text>";
$parents = array("doc/index.php", "Document List");
$navbox = array(
  "</xsl:text>
<xsl:value-of select="$DESTDIR"/>
<xsl:text>index.php?phpLang=</xsl:text><xsl:value-of 
select="$lang-ext"/><xsl:text>", "Contents",
</xsl:text>
<xsl:for-each select="chapter">
<xsl:text>  "</xsl:text><xsl:value-of select="$DESTDIR"/><xsl:value-of 
select="@filename"/><xsl:text>.php?phpLang=</xsl:text><xsl:value-of 
select="$lang-ext"/><xsl:text>", "</xsl:text>
<xsl:value-of select="shorttitle"/>
<xsl:text>",
</xsl:text>
</xsl:for-each>
<xsl:text>);
$printlink = "</xsl:text>
<xsl:value-of select="$DESTDIR"/><xsl:value-of 
select="$PRINTFILE"/><xsl:text>.</xsl:text><xsl:value-of select="$lang-ext"/>
<xsl:text>.html";

$fsroot = $root = "</xsl:text><xsl:value-of select="@fsroot"/><xsl:text>";
include $fsroot."header.inc";
</xsl:text><xsl:text disable-output-escaping="yes"> ?&gt;</xsl:text>
</xsl:document>

</xsl:template>

<!-- ***** chapter (renders to a separate file) ***** -->

<xsl:template match="chapter">
<xsl:document href="[EMAIL PROTECTED]" method="html" indent="no" 
encoding="utf-8">
<xsl:text disable-output-escaping="yes">&lt;? include_once 
"</xsl:text><xsl:value-of select="../@fsroot"/><xsl:text 
disable-output-escaping="yes">phpLang.inc.php"; ?&gt;</xsl:text>
</xsl:document>

<xsl:document href="[EMAIL PROTECTED]" method="html" indent="no" 
encoding="utf-8">
<html><head>
<!-- this will be seen and then removed by postprocess.pl -->
<xsl:value-of select="../cvsid" />
<title><xsl:value-of select="../shorttitle"/><xsl:text> - 
</xsl:text><xsl:value-of select="shorttitle"/></title>
<link rel="contents" href="{../@filename}.php?phpLang={$lang-ext}" 
title="{../shorttitle} Contents" />

<xsl:for-each select="following-sibling::chapter">
<xsl:if test="position()=1">
<link rel="next" href="[EMAIL PROTECTED]" title="{title}" />
</xsl:if>
</xsl:for-each>

<xsl:for-each select="preceding-sibling::chapter">
<xsl:if test="position()=last()">
<link rel="prev" href="[EMAIL PROTECTED]" title="{title}" />
</xsl:if>
</xsl:for-each>
<xsl:if test="position()=1">
<link rel="prev" href="{../@filename}.php?phpLang={$lang-ext}" 
title="{../shorttitle} Contents" />
</xsl:if>

</head><body>
<xsl:text disable-output-escaping="yes">&lt;!--?
include_once "header.</xsl:text><xsl:value-of select="$lang-ext"/><xsl:text 
disable-output-escaping="yes">.inc";
?--&gt;
</xsl:text>

<h1><xsl:value-of select="../shorttitle"/><xsl:text> - </xsl:text><xsl:number 
format="1. " /><xsl:value-of select="title"/></h1>

<xsl:apply-templates/>

<xsl:for-each select="following-sibling::chapter">
<xsl:if test="position()=1">
<p align="right">
<xsl:text>{FINK_NEXT}</xsl:text>:
<a href="[EMAIL PROTECTED]"><xsl:number format="1. " /><xsl:value-of 
select="title" /></a>
</p>
</xsl:if>
</xsl:for-each>

<xsl:text disable-output-escaping="yes">
&lt;!--? include_once "</xsl:text><xsl:value-of select="../@fsroot"/><xsl:text 
disable-output-escaping="yes">footer.inc"; ?--&gt;
</xsl:text>
</body></html>
</xsl:document>
</xsl:template>

<!-- ***** article (renders all on one page) ***** -->

<xsl:template match="article">
<xsl:document href="[EMAIL PROTECTED]" method="html" indent="no" 
encoding="utf-8">
<xsl:text disable-output-escaping="yes">&lt;? include_once 
"</xsl:text><xsl:value-of select="@fsroot"/><xsl:text 
disable-output-escaping="yes">phpLang.inc.php"; ?&gt;</xsl:text>
</xsl:document>

<xsl:document href="[EMAIL PROTECTED]@lang}.php.tmp" method="html" indent="no" 
encoding="utf-8">
<html><head>

<title><xsl:value-of select="shorttitle" /></title>
</head><body>
<xsl:text disable-output-escaping="yes">&lt;!--?
include_once "header.inc";
?--&gt;
</xsl:text>

<h1><xsl:value-of select="title"/></h1>

<xsl:apply-templates select="cvsid" />

<xsl:apply-templates select="preface" />

<xsl:apply-templates select="section" />

<xsl:text disable-output-escaping="yes">
&lt;!--? include_once "</xsl:text><xsl:value-of select="@fsroot"/><xsl:text 
disable-output-escaping="yes">footer.inc"; ?--&gt;
</xsl:text>
</body></html>
</xsl:document>
</xsl:template>


<!-- ***** other structure elements ***** -->

<xsl:template match="preface">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="section">
<h2><a name="[EMAIL PROTECTED]">
<xsl:if test="boolean(//document)">
<xsl:number count="chapter" format="1." /><xsl:number format="1 " />
</xsl:if>
<xsl:value-of select="title"/></a></h2>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="faqentry">
<a name="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match="question">
<div class="question">
<p><b>{FINK_Q}<xsl:number count="chapter" format="1." /><xsl:number 
count="faqentry" format="1" /><xsl:text>: </xsl:text>
<xsl:for-each select="p">
<xsl:if test='position() = 1'><xsl:call-template name="plain" /></xsl:if>
</xsl:for-each>
</b></p>
<xsl:for-each select="p">
<xsl:if test='position() > 1'><xsl:apply-templates select="." /></xsl:if>
</xsl:for-each>
</div>
</xsl:template>

<xsl:template match="answer">
<div class="answer">
<p><b>{FINK_A}:</b><xsl:text> </xsl:text>
<xsl:for-each select="p">
<xsl:if test='position() = 1'><xsl:call-template name="plain" /></xsl:if>
</xsl:for-each>
</p>
<xsl:for-each select="p | codeblock | ul">
<xsl:if test='position() > 1'><xsl:apply-templates select="." /></xsl:if>
</xsl:for-each>
</div>
</xsl:template>

<!-- ***** block-level elements ***** -->

<xsl:template match="p">
<p><xsl:apply-templates/>
    <xsl:if test="@translated=&quot;no&quot;"><br/><translate/></xsl:if>
</p>
</xsl:template>

<xsl:template match="codeblock">
<pre><xsl:apply-templates/></pre>
</xsl:template>

<xsl:template match="ol">
<ol><xsl:apply-templates/></ol>
</xsl:template>

<xsl:template match="ul">
<ul><xsl:apply-templates/></ul>
</xsl:template>

<xsl:template match="li">
<li><xsl:apply-templates/></li>
</xsl:template>

<xsl:template match="itemtable">
<table border="0" cellpadding="0" cellspacing="10">
<tr valign="bottom"><th align="left"><xsl:value-of select="@labelt" /></th><th 
align="left"><xsl:value-of select="@labeld" /></th></tr>
<xsl:apply-templates select="item" />
</table>
</xsl:template>

<xsl:template match="item">
<tr valign="top"><td><xsl:apply-templates select="itemt" /></td>
<td><xsl:apply-templates select="itemd" /></td></tr>
</xsl:template>

<xsl:template match="itemt|itemd">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="cvsid">
<xsl:text>
</xsl:text><xsl:comment><p><xsl:text>Generated from 
</xsl:text><i><xsl:apply-templates/></i></p></xsl:comment>
</xsl:template>


<!-- ***** character-level elements ***** -->

<xsl:template match="em">
<b><xsl:apply-templates/></b>
</xsl:template>

<xsl:template match="i">
<i><xsl:apply-templates/></i>
</xsl:template>

<xsl:template match="quote">
<q><xsl:apply-templates/></q>
</xsl:template>

<xsl:template match="code|filename">
<code><xsl:apply-templates/></code>
</xsl:template>

<xsl:template match="link">
<a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match="varlink">
<a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match="xref">
<a><xsl:attribute name="href">
<xsl:if test="boolean(@chapter)"><xsl:value-of select="@chapter" 
/>.php?phpLang=<xsl:value-of select="$lang-ext" /></xsl:if>
<xsl:if test="boolean(@section)">#<xsl:value-of select="@section" /></xsl:if>
</xsl:attribute>
<xsl:apply-templates/></a>
</xsl:template>


<!-- *** special stuff *** -->

<xsl:template match="title|shorttitle">
</xsl:template>

<xsl:template name="plain">
<xsl:apply-templates/>
</xsl:template>



</xsl:stylesheet>

Index: header.inc
===================================================================
RCS file: /cvsroot/fink/experimental/babayoshihiko/web/header.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- header.inc  8 Mar 2004 01:44:24 -0000       1.2
+++ header.inc  3 Jun 2007 11:05:43 -0000       1.3
@@ -7,7 +7,7 @@
 // +--------------------------------------------------------------------------+
 // | License:  GNU/GPL - http://www.gnu.org/copyleft/gpl.html                 |
 // +--------------------------------------------------------------------------+
-// | Used by all the PHP files at http://fink.sourceforge.net                 |
+// | Used by all the PHP files at http://www.finkproject.org                  |
 // |    to produce the headers (incl HTML headers and top parts)              |
 // |                                                                          |
 // | usage:    1. read the comments                                           |
@@ -18,16 +18,47 @@
 // |                                                                          |
 // +--------------------------------------------------------------------------+
 
+if (!defined($expires))
+{
+       # by default, expire in 1 hour
+       $expires = 60 * 60;
+}
+
+// param() allows us to work without register_globals set on the server.
+function param($Name) {
+        global $HTTP_GET_VARS;
+        global $HTTP_POST_VARS;
+        global $HTTP_COOKIE_VARS;
+        if(isset($HTTP_GET_VARS[$Name]))
+               return($HTTP_GET_VARS[$Name]);
+       
+        if(isset($HTTP_POST_VARS[$Name]))
+               return($HTTP_POST_VARS[$Name]);
+       
+        if(isset($HTTP_COOKIE_VARS[$Name]))
+               return($HTTP_COOKIE_VARS[$Name]);
+       
+        return("");
+}      
+ 
 // Language Code (from phpLang.inc.php)
 include_once dirname(__FILE__) . "/phpLang.inc.php";
 $lang_code = 'en';
 if ((phpLang_current)) $lang_code = phpLang_current;
 
+header("Content-Language: " . $lang_code);
+if ($_REQUEST['phpLang'])
+{
+       header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expires) . " 
GMT");
+}
+
 if (is_readable (dirname(__FILE__) . "/constants." . $lang_code . ".inc"))
        include_once dirname(__FILE__) . "/constants." . $lang_code . ".inc";
 
 /* The Sections.  Used in Menu Navigation Bar */
 define (FINK_LC_ALL, 'en_US');
+define (FINK_SF_ENCODING, 'ISO-8859-1');
+define (FINK_DATE_FORMAT, '%d %B %Y');
 
 /* The Sections.  Used in Menu Navigation Bar */
 define (FINK_SECTION_HOME, 'Home');
@@ -50,6 +81,9 @@
 
 /* Contents as Table of Contents.  Used in FAQ/Documentation Sections */
 define (FINK_CONTENTS, 'Contents');
+define (FINK_NEXT, 'Next');
+define (FINK_Q, 'Q');
+define (FINK_A, 'A');
 
 /* Printer */
 define (FINK_PRINTER, 'Printer');
@@ -62,7 +96,7 @@
 define (FOOTER_AVAILABLE_LANGUAGES, 'Available Languages');
 define (FOOTER_GENERATED_DYNAMICALLY, 'Generated dynamically');
 define (FOOTER_DATABASE_LAST_UPDATED, 'Database last updated on  %a, %b %d %Y, 
%R GMT');
-define (FOOTER_LAST_CHANGED, 'Last changed by {author} on %a, %b %d %Y, %R 
GMT');
+define (FOOTER_LAST_CHANGED, 'Last changed by {author} on {date}, {time}');
 
 setlocale(LC_TIME, FINK_LC_ALL);
 $section_names = array(
@@ -76,13 +110,13 @@
 );
 
 $section_files = array(
-       'home' => 'index.php',
-       'download' => 'download/index.php',
-       'packages' => 'pdb/index.php',
-       'help' => 'help/index.php',
-       'faq' => 'faq/index.php',
-       'documentation' => 'doc/index.php', 
-       'mailing-lists' => 'lists/index.php'
+       'home' => 'http://www.finkproject.org/index.php?phpLang='. $lang_code,
+       'download' => 'http://www.finkproject.org/download/index.php?phpLang='. 
$lang_code,
+       'packages' => 'http://pdb.finkproject.org/pdb/index.php?phpLang='. 
$lang_code,
+       'help' => 'http://www.finkproject.org/help/index.php?phpLang='. 
$lang_code,
+       'faq' => 'http://www.finkproject.org/faq/index.php?phpLang='. 
$lang_code,
+       'documentation' => 'http://www.finkproject.org/doc/index.php?phpLang='. 
$lang_code, 
+       'mailing-lists' => 
'http://www.finkproject.org/lists/index.php?phpLang='. $lang_code
 );
 
 if (!$section) $section = "home";
@@ -90,11 +124,11 @@
 // main navigation box
 if (!is_array($navbox) && $nonav != 1) {
        $navbox = array(
-               'index.php', FINK_SECTION_HOME_INDEX,
-               'news/index.php', FINK_SECTION_HOME_NEWS,
-               'about.php', FINK_SECTION_HOME_ABOUT,
-               'people.php', FINK_SECTION_HOME_CONTRIBUTORS,
-               'links.php', FINK_SECTION_HOME_LINKS
+               'index.php?phpLang='. $lang_code, FINK_SECTION_HOME_INDEX,
+               'news/index.php?phpLang='. $lang_code, FINK_SECTION_HOME_NEWS,
+               'about.php?phpLang='. $lang_code, FINK_SECTION_HOME_ABOUT,
+               'people.php?phpLang='. $lang_code, 
FINK_SECTION_HOME_CONTRIBUTORS,
+               'links.php?phpLang='. $lang_code, FINK_SECTION_HOME_LINKS
 );
 }
 
@@ -119,6 +153,7 @@
 $metatags = ereg_replace('<([^/]*)/>', '<\1>', $metatags);
 
 // Functions Used in PDB
+        
 function it_start() {
   global $it_flag;
 
@@ -136,8 +171,12 @@
   }
   $it_flag = 1;
 
-  print '<tr valign="top"><td>'.$title.'</td><td>&nbsp;&nbsp;&nbsp;</td><td>'.
-        $item.'</td></tr>'."\n";
+  if ($title) {
+    print '<tr 
valign="top"><td>'.$title.'</td><td>&nbsp;&nbsp;&nbsp;</td><td>'.
+          $item.'</td></tr>'."\n";
+  } else {
+    print '<tr valign="top"><td colspan=3>'.$item.'</td></tr>'."\n";
+  }
 }
 
 function it_start2() {
@@ -163,6 +202,19 @@
 echo '</table>';
 }
 
+// Used in index
+function convert_date_to_locale ($initialstringdate) {
+       $date_exploded = @explode(' ', $initialstringdate, 3);
+       $array_month = array('January', 'February', 'March', 'April', 'May', 
'June', 'July', 'August', 'September', 'October', 'November', 'December');
+       $search_month = array_search($date_exploded[1], $array_month)+1;
+       $date_converted=gmstrftime(FINK_DATE_FORMAT, 
mktime(1,0,0,$search_month, $date_exploded[0], $date_exploded[2],0));
+       // $date_encoding = mb_detect_encoding($date_converted);
+       // if ($date_encoding == '') $date_encoding = FINK_SF_ENCODING;
+       $date_encoding = FINK_SF_ENCODING;
+       $date_converted = mb_convert_encoding($date_converted, "UTF-8", 
$date_encoding);
+       return $date_converted;
+}
+
 // Used in News
 function gray_line ()
 {
@@ -170,9 +222,15 @@
        print '<img src="'.$root.'img/grey_pixel.gif" height="1" width="100%" 
alt="-">';
 }
 
+// $linkroot is used for links to other parts of the website; $root is
+// used for files that are loaded locally.  (This enables us to move
+// portions of the website to other servers without losing the navigation.)
+
+if (!$linkroot) $linkroot = $root;
+
 // Used in Sections
 function insert_sub ($navbox, $active_page) {
-       global $root;
+       global $root, $linkroot;
        
        // Determine the active page
        $active_page = -1;
@@ -183,7 +241,7 @@
        
        for ($i = 0; $i <= sizeof($navbox) - 2 ; $i += 2) {
                $filename = explode('?', $navbox[$i]);
-               if ($relativepath . '/' . $filename[0] == 
$_SERVER['SCRIPT_NAME']) {
+               if ($relativepath . '/' . $filename[0] == 
$_SERVER['SCRIPT_NAME'] || '/' . $filename[0] == $_SERVER['SCRIPT_NAME']) {
                        $active_page = $i;
                        break;
                }
@@ -194,8 +252,10 @@
                if ('Contents' == $navbox[$i + 1]) $navbox[$i + 1] = 
FINK_CONTENTS;
                if ($i != $active_page) {
                        // For testing locally at my machine
+                       // (also: allows some navbox items to link to other
+                       // websites)
                        if (substr($navbox[$i ], 0, 7) != 'http://') {
-                               $_link = $root . $navbox[$i ];
+                               $_link = $linkroot . $navbox[$i ];
                        } else {
                                $_link = $navbox[$i ];
                        }
@@ -206,6 +266,7 @@
                }
        }
 }
+
 ?>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
@@ -215,65 +276,54 @@
        <title>Fink - <? echo $title ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="keywords" content="<? echo META_KEYWORDS; ?>">
-       <meta name="description" content="<? echo META_DESCRIPTION; ?>" 
+       <meta name="description" content="<? echo META_DESCRIPTION; ?>">
        <meta name="robots" content="all">
+<?
+       $rdf_file = dirname(__FILE__) .'/news/news.' . $lang_code . '.rdf';
+       echo "<!-- $rdf_file  -->\n";
+       if (is_readable ($rdf_file )) {
+               $rdf_file = 'http://feeds.feedburner.com/FinkProjectNews-' . 
$lang_code;
+       } else {
+               $rdf_file = 'http://feeds.feedburner.com/FinkProjectNews';
+       }
+?>
+       <link rel="alternate" title="Fink News RDF" href="<? print $rdf_file 
?>" type="application/rss+xml">
        <link rev="made" href="mailto:[EMAIL PROTECTED]">
        <link rel="stylesheet" href="<? print $root ?>fink.css">
        <? if ($metatags) echo $metatags; ?>
        <link rel="start" href="<? print $root ?>index.php">
        <link rel="copyright" href="<? print $root ?>legal.php">
+    <script type=""text/javascript" 
src="http://localhost/fink/fink.i18n.js";></script>
+
 </head>
-<body bgcolor="#ffffff" text="#000000" link="#0000f0" vlink="#800080" 
alink="#ff3333">
+<body bgcolor="#ffffff" text="#000000" link="#0000f0" vlink="#800080" 
alink="#ff3333" onLoad="i18n_Init();">
 
 <? /* header and sourceforge logo */ ?>
-<table width="100%" cellspacing="0" class="header">
-<tr valign="bottom">
-       <td align="left" rowspan="2" class="header">
-       <? if (!$is_home) echo '<a href="' . $root . 'index.php">'; ?>
-       <img src="<? echo $root ?>img/mlogo.png"  border="0" alt="Fink">
+<div id="header-left">
+
+       <? if (!$is_home) echo '<a href="' . $linkroot . 'index.php">'; ?>
+       <img src="<? echo $root ?>img/mlogo.png"  width="171" height="85" 
border="0" alt="Fink">
        <? if (!$is_home) echo '</a>'; ?>
-       </td>
-       <td align="right" class="header">
-       
+</div>
+
+<div id="header">
        <? /* Call phpLang function */ ?>
        <? if (function_exists(AddFlags)) AddFlags('', false, $root); ?>
-       </td>
-</tr>
-<tr valign="bottom">
-       <td align="right" class="header">
-<?
-       $img = '<a href="http://sourceforge.net/";>
-                       <img 
-                               
src="http://sourceforge.net/sflogo.php?group_id=17203"; 
-                               width="88"
-                               height="31" 
-                               border="0" 
-                               alt="SourceForge" 
-                               style="vertical-align:text-bottom">
-               </a>';
+       <br>
+<? if (!$hostlogo) include dirname(__FILE__) . "/hostlogo.inc" ;
                echo str_replace("{img}", $img, HEADER_HOSTED_BY);
 ?>
-       </td>
-</tr>
-</table>
+</div>
+
 <? /* main table with navigation column and content column */ ?>
-<table width="100%" cellspacing="0" class="main">
-<tr valign="top">
-<td class="main_left" width="120">
+<div id="sidebar">
+
 <? /* navigation column table */ ?>
 
 <? /* sections */ ?>
-       <p style="
-                       background-image: url(<? echo $root; ?>img/stripes.gif) 
; 
-                       display: block ; 
-                       border-style: solid ; 
-                       border-width: 0px 0px 4px 0px ; 
-                       border-color: #fc6 ; 
-                       text-align: center ; 
-                       margin: 0px ;
-                       padding: 6px 3px">
+       <div id="sections">
                <? echo FINK_SECTIONS; ?>
-       </p>
+       </div>
        <ul class="menu">
 <? 
        foreach ($section_files as $key => $filename) {
@@ -281,18 +331,18 @@
                if ($section == $key && 1 == $nonav) {
                        echo '<div class="selected" >'. $section_names[$key] . 
"</div></li>\n";
                } elseif ($section == $key) {
-                       echo '<a href="' . $root . $section_files[$key] . '">' 
. $section_names[$key] . "</a></li>\n";
+                       echo '<a href="' . $section_files[$key] . '">' . 
$section_names[$key] . "</a></li>\n";
                        insert_sub ($navbox, $active_page);
                        echo "\t\t";
                } else {
-                       echo '<a href="' . $root . $section_files[$key] . '">' 
. $section_names[$key] . "</a></li>\n";
+                       echo '<a href="' . $section_files[$key] . '">' . 
$section_names[$key] . "</a></li>\n";
                }
        } 
 ?>
 <? /* link to print version */ ?>
 <? if ($printlink) { ?>
                <li class="menu_item">
-                       <a href="<? echo $root . $printlink ?>" 
style="border-width: 0px ; ">
+                       <a href="<? echo $linkroot . $printlink ?>" 
style="border-width: 0px ; ">
                                <img src="<? echo $root; ?>img/printer.png" 
                                        alt="<? echo FINK_PRINTER; ?>" 
                                        width="18" height="16" 
@@ -303,6 +353,7 @@
                </li>
 <? } ?>
        </ul>
-</td>
+       
 <? /* end navigation column */ ?>
-<td class="main">
+</div>
+<div id="main">

--- NEW FILE: finkfaq.dtd ---
<!ENTITY % block "codeblock | p | ul" >
<!ENTITY % inline "#PCDATA | code | em | filename | link | tt | quote | xref" >

<!ENTITY fink_version "0.8.1" >


<!-- Root elements -->

<!ELEMENT document ( title, shorttitle, cvsid, preface?, chapter+ ) >
<!ATTLIST document filename ID #REQUIRED >
<!ATTLIST document lang CDATA "en" >
<!ATTLIST document section CDATA "faq" >
<!ATTLIST document fsroot CDATA "../" >


<!-- Structure -->
<!ELEMENT chapter ( title, shorttitle, faqentry+ ) >
<!ATTLIST chapter filename ID #REQUIRED >

<!ELEMENT title ( #PCDATA ) >
<!ELEMENT shorttitle ( #PCDATA ) >
<!ELEMENT cvsid ( #PCDATA ) >
<!ELEMENT preface ( p+ ) >

<!ELEMENT faqentry ( question, answer ) >
<!ATTLIST faqentry name ID #REQUIRED >

<!ELEMENT question ( p ) >
<!ELEMENT answer ( %block; )* >


<!-- Block elements -->
<!ELEMENT codeblock ( #PCDATA | em )* >
<!ELEMENT p ( %inline; )* >
<!ATTLIST p translated (yes|no) "yes" >


<!-- Inline -->
<!ELEMENT code ( #PCDATA | em )* >
<!ELEMENT em ( #PCDATA ) >
<!ELEMENT filename ( #PCDATA ) >
<!ELEMENT tt ( #PCDATA ) >
<!ELEMENT quote ( #PCDATA ) >


<!-- Links -->
<!ELEMENT link ( #PCDATA ) >
<!ATTLIST link url CDATA #REQUIRED >

<!ELEMENT xref ( #PCDATA ) >
<!ATTLIST xref chapter IDREF #IMPLIED >
<!ATTLIST xref section NMTOKEN #IMPLIED >


<!-- Lists -->
<!ELEMENT ul ( li+ ) >
<!ELEMENT li ( %inline; | codeblock | p )* >

--- NEW FILE: finkdoc.dtd ---
<!ENTITY % block "codeblock | ol | p | ul" >
<!ENTITY % inline "#PCDATA | code | strong | em | filename | link | varlink | 
tt | quote | xref" >

<!ENTITY fink_version "0.8.1" >


<!-- Root elements -->
<!ELEMENT article ( title, shorttitle, cvsid, preface?, section+ ) >
<!ATTLIST article filename ID #REQUIRED >
<!ATTLIST article lang CDATA "en" >
<!ATTLIST article fsroot CDATA "../" >

<!ELEMENT document ( title, shorttitle, cvsid, preface?, chapter+ ) >
<!ATTLIST document filename ID #REQUIRED >
<!ATTLIST document lang CDATA "en" >
<!ATTLIST document section CDATA "documentation" >
<!ATTLIST document fsroot CDATA "../../" >


<!-- Structure -->
<!ELEMENT chapter ( title, shorttitle, preface?, section+ ) >
<!ATTLIST chapter filename ID #REQUIRED >

<!ELEMENT title ( #PCDATA ) >
<!ELEMENT shorttitle ( #PCDATA ) >
<!ELEMENT cvsid ( #PCDATA ) >
<!ELEMENT preface ( p+ ) >

<!ELEMENT section (title?, ( %block; | itemtable )*) >
<!ATTLIST section name NMTOKEN #IMPLIED >


<!-- Block elements -->
<!ELEMENT codeblock ( #PCDATA | em | strong )* >
<!ELEMENT p ( %inline; )* >
<!ATTLIST p translated (yes|no) "yes" >


<!-- Inline -->
<!ELEMENT code ( #PCDATA | em | strong )* >
<!ELEMENT em ( #PCDATA ) >
<!ELEMENT strong ( #PCDATA ) >
<!ELEMENT filename ( #PCDATA ) >
<!ELEMENT tt ( #PCDATA ) >
<!ELEMENT quote ( #PCDATA ) >


<!-- Links -->
<!ELEMENT link ( #PCDATA ) >
<!ATTLIST link url CDATA #REQUIRED >

<!-- VarLinks -->
<!ELEMENT varlink ( #PCDATA ) >
<!ATTLIST varlink url CDATA #REQUIRED >
<!ATTLIST varlink varurl CDATA #REQUIRED >


<!ELEMENT xref ( #PCDATA ) >
<!ATTLIST xref chapter IDREF #IMPLIED >
<!ATTLIST xref section NMTOKEN #IMPLIED >


<!-- Lists -->
<!ELEMENT ol ( li+ ) >
<!ELEMENT ul ( li+ ) >

<!ELEMENT li ( %inline; | codeblock | p | ol )* >

<!ELEMENT itemtable ( item+ ) >
<!ATTLIST itemtable labeld CDATA "Value" >
<!ATTLIST itemtable labelt CDATA "Field" >

<!ELEMENT item ( itemt, itemd ) >
<!ELEMENT itemt ( %inline; )* >
<!ELEMENT itemd ( %block; )* >

--- NEW FILE: fink.i18n.js ---
/* $Id: fink.i18n.js,v 1.1 2007/06/03 11:05:40 babayoshihiko Exp $ */


/*
 *
 *
 *
 *
 *
 *
 *
 */


function i18n_Init(){
        var e = document.getElementsByTagName('translate');
        for( var i = 0 ; i < e.length ; i++ ){
                str = e[i].innerHTML;
                e[i].innerHTML = "<a 
href=\"javascript:i18n_Translate_Init('','','','de'," + i + ")\" 
>Translate</a>";
        }
}

function i18n_Translate_Init(doc, chapter, section, lang, id){
        var e = document.getElementsByTagName('translate');
        e[id].parentNode.style.backgroundColor = "#eeffff";
        
        // guesses the window size for column width
        var colwidth = (document.width - 80) / 10;
        colwidth = (colwidth > 10 ? colwidth : 10);
        
        var str = '<form action="http://localhost/fink/i18n_form.php"; 
method="post" name="form' + id + '">';
        str += '<textarea cols="' + colwidth + '" rows="10" 
accept-charset="UTF-8" name="translated"></textarea>';
        str += '<input type="hidden" name="doc" value="' + doc + '">';
        str += '<input type="hidden" name="chapter" value="' + chapter + '">';
        str += '<input type="hidden" name="section" value="' + section + '">';
        str += '<input type="hidden" name="lang" value="' + lang + '">';
        str += '<input type="hidden" name="id" value="' + id + '">';
        str += '<input type="hidden" name="original" value="' + 
e[id].parentNode.innerText + '">';
        str += '<br><a href="javascript:i18n_Previw(' + id + ')">Preview</a>';
        str += ' |  <a href="javascript:document.form' + id + 
'.submit();">Commit</a>';
        str += '</form>';
        
        e[id].innerHTML = str;
        
        // this.form.translated.focus();
}

function i18n_Previw(id){
        var e = document.getElementsByTagName('translate');
        e[id].parentNode.style.backgroundColor = "#ffffff";
        
        var str = e[id].getElementsByTagName('textarea')[0].value;
        
        e[id].parentNode.innerText = str;
}


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to