From d317fb5d70f8903dc518943c731202869d450d68 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Fri, 2 Aug 2013 14:04:04 +0100 Subject: fixed some bi-directionality issues Fixed some issues which occur whenever RTL and LTR languages could potentially be mixed, using the HTML5 `` element. This element is currently only supported by Chrome and Firefox. The old and only partially working fix for tpl_breadcrumbs() was removed in favour of this solution. --- inc/html.php | 50 +++++++++++++++++++++++++------------------------- inc/template.php | 24 ++++++++++-------------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/inc/html.php b/inc/html.php index 614cf172c..2d2bb8a7c 100644 --- a/inc/html.php +++ b/inc/html.php @@ -575,18 +575,18 @@ function html_revisions($first=0, $media_id = false){ if ($info['sum']) { $form->addElement(form_makeOpenTag('span', array('class' => 'sum'))); if (!$media_id) $form->addElement(' – '); - $form->addElement(htmlspecialchars($info['sum'])); + $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'])); + $form->addElement(''.editorinfo($info['user']).''); if(auth_ismanager()){ - $form->addElement(' ('.$info['ip'].')'); + $form->addElement(' ('.$info['ip'].')'); } }else{ - $form->addElement($info['ip']); + $form->addElement(''.$info['ip'].''); } $form->addElement(form_makeCloseTag('span')); @@ -774,12 +774,12 @@ function html_recent($first=0, $show_changes='both'){ $form->addElement(form_makeOpenTag('span', array('class' => 'user'))); if($recent['user']){ - $form->addElement(editorinfo($recent['user'])); + $form->addElement(''.editorinfo($recent['user']).''); if(auth_ismanager()){ - $form->addElement(' ('.$recent['ip'].')'); + $form->addElement(' ('.$recent['ip'].')'); } }else{ - $form->addElement($recent['ip']); + $form->addElement(''.$recent['ip'].''); } $form->addElement(form_makeCloseTag('span')); @@ -1027,52 +1027,52 @@ function html_diff_head($l_rev, $r_rev, $id = null, $media = false, $inline = fa }else{ $l_info = getRevisionInfo($id,$l_rev,true, $media); if($l_info['user']){ - $l_user = editorinfo($l_info['user']); - if(auth_ismanager()) $l_user .= ' ('.$l_info['ip'].')'; + $l_user = ''.editorinfo($l_info['user']).''; + if(auth_ismanager()) $l_user .= ' ('.$l_info['ip'].')'; } else { - $l_user = $l_info['ip']; + $l_user = ''.$l_info['ip'].''; } $l_user = ''.$l_user.''; - $l_sum = ($l_info['sum']) ? ''.hsc($l_info['sum']).'' : ''; + $l_sum = ($l_info['sum']) ? ''.hsc($l_info['sum']).'' : ''; 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 = ''. - $l_head_title.''. + $l_head = ''. + $l_head_title.''. $head_separator.$l_user.' '.$l_sum; } if($r_rev){ $r_info = getRevisionInfo($id,$r_rev,true, $media); if($r_info['user']){ - $r_user = editorinfo($r_info['user']); - if(auth_ismanager()) $r_user .= ' ('.$r_info['ip'].')'; + $r_user = ''.editorinfo($r_info['user']).''; + if(auth_ismanager()) $r_user .= ' ('.$r_info['ip'].')'; } else { - $r_user = $r_info['ip']; + $r_user = ''.$r_info['ip'].''; } $r_user = ''.$r_user.''; - $r_sum = ($r_info['sum']) ? ''.hsc($r_info['sum']).'' : ''; + $r_sum = ($r_info['sum']) ? ''.hsc($r_info['sum']).'' : ''; 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 = ''. - $r_head_title.''. + $r_head = ''. + $r_head_title.''. $head_separator.$r_user.' '.$r_sum; }elseif($_rev = @filemtime($media_or_wikiFN($id))){ $_info = getRevisionInfo($id,$_rev,true, $media); if($_info['user']){ - $_user = editorinfo($_info['user']); - if(auth_ismanager()) $_user .= ' ('.$_info['ip'].')'; + $_user = ''.editorinfo($_info['user']).''; + if(auth_ismanager()) $_user .= ' ('.$_info['ip'].')'; } else { - $_user = $_info['ip']; + $_user = ''.$_info['ip'].''; } $_user = ''.$_user.''; - $_sum = ($_info['sum']) ? ''.hsc($_info['sum']).'' : ''; + $_sum = ($_info['sum']) ? ''.hsc($_info['sum']).'' : ''; if ($_info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) $r_minor = 'class="minor"'; $r_head_title = ($media) ? dformat($_rev) : $id.' ['.dformat($_rev).']'; - $r_head = ''. - $r_head_title.' '. + $r_head = ''. + $r_head_title.' '. '('.$lang['current'].')'. $head_separator.$_user.' '.$_sum; }else{ diff --git a/inc/template.php b/inc/template.php index bb5f2cd53..d03d3561b 100644 --- a/inc/template.php +++ b/inc/template.php @@ -468,7 +468,7 @@ function tpl_link($url, $name, $more = '', $return = false) { * @author Andreas Gohr */ function tpl_pagelink($id, $name = null) { - print html_wikilink($id, $name); + print ''.html_wikilink($id, $name).''; return true; } @@ -800,13 +800,7 @@ function tpl_breadcrumbs($sep = '•') { $crumbs = breadcrumbs(); //setup crumb trace - //reverse crumborder in right-to-left mode, add RLM character to fix heb/eng display mixups - if($lang['direction'] == 'rtl') { - $crumbs = array_reverse($crumbs, true); - $crumbs_sep = ' ‏'.$sep.'‏ '; - } else { - $crumbs_sep = ' '.$sep.' '; - } + $crumbs_sep = ' '.$sep.' '; //render crumbs, highlight the last one print ''.$lang['breadcrumb'].':'; @@ -816,7 +810,9 @@ function tpl_breadcrumbs($sep = '•') { $i++; echo $crumbs_sep; if($i == $last) print ''; + print ''; tpl_link(wl($id), hsc($name), 'class="breadcrumbs" title="'.$id.'"'); + print ''; if($i == $last) print ''; } return true; @@ -889,7 +885,7 @@ function tpl_userinfo() { global $lang; global $INFO; if(isset($_SERVER['REMOTE_USER'])) { - print $lang['loggedinas'].': '.hsc($INFO['userinfo']['name']).' ('.hsc($_SERVER['REMOTE_USER']).')'; + print $lang['loggedinas'].': '.hsc($INFO['userinfo']['name']).' ('.hsc($_SERVER['REMOTE_USER']).')'; return true; } return false; @@ -928,14 +924,14 @@ function tpl_pageinfo($ret = false) { // print it if($INFO['exists']) { $out = ''; - $out .= $fn; + $out .= ''.$fn.''; $out .= ' · '; $out .= $lang['lastmod']; $out .= ': '; $out .= $date; if($INFO['editor']) { $out .= ' '.$lang['by'].' '; - $out .= editorinfo($INFO['editor']); + $out .= ''.editorinfo($INFO['editor']).''; } else { $out .= ' ('.$lang['external_edit'].')'; } @@ -943,7 +939,7 @@ function tpl_pageinfo($ret = false) { $out .= ' · '; $out .= $lang['lockedby']; $out .= ': '; - $out .= editorinfo($INFO['locked']); + $out .= ''.editorinfo($INFO['locked']).''; } if($ret) { return $out; @@ -1469,8 +1465,8 @@ function tpl_license($img = 'badge', $imgonly = false, $return = false, $wrap = } if(!$imgonly) { $out .= $lang['license'].' '; - $out .= ''; + $out .= ''; } if($wrap) $out .= ''; -- cgit v1.2.3