home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / wiki / lib / url.php < prev   
PHP Script  |  2004-03-08  |  2KB  |  84 lines

  1. <?php
  2. // Users may redefine these functions if they wish to change the
  3. // URL scheme, e.g., to enable links like:
  4. //
  5. //     http://somewiki.org/PageName
  6. //
  7. // The new versions of the relevant functions should be defined in
  8. // config.php.  Those functions that are redefined will not be
  9. // redefined here.
  10. if(!isset($ViewBase))
  11.   { $ViewBase    = $ScriptBase . '?page='; }
  12. if(!isset($EditBase))
  13.   { $EditBase    = $ScriptBase . '?action=edit&page='; }
  14. if(!isset($HistoryBase))
  15.   { $HistoryBase = $ScriptBase . '?action=history&page='; }
  16. if(!isset($FindScript))
  17.   { $FindScript  = $ScriptBase . '?action=find'; }
  18. if(!isset($FindBase))
  19.   { $FindBase    = $FindScript . '&find='; }
  20. if(!isset($SaveBase))
  21.   { $SaveBase    = $ScriptBase . '?action=save&page='; }
  22. if(!isset($DiffScript))
  23.   { $DiffScript  = $ScriptBase . '?action=diff'; }
  24. if(!isset($PrefsScript))
  25.   { $PrefsScript = $ScriptBase . '?action=prefs'; }
  26. if(!isset($StyleScript))
  27.   { $StyleScript = $ScriptBase . '?action=style'; }
  28.  
  29. if(!function_exists('viewURL'))
  30. {
  31. function viewURL($page, $version = '', $full = '')
  32. {
  33.   global $ViewBase;
  34.  
  35.   return $ViewBase . urlencode($page) .
  36.          ($version == '' ? '' : "&version=$version") .
  37.          ($full == '' ? '' : '&full=1');
  38. }
  39. }
  40.  
  41. if(!function_exists('editURL'))
  42. {
  43. function editURL($page, $version = '')
  44. {
  45.   global $EditBase;
  46.  
  47.   return $EditBase . urlencode($page) .
  48.          ($version == '' ? '' : "&version=$version");
  49. }
  50. }
  51.  
  52. if(!function_exists('historyURL'))
  53. {
  54. function historyURL($page, $full = '')
  55. {
  56.   global $HistoryBase;
  57.  
  58.   return $HistoryBase . urlencode($page) .
  59.          ($full == '' ? '' : '&full=1');
  60. }
  61. }
  62.  
  63. if(!function_exists('findURL'))
  64. {
  65. function findURL($page)
  66. {
  67.   global $FindBase;
  68.  
  69.   return $FindBase . urlencode($page);
  70. }
  71. }
  72.  
  73. if(!function_exists('saveURL'))
  74. {
  75. function saveURL($page)
  76. {
  77.   global $SaveBase;
  78.  
  79.   return $SaveBase . urlencode($page);
  80. }
  81. }
  82.  
  83. ?>
  84.