-<?php // -*-php-*-
-// $Id: DynamicIncludePage.php 8071 2011-05-18 14:56:14Z vargenau $
+<?php
+
/*
* Copyright 2009 $ThePhpWikiProgrammingTeam
*
require_once 'lib/plugin/IncludePage.php';
class WikiPlugin_DynamicIncludePage
-extends WikiPlugin_IncludePage
+ extends WikiPlugin_IncludePage
{
- function getName() {
- return _("DynamicIncludePage");
- }
-
- function getDescription() {
+ function getDescription()
+ {
return _("Dynamically include the content from another wiki page.");
}
- function getDefaultArguments() {
- return array_merge
- (WikiPlugin_IncludePage::getDefaultArguments(),
- array(
- 'state' => false, // initial state: false <=> [+], true <=> [-]
- ));
+ function getDefaultArguments()
+ {
+ return array_merge
+ (WikiPlugin_IncludePage::getDefaultArguments(),
+ array(
+ 'state' => false, // initial state: false <=> [+], true <=> [-]
+ ));
}
- function run($dbi, $argstr, &$request, $basepage) {
- global $WikiTheme;
+ function run($dbi, $argstr, &$request, $basepage)
+ {
+ global $WikiTheme;
$args = $this->getArgs($argstr, $request, false);
$page =& $args['page'];
if (ENABLE_AJAX) {
$html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage);
else
$html = HTML(HTML::p(array('class' => 'transclusion-title'),
- fmt(" %s :", WikiLink($page))),
- HTML::div(array('class' => 'transclusion'), ''));
+ fmt(" %s :", WikiLink($page))),
+ HTML::div(array('class' => 'transclusion'), ''));
$ajaxuri = WikiURL($page, array('format' => 'xml'));
} else {
$html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage);
}
- $header = $html->_content[0];
- $body = $html->_content[1];
- $id = 'DynInc-'.MangleXmlIdentifier($page);
- $body->setAttr('id', $id.'-body');
- $png = $WikiTheme->_findData('images/folderArrow'.
- ($args['state'] ? 'Open' : 'Closed').
- '.png');
- $icon = HTML::img(array('id' => $id.'-img',
- 'src' => $png,
- 'onclick' => ENABLE_AJAX
- ? "showHideAsync('".$ajaxuri."','$id')"
- : "showHideFolder('$id')",
- 'alt' => _("Click to hide/show"),
- 'title' => _("Click to hide/show")));
+ $body = $html->_content[1];
+ $id = 'DynInc-' . MangleXmlIdentifier($page);
+ $body->setAttr('id', $id . '-body');
+ $png = $WikiTheme->_findData('images/folderArrow' .
+ ($args['state'] ? 'Open' : 'Closed') .
+ '.png');
+ $icon = HTML::img(array('id' => $id . '-img',
+ 'src' => $png,
+ 'onclick' => ENABLE_AJAX
+ ? "showHideAsync('" . $ajaxuri . "','$id')"
+ : "showHideFolder('$id')",
+ 'alt' => _("Click to hide/show"),
+ 'title' => _("Click to hide/show")));
$header = HTML::p(array('class' => 'transclusion-title',
- 'style' => "text-decoration: none;"),
- $icon,
- fmt(" %s :", WikiLink($page)));
+ 'style' => "text-decoration: none;"),
+ $icon,
+ fmt(" %s :", WikiLink($page)));
if ($args['state']) { // show base
$body->setAttr('style', 'display:block');
return HTML($header, $body);
return HTML($header, $body); // sync (load but display:none)
}
}
-};
+}
// Local Variables:
// mode: php