mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 12:25:16 +00:00
Virtual directory are handled at website's root directories.
This commit is contained in:
@ -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
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
};
|
@ -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
|
||||
|
Reference in New Issue
Block a user