site tranlation

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@216 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2008-12-01 21:55:24 +00:00
parent 44795c6b36
commit 53258ad278
28 changed files with 1142 additions and 71 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

BIN
site/admin/images/free.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

BIN
site/admin/images/save.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

337
site/admin/styles.css Normal file
View File

@ -0,0 +1,337 @@
a {
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
ul {
margin-bottom: 10px;
margin-top: 10px;
margin-left: 0px;
}
li {
margin-left: 18px;
list-style-image: url(images/li.gif);
}
li.error {
margin-left: 15px;
list-style-image: url(images/li_error.gif);
}
li.grey {
margin-left: 15px;
list-style-image: url(images/li_grey.gif);
}
form {
margin-bottom: 0px;
margin-top: 0px;
}
.bgcn {
background-position: center;
background-repeat: no-repeat;
}
.bgrn {
background-position: right;
background-repeat: no-repeat;
}
.bgcy {
background-position: center;
background-repeat: repeat-y;
}
.bgry {
background-position: right;
background-repeat: repeat-y;
}
.bgly {
background-position: left;
background-repeat: repeat-y;
}
.bgbx {
background-position: bottom;
background-repeat: repeat-x;
}
.textform {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
}
.textform a {
color: #2971C1;
}
.text {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #515151;
}
.text h1 {
margin-bottom: 15px;
margin-top: 0px;
color: #000000;
font-size: 18px;
font-weight: normal;
line-height: 15px;
}
.text h2 {
margin-bottom: 15px;
margin-top: 0px;
color: #000000;
font-size: 16px;
}
.text h3 {
margin-bottom: 15px;
margin-top: 0px;
color: #000000;
font-size: 14px;
}
.text h4 {
margin-bottom: 15px;
margin-top: 0px;
color: #000000;
font-size: 12px;
}
.text span.date {
font-size: 11px;
color: #FFFFFF;
font-weight: bold;
}
.text span.sub {
font-size: 11px;
color: #676767;
}
.text a.sublink {
font-size: 11px;
color: #666666;
}
.text b.black {
color: #000000;
}
.text span.black {
color: #000000;
}
.block {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #515151;
}
.block h1 {
margin-bottom: 10px;
font-size: 12px;
color: #000000;
font-weight: bold;
line-height: 11px;
}
.bann {
font-family: Arial, Helvetica, sans-serif;
font-size: 21px;
color: #000000;
line-height: 18px;
}
.bann span.text {
font-size: 14px;
color: #9F7800;
}
.bannin {
font-family: Arial, Helvetica, sans-serif;
font-size: 17px;
color: #000000;
line-height: 14px;
font-weight: bold;
}
.bannin span.text {
font-size: 12px;
color: #9F7800;
font-weight: normal;
white-space: nowrap;
}
.bannform {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #766037;
}
.menu {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
.menu a {
color: #000000;
}
.smenu {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #165798;
}
.smenu a {
color: #165798;
}
.table {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #515151;
padding-left: 5px;
padding-right: 15px;
padding-top: 2px;
padding-bottom: 2px;
}
.table span.header {
color: #FFFFFF;
}
.table span.headergrey {
color: #676767;
}
.table a.black {
color: #000000;
}
.table span.black {
color: #000000;
}
.table a.blocked {
color: #e0a0a0;
}
.address {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
.address a {
color: #000000;
}
.phone {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
.phone span.number {
font-size: 17px;
color: #3D79AD;
font-weight: bold;
}
td.formauth {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
padding-left: 0px;
}
td.formauth span {
color: #474747;
}
td.formauth span.formdescr {
font-size: 10px;
color: #676767;
}
.formauth {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #676767;
}
input.formauth {
border: 1px solid #878787;
}
textarea.formauth {
border: 1px solid #878787;
overflow: auto;
}
.submit a {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
text-decoration: none;
}
.perpage {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #676767;
}
input.submit {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
background: transparent;
background-image: url(images/submitbg.gif);
height: 33px;
cursor: hand;
border: none;
}
.cal {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #515151;
}
.cal a {
color: #515151;
text-decoration: none;
}
.cal span {
color: #B70606;
}
.cal b {
color: #000000;
}
.firstmessage a {
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 10px;
text-decoration: none;
color: #6a6a6a;
}
.firstmessage a:hover {
color: #8a6a6a;
}

141
site/admin/translate.php Normal file
View File

@ -0,0 +1,141 @@
<?php
/*
* This file is part of Web Instant Messenger project.
*
* Copyright (c) 2005-2008 Web Messenger Community
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Evgeny Gryaznov - initial API and implementation
*/
require_once('../libs/common.php');
require_once('../libs/pagination.php');
function getparam( $name ) {
global $webim_encoding;
if( isset($_POST[$name]) )
return myiconv(getoutputenc(), $webim_encoding, $_POST[$name]);
die("no ".$name." parameter");
}
function form_value($key) {
global $page;
if( isset($page) && isset($page["form$key"]) )
return $page["form$key"];
return "";
}
function save_message($locale,$key,$value) {
global $webim_encoding;
$result = "";
$added = false;
$current_encoding = $webim_encoding;
$fp = fopen(dirname(__FILE__)."/../locales/$locale/properties", "r");
while (!feof($fp)) {
$line = fgets($fp, 4096);
$keyval = split("=", $line, 2 );
if( isset($keyval[1]) ) {
if($keyval[0] == 'encoding') {
$current_encoding = trim($keyval[1]);
} else if(!$added && $keyval[0] == $key) {
$line = "$key=".myiconv($webim_encoding, $current_encoding, str_replace("\r", "",str_replace("\n", "\\n",trim($value))))."\n";
$added = true;
}
}
$result .= $line;
}
fclose($fp);
if(!$added) {
$result .= "$key=".myiconv($webim_encoding, $current_encoding, str_replace("\r", "",str_replace("\n", "\\n",trim($value))))."\n";
}
$fp = fopen(dirname(__FILE__)."/../locales/$locale/properties", "w");
fwrite($fp, $result);
fclose($fp);
$fp = fopen(dirname(__FILE__)."/../locales/$locale/properties.log", "a");
$extAddr = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
$extAddr = $_SERVER['REMOTE_ADDR'].' ('.$_SERVER['HTTP_X_FORWARDED_FOR'].')';
}
$userbrowser = $_SERVER['HTTP_USER_AGENT'];
$remoteHost = isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : $extAddr;
fwrite($fp,"# ".date(DATE_RFC822)." by $remoteHost using $userbrowser\n");
fwrite($fp,"$key=".myiconv($webim_encoding, $current_encoding, str_replace("\r", "",str_replace("\n", "\\n",trim($value))))."\n");
fclose($fp);
}
$source = verifyparam("source", "/^[\w-]{2,5}$/", $default_locale);
$target = verifyparam("target", "/^[\w-]{2,5}$/", "ru");
$stringid = verifyparam("key", "/^[_\.\w]+$/", "");
if(!isset($messages[$source])) {
load_messages($source);
}
$lang1 = $messages[$source];
if(!isset($messages[$target])) {
load_messages($target);
}
$lang2 = $messages[$target];
$errors = array();
$page = array(
'lang1' => $source,
'lang2' => $target,
'title1' => isset($lang1["localeid"]) ? $lang1["localeid"] : $source,
'title2' => isset($lang2["localeid"]) ? $lang2["localeid"] : $target
);
if($stringid) {
$translation = isset($lang2[$stringid]) ? $lang2[$stringid] : "";
if(isset($_POST['translation'])) {
$translation = getparam('translation');
if(!$translation) {
$errors[] = no_field("form.field.translation");
}
if(count($errors) == 0) {
save_message($target, $stringid, $translation);
$page['saved'] = true;
start_html_output();
require('view/translate.php');
exit;
}
}
$page['saved'] = false;
$page['key'] = $stringid;
$page['target'] = $target;
$page['formoriginal'] = isset($lang1[$stringid]) ? $lang1[$stringid] : "<b><unknown></b>";
$page['formtranslation'] = $translation;
start_html_output();
require('view/translate.php');
exit;
}
$localesList = array();
foreach($available_locales as $loc) {
$localesList[] = array("id" => $loc, "name" => getlocal_($loc, "names"));
}
$result = array();
$allkeys = array_keys($lang1);
foreach($allkeys as $key) {
$result[] = array('id' => $key, 'l1' => $lang1[$key], 'l2' => (isset($lang2[$key]) ? $lang2[$key] : "<font color=\"#c13030\"><b>absent</b></font>") );
}
setup_pagination($result,100);
$page['formtarget'] = $target;
$page['formsource'] = $source;
$page['availableLocales'] = $localesList;
start_html_output();
require('view/translatelist.php');
?>

View File

@ -0,0 +1 @@
Deny from all

View File

@ -0,0 +1,115 @@
<?php
/*
* This file is part of Web Instant Messenger project.
*
* Copyright (c) 2005-2008 Web Messenger Community
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Evgeny Gryaznov - initial API and implementation
*/
?>
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $siteroot ?>/admin/styles.css" />
<link rel="shortcut icon" href="<?php echo $siteroot ?>/admin/images/favicon.ico" type="image/x-icon"/>
<title>
Translate
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#2971C1" vlink="#2971C1" alink="#2971C1">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td valign="top" class="text">
<h1>Translate</h1>
<?php if( $page['saved'] ) { ?>
Your translation is saved.
<script><!--
setTimeout( (function() { window.close(); }), 500 );
//--></script>
<?php } ?>
<?php if( !$page['saved'] ) { ?>
Enter you translation.
<br/>
<br/>
<?php if( isset($errors) && count($errors) > 0 ) { ?>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top"><img src='<?php echo $siteroot ?>/admin/images/icon_err.gif' width="40" height="40" border="0" alt="" /></td>
<td width="10"></td>
<td class="text">
<?php if( isset($errors) && count($errors) > 0 ) {
print '<font color="#c13030"><b>Correct the mistakes:</b><br/><ul>';
foreach( $errors as $e ) {
print '<li class="error">';
print $e;
print '</li>';
}
print '</ul></font>';
} ?>
</td>
</tr>
</table>
<?php } ?>
<form name="translateForm" method="post" action="<?php echo $siteroot ?>/admin/translate.php">
<table cellspacing='0' cellpadding='0' border='0'><tr><td background='<?php echo $siteroot ?>/admin/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='<?php echo $siteroot ?>/admin/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $siteroot ?>/admin/images/logincrnrt.gif' width='16' height='16' border='0' alt=''></td></tr><tr><td></td><td align='center'><table border='0' cellspacing='0' cellpadding='0'>
<tr>
<td colspan="3" class="formauth"><?php echo $page['title1'] ?></td>
</tr>
<tr><td colspan="3" height="2"></td></tr>
<tr>
<td colspan="3">
<textarea name="original" tabindex="0" cols="80" rows="5" style="border:1px solid #878787; overflow:auto"><?php echo $page['formoriginal'] ?></textarea>
</td>
</tr>
<tr><td colspan="3" height="5"></td></tr>
<tr>
<td colspan="3" class="formauth"><?php echo $page['title2'] ?></td>
</tr>
<tr><td colspan="3" height="2"></td></tr>
<tr>
<td colspan="3">
<textarea name="translation" tabindex="0" cols="80" rows="5" style="border:1px solid #878787; overflow:auto"><?php echo $page['formtranslation'] ?></textarea>
</td>
</tr>
<tr><td colspan="3" height="5"></td></tr>
<tr><td colspan='3' height='20'></td></tr><tr><td colspan='3' background='<?php echo $siteroot ?>/admin/images/formline.gif'><img src='<?php echo $siteroot ?>/admin/images/formline.gif' width='1' height='2' border='0' alt=''></td></tr><tr><td colspan='3' height='10'></td></tr>
<tr>
<td class="formauth">
<input type="hidden" name="key" value="<?php echo $page['key'] ?>"/>
<input type="hidden" name="target" value="<?php echo $page['target'] ?>"/>
<input type="image" name="" src='<?php echo $siteroot ?>/admin/images/save.gif' border="0" alt='Save'/></td>
<td></td>
<td></td>
</tr>
</table></td><td></td></tr><tr><td><img src='<?php echo $siteroot ?>/admin/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $siteroot ?>/admin/images/logincrnrb.gif' width='16' height='16' border='0' alt=''></td></tr></table></td></tr></table>
</form>
<?php } ?>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,93 @@
<?php
/*
* This file is part of Web Instant Messenger project.
*
* Copyright (c) 2005-2008 Web Messenger Community
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Evgeny Gryaznov - initial API and implementation
*/
?>
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $siteroot ?>/admin/styles.css" />
<link rel="shortcut icon" href="<?php echo $siteroot ?>/admin/images/favicon.ico" type="image/x-icon"/>
<title>
Translate
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#2971C1" vlink="#2971C1" alink="#2971C1">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td valign="top" class="text">
<h1>Translate</h1>
If you don't like the translation, please send us an update.
<br />
<br />
<form name="translateForm" method="get" action="<?php echo $siteroot ?>/admin/translate.php">
<table cellspacing='0' cellpadding='0' border='0'><tr><td background='<?php echo $siteroot ?>/admin/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='<?php echo $siteroot ?>/admin/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $siteroot ?>/admin/images/logincrnrt.gif' width='16' height='16' border='0' alt=''></td></tr><tr><td></td><td align='center'><table border='0' cellspacing='0' cellpadding='0'>
<tr>
<td class="formauth" colspan="3">
<select name="source" onchange="this.form.submit();"><?php foreach($page['availableLocales'] as $k) { echo "<option value=\"".$k["id"]."\"".($k["id"] == form_value("source") ? " selected=\"selected\"" : "").">".$k["name"]."</option>"; } ?></select>
=>
<select name="target" onchange="this.form.submit();"><?php foreach($page['availableLocales'] as $k) { echo "<option value=\"".$k["id"]."\"".($k["id"] == form_value("target") ? " selected=\"selected\"" : "").">".$k["name"]."</option>"; } ?></select>
</td>
</tr>
</table></td><td></td></tr><tr><td><img src='<?php echo $siteroot ?>/admin/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $siteroot ?>/admin/images/logincrnrb.gif' width='16' height='16' border='0' alt=''></td></tr></table></td></tr></table>
</form>
<br/>
<?php if( $page['pagination'] && $page['pagination.items'] ) { ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class='table' bgcolor='#276db8' height='30'><span class='header'>Key</span></td><td width='3'></td>
<td class='table' bgcolor='#276db8' height='30'width="40%"><span class='header'><?php echo topage($page['title1']) ?></span></td><td width='3'></td>
<td class='table' bgcolor='#276db8' height='30'width="40%"><span class='header'><?php echo topage($page['title2']) ?></span></td>
</tr>
<?php foreach( $page['pagination.items'] as $localstr ) { ?>
<tr>
<td height='20' class='table'>
<a href="<?php echo $siteroot ?>/admin/translate.php?source=<?php echo $page['lang1'] ?>&amp;target=<?php echo $page['lang2'] ?>&amp;key=<?php echo $localstr['id'] ?>" target="_blank" onclick="this.newWindow = window.open('<?php echo $siteroot ?>/admin/translate.php?source=<?php echo $page['lang1'] ?>&amp;target=<?php echo $page['lang2'] ?>&amp;key=<?php echo $localstr['id'] ?>', '', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,width=640,height=430,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><?php echo topage($localstr['id']) ?></a>
</td><td background='<?php echo $siteroot ?>/admin/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $siteroot ?>/admin/images/free.gif'></td>
<td height='20' class='table'>
<?php echo topage($localstr['l1']) ?>
</td><td background='<?php echo $siteroot ?>/admin/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $siteroot ?>/admin/images/free.gif'></td>
<td height='20' class='table'>
<?php echo topage($localstr['l2']) ?>
</td>
</tr>
<tr><td height='2' colspan='9'></td></tr><tr><td bgcolor='#e1e1e1' colspan='9'><img width='1' height='1' border='0' alt='' src='<?php echo $siteroot ?>/admin/images/free.gif'></td></tr><tr><td height='2' colspan='9'></td></tr>
<?php } ?>
</table>
<br />
<?php echo generate_pagination($page['pagination']) ?>
<?php } ?>
<?php if( $page['pagination'] && !$page['pagination.items'] ) { ?>
<br/><br/>
<table cellspacing='0' cellpadding='0' border='0'><tr><td background='<?php echo $siteroot ?>/admin/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='<?php echo $siteroot ?>/admin/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $siteroot ?>/admin/images/logincrnrt.gif' width='16' height='16' border='0' alt=''></td></tr><tr><td></td><td align='center'><table border='0' cellspacing='0' cellpadding='0'>
<span class="table">
No items.
</span>
</table></td><td></td></tr><tr><td><img src='<?php echo $siteroot ?>/admin/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $siteroot ?>/admin/images/logincrnrb.gif' width='16' height='16' border='0' alt=''></td></tr></table></td></tr></table>
<?php } ?>
</td>
</tr>
</table>
</body>
</html>

View File

@ -1,14 +1,27 @@
<?php
$page = 'demo';
require_once('libs/common.php');
start_html_output();
require_once('inc/header.i');
require_once('inc/menu.i');
?>
<div id="container">
<div id="content">
<h3>DEMO</h3>
<p>Sorry, demo is not available yet.</p>
<h3><?php echo getlocal("demo.title") ?></h3>
<p>
<?php echo getlocal("demo.click") ?><br/>
<br/>
<!-- webim button --><a href="/webim/client.php?locale=<?php echo $current_locale ?>" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=<?php echo $current_locale ?>', 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=<?php echo $current_locale ?>" border="0" width="163" height="61"/></a><!-- / webim button -->
<br/>
<br/>
<?php echo getlocal("demo.login") ?><br/><br/>
<a href="/webim/"><?php echo getlocal("demo.application") ?></a>
</p>
</div>
</div>

View File

@ -1,20 +1,31 @@
<?php
$page = 'downl';
require_once('libs/common.php');
start_html_output();
require_once('inc/header.i');
require_once('inc/menu.i');
?>
<div id="container">
<div id="content">
<h3>Latest release</h3>
<h3><?php echo getlocal("downl.title") ?></h3>
<div id="downl">
<?php echo getlocal("downl.release") ?><br/>
<a href="http://prdownloads.sourceforge.net/webim/webim142.zip?download">
1.4.2, October 6, 2008
</a>
</div>
<br/>
<br/>
<?php echo getlocal("downl.nightly") ?><br/>
<a href="http://openwebim.org/download/webim150b1.zip">
1.5.0 beta 1, November 28, 2008
</a>
</div>
</div>
</div>

View File

@ -1,6 +1,7 @@
<?php
$page = 'feat';
require_once('libs/common.php');
start_html_output();
require_once('inc/header.i');
require_once('inc/menu.i');
?>
@ -8,64 +9,35 @@ require_once('inc/menu.i');
<div id="container">
<div id="content">
<a name='price'></a>
<h3>Pricing</h3>
<ul>
<li>Open-source code, absolutely free
<li>Eclipse Public License 1.0
</ul>
<h3><?php echo getlocal("features.price.title") ?></h3>
<?php echo getlocal("features.price") ?>
<a name='main'></a>
<h3>Main features</h3>
<ul>
<li>Chat button for email signatures
<li>Differing buttons on same website
</ul>
<h3><?php echo getlocal("features.main.title") ?></h3>
<?php echo getlocal("features.main") ?>
<a name='chat'></a>
<h3>Chat window</h3>
<ul>
<li>Agent and visitor "Typing Indicator"
<li>Agent photo
<li>Chat transcript emails
<li>Sound and Visual alerts
<li>"Leave a message" when you are away
<li>Customize chat with your Logo, Name etc.
<li>Unicode support for multiple languages
<li>Quickly convert text to hyperlinks in chat
<li>Not blocked by pop-up blockers
</ul>
<h3><?php echo getlocal("features.chat.title") ?></h3>
<?php echo getlocal("features.chat") ?>
<a name='operator'></a>
<h3>Operator abilites</h3>
<ul>
<li>Web-based Operator Console
<li>Canned messages for speed and consistency
<li>Chat conversation history with search
<li>Linking to previous visits, instant access to previous chats
<li>Reassign/Transfer chat ownership
<li>Mark/Highlight nuisance visitors
</ul>
<h3><?php echo getlocal("features.operator.title") ?></h3>
<?php echo getlocal("features.operator") ?>
<a name='next'></a>
<h3>Nearest future (not ready yet)</h3>
<ul>
<li>Operator to Operator IM (Discussion)
<li>Push Web Pages
<li>SSL Secured Chat
<li>Pre-Chat Questionnaire
<li>Multiple Departments
<li>Define Initial Chat Window Size
<li>Co-Browse to View Visitor's Location on Your Site
<li>Dynamic Chat Icons
</ul>
<h3><?php echo getlocal("features.next.title") ?></h3>
<?php echo getlocal("features.next") ?>
</div>
<div id="side">
<p>Content:</p>
<p><?php echo getlocal("features.content.head") ?></p>
<p>
<a href="#price">pricing</a><br/>
<a href="#main">main features</a><br/>
<a href="#chat">chat window</a><br/>
<a href="#operator">operator abilities</a><br/>
<a href="#price"><?php echo strtolower(getlocal("features.price.title")) ?></a><br/>
<a href="#main"><?php echo strtolower(getlocal("features.main.title")) ?></a><br/>
<a href="#chat"><?php echo strtolower(getlocal("features.chat.title")) ?></a><br/>
<a href="#operator"><?php echo strtolower(getlocal("features.operator.title")) ?></a><br/>
<a href="#next">what is coming next</a><br/>
</p>
</div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Web Messenger</title>
<title><?php echo getlocal("title") ?></title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="niftyCorners.css">
<script type="text/javascript" src="niftycube.js"></script>

View File

@ -1,14 +1,14 @@
<div id="header">
<div id="title">
<h1><strong>Web Messenger</strong>&nbsp;&#8212; open-source live support software</h1>
<big>allows visitors of your site to chat with your operators</big>
<h1><?php echo getlocal("head.name") ?></h1>
<big><?php echo getlocal("head.descr") ?></big>
</div>
<div id="menu">
<ul id="nav">
<li id="home"<?php echo $page == 'home' ? ' class="activelink"' : '' ?>><a href="index.php">home</a></li>
<li id="who"<?php echo $page == 'feat' ? ' class="activelink"' : '' ?>><a href="features.php">features</a></li>
<li id="prod"<?php echo $page == 'demo' ? ' class="activelink"' : '' ?>><a href="demo.php">demo</a></li>
<li id="serv"<?php echo $page == 'downl' ? ' class="activelink"' : '' ?>><a href="download.php">download</a></li>
<li id="home"<?php echo $page == 'home' ? ' class="activelink"' : '' ?>><a href="index.php"><?php echo getlocal("menu.home") ?></a></li>
<li id="who"<?php echo $page == 'feat' ? ' class="activelink"' : '' ?>><a href="features.php"><?php echo getlocal("menu.features") ?></a></li>
<li id="prod"<?php echo $page == 'demo' ? ' class="activelink"' : '' ?>><a href="demo.php"><?php echo getlocal("menu.demo") ?></a></li>
<li id="serv"<?php echo $page == 'downl' ? ' class="activelink"' : '' ?>><a href="download.php"><?php echo getlocal("menu.download") ?></a></li>
</ul>
</div>
<div id="logo">

View File

@ -1,25 +1,26 @@
<?php
$page = 'home';
require_once('libs/common.php');
start_html_output();
require_once('inc/header.i');
require_once('inc/menu.i');
?>
<div id="container">
<div id="content">
<h3>What is Web Messenger?</h3>
<p>"Web Messenger" - is unique software allowing visitors of your site to chat with your operators.</p>
<h3><?php echo getlocal("index.whatis.title") ?></h3>
<p><?php echo getlocal("index.whatis") ?></p>
<h3>Why should I use Web Messenger?</h3>
<p>"Web Messenger" makes it easier to communicate with existing and potential clients. It will significantly increase conversion rates and online sales of your web site.</p>
<h3><?php echo getlocal("index.why.title") ?></h3>
<p><?php echo getlocal("index.why") ?></p>
<h3>How it works?</h3>
<p>You should place the button of Web Messenger at your site. Your visitors click the button and chat with your operators who help them.</p>
<h3><?php echo getlocal("index.how.title") ?></h3>
<p><?php echo getlocal("index.how") ?></p>
<h3>License</h3>
<p>This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0.</p>
<h3><?php echo getlocal("index.license.title") ?></h3>
<p><?php echo getlocal("index.license") ?></p>
<p>Project is hosted by SourceForge.</p>
<p><?php echo getlocal("index.hosted") ?></p>
</div>
</div>

1
site/libs/.htaccess Normal file
View File

@ -0,0 +1 @@
Deny from all

200
site/libs/common.php Normal file
View File

@ -0,0 +1,200 @@
<?php
$available_locales = array("en", "ru");
$default_locale = "en";
$siteroot = "/site";
$site_encoding = "utf-8";
function myiconv($in_enc, $out_enc, $string) {
if($in_enc == $out_enc ) {
return $string;
}
if( function_exists('iconv') ) {
$converted = @iconv($in_enc, $out_enc, $string);
if( $converted !== FALSE ) {
return $converted;
}
}
return $string; // do not know how to convert
}
function verifyparam( $name, $regexp, $default = null ) {
if( isset( $_GET[$name] ) ) {
$val = $_GET[$name];
if( preg_match( $regexp, $val ) )
return $val;
} else if( isset( $_POST[$name] ) ) {
$val = $_POST[$name];
if( preg_match( $regexp, $val ) )
return $val;
} else {
if( isset( $default ) )
return $default;
}
echo "<html><head></head><body>Wrong parameter used or absent: ".$name."</body></html>";
exit;
}
function get_user_locale() {
global $available_locales, $default_locale;
if( isset($_COOKIE['webim_locale']) ) {
$requested_lang = $_COOKIE['webim_locale'];
if( in_array($requested_lang,$available_locales) )
return $requested_lang;
}
if( isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) {
$requested_langs = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
foreach( $requested_langs as $requested_lang) {
if( strlen($requested_lang) > 2 )
$requested_lang = substr($requested_lang,0,2);
if( in_array($requested_lang,$available_locales) )
return $requested_lang;
}
}
if( in_array($default_locale,$available_locales) )
return $default_locale;
return 'en';
}
function get_locale() {
global $available_locales, $siteroot;
$locale = verifyparam("locale", "/^[\w-]{2,5}$/", "");
if( $locale && in_array($locale,$available_locales) ) {
$_SESSION['locale'] = $locale;
setcookie('webim_locale', $locale, time()+60*60*24*1000, "$siteroot/");
} else if( isset($_SESSION['locale']) ){
$locale = $_SESSION['locale'];
}
if( !$locale || !in_array($locale,$available_locales) )
$locale = get_user_locale();
return $locale;
}
$current_locale = get_locale();
setlocale(LC_TIME, $current_locale);
$messages = array();
$output_encoding = array();
function get_locale_links($href) {
global $available_locales, $current_locale;
$localeLinks = "";
foreach($available_locales as $k) {
if( strlen($localeLinks) > 0 )
$localeLinks .= " &bull; ";
if( $k == $current_locale )
$localeLinks .= getlocal_($k, "names");
else
$localeLinks .= "<a href=\"$href?locale=$k\">".getlocal_($k, "names")."</a>";
}
return $localeLinks;
}
function load_messages($locale) {
global $messages, $site_encoding, $output_encoding;
$hash = array();
$current_encoding = $site_encoding;
$fp = @fopen(dirname(__FILE__)."/../locales/$locale/properties", "r");
if(!$fp) { die("wrong locale"); }
while (!feof($fp)) {
$line = fgets($fp, 4096);
$keyval = split("=", $line, 2 );
if( isset($keyval[1]) ) {
if($keyval[0] == 'encoding') {
$current_encoding = trim($keyval[1]);
} else if($keyval[0] == 'output_encoding') {
$output_encoding[$locale] = trim($keyval[1]);
} else if( $current_encoding == $site_encoding ) {
$hash[$keyval[0]] = str_replace("\\n", "\n",trim($keyval[1]));
} else {
$hash[$keyval[0]] = myiconv($current_encoding, $site_encoding, str_replace("\\n", "\n",trim($keyval[1])));
}
}
}
fclose($fp);
$messages[$locale] = $hash;
}
function getoutputenc() {
global $current_locale, $output_encoding, $site_encoding, $messages;
if(!isset($messages[$current_locale]))
load_messages($current_locale);
return isset($output_encoding[$current_locale]) ? $output_encoding[$current_locale] : $site_encoding;
}
function getstring_($text,$locale) {
global $messages;
if(!isset($messages[$locale]))
load_messages($locale);
$localized = $messages[$locale];
if( isset($localized[$text]) )
return $localized[$text];
return "!".$text;
}
function getstring($text) {
global $current_locale;
return getstring_($text,$current_locale);
}
function getlocal($text) {
global $current_locale, $site_encoding;
return myiconv($site_encoding,getoutputenc(), getstring_($text,$current_locale));
}
function getlocal_($text,$locale) {
global $site_encoding;
return myiconv($site_encoding,getoutputenc(), getstring_($text,$locale));
}
function topage($text) {
global $site_encoding;
return myiconv($site_encoding,getoutputenc(), $text);
}
function getstring2_($text,$params,$locale) {
$string = getstring_($text,$locale);
for( $i = 0; $i < count($params); $i++ ) {
$string = str_replace("{".$i."}", $params[$i], $string);
}
return $string;
}
function getstring2($text,$params) {
global $current_locale;
return getstring2_($text,$params,$current_locale);
}
function getlocal2($text,$params) {
global $current_locale, $site_encoding;
$string = myiconv($site_encoding,getoutputenc(), getstring_($text,$current_locale));
for( $i = 0; $i < count($params); $i++ ) {
$string = str_replace("{".$i."}", $params[$i], $string);
}
return $string;
}
function start_html_output() {
$charset = getstring("output_charset");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/html".(isset($charset)?"; charset=".$charset:""));
}
function div($a,$b) {
return ($a-($a % $b)) / $b;
}
?>

98
site/libs/pagination.php Normal file
View File

@ -0,0 +1,98 @@
<?php
/*
* This file is part of Web Instant Messenger project.
*
* Copyright (c) 2005-2008 Web Messenger Community
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Evgeny Gryaznov - initial API and implementation
*/
$pagination_spacing = "&nbsp;&nbsp;&nbsp;";
$links_on_page = 5;
function generate_pagination_link($page,$title) {
$lnk = $_SERVER['REQUEST_URI'];
$href = preg_replace("/\?page=\d+\&/", "?", preg_replace("/\&page=\d+/", "", $lnk));
$href .= strstr($href,"?") ? "&page=$page" : "?page=$page";
return "<a href=\"$href\" class=\"pagelink\">$title</a>";
}
function generate_pagination_image($id) {
global $webimroot;
return "<img src=\"$webimroot/images/$id.gif\" border=\"0\"/>";
}
function setup_pagination($items,$default_items_per_page=15) {
global $page;
if( $items ) {
$items_per_page = verifyparam("items", "/^\d{1,3}$/", $default_items_per_page);
if( $items_per_page < 2 )
$items_per_page = 2;
$total_pages = div(count($items) + $items_per_page - 1, $items_per_page);
$curr_page = verifyparam("page", "/^\d{1,6}$/", 1);
if( $curr_page < 1 )
$curr_page = 1;
if( $curr_page > $total_pages )
$curr_page = $total_pages;
$start_index = ($curr_page-1)*$items_per_page;
$end_index = min($start_index+$items_per_page, count($items));
$page['pagination.items'] = array_slice($items, $start_index, $end_index-$start_index);
$page['pagination'] =
array( "page" => $curr_page, "items" => $items_per_page, "total" => $total_pages,
"count" => count($items), "start" => $start_index, "end" => $end_index );
} else {
$page['pagination.items'] = false;
$page['pagination'] = true;
}
}
function setup_empty_pagination() {
global $page;
$page['pagination.items'] = false;
$page['pagination'] = false;
}
function generate_pagination($pagination) {
global $pagination_spacing, $links_on_page;
$result = getlocal2("tag.pagination.info",
array($pagination['page'],$pagination['total'],$pagination['start']+1,$pagination['end'],$pagination['count']))."<br/>";
if( $pagination['total'] > 1 ) {
$result.="<br/><div class='pagination'>";
$curr_page = $pagination['page'];
$minPage = max( $curr_page - $links_on_page, 1 );
$maxPage = min( $curr_page + $links_on_page, $pagination['total'] );
if( $curr_page > 1 ) {
$result .= generate_pagination_link($curr_page-1, generate_pagination_image("prevpage")).$pagination_spacing;
}
for($i = $minPage; $i <= $maxPage; $i++ ) {
$title = abs($curr_page-$i) >= $links_on_page && $i != 1 ? "..." : $i;
if( $i != $curr_page)
$result .= generate_pagination_link($i, $title);
else
$result .= "<span class=\"pagecurrent\">$title</span>";
if( $i < $maxPage )
$result .= $pagination_spacing;
}
if( $curr_page < $pagination['total'] ) {
$result .= $pagination_spacing.generate_pagination_link($curr_page+1, generate_pagination_image("nextpage"));
}
$result.="</div>";
}
return $result;
}
?>

View File

@ -0,0 +1,46 @@
encoding=utf-8
output_charset=utf-8
output_encoding=utf-8
title=Open Web Messenger
head.name=<strong>Web Messenger</strong>&nbsp;&#8212; open-source live support software
head.descr=allows visitors of your site to chat with your operators
menu.home=home
menu.features=features
menu.demo=demo
menu.download=download
index.whatis.title=What is Web Messenger?
index.whatis="Web Messenger" - is unique software allowing visitors of your site to chat with your operators.
index.why.title=Why should I use Web Messenger?
index.why="Web Messenger" makes it easier to communicate with existing and potential clients. It will significantly increase conversion rates and online sales of your web site.
index.how.title=How it works?
index.how=You should place the button of Web Messenger at your site. Your visitors click the button and chat with your operators who help them.
index.license.title=License
index.license=This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0.
index.hosted=Project is hosted by SourceForge.
features.price.title=Pricing
features.price=<ul><li>Open-source code, absolutely free\n<li>Eclipse Public License 1.0</ul>
features.main.title=Main features
features.main=<ul><li>Chat button for email signatures\n<li>Differing buttons on same website</ul>
features.chat.title=Chat window
features.chat=<ul>\n<li>Agent and visitor "Typing Indicator"\n<li>Agent photo\n<li>Chat transcript emails\n<li>Sound and Visual alerts\n<li>"Leave a message" when you are away\n<li>Customize chat with your Logo, Name etc.\n<li>Unicode support for multiple languages\n<li>Quickly convert text to hyperlinks in chat\n<li>Not blocked by pop-up blockers\n</ul>
features.operator.title=Operator abilites
features.operator=<ul>\n<li>Web-based Operator Console\n<li>Canned messages for speed and consistency\n<li>Chat conversation history with search\n<li>Linking to previous visits, instant access to previous chats\n<li>Reassign/Transfer chat ownership\n<li>Mark/Highlight nuisance visitors\n</ul>
features.next.title=Nearest future (not ready yet)
features.next=<ul>\n<li>Operator to Operator IM (Discussion)\n<li>Push Web Pages\n<li>SSL Secured Chat\n<li>Pre-Chat Questionnaire\n<li>Multiple Departments\n<li>Define Initial Chat Window Size\n<li>Co-Browse to View Visitor's Location on Your Site\n<li>Dynamic Chat Icons\n</ul>
features.content.head=Content:
demo.title=DEMO
demo.click=Click this button:
demo.login=And/or login as administrator here (no password is required) :
demo.application=Web Messenger Application
downl.title=Latest
downl.release=Release:
downl.nightly=Nightly:
tag.pagination.info=Page {0} of {1}, {2}-{3} from {4}

View File

@ -0,0 +1,6 @@
encoding=utf-8
en=English
fr=Français
sp=Español
ru=Russian

View File

@ -0,0 +1,36 @@
encoding=cp1251
output_charset=utf-8
output_encoding=utf-8
title=Open Веб Мессенджер
head.name=<strong>Веб Мессенджер</strong> - бесплатное решение для онлайн поддержки
menu.home=главная
head.descr=позволяет посетителям вашего сайта легко общаться с вашими операторами
menu.demo=демо
menu.download=скачать
index.whatis.title=Что такое Веб Мессенджер?
index.license.title=Лицензия
demo.click=Нажмите на эту кнопку:
demo.application=Приложение Веб Мессенджер
tag.pagination.info=Страница {0} из {1}, показаны {2}-{3} из {4}
demo.login=И войдите в систему как администратор (пароль не требуется) :
menu.features=возможности
features.chat=<ul>\n<li>Уведомление о наборе текста собеседником\n<li>Фотография оператора в окне диалога\n<li>Возможность отправки истории диалога себе на email\n<li>Звуковые и визуальные оповещения\n<li>Возможность оставить сообщения при отсутствии операторов в онлайне\n<li>Кастомизация вашего логотипа и названия компании\n<li>Поддержка разных языков (Unicode)\n<li>Выделение ссылок в окне диалога с возможностью перехода\n<li>Всплывающее окно не блокируется большинством браузеров \n</ul>
features.chat.title=Окно диалога
features.main.title=Основные возможности
features.main=<ul>\n<li>Возможность включить код кнопки в email рассылку\n<li>Отображение кнопки в зависимости от присутствия операторов\n</ul>
features.operator.title=Возможности операторов
features.operator=<ul>\n<li>Веб-интерфейс для обслуживания посетителей\n<li>Шаблоны для быстрого ответа\n<li>История сообщений и поиск по ней\n<li>Доступ к предыдущим диалогам с текущим посетителем из чата\n<li>Перенаправление посетителя другому оператору\n<li>Выделение нежелательных посетителей в списке\n</ul>
features.price=<ul>\n<li>Открытый исходный код, свободное распространение\n<li>Eclipse Public License 1.0\n</ul>
features.price.title=Стоимость
index.license=В настоящее время Open Web Messenger выпускается под лицензией Eclipse Public License v1.0.
index.hosted=Проект разрабатывается на сервере SourceForge.net.
index.how.title=Как это работает?
index.how=Вы размещаете предоставленную кнопку связи с оператором на вашем сайте. Ваши посетители получают возможность пообщаться с вашими операторами не устанавливая дополнительного ПО.
index.whatis="Веб Мессенджер" - уникальное програмное обеспечение, позволяющее вашим посетителям общаться с операторами в режиме реального времени.
index.why.title=Почему нужно использовать Веб Мессенджер?
index.why=Веб Мессенджер упрощает взаимодействие с существующими и потенциальными клиентами. Он позволяет серьезно повысить онлайн продажи и улучшить отношение к вам ваших клиентов.
demo.title=Демонстрация работы
downl.release=Стабильная:
downl.nightly=Промежуточная:
features.content.head=Содержание:
downl.title=Последние версии