Jump to content

Recommended Posts

For osC-BS (pre-Gold through Edge) and/or Phoenix (*before* Admin Bootstrap)

I'm trying to make an Admin Dashboard Module that displays on top of the module stack, fills the full width of the screen, and the rest of the modules maintain the order and position they originally had ...

(before)

+------------------------------------+---------------------------------+

|                  A                     |                 B                   |

+------------------------------------+---------------------------------+

|                  C                     |                 D                   |

+------------------------------------+---------------------------------+

 

(after)

+-----------------------------------------------------------------------+

|                                     NEW                                   |

+------------------------------------+---------------------------------+

|                  A                     |                 B                   |

+------------------------------------+---------------------------------+

|                  C                     |                 D                   |

+------------------------------------+---------------------------------+

I can easily do this if I want to edit a core file, but I'm trying to avoid that ...

From what I can gather, dashboard modules default to 50% width. I've tried to over-ride that in the new module with this:

    function getOutput() {

      $output = '<tr width="100%">' .

      $output .= tep_draw_button(IMAGE_BUTTON_WHOS_ONLINE, 'person', tep_href_link('whos_online.php')) .
                 tep_draw_button(IMAGE_BUTTON_CUSTOMERS, 'person', tep_href_link('customers.php')) .
                 tep_draw_button(IMAGE_BUTTON_ORDERS, 'person', tep_href_link('orders.php')) .
                 tep_draw_button(IMAGE_BUTTON_ADD_CUSTOMER, 'person', tep_href_link('create_account.php')) .
                 tep_draw_button(IMAGE_BUTTON_ADD_ORDER, 'person', tep_href_link('create_order.php')) .
                 tep_draw_button(IMAGE_BUTTON_ORDERS, 'person', tep_href_link('orders.php')) .
                 tep_draw_button(IMAGE_BUTTON_ADD_CUSTOMER, 'person', tep_href_link('create_account.php')) .
                 tep_draw_button(IMAGE_BUTTON_ADD_ORDER, 'person', tep_href_link('create_order.php')) .

      $output .= '</td>';

      return $output;
    }

(ignore the multiple duplicate buttons, they are just for testing)

Yes, the <tr> and </td> don't match, but I've been trying to match up the rows and columns being generated in the HTML code. This sort of works, but does mess up the modules below it:

+-----------------------------------------------------------------------+

|                                     NEW                                   |

+------------------------------------+---------------------------------+

|                  A                     |             (empty)           |

+------------------------------------+---------------------------------+

|                  B                     |                 C                   |

+------------------------------------+---------------------------------+

|                  D                     |                                       |

+------------------------------------+---------------------------------+

@Dan Cole Any suggestions?

TIA

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@ArtcoInc  Sorry Malcolm I'm not going to be of much use to you on this.  My admin is still running on RC2.  I've made so many hacks to the core on the admin side of my shop over the years that I'm not sure where to start (not really) and it has a real low priority for me.

Dan

Share this post


Link to post
Share on other sites

@Dan Cole No problem. I just found the thread you started a long time ago (Dec 2016) working on dashboard modules, and hoped ...

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

I have those working and have prettied them up over the years and while they are all individual modules the routine to do accomplish that is hacked into the index page as I recall.  At some point I might rework them so they are of use in Phoenix, if and when I ever get the time to look at the admin side of my shop.  It certainly won't be anytime soon.

Dan

Share this post


Link to post
Share on other sites

That would not be possible with a core code change in old versions.  The old style page requires each module to be 50%, and this is done using a table, where the modules have no influence over the layout.  In effect, this type of coding is as old as the Ark as the "controller" is the page, not the modules.

Modules are saying:
Here's my Content

Page is saying:
Here's the slot where you are going.

In the recent update, I recoded the page and all the modules to give the modules control over the layout.

Modules are now saying:
Here's my content and here's my width.  Jump.

Page is now saying:
Yes Sir.  How high?


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites
50 minutes ago, burt said:

That would not be possible with a core code change in old versions.

Gary, I assume you mean withOUT a core code change?

Dan

Share this post


Link to post
Share on other sites

@burt @Dan Cole Thank you. I kind of assumed as much.

I was trying to re-create an old add-on that, with just two small core edits, gave a row of 'Quick Access' buttons across the top of the Admin screen. A 5 minute install ... 10 minutes tops. Instead, I spent the afternoon trying to see if I could do it without core changes.

It's not as if I'm apposed to core changes. Heck, I've hacked the core so much, it could (almost) qualify as an original work! But, it was an exercise to see what I could learn ...

Thanks guys!

M


Get the latest Responsive osCommerce CE (community edition) here .

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

×