Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class helper_plugin_struct extends Plugin
* All descendants are also blacklisted.
*/
public const BLACKLIST_RENDERER = [
'Doku_Renderer_metadata',
'\renderer_plugin_qc'
];

Expand Down
4 changes: 2 additions & 2 deletions meta/SearchConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ protected function applyFilterVars($filter)
{
global $INPUT;
global $INFO;
if (!isset($INFO['id'])) {
$INFO['id'] = '';
if (is_null($INFO)) {
$INFO = pageinfo();
}

// apply inexpensive filters first
Expand Down
22 changes: 17 additions & 5 deletions syntax/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class syntax_plugin_struct_output extends SyntaxPlugin
{
protected $hasBeenRendered = false;
protected $hasBeenRendered = array('metadata'=>false, 'xhtml'=>false);

protected const XHTML_OPEN = '<div id="plugin__struct_output">';
protected const XHTML_CLOSE = '</div>';
Expand Down Expand Up @@ -99,13 +99,25 @@ public function render($format, Doku_Renderer $renderer, $data)
return true;
}
}
if (!isset($INFO['id']) || ($ID != $INFO['id'])) return true;
if (!$INFO['exists']) return true;
if ($this->hasBeenRendered) return true;
if (!isset($INFO) || $format == "metadata") {
$pagename = pageinfo()['id'];
} else {
$pagename = $INFO['id'];
}

if ($ID != $pagename) return true;
if (!page_exists($pagename)) return true;
if ($this->hasBeenRendered['metadata'] && $format == 'metadata') return true;
if ($this->hasBeenRendered['xhtml'] && $format == 'xhtml') return true;
if (!preg_match(self::WHITELIST_ACTIONS, act_clean($ACT))) return true;

// do not render the output twice on the same page, e.g. when another page has been included
$this->hasBeenRendered = true;
if ($format == 'metadata') {
$this->hasBeenRendered['metadata'] = true;
}
else if ($format == 'xhtml') {
$this->hasBeenRendered['xhtml'] = true;
}
try {
$assignments = Assignments::getInstance();
} catch (StructException $e) {
Expand Down
15 changes: 10 additions & 5 deletions syntax/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ public function render($format, Doku_Renderer $renderer, $config)
}

try {
$search = $this->getSearchConfig($config);
if ($format === 'struct_csv') {
// no pagination in export
if ($format === "metadata") {
$search = $this->getSearchConfig($config, false);
} else {
$search = $this->getSearchConfig($config);
}

if ($format === 'struct_csv' || $format === "metadata") {
// no pagination in export or metadata render
$search->setLimit(0);
$search->setOffset(0);
}
Expand Down Expand Up @@ -144,9 +149,9 @@ public function render($format, Doku_Renderer $renderer, $config)
* @param array $config
* @return SearchConfig
*/
protected function getSearchConfig($config)
protected function getSearchConfig($config, $dymamic = true)
{
return new SearchConfig($config);
return new SearchConfig($config, $dymamic);
}


Expand Down