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__).'/../').'/');
require_once(DOKU_INC.'inc/format.php');
*/
function html_wikilink($url,$name='',$search=''){
global $conf;
$link = array();
$link['url'] = $url;
$link['name'] = $name;
$link = format_link_wiki($link);
if($search){
($conf['userewrite']) ? $link['url'].='?s=' : $link['url'].='&s=';
$link['url'] .= urlencode($search);
}
return format_link_build($link);
}
/**
* The loginform
*/
function html_login(){
global $lang;
global $conf;
global $ID;
print parsedLocale('login');
?>
<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 = '';
if($p) $secedit .= "</p>\n";
$secedit .= '<div class="secedit">';
$secedit .= html_btn('secedit',$ID,'',
array('do' => 'edit',
'lines' => "$section"),
'post');
$secedit .= '</div>';
if($p) $secedit .= "\n<p>";
return $secedit;
}
/**
* inserts section edit buttons if wanted or removes the markers
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_secedit($text,$show=true){
global $INFO;
if($INFO['writable'] && $show){
$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;
}
/**
* displays the breadcrumbs trace
*/
function html_breadcrumbs(){
global $lang;
global $conf;
//check if enabled
if(!$conf['breadcrumbs']) return;
$crumbs = breadcrumbs(); //setup crumb trace
print '<div class="breadcrumbs">';
print $lang['breadcrumb'].':';
foreach ($crumbs as $crumb){
print ' » ';
print '<a href="'.wl($crumb).'" class="breadcrumbs" onclick="return svchk()" onkeypress="return svchk()" title="'.$crumb.'">'.noNS($crumb).'</a>';
}
print '</div>';
}
/**
* display the HTML head and metadata
*/
function html_head(){
global $ID;
global $ACT;
global $INFO;
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"';
print ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
print "\n";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['lang']?>" lang="<?=$conf['lang']?>" dir="ltr">
<head>
<title><?=$ID?> [<?=$conf['title']?>]</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$lang['encoding']?>" />
<meta name="generator" content="DokuWiki <?=getVersion()?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_BASE?>style.css" />
<link rel="stylesheet" media="print" type="text/css" href="<?=DOKU_BASE?>print.css" />
<link rel="shortcut icon" href="<?=DOKU_BASE?>images/favicon.ico" />
<link rel="start" href="<?=wl()?>" />
<link rel="contents" href="<?=wl($ID,'do=index')?>" title="<?=$lang['index']?>" />
<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="<?=DOKU_BASE?>feed.php" />
<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="<?=DOKU_BASE?>feed.php?mode=list&ns=<?=$INFO['namespace']?>" />
<link rel="alternate" type="text/html" title="Plain HTML" href="<?=wl($ID,'do=export_html')?>" />
<link rel="alternate" type="text/plain" title="Wiki Markup" href="<?=wl($ID, 'do=export_raw')?>" />
<?
if( ($ACT=='show' || $ACT=='export_html') && !$REV){
if($INFO['exists']){
print ' <meta name="robots" content="index,follow" />'."\n";
print ' <meta name="date" content="'.date('Y-m-d\TH:i:sO',$INFO['lastmod']).'" />'."\n";
}else{
print ' <meta name="robots" content="noindex,follow" />'."\n";
}
}else{
print ' <meta name="robots" content="noindex,nofollow" />'."\n";
}
?>
<script language="JavaScript" type="text/javascript">
var alertText = '<?=$lang['qb_alert']?>';
var notSavedYet = '<?=$lang['notsavedyet']?>';
var DOKU_BASE = '<?=DOKU_BASE?>';
<script language="JavaScript" type="text/javascript" src="<?=DOKU_BASE?>script.js"></script>
<!--[if gte IE 5]>
<style type="text/css">
/* that IE 5+ conditional comment makes this only visible in IE 5+ */
img { behavior: url("<?=DOKU_BASE?>pngbehavior.htc"); } /* IE bugfix for transparent PNGs */
</style>
<![endif]-->
<?@include("includes/meta.html")?>
</head>
<?
}
/**
* Displays a button (using it's own form)
*/
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']){
$script = DOKU_BASE.$id;
}
$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;
}
/**
* Check for the given permission or prints an error
*/
function html_acl($perm){
global $INFO;
if($INFO['perm'] >= $perm) return true;
print parsedLocale('denied');
return false;
}
/**
*/
function html_header(){
global $ID;
global $REV;
global $lang;
global $conf;
html_head();
?>
<body>
<div class="all">
<?
<div class="stylehead">
<div class="header">
<div class="pagename">
[[<a href="<?=wl($ID,'do=backlink')?>" onclick="return svchk()" onkeypress="return svchk()"><?=$ID?></a>]]
</div>
<div class="logo">
<a href="<?=wl()?>" name="top" accesskey="h" title="[ALT+H]" onclick="return svchk()" onkeypress="return svchk()"><?=$conf['title']?></a>
</div>
<?@include("includes/header.html")?>
<div class="bar" id="bar_top">
<div class="bar-left" id="bar_topleft">
<?=html_editbutton()?>
<?=html_btn(revs,$ID,'o',array('do' => 'revisions'))?>
</div>
<div class="bar-right" id="bar_topright">
<?=html_btn(recent,'','r',array('do' => 'recent'))?>
<form action="<?=wl()?>" accept-charset="<?=$lang['encoding']?>">
<input type="hidden" name="do" value="search" />
<input type="text" accesskey="f" name="id" class="edit" />
<input type="submit" value="<?=$lang['btn_search']?>" class="button" />
</form>
</div>
<?
flush();
html_breadcrumbs();
@include("includes/pageheader.html");
?>
</div>
<div class="page">
<!-- wikipage start -->
<?
}
/**
* Displays some Metadata like who's logged in and the last modified
* date - do not confuse this with the HTML meta header.
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
*/
function html_metainfo(){
global $conf;
global $lang;
global $INFO;
global $REV;
$fn = $INFO['filepath'];
if(!$conf['fullpath']){
if($REV){
$fn = str_replace(realpath($conf['olddir']).DIRECTORY_SEPARATOR,'',$fn);
}else{
$fn = str_replace(realpath($conf['datadir']).DIRECTORY_SEPARATOR,'',$fn);
}
}
$date = date($conf['dformat'],$INFO['lastmod']);
print '<div class="meta">';
if($_SERVER['REMOTE_USER']){
print '<div class="user">';
print $lang['loggedinas'].': '.$_SERVER['REMOTE_USER'];
print '</div>';
}
print ' ';
if($INFO['exists']){
print $fn;
print ' · ';
print $lang['lastmod'];
print ': ';
print $date;
if($INFO['editor']){
print ' '.$lang['by'].' ';
print $INFO['editor'];
}
if($INFO['locked']){
print ' · ';
print $lang['lockedby'];
print ': ';
print $INFO['locked'];
}
}
print '</div>';
}
/**
* Diplay the overall footer
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_footer(){
global $ID;
global $REV;
global $INFO;
global $lang;
global $conf;
?>
<!-- wikipage stop -->
</div>
<div class="clearer"> </div>
<div class="stylefoot">
<?
flush();
@include("includes/pagefooter.html");
html_metainfo();
?>
<div class="bar" id="bar_bottom">
<div class="bar-left" id="bar_bottomleft">
<?=html_editbutton()?>
<?=html_btn(revs,$ID,'o',array('do' => 'revisions'))?>
<div class="bar-right" id="bar_bottomright">
<?
if($conf['useacl']){
if($_SERVER['REMOTE_USER']){
print html_btn('logout',$ID,'',array('do' => 'logout',));
}else{
print html_btn('login',$ID,'',array('do' => 'login'));
}
#//acl-admin button
#if($INFO['perm'] == AUTH_GRANT){
# print html_btn('acl_admin',$ID,'',array('do' => 'acl_admin'));
#}
?>
<?=html_btn(index,$ID,'x',array('do' => 'index'))?>
<a href="#top"><input type="button" class="button" value="<?=$lang['btn_top']?>" /></a>
</div>
</div>
</div>
<?@include("includes/footer.html")?>
</div>
</body>
</html>
<?
}
/**
* Print the table of contents
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_toc($toc){
global $lang;
$ret = '';
$ret .= '<div class="toc">';
$ret .= '<div class="tocheader">';
$ret .= $lang['toc'];
$ret .= ' <script type="text/javascript">';
$ret .= 'showTocToggle("+","-")';
$ret .= '</script>';
$ret .= '</div>';
$ret .= '<div id="tocinside">';
$ret .= html_buildlist($toc,'toc','html_list_toc');
$ret .= '</div>';
$ret .= '</div>';
return $ret;
}
/**
*/
function html_list_toc($item){
$ret = '';
$ret .= '<a href="#'.$item['id'].'" class="toc">';
$ret .= $item['name'];
$ret .= '</a>';
return $ret;
}
/**
* show a wiki page
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
function html_show($text=''){
global $ID;
global $REV;
global $HIGH;
//disable section editing for old revisions or in preview
if($text || $REV){
global $parser;
$parser['secedit'] = false;
}
if ($text){
//PreviewHeader
print parsedLocale('preview');
print '<div class="preview">';
print html_secedit(parse($text),false);
print '</div>';
}else{
if ($REV) print parsedLocale('showrev');
$html = parsedWiki($ID,$REV,true);
$html = html_secedit($html);
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 parsedLocale('searchpage');
flush();
//show progressbar
print '<div align="center">';
print '<script language="JavaScript" type="text/javascript">';
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'],$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'],$row['id'],$QUERY);
print ': <span class="search_cnt">'.$row['count'].' '.$lang['hits'].'</span><br />';
print '<div class="search_snippet">'.$row['snippet'].'</div>';
print '</div>';
}
}else{
print '<div align="center">'.$lang['nothingfound'].'</div>';
}
//hide progressbar
print '<script language="JavaScript" type="text/javascript">';
print 'hideLoadBar();';
print '</script>';
/**
* Display error on locked pages
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_locked($ip){
global $ID;
global $conf;
global $lang;
$locktime = filemtime(wikiFN($ID).'.lock');
$expire = @date($conf['dformat'], $locktime + $conf['locktime'] );
$min = round(($conf['locktime'] - (time() - $locktime) )/60);
print parsedLocale('locked');
print '<ul>';
print '<li><b>'.$lang['lockedby'].':</b> '.$ip.'</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 parsedLocale('revisions');
print '<ul>';
if($INFO['exists']){
print '<li>';
print $date.' <a class="wikilink1" href="'.wl($ID).'">'.$ID.'</a> ';
print $INFO['sum'];
print ' <span class="user">(';
print $INFO['ip'];
if($INFO['user']) print ' '.$INFO['user'];
print ')</span> ';
print '('.$lang['current'].')';
print '</li>';
}
foreach($revisions as $rev){
$date = date($conf['dformat'],$rev);
print '<li>';
print $date.' <a class="wikilink1" href="'.wl($ID,"rev=$rev").'">'.$ID.'</a> ';
print $info['sum'];
print ' <span class="user">(';
print $info['ip'];
if($info['user']) print ' '.$info['user'];
print ')</span> ';
print '<a href="'.wl($ID,"rev=$rev,do=diff").'">';
print '<img src="'.DOKU_BASE.'images/diff.png" border="0" width="15" height="11" title="'.$lang['diff'].'" />';
/**
* display recent changes
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_recent(){
global $conf;
$recents = getRecents(0,true);
print parsedLocale('recent');
print '<ul>';
foreach(array_keys($recents) as $id){
$date = date($conf['dformat'],$recents[$id]['date']);
print '<li>';
print $date.' '.html_wikilink($id,$id);
print ' '.htmlspecialchars($recents[$id]['sum']);
print ' <span class="user">(';
print $recents[$id]['ip'];
if($recents[$id]['user']) print ' '.$recents[$id]['user'];
print ')</span>';
print '</li>';
}
print '</ul>';
}
/**
* 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));
print parsedLocale('index');
$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;
}
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
/**
* 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');
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
global $ID;
global $conf;
if(preg_match('#^(.*):(.*)$#',$ID,$matches)){
$opts['ns'] = $matches[1];
$opts['name'] = $matches[2];
}else{
$opts['ns'] = '';
$opts['name'] = $ID;
}
print parsedLocale('backlinks');
$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'],$row['id']);
print '</li>';
}
print '</ul>';
}
/**
* show diff
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
require_once(DOKU_INC.'inc/DifferenceEngine.php');
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
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{
$df = new Diff(split("\n",htmlspecialchars(rawWiki($ID,$REV))),
split("\n",htmlspecialchars(rawWiki($ID,''))));
$left = '<a class="wikilink1" href="'.wl($ID,"rev=$REV").'">'.
$ID.' '.date($conf['dformat'],$REV).'</a>';
$right = '<a class="wikilink1" href="'.wl($ID).'">'.
$ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a> '.
$lang['current'];
}
$tdf = new TableDiffFormatter();
if($intro) print parsedLocale('diff');
?>
<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;
print parsedLocale('conflict');
?>
<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
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
*/
function html_register(){
global $lang;
global $ID;
print parsedLocale('register');
?>
<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 />
<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)
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*/
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;
//check for create permissions first
if(!$INFO['exists'] && !html_acl(AUTH_CREATE)) return;
//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