[dokuwiki] Globalstart patch
- From: Guy Brand <gb@xxxxxxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sat, 28 Jan 2006 21:19:43 +0100
Hello,
Solution 3 on http://wiki.splitbrain.org/wiki:tips:namespaceindex
page is a smart and simple way to turn the $conf['start'] as the
default page for any directory (namespace) and not only the root
namespace. How about commiting the globalstart patch attached to
the core? Such a behavior is needed when Dokuwiki is used as a
CMS or just to shorten links in pages ([[project/]] instead of
[[project/start]]). My previous globalstart patch was breaking
Gary's pagemove plugin when trying to rename a page in or to the
root namespace. This short patch is clean with pagemove.
This also fixes FS#472
gb
diff -aur dokuwiki/inc/pageutils.php work/dokuwiki/inc/pageutils.php
--- dokuwiki/inc/pageutils.php Tue Nov 29 14:46:31 2005
+++ work/dokuwiki/inc/pageutils.php Sat Jan 28 20:21:13 2006
@@ -23,6 +23,13 @@
$id = $_REQUEST[$param];
+ //globalstart
+ if($conf['globalstart']) {
+ if((substr($_REQUEST['id'], -1) == "/") || (substr($_REQUEST['id'], -1) ==
":")) {
+ $id .= $conf['start'];
+ }
+ }
+
//construct page id from request URI
if(empty($id) && $conf['userewrite'] == 2){
//get the script URL
diff -aur dokuwiki/conf/dokuwiki.php work/dokuwiki/conf/dokuwiki.php
--- dokuwiki/conf/dokuwiki.php Sat Jan 28 12:11:53 2006
+++ work/dokuwiki/conf/dokuwiki.php Sat Jan 28 20:30:03 2006
@@ -17,9 +17,11 @@
$conf['savedir'] = './data'; //where to store all the files
$conf['allowdebug'] = 1; //make debug possible, disable after
install! 0|1
+
/* Display Options */
$conf['start'] = 'start'; //name of start page
+$conf['globalstart'] = 0; //is the start page global to all
namespaces
$conf['title'] = 'DokuWiki'; //what to show in the title
$conf['template'] = 'default'; //see tpl directory
$conf['fullpath'] = 0; //show full path of the document or
relative to datadir only? 0|1
- Follow-Ups:
- [dokuwiki] Re: Globalstart patch
- From: Mark McCoy
- References:
- [dokuwiki] Pagemove plugin available for testing
- From: Gary Owen
Other related posts:
- » [dokuwiki] Globalstart patch
- » [dokuwiki] Re: Globalstart patch
- [dokuwiki] Re: Globalstart patch
- From: Mark McCoy
- [dokuwiki] Pagemove plugin available for testing
- From: Gary Owen