Use global mod_rewrite configuration.
authorJan Schneider <jan@horde.org>
Fri, 15 Oct 2010 12:07:33 +0000 (14:07 +0200)
committerJan Schneider <jan@horde.org>
Fri, 15 Oct 2010 12:09:11 +0000 (14:09 +0200)
wicked/config/conf.xml
wicked/lib/Text_Wiki/Render/Xhtml/Wikilink2.php
wicked/lib/Wicked.php

index f9747cd..51860b3 100644 (file)
   </configsection>
  </configsection>
 
- <configsection name="options" desc="Look and feel">
-  <configheader>Look and feel</configheader>
-  <configboolean name="use_mod_rewrite" desc="Should we use mod_rewrite URL translations for page URLs? If your webserver doesn't have mod_rewrite enabled, enabling this will result in broken links. The default/fallback if this is off is to use GET to pass the page name.">false</configboolean>
- </configsection>
-
  <configsection name="menu">
   <configheader>
     Menu Settings
index 1eaa71a..4a2ad7d 100644 (file)
@@ -47,14 +47,11 @@ class Text_Wiki_Render_Xhtml_Wikilink2 extends Text_Wiki_Render_Xhtml_Wikilink {
             }
         }
 
-        $anchor = '#'.$this->urlEncode(substr($anchor, 1));
+        $anchor = '#' . $this->urlEncode(substr($anchor, 1));
 
-        // does the page exist?
+        // Does the page exist?
         if ($exists) {
-
-            // PAGE EXISTS.
-
-            $href = sprintf($this->getConf('view_url'), (!empty($GLOBALS['conf']['options']['use_mod_rewrite']) ? htmlspecialchars($page) : $this->urlEncode($page))) . $anchor;
+            $href = sprintf($this->getConf('view_url'), $GLOBALS['conf']['urls']['pretty'] == 'rewrite' ? htmlspecialchars($page) : $this->urlEncode($page)) . $anchor;
 
             // get the CSS class and generate output
             $css = ' class="'.$this->textEncode($this->getConf('css')).'"';
@@ -62,9 +59,6 @@ class Text_Wiki_Render_Xhtml_Wikilink2 extends Text_Wiki_Render_Xhtml_Wikilink {
             $start = '<a'.$css.' href="'.$this->textEncode($href).'">';
             $end = '</a>';
         } else {
-
-            // PAGE DOES NOT EXIST.
-
             $new_url = $this->getConf('new_url');
             if (!$new_url) {
                 return $this->textEncode($text);
index 2c33d50..afea0fe 100644 (file)
@@ -75,9 +75,7 @@ class Wicked
      */
     public static function url($page, $full = false, $append_session = 0)
     {
-        global $conf;
-
-        if (!empty($conf['options']['use_mod_rewrite'])) {
+        if ($GLOBALS['conf']['urls']['pretty'] == 'rewrite') {
             $script = str_replace('%2F', '/', urlencode($page));
         } else {
             $script = Horde_Util::addParameter('display.php', 'page', $page);