/** * @author Francesco */ function StandardModule() { this.open = false; this.mod = null; this.istanza = null; this.nome = null; this.init = function(mod, istanza, nome) { this.mod = parseInt(mod); this.istanza = istanza; this.nome = nome; } this.script_page = "modulo.php"; this.script_path = "include_amministrazione/php/"; this.setDefaults = function() { this.setTarget(getById("content")); this.setLoadingTarget(getById("content")); this.params["mod"] = this.mod; this.params["nome"] = this.nome; this.params["istanza"] = this.istanza; } this.close = function() { this.open = false; var html = " "; html += "" + this.nome + ""; getById("m" + this.istanza).innerHTML = html; } this.loadmenu = function() { if (this.open) this.close(); else { var html = ""; this.open = true; if (ListaUnici[this.mod] != true) { html = " "; html += "" + this.nome + ""; if (PIns[this.mod] == 1) html += "
Inserisci"; html += "
Visualizza"; } else html = " " + this.nome + ""; var cr = false; try { if (ListaRicerche[this.mod] instanceof Ricerche) { if (PRic[this.mod] == 1) { cr = true; html += "
Cerca
"; } } } catch (e) {} try { if (ListaCampi[this.mod] instanceof CampiDinamici) { if (PCampi[this.mod] == 1) { if (!cr) { html += "
"; cr = true; } html += "
Campi
"; } } } catch (e) {} try { if (ListaCategorie[this.mod] instanceof Categorie) { if (PCats[this.mod] == 1) { if (!cr) { html += "
"; cr = true; } html += "
Categorie
"; } } } catch (e) {} try { if (ListaCommenti[this.mod] instanceof Commenti) { if (!cr) { html += "
"; cr = true; } html += "
Commenti
"; } } catch (e) {} getById("m" + this.istanza).innerHTML = html; closeOtherMenus(this.istanza); } this.visualizza(); } this.getSelected = function(opt) { var selected = new Array(); var index = 0; for (var intLoop = 0; intLoop < opt.length; intLoop++) { if ((opt[intLoop].selected) || (opt[intLoop].checked)) { index = selected.length; selected[index] = new Object; selected[index].value = opt[intLoop].value; selected[index].index = intLoop; } } return selected; } //this.outputSelected(getById("gruppi_utente").options, "gu"); this.outputSelected = function(opt, p) { var sel = this.getSelected(opt); var strSel = ""; var cont = 0; for (var item in sel) { cont++; this.params[p + "_" + cont] = sel[item].value; } this.params["n_" + p] = cont; } } StandardModule.prototype = new AjaxModule(); StandardModule.prototype.constructor = StandardModule;