Albert S
2102cf4e6b
Pages must specify whether they want to be included or not. Otherwise there too many surprises possibe, enforcing access restrictions will get more complicated
17 خطوط
379 B
C++
17 خطوط
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 {};
|
|
}
|