UrlProvider: Add pageByTitle()
This commit is contained in:
parent
1e224fdac6
commit
73a4e4c10f
@ -85,6 +85,7 @@ Config::Config(const std::map<std::string, std::string> &map)
|
|||||||
this->urls.linkindex = required("linkindex");
|
this->urls.linkindex = required("linkindex");
|
||||||
this->urls.linklogout = required("linklogout");
|
this->urls.linklogout = required("linklogout");
|
||||||
this->urls.linkpage = required("linkpage");
|
this->urls.linkpage = required("linkpage");
|
||||||
|
this->urls.linkpagebytitle = required("linkpagebytitle");
|
||||||
this->urls.linkrecent = required("linkrecent");
|
this->urls.linkrecent = required("linkrecent");
|
||||||
this->urls.linkrevision = required("linkrevision");
|
this->urls.linkrevision = required("linkrevision");
|
||||||
this->urls.linksettings = required("linksettings");
|
this->urls.linksettings = required("linksettings");
|
||||||
|
1
config.h
1
config.h
@ -26,6 +26,7 @@ struct ConfigUrls
|
|||||||
std::string linkallcats;
|
std::string linkallcats;
|
||||||
std::string linkshere;
|
std::string linkshere;
|
||||||
std::string linkpage;
|
std::string linkpage;
|
||||||
|
std::string linkpagebytitle;
|
||||||
std::string linkrevision;
|
std::string linkrevision;
|
||||||
std::string linkhistory;
|
std::string linkhistory;
|
||||||
std::string linkedit;
|
std::string linkedit;
|
||||||
|
@ -63,6 +63,11 @@ std::string UrlProvider::page(std::string pagename)
|
|||||||
return replaceOnlyPage(config->linkpage, pagename);
|
return replaceOnlyPage(config->linkpage, pagename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string UrlProvider::pageByTitle(std::string title)
|
||||||
|
{
|
||||||
|
return replaceSingleVar(config->linkpagebytitle, "title", utils::strreplace(title, " ", "-"));
|
||||||
|
}
|
||||||
|
|
||||||
std::string UrlProvider::linksHere(std::string pagename)
|
std::string UrlProvider::linksHere(std::string pagename)
|
||||||
{
|
{
|
||||||
return replaceOnlyPage(config->linkshere, pagename);
|
return replaceOnlyPage(config->linkshere, pagename);
|
||||||
|
@ -27,6 +27,8 @@ class UrlProvider
|
|||||||
|
|
||||||
std::string page(std::string pagename);
|
std::string page(std::string pagename);
|
||||||
|
|
||||||
|
std::string pageByTitle(std::string title);
|
||||||
|
|
||||||
std::string linksHere(std::string pagename);
|
std::string linksHere(std::string pagename);
|
||||||
|
|
||||||
std::string pageHistory(std::string pagename);
|
std::string pageHistory(std::string pagename);
|
||||||
|
Loading…
Reference in New Issue
Block a user