mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Created settings sections system.
This commit is contained in:
		@@ -32,8 +32,38 @@ ComunicWeb.pages.settings.main = {
 | 
			
		||||
			class: "col-md-3"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Right area
 | 
			
		||||
		var rightArea = createElem2({
 | 
			
		||||
			appendTo: row,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "col-md-9"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Display left navigation pane
 | 
			
		||||
		ComunicWeb.pages.settings.navigationPane.display(leftArea);
 | 
			
		||||
 | 
			
		||||
		//Determine which page to open
 | 
			
		||||
		var section = args.subfolder ? args.subfolder : "general";
 | 
			
		||||
		
 | 
			
		||||
		//Check if the section exists or not
 | 
			
		||||
		if(ComunicWeb.pages.settings.sectionsList[section]){
 | 
			
		||||
			
 | 
			
		||||
			//Extract section information
 | 
			
		||||
			var section = ComunicWeb.pages.settings.sectionsList[section];
 | 
			
		||||
			
 | 
			
		||||
			//Update document title
 | 
			
		||||
			document.title += section.title;
 | 
			
		||||
 | 
			
		||||
			//Call handler
 | 
			
		||||
			eval(section.handler + "(args, rightArea);");
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//The section is not found
 | 
			
		||||
		else {
 | 
			
		||||
			//Display error page (404)
 | 
			
		||||
			ComunicWeb.common.error.pageNotFound(args, target);
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								assets/js/pages/settings/sections/general.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								assets/js/pages/settings/sections/general.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Settings general section
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.pages.settings.sections.general = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Open settings section
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {object} args Additionnal arguments
 | 
			
		||||
	 * @param {HTMLElement} target The target for the page
 | 
			
		||||
	 */
 | 
			
		||||
	open: function(args, target){
 | 
			
		||||
		alert("hey");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										17
									
								
								assets/js/pages/settings/sectionsList.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								assets/js/pages/settings/sectionsList.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Settings pages list
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.pages.settings.sectionsList = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * General settings
 | 
			
		||||
	 */
 | 
			
		||||
	general: {
 | 
			
		||||
		title: "General",
 | 
			
		||||
		handler: "ComunicWeb.pages.settings.sections.general.open",
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user