From ed7b5f0908941f1bacef7e7c3a02c106a42cd5cc Mon Sep 17 00:00:00 2001 From: andi Date: Sat, 19 Feb 2005 11:20:55 +0100 Subject: added init.php - may have broken something! (related to #153) darcs-hash:20050219102055-9977f-575d654e742934c911ffab855d82aa91f198b5cf.gz --- inc/html.php | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index b21ab4e57..d848f89b4 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1,4 +1,4 @@ - */ - include_once("inc/format.php"); + if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/'); + require_once(DOKU_INC.'inc/format.php'); /** * Convenience function to quickly build a wikilink @@ -188,13 +189,13 @@ function html_head(){ <?=$ID?> [<?=$conf['title']?>] - - - + + + - - + + var alertText = ''; var notSavedYet = ''; - var baseURL = ''; + var DOKU_BASE = ''; - + @@ -246,13 +247,11 @@ function html_btn($name,$id,$akey,$params,$method='get'){ $id = idfilter($id,false); //make nice URLs even for buttons - $link = getBaseURL().'/'; - $link = preg_replace('#//$#','/',$link); if(!$conf['userewrite']){ - $script = $link.'doku.php'; + $script = DOKU_BASE.DOKUSCRIPT; $params['id'] = $id; }else{ - $script = $link.$id; + $script = DOKU_BASE.$id; } $ret .= '
'; @@ -529,7 +528,7 @@ function html_hilight($html,$query){ * @author Andreas Gohr */ function html_search(){ - require_once("inc/search.php"); + require_once(DOKU_INC.'inc/search.php'); global $conf; global $QUERY; global $ID; @@ -648,7 +647,7 @@ function html_revisions(){ print ') '; print ''; - print ''; + print ''; print ''; print ''; } @@ -686,7 +685,7 @@ function html_recent(){ * @author Andreas Gohr */ function html_index($ns){ - require_once("inc/search.php"); + require_once(DOKU_INC.'inc/search.php'); global $conf; global $ID; $dir = $conf['datadir']; @@ -814,7 +813,7 @@ function html_buildlist($data,$class,$func,$lifunc='html_li_default'){ * @author Andreas Gohr */ function html_backlinks(){ - require_once("inc/search.php"); + require_once(DOKU_INC.'inc/search.php'); global $ID; global $conf; @@ -847,7 +846,7 @@ function html_backlinks(){ * @author Andreas Gohr */ function html_diff($text='',$intro=true){ - require_once("inc/DifferenceEngine.php"); + require_once(DOKU_INC.'inc/DifferenceEngine.php'); global $ID; global $REV; global $lang; @@ -1136,11 +1135,15 @@ function html_debug(){ print_r($cnf); print ''; - print 'abs baseURL:
';
-  print getBaseURL(true);
+  print 'DOKU_BASE:
';
+  print DOKU_BASE;
+  print '
'; + + print 'abs DOKU_BASE:
';
+  print DOKU_URL;
   print '
'; - print 'rel baseURL:
';
+  print 'rel DOKU_BASE:
';
   print dirname($_SERVER['PHP_SELF']).'/';
   print '
'; -- cgit v1.2.3