HOW TO create new page and add a link to menu in Admin Panel

Talk and info about common issues

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

administrator
Site Admin
Site Admin
Posts: 5990
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO create new page and add a link to menu in Admin Panel

Postby administrator » Feb 29th, '12, 08:19

Below is described a process of creating new page and adding a links to menu in Administrator Panel.

1. Create a new PHP file, call it for example "my_file.php" and place it in admin/ directory.

2. Here the code template for your file in Admin Panel:

Code: Select all

<?
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
if($objLogin->IsLoggedInAsAdmin(){
     
     // ... your code is here!....
 
}else{
   draw_important_message(_NOT_AUTHORIZED);
}
?>


3. Open include/classes/Login.class.php file and find there DrawLoginLinks() method.
Add in appropriate place your own link in following format:

Code: Select all

echo '<li>'.$this->PrepareLink('my_file', 'This is My File').'</li>';

Return to “ApPHP MicroCMS {HOW TO}”