From db959ae30700e3924a73350a3a43a2c36b431de7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 20 Oct 2009 23:23:38 +0200 Subject: Coding Standard Cleanup Ignore-this: 259cb5773c3144c6c706d87298dcf674 darcs-hash:20091020212338-7ad00-6bf1c5c403491f136a1c02af5ecd9f84d7227107.gz --- inc/html.php | 2067 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 1035 insertions(+), 1032 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 0ea72c06c..1fb5b0202 100644 --- a/inc/html.php +++ b/inc/html.php @@ -16,13 +16,13 @@ require_once(DOKU_INC.'inc/form.php'); * * @author Andreas Gohr */ -function html_wikilink($id,$name=NULL,$search=''){ - static $xhtml_renderer = NULL; - if(is_null($xhtml_renderer)){ - $xhtml_renderer = p_get_renderer('xhtml'); - } +function html_wikilink($id,$name=null,$search=''){ + static $xhtml_renderer = null; + if(is_null($xhtml_renderer)){ + $xhtml_renderer = p_get_renderer('xhtml'); + } - return $xhtml_renderer->internallink($id,$name,$search,true,'navigation'); + return $xhtml_renderer->internallink($id,$name,$search,true,'navigation'); } /** @@ -31,11 +31,11 @@ function html_wikilink($id,$name=NULL,$search=''){ * @author Andreas Gohr */ function html_attbuild($attributes){ - $ret = ''; - foreach ( $attributes as $key => $value ) { - $ret .= $key.'="'.formtext($value).'" '; - } - return trim($ret); + $ret = ''; + foreach ( $attributes as $key => $value ) { + $ret .= $key.'="'.formtext($value).'" '; + } + return trim($ret); } /** @@ -44,40 +44,40 @@ function html_attbuild($attributes){ * @author Andreas Gohr */ function html_login(){ - global $lang; - global $conf; - global $ID; - global $auth; - - print p_locale_xhtml('login'); - print '
'.NL; - $form = new Doku_Form('dw__login'); - $form->startFieldset($lang['btn_login']); - $form->addHidden('id', $ID); - $form->addHidden('do', 'login'); - $form->addElement(form_makeTextField('u', ((!$_REQUEST['http_credentials']) ? $_REQUEST['u'] : ''), $lang['user'], 'focus__this', 'block')); - $form->addElement(form_makePasswordField('p', $lang['pass'], '', 'block')); - if($conf['rememberme']) { - $form->addElement(form_makeCheckboxField('r', '1', $lang['remember'], 'remember__me', 'simple')); - } - $form->addElement(form_makeButton('submit', '', $lang['btn_login'])); - $form->endFieldset(); - html_form('login', $form); - - if($auth && $auth->canDo('addUser') && actionOK('register')){ - print '

'; - print $lang['reghere']; - print ': '.$lang['register'].''; - print '

'; - } - - if ($auth && $auth->canDo('modPass') && actionOK('resendpwd')) { - print '

'; - print $lang['pwdforget']; - print ': '.$lang['btn_resendpwd'].''; - print '

'; - } - print '
'.NL; + global $lang; + global $conf; + global $ID; + global $auth; + + print p_locale_xhtml('login'); + print '
'.NL; + $form = new Doku_Form('dw__login'); + $form->startFieldset($lang['btn_login']); + $form->addHidden('id', $ID); + $form->addHidden('do', 'login'); + $form->addElement(form_makeTextField('u', ((!$_REQUEST['http_credentials']) ? $_REQUEST['u'] : ''), $lang['user'], 'focus__this', 'block')); + $form->addElement(form_makePasswordField('p', $lang['pass'], '', 'block')); + if($conf['rememberme']) { + $form->addElement(form_makeCheckboxField('r', '1', $lang['remember'], 'remember__me', 'simple')); + } + $form->addElement(form_makeButton('submit', '', $lang['btn_login'])); + $form->endFieldset(); + html_form('login', $form); + + if($auth && $auth->canDo('addUser') && actionOK('register')){ + print '

'; + print $lang['reghere']; + print ': '.$lang['register'].''; + print '

'; + } + + if ($auth && $auth->canDo('modPass') && actionOK('resendpwd')) { + print '

'; + print $lang['pwdforget']; + print ': '.$lang['btn_resendpwd'].''; + print '

'; + } + print '
'.NL; } /** @@ -87,21 +87,21 @@ function html_login(){ * @author Andreas Gohr */ function html_secedit_button($matches){ - global $ID; - global $INFO; - - $section = $matches[2]; - $name = $matches[1]; - - $secedit = ''; - $secedit .= '
'; - $secedit .= html_btn('secedit',$ID,'', - array('do' => 'edit', - 'lines' => "$section", - 'rev' => $INFO['lastmod']), - 'post', $name); - $secedit .= '
'; - return $secedit; + global $ID; + global $INFO; + + $section = $matches[2]; + $name = $matches[1]; + + $secedit = ''; + $secedit .= '
'; + $secedit .= html_btn('secedit',$ID,'', + array('do' => 'edit', + 'lines' => "$section", + 'rev' => $INFO['lastmod']), + 'post', $name); + $secedit .= '
'; + return $secedit; } /** @@ -110,16 +110,16 @@ function html_secedit_button($matches){ * @author Andreas Gohr */ function html_secedit($text,$show=true){ - global $INFO; + global $INFO; - if($INFO['writable'] && $show && !$INFO['rev']){ - $text = preg_replace_callback('##', - 'html_secedit_button', $text); - }else{ - $text = preg_replace('##','',$text); - } + if($INFO['writable'] && $show && !$INFO['rev']){ + $text = preg_replace_callback('##', + 'html_secedit_button', $text); + }else{ + $text = preg_replace('##','',$text); + } - return $text; + return $text; } /** @@ -128,12 +128,12 @@ function html_secedit($text,$show=true){ * @author Andreas Gohr */ function html_topbtn(){ - global $lang; + global $lang; - $ret = ''; - $ret = ''; + $ret = ''; + $ret = ''; - return $ret; + return $ret; } /** @@ -143,53 +143,53 @@ function html_topbtn(){ * @author Andreas Gohr */ function html_btn($name,$id,$akey,$params,$method='get',$tooltip=''){ - global $conf; - global $lang; - - $label = $lang['btn_'.$name]; - - $ret = ''; - $tip = ''; - - //filter id (without urlencoding) - $id = idfilter($id,false); - - //make nice URLs even for buttons - if($conf['userewrite'] == 2){ - $script = DOKU_BASE.DOKU_SCRIPT.'/'.$id; - }elseif($conf['userewrite']){ - $script = DOKU_BASE.$id; - }else{ - $script = DOKU_BASE.DOKU_SCRIPT; - $params['id'] = $id; - } - - $ret .= '
'; - - if(is_array($params)){ - reset($params); - while (list($key, $val) = each($params)) { - $ret .= ''; + global $conf; + global $lang; + + $label = $lang['btn_'.$name]; + + $ret = ''; + $tip = ''; + + //filter id (without urlencoding) + $id = idfilter($id,false); + + //make nice URLs even for buttons + if($conf['userewrite'] == 2){ + $script = DOKU_BASE.DOKU_SCRIPT.'/'.$id; + }elseif($conf['userewrite']){ + $script = DOKU_BASE.$id; + }else{ + $script = DOKU_BASE.DOKU_SCRIPT; + $params['id'] = $id; + } + + $ret .= '
'; + + if(is_array($params)){ + reset($params); + while (list($key, $val) = each($params)) { + $ret .= ''; + } + } + + if ($tooltip!='') { + $tip = htmlspecialchars($tooltip); + }else{ + $tip = htmlspecialchars($label); } - } - - if ($tooltip!='') { - $tip = htmlspecialchars($tooltip); - }else{ - $tip = htmlspecialchars($label); - } - - $ret .= ' */ function html_show($txt=''){ - global $ID; - global $REV; - global $HIGH; - global $INFO; - //disable section editing for old revisions or in preview - if($txt || $REV){ - $secedit = false; - }else{ - $secedit = true; - } - - if ($txt){ - //PreviewHeader - echo '
'; - echo p_locale_xhtml('preview'); - echo '
'; - $html = html_secedit(p_render('xhtml',p_get_instructions($txt),$info),$secedit); - if($INFO['prependTOC']) $html = tpl_toc(true).$html; - echo $html; - echo '
'; - echo '
'; + global $ID; + global $REV; + global $HIGH; + global $INFO; + //disable section editing for old revisions or in preview + if($txt || $REV){ + $secedit = false; + }else{ + $secedit = true; + } + + if ($txt){ + //PreviewHeader + echo '
'; + echo p_locale_xhtml('preview'); + echo '
'; + $html = html_secedit(p_render('xhtml',p_get_instructions($txt),$info),$secedit); + if($INFO['prependTOC']) $html = tpl_toc(true).$html; + echo $html; + echo '
'; + echo '
'; - }else{ - if ($REV) print p_locale_xhtml('showrev'); - $html = p_wiki_xhtml($ID,$REV,true); - $html = html_secedit($html,$secedit); - if($INFO['prependTOC']) $html = tpl_toc(true).$html; - $html = html_hilight($html,$HIGH); - echo $html; - } + }else{ + if ($REV) print p_locale_xhtml('showrev'); + $html = p_wiki_xhtml($ID,$REV,true); + $html = html_secedit($html,$secedit); + if($INFO['prependTOC']) $html = tpl_toc(true).$html; + $html = html_hilight($html,$HIGH); + echo $html; + } } /** @@ -236,25 +236,25 @@ function html_show($txt=''){ * @author Andreas Gohr */ function html_draft(){ - global $INFO; - global $ID; - global $lang; - global $conf; - $draft = unserialize(io_readFile($INFO['draft'],false)); - $text = cleanText(con($draft['prefix'],$draft['text'],$draft['suffix'],true)); - - print p_locale_xhtml('draft'); - $form = new Doku_Form('dw__editform'); - $form->addHidden('id', $ID); - $form->addHidden('date', $draft['date']); - $form->addElement(form_makeWikiText($text, array('readonly'=>'readonly'))); - $form->addElement(form_makeOpenTag('div', array('id'=>'draft__status'))); - $form->addElement($lang['draftdate'].' '. dformat(filemtime($INFO['draft']))); - $form->addElement(form_makeCloseTag('div')); - $form->addElement(form_makeButton('submit', 'recover', $lang['btn_recover'], array('tabindex'=>'1'))); - $form->addElement(form_makeButton('submit', 'draftdel', $lang['btn_draftdel'], array('tabindex'=>'2'))); - $form->addElement(form_makeButton('submit', 'show', $lang['btn_cancel'], array('tabindex'=>'3'))); - html_form('draft', $form); + global $INFO; + global $ID; + global $lang; + global $conf; + $draft = unserialize(io_readFile($INFO['draft'],false)); + $text = cleanText(con($draft['prefix'],$draft['text'],$draft['suffix'],true)); + + print p_locale_xhtml('draft'); + $form = new Doku_Form('dw__editform'); + $form->addHidden('id', $ID); + $form->addHidden('date', $draft['date']); + $form->addElement(form_makeWikiText($text, array('readonly'=>'readonly'))); + $form->addElement(form_makeOpenTag('div', array('id'=>'draft__status'))); + $form->addElement($lang['draftdate'].' '. dformat(filemtime($INFO['draft']))); + $form->addElement(form_makeCloseTag('div')); + $form->addElement(form_makeButton('submit', 'recover', $lang['btn_recover'], array('tabindex'=>'1'))); + $form->addElement(form_makeButton('submit', 'draftdel', $lang['btn_draftdel'], array('tabindex'=>'2'))); + $form->addElement(form_makeButton('submit', 'show', $lang['btn_cancel'], array('tabindex'=>'3'))); + html_form('draft', $form); } /** @@ -264,12 +264,12 @@ function html_draft(){ * @author Harry Fuecks */ function html_hilight($html,$phrases){ - $phrases = array_filter((array) $phrases); - $regex = join('|',array_map('preg_quote_cb',$phrases)); + $phrases = array_filter((array) $phrases); + $regex = join('|',array_map('preg_quote_cb',$phrases)); - if ($regex === '') return $html; - $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html); - return $html; + if ($regex === '') return $html; + $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html); + return $html; } /** @@ -278,11 +278,11 @@ function html_hilight($html,$phrases){ * @author Harry Fuecks */ function html_hilight_callback($m) { - $hlight = unslash($m[0]); - if ( !isset($m[2])) { - $hlight = ''.$hlight.''; - } - return $hlight; + $hlight = unslash($m[0]); + if ( !isset($m[2])) { + $hlight = ''.$hlight.''; + } + return $hlight; } /** @@ -291,83 +291,83 @@ function html_hilight_callback($m) { * @author Andreas Gohr */ function html_search(){ - require_once(DOKU_INC.'inc/search.php'); - require_once(DOKU_INC.'inc/fulltext.php'); - global $conf; - global $QUERY; - global $ID; - global $lang; - - print p_locale_xhtml('searchpage'); - flush(); - - //check if search is restricted to namespace - if(preg_match('/@([^@]*)/',$QUERY,$match)) { - $id = cleanID($match[1]); - } else { - $id = cleanID($QUERY); - } - - //show progressbar - print '
'.NL; - print ''.NL; - print '
'.NL; - flush(); - - //do quick pagesearch - $data = array(); - - if($id) $data = ft_pageLookup($id); - if(count($data)){ - print '
'; - print '

'.$lang['quickhits'].':

'; - print '
    '; - foreach($data as $id){ - print '
  • '; - $ns = getNS($id); - if($ns){ - $name = shorten(noNS($id), ' ('.$ns.')',30); - }else{ - $name = $id; - } - print html_wikilink(':'.$id,$name); - print '
  • '; + require_once(DOKU_INC.'inc/search.php'); + require_once(DOKU_INC.'inc/fulltext.php'); + global $conf; + global $QUERY; + global $ID; + global $lang; + + print p_locale_xhtml('searchpage'); + flush(); + + //check if search is restricted to namespace + if(preg_match('/@([^@]*)/',$QUERY,$match)) { + $id = cleanID($match[1]); + } else { + $id = cleanID($QUERY); } - print '
'; - //clear float (see http://www.complexspiral.com/publications/containing-floats/) - print '
 
'; - print '
'; - } - flush(); - - //do fulltext search - $data = ft_pageSearch($QUERY,$regex); - if(count($data)){ - $num = 1; - foreach($data as $id => $cnt){ - print '
'; - print html_wikilink(':'.$id,useHeading('navigation')?NULL:$id,$regex); - if($cnt !== 0){ - print ': '.$cnt.' '.$lang['hits'].'
'; - if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ? - print '
'.ft_snippet($id,$regex).'
'; + + //show progressbar + print '
'.NL; + print ''.NL; + print '
'.NL; + flush(); + + //do quick pagesearch + $data = array(); + + if($id) $data = ft_pageLookup($id); + if(count($data)){ + print '
'; + print '

'.$lang['quickhits'].':

'; + print '
    '; + foreach($data as $id){ + print '
  • '; + $ns = getNS($id); + if($ns){ + $name = shorten(noNS($id), ' ('.$ns.')',30); + }else{ + $name = $id; + } + print html_wikilink(':'.$id,$name); + print '
  • '; } - $num++; - } - print '
'; - flush(); + print ' '; + //clear float (see http://www.complexspiral.com/publications/containing-floats/) + print '
 
'; + print '
'; } - }else{ - print '
'.$lang['nothingfound'].'
'; - } - - //hide progressbar - print ''.NL; - flush(); + flush(); + + //do fulltext search + $data = ft_pageSearch($QUERY,$regex); + if(count($data)){ + $num = 1; + foreach($data as $id => $cnt){ + print '
'; + print html_wikilink(':'.$id,useHeading('navigation')?null:$id,$regex); + if($cnt !== 0){ + print ': '.$cnt.' '.$lang['hits'].'
'; + if($num < 15){ // create snippets for the first number of matches only #FIXME add to conf ? + print '
'.ft_snippet($id,$regex).'
'; + } + $num++; + } + print '
'; + flush(); + } + }else{ + print '
'.$lang['nothingfound'].'
'; + } + + //hide progressbar + print ''.NL; + flush(); } /** @@ -376,20 +376,20 @@ function html_search(){ * @author Andreas Gohr */ function html_locked(){ - global $ID; - global $conf; - global $lang; - global $INFO; - - $locktime = filemtime(wikiLockFN($ID)); - $expire = dformat($locktime + $conf['locktime']); - $min = round(($conf['locktime'] - (time() - $locktime) )/60); - - print p_locale_xhtml('locked'); - print '
    '; - print '
  • '.$lang['lockedby'].': '.editorinfo($INFO['locked']).'
  • '; - print '
  • '.$lang['lockexpire'].': '.$expire.' ('.$min.' min)
  • '; - print '
'; + global $ID; + global $conf; + global $lang; + global $INFO; + + $locktime = filemtime(wikiLockFN($ID)); + $expire = dformat($locktime + $conf['locktime']); + $min = round(($conf['locktime'] - (time() - $locktime) )/60); + + print p_locale_xhtml('locked'); + print '
    '; + print '
  • '.$lang['lockedby'].': '.editorinfo($INFO['locked']).'
  • '; + print '
  • '.$lang['lockexpire'].': '.$expire.' ('.$min.' min)
  • '; + print '
'; } /** @@ -399,159 +399,159 @@ function html_locked(){ * @author Ben Coburn */ function html_revisions($first=0){ - global $ID; - global $INFO; - global $conf; - global $lang; - /* we need to get one additionally log entry to be able to - * decide if this is the last page or is there another one. - * see html_recent() - */ - $revisions = getRevisions($ID, $first, $conf['recent']+1); - if(count($revisions)==0 && $first!=0){ - $first=0; - $revisions = getRevisions($ID, $first, $conf['recent']+1);; - } - $hasNext = false; - if (count($revisions)>$conf['recent']) { - $hasNext = true; - array_pop($revisions); // remove extra log entry - } - - $date = dformat($INFO['lastmod']); - - print p_locale_xhtml('revisions'); - - $form = new Doku_Form('page__revisions', wl($ID)); - $form->addElement(form_makeOpenTag('ul')); - if($INFO['exists'] && $first==0){ - if (isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) - $form->addElement(form_makeOpenTag('li', array('class' => 'minor'))); - else - $form->addElement(form_makeOpenTag('li')); - $form->addElement(form_makeOpenTag('div', array('class' => 'li'))); - $form->addElement(form_makeTag('input', array( - 'type' => 'checkbox', - 'name' => 'rev2[]', - 'value' => 'current'))); - - $form->addElement(form_makeOpenTag('span', array('class' => 'date'))); - $form->addElement($date); - $form->addElement(form_makeCloseTag('span')); - - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/blank.gif', - 'width' => '15', - 'height' => '11', - 'alt' => ''))); - - $form->addElement(form_makeOpenTag('a', array( - 'class' => 'wikilink1', - 'href' => wl($ID)))); - $form->addElement($ID); - $form->addElement(form_makeCloseTag('a')); - - $form->addElement(form_makeOpenTag('span', array('class' => 'sum'))); - $form->addElement(' – '); - $form->addElement(htmlspecialchars($INFO['sum'])); - $form->addElement(form_makeCloseTag('span')); - - $form->addElement(form_makeOpenTag('span', array('class' => 'user'))); - $form->addElement((empty($INFO['editor']))?('('.$lang['external_edit'].')'):editorinfo($INFO['editor'])); - $form->addElement(form_makeCloseTag('span')); - - $form->addElement('('.$lang['current'].')'); - $form->addElement(form_makeCloseTag('div')); - $form->addElement(form_makeCloseTag('li')); - } - - foreach($revisions as $rev){ - $date = dformat($rev); - $info = getRevisionInfo($ID,$rev,true); - $exists = page_exists($ID,$rev); - - if ($info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) - $form->addElement(form_makeOpenTag('li', array('class' => 'minor'))); - else - $form->addElement(form_makeOpenTag('li')); - $form->addElement(form_makeOpenTag('div', array('class' => 'li'))); - if($exists){ - $form->addElement(form_makeTag('input', array( - 'type' => 'checkbox', - 'name' => 'rev2[]', - 'value' => $rev))); - }else{ - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/blank.gif', - 'width' => 14, - 'height' => 11, - 'alt' => ''))); + global $ID; + global $INFO; + global $conf; + global $lang; + /* we need to get one additionally log entry to be able to + * decide if this is the last page or is there another one. + * see html_recent() + */ + $revisions = getRevisions($ID, $first, $conf['recent']+1); + if(count($revisions)==0 && $first!=0){ + $first=0; + $revisions = getRevisions($ID, $first, $conf['recent']+1);; } - - $form->addElement(form_makeOpenTag('span', array('class' => 'date'))); - $form->addElement($date); - $form->addElement(form_makeCloseTag('span')); - - if($exists){ - $form->addElement(form_makeOpenTag('a', array('href' => wl($ID,"rev=$rev,do=diff", false, '&'), 'class' => 'diff_link'))); - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/diff.png', - 'width' => 15, - 'height' => 11, - 'title' => $lang['diff'], - 'alt' => $lang['diff']))); - $form->addElement(form_makeCloseTag('a')); - - $form->addElement(form_makeOpenTag('a', array('href' => wl($ID,"rev=$rev",false,'&'), 'class' => 'wikilink1'))); - $form->addElement($ID); - $form->addElement(form_makeCloseTag('a')); - }else{ - $form->addElement(form_makeTag('img', array( - 'src' => DOKU_BASE.'lib/images/blank.gif', - 'width' => '15', - 'height' => '11', - 'alt' => ''))); - $form->addElement($ID); + $hasNext = false; + if (count($revisions)>$conf['recent']) { + $hasNext = true; + array_pop($revisions); // remove extra log entry } - $form->addElement(form_makeOpenTag('span', array('class' => 'sum'))); - $form->addElement(' – '); - $form->addElement(htmlspecialchars($info['sum'])); - $form->addElement(form_makeCloseTag('span')); - - $form->addElement(form_makeOpenTag('span', array('class' => 'user'))); - if($info['user']){ - $form->addElement(editorinfo($info['user'])); - if(auth_ismanager()){ - $form->addElement(' ('.$info['ip'].')'); - } - }else{ - $form->addElement($info['ip']); + $date = dformat($INFO['lastmod']); + + print p_locale_xhtml('revisions'); + + $form = new Doku_Form('page__revisions', wl($ID)); + $form->addElement(form_makeOpenTag('ul')); + if($INFO['exists'] && $first==0){ + if (isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) + $form->addElement(form_makeOpenTag('li', array('class' => 'minor'))); + else + $form->addElement(form_makeOpenTag('li')); + $form->addElement(form_makeOpenTag('div', array('class' => 'li'))); + $form->addElement(form_makeTag('input', array( + 'type' => 'checkbox', + 'name' => 'rev2[]', + 'value' => 'current'))); + + $form->addElement(form_makeOpenTag('span', array('class' => 'date'))); + $form->addElement($date); + $form->addElement(form_makeCloseTag('span')); + + $form->addElement(form_makeTag('img', array( + 'src' => DOKU_BASE.'lib/images/blank.gif', + 'width' => '15', + 'height' => '11', + 'alt' => ''))); + + $form->addElement(form_makeOpenTag('a', array( + 'class' => 'wikilink1', + 'href' => wl($ID)))); + $form->addElement($ID); + $form->addElement(form_makeCloseTag('a')); + + $form->addElement(form_makeOpenTag('span', array('class' => 'sum'))); + $form->addElement(' – '); + $form->addElement(htmlspecialchars($INFO['sum'])); + $form->addElement(form_makeCloseTag('span')); + + $form->addElement(form_makeOpenTag('span', array('class' => 'user'))); + $form->addElement((empty($INFO['editor']))?('('.$lang['external_edit'].')'):editorinfo($INFO['editor'])); + $form->addElement(form_makeCloseTag('span')); + + $form->addElement('('.$lang['current'].')'); + $form->addElement(form_makeCloseTag('div')); + $form->addElement(form_makeCloseTag('li')); } - $form->addElement(form_makeCloseTag('span')); - $form->addElement(form_makeCloseTag('div')); - $form->addElement(form_makeCloseTag('li')); - } - $form->addElement(form_makeCloseTag('ul')); - $form->addElement(form_makeButton('submit', 'diff', $lang['diff2'])); - html_form('revisions', $form); - - print ''.DOKU_LF.'
'.DOKU_LF; $out .= ''.DOKU_LF; - return $out; } + return $out; +} /** * Callback for html_buildlist @@ -1484,7 +1488,7 @@ function html_list_toc($item){ } return ''. - hsc($item['title']).''; + hsc($item['title']).''; } /** @@ -1500,9 +1504,9 @@ function html_list_toc($item){ function html_mktocitem($link, $text, $level, $hash='#'){ global $conf; return array( 'link' => $hash.$link, - 'title' => $text, - 'type' => 'ul', - 'level' => $level); + 'title' => $text, + 'type' => 'ul', + 'level' => $level); } /** @@ -1512,9 +1516,9 @@ function html_mktocitem($link, $text, $level, $hash='#'){ * @author Tom N Harris */ function html_form($name, &$form) { - // Safety check in case the caller forgets. - $form->endFieldset(); - trigger_event('HTML_'.strtoupper($name).'FORM_OUTPUT', $form, 'html_form_output', false); + // Safety check in case the caller forgets. + $form->endFieldset(); + trigger_event('HTML_'.strtoupper($name).'FORM_OUTPUT', $form, 'html_form_output', false); } /** @@ -1522,7 +1526,7 @@ function html_form($name, &$form) { * Just calls printForm() on the data object. */ function html_form_output($data) { - $data->printForm(); + $data->printForm(); } /** @@ -1602,4 +1606,3 @@ function html_flashobject($swf,$width,$height,$params=null,$flashvars=null,$atts return $out; } -//Setup VIM: ex: et ts=2 enc=utf-8 : -- cgit v1.2.3