mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Virtual directory are handled at website's root directories.
This commit is contained in:
		
							
								
								
									
										37
									
								
								assets/js/pages/virtualDirectory/page.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								assets/js/pages/virtualDirectory/page.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Virtual directory main page
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.pages.virtualDirectory.page = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Open virtual directory page
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {object} args Optionnal arguments
 | 
			
		||||
	 * @param {HTMLElement} target The target for the page
 | 
			
		||||
	 */
 | 
			
		||||
	open: function(args, target){
 | 
			
		||||
 | 
			
		||||
		//Forward the request on the API
 | 
			
		||||
		ComunicWeb.components.virtualDirectory.interface.find(args.rootDirectory, function(r){
 | 
			
		||||
 | 
			
		||||
			//Check for errors
 | 
			
		||||
			if(r.error)
 | 
			
		||||
				return ComunicWeb.common.error.pageNotFound(args, target);
 | 
			
		||||
			
 | 
			
		||||
			//Check if the page is a user
 | 
			
		||||
			if(r.kind == "user"){
 | 
			
		||||
				ComunicWeb.pages.userPage.main.openUserPage(r.id, args, target);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			//Check if the page is  a group
 | 
			
		||||
			if(r.kind == "group"){
 | 
			
		||||
				ComunicWeb.pages.groups.pages.group.open(r.id, target);
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user