diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-05-25 11:47:07 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-05-25 11:47:07 +0200 |
commit | ed74b60ead82d59fe4b53ec8ce6a8c0c830debc5 (patch) | |
tree | faa7633ea0c64ae961974c97d3d8c81adf2dc366 /feed.php | |
parent | 6ebb44cb82f27dd826759fcb8e4a450452fd3635 (diff) | |
parent | 477e59988f5e90600b6fdcda7c055ab8ea001e03 (diff) | |
download | dokuwiki-ed74b60ead82d59fe4b53ec8ce6a8c0c830debc5.tar.gz dokuwiki-ed74b60ead82d59fe4b53ec8ce6a8c0c830debc5.zip |
Merge pull request #626 from splitbrain/feedmodelistsort
Added sort by date option to feed in list mode
Diffstat (limited to 'feed.php')
-rw-r--r-- | feed.php | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -127,6 +127,8 @@ function rss_parseOptions() { 'items' => array('int', 'num', $conf['recent']), // Boolean, only used in rc mode 'show_minor' => array('bool', 'minor', false), + // String, only used in list mode + 'sort' => array('str', 'sort', 'natural'), // String, only used in search mode 'search_query' => array('str', 'q', null), // One of: pages, media, both @@ -138,6 +140,7 @@ function rss_parseOptions() { $opt['items'] = max(0, (int) $opt['items']); $opt['show_minor'] = (bool) $opt['show_minor']; + $opt['sort'] = valid_input_set('sort', array('default' => 'natural', 'date'), $opt); $opt['guardmail'] = ($conf['mailguard'] != '' && $conf['mailguard'] != 'none'); @@ -480,7 +483,7 @@ function rssListNamespace($opt) { global $conf; $ns = ':'.cleanID($opt['namespace']); - $ns = str_replace(':', '/', $ns); + $ns = utf8_encodeFN(str_replace(':', '/', $ns)); $data = array(); $search_opts = array( @@ -488,7 +491,7 @@ function rssListNamespace($opt) { 'pagesonly' => true, 'listfiles' => true ); - search($data, $conf['datadir'], 'search_universal', $search_opts, $ns); + search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $opt['sort']); return $data; } |