+ load the result template automaticaly from the skin directory

This commit is contained in:
kelson42
2011-03-19 10:48:23 +00:00
parent 3f2f79d40f
commit 51b605906a
3 changed files with 371 additions and 3 deletions

View File

@ -23,7 +23,8 @@ namespace kiwix {
/* Constructor */
Searcher::Searcher() :
estimatedResultCount(0) {
estimatedResultCount(0),
resultTemplatePath("") {
}
/* Search strings in the database */
@ -78,9 +79,14 @@ namespace kiwix {
return retVal;
}
const bool Searcher::setResultTemplatePath(const std::string path) {
this->resultTemplatePath = path;
return true;
}
const string Searcher::getHtml() {
const STLW::string & sSourceFile = "/var/www/kiwix/moulinkiwix/templates/results.tmpl";
const STLW::string & sSourceFile = this->resultTemplatePath;
VMOpcodeCollector oVMOpcodeCollector;
StaticText oSyscalls;
StaticData oStaticData;

View File

@ -62,8 +62,9 @@ namespace kiwix {
void search(std::string &search, const unsigned int resultsCount, const bool verbose=false);
bool getNextResult(string &url, string &title, unsigned int &score);
const unsigned int getEstimatedResultCount();
void reset();
const bool setResultTemplatePath(const std::string path);
const string getHtml();
void reset();
protected:
virtual void closeIndex() = 0;
@ -71,6 +72,7 @@ namespace kiwix {
std::vector<Result> results;
std::vector<Result>::iterator resultOffset;
std::string resultTemplatePath;
unsigned int estimatedResultCount;
};