Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] FAN - Faster Admin Navigation


Phliplip

Recommended Posts

This is the support thread for Faster Admin Navigation - FAN.

 

Contribution:

http://www.oscommerce.com/community/contributions,4875

 

Abstract:

This contribution aims to speed-up the general navigation in specific sections in the osCommerce admin.

 

-- Example: --

--------------

To speed-up the navigation through the categories and products in admin, this contribution add doubleclick functionality to the rows of categories and products.

 

Click on categories or products to se quick-info pane (normal behavior).

 

Double Click on categories to se content of category, same as clicking once to select category and clicking again once page is loaded.

 

Double Click on products to edit the product, note this is not same behavior as clicking once to select product and clicking again once page is loaded. Normal behavior for this action is to view the product information page.

--------------

 

I have tested it to work in both IE 6.0 and FF 1.5/2.0 - In Opera 9.0 it doesn't work at all.

 

Though ondblclick="" in theory shouldn't work at all, due to the onclick="" on the same element! So i have experienced, that the onclick was used instead of the ondblclick!

 

You could possibly fix it by delaying the onclick="", but then again. If the onclick is used, just click again on the selected item.

Edited by Phliplip
Link to comment
Share on other sites

Although this is a nice mod if you are using Admin Access you will not want to install this code without some custom coding.

 

The onclick feature will bypass the admin rights ... and people double clicking will be able to access or edit information they are not supposed to be able to.

 

You will need to create a second set of queries for non Top Level Admins.

 

can someone explain?

 

i use admin acess , so other admin will only able to see the right files and so use th double click feature only on those files , i m wrong ?

MS2

Link to comment
Share on other sites

also on my osc version i always have

$HTTP_GET_VARS

not

$_GET

 

can someoine give me an explanation , do i have to update all my

$HTTP_GET_VARS

to

$_GET

in my shop ?

Hey Azer, I don't use this contribution (yet) but your question deals with PHP 4 verses PHP 5 and Register Globals. If you are not changing to a new PHP server that would be running PHP 5, then NO, you do not need to change this code.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

I have released a corrected version, where $_GET is replaced with $HTTP_GET_VARS.

 

Another notice, from user insomniac2.

http://www.oscommerce.com/forums/index.php?showuser=87520

 

Posted on the contribution page!

-----

Although this is a nice mod if you are using Admin Access you will not want to install this code without some custom coding.

 

The onclick feature will bypass the admin rights ... and people double clicking will be able to access or edit information they are not supposed to be able to.

 

You will need to create a second set of queries for non Top Level Admins.

-----

 

For further notice, please post compability issues in the support thread.

 

Thank ;)

Link to comment
Share on other sites

Azer: I wasn't able to reply on you PM.

 

So here comes:

 

Hi Azer,

 

Thanks for the words :)

 

I have uploaded a corrected version, please enjoy :-"

 

Regarding your articles page.

 

I don't know that the first piece of code is supposed to do, but the last code looks familiar to the other changes i have done, so please commit the following.

 

------

 

Before:

 

onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id']) . '\'"

 

Add:

 

ondblclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id'] . '&action=edit) . '\'"

 

--

 

Before:

 

onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id'] . '&action=article_preview&read=only') . '\'"

 

Add:

 

ondblclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id'] . '&action=edit') . '\'"

 

------------------

 

I haven't installed this contrib, so this is done from the code in your message. Please check that 'edit' is the correct action for this contrib. If you want' normal behavior just replace 'action=edit' with 'action=article_preview&read=only' and then you don' need to commit the second change.

 

Hope it works, and please let me know where to find the articles contribution you are using.

 

Best regards,

Philip Espersen

 

 

wow amazing ,so much time saved, how did we all do before ? :blush:

 

i dont manage to use the same concept to change the articles page , from the same contrib name

 

 

if (isset($tInfo) && is_object($tInfo) && ($topics['topics_id'] == $tInfo->topics_id) ) {
	echo '			  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, tep_get_topic_path($topics['topics_id'])) . '\'">' . "\n";
  } else {
echo '			  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $topics['topics_id']) . '\'">' . "\n";
   }

 

