summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-20 20:01:50 +0200
committerandi <andi@splitbrain.org>2005-04-20 20:01:50 +0200
commit1d47afe198e9605cb1a0bb7a80b16df1256f82ad (patch)
tree3206154ed462e2ea0daee1d194213604a51cc221 /inc/parser
parentac83b9d8ee0da2839787d268e28b1bfe3066c1b7 (diff)
downloadrpg-1d47afe198e9605cb1a0bb7a80b16df1256f82ad.tar.gz
rpg-1d47afe198e9605cb1a0bb7a80b16df1256f82ad.tar.bz2
new parser: windows links fixed, section edit only on more than one section
darcs-hash:20050420180150-9977f-1d6eed937bd7339814eb646850f6b14feb5faaac.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/xhtml.php52
1 files changed, 28 insertions, 24 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index a4bfaa57d..e17d83a35 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -46,8 +46,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
function document_end() {
- // add button for last section if any
- if($this->lastsec) $this->__secedit($this->lastsec,'');
+ // add button for last section if any and more than one
+ if($this->lastsec > 1) $this->__secedit($this->lastsec,'');
if ( count ($this->footnotes) > 0 ) {
echo '<div class="footnotes">'.DOKU_LF;
@@ -447,7 +447,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
/**
- * @TODO Remove hard coded link to splitbrain.org on style
*/
function interwikilink($match, $name = NULL, $wikiName, $wikiUri) {
global $conf;
@@ -540,31 +539,36 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*/
/**
- * @TODO Remove hard coded URL to splitbrain.org
- * @TODO Add error message for non-IE users
*/
- function windowssharelink($link, $title = NULL) {
- echo '<a';
-
- $title = $this->__getLinkTitle($title, $link, $isImage);
-
+ function windowssharelink($url, $name = NULL) {
+ global $conf;
+ global $lang;
+ //simple setup
+ $link['target'] = $conf['target']['windows'];
+ $link['pre'] = '';
+ $link['suf'] = '';
+ $link['style'] = '';
+ //Display error on browsers other than IE
+ $link['more'] = 'onclick="if(document.all == null){alert(\''.
+ $this->__xmlEntities($lang['nosmblinks'],ENT_QUOTES).
+ '\');}" onkeypress="if(document.all == null){alert(\''.
+ $this->__xmlEntities($lang['nosmblinks'],ENT_QUOTES).'\');}"';
+
+ $link['name'] = $this->__getLinkTitle($name, $url, $isImage);
if ( !$isImage ) {
- echo ' class="windows"';
+ $link['class'] = 'windows';
} else {
- echo ' class="media"';
+ $link['class'] = 'media';
}
-
- $link = str_replace('\\','/',$link);
- $link = 'file:///'.$link;
- echo ' href="'.$this->__xmlEntities($link).'"';
-
- echo ' style="background: transparent url(http://wiki.splitbrain.org/images/windows.gif) 0px 1px no-repeat;"';
-
- echo ' onclick="return svchk()" onkeypress="return svchk()">';
-
- echo $title;
-
- echo '</a>';
+
+
+ $link['title'] = $this->__xmlEntities($url);
+ $url = str_replace('\\','/',$url);
+ $url = 'file:///'.$url;
+ $link['url'] = $url;
+
+ //output formatted
+ echo $this->__formatLink($link);
}
function emaillink($address, $name = NULL) {