function cSMBasketGUIColumn(id, caption){ this.styleHeader = new cSMStyleBox(); this.styleBody = new cSMStyleBox(); this.id = id; this.index = 0; this.product = null; this.caption = caption; this.gui = null; this.render = null; this.renderXML = null; }; function cSMBasketGUIFooterItem(id, caption){ this.styleCaption = new cSMStyleBox(); this.styleValue = new cSMStyleBox(); this.id = id; this.basket = null; this.caption = caption; this.gui = null; this.render = null; this.renderXML = null; this.cancel = false; }; function cSMBasketGUI(id){ this.id = id; this.hideColumnHeaders = false; this.base = new cSMBase(this.id); this.shop = SMShop; this.basket = this.shop.basket; this.columns = new Array(); this.footerItems = new Array(); this.styleTable = new cSMStyleBox(); // add as basket event member this.basket.base.addMember(this.id); }; cSMBasketGUI.prototype.addColumn = function(id, caption){ var c = new cSMBasketGUIColumn(id, caption); this.columns[this.columns.length] = c; c.gui = this; return(c); }; cSMBasketGUI.prototype.addFooterItem = function(id, caption){ var f = new cSMBasketGUIFooterItem(id, caption); this.footerItems[this.footerItems.length] = f; f.gui = this; return(f); }; cSMBasketGUI.prototype.render = function(){ var s = fc = "", xb = this.basket.xml, xc = null, p = null, c = null, f = null, tro = "", trc = "", tho = ""; // reset basket if another order has been previously completed with(this.basket.parent){ if(getAttribute(_SMAOComplete)=="true"){ reinitOrder(); }; }; // continue if(!this.hideColumnHeaders){ s += "" + tro; for(var i=0; i" + c.caption + thc; }; s += trc + ""; }; s += ""; if(xb.selectNodes(_SMPrd).length()==0){ s += tro + tdo + " colspan=\"" + this.columns.length + "\">"; s += "Ihr Warenkorb enthält keine Einträge, bitte legen Sie mindestens einen Artikel in den Warenkorb." + tdc + trc; } else{ for(var i=0; i" + c.render() + tdc; }; }; s += trc; }; }; s += ""; if(this.footerItems.length>0&&this.basket.getAttribute(_SMAItems)!="0"){ s += ""; for(var i=0; i"; fc += f.caption + tdc; cl = new Array(); if(i==0||!fset) cl[cl.length] = "first-item"; cl[cl.length] = "basket-summary"; fc += tdo + this.htAttrib("class", cl.join(" ")) + f.styleValue.createInlineCode() + " nowrap>"; if(f.render!=null) fc += f.render(); fc += tdc + trc; if(!f.cancel){ s += fc; fset = true; } else if(i==0) fset = false; }; s += ""; }; s += "
"; s += ""; xc = document.getElementById("basket-buttons"); if(xc) xc.style.display = ((xb.selectNodes(_SMPrd).length()!=0) ? "inline" : "none"); return(s); }; cSMBasketGUI.prototype.renderXML = function(){ var dom = new SXMLDom(), xc = p = c = f = xf = null; with(dom){ documentElement = createNode("SMBasketXML"); with(documentElement){ with(appendChild(dom.createNode("SMColumns"))){ for(var i=0; i