Newer
Older
/**
* HTML output functions
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <andi@splitbrain.org>
*/
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
function html_wikilink($id,$name=NULL,$search=''){
require_once(DOKU_INC.'inc/parser/xhtml.php');
static $xhtml_renderer = NULL;
if(is_null($xhtml_renderer)){
$xhtml_renderer = new Doku_Renderer_xhtml();
return $xhtml_renderer->internallink($id,$name,$search,true);
/**
* Helps building long attribute lists
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_attbuild($attributes){
$ret = '';
foreach ( $attributes as $key => $value ) {
$ret .= $key.'="'.formtext($value).'" ';
}
return trim($ret);
}
*/
function html_login(){
global $lang;
global $conf;
global $ID;
?>
<div align="center">
<form action="<?=script()?>" accept-charset="<?=$lang['encoding']?>" method="post">
<fieldset>
<legend><?=$lang['btn_login']?></legend>
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="hidden" name="do" value="login" />
<label>
<span><?=$lang['user']?></span>
<input type="text" name="u" value="<?=formText($_REQUEST['u'])?>" class="edit" />
</label><br />
<label>
<span><?=$lang['pass']?></span>
<input type="password" name="p" class="edit" />
</label><br />
<input type="submit" value="<?=$lang['btn_login']?>" class="button" />
<label for="remember" class="simple">
<input type="checkbox" name="r" id="remember" value="1" />
<span><?=$lang['remember']?></span>
</label>
</fieldset>
</form>
<?
if($conf['openregister']){
print '<p>';
print $lang['reghere'];
print ': <a href="'.wl($ID,'do=register').'" class="wikilink1">'.$lang['register'].'</a>';
print '</p>';
}
?>
</div>
<?
if(@file_exists('includes/login.txt')){
print io_cacheParse('includes/login.txt');
}
}
/**
* shows the edit/source/show button dependent on current mode
*/
function html_editbutton(){
global $ID;
global $REV;
global $ACT;
global $INFO;
if($ACT == 'show' || $ACT == 'search'){
if($INFO['writable']){
if($INFO['exists']){
$r = html_btn('edit',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
}else{
$r = html_btn('create',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
}
}else{
$r = html_btn('source',$ID,'v',array('do' => 'edit','rev' => $REV),'post');
}
}else{
$r = html_btn('show',$ID,'v',array('do' => 'show'));
}
return $r;
}
/**
* prints a section editing button
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_secedit_button($section,$p){
global $ID;
global $lang;
$secedit = '';
$secedit .= '<div class="secedit">';
$secedit .= html_btn('secedit',$ID,'',
array('do' => 'edit',
'lines' => "$section"),
'post');
$secedit .= '</div>';
/**
* inserts section edit buttons if wanted or removes the markers
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
if($INFO['writable'] && $show && !$INFO['rev']){
$text = preg_replace('#<!-- SECTION \[(\d+-\d+)\] -->#e',
"html_secedit_button('\\1',true)",
$text);
$text = preg_replace('#<!-- SECTION \[(\d+-)\] -->#e',
"html_secedit_button('\\1',false)",
$text);
}else{
$text = preg_replace('#<!-- SECTION \[(\d*-\d*)\] -->#e','',$text);
}
return $text;
}
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_topbtn(){
global $lang;
$ret = '';
$ret = '<a href="#top"><input type="button" class="button" value="'.$lang['btn_top'].'" onclick="window.scrollTo(0, 0)" /></a>';
*/
function html_btn($name,$id,$akey,$params,$method='get'){
global $conf;
global $lang;
$label = $lang['btn_'.$name];
$ret = '';
//filter id (without urlencoding)
$id = idfilter($id,false);
//make nice URLs even for buttons
if($conf['userewrite'] == 2){
$script = DOKU_BASE.DOKU_SCRIPT.'/'.$id;
}elseif($conf['userewrite']){
$script = DOKU_BASE.$id;
}else{
$ret .= '<form class="button" method="'.$method.'" action="'.$script.'" onsubmit="return svchk()">';
reset($params);
while (list($key, $val) = each($params)) {
$ret .= '<input type="hidden" name="'.$key.'" ';
$ret .= 'value="'.htmlspecialchars($val).'" />';
}
$ret .= '<input type="submit" value="'.htmlspecialchars($label).'" class="button" ';
if($akey){
$ret .= 'title="ALT+'.strtoupper($akey).'" ';
$ret .= 'accesskey="'.$akey.'" ';
}
$ret .= '/>';
$ret .= '</form>';
return $ret;
}
/**
* show a wiki page
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
global $ID;
global $REV;
global $HIGH;
//disable section editing for old revisions or in preview
print html_secedit(p_render('xhtml',p_get_instructions($txt),$info),$secedit);
if ($REV) print p_locale_xhtml('showrev');
$html = p_wiki_xhtml($ID,$REV,true);
print html_hilight($html,$HIGH);
}
}
/**
* Highlights searchqueries in HTML code
*/
function html_hilight($html,$query){
$queries = preg_split ("/\s/",$query,-1,PREG_SPLIT_NO_EMPTY);
foreach ($queries as $q){
$q = preg_quote($q,'/');
$html = preg_replace("/((<[^>]*)|$q)/ie", '"\2"=="\1"? "\1":"<span class=\"search_hit\">\1</span>"', $html);
}
return $html;
}
/**
* Run a search and display the result
*
* @author Andreas Gohr <andi@splitbrain.org>
require_once(DOKU_INC.'inc/search.php');
global $conf;
global $QUERY;
global $ID;
global $lang;
print '<script language="javascript" type="text/javascript" charset="utf-8">';
print 'showLoadBar();';
print '</script>';
print '<br /></div>';
search($data,$conf['datadir'],'search_pagename',array(query => cleanID($QUERY)));
if(count($data)){
sort($data);
print '<div class="search_quickresult">';
print '<b>'.$lang[quickhits].':</b><br />';
foreach($data as $row){
print '<div class="search_quickhits">';
print html_wikilink(':'.$row['id'],$conf['useheading']?NULL:$row['id']);
print '</div> ';
}
//clear float (see http://www.complexspiral.com/publications/containing-floats/)
print '<div class="clearer"> </div>';
print '</div>';
}
flush();
//do fulltext search
$data = array();
search($data,$conf['datadir'],'search_fulltext',array(query => utf8_strtolower($QUERY)));
if(count($data)){
usort($data,'sort_search_fulltext');
foreach($data as $row){
print '<div class="search_result">';
print html_wikilink(':'.$row['id'],$conf['useheading']?NULL:$row['id'],$row['poswords']);
print ': <span class="search_cnt">'.$row['count'].' '.$lang['hits'].'</span><br />';
print '<div class="search_snippet">'.$row['snippet'].'</div>';
print '</div>';
}
}else{
print '<div class="nothing">'.$lang['nothingfound'].'</div>';
print '<script language="javascript" type="text/javascript" charset="utf-8">';
/**
* Display error on locked pages
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
$locktime = filemtime(wikiFN($ID).'.lock');
$expire = @date($conf['dformat'], $locktime + $conf['locktime'] );
$min = round(($conf['locktime'] - (time() - $locktime) )/60);
print '<li><b>'.$lang['lockedby'].':</b> '.$INFO['locked'].'</li>';
print '<li><b>'.$lang['lockexpire'].':</b> '.$expire.' ('.$min.' min)</li>';
print '</ul>';
}
/**
* list old revisions
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_revisions(){
global $ID;
global $INFO;
global $conf;
global $lang;
$revisions = getRevisions($ID);
$date = @date($conf['dformat'],$INFO['lastmod']);
print ' <img src="'.DOKU_BASE.'lib/images/blank.gif" border="0" width="15" height="11" alt="" /> ';
print '<a class="wikilink1" href="'.wl($ID).'">'.$ID.'</a> ';
print ' <span class="user">';
print $INFO['editor'];
print '</span> ';
print '('.$lang['current'].')';
print '</li>';
}
foreach($revisions as $rev){
$date = date($conf['dformat'],$rev);
print $date;
print ' <a href="'.wl($ID,"rev=$rev,do=diff").'">';
print '<img src="'.DOKU_BASE.'lib/images/diff.png" border="0" width="15" height="11" title="'.$lang['diff'].'" />';
print '<a class="wikilink1" href="'.wl($ID,"rev=$rev").'">'.$ID.'</a> ';
print ' <span class="user">';
if($info['user']){
print $info['user'];
}else{
print $info['ip'];
}
print '</span>';
/**
* display recent changes
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
/* we need to get one additionally log entry to be able to
* decide if this is the last page or is there another one.
* This is the cheapest solution to get this information.
*/
$recents = getRecents($first,$conf['recent'] + 1,true);
if(count($recents) == 0 && $first != 0){
$first=0;
$recents = getRecents(0,$conf['recent'] + 1,true);
}
$cnt = count($recents) <= $conf['recent'] ? count($recents) : $conf['recent'];
$date = date($conf['dformat'],$recents[$id]['date']);
print '<li>';
print '<a href="'.wl($id,"do=diff").'">';
print '<img src="'.DOKU_BASE.'lib/images/diff.png" border="0" width="15" height="11" title="'.$lang['diff'].'" />';
print '</a> ';
print '<a href="'.wl($id,"do=revisions").'">';
print '<img src="'.DOKU_BASE.'lib/images/history.png" border="0" width="12" height="14" title="'.$lang['btn_revs'].'" />';
print ' <span class="user">';
if($recents[$id]['user']){
print $recents[$id]['user'];
}else{
print $recents[$id]['ip'];
}
print '</span>';
if ($first > 0) {
$first -= $conf['recent'];
if ($first < 0) $first = 0;
print '<div class="pagenav-prev">';
print html_btn('newer','',"p",array('do' => 'recent', 'first' => $first));
if ($conf['recent'] < count($recents)) {
print html_btn('older','',"n",array('do' => 'recent', 'first' => $last));
/**
* Display page index
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
require_once(DOKU_INC.'inc/search.php');
global $conf;
global $ID;
$dir = $conf['datadir'];
$ns = cleanID($ns);
if(empty($ns)){
$ns = dirname(str_replace(':','/',$ID));
if($ns == '.') $ns ='';
}
$ns = utf8_encodeFN(str_replace(':','/',$ns));
$data = array();
search($data,$conf['datadir'],'search_index',array('ns' => $ns));
*/
function html_list_index($item){
$ret = '';
$base = ':'.$item['id'];
$base = substr($base,strrpos($base,':')+1);
if($item['type']=='d'){
$ret .= '<a href="'.wl($ID,'idx='.$item['id']).'" class="idx_dir">';
$ret .= $base;
$ret .= '</a>';
}else{
$ret .= html_wikilink(':'.$item['id']);
}
return $ret;
}
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
/**
* Index List item
*
* This user function is used in html_build_lidt to build the
* <li> tags for namespaces when displaying the page index
* it gives different classes to opened or closed "folders"
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_li_index($item){
if($item['type'] == "f"){
return '<li class="level'.$item['level'].'">';
}elseif($item['open']){
return '<li class="open">';
}else{
return '<li class="closed">';
}
}
/**
* Default List item
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_li_default($item){
return '<li class="level'.$item['level'].'">';
}
* Build an unordered list from the given $data array
* Each item in the array has to have a 'level' property
* the item itself gets printed by the given $func user
* function. The second and optional function is used to
* print the <li> tag. Both user function need to accept
* a single item.
function html_buildlist($data,$class,$func,$lifunc='html_li_default'){
$level = 0;
$opens = 0;
$ret = '';
foreach ($data as $item){
if( $item['level'] > $level ){
//open new list
for($i=0; $i<($item['level'] - $level); $i++){
if ($i) $ret .= "<li class=\"clear\">\n";
$ret .= "\n<ul class=\"$class\">\n";
}
}elseif( $item['level'] < $level ){
//close last item
$ret .= "</li>\n";
for ($i=0; $i<($level - $item['level']); $i++){
//close higher lists
$ret .= "</ul>\n</li>\n";
}
}else{
//close last item
$ret .= "</li>\n";
}
//remember current level
$level = $item['level'];
//print item
$ret .= '<span class="li">';
$ret .= $func($item); //user function
$ret .= '</span>';
}
//close remaining items and lists
for ($i=0; $i < $level; $i++){
$ret .= "</li></ul>\n";
}
return $ret;
}
/**
* display backlinks
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
require_once(DOKU_INC.'inc/search.php');
global $ID;
global $conf;
if(preg_match('#^(.*):(.*)$#',$ID,$matches)){
$opts['ns'] = $matches[1];
$opts['name'] = $matches[2];
}else{
$opts['ns'] = '';
$opts['name'] = $ID;
}
$data = array();
search($data,$conf['datadir'],'search_backlinks',$opts);
sort($data);
print '<ul class="idx">';
foreach($data as $row){
print '<li>';
print html_wikilink(':'.$row['id'],$conf['useheading']?NULL:$row['id']);
/**
* show diff
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
require_once(DOKU_INC.'inc/DifferenceEngine.php');
global $ID;
global $REV;
global $lang;
global $conf;
if($text){
$df = new Diff(split("\n",htmlspecialchars(rawWiki($ID,''))),
split("\n",htmlspecialchars(cleanText($text))));
$left = '<a class="wikilink1" href="'.wl($ID).'">'.
$ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a>'.
$lang['current'];
$right = $lang['yours'];
}else{
if($REV){
$r = $REV;
}else{
//use last revision if none given
$revs = getRevisions($ID);
$r = $revs[0];
}
$df = new Diff(split("\n",htmlspecialchars(rawWiki($ID,$r))),
$left = '<a class="wikilink1" href="'.wl($ID,"rev=$r").'">'.
$ID.' '.date($conf['dformat'],$r).'</a>';
$right = '<a class="wikilink1" href="'.wl($ID).'">'.
$ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a> '.
$lang['current'];
}
$tdf = new TableDiffFormatter();
?>
<table class="diff" width="100%">
<tr>
<td colspan="2" width="50%" class="diff-header">
<?=$left?>
</td>
<td colspan="2" width="50%" class="diff-header">
<?=$right?>
</td>
</tr>
<?=$tdf->format($df)?>
</table>
<?
}
/**
* show warning on conflict detection
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_conflict($text,$summary){
global $ID;
global $lang;
?>
<form name="editform" method="post" action="<?=script()?>" accept-charset="<?=$lang['encoding']?>">
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="hidden" name="wikitext" value="<?=formText($text)?>" />
<input type="hidden" name="summary" value="<?=formText($summary)?>" />
<div align="center">
<input class="button" type="submit" name="do" value="<?=$lang['btn_save']?>" accesskey="s" title="[ALT+S]" />
<input class="button" type="submit" name="do" value="<?=$lang['btn_cancel']?>" />
</div>
</form>
<br /><br /><br /><br />
<?
}
/**
* Prints the global message array
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_msgarea(){
global $MSG;
if(!isset($MSG)) return;
foreach($MSG as $msg){
print '<div class="'.$msg['lvl'].'">';
print $msg['msg'];
print '</div>';
}
}
/**
* Prints the registration form
?>
<div align="center">
<form name="register" method="post" action="<?=wl($ID)?>" accept-charset="<?=$lang['encoding']?>">
<input type="hidden" name="do" value="register" />
<input type="hidden" name="save" value="1" />
<fieldset>
<legend><?=$lang['register']?></legend>
<label>
<?=$lang['user']?>
<input type="text" name="login" class="edit" size="50" value="<?=formText($_POST['login'])?>" />
</label><br />
<?php
if (!$conf['autopasswd']) {
?>
<label>
<?=$lang['pass']?>
<input type="password" name="pass" class="edit" size="50" />
</label><br />
<label>
<?=$lang['passchk']?>
<input type="password" name="passchk" class="edit" size="50" />
</label><br />
<?php
}
?>
<label>
<?=$lang['fullname']?>
<input type="text" name="fullname" class="edit" size="50" value="<?=formText($_POST['fullname'])?>" />
</label><br />
<label>
<?=$lang['email']?>
<input type="text" name="email" class="edit" size="50" value="<?=formText($_POST['email'])?>" />
</label><br />
<input type="submit" class="button" value="<?=$lang['register']?>" />
</fieldset>
</form>
</div>
<?
}
/**
* This displays the edit form (lots of logic included)
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
*/
function html_edit($text=null,$include='edit'){ //FIXME: include needed?
global $ID;
global $REV;
global $DATE;
global $RANGE;
global $PRE;
global $SUF;
global $INFO;
global $SUM;
global $lang;
global $conf;
//set summary default
if(!$SUM){
if($REV){
$SUM = $lang['restored'];
}elseif(!$INFO['exists']){
$SUM = $lang['created'];
}
}
//no text? Load it!
if(!isset($text)){
$pr = false; //no preview mode
if($RANGE){
list($PRE,$text,$SUF) = rawWikiSlices($RANGE,$ID,$REV);
}else{
$text = rawWiki($ID,$REV);
}
}else{
$pr = true; //preview mode
}
$wr = $INFO['writable'];
if($wr){
if ($REV) print p_locale_xhtml('editrev');
print p_locale_xhtml($include);
$ro='readonly="readonly"';
}
if(!$DATE) $DATE = $INFO['lastmod'];
?>
<form name="editform" method="post" action="<?=script()?>" accept-charset="<?=$lang['encoding']?>" onsubmit="return svchk()">
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="hidden" name="rev" value="<?=$REV?>" />
<input type="hidden" name="date" value="<?=$DATE?>" />
<input type="hidden" name="prefix" value="<?=formText($PRE)?>" />
<input type="hidden" name="suffix" value="<?=formText($SUF)?>" />
<table style="width:99%">
<tr>
<script language="javascript" type="text/javascript" charset="utf-8">
<?/* sets changed to true when previewed */?>
textChanged = <? ($pr) ? print 'true' : print 'false' ?>;
formatButton('bold.png','<?=$lang['qb_bold']?>','**','**','<?=$lang['qb_bold']?>','b');
formatButton('italic.png','<?=$lang['qb_italic']?>',"\/\/","\/\/",'<?=$lang['qb_italic']?>','i');
formatButton('underline.png','<?=$lang['qb_underl']?>','__','__','<?=$lang['qb_underl']?>','u');
formatButton('code.png','<?=$lang['qb_code']?>','\'\'','\'\'','<?=$lang['qb_code']?>','c');
formatButton('strike.png','<?=$lang['qb_strike']?>','<del>','<\/del>','<?=$lang['qb_strike']?>','d');
formatButton('fonth1.png','<?=$lang['qb_h1']?>','====== ',' ======\n','<?=$lang['qb_h1']?>','1');
formatButton('fonth2.png','<?=$lang['qb_h2']?>','===== ',' =====\n','<?=$lang['qb_h2']?>','2');
formatButton('fonth3.png','<?=$lang['qb_h3']?>','==== ',' ====\n','<?=$lang['qb_h3']?>','3');
formatButton('fonth4.png','<?=$lang['qb_h4']?>','=== ',' ===\n','<?=$lang['qb_h4']?>','4');
formatButton('fonth5.png','<?=$lang['qb_h5']?>','== ',' ==\n','<?=$lang['qb_h5']?>','5');
formatButton('link.png','<?=$lang['qb_link']?>','[[',']]','<?=$lang['qb_link']?>','l');
formatButton('extlink.png','<?=$lang['qb_extlink']?>','[[',']]','http://www.example.com|<?=$lang['qb_extlink']?>');
formatButton('list.png','<?=$lang['qb_ol']?>',' - ','\n','<?=$lang['qb_ol']?>');
formatButton('list_ul.png','<?=$lang['qb_ul']?>',' * ','\n','<?=$lang['qb_ul']?>');
insertButton('rule.png','<?=$lang['qb_hr']?>','----\n');
mediaButton('image.png','<?=$lang['qb_media']?>','m','<?=$INFO['namespace']?>');
echo "insertButton('sig.png','".$lang['qb_sig']."','".html_signature()."','y');";
<textarea name="wikitext" id="wikitext" <?=$ro?> cols="80" rows="10" class="edit" onchange="textChanged = true;" onkeyup="summaryCheck();" tabindex="1"><?="\n".formText($text)?></textarea>
<td>
<?if($wr){?>
<input class="button" type="submit" name="do" value="<?=$lang['btn_save']?>" accesskey="s" title="[ALT+S]" onclick="textChanged=false" onkeypress="textChanged=false" tabindex="3" />
<input class="button" type="submit" name="do" value="<?=$lang['btn_preview']?>" accesskey="p" title="[ALT+P]" onclick="textChanged=false" onkeypress="textChanged=false" tabindex="4" />
<input class="button" type="submit" name="do" value="<?=$lang['btn_cancel']?>" tabindex="5" />
<?}?>
</td>
<td>
<?if($wr){?>
<?=$lang['summary']?>:
<input type="text" class="edit" name="summary" id="summary" size="50" onkeyup="summaryCheck();" value="<?=formText($SUM)?>" tabindex="2" />
<script language="javascript" type="text/javascript" charset="utf-8">
showSizeCtl();
<?if($wr){?>
init_locktimer(<?=$conf['locktime']-60?>,'<?=$lang['willexpire']?>');
ajax_spell.init('<?=$lang['spell_start']?>','<?=$lang['spell_stop']?>','<?=$lang['spell_wait']?>','<?=$lang['spell_noerr']?>','<?=$lang['spell_nosug']?>','<?=$lang['spell_change']?>');
<?}?>
</script>
</td>
</tr>
</table>
</form>
<?
}
/**
* prepares the signature string as configured in the config
*/
function html_signature(){
global $conf;
global $INFO;
$sig = $conf['signature'];
$sig = strftime($sig);
$sig = str_replace('@USER@',$_SERVER['REMOTE_USER'],$sig);
$sig = str_replace('@NAME@',$INFO['userinfo']['name'],$sig);
$sig = str_replace('@MAIL@',$INFO['userinfo']['mail'],$sig);
$sig = str_replace('@DATE@',date($conf['dformat']),$sig);
return $sig;
}
/**
* prints some debug info
//remove sensitive data
$cnf = $conf;
$cnf['auth']='***';
$cnf['notify']='***';
print '<html><body>';
print '<p>When reporting bugs please send all the following ';
print 'output as a mail to andi@splitbrain.org ';
print 'The best way to do this is to save this page in your browser</p>';
print '<b>$_SERVER:</b><pre>';
print_r($_SERVER);
print '</pre>';
print '<b>$conf:</b><pre>';
print '<b>DOKU_BASE:</b><pre>';
print DOKU_BASE;
print '</pre>';
print '<b>abs DOKU_BASE:</b><pre>';
print DOKU_URL;
print '<b>rel DOKU_BASE:</b><pre>';
print dirname($_SERVER['PHP_SELF']).'/';
print '</pre>';
print '<b>PHP Version:</b><pre>';
print phpversion();
print '</pre>';
print '<b>locale:</b><pre>';
print setlocale(LC_ALL,0);
print '</pre>';
print '<b>encoding:</b><pre>';
print $lang['encoding'];
print '</pre>';
print '<b>Environment:</b><pre>';
print_r($_ENV);
print '</pre>';