From: <var...@us...> - 2009-11-21 15:19:11
|
Revision: 7277 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7277&view=rev Author: vargenau Date: 2009-11-21 15:19:00 +0000 (Sat, 21 Nov 2009) Log Message: ----------- RedirectTo is done Modified Paths: -------------- trunk/lib/plugin/IncludePages.php Modified: trunk/lib/plugin/IncludePages.php =================================================================== --- trunk/lib/plugin/IncludePages.php 2009-11-21 15:18:27 UTC (rev 7276) +++ trunk/lib/plugin/IncludePages.php 2009-11-21 15:19:00 UTC (rev 7277) @@ -24,8 +24,6 @@ * IncludePages: Include a list of multiple pages, based on IncludePage. * usage: <?plugin IncludePages pages=<!plugin-list BackLinks !> ?> * author: ReiniUrban - * - * Todo: follow RedirectTo */ include_once("lib/plugin/IncludePage.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-04-11 12:52:04
|
Revision: 8035 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8035&view=rev Author: vargenau Date: 2011-04-11 12:51:58 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Whitespace only Modified Paths: -------------- trunk/lib/plugin/IncludePages.php Modified: trunk/lib/plugin/IncludePages.php =================================================================== --- trunk/lib/plugin/IncludePages.php 2011-04-11 09:22:33 UTC (rev 8034) +++ trunk/lib/plugin/IncludePages.php 2011-04-11 12:51:58 UTC (rev 8035) @@ -40,18 +40,18 @@ } function getDefaultArguments() { - return array_merge( - array( 'pages' => false, // the pages to include + return array_merge(array( 'pages' => false, // the pages to include 'exclude' => false), // the pages to exclude WikiPlugin_IncludePage::getDefaultArguments() - ); + ); } function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - $html = HTML(); - if (empty($args['pages'])) + $html = HTML(); + if (empty($args['pages'])) { return $html; + } $include = new WikiPlugin_IncludePage(); if (is_string($args['exclude']) and !empty($args['exclude'])) { @@ -67,11 +67,11 @@ $argstr = preg_replace("/pages=<\?plugin-list.*?\>/", "", $argstr); } - foreach ($args['pages'] as $page) { + foreach ($args['pages'] as $page) { if (empty($args['exclude']) or !in_array($page, $args['exclude'])) { $html = HTML($html, $include->run($dbi, "page='$page' ".$argstr, $request, $basepage)); } - } + } return $html; } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-04-11 15:39:59
|
Revision: 8037 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8037&view=rev Author: vargenau Date: 2011-04-11 15:39:53 +0000 (Mon, 11 Apr 2011) Log Message: ----------- IncludePage plugin has no "pages" argument. Remove it to avoid warning. Modified Paths: -------------- trunk/lib/plugin/IncludePages.php Modified: trunk/lib/plugin/IncludePages.php =================================================================== --- trunk/lib/plugin/IncludePages.php 2011-04-11 13:44:13 UTC (rev 8036) +++ trunk/lib/plugin/IncludePages.php 2011-04-11 15:39:53 UTC (rev 8037) @@ -67,6 +67,11 @@ $argstr = preg_replace("/pages=<\?plugin-list.*?\>/", "", $argstr); } + // IncludePage plugin has no "pages" argument. + // Remove it to avoid warning. + $argstr = preg_replace('/pages=".*?"/', "", $argstr); + $argstr = preg_replace('/pages=\S*\s/', "", $argstr); + foreach ($args['pages'] as $page) { if (empty($args['exclude']) or !in_array($page, $args['exclude'])) { $html = HTML($html, $include->run($dbi, "page='$page' ".$argstr, $request, $basepage)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-04-13 12:02:33
|
Revision: 8041 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8041&view=rev Author: vargenau Date: 2011-04-13 12:02:20 +0000 (Wed, 13 Apr 2011) Log Message: ----------- pages might be last Modified Paths: -------------- trunk/lib/plugin/IncludePages.php Modified: trunk/lib/plugin/IncludePages.php =================================================================== --- trunk/lib/plugin/IncludePages.php 2011-04-13 11:26:19 UTC (rev 8040) +++ trunk/lib/plugin/IncludePages.php 2011-04-13 12:02:20 UTC (rev 8041) @@ -71,6 +71,7 @@ // Remove it to avoid warning. $argstr = preg_replace('/pages=".*?"/', "", $argstr); $argstr = preg_replace('/pages=\S*\s/', "", $argstr); + $argstr = preg_replace('/pages=\S*/', "", $argstr); foreach ($args['pages'] as $page) { if (empty($args['exclude']) or !in_array($page, $args['exclude'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-02-17 19:17:26
|
Revision: 11005 http://sourceforge.net/p/phpwiki/code/11005 Author: vargenau Date: 2022-02-17 19:17:24 +0000 (Thu, 17 Feb 2022) Log Message: ----------- Implement function getWikiPageLinks for lib/plugin/IncludePages.php Modified Paths: -------------- trunk/lib/plugin/IncludePages.php Modified: trunk/lib/plugin/IncludePages.php =================================================================== --- trunk/lib/plugin/IncludePages.php 2022-02-16 18:24:08 UTC (rev 11004) +++ trunk/lib/plugin/IncludePages.php 2022-02-17 19:17:24 UTC (rev 11005) @@ -46,6 +46,38 @@ ); } + function getWikiPageLinks($argstr, $basepage) + { + $args = $this->getArgs($argstr); + if (is_string($args['exclude']) and !empty($args['exclude'])) { + $exclude = explodePageList($args['exclude']); + } elseif (is_array($args['exclude'])) { + $exclude = $args['exclude']; + } else { + $exclude = array(); + } + if (is_string($args['pages']) and !empty($args['pages'])) { + $pages = explodePageList($args['pages']); + } elseif (is_array($args['pages'])) { + $pages = $args['pages']; + } else { + $pages = array(); + } + $pages = array_diff($pages, $exclude); + $links = array(); + global $request; + $dbi = $request->_dbi; + foreach($pages as $page) { + $page_handle = $dbi->getPage($page); + $pagelinks = $page_handle->getPageLinks(); + while ($link_handle = $pagelinks->next()) { + $linkname = $link_handle->getName(); + $links[] = array('linkto' => $linkname); + } + } + return $links; + } + /** * @param WikiDB $dbi * @param string $argstr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |