Page 1 of 1

Adding a page to the admin section

Posted: Mon Sep 25, 2006 3:42 pm
by Leav
Hi,
I wanna add a page to the admin section for a custom module I wrote.

I need both the skeleton for the page itself and help on how to add it to the admin menu..


Thanks Alot!

-Leav

p.s.

Like the FCKeditor page!

Re: Adding a page to the admin section

Posted: Mon Sep 25, 2006 5:08 pm
by Dee
Checkout the Skeleton module:
http://dev.cmsmadesimple.org/projects/skeleton/

To get a page in the admin section from a module use this code:

Code: Select all

	/*---------------------------------------------------------
	   HasAdmin()
	   This function returns a boolean value, depending on
	   whether your module adds anything to the Admin area of
	   the site. For the rest of these comments, I'll be calling
	   the admin part of your module the "Admin Panel" for
	   want of a better term.
	  ---------------------------------------------------------*/
	function HasAdmin()
	{
		return true;
	}


	/*---------------------------------------------------------
	   GetAdminSection()
	   If your module has an Admin Panel, you can specify
	   which Admin Section (or top-level Admin Menu) it shows
	   up in. This method returns a string to specify that
	   section. Valid return values are:

	   main        - the Main menu tab.
	   content     - the Content menu
	   layout      - the Layout menu
	   usersgroups - the Users and Groups menu
	   extensions  - the Extensions menu (this is the default)
	   siteadmin   - the Site Admin menu
	   viewsite    - the View Site menu tab
	   logout      - the Logout menu tab
	   
	   Note that if you place your module in the main,
	   viewsite, or logout sections, it will show up in the
	   menus, but will not be visible in any top-level
	   section pages.
	  ---------------------------------------------------------*/
	function GetAdminSection()
	{
		return 'extensions';
	}
action.defaultadmin.php is called when the admin page is accessed.