Contributions
AJAX Attribute Manager for 2.3
This is a rewrite for AJAX attribute manager for 2.3.1
It's based on AJAX attribute manager v2.8.6 but added a sort option.
Basicly it sorts the way you sort your values in admin.
G
Expand All / Collapse All
I got a problem with languages working at my localhost:
1-catalogadminattributeManagerlanguagesenglishattributeManager.php
1 line: <?
fixed to <?php
2-1-catalogadminattributeManagerattributeManager.php (file attached)
fixed these kind of declaratio: <?php=AM_AJAX_NAME?> to <?php echo AM_AJAX_NAME; ?>
V2: matta 16-Mar-2012
Updated Install.txt with previous changes from boschie 2-Apr-2011
Moved attributesManager folder to it's proper location (catalog/admin/attributesManager)
Updated attributeManager.js with version from toniroger 26-Jan-2012
Removed ampersands in attributeManagerincludesattributeManagerGeneralFunctions.inc.php (Gets rid of PHP 5.3 warning "Deprecated: Assigning the return value of new by reference is deprecated")
Full package with screenshot.
I've got a problem on the attributemanajer.js
The problem is that when i add a new option using the attribute manager on the catalog file, the div blackout not appear in the center of the plugin, instead appeats on the top of the page, and this not look fine.
to solve this i've got to change the function create_custom_prompt() to this
function createCustomPrompt() {
var attributeManager = getElement("attributeManager");
var attributeManagerX = findPosX(attributeManager);
var attributeManagerY = findPosY(attributeManager);
var attributeManagerW = attributeManager.scrollWidth;
var attributeManagerH = attributeManager.scrollHeight;
// cover the attribute manager with a semi tranparent div
newBit = attributeManager.appendChild(document.createElement("div"));
newBit.id = "blackout";
newBit.style.height = attributeManagerH + 'px';
newBit.style.width = attributeManagerW + 'px';
newBit.style.left += attributeManagerX + 'px';
newBit.style.top += attributeManagerY + 'px';
// hide select boxes (for IE)
showHideSelectBoxes('hidden');
// create a popup shaddow
popupShaddow = attributeManager.appendChild(document.createElement("div"));
popupShaddow.id = "popupShaddow";
// create the contents div
popupContents = attributeManager.appendChild(document.createElement("div"));
popupContents.id = "popupContents";
// put the ajax reqest text in the box
popupContents.innerHTML = amRequester.getText();
// work out the center postion for the box
leftPos = (((attributeManagerW - popupContents.scrollWidth) / 2) + attributeManagerX);
topPos = (((attributeManagerH - popupContents.scrollHeight) / 2) + attributeManagerY);
// position the box
popupContents.style.left = leftPos + 'px';
popupContents.style.top = topPos + 'px';
// size the shadow
popupShaddow.style.width = popupContents.scrollWidth + 'px';
popupShaddow.style.height = popupContents.scrollHeight + 'px';
// position the shadow
popupShaddow.style.left = leftPos+6 + 'px';
popupShaddow.style.top = topPos+6 + 'px';
// if the form has any inputs focus on the first one
if(inputs == popupContents.getElementsByTagName("input"))
inputs[0].focus();
return false;
}
the real change is to add to all nodes that change style.left, top, width and height, add + 'px'
i've upload only the javascript file.
Sorry for my English!!
Where it is said:
->
The <body> tag is also in the same file as above. Just add the new onload as the <body> tag is empty in 2.3.1
onload="SetFocus();"
Replace With
onload="goOnLoad();"
<-
It means:
You need to add it to the body around line 45 in adminincludestemplate_php.top like so: <body onload="goOnLoad();">.
Thanks go to hughesca.
This is a rewrite for AJAX attribute manager for 2.3.1
It's based on AJAX attribute manager v2.8.6 but added a sort option.
Basicly it sorts the way you sort your values in admin.
G
Note: Contributions are used at own risk.