qswiki/dynamic/dynamiccontentincludepage.cpp
Albert S 2102cf4e6b Add [cmd:allowinclude]
Pages must specify whether they want to be included or not.

Otherwise there too many surprises possibe, enforcing access
restrictions will get more complicated
2022-08-17 21:54:34 +02:00

17 rader
379 B
C++

#include "dynamiccontentincludepage.h"
#include "../parser.h"
std::string DynamicContentIncludePage::render()
{
auto revisionDao = this->database->createRevisionDao();
auto rev = revisionDao->getCurrentForPage(this->argument);
if(rev)
{
/* Quite dirty */
if(rev->content.find("[cmd:allowinclude]1[") != std::string::npos)
{
return rev->content;
}
}
return {};
}