/[libdata]/trunk/admin/include/scribe_forms.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/admin/include/scribe_forms.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 71 by dpavlin, Thu Mar 4 22:43:50 2004 UTC revision 72 by dpavlin, Thu Mar 18 20:33:37 2004 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /**********************************************************  /**********************************************************
3  Function Library: scribeforms.php  Function Library: scribeforms.php
4  Original Author: Paul Bramscher <brams006@tc.umn.edu>  Original Author: Paul Bramscher <brams006@umn.edu>
5  Last Modified: 01.27.2004  Last Modified: 03.11.2004
6  ***********************************************************  ***********************************************************
7  Comments:  Comments:
8  This library brings together all of the edit forms on the  This library brings together all of the edit forms on the
# Line 32  formCourse Line 32  formCourse
32  formCoursePers  formCoursePers
33  formPageHeader  formPageHeader
34  pageTitleStyle  pageTitleStyle
 readButtons  
35  **********************************************************/  **********************************************************/
36    
37    
38  /**********************************************************  /**********************************************************
39  Function: addLabel  Function: addLabel
40  Author: Paul Bramscher  Author: Paul Bramscher
41  Last Modified: 06.23.2003  Last Modified: 03.11.2004
42  ***********************************************************  ***********************************************************
43  Purpose:  Purpose:
44  Collect values for title, description, and URL to add a  Collect values for title, description, and URL to add a
45  free-text or label type element on a PageScribe/CourseLib  free-text or label type element on a PageScribe/CourseLib
46  page.  page.
47  **********************************************************/  **********************************************************/
48  function addLabel($con, $place_array, $page_id) {  function addLabel($place_array, $page_id) {
49    
50          // Break apart place array          // Break apart place array
51          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 79  function addLabel($con, $place_array, $p Line 78  function addLabel($con, $place_array, $p
78          printf("<br>\n");                printf("<br>\n");      
79                    
80          // Description          // Description
81          printf("<BR><b>Description:</b><BR>");          printf("<BR><b>Description:</b><br>\n");
82          printf("<textarea rows=\"2\" cols=\"40\" name =\"element_descr\" >\n");          printf("<textarea rows=\"2\" cols=\"40\" name =\"element_descr\" >\n");
83          printf("</textarea><br>");          printf("</textarea><br>\n");
84                    
85          // URL          // URL
86          printf("<b>Wrap with URL:</b><BR>");          printf("<b>Wrap with URL:</b><br>\n");
87          printf("<input type = \"text\" name =\"label_url\" value =\"http://\" size=\"50\"><br><br>");          printf("<input type = \"text\" name =\"label_url\" value =\"http://\" size=\"50\"><br><br>\n");
88    
89          // Interior table          // Interior table
90          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");
# Line 94  function addLabel($con, $place_array, $p Line 93  function addLabel($con, $place_array, $p
93          printf("</td><td>\n");          printf("</td><td>\n");
94    
95          // Cancel button          // Cancel button
96          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
97                  $page_id, $position, $position);                  $page_id, $position, $position);
98          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
99          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 111  function addLabel($con, $place_array, $p Line 110  function addLabel($con, $place_array, $p
110  /**********************************************************  /**********************************************************
111  Function: addLoc  Function: addLoc
112  Author: Paul Bramscher  Author: Paul Bramscher
113  Last Modified: 06.23.2003  Last Modified: 03.11.2004
114  ***********************************************************  ***********************************************************
115  Purpose:  Purpose:
116  Select from the list of available location to add as an  Select from the list of available location to add as an
117  element to a PageScribe/CourseLib page.  element to a PageScribe/CourseLib page.
118  **********************************************************/  **********************************************************/
119  function addLoc($con, $place_array, $page_id) {  function addLoc($place_array, $page_id) {
120    
121          // Break apart place array          // Break apart place array
122          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 145  function addLoc($con, $place_array, $pag Line 144  function addLoc($con, $place_array, $pag
144                    
145          // Location drop-down          // Location drop-down
146          printf("<tr><td>\n");          printf("<tr><td>\n");
147          printf("<BR><b>Select Location:</b><BR>\n");          printf("<BR><b>Select Location:</b><br>\n");
148          printf("<select name =\"location_id\" size=\"5\" >\n");          printf("<select name =\"location_id\" size=\"5\" >\n");
149          dropDownFieldOmit($con, "location", "location", "location_id", " WHERE location_id > 1");          dropDownFieldOmit("location", "location", "location_id", " WHERE location_id > 1");
150          printf("</select><br><br>");          printf("</select><br><br>\n");
151    
152                    
153          // Interior table          // Interior table
# Line 158  function addLoc($con, $place_array, $pag Line 157  function addLoc($con, $place_array, $pag
157          printf("</td><td>\n");            printf("</td><td>\n");  
158                                    
159          // Cancel button          // Cancel button
160          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
161                  $page_id, $position, $position);                  $page_id, $position, $position);
162          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
163          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 175  function addLoc($con, $place_array, $pag Line 174  function addLoc($con, $place_array, $pag
174  /**********************************************************  /**********************************************************
175  Function: addRes  Function: addRes
176  Author: Paul Bramscher  Author: Paul Bramscher
177  Last Modified: 06.23.2003  Last Modified: 03.11.2004
178  ***********************************************************  ***********************************************************
179  Purpose:  Purpose:
180  Select from the list of available resources to add as  Select from the list of available resources to add as
181  an element to a PageScribe/CourseLib page.  an element to a PageScribe/CourseLib page.
182  **********************************************************/  **********************************************************/
183  function addRes($con, $feature_id, $letter, $limitstring, $masterinfotype_id, $place_array, $page_id) {  function addRes($feature_id, $letter, $limitstring, $masterinfotype_id, $place_array, $page_id) {
184    
185          // Default to letter A if nothing selected          // Default to letter A if nothing selected
186          if ($letter == "" && $limitstring == "" && $masterinfotype_id < 1 && $feature_id < 1) $letter = "A";          if ($letter == "" && $limitstring == "" && $masterinfotype_id < 1 && $feature_id < 1) $letter = "A";
# Line 214  function addRes($con, $feature_id, $lett Line 213  function addRes($con, $feature_id, $lett
213    
214          // User limited by masterinfotype, display it          // User limited by masterinfotype, display it
215          if ($masterinfotype_id > 0) {          if ($masterinfotype_id > 0) {
216                  $masterinfotype = lookupField($con, "masterinfotype", "masterinfotype_id", $masterinfotype_id, "masterinfotype");                  $masterinfotype = lookupField("masterinfotype", "masterinfotype_id", $masterinfotype_id, "masterinfotype");
217                  printf(" within <b>%s</b>\n", $masterinfotype);                  printf(" within <b>%s</b>\n", $masterinfotype);
218          }          }
219    
220          // User limited by feature, display it          // User limited by feature, display it
221          if ($feature_id > 0) {          if ($feature_id > 0) {
222                  $feature = lookupField($con, "feature", "feature_id", $feature_id, "feature");                  $feature = lookupField("feature", "feature_id", $feature_id, "feature");
223                  printf(" involving <b>%s</b>\n", $feature);                  printf(" involving <b>%s</b>\n", $feature);
224          }          }
225    
# Line 265  function addRes($con, $feature_id, $lett Line 264  function addRes($con, $feature_id, $lett
264          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);
265          printf("<input type = \"hidden\" name=\"this_pos\" value =\"%s\">\n", $position);                printf("<input type = \"hidden\" name=\"this_pos\" value =\"%s\">\n", $position);      
266          printf("<input type=\"text\" name=\"limitstring\" value =\"%s\" size =\"20\">\n", $limitstring);                          printf("<input type=\"text\" name=\"limitstring\" value =\"%s\" size =\"20\">\n", $limitstring);                
267          printf(" and/or<br>\n");          printf(" and/or ");
         printf("<b>Note:</b> This searches contiguous strings or words, no boolean functionality yet. ");  
268          printf("</td></tr>\n");          printf("</td></tr>\n");
269    
270    
# Line 274  function addRes($con, $feature_id, $lett Line 272  function addRes($con, $feature_id, $lett
272          printf("<tr><td class = \"cellPlain\" >Master Info Type:</td><td>\n");          printf("<tr><td class = \"cellPlain\" >Master Info Type:</td><td>\n");
273          printf("<select name = \"masterinfotype_id\">\n");          printf("<select name = \"masterinfotype_id\">\n");
274          printf("<option value=\"0\">All</option>\n");          printf("<option value=\"0\">All</option>\n");
275          dropDownFieldSelected($con, "masterinfotype", "masterinfotype", "masterinfotype_id", " WHERE masterinfotype_id > 1 ", $masterinfotype_id);          dropDownFieldSelected("masterinfotype", "masterinfotype", "masterinfotype_id", " WHERE masterinfotype_id > 1 ", $masterinfotype_id);
276          printf("</select>\n");          printf("</select>\n");
277          printf(" and/or</td></tr>\n");          printf(" and/or</td></tr>\n");
278    
# Line 283  function addRes($con, $feature_id, $lett Line 281  function addRes($con, $feature_id, $lett
281          printf("<tr><td class = \"cellPlain\" >Feature:</td><td>\n");          printf("<tr><td class = \"cellPlain\" >Feature:</td><td>\n");
282          printf("<select name = \"feature_id\">\n");          printf("<select name = \"feature_id\">\n");
283          printf("<option value=\"0\">All</option>\n");          printf("<option value=\"0\">All</option>\n");
284          dropDownFieldSelected($con, "feature", "feature", "feature_id", " WHERE feature_id > 1 ", $feature_id);          dropDownFieldSelected("feature", "feature", "feature_id", " WHERE feature_id > 1 ", $feature_id);
285          printf("</select>\n");          printf("</select>\n");
286          printf("<input type=\"submit\" value =\"Limit\"></form>\n");          printf("<input type=\"submit\" value =\"Limit\"></form>\n");
287          printf("</td></tr>\n");          printf("</td></tr>\n");
# Line 292  function addRes($con, $feature_id, $lett Line 290  function addRes($con, $feature_id, $lett
290          // The Add-Resource Box          // The Add-Resource Box
291          printf("<tr><td align=\"center\" colspan = \"2\" >\n");          printf("<tr><td align=\"center\" colspan = \"2\" >\n");
292          printf("<form method =\"POST\" action=\"scribe_transaction.phtml\" >\n");          printf("<form method =\"POST\" action=\"scribe_transaction.phtml\" >\n");
293          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">", $page_id);          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);
294          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">", $place_array_HTML);          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">\n", $place_array_HTML);      
295          printf("<input type = \"Hidden\" name = \"transaction\" value = \"insertScribeResource\" >");            printf("<input type = \"Hidden\" name = \"transaction\" value = \"insertScribeResource\" >\n");
296          printf("<b>Add a Resource</b><BR>\n");          printf("<b>Add a Resource</b><br>\n");
297          printf("<select name = \"resource_id\" size = \"5\" >\n");          printf("<select name = \"resource_id\" size = \"5\" >\n");
298    
299          // Determine any limits and draw the box          // Determine any limits and draw the box
300          if (strlen($letter) > 0 && $letter != "All") $limit = $letter;          if (strlen($letter) > 0 && $letter != "All") $limit = $letter;
301          if (strlen($limitstring) > 0) $limit = $limitstring;          if (strlen($limitstring) > 0) $limit = $limitstring;
302          dropDownResource($con, 0, $limit, $masterinfotype_id, $feature_id);          dropDownResource(0, $limit, $masterinfotype_id, $feature_id);
303          printf("</select><br>\n");          printf("</select><br>\n");
304                    
305          // Interior table          // Interior table
# Line 311  function addRes($con, $feature_id, $lett Line 309  function addRes($con, $feature_id, $lett
309          printf("</td><td>\n");            printf("</td><td>\n");  
310                    
311          // Cancel button          // Cancel button
312          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
313                  $page_id, $position, $position);                  $page_id, $position, $position);
314          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
315          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 326  function addRes($con, $feature_id, $lett Line 324  function addRes($con, $feature_id, $lett
324          printf("<a href=\"console.phtml\">Add New Resource</a>\n");          printf("<a href=\"console.phtml\">Add New Resource</a>\n");
325                    
326          // Close exterior table          // Close exterior table
327          printf("</td></tr></table><BR>\n");          printf("</td></tr></table><br>\n");
328  }  }
329    
330    
331  /**********************************************************  /**********************************************************
332  Function: addRQS  Function: addRQS
333  Author: Paul Bramscher  Author: Paul Bramscher
334  Last Modified: 06.23.2003  Last Modified: 03.11.2004
335  ***********************************************************  ***********************************************************
336  Purpose:  Purpose:
337  Select an RQS subject page to harvest (all elements).  This  Select an RQS subject page to harvest (all elements).  This
338  is contrasted with addRQSLink() which merely adds a link  is contrasted with addRQSLink() which merely adds a link
339  to it.  to it.
340  **********************************************************/  **********************************************************/
341  function addRQS($con, $place_array, $page_id) {  function addRQS($place_array, $page_id) {
342    
343          // Break apart place array          // Break apart place array
344          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 370  function addRQS($con, $place_array, $pag Line 368  function addRQS($con, $place_array, $pag
368          printf("<tr><td>\n");          printf("<tr><td>\n");
369          printf("<br><b>RQS Subject:</b><br>\n");          printf("<br><b>RQS Subject:</b><br>\n");
370          printf("<select name = \"subject_id\" size=\"10\">\n");          printf("<select name = \"subject_id\" size=\"10\">\n");
371          dropDownFieldOmit($con, "subject", "subject", "subject_id", "WHERE SUBJECT_ID > 1");          dropDownFieldOmit("subject", "subject", "subject_id", "WHERE SUBJECT_ID > 1");
372          printf("</select>\n");            printf("</select>\n");  
373                    
374          // Interior table          // Interior table
# Line 380  function addRQS($con, $place_array, $pag Line 378  function addRQS($con, $place_array, $pag
378          printf("</td><td>\n");          printf("</td><td>\n");
379    
380          // Cancel button          // Cancel button
381          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
382                  $page_id, $position, $position);                  $page_id, $position, $position);
383          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
384          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 397  function addRQS($con, $place_array, $pag Line 395  function addRQS($con, $place_array, $pag
395  /**********************************************************  /**********************************************************
396  Function: addRQSLink  Function: addRQSLink
397  Author: Paul Bramscher  Author: Paul Bramscher
398  Last Modified: 06.13.2003  Last Modified: 03.11.2004
399  ***********************************************************  ***********************************************************
400  Purpose:  Purpose:
401  Select from a list of RQS pages to add as a link element  Select from a list of RQS pages to add as a link element
402  on a PageScribe/CourseLib page.  on a PageScribe/CourseLib page.
403  **********************************************************/  **********************************************************/
404  function addRQSLink($con, $place_array, $page_id) {  function addRQSLink($place_array, $page_id) {
405    
406          // Break apart place array          // Break apart place array
407          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 433  function addRQSLink($con, $place_array, Line 431  function addRQSLink($con, $place_array,
431          printf("<tr><td>\n");          printf("<tr><td>\n");
432          printf("<br><b>RQS Subject:</b><br>\n");          printf("<br><b>RQS Subject:</b><br>\n");
433          printf("<select name = \"subject_id\" size=\"10\">\n");          printf("<select name = \"subject_id\" size=\"10\">\n");
434          dropDownFieldOmit($con, "subject", "subject", "subject_id", "WHERE SUBJECT_ID > 1");          dropDownFieldOmit("subject", "subject", "subject_id", "WHERE SUBJECT_ID > 1");
435          printf("</select>\n");            printf("</select>\n");  
436                    
437          // Interior table          // Interior table
# Line 443  function addRQSLink($con, $place_array, Line 441  function addRQSLink($con, $place_array,
441          printf("</td><td>\n");          printf("</td><td>\n");
442    
443          // Cancel button          // Cancel button
444          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
445                  $page_id, $position, $position);                  $page_id, $position, $position);
446          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
447          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 460  function addRQSLink($con, $place_array, Line 458  function addRQSLink($con, $place_array,
458  /**********************************************************  /**********************************************************
459  Function: addSelection  Function: addSelection
460  Author: Paul Bramscher  Author: Paul Bramscher
461  Last Modified: 06.25.2003  Last Modified: 03.11.2004
462  ***********************************************************  ***********************************************************
463  Purpose:  Purpose:
464  Select from a list of element types to add to a  Select from a list of element types to add to a
# Line 470  pastebuffer tables -- adding a new type Line 468  pastebuffer tables -- adding a new type
468  task.  All SQL which render Pagescribe/Courselib pages  task.  All SQL which render Pagescribe/Courselib pages
469  would need to be changed to add the new join criteria.  would need to be changed to add the new join criteria.
470  **********************************************************/  **********************************************************/
471  function addSelection($con, $place_array, $page_id) {  function addSelection($place_array, $page_id) {
472    
473          // Break apart place array          // Break apart place array
474          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 488  function addSelection($con, $place_array Line 486  function addSelection($con, $place_array
486          printf("</td></tr>\n");          printf("</td></tr>\n");
487    
488          // Element selection form          // Element selection form
489          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
490                  $page_id, $position, $position);                  $page_id, $position, $position);
491                                    
492          printf("<tr><td>\n");          printf("<tr><td>\n");
493          printf("<BR><b>Select Type To Add:</b><BR>\n");          printf("<BR><b>Select Type To Add:</b><br>\n");
494          printf("<select name =\"cmd\" size=\"7\">");          printf("<select name =\"cmd\" size=\"7\">\n");
495          printf("<option value =\"addRes\">Resource</option>\n");          printf("<option value =\"addRes\">Resource</option>\n");
496          printf("<option value=\"addLoc\">Location</option>\n");          printf("<option value=\"addLoc\">Location</option>\n");
497          printf("<option value=\"addStaff\">Staff</option>\n");          printf("<option value=\"addStaff\">Staff</option>\n");
# Line 510  function addSelection($con, $place_array Line 508  function addSelection($con, $place_array
508          printf("</td><td>\n");          printf("</td><td>\n");
509                    
510          // Cancel button          // Cancel button
511          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
512                  $page_id, $position, $position);                  $page_id, $position, $position);
513          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
514          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 528  function addSelection($con, $place_array Line 526  function addSelection($con, $place_array
526  /**********************************************************  /**********************************************************
527  Function: addService  Function: addService
528  Author: Paul Bramscher  Author: Paul Bramscher
529  Last Modified: 06.23.2003  Last Modified: 03.11.2004
530  ***********************************************************  ***********************************************************
531  Purpose:  Purpose:
532  Select from a list of library services to add as an  Select from a list of library services to add as an
533  element to a PageScribe/CourseLib page.  element to a PageScribe/CourseLib page.
534  **********************************************************/  **********************************************************/
535  function addService($con, $place_array, $servicetype_id, $page_id) {  function addService($place_array, $servicetype_id, $page_id) {
536                    
537          // Break apart place array          // Break apart place array
538          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 555  function addService($con, $place_array, Line 553  function addService($con, $place_array,
553          printf("</td></tr>\n");          printf("</td></tr>\n");
554                    
555          // Limit by type          // Limit by type
556          printf("<tr><td class=\"cellPlain\">Service Type:</td>");          printf("<tr><td class=\"cellPlain\">Service Type:</td>\n");
557          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
558                  $page_id, $position, $position);                  $page_id, $position, $position);
559          printf("<input type=\"hidden\" name=\"cmd\" value=\"addService\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"addService\">\n");
560          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);
# Line 565  function addService($con, $place_array, Line 563  function addService($con, $place_array,
563          printf("<td>\n");          printf("<td>\n");
564          printf("<select name =\"servicetype_id\">\n");          printf("<select name =\"servicetype_id\">\n");
565          printf("<option value=\"\">All</option>\n");          printf("<option value=\"\">All</option>\n");
566          dropDownFieldSelected($con, "servicetype", "servicetype", "servicetype_id", " WHERE servicetype_id > 1", $servicetype_id);          dropDownFieldSelected("servicetype", "servicetype", "servicetype_id", " WHERE servicetype_id > 1", $servicetype_id);
567          printf("</select><br><br>\n");          printf("</select><br><br>\n");
568          printf("<input type =\"submit\" value =\"Limit by Service Type\">\n");            printf("<input type =\"submit\" value =\"Limit by Service Type\">\n");  
569          printf("</form></td></tr>\n");          printf("</form></td></tr>\n");
# Line 579  function addService($con, $place_array, Line 577  function addService($con, $place_array,
577          // Service drop-down          // Service drop-down
578          printf("<tr><td colspan=\"2\">Select a Service:<br>\n");          printf("<tr><td colspan=\"2\">Select a Service:<br>\n");
579          printf("<select name =\"service_id\" size=\"5\" >\n");          printf("<select name =\"service_id\" size=\"5\" >\n");
580          dropDownServiceLimit($con, $servicetype_id);          dropDownServiceLimit($servicetype_id);
581          printf("</select><br><br>");          printf("</select><br><br>\n");
582                    
583          // Interior table          // Interior table
584          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");
# Line 589  function addService($con, $place_array, Line 587  function addService($con, $place_array,
587          printf("</td><td>\n");          printf("</td><td>\n");
588                    
589          // Cancel button          // Cancel button
590          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
591                  $page_id, $position, $position);                  $page_id, $position, $position);
592          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
593          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 606  function addService($con, $place_array, Line 604  function addService($con, $place_array,
604  /**********************************************************  /**********************************************************
605  Function: addStaff  Function: addStaff
606  Author: Paul Bramscher  Author: Paul Bramscher
607  Last Modified: 06.23.2003  Last Modified: 03.11.2004
608  ***********************************************************  ***********************************************************
609  Purpose:  Purpose:
610  Select from a list of library staff to add as an  Select from a list of library staff to add as an
611  element to a PageScribe/CourseLib page.  element to a PageScribe/CourseLib page.
612  **********************************************************/  **********************************************************/
613  function addStaff($con, $place_array, $page_id) {  function addStaff($place_array, $page_id) {
614    
615          // Break apart place array          // Break apart place array
616          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 630  function addStaff($con, $place_array, $p Line 628  function addStaff($con, $place_array, $p
628          printf("<table width=\"25%%\" class=\"backLight\" border=\"1\" cellpadding=\"4\">\n");          printf("<table width=\"25%%\" class=\"backLight\" border=\"1\" cellpadding=\"4\">\n");
629                    
630          // Add staff form          // Add staff form
631          printf("<form method = \"POST\" action = \"scribe_transaction.phtml\">");                printf("<form method = \"POST\" action = \"scribe_transaction.phtml\">\n");    
632          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">", $page_id);          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);
633          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">", $place_array_HTML);          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">\n", $place_array_HTML);      
634          printf("<input type = \"Hidden\" name = \"transaction\" value = \"insertScribeStaff\" >");          printf("<input type = \"Hidden\" name = \"transaction\" value = \"insertScribeStaff\" >\n");
635                                    
636          // Row header          // Row header
637          printf("<tr><td class=\"cellPlain\">\n");          printf("<tr><td class=\"cellPlain\">\n");
# Line 642  function addStaff($con, $place_array, $p Line 640  function addStaff($con, $place_array, $p
640    
641          // Staff drop-down          // Staff drop-down
642          printf("<tr><td>\n");          printf("<tr><td>\n");
643          printf("<BR><b>Select Staffperson:</b><BR>\n");          printf("<BR><b>Select Staffperson:</b><br>\n");
644          printf("<select name =\"staff_id\" size=\"5\" >");          printf("<select name =\"staff_id\" size=\"5\" >\n");
645          dropDownStaffOmit($con, " WHERE staff_id > 1");          dropDownStaffOmit(" WHERE staff_id > 1");
646          printf("</select><br><br>");          printf("</select><br><br>\n");
647                    
648          // Interior table          // Interior table
649          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");
650          printf("<input type= \"submit\" value=\"Add\">");          printf("<input type= \"submit\" value=\"Add\">\n");
651          printf("</form>\n");          printf("</form>\n");
652          printf("</td><td>\n");          printf("</td><td>\n");
653                    
654          // Cancel button          // Cancel button
655          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
656                  $page_id, $position, $position);                  $page_id, $position, $position);
657          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
658          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 717  function buttonUp($page_id, $place_array Line 715  function buttonUp($page_id, $place_array
715  /**********************************************************  /**********************************************************
716  Function: copyElement  Function: copyElement
717  Author: Paul Bramscher  Author: Paul Bramscher
718  Last Modified: 06.23.2003  Last Modified: 03.11.2004
719  ***********************************************************  ***********************************************************
720  Purpose:  Purpose:
721  Query the user to copy either the selected element  Query the user to copy either the selected element
# Line 725  singly or (if present) all descendants. Line 723  singly or (if present) all descendants.
723  pass the current staff id, since each staffperson has  pass the current staff id, since each staffperson has
724  his/her unique copy-paste buffer.  his/her unique copy-paste buffer.
725  **********************************************************/  **********************************************************/
726  function copyElement($con, $place_array, $page_id, $element_id, $sess_staff_id) {  function copyElement($place_array, $page_id, $element_id, $sess_staff_id) {
727    
728          // Break apart place array          // Break apart place array
729          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 746  function copyElement($con, $place_array, Line 744  function copyElement($con, $place_array,
744          printf("</td></tr>\n");          printf("</td></tr>\n");
745                    
746          // Determine number of children          // Determine number of children
747          $num_children = parentIs($con, $element_id, $page_id);          $num_children = parentIs($element_id, $page_id);
748    
749          // Cut form          // Cut form
750          printf("<form method =\"POST\" action =\"scribe_transaction.phtml\">");          printf("<form method =\"POST\" action =\"scribe_transaction.phtml\">\n");
751          printf("<input type =\"hidden\" name =\"transaction\" value =\"copyPasteElement\">");          printf("<input type =\"hidden\" name =\"transaction\" value =\"copyPasteElement\">\n");
752          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">", $place_array_HTML);          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">\n", $place_array_HTML);      
753          printf("<input type =\"hidden\" name =\"page_id\" value =\"%d\">", $page_id);            printf("<input type =\"hidden\" name =\"page_id\" value =\"%d\">\n", $page_id);
754          printf("<input type =\"hidden\" name =\"sess_staff_id\" value =\"%d\">", $sess_staff_id);          printf("<input type =\"hidden\" name =\"sess_staff_id\" value =\"%d\">\n", $sess_staff_id);
755    
756          // Display the element          // Display the element
757          printf("<tr><td>\n");          printf("<tr><td>\n");
758          printf("<b>Item:</b><br>\n");          printf("<b>Item:</b><br>\n");
759          displayElement($con, $element_id, $page_id);          displayElement($element_id, $page_id);
760          printf("<BR>\n");          printf("<BR>\n");
761    
762          if ($num_children > 0) {          if ($num_children > 0) {
763                  printf("Element is a parent.  How do you wish to copy?<BR><BR>");                  printf("Element is a parent.  How do you wish to copy?<br><br>\n");
764                  printf("<select name =\"copysingle\">");                  printf("<select name =\"copysingle\">\n");
765                  printf("<option value =\"0\" selected>Copy element and all descendants</option>");                  printf("<option value =\"0\" selected>Copy element and all descendants</option>\n");
766                  printf("<option value =\"1\">Copy this element only?</option>");                  printf("<option value =\"1\">Copy this element only?</option>\n");
767                  printf("</select><BR><BR>");                  printf("</select><br><br>\n");
768          }          }
769          else {          else {
770                  printf("<input type =\"hidden\" name =\"copysingle\" value =\"0\">");                  printf("<input type =\"hidden\" name =\"copysingle\" value =\"0\">");
# Line 780  function copyElement($con, $place_array, Line 778  function copyElement($con, $place_array,
778          printf("</td><td>\n");          printf("</td><td>\n");
779                    
780          // Cancel button          // Cancel button
781          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
782                  $page_id, $position, $position);                  $page_id, $position, $position);
783          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
784          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 797  function copyElement($con, $place_array, Line 795  function copyElement($con, $place_array,
795  /**********************************************************  /**********************************************************
796  Function: delElement  Function: delElement
797  Author: Paul Bramscher  Author: Paul Bramscher
798  Last Modified: 06.23.2003  Last Modified: 03.11.2004
799  ***********************************************************  ***********************************************************
800  Purpose:  Purpose:
801  Query the user to (1) delete the current element only,  Query the user to (1) delete the current element only,
802  (2) also delete all children (if available), or (3) promote  (2) also delete all children (if available), or (3) promote
803  them to the parent level of the deleted element.  them to the parent level of the deleted element.
804  **********************************************************/  **********************************************************/
805  function delElement($con, $place_array, $page_id, $element_id) {  function delElement($place_array, $page_id, $element_id) {
806    
807          // Break apart place array          // Break apart place array
808          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 825  function delElement($con, $place_array, Line 823  function delElement($con, $place_array,
823          printf("</td></tr>\n");          printf("</td></tr>\n");
824                    
825          // Determine number of children          // Determine number of children
826          $num_children = parentIs($con, $element_id, $page_id);          $num_children = parentIs($element_id, $page_id);
827    
828          // Delete form          // Delete form
829          printf("<form method =\"POST\" action =\"scribe_transaction.phtml\">");          printf("<form method =\"POST\" action =\"scribe_transaction.phtml\">\n");
830          printf("<input type =\"hidden\" name =\"transaction\" value =\"deleteElement\">");          printf("<input type =\"hidden\" name =\"transaction\" value =\"deleteElement\">\n");
831          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">", $place_array_HTML);          printf("<input type = \"hidden\" name=\"place_array_HTML\" value =\"%s\">\n", $place_array_HTML);      
832          printf("<input type =\"hidden\" name =\"page_id\" value =\"%d\">", $page_id);            printf("<input type =\"hidden\" name =\"page_id\" value =\"%d\">\n", $page_id);
833    
834          // Display the element          // Display the element
835          printf("<tr><td>\n");          printf("<tr><td>\n");
836          printf("<b>Item:</b><br>\n");          printf("<b>Item:</b><br>\n");
837          displayElement($con, $element_id, $page_id);          displayElement($element_id, $page_id);
838          printf("<BR>\n");          printf("<BR>\n");
839    
840          if ($num_children > 0) {          if ($num_children > 0) {
841                  printf("Element is a parent.  How do you wish to delete?<BR><BR>");                  printf("Element is a parent.  How do you wish to delete?<br><br>\n");
842                  printf("<select name =\"promote\">");                  printf("<select name =\"promote\">\n");
843                  printf("<option value =\"1\" selected>Delete element and promote children</option>");                  printf("<option value =\"1\" selected>Delete element and promote children</option>\n");
844                  printf("<option value =\"2\">Delete element and all descendants</option>");                  printf("<option value =\"2\">Delete element and all descendants</option>\n");
845                  printf("</select><BR><BR>");                  printf("</select><br><br>\n");
846          }          }
847          else {          else {
848                  printf("<input type =\"hidden\" name =\"promote\" value =\"0\">");                  printf("<input type =\"hidden\" name =\"promote\" value =\"0\">\n");
849                  printf("Element has no children.  Delete this one only.<br><br>");                  printf("Element has no children.  Delete this one only.<br><br>\n");
850          }          }
851    
852          // Interior table          // Interior table
# Line 857  function delElement($con, $place_array, Line 855  function delElement($con, $place_array,
855          printf("</form>\n");          printf("</form>\n");
856                    
857          // Cancel button          // Cancel button
858          printf("</td><td>");          printf("</td><td>\n");
859          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
860                  $page_id, $position, $position);                  $page_id, $position, $position);
861          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
862          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 875  function delElement($con, $place_array, Line 873  function delElement($con, $place_array,
873  /**********************************************************  /**********************************************************
874  Function: displayElement  Function: displayElement
875  Author: Paul Bramscher  Author: Paul Bramscher
876  Last Modified: 06.23.2003  Last Modified: 03.11.2004
877  ***********************************************************  ***********************************************************
878  Purpose:  Purpose:
879  Output the "title" of any element type.  Note that this  Output the "title" of any element type.  Note that this
# Line 883  also include free-text label type elemen Line 881  also include free-text label type elemen
881  a concatenated first-name, last-name staff member type  a concatenated first-name, last-name staff member type
882  element.  element.
883  **********************************************************/  **********************************************************/
884  function displayElement ($con, $element_id, $page_id) {  function displayElement ($element_id, $page_id) {
885    
886          // Build a join to cover the possible element types          // Build a join to cover the possible element types
887          $sql = "SELECT l.location, s.last_name, s.first_name, r.title, e.label, v.service, b.subject          $sql = "SELECT
888                          FROM                  l.location,
889                          element e                  s.last_name,
890                          LEFT JOIN resource r using (resource_id)                                  s.first_name,
891                          LEFT JOIN location l on e.location_id = l.location_id                  r.title,
892                          LEFT JOIN staff s on e.staff_id = s.staff_id                  e.label,
893                          LEFT JOIN service v on e.service_id = v.service_id                  v.service,
894                          LEFT JOIN subject b on e.subject_id = b.subject_id                  b.subject
895                          WHERE page_id = "                  FROM
896                          . $page_id                  element e
897                          . " AND element_id = "                  LEFT JOIN resource r using (resource_id)                
898                          . $element_id;                  LEFT JOIN location l on e.location_id = l.location_id
899                    LEFT JOIN staff s on e.staff_id = s.staff_id
900                    LEFT JOIN service v on e.service_id = v.service_id
901                    LEFT JOIN subject b on e.subject_id = b.subject_id
902                    WHERE page_id = "
903                    . $page_id
904                    . " AND element_id = "
905                    . $element_id;
906                                                    
907          $rs = xx_query($sql, $con);          $rs = xx_tryquery($sql);
908          $row = xx_fetch_array ($rs);          $row = xx_fetch_array ($rs, xx_ASSOC);
909                    
910          // Pull out the possible display values          // Pull out the possible display values
911          $location = $row["location"];          $location = $row["location"];
# Line 912  function displayElement ($con, $element_ Line 917  function displayElement ($con, $element_
917          $subject =  $row["subject"];          $subject =  $row["subject"];
918                    
919          // Determine which one          // Determine which one
920          if (strlen($title) > 1) printf("%s<BR>", $title);          if (strlen($title) > 1) printf("%s<br>\n", $title);
921          else if (strlen($label) > 1) printf("%s<BR>", $label);          else if (strlen($label) > 1) printf("%s<br>\n", $label);
922          else if (strlen($location) > 1) printf("%s<BR>", $location);          else if (strlen($location) > 1) printf("%s<br>\n", $location);
923          else if (strlen($service) > 1) printf("%s<BR>", $service);          else if (strlen($service) > 1) printf("%s<br>\n", $service);
924          else if (strlen($subject) > 1) printf("%s<BR>", $subject);                else if (strlen($subject) > 1) printf("%s<br>\n", $subject);    
925          else if (strlen($last_name) > 1) {          else if (strlen($last_name) > 1) {
926                  if (strlen($first_name) > 1) printf("%s", $first_name);                  if (strlen($first_name) > 1) printf("%s", $first_name);
927                  printf(" %s<BR>", $last_name);                  printf(" %s<br>\n", $last_name);
928          }          }
929    
930  }  }
# Line 928  function displayElement ($con, $element_ Line 933  function displayElement ($con, $element_
933  /**********************************************************  /**********************************************************
934  Function: displayHeader  Function: displayHeader
935  Author: Paul Bramscher  Author: Paul Bramscher
936  Last Modified: 11.21.2003  Last Modified: 03.11.2004
937  ***********************************************************  ***********************************************************
938  Purpose:  Purpose:
939  In edit mode, offer a form to the author of a PageScribe or  In edit mode, offer a form to the author of a PageScribe or
# Line 936  CourseLib page the ability to edit the p Line 941  CourseLib page the ability to edit the p
941  Note that the actual data is prefixed with either "Page Title"  Note that the actual data is prefixed with either "Page Title"
942  or "Course Title" depending on the type of page it is.  or "Course Title" depending on the type of page it is.
943  **********************************************************/  **********************************************************/
944  function displayHeader ($con, $page_id, $page_title,  function displayHeader ($page_id, $page_title,
945          $pagetitle_style, $pagetype_id) {          $pagetitle_style, $pagetype_id) {
946    
947          // Determine label name          // Determine label name
# Line 959  function displayHeader ($con, $page_id, Line 964  function displayHeader ($con, $page_id,
964    
965          // Edit page title style          // Edit page title style
966          printf("<td>&nbsp;");          printf("<td>&nbsp;");
967          pageTitleStyle($con, $page_id, $pagetitle_style);          pageTitleStyle($page_id, $pagetitle_style);
968                    
969          // Close table          // Close table
970          printf("</td></tr></table>\n");          printf("</td></tr></table>\n");
# Line 970  function displayHeader ($con, $page_id, Line 975  function displayHeader ($con, $page_id,
975  /**********************************************************  /**********************************************************
976  Function: editButtons  Function: editButtons
977  Author: Paul Bramscher  Author: Paul Bramscher
978  Last Modified: 06.23.2003  Last Modified: 03.11.2004
979  ***********************************************************  ***********************************************************
980  Purpose:  Purpose:
981  Display the style elements (1-5) that may be applied to  Display the style elements (1-5) that may be applied to
# Line 978  the given element.  The currently-enforc Line 983  the given element.  The currently-enforc
983  (if non-NULL) is displayed in boldface.  If no style  (if non-NULL) is displayed in boldface.  If no style
984  is selected, the "X" is bolded.  is selected, the "X" is bolded.
985  **********************************************************/  **********************************************************/
986  function editButtons($con, $element_size, $label_text, $label_url,  function editButtons($element_size, $label_text, $label_url,
987          $place_array, $resource_id, $page_id, $element_id){          $place_array, $resource_id, $page_id, $element_id){
988    
989          // Break apart place array          // Break apart place array
# Line 1036  function editButtons($con, $element_size Line 1041  function editButtons($con, $element_size
1041          // Copy          // Copy
1042          printf("<a href=\"scribe.phtml?page_id=%d&cmd=copyElement&this_pos=%d#p%d\"><img src=\"images/copy.gif\" border=\"0\" alt=\"copy\"></a>\n", $page_id, $position, $position);          printf("<a href=\"scribe.phtml?page_id=%d&cmd=copyElement&this_pos=%d#p%d\"><img src=\"images/copy.gif\" border=\"0\" alt=\"copy\"></a>\n", $page_id, $position, $position);
1043    
         // Increase size  
         // printf("<a href=\"scribe_transaction.phtml?transaction=elementIncrease&page_id=%d&element_id=%d&position=%d#p%d\"><img src=\"images/plus.jpg\" border=\"0\"></a>\n", $page_id, $element_id, $position, $position);  
           
         // Decrease size  
         // printf("<a href=\"scribe_transaction.phtml?transaction=elementDecrease&page_id=%d&element_id=%d&position=%d#p%d\"><img src=\"images/minus.jpg\" border=\"0\"></a>\n", $page_id, $element_id, $position, $position);  
   
1044          // Element size control          // Element size control
1045          printf("Style: [ %s<a href=\"scribe_transaction.phtml?transaction=elementSize&page_id=%d&element_id=%d&size=0&position=%d#p%d\">X</a>%s | ", $bold0, $page_id, $element_id, $position, $position, $bold0_close);          printf("Style: [ %s<a href=\"scribe_transaction.phtml?transaction=elementSize&page_id=%d&element_id=%d&size=0&position=%d#p%d\">X</a>%s | ", $bold0, $page_id, $element_id, $position, $position, $bold0_close);
1046          printf("%s<a href=\"scribe_transaction.phtml?transaction=elementSize&page_id=%d&element_id=%d&size=1&position=%d#p%d\">1</a>%s | ", $bold1, $page_id, $element_id, $position, $position, $bold1_close);          printf("%s<a href=\"scribe_transaction.phtml?transaction=elementSize&page_id=%d&element_id=%d&size=1&position=%d#p%d\">1</a>%s | ", $bold1, $page_id, $element_id, $position, $position, $bold1_close);
# Line 1057  function editButtons($con, $element_size Line 1056  function editButtons($con, $element_size
1056  /**********************************************************  /**********************************************************
1057  Function: editElement  Function: editElement
1058  Author: Paul Bramscher  Author: Paul Bramscher
1059  Last Modified: 06.25.2003  Last Modified: 03.11.2004
1060  ***********************************************************  ***********************************************************
1061  Purpose:  Purpose:
1062  Build a form to edit the incoming element.  Depending on  Build a form to edit the incoming element.  Depending on
1063  the type of element, different sorts of functionality  the type of element, different sorts of functionality
1064  occurs.  occurs.
1065  **********************************************************/  **********************************************************/
1066  function editElement($con, $place_array, $page_id, $element_id) {  function editElement($place_array, $page_id, $element_id) {
1067    
1068          // Break apart place array          // Break apart place array
1069          // $element_id = $place_array[0];          // $element_id = $place_array[0];
# Line 1083  function editElement($con, $place_array, Line 1082  function editElement($con, $place_array,
1082                  WHERE page_id = " . $page_id . " AND element_id = " . $element_id                  WHERE page_id = " . $page_id . " AND element_id = " . $element_id
1083                  . " ORDER BY e.element_order";                  . " ORDER BY e.element_order";
1084                    
1085          $rs = xx_query($sql, $con);          $rs = xx_tryquery($sql);
1086          $row = xx_fetch_array ($rs);          $row = xx_fetch_array ($rs, xx_ASSOC);
1087                    
1088          // General element fields          // General element fields
1089          $element_descr = $row["element_descr"];          $element_descr = $row["element_descr"];
# Line 1178  function editElement($con, $place_array, Line 1177  function editElement($con, $place_array,
1177                    
1178          // Item Display          // Item Display
1179          printf("<tr><td>\n");          printf("<tr><td>\n");
1180          printf("<b>Item:</b><br>");          printf("<b>Item:</b><br>\n");
1181          if ($label_flag == 0) printf("%s<BR><BR>\n", $display_label);          if ($label_flag == 0) printf("%s<br><br>\n", $display_label);
1182          else {          else {
1183                  printf("<input type=\"text\" name =\"label\" value=\"%s\" size=\"40\"><BR><BR>\n", $label);                  printf("<input type=\"text\" name =\"label\" value=\"%s\" size=\"40\"><br><br>\n", $label);
1184          }                }      
1185                    
1186          // If a text label          // If a text label
# Line 1204  function editElement($con, $place_array, Line 1203  function editElement($con, $place_array,
1203          }          }
1204                    
1205          // Description          // Description
1206          printf("<b>Description:</b><BR>\n");          printf("<b>Description:</b><br>\n");
1207          if (strlen($element_descr) < 1) $element_descr = $display_descr;          if (strlen($element_descr) < 1) $element_descr = $display_descr;
1208          printf("<textarea name =\"element_descr\" rows=\"5\" cols=\"45\">\n");            printf("<textarea name =\"element_descr\" rows=\"5\" cols=\"45\">\n");  
1209          printf("%s", $element_descr);          printf("%s", $element_descr);
# Line 1212  function editElement($con, $place_array, Line 1211  function editElement($con, $place_array,
1211                    
1212          // Interior table          // Interior table
1213          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");          printf("<table border=\"0\" cellpadding=\"4\"><tr><td>\n");
1214          if ($label_flag == 1) printf("<input type= \"submit\" value=\"Save Changes\">");          if ($label_flag == 1) printf("<input type= \"submit\" value=\"Save Changes\">\n");
1215          else printf("<input type= \"submit\" value=\"Save Custom Description\">");          else printf("<input type= \"submit\" value=\"Save Custom Description\">\n");
1216          printf("</form>\n");          printf("</form>\n");
1217          printf("</td><td>\n");          printf("</td><td>\n");
1218                    
1219          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">",          printf("<form method =\"POST\" action =\"scribe.phtml?page_id=%d&this_pos=%d#p%d\">\n",
1220                  $page_id, $position, $position);                  $page_id, $position, $position);
1221          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");          printf("<input type=\"hidden\" name=\"cmd\" value=\"\">\n");
1222          printf("<input type =\"submit\" value =\"Cancel\">\n");          printf("<input type =\"submit\" value =\"Cancel\">\n");
# Line 1235  function editElement($con, $place_array, Line 1234  function editElement($con, $place_array,
1234  /**********************************************************  /**********************************************************
1235  Function: editHeader  Function: editHeader
1236  Author: Paul Bramscher  Author: Paul Bramscher
1237  Last Modified: 06.23.2003  Last Modified: 03.11.2004
1238  ***********************************************************  ***********************************************************
1239  Purpose:  Purpose:
1240  Form to edit the supplied page_id title.  Form to edit the supplied page_id title.
1241  **********************************************************/  **********************************************************/
1242  function editHeader ($con, $course_id, $page_id, $page_title, $pagetype_id) {  function editHeader ($course_id, $page_id, $page_title, $pagetype_id) {
1243    
1244          // Determine label name          // Determine label name
1245          if ($pagetype_id == 3) $label = "Course Title";          if ($pagetype_id == 3) $label = "Course Title";
# Line 1255  function editHeader ($con, $course_id, $ Line 1254  function editHeader ($con, $course_id, $
1254    
1255          // Save or cancel          // Save or cancel
1256          printf("<input type=\"submit\" value =\"Save\">\n");          printf("<input type=\"submit\" value =\"Save\">\n");
         // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1257          printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);          printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1258          printf("<input type = \"Hidden\" name = \"transaction\" value = \"updateScribeHeader\" >\n");          printf("<input type = \"Hidden\" name = \"transaction\" value = \"updateScribeHeader\" >\n");
1259          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);          printf("<input type = \"hidden\" name=\"page_id\" value =\"%d\">\n", $page_id);
1260          printf("<input type = \"hidden\" name=\"pagetype_id\" value=\"%d\">\n", $pagetype_id);            printf("<input type = \"hidden\" name=\"pagetype_id\" value=\"%d\">\n", $pagetype_id);  
# Line 1271  function editHeader ($con, $course_id, $ Line 1268  function editHeader ($con, $course_id, $
1268  /**********************************************************  /**********************************************************
1269  Function: formAssignPageStaff  Function: formAssignPageStaff
1270  Author: Paul Bramscher  Author: Paul Bramscher
1271  Last Modified: 06.23.2003  Last Modified: 03.11.2004
1272  ***********************************************************  ***********************************************************
1273  Purpose:  Purpose:
1274  Assign authoring staff to the supplied page id.  This may  Assign authoring staff to the supplied page id.  This may
# Line 1280  access.  By default, of course, the crea Line 1277  access.  By default, of course, the crea
1277  coordinator.  Assigning him/her as a secondary maintainer  coordinator.  Assigning him/her as a secondary maintainer
1278  (in addition to coordinator) offers no benefits.  (in addition to coordinator) offers no benefits.
1279  **********************************************************/  **********************************************************/
1280  function formAssignPageStaff($con, $page_id, $staff_coordinator){  function formAssignPageStaff($page_id, $staff_coordinator){
1281    
1282          // Table definition          // Table definition
1283          printf("<center>\n");            printf("<center>\n");  
# Line 1297  function formAssignPageStaff($con, $page Line 1294  function formAssignPageStaff($con, $page
1294          printf("<input type = \"Hidden\" name = \"transaction\" value = \"assignStaffCoordinator\" >\n");          printf("<input type = \"Hidden\" name = \"transaction\" value = \"assignStaffCoordinator\" >\n");
1295          printf("<b>Page Coordinator:</b> ");          printf("<b>Page Coordinator:</b> ");
1296          printf("<select name =\"staff_coordinator\">\n");          printf("<select name =\"staff_coordinator\">\n");
1297          dropDownStaffSelected($con, $staff_coordinator);          dropDownStaffSelected($staff_coordinator);
1298          printf("</select>\n");          printf("</select>\n");
1299          printf("<input type=\"submit\" value=\"Reassign Coordinator!\"><br>\n");          printf("<input type=\"submit\" value=\"Reassign Coordinator!\"><br>\n");
1300          printf("</center>\n");          printf("</center>\n");
# Line 1310  function formAssignPageStaff($con, $page Line 1307  function formAssignPageStaff($con, $page
1307          $omit_string = "WHERE staff_id > 1";          $omit_string = "WHERE staff_id > 1";
1308                    
1309          // Omit any pre-selected staff in page_staff          // Omit any pre-selected staff in page_staff
1310          $in_string = getNotIn($con, "staff_id", "page_id", $page_id, "page_staff");          $in_string = getNotIn("staff_id", "page_id", $page_id, "page_staff");
1311          if (strlen($in_string) > 0) $omit_string .= " AND staff_id NOT IN " . $in_string;          if (strlen($in_string) > 0) $omit_string .= " AND staff_id NOT IN " . $in_string;
1312    
1313          // Form for maintainer assignments          // Form for maintainer assignments
1314          printf("<form method = \"POST\" action = \"scribe_transaction.phtml\" >\n");          printf("<form method = \"POST\" action = \"scribe_transaction.phtml\" >\n");
1315          printf("<input type = \"Hidden\" name = \"page_id\" value = \"%d\" >", $page_id);          printf("<input type = \"Hidden\" name = \"page_id\" value = \"%d\" >\n", $page_id);
1316          printf("<input type = \"Hidden\" name = \"transaction\" value = \"assignPageStaff\" >\n");          printf("<input type = \"Hidden\" name = \"transaction\" value = \"assignPageStaff\" >\n");
1317    
1318          // Available staff          // Available staff
1319          printf("<tr><td valign = \"top\" >\n");          printf("<tr><td valign = \"top\" >\n");
1320          printf("<br><strong>Available Maintainers:<br></strong>\n");          printf("<br><b>Available Maintainers:<br></b>\n");
1321          printf("<select name = \"staff_id_array[]\" multiple size = \"5\" >\n");          printf("<select name = \"staff_id_array[]\" multiple size = \"5\" >\n");
1322          dropDownStaffOmit($con, $omit_string);          dropDownStaffOmit($omit_string);
1323          printf("</select><br><br>\n");          printf("</select><br><br>\n");
1324          printf("<center>");          printf("<center>\n");
1325          printf("<input type = \"Submit\" value = \" >> \" >");          printf("<input type = \"Submit\" value = \" >> \" >\n");
1326          printf("</center>");          printf("</center>\n");
1327          printf("</form>");          printf("</form>\n");
1328          printf("</td>");          printf("</td>\n");
1329    
1330          // Current staff          // Current staff
1331          printf("<td valign = \"top\" >\n");          printf("<td valign = \"top\" >\n");
1332          printf("<form method = \"POST\" action = \"scribe_transaction.phtml\" >\n");          printf("<form method = \"POST\" action = \"scribe_transaction.phtml\" >\n");
1333          printf("<input type = \"Hidden\" name = \"page_id\" value = \"%d\" >\n", $page_id);          printf("<input type = \"Hidden\" name = \"page_id\" value = \"%d\" >\n", $page_id);
1334          printf("<input type = \"Hidden\" name = \"transaction\" value = \"deletePageStaff\" >\n");          printf("<input type = \"Hidden\" name = \"transaction\" value = \"deletePageStaff\" >\n");
1335          printf("<br><strong>Selected Maintainers:</strong><br>\n");          printf("<br><b>Selected Maintainers:</b><br>\n");
1336          printf("<select name =\"staff_list_array[]\" multiple size = 5>\n");          printf("<select name =\"staff_list_array[]\" multiple size = 5>\n");
1337          dropDownPageStaff($con, $page_id);          dropDownPageStaff($page_id);
1338          printf("</select><br><br>\n");          printf("</select><br><br>\n");
1339          printf("<center>\n");          printf("<center>\n");
1340          printf("<input type = \"Submit\" value =\" << \">\n");          printf("<input type = \"Submit\" value =\" << \">\n");
# Line 1361  function formAssignPageStaff($con, $page Line 1358  function formAssignPageStaff($con, $page
1358  /**********************************************************  /**********************************************************
1359  Function: formCourse  Function: formCourse
1360  Author: Paul Bramscher  Author: Paul Bramscher
1361  Last Modified: 06.24.2003  Last Modified: 03.11.2004
1362  ***********************************************************  ***********************************************************
1363  Purpose:  Purpose:
1364  This function draws out CourseLib specific fields and  This function draws out CourseLib specific fields and
# Line 1371  will turn one of the fields into an acti Line 1368  will turn one of the fields into an acti
1368  While inactive, the form -- when clicked -- turns that field  While inactive, the form -- when clicked -- turns that field
1369  active.  active.
1370  **********************************************************/    **********************************************************/  
1371  function formCourse($con, $active, $page_id) {  function formCourse($active, $page_id) {
1372    
1373          // Retrieve current information          // Retrieve current information
1374          $sql = "SELECT          $sql = "SELECT
# Line 1400  function formCourse($con, $active, $page Line 1397  function formCourse($con, $active, $page
1397                  LEFT JOIN page g on c.page_id = g.page_id                  LEFT JOIN page g on c.page_id = g.page_id
1398                                    
1399                  WHERE                  WHERE
1400                  c.page_id = " . $page_id;                  c.page_id = " . $page_id;      
1401            $rs = xx_tryquery($sql);
1402            $row = xx_fetch_array ($rs, xx_ASSOC);
         /*  
         // Retrieve current information  
         $sql = "SELECT *  
                 FROM  
                 course c  
                 LEFT JOIN term t using (term_id)                  
                 LEFT JOIN campus p on c.campus_id = p.campus_id  
                 LEFT JOIN coursesub s on c.coursesub_id = s.coursesub_id  
                   
                 WHERE  
                 page_id = " . $page_id;  
         */  
           
         $rs = xx_query($sql, $con);  
         $row = xx_fetch_array ($rs);  
1403    
1404          $course_id = $row["course_id"];          $course_id = $row["course_id"];
1405          $staff_id_created = $row["staff_id_created"];          $staff_id_created = $row["staff_id_created"];
# Line 1467  function formCourse($con, $active, $page Line 1449  function formCourse($con, $active, $page
1449                                    
1450                  // Save or cancel                  // Save or cancel
1451                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1452                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1453                  printf("</td>\n");                  printf("</td>\n");
1454                  printf("</form>\n");                  printf("</form>\n");
1455    
# Line 1477  function formCourse($con, $active, $page Line 1457  function formCourse($con, $active, $page
1457                    
1458          // Inactive          // Inactive
1459          else {            else {  
1460                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1461                  printf("<td colspan=\"3\">\n");                          printf("<td colspan=\"3\">\n");        
1462                  printf("<input type=\"Hidden\" name=\"active\" value=\"courseheader\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"courseheader\">\n");
1463                  printf("%s ", $courseheader);                  printf("%s ", $courseheader);
1464                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1465                  printf("</td>\n");                  printf("</td>\n");
# Line 1508  function formCourse($con, $active, $page Line 1488  function formCourse($con, $active, $page
1488                  // Published pages may not be set to N/A or null course designators                  // Published pages may not be set to N/A or null course designators
1489                  $limit = "";                  $limit = "";
1490                  if ($published == 1) $limit = " WHERE coursesub_id > 1";                  if ($published == 1) $limit = " WHERE coursesub_id > 1";
1491                  dropDownCoursesubSelected($con, $limit, $coursesub_id);                  dropDownCoursesubSelected($limit, $coursesub_id);
1492                  printf("</select> \n");                  printf("</select> \n");
1493    
1494                  // Save or cancel                  // Save or cancel
1495                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
1496                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1497                  printf("</td>\n");                                printf("</td>\n");              
1498                  printf("</form>\n");                  printf("</form>\n");
1499          }          }
1500                    
1501          // Inactive          // Inactive
1502          else {          else {
1503                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1504                  printf("<td colspan=\"3\">\n");                          printf("<td colspan=\"3\">\n");        
1505                  printf("<input type=\"Hidden\" name=\"active\" value=\"coursesub\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"coursesub\">\n");
1506                  printf("%s ", $coursesub);                  printf("%s ", $coursesub);
1507                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1508                  printf("</td>\n");                                printf("</td>\n");              
# Line 1551  function formCourse($con, $active, $page Line 1530  function formCourse($con, $active, $page
1530    
1531                  // Save or cancel                  // Save or cancel
1532                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1533                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1534                  printf("</td>\n");                                printf("</td>\n");              
1535                  printf("</form>\n");                  printf("</form>\n");
1536          }          }
1537                    
1538          // Inactive          // Inactive
1539          else {          else {
1540                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1541                  printf("<td width=\"25%%\">\n");                                  printf("<td width=\"25%%\">\n");                
1542                  printf("<input type=\"Hidden\" name=\"active\" value=\"course_num\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"course_num\">\n");
1543                  printf("%s ", $course_num);                  printf("%s ", $course_num);
1544                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1545                  printf("</td>\n");                  printf("</td>\n");
# Line 1589  function formCourse($con, $active, $page Line 1566  function formCourse($con, $active, $page
1566    
1567                  // Save or cancel                  // Save or cancel
1568                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1569                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1570                  printf("</td>\n");                  printf("</td>\n");
1571                  printf("</form>\n");                  printf("</form>\n");
1572          }          }
1573                    
1574          // Inactive          // Inactive
1575          else {          else {
1576                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1577                  printf("<td width=\"25%%\">\n");                                  printf("<td width=\"25%%\">\n");                
1578                  printf("<input type=\"Hidden\" name=\"active\" value=\"course_section\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"course_section\">\n");
1579                  printf("%s ", $course_section);                  printf("%s ", $course_section);
1580                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1581                  printf("</td>\n");                                printf("</td>\n");              
# Line 1624  function formCourse($con, $active, $page Line 1599  function formCourse($con, $active, $page
1599                  printf("<input type=\"Hidden\" name=\"course_id\" value=\"%d\">\n", $course_id);                          printf("<input type=\"Hidden\" name=\"course_id\" value=\"%d\">\n", $course_id);        
1600                  printf("<input type=\"Hidden\" name=\"field_name\" value=\"campus_id\">\n");                      printf("<input type=\"Hidden\" name=\"field_name\" value=\"campus_id\">\n");    
1601                  printf("<select name =\"field_value\">\n");                  printf("<select name =\"field_value\">\n");
1602                  dropDownFieldSelected($con, "campus", "campus", "campus_id", " WHERE campus_id > 0", $campus_id);                  dropDownFieldSelected("campus", "campus", "campus_id", " WHERE campus_id > 0", $campus_id);
1603                  printf("</select> \n");                  printf("</select> \n");
                 printf("<!-- id was: %d -->", $campus_id);  
1604    
1605                  // Save or cancel                  // Save or cancel
1606                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1607                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1608                  printf("</td>\n");                                printf("</td>\n");              
1609                  printf("</form>\n");                  printf("</form>\n");
1610          }          }
1611                    
1612          // Inactive          // Inactive
1613          else {          else {
1614                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1615                  printf("<td colspan=\"3\">\n");                          printf("<td colspan=\"3\">\n");        
1616                  printf("<input type=\"Hidden\" name=\"active\" value=\"campus\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"campus\">\n");
1617                  printf("%s ", $campus);                  printf("%s ", $campus);
1618                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1619                  printf("</td>\n");                                printf("</td>\n");              
# Line 1665  function formCourse($con, $active, $page Line 1637  function formCourse($con, $active, $page
1637                  printf("<input type=\"Hidden\" name=\"course_id\" value=\"%d\">\n", $course_id);                          printf("<input type=\"Hidden\" name=\"course_id\" value=\"%d\">\n", $course_id);        
1638                  printf("<input type=\"Hidden\" name=\"field_name\" value=\"term_id\">\n");                        printf("<input type=\"Hidden\" name=\"field_name\" value=\"term_id\">\n");      
1639                  printf("<select name =\"field_value\">\n");                  printf("<select name =\"field_value\">\n");
1640                  dropDownFieldSelected($con, "term", "term", "term_id", " WHERE term_id > 0", $term_id);                  dropDownFieldSelected("term", "term", "term_id", " WHERE term_id > 0", $term_id);
1641                  printf("</select> \n");                  printf("</select> \n");
1642    
1643                  // Save or cancel                  // Save or cancel
1644                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1645                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1646                  printf("</td>\n");                                printf("</td>\n");              
1647                  printf("</form>\n");                  printf("</form>\n");
1648          }          }
1649                    
1650          // Inactive          // Inactive
1651          else {          else {
1652                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1653                  printf("<td>\n");                                printf("<td>\n");              
1654                  printf("<input type=\"Hidden\" name=\"active\" value=\"term\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"term\">\n");
1655                  printf("%s ", $term);                  printf("%s ", $term);
1656                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1657                  printf("</td>\n");                  printf("</td>\n");
# Line 1706  function formCourse($con, $active, $page Line 1676  function formCourse($con, $active, $page
1676    
1677                  // Save or cancel                  // Save or cancel
1678                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1679                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1680                  printf("</td>\n");                                printf("</td>\n");              
1681                  printf("</form>\n");                  printf("</form>\n");
1682          }          }
# Line 1744  function formCourse($con, $active, $page Line 1712  function formCourse($con, $active, $page
1712    
1713                  // Save or cancel                  // Save or cancel
1714                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1715                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1716                  printf("</form>\n");                  printf("</form>\n");
1717          }          }
1718                    
1719          // Inactive          // Inactive
1720          else {          else {
1721                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1722                  printf("<input type=\"Hidden\" name=\"active\" value=\"introheader1\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"introheader1\">\n");
1723                  printf("%s ", $introheader1);                  printf("%s ", $introheader1);
1724                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1725                  printf("</form>\n");                  printf("</form>\n");
# Line 1781  function formCourse($con, $active, $page Line 1747  function formCourse($con, $active, $page
1747    
1748                  // Save or cancel                  // Save or cancel
1749                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1750                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1751                  printf("</form>\n");                  printf("</form>\n");
1752          }          }
1753                    
# Line 1816  function formCourse($con, $active, $page Line 1780  function formCourse($con, $active, $page
1780    
1781                  // Save or cancel                  // Save or cancel
1782                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1783                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1784                  printf("</form>\n");                  printf("</form>\n");
1785          }          }
1786                    
1787          // Inactive          // Inactive
1788          else {          else {
1789                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1790                  printf("<input type=\"Hidden\" name=\"active\" value=\"introheader2\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"introheader2\">\n");
1791                  printf("%s ", $introheader2);                  printf("%s ", $introheader2);
1792                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1793                  printf("</form>\n");                  printf("</form>\n");
# Line 1852  function formCourse($con, $active, $page Line 1814  function formCourse($con, $active, $page
1814    
1815                  // Save or cancel                  // Save or cancel
1816                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
                 // printf("<input type = \"image\" src=\"images/save.jpg\" name =\"save\" alt=\"save\">\n");  
1817                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
1818                  printf("</form>\n");                  printf("</form>\n");
1819          }          }
1820                    
1821          // Inactive          // Inactive
1822          else {          else {
1823                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
1824                  printf("<input type=\"Hidden\" name=\"active\" value=\"intromessage2\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"intromessage2\">\n");
1825                  printf("%s ", $intromessage2);                  printf("%s ", $intromessage2);
1826                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
1827                  printf("</form>\n");                  printf("</form>\n");
# Line 1877  function formCourse($con, $active, $page Line 1837  function formCourse($con, $active, $page
1837  /**********************************************************  /**********************************************************
1838  Function: formCoursePers  Function: formCoursePers
1839  Author: Paul Bramscher  Author: Paul Bramscher
1840  Last Modified: 06.23.2003  Last Modified: 03.11.2004
1841  ***********************************************************  ***********************************************************
1842  Purpose:  Purpose:
1843  Allows the selection of existing LibData library staff,  Allows the selection of existing LibData library staff,
# Line 1885  faculty (drawn from the faculty table), Line 1845  faculty (drawn from the faculty table),
1845  on-the-fly and non-indexed TA/other staff.  Also, it is  on-the-fly and non-indexed TA/other staff.  Also, it is
1846  possible here to create faculty on the fly.  possible here to create faculty on the fly.
1847  **********************************************************/    **********************************************************/  
1848  function formCoursePers($con, $active, $course_id, $page_id) {  function formCoursePers($active, $course_id, $page_id) {
1849    
1850          // Retrieve current information          // Retrieve current information
1851          $sql = "SELECT *          $sql = "SELECT *
# Line 1898  function formCoursePers($con, $active, $ Line 1858  function formCoursePers($con, $active, $
1858                  WHERE                  WHERE
1859                  course_id = " . $course_id . " ORDER BY personnel_id";                  course_id = " . $course_id . " ORDER BY personnel_id";
1860                    
1861          $rs = xx_query($sql, $con);          $rs = xx_tryquery($sql);
1862    
1863          // Table          // Table
1864          printf("<table cellpadding = \"0\" cellspacing = \"4\" >\n");          printf("<table cellpadding = \"0\" cellspacing = \"4\" >\n");
# Line 1912  function formCoursePers($con, $active, $ Line 1872  function formCoursePers($con, $active, $
1872          printf("<b>Personnel:</b><br>\n");          printf("<b>Personnel:</b><br>\n");
1873          printf("</td></tr>\n");          printf("</td></tr>\n");
1874    
1875          while ($row = xx_fetch_array ($rs)) {          while ($row = xx_fetch_array ($rs, xx_ASSOC)) {
1876    
1877                  // Initialize                  // Initialize
1878                  $last_name = "";                  $last_name = "";
1879                  $first_name = "";                  $first_name = "";
1880                  $x500 = "";                  $staff_account = "";
1881                  $email = "";                  $email = "";
1882                  $stafftitle = "";                  $stafftitle = "";
1883                    $staff_email = "";
1884                    $faculty_email = "";
1885                    $pers_email = "";
1886    
1887                  // Fetch the general stuff                  // Fetch the general stuff
1888                  $personnel_id = $row["personnel_id"];                  $personnel_id = $row["personnel_id"];
# Line 1934  function formCoursePers($con, $active, $ Line 1897  function formCoursePers($con, $active, $
1897                          // Gather the staff table fields                          // Gather the staff table fields
1898                          $last_name = $row["last_name"];                          $last_name = $row["last_name"];
1899                          $first_name = $row["first_name"];                          $first_name = $row["first_name"];
1900                          $x500 = $row["staff_account"];                          $staff_account = $row["staff_account"];
1901                          $email = $x500 . "@umn.edu";                          $email = $row["staff_email"];
1902    
1903                  }                  }
1904                    
# Line 1945  function formCoursePers($con, $active, $ Line 1908  function formCoursePers($con, $active, $
1908                          // Gather the faculty table fields                          // Gather the faculty table fields
1909                          $last_name = $row["faculty_lastname"];                          $last_name = $row["faculty_lastname"];
1910                          $first_name = $row["faculty_firstname"];                          $first_name = $row["faculty_firstname"];
1911                          $x500 = $row["faculty_account"];                          $faculty_account = $row["faculty_account"];
1912                          $email = $row["faculty_email"];                          $email = $row["faculty_email"];
1913    
1914                  }                  }
# Line 1956  function formCoursePers($con, $active, $ Line 1919  function formCoursePers($con, $active, $
1919                          // Gather the catch-all fields                          // Gather the catch-all fields
1920                          $last_name = $row["pers_lastname"];                          $last_name = $row["pers_lastname"];
1921                          $first_name = $row["pers_firstname"];                          $first_name = $row["pers_firstname"];
1922                          $x500 = $row["pers_account"];                          $pers_account = $row["pers_account"];
1923                          $email = $row["pers_email"];                          $email = $row["pers_email"];
1924                  }                  }
1925    
# Line 2024  function formCoursePers($con, $active, $ Line 1987  function formCoursePers($con, $active, $
1987                  printf("<b>Personnel Title:</b>\n");                  printf("<b>Personnel Title:</b>\n");
1988                  printf("</td><td colspan = \"2\" valign=\"top\" >\n");                  printf("</td><td colspan = \"2\" valign=\"top\" >\n");
1989                  printf("<select name=\"stafftitle_id\">\n");                  printf("<select name=\"stafftitle_id\">\n");
1990                  dropDownField($con, "stafftitle", "stafftitle", "stafftitle_id");                  dropDownField("stafftitle", "stafftitle", "stafftitle_id");
1991                  printf("</select><br><br>");                  printf("</select><br><br>");
1992                  printf("</td></tr>\n");                  printf("</td></tr>\n");
1993    
# Line 2043  function formCoursePers($con, $active, $ Line 2006  function formCoursePers($con, $active, $
2006                  printf("<b>Library Staff:</b>\n");                  printf("<b>Library Staff:</b>\n");
2007                  printf("</td><td colspan = \"2\" valign=\"top\" >\n");                  printf("</td><td colspan = \"2\" valign=\"top\" >\n");
2008                  printf("<select name=\"staff_id\">\n");                  printf("<select name=\"staff_id\">\n");
2009                  dropDownStaff($con);                  dropDownStaff();
2010                  printf("</select>");                  printf("</select>");
2011                  printf("</td></tr>\n");                          printf("</td></tr>\n");        
2012    
# Line 2058  function formCoursePers($con, $active, $ Line 2021  function formCoursePers($con, $active, $
2021                  printf("<b>U Faculty:</b>\n");                  printf("<b>U Faculty:</b>\n");
2022                  printf("</td><td colspan = \"2\" valign=\"top\" >\n");                  printf("</td><td colspan = \"2\" valign=\"top\" >\n");
2023                  printf("<select name=\"faculty_id\">\n");                  printf("<select name=\"faculty_id\">\n");
2024                  dropDownFaculty($con);                  dropDownFaculty();
2025                  printf("</select>");                  printf("</select>");
2026                  printf("</td></tr>\n");                  printf("</td></tr>\n");
2027    
# Line 2108  function formCoursePers($con, $active, $ Line 2071  function formCoursePers($con, $active, $
2071                                    
2072                  // Submit or reset form                  // Submit or reset form
2073                  printf("<tr><td align=\"right\">\n");                  printf("<tr><td align=\"right\">\n");
2074                  printf("<input type=\"submit\" value=\"Submit\"> ");                  printf("<input type=\"submit\" value=\"Submit\">\n");
2075                  printf("</td><td align=\"center\">\n");                  printf("</td><td align=\"center\">\n");
2076                  printf("<input type=\"reset\" value=\"Reset\">\n");                              printf("<input type=\"reset\" value=\"Reset\">\n");            
2077                  printf("</td>\n");                  printf("</td>\n");
# Line 2135  function formCoursePers($con, $active, $ Line 2098  function formCoursePers($con, $active, $
2098  /**********************************************************  /**********************************************************
2099  Function: formPageHeader  Function: formPageHeader
2100  Author: Paul Bramscher  Author: Paul Bramscher
2101  Last Modified: 01.27.2004  Last Modified: 03.11.2004
2102  ***********************************************************  ***********************************************************
2103  Purpose:  Purpose:
2104  This function allows the editing of the supplied page id  This function allows the editing of the supplied page id
2105  pageheader field.  pageheader field.
2106  **********************************************************/    **********************************************************/  
2107  function formPageHeader($con, $active, $page_id) {  function formPageHeader($active, $page_id) {
2108    
2109          // Retrieve current information          // Retrieve current information
2110          $sql = "SELECT          $sql = "SELECT
# Line 2152  function formPageHeader($con, $active, $ Line 2115  function formPageHeader($con, $active, $
2115                  page_id = " . $page_id;                  page_id = " . $page_id;
2116    
2117                    
2118          $rs = xx_query($sql, $con);          $rs = xx_tryquery($sql);
2119          $row = xx_fetch_array ($rs);          $row = xx_fetch_array ($rs, xx_ASSOC);
2120    
2121          $pageheader = $row["pageheader"];          $pageheader = $row["pageheader"];
2122    
2123          // Run strings through the HTML cleaner for output          // Run strings through the HTML cleaner for output
2124          $pageheader = textOutHTML($pageheader);          // $pageheader = textOutHTML($pageheader);
2125                    
2126                    
2127          /****************          /****************
# Line 2186  function formPageHeader($con, $active, $ Line 2149  function formPageHeader($con, $active, $
2149                  // Save or cancel                  // Save or cancel
2150                  printf("<input type=\"submit\" value =\"Save\">\n");                  printf("<input type=\"submit\" value =\"Save\">\n");
2151                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);                  printf("<a href=\"scribe.phtml?page_id=%d\">Cancel</a>\n", $page_id);
   
2152                  printf("</td>\n");                  printf("</td>\n");
2153                  printf("</form>\n");                  printf("</form>\n");
2154    
# Line 2194  function formPageHeader($con, $active, $ Line 2156  function formPageHeader($con, $active, $
2156                    
2157          // Inactive          // Inactive
2158          else {            else {  
2159                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">", $page_id);                  printf("<form method=\"POST\" action=\"scribe.phtml?page_id=%d\">\n", $page_id);
2160                  printf("<td align=\"left\">\n");                  printf("<td align=\"left\">\n");
2161                  printf("<input type=\"Hidden\" name=\"active\" value=\"pageheader\">");                  printf("<input type=\"Hidden\" name=\"active\" value=\"pageheader\">\n");
2162                  printf("%s ", $pageheader);                  printf("%s ", $pageheader);
2163                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");                  printf("<input type = \"image\" src=\"images/edit.gif\" name =\"edit\" alt=\"edit\">\n");
2164                  printf("</td>\n");                  printf("</td>\n");
# Line 2212  function formPageHeader($con, $active, $ Line 2174  function formPageHeader($con, $active, $
2174  /**********************************************************  /**********************************************************
2175  Function:pageTitleStyle  Function:pageTitleStyle
2176  Author: Paul Bramscher  Author: Paul Bramscher
2177  Last Modified: 11.21.2003  Last Modified: 03.11.2004
2178  ***********************************************************  ***********************************************************
2179  Purpose:  Purpose:
2180  Display the style elements (1-5) that may be applied to  Display the style elements (1-5) that may be applied to
# Line 2220  the CLPS page title.  The currently-enfo Line 2182  the CLPS page title.  The currently-enfo
2182  (if non-NULL) is displayed in boldface.  If no style  (if non-NULL) is displayed in boldface.  If no style
2183  is selected, the "X" is bolded.  is selected, the "X" is bolded.
2184  **********************************************************/  **********************************************************/
2185  function pageTitleStyle($con, $page_id, $pagetitle_style){  function pageTitleStyle($page_id, $pagetitle_style){
2186    
2187          // Initial the bolding variables          // Initial the bolding variables
2188          $bold0 = "";          $bold0 = "";
# Line 2269  function pageTitleStyle($con, $page_id, Line 2231  function pageTitleStyle($con, $page_id,
2231          printf("%s<a href=\"scribe_transaction.phtml?transaction=updatePageTitleStyle&page_id=%d&pagetitle_style=5\">5</a>%s ]\n", $bold5, $page_id, $bold5_close);          printf("%s<a href=\"scribe_transaction.phtml?transaction=updatePageTitleStyle&page_id=%d&pagetitle_style=5\">5</a>%s ]\n", $bold5, $page_id, $bold5_close);
2232    
2233  }  }
2234    ?>
   
 /**********************************************************  
 Function: readButtons  
 Author: Paul Bramscher  
 Last Modified: 08.25.2003  
 ***********************************************************  
 Purpose:  
 Display read-only buttons (currently only copy an element),  
 rather than the full authoring set of buttons on a scribe  
 page.  
 **********************************************************/  
 function readButtons($con, $element_size, $label_text, $label_url,  
         $place_array, $resource_id, $page_id, $element_id){  
   
         // Break apart place array  
         // $element_id = $place_array[0];  
         // $element_order = $place_array[1];  
         // $indent_level = $place_array[2];  
         // $parent_id = $place_array[3];  
         $position = $place_array[4];  
   
         // Initial the bolding variables  
         $bold0 = "";  
         $bold0_close = "";  
         $bold1 = "";  
         $bold1_close = "";  
         $bold2 = "";  
         $bold2_close = "";  
         $bold3 = "";  
         $bold3_close = "";  
         $bold4 = "";  
         $bold4_close = "";  
         $bold5 = "";  
         $bold5_close = "";        
   
         // Display the selected size in bold type  
         switch ($element_size) {  
           
                 case 1: $bold1 = "<b>";  
                         $bold1_close = "</b>";  
                         break;                    
                 case 2: $bold2 = "<b>";  
                         $bold2_close = "</b>";  
                         break;  
                 case 3: $bold3 = "<b>";  
                         $bold3_close = "</b>";  
                         break;  
                           
                 case 4: $bold4 = "<b>";  
                         $bold4_close = "</b>";  
                         break;  
                 case 5: $bold5 = "<b>";  
                         $bold5_close = "</b>";  
                         break;                    
                 default: $bold0 = "<b>";  
                         $bold0_close = "</b>";  
                         break;    
         }  
   
         // Copy  
         printf("<a href=\"scribe_read.phtml?page_id=%d&cmd=copyElement&this_pos=%d#p%d\"><img src=\"images/copy.gif\" border=\"0\" alt=\"copy\"></a>\n", $page_id, $position, $position);  
   
 }  
 ?>  

Legend:
Removed from v.71  
changed lines
  Added in v.72

  ViewVC Help
Powered by ViewVC 1.1.26