UrlProvider: Add Links to specify rendertype in allpages / category view
Esse commit está contido em:
pai
622ef5af6a
commit
1c1416934b
@ -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");
|
||||
|
2
config.h
2
config.h
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
Carregando…
Referência em uma nova issue
Block a user