<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -28,249 +28,248 @@ require_once(DOKU_PLUGIN.'syntax.php');
  */ 
 class syntax_plugin_repo extends DokuWiki_Syntax_Plugin { 
  
-  /** 
-   * return some info 
-   */ 
-  function getInfo(){ 
-    return array( 
-      'author' =&gt; 'Esther Brunner', 
-      'email'  =&gt; 'wikidesign@gmail.com', 
-      'date'   =&gt; '2007-03-14', 
-      'name'   =&gt; 'Repository Plugin', 
-      'desc'   =&gt; 'Show files from a remote repository with GesHi syntax highlighting', 
-      'url'    =&gt; 'http://www.wikidesign.ch/en/plugin/repo/start', 
-    ); 
-  } 
- 
-  function getType(){ return 'substition'; } 
-  function getSort(){ return 301; } 
-  function getPType(){ return 'block'; } 
-  function connectTo($mode){  
-    $this-&gt;Lexer-&gt;addSpecialPattern(&quot;{{repo&gt;.+?}}&quot;, $mode, 'plugin_repo');  
-  } 
- 
-  /** 
-   * Handle the match 
-   */ 
-  function handle($match, $state, $pos, &amp;$handler){ 
- 
-      $match = substr($match, 7, -2);
-      list($base, $title) = explode('|', $match, 2);
-      list($base, $refresh) = explode(' ', $base, 2);
-      
-      if (preg_match('/(\d+)([dhm])/', $refresh, $match)){
-        $period = array('d' =&gt; 86400, 'h' =&gt; 3600, 'm' =&gt; 60);
-        // n * period in seconds, minimum 10 minutes
-        $refresh = max(600, $match[1] * $period[$match[2]]);
-      } else {
-        // default to 4 hours
-        $refresh = 14400;
-      }
-      
-      return array(trim($base), trim($title), $pos, $refresh);
-  }     
- 
-  /** 
-   * Create output 
-   */ 
-  function render($mode, &amp;$renderer, $data){
-    
-    // construct requested URL
-    $base  = hsc($data[0]);
-    $title = ($data[1] ? hsc($data[1]) : $base);
-    $path  = hsc($_REQUEST['repo']);
-    $url   = $base.$path;
-
-    if ($mode == 'xhtml'){
-    
-      // prevent caching to ensure the included page is always fresh
-      $renderer-&gt;info['cache'] = false;
-                        
-      // output
-      $renderer-&gt;header($title.$path, 5, $data[2]);
-      $renderer-&gt;section_open(5);
-      if ($url{strlen($url) - 1} == '/'){                 // directory
-        $this-&gt;_directory($base, $renderer, $path, $data[3]);
-      } elseif (preg_match('/(jpe?g|gif|png)$/i', $url)){ // image
-        $this-&gt;_image($url, $renderer);
-      } else {                                            // source code file
-        $this-&gt;_codefile($url, $renderer, $data[3]);
-      }
-      if ($path) $this-&gt;_location($path, $title, $renderer);
-      $renderer-&gt;section_close();
-      
-    // for metadata renderer
-    } elseif ($mode == 'metadata'){
-      $renderer-&gt;meta['relation']['haspart'][$url] = 1;
+    /** 
+     * return some info 
+     */ 
+    function getInfo() { 
+        return array( 
+                'author' =&gt; 'Esther Brunner', 
+                'email'  =&gt; 'wikidesign@gmail.com', 
+                'date'   =&gt; '2007-03-14', 
+                'name'   =&gt; 'Repository Plugin', 
+                'desc'   =&gt; 'Show files from a remote repository with GesHi syntax highlighting', 
+                'url'    =&gt; 'http://www.wikidesign.ch/en/plugin/repo/start', 
+                ); 
+    } 
+
+    function getType() { return 'substition'; } 
+    function getSort() { return 301; } 
+    function getPType() { return 'block'; } 
+    function connectTo($mode) {  
+        $this-&gt;Lexer-&gt;addSpecialPattern(&quot;{{repo&gt;.+?}}&quot;, $mode, 'plugin_repo');  
+    } 
+
+    /** 
+     * Handle the match 
+     */ 
+    function handle($match, $state, $pos, &amp;$handler) { 
+
+        $match = substr($match, 7, -2);
+        list($base, $title) = explode('|', $match, 2);
+        list($base, $refresh) = explode(' ', $base, 2);
+
+        if (preg_match('/(\d+)([dhm])/', $refresh, $match)) {
+            $period = array('d' =&gt; 86400, 'h' =&gt; 3600, 'm' =&gt; 60);
+            // n * period in seconds, minimum 10 minutes
+            $refresh = max(600, $match[1] * $period[$match[2]]);
+        } else {
+            // default to 4 hours
+            $refresh = 14400;
+        }
+
+        return array(trim($base), trim($title), $pos, $refresh);
+    }     
+
+    /** 
+     * Create output 
+     */ 
+    function render($mode, &amp;$renderer, $data) {
+
+        // construct requested URL
+        $base  = hsc($data[0]);
+        $title = ($data[1] ? hsc($data[1]) : $base);
+        $path  = hsc($_REQUEST['repo']);
+        $url   = $base.$path;
+
+        if ($mode == 'xhtml') {
+
+            // prevent caching to ensure the included page is always fresh
+            $renderer-&gt;info['cache'] = false;
+
+            // output
+            $renderer-&gt;header($title.$path, 5, $data[2]);
+            $renderer-&gt;section_open(5);
+            if ($url{strlen($url) - 1} == '/') {                 // directory
+                $this-&gt;_directory($base, $renderer, $path, $data[3]);
+            } elseif (preg_match('/(jpe?g|gif|png)$/i', $url)) { // image
+                $this-&gt;_image($url, $renderer);
+            } else {                                            // source code file
+                $this-&gt;_codefile($url, $renderer, $data[3]);
+            }
+            if ($path) $this-&gt;_location($path, $title, $renderer);
+            $renderer-&gt;section_close();
+
+            // for metadata renderer
+        } elseif ($mode == 'metadata') {
+            $renderer-&gt;meta['relation']['haspart'][$url] = 1;
+        }
+
+        return $ok;  
     }
- 
-    return $ok;  
-  }
-  
-  /**
-   * Handle remote directories
-   */
-  function _directory($url, &amp;$renderer, $path, $refresh){
-    global $conf;
-    
-    $cache = getCacheName($url.$path, '.repo');
-    $mtime = @filemtime($cache); // 0 if it doesn't exist
-    
-    if (($mtime != 0) &amp;&amp; !$_REQUEST['purge'] &amp;&amp; ($mtime &gt; time() - $refresh)){
-      $idx = io_readFile($cache, false);
-      if ($conf['allowdebug']) $idx .= &quot;\n&lt;!-- cachefile $cache used --&gt;\n&quot;;
-    } else {
-      $items = $this-&gt;_index($url, $path);
-      $idx = html_buildlist($items, 'idx', 'repo_list_index', 'html_li_index');
-      
-      io_saveFile($cache, $idx);
-      if ($conf['allowdebug']) $idx .= &quot;\n&lt;!-- no cachefile used, but created --&gt;\n&quot;;
+
+    /**
+     * Handle remote directories
+     */
+    function _directory($url, &amp;$renderer, $path, $refresh) {
+        global $conf;
+
+        $cache = getCacheName($url.$path, '.repo');
+        $mtime = @filemtime($cache); // 0 if it doesn't exist
+
+        if (($mtime != 0) &amp;&amp; !$_REQUEST['purge'] &amp;&amp; ($mtime &gt; time() - $refresh)) {
+            $idx = io_readFile($cache, false);
+            if ($conf['allowdebug']) $idx .= &quot;\n&lt;!-- cachefile $cache used --&gt;\n&quot;;
+        } else {
+            $items = $this-&gt;_index($url, $path);
+            $idx = html_buildlist($items, 'idx', 'repo_list_index', 'html_li_index');
+
+            io_saveFile($cache, $idx);
+            if ($conf['allowdebug']) $idx .= &quot;\n&lt;!-- no cachefile used, but created --&gt;\n&quot;;
+        }
+
+        $renderer-&gt;doc .= $idx;
     }
-    
-    $renderer-&gt;doc .= $idx;
-  }
-  
-  /**
-   * Extract links and list them as directory contents
-   */
-  function _index($url, $path, $base = '', $lvl = 0){
-    
-    // download the index html file
-    $http = new DokuHTTPClient();
-    $http-&gt;timeout = 25; //max. 25 sec
-    $data = $http-&gt;get($url.$base);
-    preg_match_all('/&lt;li&gt;&lt;a href=&quot;(.*?)&quot;&gt;/i', $data, $results);
-    
-    $lvl++;
-    foreach ($results[1] as $result){
-      if ($result == '../') continue;
-      
-      $type = ($result{strlen($result) - 1} == '/' ? 'd' : 'f');
-      $open = (($type == 'd') &amp;&amp; (strpos($path, $base.$result) === 0));
-      $items[] = array(
-        'level' =&gt; $lvl,
-        'type'  =&gt; $type,
-        'path'  =&gt; $base.$result,
-        'open'  =&gt; $open,
-      );
-      if ($open){
-        $items = array_merge($items, $this-&gt;_index($url, $path, $base.$result, $lvl));
-      }
+
+    /**
+     * Extract links and list them as directory contents
+     */
+    function _index($url, $path, $base = '', $lvl = 0) {
+
+        // download the index html file
+        $http = new DokuHTTPClient();
+        $http-&gt;timeout = 25; //max. 25 sec
+        $data = $http-&gt;get($url.$base);
+        preg_match_all('/&lt;li&gt;&lt;a href=&quot;(.*?)&quot;&gt;/i', $data, $results);
+
+        $lvl++;
+        foreach ($results[1] as $result) {
+            if ($result == '../') continue;
+
+            $type = ($result{strlen($result) - 1} == '/' ? 'd' : 'f');
+            $open = (($type == 'd') &amp;&amp; (strpos($path, $base.$result) === 0));
+            $items[] = array(
+                    'level' =&gt; $lvl,
+                    'type'  =&gt; $type,
+                    'path'  =&gt; $base.$result,
+                    'open'  =&gt; $open,
+                    );
+            if ($open) {
+                $items = array_merge($items, $this-&gt;_index($url, $path, $base.$result, $lvl));
+            }
+        }
+        return $items; 
     }
-    return $items; 
-  }
-  
-  /**
-   * Handle remote images
-   */
-  function _image($url, &amp;$renderer){
-    $renderer-&gt;p_open();
-    $renderer-&gt;externalmedia($url, NULL, NULL, NULL, NULL, 'recache');
-    $renderer-&gt;p_close();
-  }
-  
-  /**
-   * Handle remote source code files: display as code box with link to file at the end
-   */
-  function _codefile($url, &amp;$renderer, $refresh){
-          
-    // output the code box with syntax highlighting
-    $renderer-&gt;doc .= $this-&gt;_cached_geshi($url, $refresh);
-    
-    // and show a link to the original file
-    $renderer-&gt;p_open();
-    $renderer-&gt;externallink($url);
-    $renderer-&gt;p_close();
-  }
-  
-  /**
-   * Wrapper for GeSHi Code Highlighter, provides caching of its output
-   * Modified to calculate cache from URL so we don't have to re-download time and again
-   *
-   * @author Christopher Smith &lt;chris@jalakai.co.uk&gt;
-   * @author Esther Brunner &lt;wikidesign@gmail.com&gt;
-   */
-  function _cached_geshi($url, $refresh){
-    global $conf;
-    
-    $cache = getCacheName($url, '.code');
-    $mtime = @filemtime($cache); // 0 if it doesn't exist
-  
-    if (($mtime != 0) &amp;&amp; !$_REQUEST['purge'] &amp;&amp;
-      ($mtime &gt; time() - $refresh) &amp;&amp;
-      ($mtime &gt; filemtime(DOKU_INC.'inc/geshi.php'))){
-  
-      $hi_code = io_readFile($cache, false);
-      if ($conf['allowdebug']) $hi_code .= &quot;\n&lt;!-- cachefile $cache used --&gt;\n&quot;;
-  
-    } else {
-      require_once(DOKU_INC . 'inc/geshi.php');
-      
-      // get the source code language first
-      $search = array('/^htm/', '/^js$/');
-      $replace = array('html4strict', 'javascript');
-      $lang = preg_replace($search, $replace, substr(strrchr($url, '.'), 1));
-      
-      // download external file
-      $http = new DokuHTTPClient();
-      $http-&gt;timeout = 25; //max. 25 sec
-      $code = $http-&gt;get($url);
-  
-      $geshi = new GeSHi($code, strtolower($lang), DOKU_INC.'inc/geshi');
-      $geshi-&gt;set_encoding('utf-8');
-      $geshi-&gt;enable_classes();
-      $geshi-&gt;set_header_type(GESHI_HEADER_PRE);
-      $geshi-&gt;set_overall_class(&quot;code $language&quot;);
-      $geshi-&gt;set_link_target($conf['target']['extern']);
-  
-      $hi_code = $geshi-&gt;parse_code();
-  
-      io_saveFile($cache, $hi_code);
-      if ($conf['allowdebug']) $hi_code .= &quot;\n&lt;!-- no cachefile used, but created --&gt;\n&quot;;
+
+    /**
+     * Handle remote images
+     */
+    function _image($url, &amp;$renderer) {
+        $renderer-&gt;p_open();
+        $renderer-&gt;externalmedia($url, NULL, NULL, NULL, NULL, 'recache');
+        $renderer-&gt;p_close();
     }
-  
-    return $hi_code;
-  }
-    
-  /**
-   * Show where we are with link back to main repository
-   */
-  function _location($path, $title, &amp;$renderer){
-    global $ID;
-    
-    $renderer-&gt;p_open();
-    $renderer-&gt;internallink($ID, $title);
-    
-    $base = '';
-    $dirs = explode('/', $path);
-    $n = count($dirs);
-    for ($i = 0; $i &lt; $n-1; $i++){
-      $base .= hsc($dirs[$i]).'/';
-      $renderer-&gt;doc .= '&lt;a href=&quot;'.wl($ID, 'repo='.$base).'&quot; class=&quot;idx_dir&quot;&gt;'.
-        hsc($dirs[$i]).'/&lt;/a&gt;';
+
+    /**
+     * Handle remote source code files: display as code box with link to file at the end
+     */
+    function _codefile($url, &amp;$renderer, $refresh) {
+
+        // output the code box with syntax highlighting
+        $renderer-&gt;doc .= $this-&gt;_cached_geshi($url, $refresh);
+
+        // and show a link to the original file
+        $renderer-&gt;p_open();
+        $renderer-&gt;externallink($url);
+        $renderer-&gt;p_close();
+    }
+
+    /**
+     * Wrapper for GeSHi Code Highlighter, provides caching of its output
+     * Modified to calculate cache from URL so we don't have to re-download time and again
+     *
+     * @author Christopher Smith &lt;chris@jalakai.co.uk&gt;
+     * @author Esther Brunner &lt;wikidesign@gmail.com&gt;
+     */
+    function _cached_geshi($url, $refresh) {
+        global $conf;
+
+        $cache = getCacheName($url, '.code');
+        $mtime = @filemtime($cache); // 0 if it doesn't exist
+
+        if (($mtime != 0) &amp;&amp; !$_REQUEST['purge'] &amp;&amp;
+                ($mtime &gt; time() - $refresh) &amp;&amp;
+                ($mtime &gt; filemtime(DOKU_INC.'inc/geshi.php'))) {
+
+            $hi_code = io_readFile($cache, false);
+            if ($conf['allowdebug']) $hi_code .= &quot;\n&lt;!-- cachefile $cache used --&gt;\n&quot;;
+
+        } else {
+            require_once(DOKU_INC . 'inc/geshi.php');
+
+            // get the source code language first
+            $search = array('/^htm/', '/^js$/');
+            $replace = array('html4strict', 'javascript');
+            $lang = preg_replace($search, $replace, substr(strrchr($url, '.'), 1));
+
+            // download external file
+            $http = new DokuHTTPClient();
+            $http-&gt;timeout = 25; //max. 25 sec
+            $code = $http-&gt;get($url);
+
+            $geshi = new GeSHi($code, strtolower($lang), DOKU_INC.'inc/geshi');
+            $geshi-&gt;set_encoding('utf-8');
+            $geshi-&gt;enable_classes();
+            $geshi-&gt;set_header_type(GESHI_HEADER_PRE);
+            $geshi-&gt;set_overall_class(&quot;code $language&quot;);
+            $geshi-&gt;set_link_target($conf['target']['extern']);
+
+            $hi_code = $geshi-&gt;parse_code();
+
+            io_saveFile($cache, $hi_code);
+            if ($conf['allowdebug']) $hi_code .= &quot;\n&lt;!-- no cachefile used, but created --&gt;\n&quot;;
+        }
+
+        return $hi_code;
     }
-    
-    $renderer-&gt;doc .= hsc($dirs[$n-1]);
-    $renderer-&gt;p_close();
-  }
-            
+
+    /**
+     * Show where we are with link back to main repository
+     */
+    function _location($path, $title, &amp;$renderer) {
+        global $ID;
+
+        $renderer-&gt;p_open();
+        $renderer-&gt;internallink($ID, $title);
+
+        $base = '';
+        $dirs = explode('/', $path);
+        $n = count($dirs);
+        for ($i = 0; $i &lt; $n-1; $i++) {
+            $base .= hsc($dirs[$i]).'/';
+            $renderer-&gt;doc .= '&lt;a href=&quot;'.wl($ID, 'repo='.$base).'&quot; class=&quot;idx_dir&quot;&gt;'.
+                hsc($dirs[$i]).'/&lt;/a&gt;';
+        }
+
+        $renderer-&gt;doc .= hsc($dirs[$n-1]);
+        $renderer-&gt;p_close();
+    }
+
 }
 
 /**
  * For html_buildlist()
  */
-function repo_list_index($item){
-  global $ID;
-  
-  if ($item['type'] == 'd'){
-    $title = substr($item['path'], 0, -1);
-    $class = 'idx_dir';
-  } else {
-    $title = $item['path'];
-    $class = 'wikilink1';
-  }
-  $title = substr(strrchr('/'.$title, '/'), 1);
-  return '&lt;a href=&quot;'.wl($ID, 'repo='.$item['path']).'&quot; class=&quot;'.$class.'&quot;&gt;'.$title.'&lt;/a&gt;';
-}
+function repo_list_index($item) {
+    global $ID;
 
-//Setup VIM: ex: et ts=4 enc=utf-8 :
\ No newline at end of file
+    if ($item['type'] == 'd') {
+        $title = substr($item['path'], 0, -1);
+        $class = 'idx_dir';
+    } else {
+        $title = $item['path'];
+        $class = 'wikilink1';
+    }
+    $title = substr(strrchr('/'.$title, '/'), 1);
+    return '&lt;a href=&quot;'.wl($ID, 'repo='.$item['path']).'&quot; class=&quot;'.$class.'&quot;&gt;'.$title.'&lt;/a&gt;';
+}
+//vim:ts=4:sw=4:et:enc=utf-8:</diff>
      <filename>syntax.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7952328066c9d53181bb5b2de905fa5d20d7e8ac</id>
    </parent>
  </parents>
  <author>
    <name>Michael Klier</name>
    <email>chi@chimeric.de</email>
  </author>
  <url>http://github.com/dokufreaks/plugin-repo/commit/963df94b06b0fdab2c94b93c61900308fd55bc2a</url>
  <id>963df94b06b0fdab2c94b93c61900308fd55bc2a</id>
  <committed-date>2008-06-07T14:10:34-07:00</committed-date>
  <authored-date>2008-06-07T14:10:34-07:00</authored-date>
  <message>fixed code style

darcs-hash:20080607211034-23886-8241ba2823cc68838b6a5d6cf2185a95da93e9b4.gz</message>
  <tree>00d5361c60f6584d858c61a90354ba995086c212</tree>
  <committer>
    <name>Michael Klier</name>
    <email>chi@chimeric.de</email>
  </committer>
</commit>
