Newer
Older
if ($i) $ret .= "<li class=\"clear\">";
$level = $item['level'];
}elseif( $item['level'] < $level ){
//close last item
$ret .= "</li>\n";
while( $level > $item['level'] && $open > 0 ){
//close higher lists
$ret .= "</ul>\n</li>\n";
$level--;
$open--;
} elseif ($ret !== '') {
//print item
$ret .= call_user_func($lifunc,$item);
$ret .= '<div class="li">';
$ret .= call_user_func($func,$item);
$ret .= '</div>';
}
$ret .= "</li>\n";
while($open-- > 0) {
$ret .= "</ul></li>\n";
}
if ($forcewrapper || $start_level < 2) {
// Trigger building a wrapper ul if the first level is
// 0 (we have a root object) or 1 (just the root content)
$ret = "\n<ul class=\"$class\">\n".$ret."</ul>\n";
/**
* display backlinks
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Michael Klier <chi@chimeric.de>
global $ID;
global $lang;
print p_locale_xhtml('backlinks');
$data = ft_backlinks($ID);
if(!empty($data)) {
print '<ul class="idx">';
foreach($data as $blink){
print '<li><div class="li">';
print html_wikilink(':'.$blink,useHeading('navigation')?null:$blink);
print '</div></li>';
}
print '</ul>';
} else {
print '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
}
/**
* Get header of diff HTML
* @param string $l_rev Left revisions
* @param string $r_rev Right revision
* @param string $id Page id, if null $ID is used
* @param bool $media If it is for media files
* @param bool $inline Return the header on a single line
* @return string[] HTML snippets for diff header
function html_diff_head($l_rev, $r_rev, $id = null, $media = false, $inline = false) {
global $lang;
if ($id === null) {
global $ID;
$id = $ID;
}
$head_separator = $inline ? ' ' : '<br />';
$media_or_wikiFN = $media ? 'mediaFN' : 'wikiFN';
$ml_or_wl = $media ? 'ml' : 'wl';
$l_minor = $r_minor = '';
if($media) {
} else {
}
if(!$l_rev){
$l_head = '—';
}else{
$l_info = $changelog->getRevisionInfo($l_rev);
$l_user = '<bdi>'.editorinfo($l_info['user']).'</bdi>';
if(auth_ismanager()) $l_user .= ' <bdo dir="ltr">('.$l_info['ip'].')</bdo>';
$l_user = '<bdo dir="ltr">'.$l_info['ip'].'</bdo>';
}
$l_user = '<span class="user">'.$l_user.'</span>';
$l_sum = ($l_info['sum']) ? '<span class="sum"><bdi>'.hsc($l_info['sum']).'</bdi></span>' : '';
if ($l_info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) $l_minor = 'class="minor"';
$l_head_title = ($media) ? dformat($l_rev) : $id.' ['.dformat($l_rev).']';
$l_head = '<bdi><a class="wikilink1" href="'.$ml_or_wl($id,"rev=$l_rev").'">'.
$l_head_title.'</a></bdi>'.
$head_separator.$l_user.' '.$l_sum;
$r_info = $changelog->getRevisionInfo($r_rev);
$r_user = '<bdi>'.editorinfo($r_info['user']).'</bdi>';
if(auth_ismanager()) $r_user .= ' <bdo dir="ltr">('.$r_info['ip'].')</bdo>';
$r_user = '<bdo dir="ltr">'.$r_info['ip'].'</bdo>';
}
$r_user = '<span class="user">'.$r_user.'</span>';
$r_sum = ($r_info['sum']) ? '<span class="sum"><bdi>'.hsc($r_info['sum']).'</bdi></span>' : '';
if ($r_info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) $r_minor = 'class="minor"';
$r_head_title = ($media) ? dformat($r_rev) : $id.' ['.dformat($r_rev).']';
$r_head = '<bdi><a class="wikilink1" href="'.$ml_or_wl($id,"rev=$r_rev").'">'.
$r_head_title.'</a></bdi>'.
$head_separator.$r_user.' '.$r_sum;
}elseif($_rev = @filemtime($media_or_wikiFN($id))){
$_info = $changelog->getRevisionInfo($_rev);
$_user = '<bdi>'.editorinfo($_info['user']).'</bdi>';
if(auth_ismanager()) $_user .= ' <bdo dir="ltr">('.$_info['ip'].')</bdo>';
$_user = '<bdo dir="ltr">'.$_info['ip'].'</bdo>';
}
$_user = '<span class="user">'.$_user.'</span>';
$_sum = ($_info['sum']) ? '<span class="sum"><bdi>'.hsc($_info['sum']).'</span></bdi>' : '';
if ($_info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) $r_minor = 'class="minor"';
$r_head_title = ($media) ? dformat($_rev) : $id.' ['.dformat($_rev).']';
$r_head = '<bdi><a class="wikilink1" href="'.$ml_or_wl($id).'">'.
$r_head_title.'</a></bdi> '.
'('.$lang['current'].')'.
$head_separator.$_user.' '.$_sum;
}else{
$r_head = '— ('.$lang['current'].')';
}
return array($l_head, $r_head, $l_minor, $r_minor);
}
* between current page version and provided $text
* or between the revisions provided via GET or POST
* @param string $text when non-empty: compare with this text with most current version
* @param bool $intro display the intro text
* @param string $type type of the diff (inline or sidebyside)
function html_diff($text = '', $intro = true, $type = null) {
global $ID;
global $REV;
global $lang;
global $INFO;
$pagelog = new PageChangeLog($ID);
/*
* Determine diff type
*/
if(!$type) {
$type = $INPUT->str('difftype');
$type = get_doku_pref('difftype', $type);
$type = 'inline';
}
}
}
if($type != 'inline') $type = 'sidebyside';
/*
* Determine requested revision(s)
*/
// we're trying to be clever here, revisions to compare can be either
// given as rev and rev2 parameters, with rev2 being optional. Or in an
// array in rev2.
$rev1 = $REV;
$rev1 = (int) $rev2[0];
$rev2 = (int) $rev2[1];
/*
* Determine left and right revision, its texts and the header
*/
if($text) { // compare text to the most current revision
$l_rev = '';
$l_text = rawWiki($ID, '');
$l_head = '<a class="wikilink1" href="' . wl($ID) . '">' .
$ID . ' ' . dformat((int) @filemtime(wikiFN($ID))) . '</a> ' .
$r_rev = '';
$r_text = cleanText($text);
$r_head = $lang['yours'];
} else {
if($rev1 && isset($rev2) && $rev2) { // two specific revisions wanted
// make sure order is correct (older on the left)
} elseif($rev1) { // single revision given, compare to current
} else { // no revision was given, compare previous to current
$revs = $pagelog->getRevisions(0, 1);
$l_rev = $revs[0];
$REV = $l_rev; // store revision back in $REV
}
// when both revisions are empty then the page was created just now
} else {
$l_text = rawWiki($ID, $l_rev);
list($l_head, $r_head, $l_minor, $r_minor) = html_diff_head($l_rev, $r_rev, null, false, $type == 'inline');
/*
* Build navigation
*/
list($l_nav, $r_nav) = html_diff_navigation($pagelog, $type, $l_rev, $r_rev);
/*
* Create diff object and the formatter
*/
$diff = new Diff(explode("\n", $l_text), explode("\n", $r_text));
if($type == 'inline') {
$diffformatter = new InlineDiffFormatter();
} else {
$diffformatter = new TableDiffFormatter();
}
/*
* Display intro
*/
if($intro) print p_locale_xhtml('diff');
* Display type and exact reference
*/
if(!$text) {
ptln('<div class="diffoptions group">');
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
$form = new Doku_Form(array('action' => wl()));
$form->addHidden('id', $ID);
$form->addHidden('rev2[0]', $l_rev);
$form->addHidden('rev2[1]', $r_rev);
$form->addHidden('do', 'diff');
$form->addElement(
form_makeListboxField(
'difftype',
array(
'sidebyside' => $lang['diff_side'],
'inline' => $lang['diff_inline']
),
$type,
$lang['diff_type'],
'', '',
array('class' => 'quickselect')
)
);
$form->addElement(form_makeButton('submit', 'diff', 'Go'));
$form->printForm();
ptln('<p>');
// link to exactly this view FS#2835
echo html_diff_navigationlink($type, 'difflink', $l_rev, $r_rev ? $r_rev : $INFO['currentrev']);
ptln('</p>');
ptln('</div>'); // .diffoptions
}
/*
* Display diff view table
<div class="table">
<table class="diff diff_<?php echo $type ?>">
<?php
//navigation and header
if($type == 'inline') {
if(!$text) { ?>
<tr>
<td class="diff-lineheader">-</td>
<td class="diffnav"><?php echo $l_nav ?></td>
</tr>
<tr>
<th class="diff-lineheader">-</th>
<th <?php echo $l_minor ?>>
<?php echo $l_head ?>
</th>
</tr>
<?php } ?>
<td class="diff-lineheader">+</td>
<td class="diffnav"><?php echo $r_nav ?></td>
<th class="diff-lineheader">+</th>
<th <?php echo $r_minor ?>>
<?php echo $r_head ?>
<?php } else {
if(!$text) { ?>
<tr>
<td colspan="2" class="diffnav"><?php echo $l_nav ?></td>
<td colspan="2" class="diffnav"><?php echo $r_nav ?></td>
</tr>
<?php } ?>
<th colspan="2" <?php echo $l_minor ?>>
<?php echo $l_head ?>
</th>
<th colspan="2" <?php echo $r_minor ?>>
<?php echo $r_head ?>
</th>
<?php }
//diff view
echo html_insert_softbreaks($diffformatter->format($diff)); ?>
/**
* Create html for revision navigation
*
* @param PageChangeLog $pagelog changelog object of current page
* @param string $type inline vs sidebyside
* @param int $l_rev left revision timestamp
* @param int $r_rev right revision timestamp
* @return string[] html of left and right navigation elements
*/
function html_diff_navigation($pagelog, $type, $l_rev, $r_rev) {
global $INFO, $ID;
// last timestamp is not in changelog, retrieve timestamp from metadata
// note: when page is removed, the metadata timestamp is zero
if(!$r_rev) {
if(isset($INFO['meta']['last_change']['date'])) {
$r_rev = $INFO['meta']['last_change']['date'];
} else {
$r_rev = 0;
}
}
//retrieve revisions with additional info
list($l_revs, $r_revs) = $pagelog->getRevisionsAround($l_rev, $r_rev);
$l_revisions = array();
if(!$l_rev) {
$l_revisions[0] = array(0, "", false); //no left revision given, add dummy
}
foreach($l_revs as $rev) {
$info = $pagelog->getRevisionInfo($rev);
$l_revisions[$rev] = array(
$rev,
dformat($info['date']) . ' ' . editorinfo($info['user'], true) . ' ' . $info['sum'],
$r_rev ? $rev >= $r_rev : false //disable?
);
}
$r_revisions = array();
if(!$r_rev) {
$r_revisions[0] = array(0, "", false); //no right revision given, add dummy
}
foreach($r_revs as $rev) {
$info = $pagelog->getRevisionInfo($rev);
$r_revisions[$rev] = array(
$rev,
dformat($info['date']) . ' ' . editorinfo($info['user'], true) . ' ' . $info['sum'],
$rev <= $l_rev //disable?
);
}
//determine previous/next revisions
$l_index = array_search($l_rev, $l_revs);
$l_prev = $l_revs[$l_index + 1];
$l_next = $l_revs[$l_index - 1];
if($r_rev) {
$r_index = array_search($r_rev, $r_revs);
$r_prev = $r_revs[$r_index + 1];
$r_next = $r_revs[$r_index - 1];
} else {
//removed page
if($l_next) {
$r_prev = $r_revs[0];
} else {
$r_prev = null;
}
$r_next = null;
}
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
/*
* Left side:
*/
$l_nav = '';
//move back
if($l_prev) {
$l_nav .= html_diff_navigationlink($type, 'diffbothprevrev', $l_prev, $r_prev);
$l_nav .= html_diff_navigationlink($type, 'diffprevrev', $l_prev, $r_rev);
}
//dropdown
$form = new Doku_Form(array('action' => wl()));
$form->addHidden('id', $ID);
$form->addHidden('difftype', $type);
$form->addHidden('rev2[1]', $r_rev);
$form->addHidden('do', 'diff');
$form->addElement(
form_makeListboxField(
'rev2[0]',
$l_revisions,
$l_rev,
'', '', '',
array('class' => 'quickselect')
)
);
$form->addElement(form_makeButton('submit', 'diff', 'Go'));
$l_nav .= $form->getForm();
//move forward
if($l_next && ($l_next < $r_rev || !$r_rev)) {
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
$l_nav .= html_diff_navigationlink($type, 'diffnextrev', $l_next, $r_rev);
}
/*
* Right side:
*/
$r_nav = '';
//move back
if($l_rev < $r_prev) {
$r_nav .= html_diff_navigationlink($type, 'diffprevrev', $l_rev, $r_prev);
}
//dropdown
$form = new Doku_Form(array('action' => wl()));
$form->addHidden('id', $ID);
$form->addHidden('rev2[0]', $l_rev);
$form->addHidden('difftype', $type);
$form->addHidden('do', 'diff');
$form->addElement(
form_makeListboxField(
'rev2[1]',
$r_revisions,
$r_rev,
'', '', '',
array('class' => 'quickselect')
)
);
$form->addElement(form_makeButton('submit', 'diff', 'Go'));
$r_nav .= $form->getForm();
//move forward
if($r_next) {
if($pagelog->isCurrentRevision($r_next)) {
$r_nav .= html_diff_navigationlink($type, 'difflastrev', $l_rev); //last revision is diff with current page
} else {
$r_nav .= html_diff_navigationlink($type, 'diffnextrev', $l_rev, $r_next);
}
$r_nav .= html_diff_navigationlink($type, 'diffbothnextrev', $l_next, $r_next);
}
return array($l_nav, $r_nav);
}
/**
* Create html link to a diff defined by two revisions
*
* @param string $difftype display type
* @param string $linktype
* @param int $lrev oldest revision
* @param int $rrev newest revision or null for diff with current revision
* @return string html of link to a diff
*/
function html_diff_navigationlink($difftype, $linktype, $lrev, $rrev = null) {
global $ID, $lang;
$urlparam = array(
'do' => 'diff',
'rev' => $lrev,
);
} else {
$urlparam = array(
'do' => 'diff',
'rev2[0]' => $lrev,
'rev2[1]' => $rrev,
return '<a class="' . $linktype . '" href="' . wl($ID, $urlparam) . '" title="' . $lang[$linktype] . '">' .
'<span>' . $lang[$linktype] . '</span>' .
'</a>' . "\n";
/**
* Insert soft breaks in diff html
*
* @param string $diffhtml
function html_insert_softbreaks($diffhtml) {
// search the diff html string for both:
// - html tags, so these can be ignored
// - long strings of characters without breaking characters
return preg_replace_callback('/<[^>]*>|[^<> ]{12,}/','html_softbreak_callback',$diffhtml);
}
/**
* callback which adds softbreaks
*
* @param array $match array with first the complete match
* @return string the replacement
*/
function html_softbreak_callback($match){
// if match is an html tag, return it intact
if ($match[0]{0} == '<') return $match[0];
// its a long string without a breaking character,
// make certain characters into breaking characters by inserting a
// word break opportunity (<wbr> tag) in front of them.
(?(?= # start a conditional expression with a positive look ahead ...
&\#?\\w{1,6};) # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
&\#?\\w{1,6}; # yes pattern - a quicker match for the html entity, since we know we have one
|
Christopher Smith
committed
[?/,&\#;:] # no pattern - any other group of 'special' characters to insert a breaking character after
)+ # end conditional expression
REGEX;
return preg_replace('<'.$regex.'>xu','\0<wbr>',$match[0]);
}
/**
* show warning on conflict detection
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $text
* @param string $summary
global $ID;
global $lang;
print p_locale_xhtml('conflict');
$form = new Doku_Form(array('id' => 'dw__editform'));
$form->addHidden('id', $ID);
$form->addHidden('wikitext', $text);
$form->addHidden('summary', $summary);
$form->addElement(form_makeButton('submit', 'save', $lang['btn_save'], array('accesskey'=>'s')));
$form->addElement(form_makeButton('submit', 'cancel', $lang['btn_cancel']));
html_form('conflict', $form);
print '<br /><br /><br /><br />'.NL;
* Prints the global message array
*
* @author Andreas Gohr <andi@splitbrain.org>
global $MSG, $MSG_shown;
// store if the global $MSG has already been shown and thus HTML output has been started
$MSG_shown = true;
if(!isset($MSG)) return;
$shown = array();
foreach($MSG as $msg){
$hash = md5($msg['msg']);
if(isset($shown[$hash])) continue; // skip double messages
if(info_msg_allowed($msg)){
Christopher Smith
committed
print '<div class="'.$msg['lvl'].'">';
print $msg['msg'];
print '</div>';
}
unset($GLOBALS['MSG']);
$base_attrs = array('size'=>50,'required'=>'required');
$email_attrs = $base_attrs + array('type'=>'email','class'=>'edit');
print p_locale_xhtml('register');
print '<div class="centeralign">'.NL;
$form = new Doku_Form(array('id' => 'dw__register'));
$form->startFieldset($lang['btn_register']);
$form->addHidden('do', 'register');
$form->addHidden('save', '1');
$form->addElement(form_makeTextField('login', $INPUT->post->str('login'), $lang['user'], '', 'block', $base_attrs));
$form->addElement(form_makePasswordField('pass', $lang['pass'], '', 'block', $base_attrs));
$form->addElement(form_makePasswordField('passchk', $lang['passchk'], '', 'block', $base_attrs));
$form->addElement(form_makeTextField('fullname', $INPUT->post->str('fullname'), $lang['fullname'], '', 'block', $base_attrs));
$form->addElement(form_makeField('email','email', $INPUT->post->str('email'), $lang['email'], '', 'block', $email_attrs));
$form->addElement(form_makeButton('submit', '', $lang['btn_register']));
$form->endFieldset();
html_form('register', $form);
print '</div>'.NL;
chris
committed
/**
* Print the update profile form
*
* @author Christopher Smith <chris@jalakai.co.uk>
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_updateprofile(){
global $auth;
print p_locale_xhtml('updateprofile');
print '<div class="centeralign">'.NL;
$fullname = $INPUT->post->str('fullname', $INFO['userinfo']['name'], true);
$email = $INPUT->post->str('email', $INFO['userinfo']['mail'], true);
$form = new Doku_Form(array('id' => 'dw__register'));
$form->startFieldset($lang['profile']);
$form->addHidden('do', 'profile');
$form->addHidden('save', '1');
$form->addElement(form_makeTextField('login', $_SERVER['REMOTE_USER'], $lang['user'], '', 'block', array('size'=>'50', 'disabled'=>'disabled')));
$attr = array('size'=>'50');
if (!$auth->canDo('modName')) $attr['disabled'] = 'disabled';
$form->addElement(form_makeTextField('fullname', $fullname, $lang['fullname'], '', 'block', $attr));
$attr = array('size'=>'50', 'class'=>'edit');
if (!$auth->canDo('modMail')) $attr['disabled'] = 'disabled';
$form->addElement(form_makeField('email','email', $email, $lang['email'], '', 'block', $attr));
$form->addElement(form_makeTag('br'));
if ($auth->canDo('modPass')) {
$form->addElement(form_makePasswordField('newpass', $lang['newpass'], '', 'block', array('size'=>'50')));
$form->addElement(form_makePasswordField('passchk', $lang['passchk'], '', 'block', array('size'=>'50')));
}
if ($conf['profileconfirm']) {
$form->addElement(form_makeTag('br'));
$form->addElement(form_makePasswordField('oldpass', $lang['oldpass'], '', 'block', array('size'=>'50', 'required' => 'required')));
}
$form->addElement(form_makeButton('submit', '', $lang['btn_save']));
$form->addElement(form_makeButton('reset', '', $lang['btn_reset']));
$form->endFieldset();
html_form('updateprofile', $form);
if ($auth->canDo('delUser') && actionOK('profile_delete')) {
$form_profiledelete = new Doku_Form(array('id' => 'dw__profiledelete'));
$form_profiledelete->startFieldset($lang['profdeleteuser']);
$form_profiledelete->addHidden('do', 'profile_delete');
$form_profiledelete->addHidden('delete', '1');
$form_profiledelete->addElement(form_makeCheckboxField('confirm_delete', '1', $lang['profconfdelete'],'dw__confirmdelete','', array('required' => 'required')));
if ($conf['profileconfirm']) {
$form_profiledelete->addElement(form_makeTag('br'));
$form_profiledelete->addElement(form_makePasswordField('oldpass', $lang['oldpass'], '', 'block', array('size'=>'50', 'required' => 'required')));
}
$form_profiledelete->addElement(form_makeButton('submit', '', $lang['btn_deleteuser']));
$form_profiledelete->endFieldset();
html_form('profiledelete', $form_profiledelete);
}
chris
committed
}
* @author Andreas Gohr <andi@splitbrain.org>
*
* @triggers HTML_EDITFORM_OUTPUT
global $ID;
global $REV;
global $DATE;
global $PRE;
global $SUF;
global $INFO;
global $SUM;
global $lang;
global $conf;
if ($INPUT->has('changecheck')) {
$check = $INPUT->str('changecheck');
} elseif(!$INFO['exists']){
// $TEXT has been loaded from page template
$check = md5('');
} else {
$check = md5($TEXT);
$wr = $INFO['writable'] && !$INFO['locked'];
}else{
// check pseudo action 'source'
if(!actionOK('source')){
msg('Command disabled: source',-1);
return;
}
$form = new Doku_Form(array('id' => 'dw__editform'));
$form->addHidden('id', $ID);
$form->addHidden('rev', $REV);
$form->addHidden('date', $DATE);
$form->addHidden('prefix', $PRE . '.');
$form->addHidden('suffix', $SUF);
$form->addHidden('changecheck', $check);
$data = array('form' => $form,
'wr' => $wr,
'media_manager' => true,
'target' => ($INPUT->has('target') && $wr) ? $INPUT->str('target') : 'section',
'intro_locale' => $include);
if ($data['target'] !== 'section') {
// Only emit event if page is writable, section edit data is valid and
// edit target is not section.
trigger_event('HTML_EDIT_FORMSELECTION', $data, 'html_edit_form', true);
} else {
html_edit_form($data);
}
if (isset($data['intro_locale'])) {
echo p_locale_xhtml($data['intro_locale']);
}
$form->addHidden('target', $data['target']);
if ($INPUT->has('hid')) {
$form->addHidden('hid', $INPUT->str('hid'));
}
if ($INPUT->has('codeblockOffset')) {
$form->addHidden('codeblockOffset', $INPUT->str('codeblockOffset'));
}
$form->addElement(form_makeOpenTag('div', array('id'=>'wiki__editbar', 'class'=>'editBar')));
$form->addElement(form_makeOpenTag('div', array('id'=>'size__ctl')));
$form->addElement(form_makeCloseTag('div'));
if ($wr) {
$form->addElement(form_makeOpenTag('div', array('class'=>'editButtons')));
$form->addElement(form_makeButton('submit', 'save', $lang['btn_save'], array('id'=>'edbtn__save', 'accesskey'=>'s', 'tabindex'=>'4')));
$form->addElement(form_makeButton('submit', 'preview', $lang['btn_preview'], array('id'=>'edbtn__preview', 'accesskey'=>'p', 'tabindex'=>'5')));
$form->addElement(form_makeButton('submit', 'cancel', $lang['btn_cancel'], array('tabindex'=>'6')));
$form->addElement(form_makeOpenTag('div', array('class'=>'summary')));
$form->addElement(form_makeTextField('summary', $SUM, $lang['summary'], 'edit__summary', 'nowrap', array('size'=>'50', 'tabindex'=>'2')));
$elem = html_minoredit();
if ($elem) $form->addElement($elem);
}
$form->addElement(form_makeCloseTag('div'));
if($wr && $conf['license']){
$form->addElement(form_makeOpenTag('div', array('class'=>'license')));
$out = $lang['licenseok'];
$out .= ' <a href="'.$license[$conf['license']]['url'].'" rel="license" class="urlextern"';
if($conf['target']['extern']) $out .= ' target="'.$conf['target']['extern'].'"';
$out .= '>'.$license[$conf['license']]['name'].'</a>';
$form->addElement($out);
$form->addElement(form_makeCloseTag('div'));
}
if ($wr) {
// sets changed to true when previewed
echo '<script type="text/javascript">/*<![CDATA[*/'. NL;
echo 'textChanged = ' . ($mod ? 'true' : 'false');
echo '/*!]]>*/</script>' . NL;
<div class="editBox" role="application">
<div id="tool__bar" class="tool__bar"><?php if ($wr && $data['media_manager']){?><a href="<?php echo DOKU_BASE?>lib/exe/mediamanager.php?ns=<?php echo $INFO['namespace']?>"
target="_blank"><?php echo $lang['mediaselect'] ?></a><?php }?></div>
<div id="draft__status" class="draft__status">
<?php
$draft = new \dokuwiki\Draft($ID, $INFO['client']);
if ($draft->isDraftAvailable()) {
echo $draft->getDraftMessage();
}
?>
</div>
<?php
html_form('edit', $form);
print '</div>'.NL;
}
/**
* Display the default edit form
*
* Is the default action for HTML_EDIT_FORMSELECTION.
*/
function html_edit_form($param) {
if ($param['target'] !== 'section') {
msg('No editor for edit target ' . hsc($param['target']) . ' found.', -1);
$attr = array('tabindex'=>'1');
if (!$param['wr']) $attr['readonly'] = 'readonly';
$param['form']->addElement(form_makeWikiText($TEXT, $attr));
/**
* Adds a checkbox for minor edits for logged in users
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @return array|bool
// minor edits are for logged in users only
if(!$conf['useacl'] || !$_SERVER['REMOTE_USER']){
return false;
}
$p = array();
$p['tabindex'] = 3;
if($INPUT->bool('minor')) $p['checked']='checked';
return form_makeCheckboxField('minor', '1', $lang['minoredit'], 'minoredit', 'nowrap', $p);
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
global $auth;
global $INFO;
//remove sensitive data
$cnf = $conf;
debug_guard($cnf);
$nfo = $INFO;
debug_guard($nfo);
$ses = $_SESSION;
debug_guard($ses);
print '<html><body>';
print '<p>When reporting bugs please send all the following ';
print 'output as a mail to andi@splitbrain.org ';
print 'The best way to do this is to save this page in your browser</p>';
print '<b>$INFO:</b><pre>';
print_r($nfo);
print '</pre>';
print '<b>$_SERVER:</b><pre>';
print_r($_SERVER);
print '</pre>';
print '<b>$conf:</b><pre>';
print_r($cnf);
print '</pre>';
print '<b>DOKU_BASE:</b><pre>';
print DOKU_BASE;
print '</pre>';
print '<b>abs DOKU_BASE:</b><pre>';
print DOKU_URL;
print '</pre>';
print '<b>rel DOKU_BASE:</b><pre>';
print dirname($_SERVER['PHP_SELF']).'/';
print '<b>PHP Version:</b><pre>';
print phpversion();
print '</pre>';
print '<b>locale:</b><pre>';
print setlocale(LC_ALL,0);
print '</pre>';
print '<b>encoding:</b><pre>';
print $lang['encoding'];
print '</pre>';
if($auth){
print '<b>Auth backend capabilities:</b><pre>';
foreach ($auth->getCapabilities() as $cando){
print ' '.str_pad($cando,16) . ' => ' . (int)$auth->canDo($cando) . NL;
}
print '</pre>';
}
print '<b>$_SESSION:</b><pre>';
print_r($ses);
print '</pre>';
print '<b>Environment:</b><pre>';
print_r($_ENV);
print '</pre>';
print '<b>PHP settings:</b><pre>';
$inis = ini_get_all();
print_r($inis);
print '</pre>';
if (function_exists('apache_get_version')) {
$apache['version'] = apache_get_version();
if (function_exists('apache_get_modules')) {
$apache['modules'] = apache_get_modules();
}
print '<b>Apache</b><pre>';
print_r($apache);
print '</pre>';
}
chris
committed
/**
* Form to request a new password for an existing account
*
* @author Benoit Chesneau <benoit@bchesneau.info>
* @author Andreas Gohr <gohr@cosmocode.de>
chris
committed
*/
function html_resendpwd() {