Dynamic: Add DynamicContentIncludePage to allow including pages

This commit is contained in:
2022-03-27 21:36:53 +02:00
rodzic 7bb7600d39
commit 1ae5495e61
7 zmienionych plików z 42 dodań i 12 usunięć

Wyświetl plik

@ -24,6 +24,7 @@ SOFTWARE.
#include "../parser.h"
#include "../htmllink.h"
#include "../dynamic/dynamiccontentpostlist.h"
#include "../dynamic/dynamiccontentincludepage.h"
bool HandlerPageView::canAccess(std::string page)
{
return effectivePermissions(page).canRead();
@ -142,9 +143,15 @@ Response HandlerPageView::handleRequest(PageDao &pageDao, std::string pagename,
if(key == "dynamic:postlist")
{
std::shared_ptr<DynamicContentPostList> postlist = createDynamic<DynamicContentPostList>();
postlist->setCategory(std::string(value));
postlist->setArgument(std::string(value));
return postlist->render();
}
if(key == "dynamic:includepage")
{
std::shared_ptr<DynamicContentIncludePage> includePage = createDynamic<DynamicContentIncludePage>();
includePage->setArgument(std::string(value));
return includePage->render();
}
return std::string{};
};
if(revisionid > 0)