SourceForge logo
SourceForge logo
Menu

phpwiki-talk

From: Arthaey A. <ar...@gm...> - 2004年07月30日 18:41:40
I'm working on a plugin that programmatically creates headers (via
TransformText("!Header")). Because the text of the header isn't in the
wiki page's source, the following won't work:
<?plugin CreateToc ?>
<?plugin MyPlugin ?>
A comment in Template.php says that there is CreateToc support if I
pass the parsed markup to the plugin as $dbi->_markup. I tried
grepping for an existing plugin that uses _markup like this, but I
found nothing. Without an example, I'm confused about the specific
syntax of getting this call to work. Here's my best guess:
In MyPlugin.php:
function run($dbi, $argstr, &$request, $basepage) {
 $html = HTML();
 $toc = new WikiPlugin_CreateToc();
 $content = $this->_generateMyContentAndHeaders();
 $html->pushContent($toc->run($dbi, "", $request, $basepage));
 $html->pushContent($content);
 return $html;
}
Alas, this gives me an error says I "cannot instantiate non-existent
class wikiplugin_createtoc." Changing it from WikiPlugin_CreateToc to
just CreateToc gives me the same error.
How do I get an instance of CreateToc to run programmatically, and how
to I pass it the proper data?
Thanks!
-- 
AA
From: Reini U. <ru...@x-...> - 2004年07月31日 10:51:26
> I'm working on a plugin that programmatically creates headers (via
> TransformText("!Header")). Because the text of the header isn't in the
> wiki page's source, the following won't work:
>
> <?plugin CreateToc ?>
> <?plugin MyPlugin ?>
>
> A comment in Template.php says that there is CreateToc support if I pass
> the parsed markup to the plugin as $dbi->_markup. I tried
> grepping for an existing plugin that uses _markup like this, but I found
> nothing.
There's only CreateToc so far.
> Without an example, I'm confused about the specific syntax of
> getting this call to work. Here's my best guess:
>
> In MyPlugin.php:
>
> function run($dbi, $argstr, &$request, $basepage) {
> $html = HTML();
require_once("lib/plugin/CreateToc.php"):
> $toc = new WikiPlugin_CreateToc();
> $content = $this->_generateMyContentAndHeaders();
> $html->pushContent($toc->run($dbi, "", $request, $basepage));
> $html->pushContent($content);
> return $html;
> }
>
> Alas, this gives me an error says I "cannot instantiate non-existent
> class wikiplugin_createtoc." Changing it from WikiPlugin_CreateToc to
> just CreateToc gives me the same error.
>
> How do I get an instance of CreateToc to run programmatically, and how
> to I pass it the proper data?
-- 
Reini Urban
http://xarch.tu-graz.ac.at/~rurban/
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /