Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Convert ADMIN Addons from 2.2x to 2.3.x


Chadduck

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://www.oscommerce.com/forums/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

Link to comment
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
Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...