Forums / Contribution-Writing Guidelines / Plugin Maintainers - Important details for Zen Cart 2.0.0

Plugin Maintainers - Important details for Zen Cart 2.0.0

Views: 5,261

Results 1 to 1 of 1
23 Jul 2023, 8:56 PM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Plugin Maintainers - Important details for Zen Cart 2.0.0

The files

admin/includes/menu.css
admin/includes/menu.js
admin/includes/stylesheet.css

will no longer be part of Zen Cart in some future release.

For details please see https://docs.zen-cart.com/dev/plugins/admin_head_content/

Please remove them from your contributions (as described on the FAQ page above) for Zen Cart 1.5.7 and above, or modify them as shown in the code fragment below, kindly provided by @lat9, if you wish your plugin to work in old and new versions of Zen Cart.

To identify sections of code in your contributions that need updating, look for lines like the following snippets (these are NOT complete code-sections to change, just key things to search for to identify where the changes need to be applied):

<link rel="stylesheet" href="includes/stylesheet.css">

and

<script src="includes/menu.js"></script>
<script src="includes/general.js"></script>
<script>
function init()
{
    cssjsmenu('navbar');

The following code can be used to replace the old loading. See the "docs" page linked above for more detail of what code this is replacing:

// -----
// This section provides compatibility to load the 'legacy' stylesheets and javascript formerly used 
// in Zen Cart versions prior to v2.0.0.  Here we determine the Zen Cart base version in use 
// to maintain the downwardly-compatible use of this module.
//
$admin_html_head_supported = ((PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR) >= '1.5.7');
$body_onload = ($admin_html_head_supported === true) ? '' : ' onload="init();"';
?>
<!doctype html>
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta charset="<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<?php
if ($admin_html_head_supported === true) {
    require DIR_WS_INCLUDES . 'admin_html_head.php';
} else {
?>
<link rel="stylesheet" href="includes/stylesheet.css">
<link rel="stylesheet" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script src="includes/menu.js"></script>
<script src="includes/general.js"></script>
<script>
function init()
{
    cssjsmenu('navbar');
    if (document.getElementById) {
        var kill = document.getElementById('hoverJS');
        kill.disabled = true;
    }
}
</script>
<?php
}
?>
</head>
<body<?php echo $body_onload; ?>>
    <?php require DIR_WS_INCLUDES . 'header.php'; ?>
<?php

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.