how to add menu in admin Panel?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
mdennisa

how to add menu in admin Panel?

Post by mdennisa »

I have created a separated site using php. Let's say property.php

then, I want to add menu in the admin panel that will direct the user into property.php

so far..., I have inserted additional code in \lib\classes\class.admintheme.inc.php

here's the code :

Code: Select all

   function PopulateAdminNavigation($subtitle='')
    {
        if (count($this->menuItems) > 0)
            {
            // we have already created the list
            return;
            }
        $this->subtitle = $subtitle;
    	    
    	$this->menuItems = array(
    	    // base main menu ---------------------------------------------------------
            'main'=>array('url'=>'index.php','parent'=>-1,
                    'title'=>$this->FixSpaces(lang('main')),
                    'description'=>'','show_in_menu'=>true),
	    'home'=>array('url'=>'home.php','parent'=>'main',
		    'title'=>$this->FixSpaces(lang('home')),
                    'description'=>'','show_in_menu'=>true),
            // base content menu ---------------------------------------------------------
            'content'=>array('url'=>'topcontent.php','parent'=>-1,
                    'title'=>$this->FixSpaces(lang('content')),
                    'description'=>lang('contentdescription'),'show_in_menu'=>$this->HasPerm('contentPerms')),
            'pages'=>array('url'=>'listcontent.php','parent'=>'content',
                    'title'=>$this->FixSpaces(lang('pages')),
                    'description'=>lang('pagesdescription'),'show_in_menu'=>$this->HasPerm('pagePerms')),

// here is my code  ----------------------------------------------------------------------------------------------------------------------------------------------
             'property'=>array('url'=>'property.php?log=y','parent'=>-1,
                    'title'=>$this->FixSpaces(lang('property')),
                    'description'=>'','show_in_menu'=>true),

what I got in admin menu was :

-- Add Me - property --

the menu also displayed in the admin main page, but it has no icon.

what i want to do is :
1. to fix the menu text, so it doesn't have to display "-- Add Me - ... --", only the name "Property"
2. how to assign icon to the menu "Property" ?

I have tried some search but didn't find what i want.
You can also refer me to older post if there was explanation about this or related to this problems.

thanks.
cyberman

Re: how to add menu in admin Panel?

Post by cyberman »

If you read everywhere "-- Add Me --" CMSms tells you that a string is missed.

So you have to add a string like this

$lang['admin']['property'] = 'Property';

to your lang file in admin folder.
Post Reply

Return to “Developers Discussion”