UrlProvider: Add Links to specify rendertype in allpages / category view

This commit is contained in:
Albert S. 2022-04-03 11:13:01 +02:00
parent 622ef5af6a
commit 1c1416934b
4 ha cambiato i file con 23 aggiunte e 2 eliminazioni

Vedi File

@ -78,7 +78,9 @@ Config::Config(const std::map<std::string, std::string> &map)
this->templatepath = required("templatepath");
this->urls.linkallcats = required("linkallcats");
this->urls.linkallpages = required("linkallpages");
this->urls.linkallpagesrendertype = required ("linkallpagesrendertype");
this->urls.linkcategory = required("linkcategory");
this->urls.linkcategoryrendertype = required("linkcategoryrendertype");
this->urls.linkdelete = required("linkdelete");
this->urls.linkedit = required("linkedit");
this->urls.linkhistory = required("linkhistory");

Vedi File

@ -23,6 +23,7 @@ struct ConfigUrls
std::string linkindex;
std::string linkrecent;
std::string linkallpages;
std::string linkallpagesrendertype;
std::string linkallcats;
std::string linkshere;
std::string linkpage;
@ -34,6 +35,7 @@ struct ConfigUrls
std::string linkdelete;
std::string linklogout;
std::string linkcategory;
std::string linkcategoryrendertype;
std::string loginurl;
std::string linkrecentsort;
std::string actionurl;

Vedi File

@ -53,6 +53,11 @@ std::string UrlProvider::allPages()
return config->linkallpages;
}
std::string UrlProvider::allPages(std::string rendertype)
{
return replaceSingleVar(config->linkallpagesrendertype, "type", rendertype);
}
std::string UrlProvider::allCats()
{
return config->linkallcats;
@ -121,6 +126,16 @@ std::string UrlProvider::category(std::string catname)
{
return replaceSingleVar(config->linkcategory, "category", catname);
}
std::string UrlProvider::category(std::string catname, std::string rendertype)
{
Varreplacer replace("{");
replace.addKeyValue("category", catname);
replace.addKeyValue("type", rendertype);
return replace.parse(config->linkcategoryrendertype);
}
std::string UrlProvider::login(std::string page)
{
return replaceOnlyPage(config->loginurl, page);

Vedi File

@ -22,7 +22,8 @@ class UrlProvider
std::string recentSorted(unsigned int limit, unsigned int offset, unsigned int sort);
std::string allPages();
std::string allPages(std::string rendertype);
std::string allCats();
std::string page(std::string pagename);
@ -48,7 +49,8 @@ class UrlProvider
std::string refreshSession();
std::string category(std::string catname);
std::string category(std::string catname, std::string rendertype);
std::string login(std::string page);
std::string rootUrl();