Jump to content
Chadduck

Convert ADMIN Addons from 2.2x to 2.3.x

Recommended Posts

I will attempt to explain what I am doing and what the problem is.

I am attempting to convert an existing ADMIN mod for Quickbooks from osC version 2.2 to 2.3.4. For the most part it works flawlessly. It does what it is supposed to do except one small irritating thing.

The mod creates what I will call a "sub-menuing" system. There is an file for the includes directory that creates php menu tabs on each page of the mod. Depending on the tab selected a "sub-menu" is supposed to drop down offering additional choices for that particular section.

There is a <mod>_styles.css included with required files. Following the suggestions provided here

http://forums.oscommerce.com/topic/368538-guide-to-converting-addons-from-22x-to-23x/

I have attempted to activate the styles css file.

I have at one time or another left it in the module page_top.php as

<link rel="stylesheet" type="text/css" href="includes/<mod>_styles.css">

I have tried it in template_top.php after </head> as

<link rel="stylesheet" type="text/css" href="includes/<mod>_styles.css">

I have tried it in template_top.php before </head> with

$head_tag .= '<link rel="stylesheet" type="text/css" href="includes/<mod>_styles.css">' . "\n";
$oscTemplate->addBlock( $head_tag, 'header_tags' );

In fact - it was while doing this one that I discovered that the new osCommerce uses the jQuery system and truthfully - I have no clue HOW that affects any of what I am doing.

Like I said - the UPDATED module DOES work with 2.3.4, the pages DO what they are supposed to do. I can (and reluctantly have) created individual section ADMIN menu boxes and could do away with the exisitng tabs. My reasoning for NOT wanting to do that is - People accustomed to using the module would find the menu boxes cumbersome and irritating.

So HOW can I incorporate the <mod>_styles.css ???

The specific osC v2.2 module is located here -http://addons.oscommerce.com/info/2847

BJ Chadduck

Share this post


Link to post
Share on other sites

First thank you for reply... I have discovered some things after posting the question.

 

The css is actually being read when placed in the module page_top.php as

<link rel="stylesheet" type="text/css" href="includes/<mod>_styles.css">

After posting I discovered that the css is NOT the problem - it is the php qualifying statement in the tab file itself.  Time to break out the php5 books... gotta figure out what is wrong with this section of code

 

  foreach($menuarray as $menulabel=>$menuurl) {
    $x++;
((isset($submenuarray[$x]) AND in_array($PHP_SELF,$submenuarray[$x])) OR $PHP_SELF==$menuurl) ? $e=1 : $e=0;
    echo '<li';
    echo ($e==0) ? ' class="inactive"><a href="'.$menuurl.'">' : ' class="active"><a href="'.$menuurl.'" id="current">';
(there is more code to complete the above sequence BUT the problem statement is the isset part)
 

The TRUE problem revolves around the "isset" statement. It ALWAYS returns false so none of the tabs ever show they active.

Edited by Chadduck

Share this post


Link to post
Share on other sites

The osCommerce 2.3 series included some fixes to $PHP_SELF, so it may no longer be matching the array values.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Jim

 

Thanks for that tidbit.  Is there a place in the documentation I can review WHAT the fixes were?

 

BJ

Share this post


Link to post
Share on other sites

The details are not well documented. I would just print out the values of all the variables and see what they look like. Or just give up and convert the tabs to jQuery tabs.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

That's where I learned jQuery.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I would have one if they did. I didn't start out knowing how to do this.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×