Adding a page to the admin section

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Leav
Forum Members
Forum Members
Posts: 38
Joined: Fri Aug 11, 2006 8:26 pm

Adding a page to the admin section

Post 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!
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm
Location: the Netherlands

Re: Adding a page to the admin section

Post 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.
Post Reply

Return to “Modules/Add-Ons”