Commit d20bc5f0 by Scott

Allow widget plugins on page plugins

parent b6a72e35
...@@ -103,10 +103,22 @@ ...@@ -103,10 +103,22 @@
if ($module->allow_template($template)) if ($module->allow_template($template))
$templateoptions[$template]=qa_lang_html($langkey); $templateoptions[$template]=qa_lang_html($langkey);
if ($module->allow_template('custom')) if ($module->allow_template('custom')) {
foreach ($pages as $page) $pagemodules = qa_load_modules_with('page', 'match_request');
if (!($page['flags']&QA_PAGE_FLAGS_EXTERNAL)) foreach ($pages as $page) {
$templateoptions['custom-'.$page['pageid']]=qa_html($page['title']); // check if this is a page plugin by fetching all plugin classes and matching requests - currently quite convoluted!
$isPagePlugin = false;
foreach ($pagemodules as $pagemodule) {
if ($pagemodule->match_request($page['tags'])) {
$isPagePlugin = true;
}
}
if ($isPagePlugin || !($page['flags'] & QA_PAGE_FLAGS_EXTERNAL))
$templateoptions['custom-' . $page['pageid']] = qa_html($page['title']);
}
}
} }
......
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
foreach ($pagemodules as $pagemodule) foreach ($pagemodules as $pagemodule)
if ($pagemodule->match_request($request)) { if ($pagemodule->match_request($request)) {
qa_set_template('plugin'); $tmpl = isset($custompage['pageid']) ? 'custom-'.$custompage['pageid'] : 'custom';
qa_set_template($tmpl);
return $pagemodule->process_request($request); return $pagemodule->process_request($request);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment