xref: /dokuwiki/inc/html.php (revision 041d7a86fb8203c598f5311bcbc2ab4b7b5bb085)
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">
554da078a3Smatthiasgrimm    <form action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>" method="post">
56f3f0262cSandi      <fieldset>
574da078a3Smatthiasgrimm        <legend><?php echo $lang['btn_login']?></legend>
584da078a3Smatthiasgrimm        <input type="hidden" name="id" value="<?php echo $ID?>" />
59f3f0262cSandi        <input type="hidden" name="do" value="login" />
60b6912aeaSAndreas Gohr        <label class="block">
614da078a3Smatthiasgrimm          <span><?php echo $lang['user']?></span>
624da078a3Smatthiasgrimm          <input type="text" name="u" value="<?php echo formText($_REQUEST['u'])?>" class="edit" />
63f3f0262cSandi        </label><br />
64b6912aeaSAndreas Gohr        <label class="block">
654da078a3Smatthiasgrimm          <span><?php echo $lang['pass']?></span>
66f3f0262cSandi          <input type="password" name="p" class="edit" />
67f3f0262cSandi        </label><br />
684da078a3Smatthiasgrimm        <input type="submit" value="<?php echo $lang['btn_login']?>" class="button" />
690c1887a0SAndreas Gohr        <label for="remember__me" class="simple">
704d6f545eSAndreas Gohr          <input type="checkbox" name="r" id="remember__me" value="1" />
714da078a3Smatthiasgrimm          <span><?php echo $lang['remember']?></span>
72132bdbfeSandi        </label>
73f3f0262cSandi      </fieldset>
74f3f0262cSandi    </form>
754da078a3Smatthiasgrimm  <?php
7682fd59b6SAndreas Gohr    if($auth->canDo('addUser') && $conf['openregister']){
77f3f0262cSandi      print '<p>';
78f3f0262cSandi      print $lang['reghere'];
79f3f0262cSandi      print ': <a href="'.wl($ID,'do=register').'" class="wikilink1">'.$lang['register'].'</a>';
80f3f0262cSandi      print '</p>';
81f3f0262cSandi    }
828b06d178Schris
8382fd59b6SAndreas Gohr    if ($auth->canDo('modPass') && $conf['resendpasswd']) {
848b06d178Schris      print '<p>';
858b06d178Schris      print $lang['pwdforget'];
86753d5abfSMatthias Grimm      print ': <a href="'.wl($ID,'do=resendpwd').'" class="wikilink1">'.$lang['btn_resendpwd'].'</a>';
878b06d178Schris      print '</p>';
888b06d178Schris    }
89f3f0262cSandi  ?>
90f3f0262cSandi    </div>
914da078a3Smatthiasgrimm  <?php
926bbae538Sandi/*
936bbae538Sandi FIXME provide new hook
94f3f0262cSandi  if(@file_exists('includes/login.txt')){
95f3f0262cSandi    print io_cacheParse('includes/login.txt');
96f3f0262cSandi  }
976bbae538Sandi*/
98f3f0262cSandi}
99f3f0262cSandi
100f3f0262cSandi/**
101ee4c4a1bSAndreas Gohr * shows the edit/source/show/draft button dependent on current mode
10215fae107Sandi *
10315fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
104f3f0262cSandi */
105f3f0262cSandifunction html_editbutton(){
106f3f0262cSandi  global $ID;
107f3f0262cSandi  global $REV;
108f3f0262cSandi  global $ACT;
109f3f0262cSandi  global $INFO;
110f3f0262cSandi
111f3f0262cSandi  if($ACT == 'show' || $ACT == 'search'){
112f3f0262cSandi    if($INFO['writable']){
113ee4c4a1bSAndreas Gohr      if($INFO['draft']){
114ee4c4a1bSAndreas Gohr          $r = html_btn('draft',$ID,'e',array('do' => 'draft'),'post');
115ee4c4a1bSAndreas Gohr      }else{
116f3f0262cSandi        if($INFO['exists']){
117f3f0262cSandi          $r = html_btn('edit',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
118f3f0262cSandi        }else{
119f3f0262cSandi          $r = html_btn('create',$ID,'e',array('do' => 'edit','rev' => $REV),'post');
120f3f0262cSandi        }
121ee4c4a1bSAndreas Gohr      }
122f3f0262cSandi    }else{
123f3f0262cSandi      $r = html_btn('source',$ID,'v',array('do' => 'edit','rev' => $REV),'post');
124f3f0262cSandi    }
125f3f0262cSandi  }else{
126f3f0262cSandi    $r = html_btn('show',$ID,'v',array('do' => 'show'));
127f3f0262cSandi  }
128f3f0262cSandi  return $r;
129f3f0262cSandi}
130f3f0262cSandi
13115fae107Sandi/**
13215fae107Sandi * prints a section editing button
13335dae8b0SBen Coburn * used as a callback in html_secedit
13415fae107Sandi *
13515fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
13615fae107Sandi */
13735dae8b0SBen Coburnfunction html_secedit_button($matches){
138f3f0262cSandi  global $ID;
139*041d7a86SBen Coburn  global $INFO;
140*041d7a86SBen Coburn
141*041d7a86SBen Coburn  $section = $matches[2];
142*041d7a86SBen Coburn  $name = $matches[1];
143*041d7a86SBen Coburn
144f3f0262cSandi  $secedit  = '';
145f3f0262cSandi  $secedit .= '<div class="secedit">';
146f3f0262cSandi  $secedit .= html_btn('secedit',$ID,'',
147f3f0262cSandi                        array('do'      => 'edit',
148306b2c85SDenis Simakov                              'lines'   => "$section",
149306b2c85SDenis Simakov                              'rev' => $INFO['lastmod']),
15035dae8b0SBen Coburn                              'post', $name);
151f3f0262cSandi  $secedit .= '</div>';
152f3f0262cSandi  return $secedit;
153f3f0262cSandi}
154f3f0262cSandi
15515fae107Sandi/**
15615fae107Sandi * inserts section edit buttons if wanted or removes the markers
15715fae107Sandi *
15815fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
15915fae107Sandi */
160f3f0262cSandifunction html_secedit($text,$show=true){
161f3f0262cSandi  global $INFO;
16235dae8b0SBen Coburn
163c112d578Sandi  if($INFO['writable'] && $show && !$INFO['rev']){
16435dae8b0SBen Coburn    $text = preg_replace_callback('#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#',
16535dae8b0SBen Coburn                         'html_secedit_button', $text);
166f3f0262cSandi  }else{
16735dae8b0SBen Coburn    $text = preg_replace('#<!-- SECTION "(.*?)" \[(\d+-\d*)\] -->#','',$text);
168f3f0262cSandi  }
16935dae8b0SBen Coburn
170f3f0262cSandi  return $text;
171f3f0262cSandi}
172f3f0262cSandi
173f3f0262cSandi/**
174d6c9c552Smatthiasgrimm * Just the back to top button (in its own form)
1756b13307fSandi *
1766b13307fSandi * @author Andreas Gohr <andi@splitbrain.org>
1776b13307fSandi */
1786b13307fSandifunction html_topbtn(){
1796b13307fSandi  global $lang;
1806b13307fSandi
1816b13307fSandi  $ret  = '';
1820e99f6d7SBen Coburn  $ret  = '<a class="nolink" href="#dokuwiki__top"><input type="button" class="button" value="'.$lang['btn_top'].'" onclick="window.scrollTo(0, 0)" /></a>';
183df7b6005Sandi
1846b13307fSandi  return $ret;
1856b13307fSandi}
1866b13307fSandi
1876b13307fSandi/**
188d67ca2c0Smatthiasgrimm * Just the back to media window button in its own form
189d67ca2c0Smatthiasgrimm *
190d67ca2c0Smatthiasgrimm * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
191d67ca2c0Smatthiasgrimm */
192d67ca2c0Smatthiasgrimmfunction html_backtomedia_button($params,$akey=''){
193d67ca2c0Smatthiasgrimm  global $conf;
194d67ca2c0Smatthiasgrimm  global $lang;
195d67ca2c0Smatthiasgrimm
1963df72098SAndreas Gohr  $ret = '<form class="button" method="get" action="'.DOKU_BASE.'lib/exe/mediamanager.php"><div class="no">';
197d67ca2c0Smatthiasgrimm
198d67ca2c0Smatthiasgrimm  reset($params);
199d67ca2c0Smatthiasgrimm  while (list($key, $val) = each($params)) {
200d67ca2c0Smatthiasgrimm    $ret .= '<input type="hidden" name="'.$key.'" ';
201d67ca2c0Smatthiasgrimm    $ret .= 'value="'.htmlspecialchars($val).'" />';
202d67ca2c0Smatthiasgrimm  }
203d67ca2c0Smatthiasgrimm
204d67ca2c0Smatthiasgrimm  $ret .= '<input type="submit" value="'.htmlspecialchars($lang['btn_backtomedia']).'" class="button" ';
205d67ca2c0Smatthiasgrimm  if($akey){
206d67ca2c0Smatthiasgrimm    $ret .= 'title="ALT+'.strtoupper($akey).'" ';
207d67ca2c0Smatthiasgrimm    $ret .= 'accesskey="'.$akey.'" ';
208d67ca2c0Smatthiasgrimm  }
209d67ca2c0Smatthiasgrimm  $ret .= '/>';
2104beabca9SAnika Henke  $ret .= '</div></form>';
211d67ca2c0Smatthiasgrimm
212d67ca2c0Smatthiasgrimm  return $ret;
213d67ca2c0Smatthiasgrimm}
214d67ca2c0Smatthiasgrimm
215d67ca2c0Smatthiasgrimm/**
216d67ca2c0Smatthiasgrimm * Displays a button (using its own form)
21735dae8b0SBen Coburn * If tooltip exists, the access key tooltip is replaced.
21815fae107Sandi *
21915fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
220f3f0262cSandi */
22135dae8b0SBen Coburnfunction html_btn($name,$id,$akey,$params,$method='get',$tooltip=''){
222f3f0262cSandi  global $conf;
223f3f0262cSandi  global $lang;
224f3f0262cSandi
225f3f0262cSandi  $label = $lang['btn_'.$name];
226f3f0262cSandi
227f3f0262cSandi  $ret = '';
22835dae8b0SBen Coburn  $tip = '';
229f3f0262cSandi
23049c713a3Sandi  //filter id (without urlencoding)
23149c713a3Sandi  $id = idfilter($id,false);
232f3f0262cSandi
233f3f0262cSandi  //make nice URLs even for buttons
2346c7843b5Sandi  if($conf['userewrite'] == 2){
2356c7843b5Sandi    $script = DOKU_BASE.DOKU_SCRIPT.'/'.$id;
2366c7843b5Sandi  }elseif($conf['userewrite']){
2376c7843b5Sandi    $script = DOKU_BASE.$id;
2386c7843b5Sandi  }else{
2398b00ebcfSandi    $script = DOKU_BASE.DOKU_SCRIPT;
240f3f0262cSandi    $params['id'] = $id;
241f3f0262cSandi  }
242f3f0262cSandi
2434beabca9SAnika Henke  $ret .= '<form class="button" method="'.$method.'" action="'.$script.'"><div class="no">';
244f3f0262cSandi
24506a4bf8fSAndreas Gohr  if(is_array($params)){
246f3f0262cSandi    reset($params);
247f3f0262cSandi    while (list($key, $val) = each($params)) {
248f3f0262cSandi      $ret .= '<input type="hidden" name="'.$key.'" ';
249f3f0262cSandi      $ret .= 'value="'.htmlspecialchars($val).'" />';
250f3f0262cSandi    }
25106a4bf8fSAndreas Gohr  }
252f3f0262cSandi
253f3f0262cSandi  $ret .= '<input type="submit" value="'.htmlspecialchars($label).'" class="button" ';
254f3f0262cSandi  if($akey){
25535dae8b0SBen Coburn    $tip = '[ALT+'.strtoupper($akey).']';
256f3f0262cSandi    $ret .= 'accesskey="'.$akey.'" ';
257f3f0262cSandi  }
25835dae8b0SBen Coburn  if ($tooltip!='') {
25935dae8b0SBen Coburn      $tip = htmlspecialchars($tooltip);
26035dae8b0SBen Coburn  }
26135dae8b0SBen Coburn  $ret .= 'title="'.$tip.'" ';
262f3f0262cSandi  $ret .= '/>';
2634beabca9SAnika Henke  $ret .= '</div></form>';
264f3f0262cSandi
265f3f0262cSandi  return $ret;
266f3f0262cSandi}
267f3f0262cSandi
268f3f0262cSandi/**
26915fae107Sandi * show a wiki page
27015fae107Sandi *
27115fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
27215fae107Sandi */
2736bbae538Sandifunction html_show($txt=''){
274f3f0262cSandi  global $ID;
275f3f0262cSandi  global $REV;
276f3f0262cSandi  global $HIGH;
277f3f0262cSandi  //disable section editing for old revisions or in preview
2785400331dSandi  if($txt || $REV){
2796bbae538Sandi    $secedit = false;
2806bbae538Sandi  }else{
2816bbae538Sandi    $secedit = true;
282f3f0262cSandi  }
283f3f0262cSandi
2846bbae538Sandi  if ($txt){
285f3f0262cSandi    //PreviewHeader
28650835be7SAndreas Gohr    print '<br id="scroll__here" />';
287c112d578Sandi    print p_locale_xhtml('preview');
288f3f0262cSandi    print '<div class="preview">';
2899dc2c2afSandi    print html_secedit(p_render('xhtml',p_get_instructions($txt),$info),$secedit);
29046723c19SAndreas Gohr    print '<div class="clearer"></div>';
291f3f0262cSandi    print '</div>';
2926bbae538Sandi
293f3f0262cSandi  }else{
294c112d578Sandi    if ($REV) print p_locale_xhtml('showrev');
295c112d578Sandi    $html = p_wiki_xhtml($ID,$REV,true);
2966bbae538Sandi    $html = html_secedit($html,$secedit);
297f3f0262cSandi    print html_hilight($html,$HIGH);
298f3f0262cSandi  }
299f3f0262cSandi}
300f3f0262cSandi
301f3f0262cSandi/**
302ee4c4a1bSAndreas Gohr * ask the user about how to handle an exisiting draft
303ee4c4a1bSAndreas Gohr *
304ee4c4a1bSAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org>
305ee4c4a1bSAndreas Gohr */
306ee4c4a1bSAndreas Gohrfunction html_draft(){
307ee4c4a1bSAndreas Gohr  global $INFO;
308ee4c4a1bSAndreas Gohr  global $ID;
309ee4c4a1bSAndreas Gohr  global $lang;
310ee4c4a1bSAndreas Gohr  global $conf;
311ee4c4a1bSAndreas Gohr  $draft = unserialize(io_readFile($INFO['draft'],false));
312ee4c4a1bSAndreas Gohr  $text  = cleanText(con($draft['prefix'],$draft['text'],$draft['suffix'],true));
313ee4c4a1bSAndreas Gohr
314ee4c4a1bSAndreas Gohr  echo p_locale_xhtml('draft');
315ee4c4a1bSAndreas Gohr  ?>
316ee4c4a1bSAndreas Gohr  <form id="dw__editform" method="post" action="<?php echo script()?>"
317ee4c4a1bSAndreas Gohr   accept-charset="<?php echo $lang['encoding']?>"><div class="no">
318ee4c4a1bSAndreas Gohr    <input type="hidden" name="id"   value="<?php echo $ID?>" />
319ee4c4a1bSAndreas Gohr    <input type="hidden" name="date" value="<?php echo $draft['date']?>" /></div>
320ee4c4a1bSAndreas Gohr    <textarea name="wikitext" id="wiki__text" readonly="readonly" cols="80" rows="10" class="edit"><?php echo "\n".formText($text)?></textarea>
321ee4c4a1bSAndreas Gohr
322ee4c4a1bSAndreas Gohr    <div id="draft__status"><?php echo $lang['draftdate'].' '.date($conf['dformat'],filemtime($INFO['draft']))?></div>
323ee4c4a1bSAndreas Gohr
324ee4c4a1bSAndreas Gohr    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_recover']?>" tabindex="1" />
325ee4c4a1bSAndreas Gohr    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_draftdel']?>" tabindex="2" />
326ee4c4a1bSAndreas Gohr    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_cancel']?>" tabindex="3" />
327ee4c4a1bSAndreas Gohr  </form>
328ee4c4a1bSAndreas Gohr  <?php
329ee4c4a1bSAndreas Gohr}
330ee4c4a1bSAndreas Gohr
331ee4c4a1bSAndreas Gohr/**
332f3f0262cSandi * Highlights searchqueries in HTML code
33315fae107Sandi *
33415fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
3357209be23SAndreas Gohr * @author Harry Fuecks <hfuecks@gmail.com>
336f3f0262cSandi */
337f3f0262cSandifunction html_hilight($html,$query){
3387209be23SAndreas Gohr  //split at common delimiters
3399d9c165eSAndreas Gohr  $queries = preg_split ('/[\s\'"\\\\`()\]\[?:!\.{};,#+*<>\\/]+/',$query,-1,PREG_SPLIT_NO_EMPTY);
340f3f0262cSandi  foreach ($queries as $q){
341f3f0262cSandi     $q = preg_quote($q,'/');
3427209be23SAndreas Gohr     $html = preg_replace_callback("/((<[^>]*)|$q)/i",'html_hilight_callback',$html);
343f3f0262cSandi  }
344f3f0262cSandi  return $html;
345f3f0262cSandi}
346f3f0262cSandi
347f3f0262cSandi/**
3487209be23SAndreas Gohr * Callback used by html_hilight()
3497209be23SAndreas Gohr *
3507209be23SAndreas Gohr * @author Harry Fuecks <hfuecks@gmail.com>
3517209be23SAndreas Gohr */
3527209be23SAndreas Gohrfunction html_hilight_callback($m) {
3537209be23SAndreas Gohr  $hlight = unslash($m[0]);
3547209be23SAndreas Gohr  if ( !isset($m[2])) {
3557209be23SAndreas Gohr    $hlight = '<span class="search_hit">'.$hlight.'</span>';
3567209be23SAndreas Gohr  }
3577209be23SAndreas Gohr  return $hlight;
3587209be23SAndreas Gohr}
3597209be23SAndreas Gohr
3607209be23SAndreas Gohr/**
36115fae107Sandi * Run a search and display the result
36215fae107Sandi *
36315fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
364f3f0262cSandi */
365f3f0262cSandifunction html_search(){
366ed7b5f09Sandi  require_once(DOKU_INC.'inc/search.php');
367506fa893SAndreas Gohr  require_once(DOKU_INC.'inc/fulltext.php');
368f3f0262cSandi  global $conf;
369f3f0262cSandi  global $QUERY;
370f3f0262cSandi  global $ID;
371f3f0262cSandi  global $lang;
372f3f0262cSandi
373c112d578Sandi  print p_locale_xhtml('searchpage');
374f3f0262cSandi  flush();
375f3f0262cSandi
376d0ab54f6SMichael Klier chi@chimeric.de  //check if search is restricted to namespace
377d0ab54f6SMichael Klier chi@chimeric.de  if(preg_match('/([^@]*)@([^@]*)/',$QUERY,$match)) {
378d0ab54f6SMichael Klier chi@chimeric.de      $id = cleanID($match[1]);
379d0ab54f6SMichael Klier chi@chimeric.de      if(empty($id)) {
380d0ab54f6SMichael Klier chi@chimeric.de        print '<div class="nothing">'.$lang['nothingfound'].'</div>';
381d0ab54f6SMichael Klier chi@chimeric.de        flush();
382d0ab54f6SMichael Klier chi@chimeric.de        return;
383d0ab54f6SMichael Klier chi@chimeric.de      }
384d0ab54f6SMichael Klier chi@chimeric.de  } else {
385d0ab54f6SMichael Klier chi@chimeric.de      $id = cleanID($QUERY);
386d0ab54f6SMichael Klier chi@chimeric.de  }
387d0ab54f6SMichael Klier chi@chimeric.de
3884d9ff3d5Sandi  //show progressbar
3899edac8a8SAndreas Gohr  print '<div class="centeralign" id="dw__loading">';
3904d9ff3d5Sandi  print '<br /></div>';
3919edac8a8SAndreas Gohr  print '<script type="text/javascript" charset="utf-8">';
3929edac8a8SAndreas Gohr  print 'showLoadBar("dw__loading");';
3939edac8a8SAndreas Gohr  print '</script>';
3949edac8a8SAndreas Gohr  flush();
3954d9ff3d5Sandi
396f3f0262cSandi  //do quick pagesearch
397f3f0262cSandi  $data = array();
398d0ab54f6SMichael Klier chi@chimeric.de
399d0ab54f6SMichael Klier chi@chimeric.de  $data = ft_pageLookup($id);
400f3f0262cSandi  if(count($data)){
401f3f0262cSandi    sort($data);
402f3f0262cSandi    print '<div class="search_quickresult">';
4034f732f0eSAnika Henke    print '<h3>'.$lang[quickhits].':</h3>';
4044f732f0eSAnika Henke    print '<ul class="search_quickhits">';
405140c93f3SAnika Henke    foreach($data as $id){
4064f732f0eSAnika Henke      print '<li> ';
407506fa893SAndreas Gohr      print html_wikilink(':'.$id,$conf['useheading']?NULL:$id);
4084f732f0eSAnika Henke      print '</li> ';
409f3f0262cSandi    }
410140c93f3SAnika Henke    print '</ul> ';
411f3f0262cSandi    //clear float (see http://www.complexspiral.com/publications/containing-floats/)
412f3f0262cSandi    print '<div class="clearer">&nbsp;</div>';
413f3f0262cSandi    print '</div>';
414f3f0262cSandi  }
415f3f0262cSandi  flush();
416f3f0262cSandi
417f3f0262cSandi  //do fulltext search
418506fa893SAndreas Gohr  $data = ft_pageSearch($QUERY,$poswords);
419f3f0262cSandi  if(count($data)){
420506fa893SAndreas Gohr    $num = 1;
421506fa893SAndreas Gohr    foreach($data as $id => $cnt){
422f3f0262cSandi      print '<div class="search_result">';
423506fa893SAndreas Gohr      print html_wikilink(':'.$id,$conf['useheading']?NULL:$id,$poswords);
424506fa893SAndreas Gohr      print ': <span class="search_cnt">'.$cnt.' '.$lang['hits'].'</span><br />';
425506fa893SAndreas Gohr      if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ?
426506fa893SAndreas Gohr        print '<div class="search_snippet">'.ft_snippet($id,$poswords).'</div>';
427506fa893SAndreas Gohr      }
428f3f0262cSandi      print '</div>';
429506fa893SAndreas Gohr      flush();
430506fa893SAndreas Gohr      $num++;
431f3f0262cSandi    }
432f3f0262cSandi  }else{
433820fa24bSandi    print '<div class="nothing">'.$lang['nothingfound'].'</div>';
434f3f0262cSandi  }
4354d9ff3d5Sandi
4364d9ff3d5Sandi  //hide progressbar
4374beabca9SAnika Henke  print '<script type="text/javascript" charset="utf-8">';
4389edac8a8SAndreas Gohr  print 'hideLoadBar("dw__loading");';
4394d9ff3d5Sandi  print '</script>';
4409edac8a8SAndreas Gohr  flush();
441f3f0262cSandi}
442f3f0262cSandi
44315fae107Sandi/**
44415fae107Sandi * Display error on locked pages
44515fae107Sandi *
44615fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
44715fae107Sandi */
448ee20e7d1Sandifunction html_locked(){
449f3f0262cSandi  global $ID;
450f3f0262cSandi  global $conf;
451f3f0262cSandi  global $lang;
45288f522e9Sandi  global $INFO;
453f3f0262cSandi
454f3f0262cSandi  $locktime = filemtime(wikiFN($ID).'.lock');
455f3f0262cSandi  $expire = @date($conf['dformat'], $locktime + $conf['locktime'] );
456f3f0262cSandi  $min    = round(($conf['locktime'] - (time() - $locktime) )/60);
457f3f0262cSandi
458c112d578Sandi  print p_locale_xhtml('locked');
459f3f0262cSandi  print '<ul>';
4600c6b58a8SAndreas Gohr  print '<li><div class="li"><strong>'.$lang['lockedby'].':</strong> '.$INFO['locked'].'</li>';
4610c6b58a8SAndreas Gohr  print '<li><div class="li"><strong>'.$lang['lockexpire'].':</strong> '.$expire.' ('.$min.' min)</div></li>';
462f3f0262cSandi  print '</ul>';
463f3f0262cSandi}
464f3f0262cSandi
46515fae107Sandi/**
46615fae107Sandi * list old revisions
46715fae107Sandi *
46815fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
46915fae107Sandi */
470f3f0262cSandifunction html_revisions(){
471f3f0262cSandi  global $ID;
472f3f0262cSandi  global $INFO;
473f3f0262cSandi  global $conf;
474f3f0262cSandi  global $lang;
475f3f0262cSandi  $revisions = getRevisions($ID);
476f3f0262cSandi  $date = @date($conf['dformat'],$INFO['lastmod']);
477f3f0262cSandi
478c112d578Sandi  print p_locale_xhtml('revisions');
479f3f0262cSandi  print '<ul>';
480f3f0262cSandi  if($INFO['exists']){
481b6912aeaSAndreas Gohr    print ($INFO['minor']) ? '<li class="minor">' : '<li>';
4820c6b58a8SAndreas Gohr    print '<div class="li">';
483f9b2fe70Sandi
484f9b2fe70Sandi    print $date;
485f9b2fe70Sandi
48602e51121SAnika Henke    print ' <img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" /> ';
487cffcc403Sandi
488f9b2fe70Sandi    print '<a class="wikilink1" href="'.wl($ID).'">'.$ID.'</a> ';
489652610a2Sandi
490652610a2Sandi    print $INFO['sum'];
49188f522e9Sandi    print ' <span class="user">';
49288f522e9Sandi    print $INFO['editor'];
49388f522e9Sandi    print '</span> ';
494652610a2Sandi
495652610a2Sandi    print '('.$lang['current'].')';
4960c6b58a8SAndreas Gohr    print '</div>';
497652610a2Sandi    print '</li>';
498f3f0262cSandi  }
499f3f0262cSandi
500f3f0262cSandi  foreach($revisions as $rev){
501f3f0262cSandi    $date = date($conf['dformat'],$rev);
502fb53bfe2SBen Coburn    $info = getRevisionInfo($ID,$rev,true);
503652610a2Sandi
504b6912aeaSAndreas Gohr    print ($info['minor']) ? '<li class="minor">' : '<li>';
5050c6b58a8SAndreas Gohr    print '<div class="li">';
506f9b2fe70Sandi    print $date;
507f9b2fe70Sandi
508cffcc403Sandi    print ' <a href="'.wl($ID,"rev=$rev,do=diff").'">';
509d94f4568SAndreas Gohr    $p = array();
510d94f4568SAndreas Gohr    $p['src']    = DOKU_BASE.'lib/images/diff.png';
511d94f4568SAndreas Gohr    $p['width']  = 15;
512d94f4568SAndreas Gohr    $p['height'] = 11;
513d94f4568SAndreas Gohr    $p['title']  = $lang['diff'];
514d94f4568SAndreas Gohr    $p['alt']    = $lang['diff'];
515d94f4568SAndreas Gohr    $att = buildAttributes($p);
516d94f4568SAndreas Gohr    print "<img $att />";
517cffcc403Sandi    print '</a> ';
518cffcc403Sandi
519f9b2fe70Sandi    print '<a class="wikilink1" href="'.wl($ID,"rev=$rev").'">'.$ID.'</a> ';
520f9b2fe70Sandi
521f243a77fSandi    print htmlspecialchars($info['sum']);
52288f522e9Sandi    print ' <span class="user">';
52388f522e9Sandi    if($info['user']){
52488f522e9Sandi      print $info['user'];
52588f522e9Sandi    }else{
526652610a2Sandi      print $info['ip'];
52788f522e9Sandi    }
52888f522e9Sandi    print '</span>';
529652610a2Sandi
5300c6b58a8SAndreas Gohr    print '</div>';
531f3f0262cSandi    print '</li>';
532f3f0262cSandi  }
533f3f0262cSandi  print '</ul>';
534f3f0262cSandi}
535f3f0262cSandi
53615fae107Sandi/**
53715fae107Sandi * display recent changes
53815fae107Sandi *
53915fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
5405749f1ceSmatthiasgrimm * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
54115fae107Sandi */
542a39955b0Smatthiasgrimmfunction html_recent($first=0){
543f3f0262cSandi  global $conf;
544cffcc403Sandi  global $lang;
545dbb00abcSEsther Brunner  global $ID;
5465749f1ceSmatthiasgrimm  /* we need to get one additionally log entry to be able to
5475749f1ceSmatthiasgrimm   * decide if this is the last page or is there another one.
5485749f1ceSmatthiasgrimm   * This is the cheapest solution to get this information.
5495749f1ceSmatthiasgrimm   */
550b6912aeaSAndreas Gohr  $recents = getRecents($first,$conf['recent'] + 1,getNS($ID));
5515749f1ceSmatthiasgrimm  if(count($recents) == 0 && $first != 0){
5525749f1ceSmatthiasgrimm    $first=0;
553b6912aeaSAndreas Gohr    $recents = getRecents(0,$conf['recent'] + 1,getNS($ID));
5545749f1ceSmatthiasgrimm  }
5555749f1ceSmatthiasgrimm  $cnt = count($recents) <= $conf['recent'] ? count($recents) : $conf['recent'];
556f3f0262cSandi
557c112d578Sandi  print p_locale_xhtml('recent');
558f3f0262cSandi  print '<ul>';
559a39955b0Smatthiasgrimm
560d437bcc4SAndreas Gohr  foreach($recents as $recent){
561d437bcc4SAndreas Gohr    $date = date($conf['dformat'],$recent['date']);
562b6912aeaSAndreas Gohr    print ($recent['minor']) ? '<li class="minor">' : '<li>';
5630c6b58a8SAndreas Gohr    print '<div class="li">';
564cffcc403Sandi
565f9b2fe70Sandi    print $date.' ';
566f9b2fe70Sandi
567d437bcc4SAndreas Gohr    print '<a href="'.wl($recent['id'],"do=diff").'">';
568d94f4568SAndreas Gohr    $p = array();
569d94f4568SAndreas Gohr    $p['src']    = DOKU_BASE.'lib/images/diff.png';
570d94f4568SAndreas Gohr    $p['width']  = 15;
571d94f4568SAndreas Gohr    $p['height'] = 11;
572d94f4568SAndreas Gohr    $p['title']  = $lang['diff'];
573d94f4568SAndreas Gohr    $p['alt']    = $lang['diff'];
574d94f4568SAndreas Gohr    $att = buildAttributes($p);
575d94f4568SAndreas Gohr    print "<img $att />";
576cffcc403Sandi    print '</a> ';
577cffcc403Sandi
578d437bcc4SAndreas Gohr    print '<a href="'.wl($recent['id'],"do=revisions").'">';
579d94f4568SAndreas Gohr    $p = array();
580d94f4568SAndreas Gohr    $p['src']    = DOKU_BASE.'lib/images/history.png';
581d94f4568SAndreas Gohr    $p['width']  = 12;
582d94f4568SAndreas Gohr    $p['height'] = 14;
583d94f4568SAndreas Gohr    $p['title']  = $lang['btn_revs'];
584d94f4568SAndreas Gohr    $p['alt']    = $lang['btn_revs'];
585d94f4568SAndreas Gohr    $att = buildAttributes($p);
586d94f4568SAndreas Gohr    print "<img $att />";
587cffcc403Sandi    print '</a> ';
588cffcc403Sandi
589d437bcc4SAndreas Gohr    print html_wikilink(':'.$recent['id'],$conf['useheading']?NULL:$recent['id']);
590d437bcc4SAndreas Gohr    print ' '.htmlspecialchars($recent['sum']);
591b6912aeaSAndreas Gohr
59288f522e9Sandi    print ' <span class="user">';
593d437bcc4SAndreas Gohr    if($recent['user']){
594d437bcc4SAndreas Gohr      print $recent['user'];
59588f522e9Sandi    }else{
596d437bcc4SAndreas Gohr      print $recent['ip'];
59788f522e9Sandi    }
59888f522e9Sandi    print '</span>';
599cffcc403Sandi
6000c6b58a8SAndreas Gohr    print '</div>';
601f3f0262cSandi    print '</li>';
602f3f0262cSandi  }
603f3f0262cSandi  print '</ul>';
604a39955b0Smatthiasgrimm
605a39955b0Smatthiasgrimm  print '<div class="pagenav">';
6065749f1ceSmatthiasgrimm  $last = $first + $conf['recent'];
607a39955b0Smatthiasgrimm  if ($first > 0) {
608a39955b0Smatthiasgrimm    $first -= $conf['recent'];
609a39955b0Smatthiasgrimm    if ($first < 0) $first = 0;
610a39955b0Smatthiasgrimm    print '<div class="pagenav-prev">';
6115749f1ceSmatthiasgrimm    print html_btn('newer','',"p",array('do' => 'recent', 'first' => $first));
612a39955b0Smatthiasgrimm    print '</div>';
613a39955b0Smatthiasgrimm  }
6145749f1ceSmatthiasgrimm  if ($conf['recent'] < count($recents)) {
615a39955b0Smatthiasgrimm    print '<div class="pagenav-next">';
6165749f1ceSmatthiasgrimm    print html_btn('older','',"n",array('do' => 'recent', 'first' => $last));
617a39955b0Smatthiasgrimm    print '</div>';
618a39955b0Smatthiasgrimm  }
619a39955b0Smatthiasgrimm  print '</div>';
620f3f0262cSandi}
621f3f0262cSandi
62215fae107Sandi/**
62315fae107Sandi * Display page index
62415fae107Sandi *
62515fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
62615fae107Sandi */
627f3f0262cSandifunction html_index($ns){
628ed7b5f09Sandi  require_once(DOKU_INC.'inc/search.php');
629f3f0262cSandi  global $conf;
630f3f0262cSandi  global $ID;
631f3f0262cSandi  $dir = $conf['datadir'];
632f3f0262cSandi  $ns  = cleanID($ns);
63330f1737dSandi  #fixme use appropriate function
634f3f0262cSandi  if(empty($ns)){
635f3f0262cSandi    $ns = dirname(str_replace(':','/',$ID));
636f3f0262cSandi    if($ns == '.') $ns ='';
637f3f0262cSandi  }
63888d3a917Sandi  $ns  = utf8_encodeFN(str_replace(':','/',$ns));
639f3f0262cSandi
640c112d578Sandi  print p_locale_xhtml('index');
641f3f0262cSandi
642f3f0262cSandi  $data = array();
643f3f0262cSandi  search($data,$conf['datadir'],'search_index',array('ns' => $ns));
644cb70c441Sandi  print html_buildlist($data,'idx','html_list_index','html_li_index');
645f3f0262cSandi}
646f3f0262cSandi
647f3f0262cSandi/**
64815fae107Sandi * Index item formatter
64915fae107Sandi *
650f3f0262cSandi * User function for html_buildlist()
65115fae107Sandi *
65215fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
653f3f0262cSandi */
654f3f0262cSandifunction html_list_index($item){
655f3f0262cSandi  $ret = '';
656f3f0262cSandi  $base = ':'.$item['id'];
657f3f0262cSandi  $base = substr($base,strrpos($base,':')+1);
658f3f0262cSandi  if($item['type']=='d'){
659f3f0262cSandi    $ret .= '<a href="'.wl($ID,'idx='.$item['id']).'" class="idx_dir">';
660f3f0262cSandi    $ret .= $base;
661f3f0262cSandi    $ret .= '</a>';
662f3f0262cSandi  }else{
663f3f0262cSandi    $ret .= html_wikilink(':'.$item['id']);
664f3f0262cSandi  }
665f3f0262cSandi  return $ret;
666f3f0262cSandi}
667f3f0262cSandi
668f3f0262cSandi/**
669cb70c441Sandi * Index List item
670cb70c441Sandi *
671cb70c441Sandi * This user function is used in html_build_lidt to build the
672cb70c441Sandi * <li> tags for namespaces when displaying the page index
673cb70c441Sandi * it gives different classes to opened or closed "folders"
674cb70c441Sandi *
675cb70c441Sandi * @author Andreas Gohr <andi@splitbrain.org>
676cb70c441Sandi */
677cb70c441Sandifunction html_li_index($item){
678cb70c441Sandi  if($item['type'] == "f"){
679cb70c441Sandi    return '<li class="level'.$item['level'].'">';
680cb70c441Sandi  }elseif($item['open']){
681cb70c441Sandi    return '<li class="open">';
682cb70c441Sandi  }else{
683cb70c441Sandi    return '<li class="closed">';
684cb70c441Sandi  }
685cb70c441Sandi}
686cb70c441Sandi
687cb70c441Sandi/**
688cb70c441Sandi * Default List item
689cb70c441Sandi *
690cb70c441Sandi * @author Andreas Gohr <andi@splitbrain.org>
691cb70c441Sandi */
692cb70c441Sandifunction html_li_default($item){
693cb70c441Sandi  return '<li class="level'.$item['level'].'">';
694cb70c441Sandi}
695cb70c441Sandi
696cb70c441Sandi/**
69715fae107Sandi * Build an unordered list
69815fae107Sandi *
699f3f0262cSandi * Build an unordered list from the given $data array
700f3f0262cSandi * Each item in the array has to have a 'level' property
701f3f0262cSandi * the item itself gets printed by the given $func user
702cb70c441Sandi * function. The second and optional function is used to
703cb70c441Sandi * print the <li> tag. Both user function need to accept
704cb70c441Sandi * a single item.
70515fae107Sandi *
706c5a8fd96SAndreas Gohr * Both user functions can be given as array to point to
707c5a8fd96SAndreas Gohr * a member of an object.
708c5a8fd96SAndreas Gohr *
70915fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
710f3f0262cSandi */
711cb70c441Sandifunction html_buildlist($data,$class,$func,$lifunc='html_li_default'){
712f3f0262cSandi  $level = 0;
713f3f0262cSandi  $opens = 0;
714f3f0262cSandi  $ret   = '';
715f3f0262cSandi
716f3f0262cSandi  foreach ($data as $item){
717f3f0262cSandi
718f3f0262cSandi    if( $item['level'] > $level ){
719f3f0262cSandi      //open new list
720df52d0feSandi      for($i=0; $i<($item['level'] - $level); $i++){
721df52d0feSandi        if ($i) $ret .= "<li class=\"clear\">\n";
722f3f0262cSandi        $ret .= "\n<ul class=\"$class\">\n";
723df52d0feSandi      }
724f3f0262cSandi    }elseif( $item['level'] < $level ){
725f3f0262cSandi      //close last item
726f3f0262cSandi      $ret .= "</li>\n";
727f3f0262cSandi      for ($i=0; $i<($level - $item['level']); $i++){
728f3f0262cSandi        //close higher lists
729f3f0262cSandi        $ret .= "</ul>\n</li>\n";
730f3f0262cSandi      }
731f3f0262cSandi    }else{
732f3f0262cSandi      //close last item
733f3f0262cSandi      $ret .= "</li>\n";
734f3f0262cSandi    }
735f3f0262cSandi
736f3f0262cSandi    //remember current level
737f3f0262cSandi    $level = $item['level'];
738f3f0262cSandi
739f3f0262cSandi    //print item
740c5a8fd96SAndreas Gohr    if(is_array($lifunc)){
741c5a8fd96SAndreas Gohr      $ret .= $lifunc[0]->$lifunc[1]($item); //user object method
742c5a8fd96SAndreas Gohr    }else{
743cb70c441Sandi      $ret .= $lifunc($item); //user function
744c5a8fd96SAndreas Gohr    }
7450c6b58a8SAndreas Gohr    $ret .= '<div class="li">';
746c5a8fd96SAndreas Gohr    if(is_array($func)){
747c5a8fd96SAndreas Gohr      $ret .= $func[0]->$func[1]($item); //user object method
748c5a8fd96SAndreas Gohr    }else{
749f3f0262cSandi    $ret .= $func($item); //user function
750c5a8fd96SAndreas Gohr    }
7510c6b58a8SAndreas Gohr    $ret .= '</div>';
752f3f0262cSandi  }
753f3f0262cSandi
754f3f0262cSandi  //close remaining items and lists
755f3f0262cSandi  for ($i=0; $i < $level; $i++){
756f3f0262cSandi    $ret .= "</li></ul>\n";
757f3f0262cSandi  }
758f3f0262cSandi
759f3f0262cSandi  return $ret;
760f3f0262cSandi}
761f3f0262cSandi
76215fae107Sandi/**
76315fae107Sandi * display backlinks
76415fae107Sandi *
76515fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
76615fae107Sandi */
767f3f0262cSandifunction html_backlinks(){
76854f4c056SAndreas Gohr  require_once(DOKU_INC.'inc/fulltext.php');
769f3f0262cSandi  global $ID;
770f3f0262cSandi  global $conf;
771f3f0262cSandi
772c112d578Sandi  print p_locale_xhtml('backlinks');
773f3f0262cSandi
77454f4c056SAndreas Gohr  $data = ft_backlinks($ID);
775f3f0262cSandi
776f3f0262cSandi  print '<ul class="idx">';
77754f4c056SAndreas Gohr  foreach($data as $blink){
7780c6b58a8SAndreas Gohr    print '<li><div class="li">';
77954f4c056SAndreas Gohr    print html_wikilink(':'.$blink,$conf['useheading']?NULL:$blink);
7800c6b58a8SAndreas Gohr    print '</div></li>';
781f3f0262cSandi  }
782f3f0262cSandi  print '</ul>';
783f3f0262cSandi}
784f3f0262cSandi
78515fae107Sandi/**
78615fae107Sandi * show diff
78715fae107Sandi *
78815fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
78915fae107Sandi */
790f3f0262cSandifunction html_diff($text='',$intro=true){
791ed7b5f09Sandi  require_once(DOKU_INC.'inc/DifferenceEngine.php');
792f3f0262cSandi  global $ID;
793f3f0262cSandi  global $REV;
794f3f0262cSandi  global $lang;
795f3f0262cSandi  global $conf;
796f3f0262cSandi  if($text){
797f3f0262cSandi    $df  = new Diff(split("\n",htmlspecialchars(rawWiki($ID,''))),
798f3f0262cSandi                    split("\n",htmlspecialchars(cleanText($text))));
799f3f0262cSandi    $left  = '<a class="wikilink1" href="'.wl($ID).'">'.
800f3f0262cSandi              $ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a>'.
801f3f0262cSandi              $lang['current'];
802f3f0262cSandi    $right = $lang['yours'];
803f3f0262cSandi  }else{
8044d58bd99Sandi    if($REV){
8054d58bd99Sandi      $r = $REV;
8064d58bd99Sandi    }else{
8074d58bd99Sandi      //use last revision if none given
8084d58bd99Sandi      $revs = getRevisions($ID);
8094d58bd99Sandi      $r = $revs[0];
8104d58bd99Sandi    }
8114d58bd99Sandi
8124d58bd99Sandi    $df  = new Diff(split("\n",htmlspecialchars(rawWiki($ID,$r))),
813f3f0262cSandi                    split("\n",htmlspecialchars(rawWiki($ID,''))));
8144d58bd99Sandi    $left  = '<a class="wikilink1" href="'.wl($ID,"rev=$r").'">'.
8154d58bd99Sandi              $ID.' '.date($conf['dformat'],$r).'</a>';
816f3f0262cSandi    $right = '<a class="wikilink1" href="'.wl($ID).'">'.
817f3f0262cSandi              $ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).'</a> '.
818f3f0262cSandi              $lang['current'];
819f3f0262cSandi  }
820f3f0262cSandi  $tdf = new TableDiffFormatter();
821c112d578Sandi  if($intro) print p_locale_xhtml('diff');
822f3f0262cSandi  ?>
823daf4ca4eSAnika Henke    <table class="diff">
824f3f0262cSandi      <tr>
825daf4ca4eSAnika Henke        <th colspan="2">
8264da078a3Smatthiasgrimm          <?php echo $left?>
827daf4ca4eSAnika Henke        </th>
828daf4ca4eSAnika Henke        <th colspan="2">
8294da078a3Smatthiasgrimm          <?php echo $right?>
830daf4ca4eSAnika Henke        </th>
831f3f0262cSandi      </tr>
8324da078a3Smatthiasgrimm      <?php echo $tdf->format($df)?>
833f3f0262cSandi    </table>
8344da078a3Smatthiasgrimm  <?php
835f3f0262cSandi}
836f3f0262cSandi
83715fae107Sandi/**
83815fae107Sandi * show warning on conflict detection
83915fae107Sandi *
84015fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
84115fae107Sandi */
842f3f0262cSandifunction html_conflict($text,$summary){
843f3f0262cSandi  global $ID;
844f3f0262cSandi  global $lang;
845f3f0262cSandi
846c112d578Sandi  print p_locale_xhtml('conflict');
847f3f0262cSandi  ?>
8481dd0c202SAnika Henke  <form id="dw__editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>">
84996331712SAnika Henke  <div class="centeralign">
8504da078a3Smatthiasgrimm    <input type="hidden" name="id" value="<?php echo $ID?>" />
8514da078a3Smatthiasgrimm    <input type="hidden" name="wikitext" value="<?php echo formText($text)?>" />
8524da078a3Smatthiasgrimm    <input type="hidden" name="summary" value="<?php echo formText($summary)?>" />
853f3f0262cSandi
8544da078a3Smatthiasgrimm    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_save']?>" accesskey="s" title="[ALT+S]" />
8554da078a3Smatthiasgrimm    <input class="button" type="submit" name="do" value="<?php echo $lang['btn_cancel']?>" />
856f3f0262cSandi  </div>
857f3f0262cSandi  </form>
858f3f0262cSandi  <br /><br /><br /><br />
8594da078a3Smatthiasgrimm  <?php
860f3f0262cSandi}
861f3f0262cSandi
862f3f0262cSandi/**
86315fae107Sandi * Prints the global message array
86415fae107Sandi *
86515fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
866f3f0262cSandi */
867f3f0262cSandifunction html_msgarea(){
868f3f0262cSandi  global $MSG;
869f3f0262cSandi
870f3f0262cSandi  if(!isset($MSG)) return;
871f3f0262cSandi
872f3f0262cSandi  foreach($MSG as $msg){
873f3f0262cSandi    print '<div class="'.$msg['lvl'].'">';
874f3f0262cSandi    print $msg['msg'];
875f3f0262cSandi    print '</div>';
876f3f0262cSandi  }
877f3f0262cSandi}
878f3f0262cSandi
879f3f0262cSandi/**
880f3f0262cSandi * Prints the registration form
88115fae107Sandi *
88215fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
883f3f0262cSandi */
884f3f0262cSandifunction html_register(){
885f3f0262cSandi  global $lang;
886cab2716aSmatthias.grimm  global $conf;
887f3f0262cSandi  global $ID;
888f3f0262cSandi
889c112d578Sandi  print p_locale_xhtml('register');
890f3f0262cSandi?>
89196331712SAnika Henke  <div class="centeralign">
8921dd0c202SAnika Henke  <form id="dw__register" method="post" action="<?php echo wl($ID)?>" accept-charset="<?php echo $lang['encoding']?>">
89396331712SAnika Henke  <fieldset>
894f3f0262cSandi    <input type="hidden" name="do" value="register" />
895f3f0262cSandi    <input type="hidden" name="save" value="1" />
89696331712SAnika Henke
8974da078a3Smatthiasgrimm    <legend><?php echo $lang['register']?></legend>
898b6912aeaSAndreas Gohr    <label class="block">
8994da078a3Smatthiasgrimm      <?php echo $lang['user']?>
9004da078a3Smatthiasgrimm      <input type="text" name="login" class="edit" size="50" value="<?php echo formText($_POST['login'])?>" />
901f3f0262cSandi    </label><br />
902cab2716aSmatthias.grimm
903cab2716aSmatthias.grimm    <?php
904cab2716aSmatthias.grimm      if (!$conf['autopasswd']) {
905cab2716aSmatthias.grimm    ?>
906b6912aeaSAndreas Gohr      <label class="block">
9074da078a3Smatthiasgrimm        <?php echo $lang['pass']?>
908cab2716aSmatthias.grimm        <input type="password" name="pass" class="edit" size="50" />
909cab2716aSmatthias.grimm      </label><br />
910b6912aeaSAndreas Gohr      <label class="block">
9114da078a3Smatthiasgrimm        <?php echo $lang['passchk']?>
912cab2716aSmatthias.grimm        <input type="password" name="passchk" class="edit" size="50" />
913cab2716aSmatthias.grimm      </label><br />
914cab2716aSmatthias.grimm    <?php
915cab2716aSmatthias.grimm      }
916cab2716aSmatthias.grimm    ?>
917cab2716aSmatthias.grimm
918b6912aeaSAndreas Gohr    <label class="block">
9194da078a3Smatthiasgrimm      <?php echo $lang['fullname']?>
9204da078a3Smatthiasgrimm      <input type="text" name="fullname" class="edit" size="50" value="<?php echo formText($_POST['fullname'])?>" />
921f3f0262cSandi    </label><br />
922b6912aeaSAndreas Gohr    <label class="block">
9234da078a3Smatthiasgrimm      <?php echo $lang['email']?>
9244da078a3Smatthiasgrimm      <input type="text" name="email" class="edit" size="50" value="<?php echo formText($_POST['email'])?>" />
925f3f0262cSandi    </label><br />
9264da078a3Smatthiasgrimm    <input type="submit" class="button" value="<?php echo $lang['register']?>" />
927f3f0262cSandi  </fieldset>
928f3f0262cSandi  </form>
929f3f0262cSandi  </div>
9304da078a3Smatthiasgrimm<?php
931f3f0262cSandi}
932f3f0262cSandi
933f3f0262cSandi/**
9348b06d178Schris * Print the update profile form
9358b06d178Schris *
9368b06d178Schris * @author Christopher Smith <chris@jalakai.co.uk>
9378b06d178Schris * @author Andreas Gohr <andi@splitbrain.org>
9388b06d178Schris */
9398b06d178Schrisfunction html_updateprofile(){
9408b06d178Schris  global $lang;
9418b06d178Schris  global $conf;
9428b06d178Schris  global $ID;
9438b06d178Schris  global $INFO;
94482fd59b6SAndreas Gohr  global $auth;
9458b06d178Schris
9468b06d178Schris  print p_locale_xhtml('updateprofile');
9478b06d178Schris
9488b06d178Schris  if (empty($_POST['fullname'])) $_POST['fullname'] = $INFO['userinfo']['name'];
9498b06d178Schris  if (empty($_POST['email'])) $_POST['email'] = $INFO['userinfo']['mail'];
9508b06d178Schris?>
95196331712SAnika Henke  <div class="centeralign">
9521dd0c202SAnika Henke  <form id="dw__register" method="post" action="<?php echo wl($ID)?>" accept-charset="<?php echo $lang['encoding']?>">
95396331712SAnika Henke  <fieldset style="width: 80%;">
9548b06d178Schris    <input type="hidden" name="do" value="profile" />
9558b06d178Schris    <input type="hidden" name="save" value="1" />
95696331712SAnika Henke
9578b06d178Schris    <legend><?php echo $lang['profile']?></legend>
9588b06d178Schris    <label class="block">
9598b06d178Schris      <?php echo $lang['user']?>
9608b06d178Schris      <input type="text" name="fullname" disabled="disabled" class="edit" size="50" value="<?php echo formText($_SERVER['REMOTE_USER'])?>" />
9618b06d178Schris    </label><br />
9628b06d178Schris    <label class="block">
9638b06d178Schris      <?php echo $lang['fullname']?>
96482fd59b6SAndreas Gohr      <input type="text" name="fullname" <?php if(!$auth->canDo('modName')) echo 'disabled="disabled"'?> class="edit" size="50" value="<?php echo formText($_POST['fullname'])?>" />
9658b06d178Schris    </label><br />
9668b06d178Schris    <label class="block">
9678b06d178Schris      <?php echo $lang['email']?>
96882fd59b6SAndreas Gohr      <input type="text" name="email" <?php if(!$auth->canDo('modName')) echo 'disabled="disabled"'?> class="edit" size="50" value="<?php echo formText($_POST['email'])?>" />
9698b06d178Schris    </label><br /><br />
97082fd59b6SAndreas Gohr
97182fd59b6SAndreas Gohr    <?php if($auth->canDo('modPass')) { ?>
9728b06d178Schris    <label class="block">
9738b06d178Schris      <?php echo $lang['newpass']?>
9748b06d178Schris      <input type="password" name="newpass" class="edit" size="50" />
9758b06d178Schris    </label><br />
9768b06d178Schris    <label class="block">
9778b06d178Schris      <?php echo $lang['passchk']?>
9788b06d178Schris      <input type="password" name="passchk" class="edit" size="50" />
9798b06d178Schris    </label><br />
98082fd59b6SAndreas Gohr    <?php } ?>
9818b06d178Schris
9828b06d178Schris    <?php if ($conf['profileconfirm']) { ?>
9838b06d178Schris      <br />
9848b06d178Schris      <label class="block">
9858b06d178Schris      <?php echo $lang['oldpass']?>
9868b06d178Schris      <input type="password" name="oldpass" class="edit" size="50" />
9878b06d178Schris    </label><br />
9888b06d178Schris    <?php } ?>
9898b06d178Schris
9904cb79657SMatthias Grimm    <input type="submit" class="button" value="<?php echo $lang['btn_save']?>" />
9918b06d178Schris    <input type="reset" class="button" value="<?php echo $lang['btn_reset']?>" />
9928b06d178Schris  </fieldset>
9938b06d178Schris  </form>
9948b06d178Schris  </div>
9958b06d178Schris<?php
9968b06d178Schris}
9978b06d178Schris
9988b06d178Schris/**
999f3f0262cSandi * This displays the edit form (lots of logic included)
100015fae107Sandi *
10017146cee2SAndreas Gohr * @fixme  this is a huge lump of code and should be modularized
100215fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
1003f3f0262cSandi */
1004f3f0262cSandifunction html_edit($text=null,$include='edit'){ //FIXME: include needed?
1005f3f0262cSandi  global $ID;
1006f3f0262cSandi  global $REV;
1007f3f0262cSandi  global $DATE;
1008f3f0262cSandi  global $RANGE;
1009f3f0262cSandi  global $PRE;
1010f3f0262cSandi  global $SUF;
1011f3f0262cSandi  global $INFO;
1012f3f0262cSandi  global $SUM;
1013f3f0262cSandi  global $lang;
1014f3f0262cSandi  global $conf;
1015f3f0262cSandi
1016f3f0262cSandi  //set summary default
1017f3f0262cSandi  if(!$SUM){
1018f3f0262cSandi    if($REV){
1019f3f0262cSandi      $SUM = $lang['restored'];
1020f3f0262cSandi    }elseif(!$INFO['exists']){
1021f3f0262cSandi      $SUM = $lang['created'];
1022f3f0262cSandi    }
1023f3f0262cSandi  }
1024f3f0262cSandi
1025f3f0262cSandi  //no text? Load it!
1026f3f0262cSandi  if(!isset($text)){
1027f3f0262cSandi    $pr = false; //no preview mode
10287146cee2SAndreas Gohr    if($INFO['exists']){
1029f3f0262cSandi      if($RANGE){
1030f3f0262cSandi        list($PRE,$text,$SUF) = rawWikiSlices($RANGE,$ID,$REV);
1031f3f0262cSandi      }else{
1032f3f0262cSandi        $text = rawWiki($ID,$REV);
1033f3f0262cSandi      }
1034f3f0262cSandi    }else{
10357146cee2SAndreas Gohr      //try to load a pagetemplate
10367146cee2SAndreas Gohr      $text = pageTemplate($ID);
10377146cee2SAndreas Gohr    }
10387146cee2SAndreas Gohr  }else{
1039f3f0262cSandi    $pr = true; //preview mode
1040f3f0262cSandi  }
1041f3f0262cSandi
1042f3f0262cSandi  $wr = $INFO['writable'];
1043f3f0262cSandi  if($wr){
1044c112d578Sandi    if ($REV) print p_locale_xhtml('editrev');
1045c112d578Sandi    print p_locale_xhtml($include);
1046f3f0262cSandi  }else{
1047c112d578Sandi    print p_locale_xhtml('read');
1048f3f0262cSandi    $ro='readonly="readonly"';
1049f3f0262cSandi  }
1050f3f0262cSandi  if(!$DATE) $DATE = $INFO['lastmod'];
1051dc57ef04Sandi
1052dc57ef04Sandi
1053f3f0262cSandi?>
105463afe2a6SAnika Henke  <div style="width:99%;">
105542c7abd6SAndreas Gohr
105663afe2a6SAnika Henke   <div class="toolbar">
1057ee4c4a1bSAndreas Gohr      <div id="draft__status"><?php if($INFO['draft']) echo $lang['draftdate'].' '.date($conf['dformat']);?></div>
1058ee379fa4SAndreas Gohr      <div id="tool__bar"><a href="<?php echo DOKU_BASE?>lib/exe/mediamanager.php?ns=<?php echo $INFO['namespace']?>"
105972f0e11fSAndreas Gohr      target="_blank"><?php echo $lang['mediaselect'] ?></a></div>
106020d062caSAndreas Gohr
10614da078a3Smatthiasgrimm      <?php if($wr){?>
10624beabca9SAnika Henke      <script type="text/javascript" charset="utf-8">
10634da078a3Smatthiasgrimm        <?php /* sets changed to true when previewed */?>
10644da078a3Smatthiasgrimm        textChanged = <?php ($pr) ? print 'true' : print 'false' ?>;
1065f3f0262cSandi      </script>
106624a33b42SAndreas Gohr      <span id="spell__action"></span>
106724a33b42SAndreas Gohr      <div id="spell__suggest"></div>
1068ee4c4a1bSAndreas Gohr      <?php } ?>
106963afe2a6SAnika Henke   </div>
107024a33b42SAndreas Gohr   <div id="spell__result"></div>
107163afe2a6SAnika Henke
107242c7abd6SAndreas Gohr
107342c7abd6SAndreas Gohr   <form id="dw__editform" method="post" action="<?php echo script()?>" accept-charset="<?php echo $lang['encoding']?>"><div class="no">
107442c7abd6SAndreas Gohr      <input type="hidden" name="id"   value="<?php echo $ID?>" />
107542c7abd6SAndreas Gohr      <input type="hidden" name="rev"  value="<?php echo $REV?>" />
107642c7abd6SAndreas Gohr      <input type="hidden" name="date" value="<?php echo $DATE?>" />
107742c7abd6SAndreas Gohr      <input type="hidden" name="prefix" value="<?php echo formText($PRE)?>" />
107842c7abd6SAndreas Gohr      <input type="hidden" name="suffix" value="<?php echo formText($SUF)?>" />
107942c7abd6SAndreas Gohr    </div>
108042c7abd6SAndreas Gohr
108124a33b42SAndreas Gohr    <textarea name="wikitext" id="wiki__text" <?php echo $ro?> cols="80" rows="10" class="edit" tabindex="1"><?php echo "\n".formText($text)?></textarea>
108263afe2a6SAnika Henke
108324a33b42SAndreas Gohr    <div id="wiki__editbar">
108424a33b42SAndreas Gohr      <div id="size__ctl"></div>
10854da078a3Smatthiasgrimm      <?php if($wr){?>
1086fa24fadbSAnika Henke         <div class="editButtons">
108724a33b42SAndreas Gohr            <input class="button" id="edbtn__save" type="submit" name="do" value="<?php echo $lang['btn_save']?>" accesskey="s" title="[ALT+S]" tabindex="4" />
108824a33b42SAndreas Gohr            <input class="button" id="edbtn__preview" type="submit" name="do" value="<?php echo $lang['btn_preview']?>" accesskey="p" title="[ALT+P]" tabindex="5" />
108942c7abd6SAndreas Gohr            <input class="button" type="submit" name="do[draftdel]" value="<?php echo $lang['btn_cancel']?>" tabindex="6" />
1090fa24fadbSAnika Henke         </div>
10914da078a3Smatthiasgrimm      <?php } ?>
10924da078a3Smatthiasgrimm      <?php if($wr){ ?>
1093fa24fadbSAnika Henke        <div class="summary">
109424a33b42SAndreas Gohr           <label for="edit__summary" class="nowrap"><?php echo $lang['summary']?>:</label>
109524a33b42SAndreas Gohr           <input type="text" class="edit" name="summary" id="edit__summary" size="50" value="<?php echo formText($SUM)?>" tabindex="2" />
1096b6912aeaSAndreas Gohr           <?php html_minoredit()?>
1097fa24fadbSAnika Henke        </div>
10984da078a3Smatthiasgrimm      <?php }?>
109963afe2a6SAnika Henke    </div>
110042c7abd6SAndreas Gohr  </form>
110163afe2a6SAnika Henke  </div>
11024da078a3Smatthiasgrimm<?php
1103f3f0262cSandi}
1104f3f0262cSandi
1105f3f0262cSandi/**
1106b6912aeaSAndreas Gohr * Adds a checkbox for minor edits for logged in users
1107b6912aeaSAndreas Gohr *
1108b6912aeaSAndreas Gohr * @author Andrea Gohr <andi@splitbrain.org>
1109b6912aeaSAndreas Gohr */
1110b6912aeaSAndreas Gohrfunction html_minoredit(){
1111b6912aeaSAndreas Gohr  global $conf;
1112b6912aeaSAndreas Gohr  global $lang;
1113b6912aeaSAndreas Gohr  // minor edits are for logged in users only
1114b6912aeaSAndreas Gohr  if(!$conf['useacl'] || !$_SERVER['REMOTE_USER']){
1115b6912aeaSAndreas Gohr    return;
1116b6912aeaSAndreas Gohr  }
1117b6912aeaSAndreas Gohr
1118b6912aeaSAndreas Gohr  $p = array();
1119b6912aeaSAndreas Gohr  $p['name']     = 'minor';
1120b6912aeaSAndreas Gohr  $p['type']     = 'checkbox';
1121b6912aeaSAndreas Gohr  $p['id']       = 'minoredit';
1122b6912aeaSAndreas Gohr  $p['tabindex'] = 3;
1123b6912aeaSAndreas Gohr  $p['value']    = '1';
1124b6912aeaSAndreas Gohr  if($_REQUEST['minor']) $p['checked']='checked';
1125b6912aeaSAndreas Gohr  $att = buildAttributes($p);
1126b6912aeaSAndreas Gohr
1127fa24fadbSAnika Henke  print '<span class="nowrap">';
1128b6912aeaSAndreas Gohr  print "<input $att />";
1129b6912aeaSAndreas Gohr  print '<label for="minoredit">';
1130b6912aeaSAndreas Gohr  print $lang['minoredit'];
1131b6912aeaSAndreas Gohr  print '</label>';
1132fa24fadbSAnika Henke  print '</span>';
1133b6912aeaSAndreas Gohr}
1134b6912aeaSAndreas Gohr
1135b6912aeaSAndreas Gohr/**
1136f3f0262cSandi * prints some debug info
113715fae107Sandi *
113815fae107Sandi * @author Andreas Gohr <andi@splitbrain.org>
1139f3f0262cSandi */
1140f3f0262cSandifunction html_debug(){
1141f3f0262cSandi  global $conf;
1142d16a4edaSandi  global $lang;
11435298a619SAndreas Gohr  global $auth;
114428fb55ffSandi  //remove sensitive data
114528fb55ffSandi  $cnf = $conf;
114628fb55ffSandi  $cnf['auth']='***';
114728fb55ffSandi  $cnf['notify']='***';
11483dc3a5f1Sandi  $cnf['ftp']='***';
1149f3f0262cSandi
1150f3f0262cSandi  print '<html><body>';
1151f3f0262cSandi
1152f3f0262cSandi  print '<p>When reporting bugs please send all the following ';
1153f3f0262cSandi  print 'output as a mail to andi@splitbrain.org ';
1154f3f0262cSandi  print 'The best way to do this is to save this page in your browser</p>';
1155f3f0262cSandi
1156f3f0262cSandi  print '<b>$_SERVER:</b><pre>';
1157f3f0262cSandi  print_r($_SERVER);
1158f3f0262cSandi  print '</pre>';
1159f3f0262cSandi
1160f3f0262cSandi  print '<b>$conf:</b><pre>';
116128fb55ffSandi  print_r($cnf);
1162f3f0262cSandi  print '</pre>';
1163f3f0262cSandi
1164ed7b5f09Sandi  print '<b>DOKU_BASE:</b><pre>';
1165ed7b5f09Sandi  print DOKU_BASE;
1166f3f0262cSandi  print '</pre>';
1167f3f0262cSandi
1168ed7b5f09Sandi  print '<b>abs DOKU_BASE:</b><pre>';
1169ed7b5f09Sandi  print DOKU_URL;
1170ed7b5f09Sandi  print '</pre>';
1171ed7b5f09Sandi
1172ed7b5f09Sandi  print '<b>rel DOKU_BASE:</b><pre>';
1173f3f0262cSandi  print dirname($_SERVER['PHP_SELF']).'/';
1174f3f0262cSandi  print '</pre>';
1175f3f0262cSandi
1176f3f0262cSandi  print '<b>PHP Version:</b><pre>';
1177f3f0262cSandi  print phpversion();
1178f3f0262cSandi  print '</pre>';
1179f3f0262cSandi
1180f3f0262cSandi  print '<b>locale:</b><pre>';
1181f3f0262cSandi  print setlocale(LC_ALL,0);
1182f3f0262cSandi  print '</pre>';
1183f3f0262cSandi
1184d16a4edaSandi  print '<b>encoding:</b><pre>';
1185d16a4edaSandi  print $lang['encoding'];
1186d16a4edaSandi  print '</pre>';
1187d16a4edaSandi
11885298a619SAndreas Gohr  if($auth){
11895298a619SAndreas Gohr    print '<b>Auth backend capabilities:</b><pre>';
11905298a619SAndreas Gohr    print_r($auth->cando);
11915298a619SAndreas Gohr    print '</pre>';
11925298a619SAndreas Gohr  }
11935298a619SAndreas Gohr
11943aa54d7cSAndreas Gohr  print '<b>$_SESSION:</b><pre>';
11953aa54d7cSAndreas Gohr  print_r($_SESSION);
11963aa54d7cSAndreas Gohr  print '</pre>';
11973aa54d7cSAndreas Gohr
1198f3f0262cSandi  print '<b>Environment:</b><pre>';
1199f3f0262cSandi  print_r($_ENV);
1200f3f0262cSandi  print '</pre>';
1201f3f0262cSandi
1202f3f0262cSandi  print '<b>PHP settings:</b><pre>';
1203f3f0262cSandi  $inis = ini_get_all();
1204f3f0262cSandi  print_r($inis);
1205f3f0262cSandi  print '</pre>';
1206f3f0262cSandi
1207f3f0262cSandi  print '</body></html>';
1208f3f0262cSandi}
1209f3f0262cSandi
1210c19fe9c0Sandifunction html_admin(){
1211c19fe9c0Sandi  global $ID;
1212c19fe9c0Sandi  global $lang;
1213ca3a6df1SMatthias Grimm  global $conf;
1214c19fe9c0Sandi
1215c112d578Sandi  print p_locale_xhtml('admin');
1216c19fe9c0Sandi
121711e2ce22Schris  // build menu of admin functions from the plugins that handle them
121811e2ce22Schris  $pluginlist = plugin_list('admin');
121911e2ce22Schris  $menu = array();
122011e2ce22Schris  foreach ($pluginlist as $p) {
122111e2ce22Schris    if($obj =& plugin_load('admin',$p) === NULL) continue;
122211e2ce22Schris    $menu[] = array('plugin' => $p,
122311e2ce22Schris                    'prompt' => $obj->getMenuText($conf['lang']),
122411e2ce22Schris                    'sort' => $obj->getMenuSort()
122511e2ce22Schris                   );
122611e2ce22Schris  }
122711e2ce22Schris
122811e2ce22Schris  usort($menu, p_sort_modes);
122911e2ce22Schris
123011e2ce22Schris  // output the menu
123111e2ce22Schris  ptln('<ul>');
123211e2ce22Schris
123311e2ce22Schris  foreach ($menu as $item) {
123411e2ce22Schris    if (!$item['prompt']) continue;
12350c6b58a8SAndreas Gohr    ptln('  <li><div class="li"><a href="'.wl($ID, 'do=admin&amp;page='.$item['plugin']).'">'.$item['prompt'].'</a></div></li>');
123611e2ce22Schris  }
123711e2ce22Schris
123811e2ce22Schris  // add in non-plugin functions
123911e2ce22Schris  if (!$conf['openregister']){
12400c6b58a8SAndreas Gohr    ptln('<li><div class="li"><a href="'.wl($ID,'do=register').'">'.$lang['admin_register'].'</a></div></li>');
124111e2ce22Schris  }
124211e2ce22Schris
124311e2ce22Schris  ptln('</ul>');
1244ca3a6df1SMatthias Grimm}
1245c19fe9c0Sandi
12468b06d178Schris/**
12478b06d178Schris * Form to request a new password for an existing account
12488b06d178Schris *
12498b06d178Schris * @author Benoit Chesneau <benoit@bchesneau.info>
125011e2ce22Schris */
12518b06d178Schrisfunction html_resendpwd() {
12528b06d178Schris  global $lang;
12538b06d178Schris  global $conf;
12548b06d178Schris  global $ID;
1255c19fe9c0Sandi
12568b06d178Schris  print p_locale_xhtml('resendpwd');
12578b06d178Schris?>
125896331712SAnika Henke  <div class="centeralign">
12591dd0c202SAnika Henke  <form id="dw__resendpwd" action="<?php echo wl($ID)?>" accept-charset="<?php echo $lang['encoding']?>" method="post">
12608b06d178Schris    <fieldset>
12618b06d178Schris      <br />
1262753d5abfSMatthias Grimm      <legend><?php echo $lang['resendpwd']?></legend>
12638b06d178Schris      <input type="hidden" name="do" value="resendpwd" />
12648b06d178Schris      <input type="hidden" name="save" value="1" />
12658b06d178Schris      <label class="block">
12668b06d178Schris        <span><?php echo $lang['user']?></span>
12678b06d178Schris        <input type="text" name="login" value="<?php echo formText($_POST['login'])?>" class="edit" /><br /><br />
12688b06d178Schris      </label><br />
12698b06d178Schris      <input type="submit" value="<?php echo $lang['btn_resendpwd']?>" class="button" />
12708b06d178Schris    </fieldset>
12718b06d178Schris  </form>
12728b06d178Schris  </div>
12738b06d178Schris<?php
12748b06d178Schris}
1275340756e4Sandi
1276340756e4Sandi//Setup VIM: ex: et ts=2 enc=utf-8 :
1277