then in another part of the file :

if (isset($aInfo) && is_object($aInfo) && ($articles['articles_id'] == $aInfo->articles_id) ) {
	echo '			  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id'] . '&action=article_preview&read=only') . '\'">' . "\n";
  } else {
	echo '			  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id']) . '\'">' . "\n";
		  }

 

any idea ?

Link to comment
Share on other sites

Couldn't agree more ;) BUT $HTTP_GET_VARS is the notation that i currently used in the latest official release (osCommerce 2.2 Milestone 2 Update 060817).

 

And therefore to hold the coding standard and best practise of that release, i've changed it back!

 

Using both $HTTP_GET_VARS and $_GET could possibly mess up osCommerce and other contribs.

 

Example:

 

-- test.php --

<?php

echo($HTTP_GET_VARS['foo']."<br>");

echo($_GET['foo']."<br>");

 

echo("<br>");

$_GET['foo'] = "MIA";

 

echo($HTTP_GET_VARS['foo']."<br>");

echo($_GET['foo']."<br>");

?>

----

 

GET request to test.php?foo=foobar will output following.

 

--

foobar

foobar

 

foobar

MIA

--

 

This is because $HTTP_GET_VARS and $_GET is 2 different arrays. And therefore $HTTP_GET_VARS don't reflect changes done to $_GET!

 

Why ??! $_GET is the way to go, not $HTTP_GET_VARS...
Link to comment
Share on other sites

there is a typo in

 

onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id']) . '\'" [code]

 

 

'&action=edit) . '\'" should be '&action=edit') . '\'" , the quote after edit !

 

 

but still it doenst work as you see , there are info for Topic like a category and Article , like a product

can i send you my whole file , if yes pm your mail

 

:rolleyes:

MS2

Link to comment
Share on other sites

there is a typo in

 

onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id']) . '\'" [code]

'&action=edit) . '\'" should be '&action=edit') . '\'" , the quote after edit !

but still it doenst work as you see , there are info for Topic like a category and Article , like a product

can i send you my whole file , if yes pm your mail

 

:rolleyes:

 

Hi Azer,

 

Please give me a link to the contribution, and i will have a look at it!

Link to comment
Share on other sites

Sorry took so long to reply to your question azer.

 

Yes I guess that does make sense to do the language bolding that way. I never thought of that.

 

 

As for the onmouseevent effecting Admin Access.

 

Basically some or most of the admin files have a command like 'action=edit' in the mouseevent section. I did a test and noticed that these commands were oeveriding Admin Access Rights .. because Admin Access only explains and has the code for controlling Admin Buttons like the Edit button in categories.php etc.

 

The current contribution code does not prevent the onmouseclick actions .. only the buttons .. unless you custom code like I have been slowly doing and I`ve taken out all the '&action=edit' etc. Now when someone doubleclicks on a line it does nothing for them. They have to use the Buttons.

 

Hope this makes some sense to you.

 

 

 

For bold just put the bold tags in the orderlist file or the language file .. around each heading you want in bold.

 

For example in the language file:

define('OL_CUSTOMERNAME', 'Customer Name:');

 

would be for bold:

define('OL_CUSTOMERNAME', '<b>Customer Name:'</b>);

yes i know that , but would be better to do it on the code page ot in the language , so if 5 language 5 times less work

 

would be maybe next release :-)

Link to comment
Share on other sites

  • 4 years later...

Hi forum readers!

 

I'm trying to install this contribution but my site has been modified so I'm not quite sure how to combine this instruction:

Before:

 

onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\'"

 

Add:

 

ondblclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product') . '\'"

 

 

Into this bit of modified code:

 

if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id) ) {

echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '\'">' . "\n";

 

I have tried, but I have limited php skills. Can anyone help?

 

Thanks in advance!

 

 

}

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.
Note: Your post will require moderator approval before it will be visible.

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...