xref: /dokuwiki/inc/html.php (revision 8d975344733b7ae67df7b86295348b661bbe0385)
1ed7b5f09Sandi<?php
215fae107Sandi/**
315fae107Sandi * HTML output functions
415fae107Sandi *
515fae107Sandi * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
615fae107Sandi * @author     Andreas Gohr <andi@splitbrain.org>
715fae107Sandi */
815fae107Sandi
9ed7b5f09Sandi  if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
10f3f0262cSandi
116bbae538Sandi  require_once(DOKU_INC.'inc/parserutils.php');
126bbae538Sandi
13f3f0262cSandi/**
14f3f0262cSandi * Convenience function to quickly build a wikilink
1515fae107Sandi *
1615fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
17f3f0262cSandi */
1830f1737dSandifunction html_wikilink($id,$name=NULL,$search=''){
19723d78dbSandi  static $xhtml_renderer = NULL;
20723d78dbSandi  if(is_null($xhtml_renderer)){
21fdf3dcb9SMatthias Urlichs    require_once(DOKU_INC.'inc/parser/xhtml.php');
22723d78dbSandi    $xhtml_renderer = new Doku_Renderer_xhtml();
23f3f0262cSandi  }
24f3f0262cSandi
25cffcc403Sandi  return $xhtml_renderer->internallink($id,$name,$search,true);
26f3f0262cSandi}
27f3f0262cSandi
28f3f0262cSandi/**
29c19fe9c0Sandi * Helps building long attribute lists
30c19fe9c0Sandi *
31c19fe9c0Sandi * @author Andreas Gohr <andi@splitbrain.org>
32c19fe9c0Sandi */
33c19fe9c0Sandifunction html_attbuild($attributes){
34c19fe9c0Sandi  $ret = '';
35c19fe9c0Sandi  foreach ( $attributes as $key => $value ) {
36c19fe9c0Sandi    $ret .= $key.'="'.formtext($value).'" ';
37c19fe9c0Sandi  }
38c19fe9c0Sandi  return trim($ret);
39c19fe9c0Sandi}
40c19fe9c0Sandi
41c19fe9c0Sandi/**
42f3f0262cSandi * The loginform
4315fae107Sandi *
4415fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
45f3f0262cSandi */
46f3f0262cSandifunction html_login(){
47f3f0262cSandi  global $lang;
48f3f0262cSandi  global $conf;
49f3f0262cSandi  global $ID;
50cd52f92dSchris  global $auth;
51f3f0262cSandi
52c112d578Sandi  print p_locale_xhtml('login');
53f3f0262cSandi  ?>
5496331712SAnika Henke    <div class="centeralign">
55*8d975344SAndreas Gohr    <form action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>"
56*8d975344SAndreas Gohr          method="post" name="login">
57f3f0262cSandi      <fieldset>
584da078a3Smatthiasgrimm        <legend><?php echo $lang['btn_login']?></legend>
594da078a3Smatthiasgrimm        <input type="hidden" name="id" value="<?php echo $ID?>" />
60f3f0262cSandi        <input type="hidden" name="do" value="login" />
61b6912aeaSAndreas Gohr        <label class="block">
624da078a3Smatthiasgrimm          <span><?php echo $lang['user']?></span>
63*8d975344SAndreas Gohr          <input type="text" name="u" value="<?php echo formText($_REQUEST['u'])?>"
64*8d975344SAndreas Gohr                 class="edit" id="focus__this" />
65f3f0262cSandi        </label><br />
66b6912aeaSAndreas Gohr        <label class="block">
674da078a3Smatthiasgrimm          <span><?php echo $lang['pass']?></span>
68f3f0262cSandi          <input type="password" name="p" class="edit" />
69f3f0262cSandi        </label><br />
700c1887a0SAndreas Gohr        <label for="remember__me" class="simple">
714d6f545eSAndreas Gohr          <input type="checkbox" name="r" id="remember__me" value="1" />
724da078a3Smatthiasgrimm          <span><?php echo $lang['remember']?></span>
73132bdbfeSandi        </label>
74*8d975344SAndreas Gohr        <input type="submit" value="<?php echo $lang['btn_login']?>" class="button" />
75f3f0262cSandi      </fieldset>
76f3f0262cSandi    </form>
774da078a3Smatthiasgrimm  <?php
7882fd59b6SAndreas Gohr    if($auth->canDo('addUser') && $conf['openregister']){
79f3f0262cSandi      print '<p>';
80f3f0262cSandi      print $lang['reghere'];
81f3f0262cSandi      print ': <a href="'.wl($ID,'do=register').'" class="wikilink1">'.$lang['register'].'</a>';
82f3f0262cSandi      print '</p>';
83f3f0262cSandi    }
848b06d178Schris
8582fd59b6SAndreas Gohr    if ($auth->canDo('modPass') && $conf['resendpasswd']) {
868b06d178Schris      print '<p>';
878b06d178Schris      print $lang['pwdforget'];
88753d5abfSMatthias Grimm      print ': <a href="'.wl($ID,'do=resendpwd').'" class="wikilink1">'.$lang['btn_resendpwd'].'</a>';
898b06d178Schris      print '</p>';
908b06d178Schris    }
91f3f0262cSandi  ?>
92f3f0262cSandi    </div>
934da078a3Smatthiasgrimm  <?php
946bbae538Sandi/*
956bbae538Sandi FIXME provide new hook
96f3f0262cSandi  if(@file_exists('includes/login.txt')){
97f3f0262cSandi    print io_cacheParse('includes/login.txt');
98f3f0262cSandi  }
996bbae538Sandi*/
100f3f0262cSandi}
101f3f0262cSandi
102f3f0262cSandi/**
103ee4c4a1bSAndreas Gohr * shows the edit/source/show/draft button dependent on current mode
10415fae107Sandi *
10515fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
106f3f0262cSandi */
107f3f0262cSandifunction html_editbutton(){
108f3f0262cSandi  global $ID;
109f3f0262cSandi  global $REV;
110f3f0262cSandi  global $ACT;
111f3f0262cSandi  global $INFO;
112f3f0262cSandi
113f3f0262cSandi  if($ACT == 'show' || $ACT == 'search'){
114f3f0262cSandi    if($INFO['writable']){
115ee4c4a1bSAndreas Gohr      if($INFO['draft']){
116ee4c4a1bSAndreas Gohr          $r = html_btn('draft',$ID,'e',array('do' => 'draft'),'post');
117ee4c4a1bSAndreas Gohr      }else{
118f3f0262cSandi        if($INFO['exists']){
119f3f0262cSandi          $r = html_btn('edit',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
120f3f0262cSandi        }else{
121f3f0262cSandi          $r = html_btn('create',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
122f3f0262cSandi        }
123ee4c4a1bSAndreas Gohr      }
124f3f0262cSandi    }else{
125f3f0262cSandi      $r = html_btn('source',$ID,'v',array('do' => 'edit','rev' => $REV),'post');
126f3f0262cSandi    }
127f3f0262cSandi  }else{
128f3f0262cSandi    $r = html_btn('show',$ID,'v',array('do' => 'show'));
129f3f0262cSandi  }
130f3f0262cSandi  return $r;
131f3f0262cSandi}
132f3f0262cSandi
13315fae107Sandi/**
13415fae107Sandi * prints a section editing button
13535dae8b0SBen Coburn * used as a callback in html_secedit
13615fae107Sandi *
13715fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
13815fae107Sandi */
13935dae8b0SBen Coburnfunction html_secedit_button($matches){
140f3f0262cSandi  global $ID;
141041d7a86SBen Coburn  global $INFO;
142041d7a86SBen Coburn
143041d7a86SBen Coburn  $section = $matches[2];
144041d7a86SBen Coburn  $name = $matches[1];
145041d7a86SBen Coburn
146f3f0262cSandi  $secedit  = '';
147f3f0262cSandi  $secedit .= '<div class="secedit">';
148f3f0262cSandi  $secedit .= html_btn('secedit',$ID,'',
149f3f0262cSandi                        array('do'      => 'edit',
150306b2c85SDenis Simakov                              'lines'   => "$section",
151306b2c85SDenis Simakov                              'rev' => $INFO['lastmod']),
15235dae8b0SBen Coburn                              'post', $name);
153f3f0262cSandi  $secedit .= '</div>';
154f3f0262cSandi  return $secedit;
155f3f0262cSandi}
156f3f0262cSandi
15715fae107Sandi/**
15815fae107Sandi * inserts section edit buttons if wanted or removes the markers
15915fae107Sandi *
16015fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
16115fae107Sandi */
162f3f0262cSandifunction html_secedit($text,$show=true){
163f3f0262cSandi  global $INFO;
16435dae8b0SBen Coburn
165c112d578Sandi  if($INFO['writable'] && $show && !$INFO['rev']){
16635dae8b0SBen Coburn    $text = preg_replace_callback('#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#',
16735dae8b0SBen Coburn                         'html_secedit_button', $text);
168f3f0262cSandi  }else{
16935dae8b0SBen Coburn    $text = preg_replace('#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#','',$text);
170f3f0262cSandi  }
17135dae8b0SBen Coburn
172f3f0262cSandi  return $text;
173f3f0262cSandi}
174f3f0262cSandi
175f3f0262cSandi/**
176d6c9c552Smatthiasgrimm * Just the back to top button (in its own form)
1776b13307fSandi *
1786b13307fSandi * @author Andreas Gohr <andi@splitbrain.org>
1796b13307fSandi */
1806b13307fSandifunction html_topbtn(){
1816b13307fSandi  global $lang;
1826b13307fSandi
1836b13307fSandi  $ret  = '';
1840e99f6d7SBen Coburn  $ret  = '<a class="nolink" href="#dokuwiki__top"><input type="button" class="button" value="'.$lang['btn_top'].'" onclick="window.scrollTo(0, 0)" /></a>';
185df7b6005Sandi
1866b13307fSandi  return $ret;
1876b13307fSandi}
1886b13307fSandi
1896b13307fSandi/**
190d67ca2c0Smatthiasgrimm * Just the back to media window button in its own form
191d67ca2c0Smatthiasgrimm *
192d67ca2c0Smatthiasgrimm * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
193d67ca2c0Smatthiasgrimm */
194d67ca2c0Smatthiasgrimmfunction html_backtomedia_button($params,$akey=''){
195d67ca2c0Smatthiasgrimm  global $conf;
196d67ca2c0Smatthiasgrimm  global $lang;
197d67ca2c0Smatthiasgrimm
1983df72098SAndreas Gohr  $ret = '<form class="button" method="get" action="'.DOKU_BASE.'lib/exe/mediamanager.php"><div class="no">';
199d67ca2c0Smatthiasgrimm
200d67ca2c0Smatthiasgrimm  reset($params);
201d67ca2c0Smatthiasgrimm  while (list($key, $val) = each($params)) {
202d67ca2c0Smatthiasgrimm    $ret .= '<input type="hidden" name="'.$key.'" ';
203d67ca2c0Smatthiasgrimm    $ret .= 'value="'.htmlspecialchars($val).'" />';
204d67ca2c0Smatthiasgrimm  }
205d67ca2c0Smatthiasgrimm
206d67ca2c0Smatthiasgrimm  $ret .= '<input type="submit" value="'.htmlspecialchars($lang['btn_backtomedia']).'" class="button" ';
207d67ca2c0Smatthiasgrimm  if($akey){
208d67ca2c0Smatthiasgrimm    $ret .= 'title="ALT+'.strtoupper($akey).'" ';
209d67ca2c0Smatthiasgrimm    $ret .= 'accesskey="'.$akey.'" ';
210d67ca2c0Smatthiasgrimm  }
211d67ca2c0Smatthiasgrimm  $ret .= '/>';
2124beabca9SAnika Henke  $ret .= '</div></form>';
213d67ca2c0Smatthiasgrimm
214d67ca2c0Smatthiasgrimm  return $ret;
215d67ca2c0Smatthiasgrimm}
216d67ca2c0Smatthiasgrimm
217d67ca2c0Smatthiasgrimm/**
218d67ca2c0Smatthiasgrimm * Displays a button (using its own form)
21935dae8b0SBen Coburn * If tooltip exists, the access key tooltip is replaced.
22015fae107Sandi *
22115fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
222f3f0262cSandi */
22335dae8b0SBen Coburnfunction html_btn($name,$id,$akey,$params,$method='get',$tooltip=''){
224f3f0262cSandi  global $conf;
225f3f0262cSandi  global $lang;
226f3f0262cSandi
227f3f0262cSandi  $label = $lang['btn_'.$name];
228f3f0262cSandi
229f3f0262cSandi  $ret = '';
23035dae8b0SBen Coburn  $tip = '';
231f3f0262cSandi
23249c713a3Sandi  //filter id (without urlencoding)
23349c713a3Sandi  $id = idfilter($id,false);
234f3f0262cSandi
235f3f0262cSandi  //make nice URLs even for buttons
2366c7843b5Sandi  if($conf['userewrite'] == 2){
2376c7843b5Sandi    $script = DOKU_BASE.DOKU_SCRIPT.'/'.$id;
2386c7843b5Sandi  }elseif($conf['userewrite']){
2396c7843b5Sandi    $script = DOKU_BASE.$id;
2406c7843b5Sandi  }else{
2418b00ebcfSandi    $script = DOKU_BASE.DOKU_SCRIPT;
242f3f0262cSandi    $params['id'] = $id;
243f3f0262cSandi  }
244f3f0262cSandi
2454beabca9SAnika Henke  $ret .= '<form class="button" method="'.$method.'" action="'.$script.'"><div class="no">';
246f3f0262cSandi
24706a4bf8fSAndreas Gohr  if(is_array($params)){
248f3f0262cSandi    reset($params);
249f3f0262cSandi    while (list($key, $val) = each($params)) {
250f3f0262cSandi      $ret .= '<input type="hidden" name="'.$key.'" ';
251f3f0262cSandi      $ret .= 'value="'.htmlspecialchars($val).'" />';
252f3f0262cSandi    }
25306a4bf8fSAndreas Gohr  }
254f3f0262cSandi
255f3f0262cSandi  $ret .= '<input type="submit" value="'.htmlspecialchars($label).'" class="button" ';
256f3f0262cSandi  if($akey){
25735dae8b0SBen Coburn    $tip = '[ALT+'.strtoupper($akey).']';
258f3f0262cSandi    $ret .= 'accesskey="'.$akey.'" ';
259f3f0262cSandi  }
26035dae8b0SBen Coburn  if ($tooltip!='') {
26135dae8b0SBen Coburn      $tip = htmlspecialchars($tooltip);
26235dae8b0SBen Coburn  }
26335dae8b0SBen Coburn  $ret .= 'title="'.$tip.'" ';
264f3f0262cSandi  $ret .= '/>';
2654beabca9SAnika Henke  $ret .= '</div></form>';
266f3f0262cSandi
267f3f0262cSandi  return $ret;
268f3f0262cSandi}
269f3f0262cSandi
270f3f0262cSandi/**
27115fae107Sandi * show a wiki page
27215fae107Sandi *
27315fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
27415fae107Sandi */
2756bbae538Sandifunction html_show($txt=''){
276f3f0262cSandi  global $ID;
277f3f0262cSandi  global $REV;
278f3f0262cSandi  global $HIGH;
279f3f0262cSandi  //disable section editing for old revisions or in preview
2805400331dSandi  if($txt || $REV){
2816bbae538Sandi    $secedit = false;
2826bbae538Sandi  }else{
2836bbae538Sandi    $secedit = true;
284f3f0262cSandi  }
285f3f0262cSandi
2866bbae538Sandi  if ($txt){
287f3f0262cSandi    //PreviewHeader
28850835be7SAndreas Gohr    print '<br id="scroll__here" />';
289c112d578Sandi    print p_locale_xhtml('preview');
290f3f0262cSandi    print '<div class="preview">';
2919dc2c2afSandi    print html_secedit(p_render('xhtml',p_get_instructions($txt),$info),$secedit);
29246723c19SAndreas Gohr    print '<div class="clearer"></div>';
293f3f0262cSandi    print '</div>';
2946bbae538Sandi
295f3f0262cSandi  }else{
296c112d578Sandi    if ($REV) print p_locale_xhtml('showrev');
297c112d578Sandi    $html = p_wiki_xhtml($ID,$REV,true);
2986bbae538Sandi    $html = html_secedit($html,$secedit);
299f3f0262cSandi    print html_hilight($html,$HIGH);
300f3f0262cSandi  }
301f3f0262cSandi}
302f3f0262cSandi
303f3f0262cSandi/**
304ee4c4a1bSAndreas Gohr * ask the user about how to handle an exisiting draft
305ee4c4a1bSAndreas Gohr *
306ee4c4a1bSAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org>
307ee4c4a1bSAndreas Gohr */
308ee4c4a1bSAndreas Gohrfunction html_draft(){
309ee4c4a1bSAndreas Gohr  global $INFO;
310ee4c4a1bSAndreas Gohr  global $ID;
311ee4c4a1bSAndreas Gohr  global $lang;
312ee4c4a1bSAndreas Gohr  global $conf;
313ee4c4a1bSAndreas Gohr  $draft = unserialize(io_readFile($INFO['draft'],false));
314ee4c4a1bSAndreas Gohr  $text  = cleanText(con($draft['prefix'],$draft['text'],$draft['suffix'],true));
315ee4c4a1bSAndreas Gohr
316ee4c4a1bSAndreas Gohr  echo p_locale_xhtml('draft');
317ee4c4a1bSAndreas Gohr  ?>
318ee4c4a1bSAndreas Gohr  <form id="dw__editform" method="post" action="<?php echo script()?>"
319ee4c4a1bSAndreas Gohr   accept-charset="<?php echo $lang['encoding']?>"><div class="no">
320ee4c4a1bSAndreas Gohr    <input type="hidden" name="id"   value="<?php echo $ID?>" />
321ee4c4a1bSAndreas Gohr    <input type="hidden" name="date" value="<?php echo $draft['date']?>" /></div>
322ee4c4a1bSAndreas Gohr    <textarea name="wikitext" id="wiki__text" readonly="readonly" cols="80" rows="10" class="edit"><?php echo "\n".formText($text)?></textarea>
323ee4c4a1bSAndreas Gohr
324ee4c4a1bSAndreas Gohr    <div id="draft__status"><?php echo $lang['draftdate'].' '.date($conf['dformat'],filemtime($INFO['draft']))?></div>
325ee4c4a1bSAndreas Gohr
326ee4c4a1bSAndreas Gohr    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_recover']?>" tabindex="1" />
327ee4c4a1bSAndreas Gohr    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_draftdel']?>" tabindex="2" />
328ee4c4a1bSAndreas Gohr    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_cancel']?>" tabindex="3" />
329ee4c4a1bSAndreas Gohr  </form>
330ee4c4a1bSAndreas Gohr  <?php
331ee4c4a1bSAndreas Gohr}
332ee4c4a1bSAndreas Gohr
333ee4c4a1bSAndreas Gohr/**
334f3f0262cSandi * Highlights searchqueries in HTML code
33515fae107Sandi *
33615fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
3377209be23SAndreas Gohr * @author Harry Fuecks <hfuecks@gmail.com>
338f3f0262cSandi */
339f3f0262cSandifunction html_hilight($html,$query){
3407209be23SAndreas Gohr  //split at common delimiters
3419d9c165eSAndreas Gohr  $queries = preg_split ('/[\s\'"\\\\`()\]\[?:!\.{};,#+*<>\\/]+/',$query,-1,PREG_SPLIT_NO_EMPTY);
342f3f0262cSandi  foreach ($queries as $q){
343f3f0262cSandi     $q = preg_quote($q,'/');
3447209be23SAndreas Gohr     $html = preg_replace_callback("/((<[^>]*)|$q)/i",'html_hilight_callback',$html);
345f3f0262cSandi  }
346f3f0262cSandi  return $html;
347f3f0262cSandi}
348f3f0262cSandi
349f3f0262cSandi/**
3507209be23SAndreas Gohr * Callback used by html_hilight()
3517209be23SAndreas Gohr *
3527209be23SAndreas Gohr * @author Harry Fuecks <hfuecks@gmail.com>
3537209be23SAndreas Gohr */
3547209be23SAndreas Gohrfunction html_hilight_callback($m) {
3557209be23SAndreas Gohr  $hlight = unslash($m[0]);
3567209be23SAndreas Gohr  if ( !isset($m[2])) {
3577209be23SAndreas Gohr    $hlight = '<span class="search_hit">'.$hlight.'</span>';
3587209be23SAndreas Gohr  }
3597209be23SAndreas Gohr  return $hlight;
3607209be23SAndreas Gohr}
3617209be23SAndreas Gohr
3627209be23SAndreas Gohr/**
36315fae107Sandi * Run a search and display the result
36415fae107Sandi *
36515fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
366f3f0262cSandi */
367f3f0262cSandifunction html_search(){
368ed7b5f09Sandi  require_once(DOKU_INC.'inc/search.php');
369506fa893SAndreas Gohr  require_once(DOKU_INC.'inc/fulltext.php');
370f3f0262cSandi  global $conf;
371f3f0262cSandi  global $QUERY;
372f3f0262cSandi  global $ID;
373f3f0262cSandi  global $lang;
374f3f0262cSandi
375c112d578Sandi  print p_locale_xhtml('searchpage');
376f3f0262cSandi  flush();
377f3f0262cSandi
378d0ab54f6SMichael Klier chi@chimeric.de  //check if search is restricted to namespace
379d0ab54f6SMichael Klier chi@chimeric.de  if(preg_match('/([^@]*)@([^@]*)/',$QUERY,$match)) {
380d0ab54f6SMichael Klier chi@chimeric.de      $id = cleanID($match[1]);
381d0ab54f6SMichael Klier chi@chimeric.de      if(empty($id)) {
382d0ab54f6SMichael Klier chi@chimeric.de        print '<div class="nothing">'.$lang['nothingfound'].'</div>';
383d0ab54f6SMichael Klier chi@chimeric.de        flush();
384d0ab54f6SMichael Klier chi@chimeric.de        return;
385d0ab54f6SMichael Klier chi@chimeric.de      }
386d0ab54f6SMichael Klier chi@chimeric.de  } else {
387d0ab54f6SMichael Klier chi@chimeric.de      $id = cleanID($QUERY);
388d0ab54f6SMichael Klier chi@chimeric.de  }
389d0ab54f6SMichael Klier chi@chimeric.de
3904d9ff3d5Sandi  //show progressbar
3919edac8a8SAndreas Gohr  print '<div class="centeralign" id="dw__loading">';
3924d9ff3d5Sandi  print '<br /></div>';
3939edac8a8SAndreas Gohr  print '<script type="text/javascript" charset="utf-8">';
3949edac8a8SAndreas Gohr  print 'showLoadBar("dw__loading");';
3959edac8a8SAndreas Gohr  print '</script>';
3969edac8a8SAndreas Gohr  flush();
3974d9ff3d5Sandi
398f3f0262cSandi  //do quick pagesearch
399f3f0262cSandi  $data = array();
400d0ab54f6SMichael Klier chi@chimeric.de
401d0ab54f6SMichael Klier chi@chimeric.de  $data = ft_pageLookup($id);
402f3f0262cSandi  if(count($data)){
403f3f0262cSandi    sort($data);
404f3f0262cSandi    print '<div class="search_quickresult">';
4054f732f0eSAnika Henke    print '<h3>'.$lang[quickhits].':</h3>';
4064f732f0eSAnika Henke    print '<ul class="search_quickhits">';
407140c93f3SAnika Henke    foreach($data as $id){
4084f732f0eSAnika Henke      print '<li> ';
409506fa893SAndreas Gohr      print html_wikilink(':'.$id,$conf['useheading']?NULL:$id);
4104f732f0eSAnika Henke      print '</li> ';
411f3f0262cSandi    }
412140c93f3SAnika Henke    print '</ul> ';
413f3f0262cSandi    //clear float (see http://www.complexspiral.com/publications/containing-floats/)
414f3f0262cSandi    print '<div class="clearer">&nbsp;</div>';
415f3f0262cSandi    print '</div>';
416f3f0262cSandi  }
417f3f0262cSandi  flush();
418f3f0262cSandi
419f3f0262cSandi  //do fulltext search
420506fa893SAndreas Gohr  $data = ft_pageSearch($QUERY,$poswords);
421f3f0262cSandi  if(count($data)){
422506fa893SAndreas Gohr    $num = 1;
423506fa893SAndreas Gohr    foreach($data as $id => $cnt){
424f3f0262cSandi      print '<div class="search_result">';
425506fa893SAndreas Gohr      print html_wikilink(':'.$id,$conf['useheading']?NULL:$id,$poswords);
426506fa893SAndreas Gohr      print ': <span class="search_cnt">'.$cnt.' '.$lang['hits'].'</span><br />';
427506fa893SAndreas Gohr      if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ?
428506fa893SAndreas Gohr        print '<div class="search_snippet">'.ft_snippet($id,$poswords).'</div>';
429506fa893SAndreas Gohr      }
430f3f0262cSandi      print '</div>';
431506fa893SAndreas Gohr      flush();
432506fa893SAndreas Gohr      $num++;
433f3f0262cSandi    }
434f3f0262cSandi  }else{
435820fa24bSandi    print '<div class="nothing">'.$lang['nothingfound'].'</div>';
436f3f0262cSandi  }
4374d9ff3d5Sandi
4384d9ff3d5Sandi  //hide progressbar
4394beabca9SAnika Henke  print '<script type="text/javascript" charset="utf-8">';
4409edac8a8SAndreas Gohr  print 'hideLoadBar("dw__loading");';
4414d9ff3d5Sandi  print '</script>';
4429edac8a8SAndreas Gohr  flush();
443f3f0262cSandi}
444f3f0262cSandi
44515fae107Sandi/**
44615fae107Sandi * Display error on locked pages
44715fae107Sandi *
44815fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
44915fae107Sandi */
450ee20e7d1Sandifunction html_locked(){
451f3f0262cSandi  global $ID;
452f3f0262cSandi  global $conf;
453f3f0262cSandi  global $lang;
45488f522e9Sandi  global $INFO;
455f3f0262cSandi
456f3f0262cSandi  $locktime = filemtime(wikiFN($ID).'.lock');
457f3f0262cSandi  $expire = @date($conf['dformat'], $locktime + $conf['locktime'] );
458f3f0262cSandi  $min    = round(($conf['locktime'] - (time() - $locktime) )/60);
459f3f0262cSandi
460c112d578Sandi  print p_locale_xhtml('locked');
461f3f0262cSandi  print '<ul>';
4620c6b58a8SAndreas Gohr  print '<li><div class="li"><strong>'.$lang['lockedby'].':</strong> '.$INFO['locked'].'</li>';
4630c6b58a8SAndreas Gohr  print '<li><div class="li"><strong>'.$lang['lockexpire'].':</strong> '.$expire.' ('.$min.' min)</div></li>';
464f3f0262cSandi  print '</ul>';
465f3f0262cSandi}
466f3f0262cSandi
46715fae107Sandi/**
46815fae107Sandi * list old revisions
46915fae107Sandi *
47015fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
47115fae107Sandi */
472f3f0262cSandifunction html_revisions(){
473f3f0262cSandi  global $ID;
474f3f0262cSandi  global $INFO;
475f3f0262cSandi  global $conf;
476f3f0262cSandi  global $lang;
477f3f0262cSandi  $revisions = getRevisions($ID);
478f3f0262cSandi  $date = @date($conf['dformat'],$INFO['lastmod']);
479f3f0262cSandi
480c112d578Sandi  print p_locale_xhtml('revisions');
481f3f0262cSandi  print '<ul>';
482f3f0262cSandi  if($INFO['exists']){
483b6912aeaSAndreas Gohr    print ($INFO['minor']) ? '<li class="minor">' : '<li>';
4840c6b58a8SAndreas Gohr    print '<div class="li">';
485f9b2fe70Sandi
486f9b2fe70Sandi    print $date;
487f9b2fe70Sandi
48802e51121SAnika Henke    print ' <img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" /> ';
489cffcc403Sandi
490f9b2fe70Sandi    print '<a class="wikilink1" href="'.wl($ID).'">'.$ID.'</a> ';
491652610a2Sandi
492652610a2Sandi    print $INFO['sum'];
49388f522e9Sandi    print ' <span class="user">';
49488f522e9Sandi    print $INFO['editor'];
49588f522e9Sandi    print '</span> ';
496652610a2Sandi
497652610a2Sandi    print '('.$lang['current'].')';
4980c6b58a8SAndreas Gohr    print '</div>';
499652610a2Sandi    print '</li>';
500f3f0262cSandi  }
501f3f0262cSandi
502f3f0262cSandi  foreach($revisions as $rev){
503f3f0262cSandi    $date = date($conf['dformat'],$rev);
504fb53bfe2SBen Coburn    $info = getRevisionInfo($ID,$rev,true);
505652610a2Sandi
506b6912aeaSAndreas Gohr    print ($info['minor']) ? '<li class="minor">' : '<li>';
5070c6b58a8SAndreas Gohr    print '<div class="li">';
508f9b2fe70Sandi    print $date;
509f9b2fe70Sandi
510cffcc403Sandi    print ' <a href="'.wl($ID,"rev=$rev,do=diff").'">';
511d94f4568SAndreas Gohr    $p = array();
512d94f4568SAndreas Gohr    $p['src']    = DOKU_BASE.'lib/images/diff.png';
513d94f4568SAndreas Gohr    $p['width']  = 15;
514d94f4568SAndreas Gohr    $p['height'] = 11;
515d94f4568SAndreas Gohr    $p['title']  = $lang['diff'];
516d94f4568SAndreas Gohr    $p['alt']    = $lang['diff'];
517d94f4568SAndreas Gohr    $att = buildAttributes($p);
518d94f4568SAndreas Gohr    print "<img $att />";
519cffcc403Sandi    print '</a> ';
520cffcc403Sandi
521f9b2fe70Sandi    print '<a class="wikilink1" href="'.wl($ID,"rev=$rev").'">'.$ID.'</a> ';
522f9b2fe70Sandi
523f243a77fSandi    print htmlspecialchars($info['sum']);
52488f522e9Sandi    print ' <span class="user">';
52588f522e9Sandi    if($info['user']){
52688f522e9Sandi      print $info['user'];
52788f522e9Sandi    }else{
528652610a2Sandi      print $info['ip'];
52988f522e9Sandi    }
53088f522e9Sandi    print '</span>';
531652610a2Sandi
5320c6b58a8SAndreas Gohr    print '</div>';
533f3f0262cSandi    print '</li>';
534f3f0262cSandi  }
535f3f0262cSandi  print '</ul>';
536f3f0262cSandi}
537f3f0262cSandi
53815fae107Sandi/**
53915fae107Sandi * display recent changes
54015fae107Sandi *
54115fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
5425749f1ceSmatthiasgrimm * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
54315fae107Sandi */
544a39955b0Smatthiasgrimmfunction html_recent($first=0){
545f3f0262cSandi  global $conf;
546cffcc403Sandi  global $lang;
547dbb00abcSEsther Brunner  global $ID;
5485749f1ceSmatthiasgrimm  /* we need to get one additionally log entry to be able to
5495749f1ceSmatthiasgrimm   * decide if this is the last page or is there another one.
5505749f1ceSmatthiasgrimm   * This is the cheapest solution to get this information.
5515749f1ceSmatthiasgrimm   */
552b6912aeaSAndreas Gohr  $recents = getRecents($first,$conf['recent'] + 1,getNS($ID));
5535749f1ceSmatthiasgrimm  if(count($recents) == 0 && $first != 0){
5545749f1ceSmatthiasgrimm    $first=0;
555b6912aeaSAndreas Gohr    $recents = getRecents(0,$conf['recent'] + 1,getNS($ID));
5565749f1ceSmatthiasgrimm  }
5575749f1ceSmatthiasgrimm  $cnt = count($recents) <= $conf['recent'] ? count($recents) : $conf['recent'];
558f3f0262cSandi
559c112d578Sandi  print p_locale_xhtml('recent');
560f3f0262cSandi  print '<ul>';
561a39955b0Smatthiasgrimm
562d437bcc4SAndreas Gohr  foreach($recents as $recent){
563d437bcc4SAndreas Gohr    $date = date($conf['dformat'],$recent['date']);
564b6912aeaSAndreas Gohr    print ($recent['minor']) ? '<li class="minor">' : '<li>';
5650c6b58a8SAndreas Gohr    print '<div class="li">';
566cffcc403Sandi
567f9b2fe70Sandi    print $date.' ';
568f9b2fe70Sandi
569d437bcc4SAndreas Gohr    print '<a href="'.wl($recent['id'],"do=diff").'">';
570d94f4568SAndreas Gohr    $p = array();
571d94f4568SAndreas Gohr    $p['src']    = DOKU_BASE.'lib/images/diff.png';
572d94f4568SAndreas Gohr    $p['width']  = 15;
573d94f4568SAndreas Gohr    $p['height'] = 11;
574d94f4568SAndreas Gohr    $p['title']  = $lang['diff'];
575d94f4568SAndreas Gohr    $p['alt']    = $lang['diff'];
576d94f4568SAndreas Gohr    $att = buildAttributes($p);
577d94f4568SAndreas Gohr    print "<img $att />";
578cffcc403Sandi    print '</a> ';
579cffcc403Sandi
580d437bcc4SAndreas Gohr    print '<a href="'.wl($recent['id'],"do=revisions").'">';
581d94f4568SAndreas Gohr    $p = array();
582d94f4568SAndreas Gohr    $p['src']    = DOKU_BASE.'lib/images/history.png';
583d94f4568SAndreas Gohr    $p['width']  = 12;
584d94f4568SAndreas Gohr    $p['height'] = 14;
585d94f4568SAndreas Gohr    $p['title']  = $lang['btn_revs'];
586d94f4568SAndreas Gohr    $p['alt']    = $lang['btn_revs'];
587d94f4568SAndreas Gohr    $att = buildAttributes($p);
588d94f4568SAndreas Gohr    print "<img $att />";
589cffcc403Sandi    print '</a> ';
590cffcc403Sandi
591d437bcc4SAndreas Gohr    print html_wikilink(':'.$recent['id'],$conf['useheading']?NULL:$recent['id']);
592d437bcc4SAndreas Gohr    print ' '.htmlspecialchars($recent['sum']);
593b6912aeaSAndreas Gohr
59488f522e9Sandi    print ' <span class="user">';
595d437bcc4SAndreas Gohr    if($recent['user']){
596d437bcc4SAndreas Gohr      print $recent['user'];
59788f522e9Sandi    }else{
598d437bcc4SAndreas Gohr      print $recent['ip'];
59988f522e9Sandi    }
60088f522e9Sandi    print '</span>';
601cffcc403Sandi
6020c6b58a8SAndreas Gohr    print '</div>';
603f3f0262cSandi    print '</li>';
604f3f0262cSandi  }
605f3f0262cSandi  print '</ul>';
606a39955b0Smatthiasgrimm
607a39955b0Smatthiasgrimm  print '<div class="pagenav">';
6085749f1ceSmatthiasgrimm  $last = $first + $conf['recent'];
609a39955b0Smatthiasgrimm  if ($first > 0) {
610a39955b0Smatthiasgrimm    $first -= $conf['recent'];
611a39955b0Smatthiasgrimm    if ($first < 0) $first = 0;
612a39955b0Smatthiasgrimm    print '<div class="pagenav-prev">';
6135749f1ceSmatthiasgrimm    print html_btn('newer','',"p",array('do' => 'recent', 'first' => $first));
614a39955b0Smatthiasgrimm    print '</div>';
615a39955b0Smatthiasgrimm  }
6165749f1ceSmatthiasgrimm  if ($conf['recent'] < count($recents)) {
617a39955b0Smatthiasgrimm    print '<div class="pagenav-next">';
6185749f1ceSmatthiasgrimm    print html_btn('older','',"n",array('do' => 'recent', 'first' => $last));
619a39955b0Smatthiasgrimm    print '</div>';
620a39955b0Smatthiasgrimm  }
621a39955b0Smatthiasgrimm  print '</div>';
622f3f0262cSandi}
623f3f0262cSandi
62415fae107Sandi/**
62515fae107Sandi * Display page index
62615fae107Sandi *
62715fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
62815fae107Sandi */
629f3f0262cSandifunction html_index($ns){
630ed7b5f09Sandi  require_once(DOKU_INC.'inc/search.php');
631f3f0262cSandi  global $conf;
632f3f0262cSandi  global $ID;
633f3f0262cSandi  $dir = $conf['datadir'];
634f3f0262cSandi  $ns  = cleanID($ns);
63530f1737dSandi  #fixme use appropriate function
636f3f0262cSandi  if(empty($ns)){
637f3f0262cSandi    $ns = dirname(str_replace(':','/',$ID));
638f3f0262cSandi    if($ns == '.') $ns ='';
639f3f0262cSandi  }
64088d3a917Sandi  $ns  = utf8_encodeFN(str_replace(':','/',$ns));
641f3f0262cSandi
642c112d578Sandi  print p_locale_xhtml('index');
643f3f0262cSandi
644f3f0262cSandi  $data = array();
645f3f0262cSandi  search($data,$conf['datadir'],'search_index',array('ns' => $ns));
646cb70c441Sandi  print html_buildlist($data,'idx','html_list_index','html_li_index');
647f3f0262cSandi}
648f3f0262cSandi
649f3f0262cSandi/**
65015fae107Sandi * Index item formatter
65115fae107Sandi *
652f3f0262cSandi * User function for html_buildlist()
65315fae107Sandi *
65415fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
655f3f0262cSandi */
656f3f0262cSandifunction html_list_index($item){
657f3f0262cSandi  $ret = '';
658f3f0262cSandi  $base = ':'.$item['id'];
659f3f0262cSandi  $base = substr($base,strrpos($base,':')+1);
660f3f0262cSandi  if($item['type']=='d'){
661f3f0262cSandi    $ret .= '<a href="'.wl($ID,'idx='.$item['id']).'" class="idx_dir">';
662f3f0262cSandi    $ret .= $base;
663f3f0262cSandi    $ret .= '</a>';
664f3f0262cSandi  }else{
665f3f0262cSandi    $ret .= html_wikilink(':'.$item['id']);
666f3f0262cSandi  }
667f3f0262cSandi  return $ret;
668f3f0262cSandi}
669f3f0262cSandi
670f3f0262cSandi/**
671cb70c441Sandi * Index List item
672cb70c441Sandi *
673cb70c441Sandi * This user function is used in html_build_lidt to build the
674cb70c441Sandi * <li> tags for namespaces when displaying the page index
675cb70c441Sandi * it gives different classes to opened or closed "folders"
676cb70c441Sandi *
677cb70c441Sandi * @author Andreas Gohr <andi@splitbrain.org>
678cb70c441Sandi */
679cb70c441Sandifunction html_li_index($item){
680cb70c441Sandi  if($item['type'] == "f"){
681cb70c441Sandi    return '<li class="level'.$item['level'].'">';
682cb70c441Sandi  }elseif($item['open']){
683cb70c441Sandi    return '<li class="open">';
684cb70c441Sandi  }else{
685cb70c441Sandi    return '<li class="closed">';
686cb70c441Sandi  }
687cb70c441Sandi}
688cb70c441Sandi
689cb70c441Sandi/**
690cb70c441Sandi * Default List item
691cb70c441Sandi *
692cb70c441Sandi * @author Andreas Gohr <andi@splitbrain.org>
693cb70c441Sandi */
694cb70c441Sandifunction html_li_default($item){
695cb70c441Sandi  return '<li class="level'.$item['level'].'">';
696cb70c441Sandi}
697cb70c441Sandi
698cb70c441Sandi/**
69915fae107Sandi * Build an unordered list
70015fae107Sandi *
701f3f0262cSandi * Build an unordered list from the given $data array
702f3f0262cSandi * Each item in the array has to have a 'level' property
703f3f0262cSandi * the item itself gets printed by the given $func user
704cb70c441Sandi * function. The second and optional function is used to
705cb70c441Sandi * print the <li> tag. Both user function need to accept
706cb70c441Sandi * a single item.
70715fae107Sandi *
708c5a8fd96SAndreas Gohr * Both user functions can be given as array to point to
709c5a8fd96SAndreas Gohr * a member of an object.
710c5a8fd96SAndreas Gohr *
71115fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
712f3f0262cSandi */
713cb70c441Sandifunction html_buildlist($data,$class,$func,$lifunc='html_li_default'){
714f3f0262cSandi  $level = 0;
715f3f0262cSandi  $opens = 0;
716f3f0262cSandi  $ret   = '';
717f3f0262cSandi
718f3f0262cSandi  foreach ($data as $item){
719f3f0262cSandi
720f3f0262cSandi    if( $item['level'] > $level ){
721f3f0262cSandi      //open new list
722df52d0feSandi      for($i=0; $i<($item['level'] - $level); $i++){
723df52d0feSandi        if ($i) $ret .= "<li class=\"clear\">\n";
724f3f0262cSandi        $ret .= "\n<ul class=\"$class\">\n";
725df52d0feSandi      }
726f3f0262cSandi    }elseif( $item['level'] < $level ){
727f3f0262cSandi      //close last item
728f3f0262cSandi      $ret .= "</li>\n";
729f3f0262cSandi      for ($i=0; $i<($level - $item['level']); $i++){
730f3f0262cSandi        //close higher lists
731f3f0262cSandi        $ret .= "</ul>\n</li>\n";
732f3f0262cSandi      }
733f3f0262cSandi    }else{
734f3f0262cSandi      //close last item
735f3f0262cSandi      $ret .= "</li>\n";
736f3f0262cSandi    }
737f3f0262cSandi
738f3f0262cSandi    //remember current level
739f3f0262cSandi    $level = $item['level'];
740f3f0262cSandi
741f3f0262cSandi    //print item
742c5a8fd96SAndreas Gohr    if(is_array($lifunc)){
743c5a8fd96SAndreas Gohr      $ret .= $lifunc[0]->$lifunc[1]($item); //user object method
744c5a8fd96SAndreas Gohr    }else{
745cb70c441Sandi      $ret .= $lifunc($item); //user function
746c5a8fd96SAndreas Gohr    }
7470c6b58a8SAndreas Gohr    $ret .= '<div class="li">';
748c5a8fd96SAndreas Gohr    if(is_array($func)){
749c5a8fd96SAndreas Gohr      $ret .= $func[0]->$func[1]($item); //user object method
750c5a8fd96SAndreas Gohr    }else{
751f3f0262cSandi    $ret .= $func($item); //user function
752c5a8fd96SAndreas Gohr    }
7530c6b58a8SAndreas Gohr    $ret .= '</div>';
754f3f0262cSandi  }
755f3f0262cSandi
756f3f0262cSandi  //close remaining items and lists
757f3f0262cSandi  for ($i=0; $i < $level; $i++){
758f3f0262cSandi    $ret .= "</li></ul>\n";
759f3f0262cSandi  }
760f3f0262cSandi
761f3f0262cSandi  return $ret;
762f3f0262cSandi}
763f3f0262cSandi
76415fae107Sandi/**
76515fae107Sandi * display backlinks
76615fae107Sandi *
76715fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
76815fae107Sandi */
769f3f0262cSandifunction html_backlinks(){
77054f4c056SAndreas Gohr  require_once(DOKU_INC.'inc/fulltext.php');
771f3f0262cSandi  global $ID;
772f3f0262cSandi  global $conf;
773f3f0262cSandi
774c112d578Sandi  print p_locale_xhtml('backlinks');
775f3f0262cSandi
77654f4c056SAndreas Gohr  $data = ft_backlinks($ID);
777f3f0262cSandi
778f3f0262cSandi  print '<ul class="idx">';
77954f4c056SAndreas Gohr  foreach($data as $blink){
7800c6b58a8SAndreas Gohr    print '<li><div class="li">';
78154f4c056SAndreas Gohr    print html_wikilink(':'.$blink,$conf['useheading']?NULL:$blink);
7820c6b58a8SAndreas Gohr    print '</div></li>';
783f3f0262cSandi  }
784f3f0262cSandi  print '</ul>';
785f3f0262cSandi}
786f3f0262cSandi
78715fae107Sandi/**
78815fae107Sandi * show diff
78915fae107Sandi *
79015fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
79115fae107Sandi */
792f3f0262cSandifunction html_diff($text='',$intro=true){
793ed7b5f09Sandi  require_once(DOKU_INC.'inc/DifferenceEngine.php');
794f3f0262cSandi  global $ID;
795f3f0262cSandi  global $REV;
796f3f0262cSandi  global $lang;
797f3f0262cSandi  global $conf;
798f3f0262cSandi  if($text){
799f3f0262cSandi    $df  = new Diff(split("\n",htmlspecialchars(rawWiki($ID,''))),
800f3f0262cSandi                    split("\n",htmlspecialchars(cleanText($text))));
801f3f0262cSandi    $left  = '<a class="wikilink1" href="'.wl($ID).'">'.
802f3f0262cSandi              $ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a>'.
803f3f0262cSandi              $lang['current'];
804f3f0262cSandi    $right = $lang['yours'];
805f3f0262cSandi  }else{
8064d58bd99Sandi    if($REV){
8074d58bd99Sandi      $r = $REV;
8084d58bd99Sandi    }else{
8094d58bd99Sandi      //use last revision if none given
8104d58bd99Sandi      $revs = getRevisions($ID);
8114d58bd99Sandi      $r = $revs[0];
8124d58bd99Sandi    }
8134d58bd99Sandi
8144d58bd99Sandi    $df  = new Diff(split("\n",htmlspecialchars(rawWiki($ID,$r))),
815f3f0262cSandi                    split("\n",htmlspecialchars(rawWiki($ID,''))));
8164d58bd99Sandi    $left  = '<a class="wikilink1" href="'.wl($ID,"rev=$r").'">'.
8174d58bd99Sandi              $ID.' '.date($conf['dformat'],$r).'</a>';
818f3f0262cSandi    $right = '<a class="wikilink1" href="'.wl($ID).'">'.
819f3f0262cSandi              $ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a> '.
820f3f0262cSandi              $lang['current'];
821f3f0262cSandi  }
822f3f0262cSandi  $tdf = new TableDiffFormatter();
823c112d578Sandi  if($intro) print p_locale_xhtml('diff');
824f3f0262cSandi  ?>
825daf4ca4eSAnika Henke    <table class="diff">
826f3f0262cSandi      <tr>
827daf4ca4eSAnika Henke        <th colspan="2">
8284da078a3Smatthiasgrimm          <?php echo $left?>
829daf4ca4eSAnika Henke        </th>
830daf4ca4eSAnika Henke        <th colspan="2">
8314da078a3Smatthiasgrimm          <?php echo $right?>
832daf4ca4eSAnika Henke        </th>
833f3f0262cSandi      </tr>
8344da078a3Smatthiasgrimm      <?php echo $tdf->format($df)?>
835f3f0262cSandi    </table>
8364da078a3Smatthiasgrimm  <?php
837f3f0262cSandi}
838f3f0262cSandi
83915fae107Sandi/**
84015fae107Sandi * show warning on conflict detection
84115fae107Sandi *
84215fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
84315fae107Sandi */
844f3f0262cSandifunction html_conflict($text,$summary){
845f3f0262cSandi  global $ID;
846f3f0262cSandi  global $lang;
847f3f0262cSandi
848c112d578Sandi  print p_locale_xhtml('conflict');
849f3f0262cSandi  ?>
8501dd0c202SAnika Henke  <form id="dw__editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>">
85196331712SAnika Henke  <div class="centeralign">
8524da078a3Smatthiasgrimm    <input type="hidden" name="id" value="<?php echo $ID?>" />
8534da078a3Smatthiasgrimm    <input type="hidden" name="wikitext" value="<?php echo formText($text)?>" />
8544da078a3Smatthiasgrimm    <input type="hidden" name="summary" value="<?php echo formText($summary)?>" />
855f3f0262cSandi
8564da078a3Smatthiasgrimm    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_save']?>" accesskey="s" title="[ALT+S]" />
8574da078a3Smatthiasgrimm    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_cancel']?>" />
858f3f0262cSandi  </div>
859f3f0262cSandi  </form>
860f3f0262cSandi  <br /><br /><br /><br />
8614da078a3Smatthiasgrimm  <?php
862f3f0262cSandi}
863f3f0262cSandi
864f3f0262cSandi/**
86515fae107Sandi * Prints the global message array
86615fae107Sandi *
86715fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
868f3f0262cSandi */
869f3f0262cSandifunction html_msgarea(){
870f3f0262cSandi  global $MSG;
871f3f0262cSandi
872f3f0262cSandi  if(!isset($MSG)) return;
873f3f0262cSandi
874f3f0262cSandi  foreach($MSG as $msg){
875f3f0262cSandi    print '<div class="'.$msg['lvl'].'">';
876f3f0262cSandi    print $msg['msg'];
877f3f0262cSandi    print '</div>';
878f3f0262cSandi  }
879f3f0262cSandi}
880f3f0262cSandi
881f3f0262cSandi/**
882f3f0262cSandi * Prints the registration form
88315fae107Sandi *
88415fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
885f3f0262cSandi */
886f3f0262cSandifunction html_register(){
887f3f0262cSandi  global $lang;
888cab2716aSmatthias.grimm  global $conf;
889f3f0262cSandi  global $ID;
890f3f0262cSandi
891c112d578Sandi  print p_locale_xhtml('register');
892f3f0262cSandi?>
89396331712SAnika Henke  <div class="centeralign">
8941dd0c202SAnika Henke  <form id="dw__register" method="post" action="<?php echo wl($ID)?>" accept-charset="<?php echo $lang['encoding']?>">
89596331712SAnika Henke  <fieldset>
896f3f0262cSandi    <input type="hidden" name="do" value="register" />
897f3f0262cSandi    <input type="hidden" name="save" value="1" />
89896331712SAnika Henke
8994da078a3Smatthiasgrimm    <legend><?php echo $lang['register']?></legend>
900b6912aeaSAndreas Gohr    <label class="block">
9014da078a3Smatthiasgrimm      <?php echo $lang['user']?>
9024da078a3Smatthiasgrimm      <input type="text" name="login" class="edit" size="50" value="<?php echo formText($_POST['login'])?>" />
903f3f0262cSandi    </label><br />
904cab2716aSmatthias.grimm
905cab2716aSmatthias.grimm    <?php
906cab2716aSmatthias.grimm      if (!$conf['autopasswd']) {
907cab2716aSmatthias.grimm    ?>
908b6912aeaSAndreas Gohr      <label class="block">
9094da078a3Smatthiasgrimm        <?php echo $lang['pass']?>
910cab2716aSmatthias.grimm        <input type="password" name="pass" class="edit" size="50" />
911cab2716aSmatthias.grimm      </label><br />
912b6912aeaSAndreas Gohr      <label class="block">
9134da078a3Smatthiasgrimm        <?php echo $lang['passchk']?>
914cab2716aSmatthias.grimm        <input type="password" name="passchk" class="edit" size="50" />
915cab2716aSmatthias.grimm      </label><br />
916cab2716aSmatthias.grimm    <?php
917cab2716aSmatthias.grimm      }
918cab2716aSmatthias.grimm    ?>
919cab2716aSmatthias.grimm
920b6912aeaSAndreas Gohr    <label class="block">
9214da078a3Smatthiasgrimm      <?php echo $lang['fullname']?>
9224da078a3Smatthiasgrimm      <input type="text" name="fullname" class="edit" size="50" value="<?php echo formText($_POST['fullname'])?>" />
923f3f0262cSandi    </label><br />
924b6912aeaSAndreas Gohr    <label class="block">
9254da078a3Smatthiasgrimm      <?php echo $lang['email']?>
9264da078a3Smatthiasgrimm      <input type="text" name="email" class="edit" size="50" value="<?php echo formText($_POST['email'])?>" />
927f3f0262cSandi    </label><br />
9284da078a3Smatthiasgrimm    <input type="submit" class="button" value="<?php echo $lang['register']?>" />
929f3f0262cSandi  </fieldset>
930f3f0262cSandi  </form>
931f3f0262cSandi  </div>
9324da078a3Smatthiasgrimm<?php
933f3f0262cSandi}
934f3f0262cSandi
935f3f0262cSandi/**
9368b06d178Schris * Print the update profile form
9378b06d178Schris *
9388b06d178Schris * @author Christopher Smith <chris@jalakai.co.uk>
9398b06d178Schris * @author Andreas Gohr <andi@splitbrain.org>
9408b06d178Schris */
9418b06d178Schrisfunction html_updateprofile(){
9428b06d178Schris  global $lang;
9438b06d178Schris  global $conf;
9448b06d178Schris  global $ID;
9458b06d178Schris  global $INFO;
94682fd59b6SAndreas Gohr  global $auth;
9478b06d178Schris
9488b06d178Schris  print p_locale_xhtml('updateprofile');
9498b06d178Schris
9508b06d178Schris  if (empty($_POST['fullname'])) $_POST['fullname'] = $INFO['userinfo']['name'];
9518b06d178Schris  if (empty($_POST['email'])) $_POST['email'] = $INFO['userinfo']['mail'];
9528b06d178Schris?>
95396331712SAnika Henke  <div class="centeralign">
9541dd0c202SAnika Henke  <form id="dw__register" method="post" action="<?php echo wl($ID)?>" accept-charset="<?php echo $lang['encoding']?>">
95596331712SAnika Henke  <fieldset style="width: 80%;">
9568b06d178Schris    <input type="hidden" name="do" value="profile" />
9578b06d178Schris    <input type="hidden" name="save" value="1" />
95896331712SAnika Henke
9598b06d178Schris    <legend><?php echo $lang['profile']?></legend>
9608b06d178Schris    <label class="block">
9618b06d178Schris      <?php echo $lang['user']?>
9628b06d178Schris      <input type="text" name="fullname" disabled="disabled" class="edit" size="50" value="<?php echo formText($_SERVER['REMOTE_USER'])?>" />
9638b06d178Schris    </label><br />
9648b06d178Schris    <label class="block">
9658b06d178Schris      <?php echo $lang['fullname']?>
96682fd59b6SAndreas Gohr      <input type="text" name="fullname" <?php if(!$auth->canDo('modName')) echo 'disabled="disabled"'?> class="edit" size="50" value="<?php echo formText($_POST['fullname'])?>" />
9678b06d178Schris    </label><br />
9688b06d178Schris    <label class="block">
9698b06d178Schris      <?php echo $lang['email']?>
97082fd59b6SAndreas Gohr      <input type="text" name="email" <?php if(!$auth->canDo('modName')) echo 'disabled="disabled"'?> class="edit" size="50" value="<?php echo formText($_POST['email'])?>" />
9718b06d178Schris    </label><br /><br />
97282fd59b6SAndreas Gohr
97382fd59b6SAndreas Gohr    <?php if($auth->canDo('modPass')) { ?>
9748b06d178Schris    <label class="block">
9758b06d178Schris      <?php echo $lang['newpass']?>
9768b06d178Schris      <input type="password" name="newpass" class="edit" size="50" />
9778b06d178Schris    </label><br />
9788b06d178Schris    <label class="block">
9798b06d178Schris      <?php echo $lang['passchk']?>
9808b06d178Schris      <input type="password" name="passchk" class="edit" size="50" />
9818b06d178Schris    </label><br />
98282fd59b6SAndreas Gohr    <?php } ?>
9838b06d178Schris
9848b06d178Schris    <?php if ($conf['profileconfirm']) { ?>
9858b06d178Schris      <br />
9868b06d178Schris      <label class="block">
9878b06d178Schris      <?php echo $lang['oldpass']?>
9888b06d178Schris      <input type="password" name="oldpass" class="edit" size="50" />
9898b06d178Schris    </label><br />
9908b06d178Schris    <?php } ?>
9918b06d178Schris
9924cb79657SMatthias Grimm    <input type="submit" class="button" value="<?php echo $lang['btn_save']?>" />
9938b06d178Schris    <input type="reset" class="button" value="<?php echo $lang['btn_reset']?>" />
9948b06d178Schris  </fieldset>
9958b06d178Schris  </form>
9968b06d178Schris  </div>
9978b06d178Schris<?php
9988b06d178Schris}
9998b06d178Schris
10008b06d178Schris/**
1001f3f0262cSandi * This displays the edit form (lots of logic included)
100215fae107Sandi *
10037146cee2SAndreas Gohr * @fixme  this is a huge lump of code and should be modularized
100415fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
1005f3f0262cSandi */
1006f3f0262cSandifunction html_edit($text=null,$include='edit'){ //FIXME: include needed?
1007f3f0262cSandi  global $ID;
1008f3f0262cSandi  global $REV;
1009f3f0262cSandi  global $DATE;
1010f3f0262cSandi  global $RANGE;
1011f3f0262cSandi  global $PRE;
1012f3f0262cSandi  global $SUF;
1013f3f0262cSandi  global $INFO;
1014f3f0262cSandi  global $SUM;
1015f3f0262cSandi  global $lang;
1016f3f0262cSandi  global $conf;
1017f3f0262cSandi
1018f3f0262cSandi  //set summary default
1019f3f0262cSandi  if(!$SUM){
1020f3f0262cSandi    if($REV){
1021f3f0262cSandi      $SUM = $lang['restored'];
1022f3f0262cSandi    }elseif(!$INFO['exists']){
1023f3f0262cSandi      $SUM = $lang['created'];
1024f3f0262cSandi    }
1025f3f0262cSandi  }
1026f3f0262cSandi
1027f3f0262cSandi  //no text? Load it!
1028f3f0262cSandi  if(!isset($text)){
1029f3f0262cSandi    $pr = false; //no preview mode
10307146cee2SAndreas Gohr    if($INFO['exists']){
1031f3f0262cSandi      if($RANGE){
1032f3f0262cSandi        list($PRE,$text,$SUF) = rawWikiSlices($RANGE,$ID,$REV);
1033f3f0262cSandi      }else{
1034f3f0262cSandi        $text = rawWiki($ID,$REV);
1035f3f0262cSandi      }
1036f3f0262cSandi    }else{
10377146cee2SAndreas Gohr      //try to load a pagetemplate
10387146cee2SAndreas Gohr      $text = pageTemplate($ID);
10397146cee2SAndreas Gohr    }
10407146cee2SAndreas Gohr  }else{
1041f3f0262cSandi    $pr = true; //preview mode
1042f3f0262cSandi  }
1043f3f0262cSandi
1044f3f0262cSandi  $wr = $INFO['writable'];
1045f3f0262cSandi  if($wr){
1046c112d578Sandi    if ($REV) print p_locale_xhtml('editrev');
1047c112d578Sandi    print p_locale_xhtml($include);
1048f3f0262cSandi  }else{
1049c112d578Sandi    print p_locale_xhtml('read');
1050f3f0262cSandi    $ro='readonly="readonly"';
1051f3f0262cSandi  }
1052f3f0262cSandi  if(!$DATE) $DATE = $INFO['lastmod'];
1053dc57ef04Sandi
1054dc57ef04Sandi
1055f3f0262cSandi?>
105663afe2a6SAnika Henke  <div style="width:99%;">
105742c7abd6SAndreas Gohr
105863afe2a6SAnika Henke   <div class="toolbar">
1059ee4c4a1bSAndreas Gohr      <div id="draft__status"><?php if($INFO['draft']) echo $lang['draftdate'].' '.date($conf['dformat']);?></div>
1060ee379fa4SAndreas Gohr      <div id="tool__bar"><a href="<?php echo DOKU_BASE?>lib/exe/mediamanager.php?ns=<?php echo $INFO['namespace']?>"
106172f0e11fSAndreas Gohr      target="_blank"><?php echo $lang['mediaselect'] ?></a></div>
106220d062caSAndreas Gohr
10634da078a3Smatthiasgrimm      <?php if($wr){?>
10644beabca9SAnika Henke      <script type="text/javascript" charset="utf-8">
10654da078a3Smatthiasgrimm        <?php /* sets changed to true when previewed */?>
10664da078a3Smatthiasgrimm        textChanged = <?php ($pr) ? print 'true' : print 'false' ?>;
1067f3f0262cSandi      </script>
106824a33b42SAndreas Gohr      <span id="spell__action"></span>
106924a33b42SAndreas Gohr      <div id="spell__suggest"></div>
1070ee4c4a1bSAndreas Gohr      <?php } ?>
107163afe2a6SAnika Henke   </div>
107224a33b42SAndreas Gohr   <div id="spell__result"></div>
107363afe2a6SAnika Henke
107442c7abd6SAndreas Gohr
107542c7abd6SAndreas Gohr   <form id="dw__editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>"><div class="no">
107642c7abd6SAndreas Gohr      <input type="hidden" name="id"   value="<?php echo $ID?>" />
107742c7abd6SAndreas Gohr      <input type="hidden" name="rev"  value="<?php echo $REV?>" />
107842c7abd6SAndreas Gohr      <input type="hidden" name="date" value="<?php echo $DATE?>" />
107942c7abd6SAndreas Gohr      <input type="hidden" name="prefix" value="<?php echo formText($PRE)?>" />
108042c7abd6SAndreas Gohr      <input type="hidden" name="suffix" value="<?php echo formText($SUF)?>" />
108142c7abd6SAndreas Gohr    </div>
108242c7abd6SAndreas Gohr
108324a33b42SAndreas Gohr    <textarea name="wikitext" id="wiki__text" <?php echo $ro?> cols="80" rows="10" class="edit" tabindex="1"><?php echo "\n".formText($text)?></textarea>
108463afe2a6SAnika Henke
108524a33b42SAndreas Gohr    <div id="wiki__editbar">
108624a33b42SAndreas Gohr      <div id="size__ctl"></div>
10874da078a3Smatthiasgrimm      <?php if($wr){?>
1088fa24fadbSAnika Henke         <div class="editButtons">
108924a33b42SAndreas Gohr            <input class="button" id="edbtn__save" type="submit" name="do" value="<?php echo $lang['btn_save']?>" accesskey="s" title="[ALT+S]" tabindex="4" />
109024a33b42SAndreas Gohr            <input class="button" id="edbtn__preview" type="submit" name="do" value="<?php echo $lang['btn_preview']?>" accesskey="p" title="[ALT+P]" tabindex="5" />
109142c7abd6SAndreas Gohr            <input class="button" type="submit" name="do[draftdel]" value="<?php echo $lang['btn_cancel']?>" tabindex="6" />
1092fa24fadbSAnika Henke         </div>
10934da078a3Smatthiasgrimm      <?php } ?>
10944da078a3Smatthiasgrimm      <?php if($wr){ ?>
1095fa24fadbSAnika Henke        <div class="summary">
109624a33b42SAndreas Gohr           <label for="edit__summary" class="nowrap"><?php echo $lang['summary']?>:</label>
109724a33b42SAndreas Gohr           <input type="text" class="edit" name="summary" id="edit__summary" size="50" value="<?php echo formText($SUM)?>" tabindex="2" />
1098b6912aeaSAndreas Gohr           <?php html_minoredit()?>
1099fa24fadbSAnika Henke        </div>
11004da078a3Smatthiasgrimm      <?php }?>
110163afe2a6SAnika Henke    </div>
110242c7abd6SAndreas Gohr  </form>
110363afe2a6SAnika Henke  </div>
11044da078a3Smatthiasgrimm<?php
1105f3f0262cSandi}
1106f3f0262cSandi
1107f3f0262cSandi/**
1108b6912aeaSAndreas Gohr * Adds a checkbox for minor edits for logged in users
1109b6912aeaSAndreas Gohr *
1110b6912aeaSAndreas Gohr * @author Andrea Gohr <andi@splitbrain.org>
1111b6912aeaSAndreas Gohr */
1112b6912aeaSAndreas Gohrfunction html_minoredit(){
1113b6912aeaSAndreas Gohr  global $conf;
1114b6912aeaSAndreas Gohr  global $lang;
1115b6912aeaSAndreas Gohr  // minor edits are for logged in users only
1116b6912aeaSAndreas Gohr  if(!$conf['useacl'] || !$_SERVER['REMOTE_USER']){
1117b6912aeaSAndreas Gohr    return;
1118b6912aeaSAndreas Gohr  }
1119b6912aeaSAndreas Gohr
1120b6912aeaSAndreas Gohr  $p = array();
1121b6912aeaSAndreas Gohr  $p['name']     = 'minor';
1122b6912aeaSAndreas Gohr  $p['type']     = 'checkbox';
1123b6912aeaSAndreas Gohr  $p['id']       = 'minoredit';
1124b6912aeaSAndreas Gohr  $p['tabindex'] = 3;
1125b6912aeaSAndreas Gohr  $p['value']    = '1';
1126b6912aeaSAndreas Gohr  if($_REQUEST['minor']) $p['checked']='checked';
1127b6912aeaSAndreas Gohr  $att = buildAttributes($p);
1128b6912aeaSAndreas Gohr
1129fa24fadbSAnika Henke  print '<span class="nowrap">';
1130b6912aeaSAndreas Gohr  print "<input $att />";
1131b6912aeaSAndreas Gohr  print '<label for="minoredit">';
1132b6912aeaSAndreas Gohr  print $lang['minoredit'];
1133b6912aeaSAndreas Gohr  print '</label>';
1134fa24fadbSAnika Henke  print '</span>';
1135b6912aeaSAndreas Gohr}
1136b6912aeaSAndreas Gohr
1137b6912aeaSAndreas Gohr/**
1138f3f0262cSandi * prints some debug info
113915fae107Sandi *
114015fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
1141f3f0262cSandi */
1142f3f0262cSandifunction html_debug(){
1143f3f0262cSandi  global $conf;
1144d16a4edaSandi  global $lang;
11455298a619SAndreas Gohr  global $auth;
114628fb55ffSandi  //remove sensitive data
114728fb55ffSandi  $cnf = $conf;
114828fb55ffSandi  $cnf['auth']='***';
114928fb55ffSandi  $cnf['notify']='***';
11503dc3a5f1Sandi  $cnf['ftp']='***';
1151f3f0262cSandi
1152f3f0262cSandi  print '<html><body>';
1153f3f0262cSandi
1154f3f0262cSandi  print '<p>When reporting bugs please send all the following ';
1155f3f0262cSandi  print 'output as a mail to andi@splitbrain.org ';
1156f3f0262cSandi  print 'The best way to do this is to save this page in your browser</p>';
1157f3f0262cSandi
1158f3f0262cSandi  print '<b>$_SERVER:</b><pre>';
1159f3f0262cSandi  print_r($_SERVER);
1160f3f0262cSandi  print '</pre>';
1161f3f0262cSandi
1162f3f0262cSandi  print '<b>$conf:</b><pre>';
116328fb55ffSandi  print_r($cnf);
1164f3f0262cSandi  print '</pre>';
1165f3f0262cSandi
1166ed7b5f09Sandi  print '<b>DOKU_BASE:</b><pre>';
1167ed7b5f09Sandi  print DOKU_BASE;
1168f3f0262cSandi  print '</pre>';
1169f3f0262cSandi
1170ed7b5f09Sandi  print '<b>abs DOKU_BASE:</b><pre>';
1171ed7b5f09Sandi  print DOKU_URL;
1172ed7b5f09Sandi  print '</pre>';
1173ed7b5f09Sandi
1174ed7b5f09Sandi  print '<b>rel DOKU_BASE:</b><pre>';
1175f3f0262cSandi  print dirname($_SERVER['PHP_SELF']).'/';
1176f3f0262cSandi  print '</pre>';
1177f3f0262cSandi
1178f3f0262cSandi  print '<b>PHP Version:</b><pre>';
1179f3f0262cSandi  print phpversion();
1180f3f0262cSandi  print '</pre>';
1181f3f0262cSandi
1182f3f0262cSandi  print '<b>locale:</b><pre>';
1183f3f0262cSandi  print setlocale(LC_ALL,0);
1184f3f0262cSandi  print '</pre>';
1185f3f0262cSandi
1186d16a4edaSandi  print '<b>encoding:</b><pre>';
1187d16a4edaSandi  print $lang['encoding'];
1188d16a4edaSandi  print '</pre>';
1189d16a4edaSandi
11905298a619SAndreas Gohr  if($auth){
11915298a619SAndreas Gohr    print '<b>Auth backend capabilities:</b><pre>';
11925298a619SAndreas Gohr    print_r($auth->cando);
11935298a619SAndreas Gohr    print '</pre>';
11945298a619SAndreas Gohr  }
11955298a619SAndreas Gohr
11963aa54d7cSAndreas Gohr  print '<b>$_SESSION:</b><pre>';
11973aa54d7cSAndreas Gohr  print_r($_SESSION);
11983aa54d7cSAndreas Gohr  print '</pre>';
11993aa54d7cSAndreas Gohr
1200f3f0262cSandi  print '<b>Environment:</b><pre>';
1201f3f0262cSandi  print_r($_ENV);
1202f3f0262cSandi  print '</pre>';
1203f3f0262cSandi
1204f3f0262cSandi  print '<b>PHP settings:</b><pre>';
1205f3f0262cSandi  $inis = ini_get_all();
1206f3f0262cSandi  print_r($inis);
1207f3f0262cSandi  print '</pre>';
1208f3f0262cSandi
1209f3f0262cSandi  print '</body></html>';
1210f3f0262cSandi}
1211f3f0262cSandi
1212c19fe9c0Sandifunction html_admin(){
1213c19fe9c0Sandi  global $ID;
1214c19fe9c0Sandi  global $lang;
1215ca3a6df1SMatthias Grimm  global $conf;
1216c19fe9c0Sandi
1217c112d578Sandi  print p_locale_xhtml('admin');
1218c19fe9c0Sandi
121911e2ce22Schris  // build menu of admin functions from the plugins that handle them
122011e2ce22Schris  $pluginlist = plugin_list('admin');
122111e2ce22Schris  $menu = array();
122211e2ce22Schris  foreach ($pluginlist as $p) {
122311e2ce22Schris    if($obj =& plugin_load('admin',$p) === NULL) continue;
122411e2ce22Schris    $menu[] = array('plugin' => $p,
122511e2ce22Schris                    'prompt' => $obj->getMenuText($conf['lang']),
122611e2ce22Schris                    'sort' => $obj->getMenuSort()
122711e2ce22Schris                   );
122811e2ce22Schris  }
122911e2ce22Schris
123011e2ce22Schris  usort($menu, p_sort_modes);
123111e2ce22Schris
123211e2ce22Schris  // output the menu
123311e2ce22Schris  ptln('<ul>');
123411e2ce22Schris
123511e2ce22Schris  foreach ($menu as $item) {
123611e2ce22Schris    if (!$item['prompt']) continue;
12370c6b58a8SAndreas Gohr    ptln('  <li><div class="li"><a href="'.wl($ID, 'do=admin&amp;page='.$item['plugin']).'">'.$item['prompt'].'</a></div></li>');
123811e2ce22Schris  }
123911e2ce22Schris
124011e2ce22Schris  // add in non-plugin functions
124111e2ce22Schris  if (!$conf['openregister']){
12420c6b58a8SAndreas Gohr    ptln('<li><div class="li"><a href="'.wl($ID,'do=register').'">'.$lang['admin_register'].'</a></div></li>');
124311e2ce22Schris  }
124411e2ce22Schris
124511e2ce22Schris  ptln('</ul>');
1246ca3a6df1SMatthias Grimm}
1247c19fe9c0Sandi
12488b06d178Schris/**
12498b06d178Schris * Form to request a new password for an existing account
12508b06d178Schris *
12518b06d178Schris * @author Benoit Chesneau <benoit@bchesneau.info>
125211e2ce22Schris */
12538b06d178Schrisfunction html_resendpwd() {
12548b06d178Schris  global $lang;
12558b06d178Schris  global $conf;
12568b06d178Schris  global $ID;
1257c19fe9c0Sandi
12588b06d178Schris  print p_locale_xhtml('resendpwd');
12598b06d178Schris?>
126096331712SAnika Henke  <div class="centeralign">
12611dd0c202SAnika Henke  <form id="dw__resendpwd" action="<?php echo wl($ID)?>" accept-charset="<?php echo $lang['encoding']?>" method="post">
12628b06d178Schris    <fieldset>
12638b06d178Schris      <br />
1264753d5abfSMatthias Grimm      <legend><?php echo $lang['resendpwd']?></legend>
12658b06d178Schris      <input type="hidden" name="do" value="resendpwd" />
12668b06d178Schris      <input type="hidden" name="save" value="1" />
12678b06d178Schris      <label class="block">
12688b06d178Schris        <span><?php echo $lang['user']?></span>
12698b06d178Schris        <input type="text" name="login" value="<?php echo formText($_POST['login'])?>" class="edit" /><br /><br />
12708b06d178Schris      </label><br />
12718b06d178Schris      <input type="submit" value="<?php echo $lang['btn_resendpwd']?>" class="button" />
12728b06d178Schris    </fieldset>
12738b06d178Schris  </form>
12748b06d178Schris  </div>
12758b06d178Schris<?php
12768b06d178Schris}
1277340756e4Sandi
1278340756e4Sandi//Setup VIM: ex: et ts=2 enc=utf-8 :
1279