Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4024/maple/aim/admin
Modified Files:
Tag: aim-xml
CompileSubject.mpl Register.mpl SourceFile.mpl Student.mpl
Subject.mpl
Log Message:
Index: Subject.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Subject.mpl,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -C2 -d -r1.5.4.1 -r1.5.4.2
*** Subject.mpl 7 Oct 2004 11:50:27 -0000 1.5.4.1
--- Subject.mpl 10 Mar 2005 21:13:55 -0000 1.5.4.2
***************
*** 530,539 ****
fi;
- # The field 'GuestsAllowed' is new, so might not be set.
- # TODO: a more systematic approach to this.
- if not(type([subject['GuestsAllowed']],[string])) then
- subject['GuestsAllowed'] := "no";
- fi;
-
page['Title'] := cat(__("Subject:"),subject['Name']);
--- 530,533 ----
Index: SourceFile.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/SourceFile.mpl,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** SourceFile.mpl 25 Sep 2003 19:01:15 -0000 1.5
--- SourceFile.mpl 10 Mar 2005 21:13:55 -0000 1.5.2.1
***************
*** 296,300 ****
fi;
! questions := traperror(`aim/Compile`(fulldir,srcfile));
if quiz <> NULL then
--- 296,300 ----
fi;
! questions := traperror(`aim/CompileFile`(fulldir,srcfile));
if quiz <> NULL then
Index: Register.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Register.mpl,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -C2 -d -r1.3 -r1.3.6.1
*** Register.mpl 25 Aug 2003 21:47:19 -0000 1.3
--- Register.mpl 10 Mar 2005 21:13:55 -0000 1.3.6.1
***************
*** 31,36 ****
--- 31,43 ----
['Parameter',"EmailToAll"::boolean = false],
+ ['Parameter',"PhotoURLFormat" = ""],
+ ['Parameter',"PhotoWidth"::integer = 100],
+ ['Parameter',"PhotoHeight"::integer = 120],
+ ['Parameter',"RecordsURLFormat" = ""],
+ ['Parameter',"EmailFormat" = ""],
+
['Parameter',
"Action"::{"LoadRegister",
+ "SaveOptions",
"UploadRegister",
"UpMergeRegister",
***************
*** 49,52 ****
--- 56,63 ----
['LinkText' = __("Reload")]],
+ ['Action',"SaveOptions",
+ "Save the register options to disk.",
+ ['LinkText' = __("Save options")]],
+
['Action',"UploadRegister",
"Load the register from a text file.",
***************
*** 164,180 ****
[["table","width" = "100%"],
["tr",
! [["td","width" = "16%"],`HTML/CloseButton`],
! [["td","width" = "16%"],
[["a", "href" = "#bottom"],__("Bottom")]],
! [["td","width" = "17%"],{["LoadRegister"]}],
! [["td","width" = "16%"],
[["a", "href" = "#AddStudent"],__("Add student")]],
! [["td","width" = "16%"],
[["a", "href" = "#FindStudent"],__("Find student")]],
! [["td","width" = "16%"],
[["a", "href" = "#StudentList"],__("Student list")]]]],
[["hr", "noshade"]],
##########
["h2",__("Uploads and downloads")],
--- 175,244 ----
[["table","width" = "100%"],
["tr",
! [["td","width" = "14%"],`HTML/CloseButton`],
! [["td","width" = "14%"],
[["a", "href" = "#bottom"],__("Bottom")]],
! [["td","width" = "15%"],{["LoadRegister"]}],
! [["td","width" = "15%"],{["SaveOptions"]}],
! [["td","width" = "14%"],
[["a", "href" = "#AddStudent"],__("Add student")]],
! [["td","width" = "14%"],
[["a", "href" = "#FindStudent"],__("Find student")]],
! [["td","width" = "14%"],
[["a", "href" = "#StudentList"],__("Student list")]]]],
[["hr", "noshade"]],
##########
+
+ [["a", "name" = "Options"],["h2",__("Options")]],
+ ["br"],
+ ["table",
+ ["tr",
+ [["td","colspan" = 3],
+ __("#Explain photos")
+ ]],
+ ["tr",
+ ["td", ["b",__("Photo URL format")]],
+ [["td","colspan"=2],
+ [["inputtext","name"="PhotoURLFormat",
+ "value"={"PhotoURLFormat"},
+ "size" = 60]]]],
+ ["tr",
+ ["td", ["b",__("Photo size")]],
+ ["td",
+ __("Width = "),
+ [["inputtext","name"="PhotoWidth",
+ "value"={"PhotoWidth"},
+ "size" = 10]],
+ " ", __("pixels")],
+ ["td",
+ __("Height = "),
+ [["inputtext","name"="PhotoHeight",
+ "value"={"PhotoHeight"},
+ "size" = 10]],
+ " ", __("pixels")]],
+ ["tr",
+ [["td","colspan" = 3],
+ __("#Explain central records")
+ ]],
+ ["tr",
+ ["td", ["b",__("Records URL format")]],
+ [["td","colspan"=2],
+ [["inputtext","name"="RecordsURLFormat",
+ "value"={"RecordsURLFormat"},
+ "size" = 60]]]],
+ ["tr",
+ [["td","colspan" = 3],
+ __("#Explain email format")
+ ]],
+ ["tr",
+ ["td", ["b",__("Email format")]],
+ [["td","colspan"=2],
+ [["inputtext","name"="EmailFormat",
+ "value"={"EmailFormat"},
+ "size" = 50]]]]
+ ],
+ [["hr", "noshade"]],
+
+ ##########
["h2",__("Uploads and downloads")],
***************
*** 308,313 ****
['Process',
proc(page::`aim/admin/Page`,p::table)
! local subject,pagetitle,regfile,register,action,textfile,err,
! selected,i,backup,id,s,studentline,studentlist,studenttable;
global AimCache;
--- 372,378 ----
['Process',
proc(page::`aim/admin/Page`,p::table)
! local subject,pagetitle,regfile,register,action,textfile,err,email,
! selected,i,backup,id,s,studentline,studentlist,studenttable,
! n,w;
global AimCache;
***************
*** 326,329 ****
--- 391,405 ----
action := p["Action"];
+ if action <> "LoadRegister" then
+ page['SetTable',
+ register,
+ 'PhotoURLFormat'::string,
+ 'PhotoWidth'::integer,
+ 'PhotoHeight'::integer,
+ 'RecordsURLFormat'::string,
+ 'EmailFormat'::string
+ ];
+ fi;
+
# Extract the list of selected students.
selected := NULL;
***************
*** 404,407 ****
--- 480,490 ----
s['EmailAddress'] := p["NewStudentEmailAddress"];
s['Password'] := p["NewStudentPassword"];
+ if s['EmailAddress'] = "" and
+ register['EmailFormat'] <> "" then
+ try
+ s['EmailAddress'] := sprintf(register['EmailFormat'],s['ID']);
+ catch:
+ end try
+ fi;
if s['ID'] = "" then
page['SetError',__("ID for new student must not be empty.")];
***************
*** 432,436 ****
studentline :=
! proc(s,pg,sl)
cat("<tr>\n",
"<td><input type='checkbox' name='",s['ID'],"Selected'",
--- 515,539 ----
studentline :=
! proc(s,pg,sl,ruf,puf)
! local rct,pht;
!
! if (ruf <> "") then
! rct :=
! sprintf("<td><a href=\"%s\" target=\"records\">%s</a></td>\n",
! sprintf(ruf,s['ID']),
! __("Records"));
! else
! rct := "";
! fi;
!
! if (puf <> "") then
! pht :=
! sprintf("<td><a href=\"%s\" target=\"records\">%s</a></td>\n",
! sprintf(puf,s['ID']),
! __("Photo"));
! else
! pht := "";
! fi;
!
cat("<tr>\n",
"<td><input type='checkbox' name='",s['ID'],"Selected'",
***************
*** 441,444 ****
--- 544,548 ----
# "<td>",pg['ActionLink',"EmailStudent", [s['ID']]],"</td>\n",
"<td>",s['EmailLink'],"</td>\n",
+ rct,pht,
"<td>",pg['ActionLink',"EditStudent", [s['ID']]],"</td>\n",
"<td>",pg['ActionLink',"ReviewStudent",[s['ID']]],"</td>\n",
***************
*** 452,455 ****
--- 556,564 ----
register['ListByName'],
register['ListByID']);
+
+ n := 5 + `if`(register['PhotoURLFormat'] = "",0,1) +
+ `if`(register['RecordsURLFormat'] = "",0,1);
+
+ w := round(50/n);
studenttable :=
***************
*** 460,475 ****
"<th width='10%' align='left'>",__("ID"),"</th>",
"<th width='35%' align='left'>",__("Name"),"</th>",
! "<th width='10%'> </th>",
! "<th width='10%'> </th>",
! "<th width='10%'> </th>",
! "<th width='10%'> </th>",
! "<th width='10%'> </th>",
"</tr>\n",
! op(map(studentline,studentlist,page,selected)),
! "</table>\n<br/>\n");
page['Title'] :=
cat(__("Register:"),subject['Name']);
page['FillTemplate',
"Title" = pagetitle,
--- 569,588 ----
"<th width='10%' align='left'>",__("ID"),"</th>",
"<th width='35%' align='left'>",__("Name"),"</th>",
! sprintf("<th width='%d%%'> </th>",w)$n,
"</tr>\n",
! op(map(studentline,studentlist,page,selected,
! register['RecordsURLFormat'],
! register['PhotoURLFormat'])),
! "</table>\n<br/>\n"
! );
page['Title'] :=
cat(__("Register:"),subject['Name']);
+ page['FillFromTable',register,
+ 'PhotoURLFormat','PhotoWidth','PhotoHeight',
+ 'RecordsURLFormat','EmailFormat'
+ ];
+
page['FillTemplate',
"Title" = pagetitle,
Index: CompileSubject.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/CompileSubject.mpl,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** CompileSubject.mpl 7 Sep 2003 09:37:52 -0000 1.2
--- CompileSubject.mpl 10 Mar 2005 21:13:55 -0000 1.2.4.1
***************
*** 97,101 ****
for srcfile in filelist do
! questions := traperror(`aim/Compile`(srcdir,srcfile));
if questions = lasterror or not type(questions,list) then
--- 97,101 ----
for srcfile in filelist do
! questions := traperror(`aim/CompileFile`(srcdir,srcfile));
if questions = lasterror or not type(questions,list) then
Index: Student.mpl
===================================================================
RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/admin/Student.mpl,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -C2 -d -r1.3 -r1.3.6.1
*** Student.mpl 25 Aug 2003 21:47:19 -0000 1.3
--- Student.mpl 10 Mar 2005 21:13:55 -0000 1.3.6.1
***************
*** 101,125 ****
["table",
["tr",
- ["td", ["b",__("ID")]],
- ["td", {"StudentID"}]],
- ["tr",
- ["td",["b",__("First name")]],
- ["td",
- [["inputtext","name" = "StudentFirstName",
- "value" = {"StudentFirstName"},
- "size" = 50]]]],
- ["tr",
- ["td",["b",__("Surname")]],
- ["td",
- [["inputtext","name" = "StudentSurname",
- "value" = {"StudentSurname"},
- "size" = 50]]]],
- ["tr",
- ["td",["b",__("Email address")]],
["td",
! [["inputtext","name" = "StudentEmailAddress",
! "value" = {"StudentEmailAddress"},
! "size" = 50]]]],
! {"passwordrow"}],
[["inputhidden", "name" = "StudentID", "value" = {"StudentID"}]],
[["hr", "noshade"]],
--- 101,129 ----
["table",
["tr",
["td",
! ["table",
! ["tr",
! ["td", ["b",__("ID")]],
! ["td", {"StudentID"}]],
! ["tr",
! ["td",["b",__("First name")]],
! ["td",
! [["inputtext","name" = "StudentFirstName",
! "value" = {"StudentFirstName"},
! "size" = 50]]]],
! ["tr",
! ["td",["b",__("Surname")]],
! ["td",
! [["inputtext","name" = "StudentSurname",
! "value" = {"StudentSurname"},
! "size" = 50]]]],
! ["tr",
! ["td",["b",__("Email address")]],
! ["td",
! [["inputtext","name" = "StudentEmailAddress",
! "value" = {"StudentEmailAddress"},
! "size" = 50]]]],
! {"passwordrow"}],
! ["td",{"image"}]]]],
[["inputhidden", "name" = "StudentID", "value" = {"StudentID"}]],
[["hr", "noshade"]],
***************
*** 133,137 ****
proc(page::`aim/admin/Page`,p::table)
local action,subject,register,r,status,matches,student,w,id,
! passwordrow,passwordacts,sendemail;
action := p["Action"];
--- 137,141 ----
proc(page::`aim/admin/Page`,p::table)
local action,subject,register,r,status,matches,student,w,id,
! passwordrow,passwordacts,sendemail,image;
action := p["Action"];
***************
*** 283,286 ****
--- 287,302 ----
fi;
+ if register['PhotoURLFormat'] <> "" then
+ image :=
+ sprintf(
+ "<img src='%s' width='%d' height='%d' alt='Photo of %s'/>\n",
+ sprintf(register['PhotoURLFormat'],student['ID']),
+ register['PhotoWidth'],register['PhotoHeight'],
+ student['Name']
+ );
+ else
+ image := "";
+ fi;
+
page['Title'] :=
cat(__("Student:"),subject['Name'],":",student['Surname']);
***************
*** 294,298 ****
"sendemail" = student['EmailLink'],
"passwordrow" = passwordrow,
! "passwordacts" = passwordacts
];
--- 310,315 ----
"sendemail" = student['EmailLink'],
"passwordrow" = passwordrow,
! "passwordacts" = passwordacts,
! "image" = image
];
|