NYX.DiscoWriter=function(A,B){NYX.util.obj.extend(this,NYX.TemplateTool);this.idRoot=A;if(typeof template=="string"){this.template=template}else{template="@Nyx.PageTitle@"}this.discoLimit=99;this.untitledText="Untitled";this.unnamedSection="";this.categoryJoin=", ";this.DOM_TARGET_SUFFIX="dynamicContent";this.DOM_WAITMSG_SUFFIX="waitMsg";this.discoContent=[];this.prepareData=function(E){var D=this.flattenDaapiItem(E);if(typeof E.Categories=="object"){D.Categories="";for(var C=0;C<E.Categories.length;C++){D.Categories+=E.Categories[C].Name+this.categoryJoin}if(C>0){D.Categories=D.Categories.substring(0,D.Categories.length-this.categoryJoin.length)}}if(typeof D.PageTitle!="undefined"){if(NYX.util.string.isBlank(D.PageTitle)){D.PageTitle=this.untitledText}}if(E.Section==null){D.Section=this.unnamedSection}else{if(typeof E.Section!="undefined"){if(NYX.util.string.isBlank(E.Section.Name)){D.Section=this.unnamedSection}else{D.Section=E.Section.Name}}}return D};this.writeGui=function(D){this.discoContent=D;var I,F,G,E,H;H=this.getElem(this.DOM_TARGET_SUFFIX);this.initGui();G=this.discoContent.length<this.discoLimit?this.discoContent.length:this.discoLimit;for(F=0;F<G;F++){I=this.prepareData(this.discoContent[F]);E=this.processTemplate(I,this.template);E=this.customizeItem(I,E,H,F);H.innerHTML+=E}this.finishGui();H.style.display="";var C=this.getElem(this.DOM_WAITMSG_SUFFIX);if(C!=null){C.style.display="none"}};this.initGui=function(){return true};this.finishGui=function(){return true};this.customizeItem=function(C,E,F,D){return E}};
