Virtual directory are handled at website's root directories.

This commit is contained in:
Pierre HUBERT
2018-07-14 14:07:27 +02:00
parent 5cfee77bb2
commit 665cbb8374
6 changed files with 117 additions and 4 deletions

View File

@ -1015,6 +1015,19 @@ var ComunicWeb = {
},
},
/**
* Virtual directories component
*/
virtualDirectory: {
/**
* API interface
*/
interface: {
//TODO : implement
},
},
},
/**
@ -1441,5 +1454,18 @@ var ComunicWeb = {
openLogoutPage: function(additionnalData, targetElement){},
},
/**
* Virtual directory pages
*/
virtualDirectory: {
/**
* Main page
*/
page: {
//TODO : implement
},
},
},
};

View File

@ -157,20 +157,23 @@ ComunicWeb.common.page = {
firstPartURI = "home";
}
//Save the first part of the URI as an argument
additionnalData.rootDirectory = firstPartURI;
//Check if there is also subfolders
if(firstPartURI.indexOf("/") != -1){
//Save the list of subfolders
var subfoldersURIarray = firstPartURI.split("/");
subfoldersURIarray.shift();
subfoldersURI = subfoldersURIarray.join("/");
var subfoldersURI = subfoldersURIarray.join("/");
//Remove them to find the right page
firstPartURI = firstPartURI.split("/")[0];
} else {
//No subfolder was specified
subfoldersURI = false;
var subfoldersURI = false;
}
//Check if specied page exists
@ -179,8 +182,17 @@ ComunicWeb.common.page = {
}
//Else we include the 404 not found page
else{
var pageInfos = ComunicWeb.pagesList.notFound;
else {
//Check if no subfolder was specified
if(subfoldersURI)
var pageInfos = ComunicWeb.pagesList.notFound;
//Find & open dynamically the appropriate page
else {
var pageInfos = ComunicWeb.pagesList.virtual_directory;
}
}
//Change page title