home *** CD-ROM | disk | FTP | other *** search
- //
- // Date Last Modified: June 26th, 2007
- //
- // Modified By: Kelsenellenelvian
- //
-
-
- function program(idx)
- {
- position="program.js";
- whatfunc="program()";
-
- var i = '' + ((ordr[idx]==null) ? (idx+900000) : ordr[idx][0]);
-
- while (i.length<6)
- i = "0" + i;
-
- this.prog = prog[idx];
- this.ordr = [i];
- this.desc = desc[idx];
- this.uid = uid[idx];
- this.dflt = (dflt[idx]==null) ? ['no'] : [dflt[idx][0]] ;
- this.cat = cat[idx];
- this.forc = forc[idx];
- this.configs=(configs[idx]==null) ? [''] : [configs[idx][0]];
- this.deps = deps[idx];
- this.excl = excl[idx];
- this.cond = cond[idx];
- this.gcond = gcond[idx];
- this.regb = regb[idx];
- this.cmd1 = cmd1[idx];
- this.cmd2 = cmd2[idx];
- this.cmd3 = cmd3[idx];
- this.cmd4 = cmd4[idx];
- this.cmd5 = cmd5[idx];
- this.cmd6 = cmd6[idx];
- this.cmd7 = cmd7[idx];
- this.cmd8 = cmd8[idx];
- this.cmd9 = cmd9[idx];
- this.cmd10 = cmd10[idx];
- this.rega = rega[idx];
- this.picf = picf[idx];
- this.picw = picw[idx];
- this.pich = pich[idx];
- this.textl= textl[idx];
-
- this.success = success[idx];
- this.fail = fail[idx];
- }
-
-
- function WriteBackPrograms(programs)
- {
- position="program.js";
- whatfunc="WriteBackPrograms()";
-
- for (var i=0; i<programs.length; i++)
- {
- if (IndentText)
- textindent =' ';
- else
- textindent ='';
-
- if (programs[i].picf != null)
- {
- if (programs[i].textl != "Top")
- {
- if (programs[i].textl != "Bottom")
- {
- pwidth=programs[i].picw;
- pheight=programs[i].pich;
- textloc=programs[i].textl;
- desc[i+1]=imagelocationlr + programs[i].picf + imagepart2lr + pwidth + imagepart3lr + pheight + imagepart4lr + textloc + imagepart5lr + textindent + programs[i].desc;
- }
- }
-
- if (programs[i].textl != "Left")
- {
- if (programs[i].textl != "Right")
- {
- if (programs[i].textl != "Bottom")
- {
- pwidth=programs[i].picw;
- pheight=programs[i].pich;
- textloc=programs[i].textl;
- desc[i+1]=textindent + programs[i].desc + imagepart1t + imagelocationtb + programs[i].picf + imagepart2tb + pwidth + imagepart3tb + pheight + imagepart4tb;
- }
- else
- {
- pwidth=programs[i].picw;
- pheight=programs[i].pich;
- textloc=programs[i].textl;
- desc[i+1]=imagelocationtb + programs[i].picf + imagepart2tb + pwidth + imagepart3tb + pheight + imagepart4tb + imagepart1b + imageparteb + textindent + programs[i].desc;
- }
- }
- }
-
- }
- else
- desc[i+1]=textindent + programs[i].desc;
-
- prog[i+1]=programs[i].prog;
- ordr[i+1]=programs[i].ordr;
- uid[i+1]=programs[i].uid;
- dflt[i+1]=programs[i].dflt;
- cat[i+1]=programs[i].cat;
- forc[i+1]=programs[i].forc;
- configs[i+1]=programs[i].configs;
- deps[i+1]=programs[i].deps;
- excl[i+1]=programs[i].excl;
- cond[i+1]=programs[i].cond;
- gcond[i+1]=programs[i].gcond;
- regb[i+1]=programs[i].regb;
- cmd1[i+1]=programs[i].cmd1;
- cmd2[i+1]=programs[i].cmd2;
- cmd3[i+1]=programs[i].cmd3;
- cmd4[i+1]=programs[i].cmd4;
- cmd5[i+1]=programs[i].cmd5;
- cmd6[i+1]=programs[i].cmd6;
- cmd7[i+1]=programs[i].cmd7;
- cmd8[i+1]=programs[i].cmd8;
- cmd9[i+1]=programs[i].cmd9;
- cmd10[i+1]=programs[i].cmd10;
- rega[i+1]=programs[i].rega;
- picf[i+1]=programs[i].picf;
- picw[i+1]=programs[i].picw;
- pich[i+1]=programs[i].pich;
- textl[i+1]=programs[i].text1;
- }
-
- prog[programs.length+1]=null;
- }
-
-
- function SortByCat(a, b)
- {
- position="program.js";
- whatfunc="SortByCat()";
-
- var x = a.cat;
- var y = b.cat;
-
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
- }
-
-
- function SortByOrdr(a, b)
- {
- position="program.js";
- whatfunc="SortByOrder()";
-
- var x = a.ordr;
- var y = b.ordr;
-
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
- }
-
-
- function SortByProg(a, b)
- {
- position="program.js";
- whatfunc="SortByProg()";
-
- var x = a.prog[0].toLowerCase();
- var y = b.prog[0].toLowerCase();
-
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
- }
-
-
- function GetCats()
- {
- position="program.js";
- whatfunc="GetCats()";
-
- var cats = new Array();
- var oldcat, DefaultCat, i, j;
-
- if (SortOrder)
- cats=SortOrder;
-
- DefaultCat='Applications';
- oldcat='';
-
- for (i=1; prog[i] != null; i++)
- {
- if (cat[i]==null)
- cat[i]=[DefaultCat];
- if (cat[i][0]=='')
- cat[i][0] = DefaultCat;
- if (cat[i][0] != oldcat)
- {
- for (j=0; j<cats.length; j++)
- {
- if (cats[j]==cat[i][0])
- break;
- }
- if (j==cats.length)
- cats[cats.length++]=cat[i][0];
- }
- oldcat=cat[i][0];
- }
-
- return cats;
- }
-
-
- function SortPrograms()
- {
- position="program.js";
- whatfunc="SortPrograms()";
-
- var programs = new Array();
- var cats = new Array;
- var i, j, progspercat;
-
- cats = GetCats();
-
- // sort inside categories
- if (cats.length==0) //this is used to sort programs, if not even one category is given
- cats[cats.length++]='';
-
- for (j=0; j<cats.length; j++)
- {
- // get a category's apps into temporary array and sort it
- progspercat = new Array();
- for (i=1; prog[i] != null; i++)
- {
- if (cat[i][0] == cats[j])
- progspercat[progspercat.length++] = new program(i);
- }
- if (SortWithinCats)
- progspercat.sort(SortByProg);
-
- //append array to programs array
- for (i=0; i<progspercat.length; i++)
- programs[programs.length++]=progspercat[i];
- }
-
- //write back 'cause the rendering uses config.js's values
- WriteBackPrograms(programs);
- programs = null;
- cats = null;
- }
-
-
- function ProgsInCat(whichCat)
- {
- position="program.js";
- whatfunc="ProgsInCat()";
-
- var i, res;
-
- res = 0;
- for (i=1; prog[i]; i++)
- {
- if (cat[i] && cat[i]==whichCat)
- res++;
- }
-
- return res;
- }
-
-
- function CatsDefined()
- {
- position="program.js";
- whatfunc="CatsDefined()";
-
- for (var i=1; prog[i]; i++)
- {
- if (cat[i])
- return true;
- }
-
- return false;
- }
-
-
- function CheckCatIfAllChecked()
- {
- position="program.js";
- whatfunc="CheckCatIfAllSelected()";
-
- for (var i=1; i<prog.length; i++)
- checkCategory(i);
- }
-