3 * Copyright © 2003,2004 $ThePhpWikiProgrammingTeam
5 * This file is part of PhpWiki.
7 * PhpWiki is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * PhpWiki is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 * SPDX-License-Identifier: GPL-2.0-or-later
26 * http://sourceforge.net/tracker/?func=detail&aid=537380&group_id=6121&atid=306121
28 * Submitted by: Cuthbert Cat (cuthbertcat)
29 * Redesigned by Reini Urban
31 * This is a quick mod of BackLinks to do the job recursively. If your
32 * site is categorized correctly, and all the categories are listed in
33 * CategoryCategory, then a RecBackLinks there will produce one BIG(!)
34 * contents page for the entire site.
35 * The list is as deep as the recursion level ('reclimit').
37 * 'includepages': passed verbatim to the IncludePage plugin. Default: "words=50"
38 * To disable words=50 use e.g. something like includepages="quiet=0"
39 * 'reclimit': Max Recursion depth. Default: 2
40 * 'direction': Get BackLinks or forward links (links listed on the page)
41 * 'firstreversed': If true, get BackLinks for the first page and forward
42 * links for the rest. Only applicable when direction = 'forward'.
43 * 'excludeunknown': If true (default) then exclude any mentioned pages
44 * which don't exist yet. Only applicable when direction='forward'.
47 require_once 'lib/PageList.php';
48 require_once 'lib/plugin/SiteMap.php';
50 class WikiPlugin_IncludeSiteMap
51 extends WikiPlugin_SiteMap
53 function getDescription()
55 return _("Include recursively all linked pages starting at [pagename].");
58 function getDefaultArguments()
60 return array('exclude' => '',
61 'include_self' => false,
63 'page' => '[pagename]',
64 'description' => $this->getDescription(),
67 'direction' => 'back',
68 'firstreversed' => false,
69 'excludeunknown' => true,
70 'includepages' => 'words=50'
76 * @param string $argstr
77 * @param WikiRequest $request
78 * @param string $basepage
81 function run($dbi, $argstr, &$request, $basepage)
83 return WikiPlugin_SiteMap::run($dbi, $argstr, $request, $basepage);