View Single Post
  #2  
Old 05-23-2007, 02:22 PM
 
sithlord sithlord is offline
 

Member
  
Join Date: Aug 2005
Posts: 28
 

Thumbs up Re: How to add a new page to the admin?

I should have posted here sooner, since I figured it out within 15 minutes of asking how to do it

If anyone else wants to know here's how:

Create your php file in the admin folder -> xcart_dir/admin/file_name.php

PHP Code:
require "./auth.php";
require 
$xcart_dir."/include/security.php";

$location[] = array("New File Menu""");//bread crumb menu

$smarty->assign("main""file_name");//skin/single/home.tpl 


# Assign the current location line
$smarty->assign("location"$location);

@include 
$xcart_dir."/modules/gold_display.php";
func_display("admin/home.tpl",$smarty); 

Then make the template file under skin/admin/main/file_name.tpl

Code:
{include file="page_title.tpl" title="Page Title"} //additional smarty code...

Finally edit skin/single/home.tpl and add an elseif statement like so
Code:
{elseif $main eq "file_name"} {include file="admin/main/file_name.tpl"}

Of course add the link in the admin menus which I haven't done yet
__________________
Rishi-Tea.com
x-cart ver. 4.0.19
Reply With Quote