Create a new Zen Cart admin page

September 6, 2007 by hejian

Create a new Zen Cart admin page is more easy than create a new Zen Cart front page:

1. gvim admin/PAGENAME.php

<?php
require('includes/application_top.php');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
</head>
<body onload="init()">
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="100%" valign="top">
<div class="pageHeading"><?php echo HEADING_TITLE; ?></div>
......
</td>
</tr>
</table>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

2. gvim admin/includes/languages/english/extra_definitions/PAGENAME.php

define('HEADING_TITLE', '......');
......

3. gvim admin/includes/extra_datafiles/PAGENAME_filenames.php
add this line:

define('FILENAME_PAGENAME', 'PAGENAME');

4. gvim admin/includes/extra_datafiles/PAGENAME.php

define('BOX_XXX_PAGENAME', '......');

5. Add the new page to admin menu
gvim admin/includes/boxes/extra_boxes/PAGENAME_xxx_dhtml.php

<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$options = array( array('box' => BOX_XXX_PAGENAME, 'page' => FILENAME_PAGENAME)
);
foreach ($options as $key => $value)
if (page_allowed($value['page'])==’true’) $za_contents[] = array(’text’ => $value['box'], ‘link’ => zen_href_link($value['page'], ”, ‘NONSSL’));
?>

Leave a Reply

You must be logged in to post a comment.

Wordpress template made by HeJian