summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-03-18 18:57:44 +0100
committerandi <andi@splitbrain.org>2005-03-18 18:57:44 +0100
commit1734437e2bd33ee82fbc1d6f0310400dc62abea9 (patch)
tree88b1b9da24240846e6786b42ce497ea041e20ecd /inc
parent60bac824c1f338a6ded5a89e79434d9acbc62f0c (diff)
downloadrpg-1734437e2bd33ee82fbc1d6f0310400dc62abea9.tar.gz
rpg-1734437e2bd33ee82fbc1d6f0310400dc62abea9.tar.bz2
removed dprecated stuff, added hierarchical breadcrumbs
darcs-hash:20050318175744-9977f-a917cca1f2eed5b85d37af9a7add00465ece9c99.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/html.php414
-rw-r--r--inc/template.php40
2 files changed, 39 insertions, 415 deletions
diff --git a/inc/html.php b/inc/html.php
index 3b31c96ff..2e8432b3c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -158,94 +158,6 @@ function html_secedit($text,$show=true){
}
/**
- * displays the breadcrumbs trace
- *
- * @deprecated
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function html_breadcrumbs(){
- global $lang;
- global $conf;
-
- //check if enabled
- if(!$conf['breadcrumbs']) return;
-
- $crumbs = breadcrumbs(); //setup crumb trace
- print '<div class="breadcrumbs">';
- print $lang['breadcrumb'].':';
- foreach ($crumbs as $crumb){
- print ' &raquo; ';
- print '<a href="'.wl($crumb).'" class="breadcrumbs" onclick="return svchk()" onkeypress="return svchk()" title="'.$crumb.'">'.noNS($crumb).'</a>';
- }
- print '</div>';
-}
-
-/**
- * display the HTML head and metadata
- *
- * @deprecated -> tpl_metaheaders()
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function html_head(){
- global $ID;
- global $ACT;
- global $INFO;
- global $REV;
- global $conf;
- global $lang;
-
- //print '<'.'?xml version="1.0"?'.">\n";
- print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"';
- print ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
- print "\n";
-?>
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$conf['lang']?>" lang="<?=$conf['lang']?>" dir="ltr">
- <head>
- <title><?=$ID?> [<?=$conf['title']?>]</title>
- <meta http-equiv="Content-Type" content="text/html; charset=<?=$lang['encoding']?>" />
- <meta name="generator" content="DokuWiki <?=getVersion()?>" />
- <link rel="stylesheet" media="screen" type="text/css" href="<?=DOKU_BASE?>style.css" />
- <link rel="stylesheet" media="print" type="text/css" href="<?=DOKU_BASE?>print.css" />
- <link rel="shortcut icon" href="<?=DOKU_BASE?>images/favicon.ico" />
- <link rel="start" href="<?=wl()?>" />
- <link rel="contents" href="<?=wl($ID,'do=index')?>" title="<?=$lang['index']?>" />
- <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="<?=DOKU_BASE?>feed.php" />
- <link rel="alternate" type="application/rss+xml" title="Current Namespace" href="<?=DOKU_BASE?>feed.php?mode=list&amp;ns=<?=$INFO['namespace']?>" />
- <link rel="alternate" type="text/html" title="Plain HTML" href="<?=wl($ID,'do=export_html')?>" />
- <link rel="alternate" type="text/plain" title="Wiki Markup" href="<?=wl($ID, 'do=export_raw')?>" />
-<?
- if( ($ACT=='show' || $ACT=='export_html') && !$REV){
- if($INFO['exists']){
- print ' <meta name="robots" content="index,follow" />'."\n";
- print ' <meta name="date" content="'.date('Y-m-d\TH:i:sO',$INFO['lastmod']).'" />'."\n";
- }else{
- print ' <meta name="robots" content="noindex,follow" />'."\n";
- }
- }else{
- print ' <meta name="robots" content="noindex,nofollow" />'."\n";
- }
-?>
-
- <script language="JavaScript" type="text/javascript">
- var alertText = '<?=$lang['qb_alert']?>';
- var notSavedYet = '<?=$lang['notsavedyet']?>';
- var DOKU_BASE = '<?=DOKU_BASE?>';
- </script>
- <script language="JavaScript" type="text/javascript" src="<?=DOKU_BASE?>script.js"></script>
-
- <!--[if gte IE 5]>
- <style type="text/css">
- /* that IE 5+ conditional comment makes this only visible in IE 5+ */
- img { behavior: url("<?=DOKU_BASE?>pngbehavior.htc"); } /* IE bugfix for transparent PNGs */
- </style>
- <![endif]-->
-
- <?@include("includes/meta.html")?>
- </head>
-<?
-}
-
-/**
* Just the back to top button (in it's own form)
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -304,180 +216,6 @@ function html_btn($name,$id,$akey,$params,$method='get'){
}
/**
- * Check for the given permission or prints an error
- *
- * @deprecated
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function html_acl($perm){
- global $INFO;
- if($INFO['perm'] >= $perm) return true;
-
- print parsedLocale('denied');
- return false;
-}
-
-/**
- * Displays the overall page header and calls html_head()
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function html_header(){
- global $ID;
- global $REV;
- global $lang;
- global $conf;
- html_head();
-?>
-<body>
- <div class="all">
- <?
- @include("includes/topheader.html");
- html_msgarea();
- ?>
- <div class="stylehead">
- <div class="header">
- <div class="pagename">
- [[<a href="<?=wl($ID,'do=backlink')?>" onclick="return svchk()" onkeypress="return svchk()"><?=$ID?></a>]]
- </div>
- <div class="logo">
- <a href="<?=wl()?>" name="top" accesskey="h" title="[ALT+H]" onclick="return svchk()" onkeypress="return svchk()"><?=$conf['title']?></a>
- </div>
- </div>
- <?@include("includes/header.html")?>
-
- <div class="bar" id="bar_top">
- <div class="bar-left" id="bar_topleft">
- <?=html_editbutton()?>
- <?=html_btn(revs,$ID,'o',array('do' => 'revisions'))?>
- </div>
-
- <div class="bar-right" id="bar_topright">
- <?=html_btn(recent,'','r',array('do' => 'recent'))?>
- <form action="<?=wl()?>" accept-charset="<?=$lang['encoding']?>">
- <input type="hidden" name="do" value="search" />
- <input type="text" accesskey="f" name="id" class="edit" />
- <input type="submit" value="<?=$lang['btn_search']?>" class="button" />
- </form>&nbsp;
- </div>
- </div>
-
- <?
- flush();
- html_breadcrumbs();
- @include("includes/pageheader.html");
- ?>
- </div>
- <div class="page">
- <!-- wikipage start -->
-<?
-}
-
-/**
- * display document and user info
- *
- * Displays some Metadata like who's logged in and the last modified
- * date - do not confuse this with the HTML meta header.
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function html_metainfo(){
- global $conf;
- global $lang;
- global $INFO;
- global $REV;
-
- $fn = $INFO['filepath'];
- if(!$conf['fullpath']){
- if($REV){
- $fn = str_replace(realpath($conf['olddir']).DIRECTORY_SEPARATOR,'',$fn);
- }else{
- $fn = str_replace(realpath($conf['datadir']).DIRECTORY_SEPARATOR,'',$fn);
- }
- }
- $date = date($conf['dformat'],$INFO['lastmod']);
-
- print '<div class="meta">';
- if($_SERVER['REMOTE_USER']){
- print '<div class="user">';
- print $lang['loggedinas'].': '.$_SERVER['REMOTE_USER'];
- print '</div>';
- }
- print ' &nbsp; ';
- if($INFO['exists']){
- print $fn;
- print ' &middot; ';
- print $lang['lastmod'];
- print ': ';
- print $date;
- if($INFO['editor']){
- print ' '.$lang['by'].' ';
- print $INFO['editor'];
- }
- if($INFO['locked']){
- print ' &middot; ';
- print $lang['lockedby'];
- print ': ';
- print $INFO['locked'];
- }
- }
- print '</div>';
-}
-
-/**
- * Diplay the overall footer
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function html_footer(){
- global $ID;
- global $REV;
- global $INFO;
- global $lang;
- global $conf;
-?>
- <!-- wikipage stop -->
- </div>
- <div class="clearer">&nbsp;</div>
- <div class="stylefoot">
- <?
- flush();
- @include("includes/pagefooter.html");
- html_metainfo();
- ?>
- <div class="bar" id="bar_bottom">
- <div class="bar-left" id="bar_bottomleft">
- <?=html_editbutton()?>
- <?=html_btn(revs,$ID,'o',array('do' => 'revisions'))?>
- </div>
-
- <div class="bar-right" id="bar_bottomright">
- <?
- if($conf['useacl']){
- if($_SERVER['REMOTE_USER']){
- print html_btn('logout',$ID,'',array('do' => 'logout',));
- }else{
- print html_btn('login',$ID,'',array('do' => 'login'));
- }
- #//acl-admin button
- #if($INFO['perm'] == AUTH_GRANT){
- # print html_btn('acl_admin',$ID,'',array('do' => 'acl_admin'));
- #}
- }
- ?>
- <?=html_btn(index,$ID,'x',array('do' => 'index'))?>
- <a href="#top"><input type="button" class="button" value="<?=$lang['btn_top']?>" /></a>&nbsp;
- </div>
- </div>
- </div>
- <?@include("includes/footer.html")?>
- </div>
- </body>
- </html>
-<?
-}
-
-/**
* Print the table of contents
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -1208,158 +946,6 @@ function html_debug(){
}
/**
- * prints the acl-admin form(s)
- *
- * @author Frank Schubert <frank@schokilade.de>
- */
-function html_acl_admin(){
- global $lang;
- global $ID;
- global $INFO;
-
- print parsedLocale('acl_admin');
-?>
- <fieldset style="float:left; text-align:left; white-space:nowrap; width:320px;">
- <legend><?=$lang['acl_admin']?></legend>
-
-
-<!-- XXXXXXXXXXXXX -->
-
- <form name="acl_admin_add" method="post" action="<?=wl($ID)?>" accept-charset="<?=$lang['encoding']?>">
- <input type="hidden" name="do" value="acl_admin_add" />
- <input type="hidden" name="save" value="1" />
- <table>
- <tr>
- <td><?=$lang['acl_user']?></td>
- <td><input type="text" name="acl_user" class="edit" size="20" value="" /></td>
- </tr><tr>
- <td><?=$lang['acl_scope']?></td>
- <td><select name="acl_scope" id="acl_scope" class="edit" size="1" onChange="checkAclLevel();">
- <option value="">(<?=$lang['acl_input_request']?>)</option>
- <option><?=$ID?></option>
- <?php if( ($ns=getNS($ID)) != NULL) {?>
- <option><?=$ns?>:*</option>
- <?php }else{ ?>
- <option>*</option>
- <?php } ?>
- </select></td>
- </tr><tr>
- <td style="vertical-align:top"><?=$lang['acl_level']?></td>
- <td>
- <input type="checkbox" name="acl_checkbox[1]" value="on" checked="checked" /><?=$lang['acl_read']?><br />
- <input type="checkbox" name="acl_checkbox[2]" value="on" /><?=$lang['acl_edit']?><br />
- <input type="checkbox" name="acl_checkbox[4]" value="on" /><?=$lang['acl_create']?><br />
- <input type="checkbox" name="acl_checkbox[8]" value="on" /><?=$lang['acl_upload']?>
- </td>
- </tr><tr>
- <td></td>
- <td><input type="submit" class="button" value="<?=$lang['acl_commit']?>" /></td>
- </tr>
- </table>
- </form>
-<!-- XXXXXXXXXXXXX -->
- </fieldset>
-
- <div style="float:right;">
- <fieldset>
- <legend><?=$lang['acl_current']?></legend>
- <div style="text-align:left">
-
-<!-- XXXXXXXXXXXXX -->
- <?php
- $acl_config=get_acl_config($ID);
- foreach($acl_config as $pagename => $value){
- if($pagename != '*') {
- $ID_cur=$pagename;
- while(($piece=getNS($ID_cur)) !== false){
- $url="<a href='".wl($piece,'do=acl_admin')."'>".noNS($piece)."</a>:".$url;;
- $ID_cur=$piece;
- }
- $url.="<a href='".wl($pagename,'do=acl_admin')."'>".noNS($pagename)."</a>";
- print $url;
- $url='';
- }else{
- print $pagename;
- } ?>
-
- <!-- XXXXXXXXXXXXX -->
- <table class="inline">
- <tr>
- <th class="inline"></th>
- <th class="inline">name</th>
- <th class="inline">R</th>
- <th class="inline">W</th>
- <th class="inline">C</th>
- <th class="inline">U</th>
- <th class="inline">UPDATE</th>
- <th class="inline">DELETE</th>
- </tr>
- <?php
- foreach($value as $conf){
- ?>
- <tr>
- <!-- user/group -->
- <td class="inline">
- <?php
- $group = false;
- if(substr($conf[0],0,1)=="@"){
- print $lang['acl_group'];
- $group = true;
- }else{
- print $lang['acl_user'];
- }
- ?>
- </td>
- <td class="inline">
- <!-- name -->
- <?php
- if($group) { print substr($conf[0],1); } else { print $conf[0]; }
- ?>
- </td>
- <form name="acl_admin_change" method="post" action="<?=wl($ID)?>" accept-charset="<?=$lang['encoding']?>">
- <?php
- // read,write,create,upload
- $acl_nums=array(1,2,4,8);
- foreach($acl_nums as $num){
- ?><td class="inline">
- <input type="hidden" name="do" value="acl_admin_change" />
- <input type="hidden" name="save" value="1" />
- <input type="hidden" name="acl_scope" value='<?=urlencode($pagename)?>' />
- <input type="hidden" name="acl_user" value='<?=urlencode($conf[0])?>' />
- <input type="hidden" name="acl_level" value='<?=$conf[1]?>' />
- <input type="checkbox" name="acl_checkbox[<?=$num?>]" value="on"<?php
- if($conf[1]>=$num) {
- ?> checked="checked"<?php
- }
- ?> /></td><?php
- }
- ?>
- <td class="inline"><input type="submit" class="button" value="update"></td>
- </form>
- <td class="inline">
- <!-- delete form -->
- <form name="acl_admin_del" method="post" action="<?=wl($ID)?>" accept-charset="<?=$lang['encoding']?>">
- <input type="hidden" name="do" value="acl_admin_del" />
- <input type="hidden" name="save" value="1" />
- <input type="hidden" name="acl_scope" value='<?=urlencode($pagename);?>' />
- <input type="hidden" name="acl_user" value='<?=urlencode($conf[0])?>' />
- <input type="hidden" name="acl_level" value='<?=$conf[1]?>' />
- <input type="submit" class="button" value='DEL' onClick="return window.confirm('<?=$lang['acl_confirm_delete']?>');" />
- </form>
- </td>
- </tr>
- <?php
- }
- ?></table><?php
- }
- ?>
- </div>
- </fieldset>
- </div>
-<?
-}
-
-/**
* Print the admin overview page
*
* @author Andreas Gohr <andi@splitbrain.org>
diff --git a/inc/template.php b/inc/template.php
index 8047a33d0..38af79df7 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -262,7 +262,6 @@ function tpl_searchform(){
/**
* Print the breadcrumbs trace
*
- * @todo add a hierachical breadcrumb function
* @author Andreas Gohr <andi@splitbrain.org>
*/
function tpl_breadcrumbs(){
@@ -281,6 +280,45 @@ function tpl_breadcrumbs(){
}
/**
+ * Hierarchical breadcrumbs
+ *
+ * This code was suggested as replacement for the usual breadcrumbs
+ * trail in the Wiki and was modified by me.
+ * It only makes sense with a deep site structure.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @link http://wiki.splitbrain.org/wiki:tipsandtricks:hierarchicalbreadcrumbs
+ */
+function tpl_youarehere(){
+ global $conf;
+ global $ID;
+ global $lang;
+
+
+ $parts = explode(':', $ID);
+
+ print $lang['breadcrumb'].': ';
+
+ //always print the startpage
+ if( $a_part[0] != $conf['start'] )
+ tpl_link(wl($conf['start']),$conf['start'],'title="'.$conf['start'].'"');
+
+ $page = '';
+ foreach ($parts as $part){
+ print ' &raquo; ';
+ $page .= $part;
+
+ if(file_exists(wikiFN($page))){
+ tpl_link(wl($page),$part,'title="'.$page.'"');
+ }else{
+ print $page;
+ }
+
+ $page .= ':';
+ }
+}
+
+/**
* Print info if the user is logged in
*
* Could be enhanced with a profile link in future?