root/main/trunk/greenstone2/macros/deposit.dm @ 22559

Revision 22559, 17.9 KB (checked in by kjdon, 10 years ago)

added tbody element to table where we will be dynamically adding the metadata fields. IE adds this in by default if its not there already, and then the trs that we create don't get added to the right place. So now the fields should show up in IE. tested in IE8.

  • Property svn:keywords set to Author Date Id Revision
Line 
1# this file must be UTF-8 encoded
2
3package depositor
4
5_imagethispage_ {<a href="_httppagedepositor_">_textdepositor_</a>}
6
7# _pagescriptextra_ will be set to the appropriate _***scriptextra_
8# macro from within the server
9_pagescriptextra_ {}
10
11# a plain header for those pages that need it (the _pagebanner_ macro
12# will be set to this by the server for those pages.
13_plainbanner_ {}
14
15# dont want links to help" or "preferences" pages from within
16# collector
17_globallinks_ {_homelink_}
18
19# metadata fields that will be displayed in the step1 page,
20# this is determined by the depositormetadata macro defined in the collection's collect.cfg
21_metadataconf_ {var DepositorMDFields = new Array();}
22
23# store any existing metadata values
24_cachedmetadatavalues_ {var CachedMDValues = new Array();}
25
26#######################################################################
27# steps
28
29_numsteps_ {3}
30
31# clashes with general text (in english2.dm) about what to do at this stage
32# now it doesn't appear in wizard bar, is it needed?
33##_textselect_ {The Depositor}
34_textstep1_ {_textmeta_}
35_textstep2_ {_textintro_}
36_textstep3_ {_textconfirm_}
37
38_laststep_ {bild}
39_textlaststep_ {_textbild_}
40
41
42#######################################################################
43# icons
44
45_iconcross_ {<img src="_httpimg_/cross.gif">}
46_iconcross_ [v=1] {<b>no</b>}
47_icontick_ {<img src="_httpimg_/tick.gif">}
48_icontick_ [v=1] {<b>yes</b>}
49_iconblank_ {<img src="_httpimg_/blank.gif">}
50_iconblank_ [v=1] {}
51
52_imagemore_ {<a href="javascript:more()" onMouseover="roll('more',1);" onMouseOut="roll('more',0);"><img
53name="more" src="_httpimg_/moreof.gif" onLoad="gbutton(this,'_httpimg_/moreon.gif');" border=0 alt="_textmore_"
54title="_textmore_" align=top></a>}
55_imagemore_ [v=1] {_textmore_}
56
57_icongreyarrow_ {<img src="_httpimg_/grarrow.gif">}
58_icongreyuparrow_ {<img src="_httpimg_/guarrow.gif">}
59_iconstop_ {<img src="_httpimg_/stop.gif" border=0>}
60
61
62#######################################################################
63# http macros
64
65_httpinfo_ {_gwcgi_?e=_compressedoptions_&p=info}
66_httpsrce_ {_gwcgi_?e=_compressedoptions_&p=srce}
67_httpconf_ {_gwcgi_?e=_compressedoptions_&p=conf}
68_httpbild_ {_gwcgi_?e=_compressedoptions_&p=bild}
69_httpview_ {_gwcgi_?a=p&p=about&c=_cgiargdi1dirname_}
70_httpdel_  {javascript:do\_delete();}
71_httpexpt_ {_gwcgi_?e=_compressedoptions_&p=expt}
72
73
74#######################################################################
75# select // this really should be intro
76#######################################################################
77
78# _fullnamemenu_ has previous collection selected. Since there is no button
79# on this page to proceed, we reset the drop down box to have no collection
80# selected.
81_selectheader_ {_cgihead_
82_htmlhead_(class="bgimage" onLoad="initialize();")_startspacer_
83}
84
85
86_selectscriptextra_ {
87
88function initialize() \{
89  document.depositorform.di1dirname.value = "";
90\}
91
92function check\_submit (gotopage) \{
93  var form = document.depositorform;
94  form.p.value = gotopage;
95
96  // if 'dirname' given, then link to cgiarg c so collection specific macros work
97  if (form.di1dirname) \{
98    form.c.value = form.di1dirname.value;
99  \}
100
101  form.submit();
102\}
103
104function menuchange() \{
105
106  _buildtypearray_
107
108  var form = document.depositorform;
109
110  if (form.di1dirname.value == "") \{
111    alert("Please choose a collection first");
112  \}
113  else \{
114    var pos = form.di1dirname.selectedIndex;
115    var bt = buildtype[pos];
116    if (bt=="") \{ bt = "mg"; \}
117    form.di1buildtype.value = bt;
118
119    check\_submit('step1'); 
120  \}
121\}
122
123}
124
125_selectcontent_ {
126<form name="depositorform" method=post action="_gwcgi_">
127<input type=hidden name="e" value="_decodedcompressedoptions_">
128<input type=hidden name="p" value="intro">
129<input type=hidden name="c" value="">
130<input type=hidden name="di1buildtype" value="">
131
132<center>
133<table width=_pagewidth_>
134<tr><td>
135<div class="divbar">&nbsp;</div>
136<center><h2>_textselect_</h2></center>
137<div class="divbar">&nbsp;</div>
138
139<p> <em>_textselectcol_</em>
140
141<p>_fullnamemenu_<br><br>
142<div class="divbar">&nbsp;</div>
143</td></tr>
144</table>
145</center>
146</form>
147}
148
149
150#######################################################################
151# step 1
152#######################################################################
153
154#here goes the "memorization" macros for each form field. 
155#_di1md.Title_ {_If_("_:cgiargdi1md.Title_" eq  "_cgiargdi1md.Title_",_cgiargdi1md.Title_,)}
156#_di1md.Creator_ {_If_("_:cgiargdi1md.Creator_" eq  "_cgiargdi1md.Creator_",_cgiargdi1md.Creator_,)}
157#_di1md.Description_ {_If_("_:cgiargdi1md.Description_" eq  "_cgiargdi1md.Description_",_cgiargdi1md.Description_,)}
158#_di1md.Subject_ {_If_("_:cgiargdi1md.Subject_" eq "_cgiargdi1md.Subject_",_cgiargdi1md.Subject,)}
159
160_step1scriptextra_ {
161
162_metadataconf_
163_cachedmetadatavalues_
164
165function loadForm() \{
166
167    var formcontainer = document.getElementById('formcontainer');
168
169    if (!formcontainer) \{
170        return;
171    \}
172
173    for (i=0; i < DepositorMDFields.length; i++) \{
174        if (DepositorMDFields[i]==null) \{
175            continue;
176        \}
177        metadataField = DepositorMDFields[i];
178       
179        var labelCell = document.createElement("td");
180        labelCell.innerHTML = metadataField.label + ": ";
181        labelCell.setAttribute("title", metadataField.tooltip);
182                       
183        var cachedValue;
184        if(CachedMDValues[0] !=null && CachedMDValues[0]["di1md." + metadataField.name])\{
185            cachedValue = CachedMDValues[0]["di1md." + metadataField.name];
186        \} else \{
187            cachedValue = "";
188        \}
189       
190        var inputObj;
191        if (metadataField.type=="text") \{
192            inputObj = document.createElement("input");
193            inputObj.setAttribute("type","text");
194            inputObj.setAttribute("size","74");
195            inputObj.setAttribute("value", cachedValue);
196        \}
197        else if (metadataField.type=="textarea") \{
198            inputObj = document.createElement("textarea");
199            inputObj.setAttribute("rows","5");
200            inputObj.setAttribute("cols", "40");
201            inputObj.innerHTML = cachedValue;
202        \} 
203        inputObj.setAttribute("name", "di1md."+ metadataField.name);
204       
205        var inputCell = document.createElement("td");
206        inputCell.appendChild(inputObj);       
207                               
208        var entry = document.createElement("tr");   
209        entry.appendChild(labelCell);
210        entry.appendChild(inputCell);
211       
212        formcontainer.appendChild(entry);
213    \}
214\}
215
216function check\_submit (gotopage) \{
217  var form = document.depositorform;
218  form.p.value = gotopage;
219  form.submit();
220\}
221
222if (window.addEventListener) window.addEventListener("load", loadForm, false);
223else if (window.attachEvent) window.attachEvent("onload", loadForm);
224
225}
226
227_step1content_ {
228
229<form name="depositorform" method=post action="_gwcgi_" enctype="multipart/form-data">
230
231<input type=hidden name="e" value="_decodedcompressedoptions_">
232<input type=hidden name="p" value="_cgiargp_">
233
234
235<center>
236<table width=_pagewidth_>
237<tr><td>
238<div class="divbar">&nbsp;</div>
239<center>
240<h2>_textstep1_</h2>
241<p>_textdepositorblurb_
242</center>
243<div class="divbar">&nbsp;</div>
244<ul>
245
246<!--input goes here-->
247<!--dynamic load the metadata elements as configured in the collection's collect.cfg-->
248<p><table><tbody id="formcontainer"></tbody></table>
249
250<div class="divbar">&nbsp;</div>
251</td></tr>
252<tr><td>_depositorbar_</td></tr>
253</table></center>
254
255</form>
256
257}
258
259#######################################################################
260# step 2
261#######################################################################
262
263_userfile_ {_If_("_:cgiargdi1userfile_" eq  "_cgiargdi1userfile_",_cgiargdi1userfile_,)}
264
265_step2scriptextra_ {
266
267function check\_submit (gotopage) \{
268  var form = document.depositorform;
269  form.p.value = gotopage;
270  form.submit();
271\}
272}
273
274_step2content_ {
275<form name="depositorform" method=post action="_gwcgi_" enctype="multipart/form-data">
276<input type=hidden name="e" value="_decodedcompressedoptions_">
277<input type=hidden name="p" value="_cgiargp_">
278<center>
279<table width=_pagewidth_>
280<tr><td>
281<div class="divbar">&nbsp;</div>
282<center><h2>_textstep2_</h2></center>
283<div class="divbar">&nbsp;</div>
284<p>_textfilename_: <input type=file name=di1userfileinfo value="_userfile_"></p>
285<div class="divbar">&nbsp;</div>
286</td></tr>
287<tr><td>_depositorbar_</td></tr>
288</table>
289</center>
290</form>
291}
292
293#######################################################################
294# step 3
295#######################################################################
296
297#here goes the "memorization" macros for each form field. 
298#_di1_ {_If_("_:cgiargdi1md.Title_" eq  "_cgiargdi1md.Title_",_cgiargdi1md.Title_,)}
299#_di1md.Creator_ {_If_("_:cgiargdi1md.Creator_" eq  "_cgiargdi1md.Creator_",_cgiargdi1md.Creator_,)}
300
301_step3scriptextra_ {
302
303function check\_submit (gotopage) \{
304  var form = document.depositorform;
305  form.p.value = gotopage;
306  form.submit();
307\}
308}
309
310_step3content_ {
311<form name="depositorform" method=post action="_gwcgi_" enctype="multipart/form-data">
312<input type=hidden name="e" value="_decodedcompressedoptions_">
313<input type=hidden name="p" value="_cgiargp_">
314<center>
315<table width=_pagewidth_>
316<tr><td>
317<div class="divbar">&nbsp;</div>
318<center><h2>_textstep3_</h2></center>
319<div class="divbar">&nbsp;</div>
320<p>_textfilename_: _di1userfile_ </p>
321<p>_textfilesize_: _di1userfilesize_ </p> 
322<div class="divbar">&nbsp;</div>
323</td></tr>
324<tr><td>_depositorbar_</td></tr>
325</table>
326</center>
327</form>
328}
329
330#######################################################################
331# bild (main frameset for build page)
332#######################################################################
333
334_bildcontent_ {
335<html>
336<head>
337<!--
338<script>
339function check\_submit (gotopage) \{
340  var form = document.depositorform;
341  form.p.value = gotopage;
342  form.submit();
343\}
344</script>
345-->
346</head>
347
348<form name="depositorform" method=post action="_gwcgi_">
349<input type=hidden name="e" value="_decodedcompressedoptions_">
350<input type=hidden name="p" value="_cgiargp_">
351
352<frameset rows="*,160" border=0>
353  <noframes><body bgcolor="#ffffff">
354  <p>You must have a frame enabled browser to obtain feedback
355  on how the building process is progressing. The collection <i>will</i>
356  continue to build as normal however.</p>
357
358  <table>
359  <tr valign=center><td>
360  To stop the building process at any time, click here.
361  <br>The collection you are working on will remain intact.
362  </td>
363  <td><input type="submit" value="stop building"></td>
364  </table>
365
366  </body>
367  </noframes>
368  <frame src="_gwcgi_?e=_compressedoptions_&p=bildframe1">
369  <frame src="_gwcgi_?e=_compressedoptions_&p=bildstatus">
370</frameset>
371</html>
372}
373
374#######################################################################
375# bildframe1
376#######################################################################
377
378# header overridden to allow base target to be set
379
380_bildframe1header_ {_cgihead_
381<html>
382<head>
383<base target=_top>
384<title>_pagetitle_</title>
385_globalscripts_
386_cssheader_
387</head>
388<body class="bgimage">
389_startspacer__pagebanner_
390}
391
392
393_bildframe1header_[v=1] {_cgihead_
394<html>
395<head>
396<base target=_top>
397<title>_pagetitle_</title>
398_globalscripts_
399</head>
400<body class="bgimage">
401_pagebanner_
402}
403
404_bildframe1scriptextra_ {}
405
406_bildframe1content_ {
407<form name="depositorform" method=post action="_gwcgi_">
408<input type=hidden name="e" value="_decodedcompressedoptions_">
409<input type=hidden name="p" value="bildcancel">
410
411<center>
412<table width=_pagewidth_>
413<tr><td>
414<div class="divbar">&nbsp;</div>
415<center>
416<h2>_textbild_</h2>
417</center>
418<div class="divbar">&nbsp;</div>
419<p>
420_depositor:textbild1_
421<p>
422
423<table>
424<tr valign=center><td>
425_depositor:textbild2_
426</td>
427<td><input type="submit" value="_depositor:textstopbuild_"></td>
428</table>
429
430<p>
431_depositor:textbild3_
432</td></tr>
433</table></center>
434</form>
435}
436
437
438#######################################################################
439# bildcancel
440#######################################################################
441
442_bildcancelscriptextra_ {
443function check\_submit (gotopage) \{
444  var form = document.depositorform;
445  form.p.value = gotopage;
446  form.submit();
447\}
448}
449_bildcancelcontent_ {
450<form name="depositorform" method=post action="_gwcgi_">
451<input type=hidden name="e" value="_decodedcompressedoptions_">
452<input type=hidden name="p" value="_cgiargp_">
453
454</form>
455<center>
456<table width=_pagewidth_>
457<tr><td>
458<div class="divbar">&nbsp;</div>
459<center>
460<h2>_depositor:textbuildcancelled_</h2>
461</center>
462<div class="divbar">&nbsp;</div>
463<p>
464_depositor:textbildcancel1_
465<p><center>
466_depositorbar_
467</center>
468
469</td></tr>
470</table></center>
471}
472
473
474#######################################################################
475# bildstatus
476#######################################################################
477
478# special header for status page
479_bildstatusheader_ {_cgihead_
480_htmlhead_(class="bgimage" onLoad="initialize();")_startspacer_
481}
482_bildstatusheader_[v=1] {_cgihead_
483_htmlhead_(onLoad="initialize();")
484}
485
486_bildstatusscriptextra_ {
487var timer = 5;
488function initialize() \{
489  setTimeout("count_down()",1000);
490\}
491
492function count_down() \{
493  if (timer==0) \{
494    window.status = "";
495    document.depositorform.submit();
496  \} else \{
497    if (timer==1) \{
498    window.status = "_textbsupdate1_";
499    \} else \{
500    window.status = "_textbsupdate2_ "+timer+" _textseconds_";
501    \}
502    timer--;
503    setTimeout("count_down()",1000);
504  \}   
505\}
506}
507
508_bildstatuscontent_ {
509<form name="depositorform" method=post action="_gwcgi_">
510<input type=hidden name="e" value="_decodedcompressedoptions_">
511
512<center>
513<table width=_pagewidth_>
514<tr><td><center>
515_statusline_
516</center>
517</td></tr>
518</table></center>
519</form>
520}
521
522
523#######################################################################
524# bilddone
525#######################################################################
526
527_bilddoneheader_ {_cgihead_
528_htmlhead_(class="bgimage")_startspacer_
529}
530_bilddonescriptextra_ {
531
532function check\_submit (gotopage) \{
533  var form = document.depositorform;
534  form.p.value = gotopage;
535  form.submit();
536\}
537
538}
539
540
541_bilddonecontent_ {
542<center>
543<table width=_pagewidth_>
544<tr><td>
545<p>_textbildsuc_
546
547<p>_textviewbildsummary_
548
549<p><center>
550_depositorbar_
551</center>
552
553</td></tr>
554</table></center>
555}
556
557
558#######################################################################
559# bildfail
560#######################################################################
561
562_bildfailheader_ {_cgihead_
563_htmlhead_(class="bgimage")_startspacer_
564}
565_bildfailscriptextra_ {
566function check\_submit (gotopage) \{
567  var form = document.depositorform;
568  form.p.value = gotopage;
569  form.submit();
570\}
571}
572_bildfailcontent_ {
573<form name="depositorform" method=post action="_gwcgi_">
574<input type=hidden name="e" value="_decodedcompressedoptions_">
575<input type=hidden name="p" value="_cgiargp_">
576
577</form>
578
579<table width=_pagewidth_>
580<tr><td>
581_textfailmsg_
582</td></tr>
583<tr><td>
584</td></tr>
585</table></center>
586}
587
588# _textfailmsg_ will be set to one of the following macros from within
589# the server
590
591_textfailmsg1_ {
592_textfailmsg11_
593<p><center>
594_depositorbar_
595</center>
596}
597
598_textfailmsg6_ {_textfailmsg1_}
599
600_textfailmsg2_ {
601_textfailmsg21_
602<p>_textblcont_
603<p>_faillog_
604<p>_texttryagain_
605}
606
607_textfailmsg3_ {
608_textfailmsg31_
609<p>_textblcont_
610<p>_faillog_
611<p>_texttryagain_
612}
613
614_textfailmsg4_ {
615_textfailmsg41_
616<p>_textblcont_
617<p>_faillog_
618}
619
620_textfailmsg5_ {_textfailmsg4_}
621
622_textfailmsg7_ {
623_textfailmsg71_
624<p>_texttryagain_
625}
626
627#######################################################################
628# Error and message pages
629#######################################################################
630
631_messagehead_ {
632<form name="depositorform" method=post action="_gwcgi_">
633<input type=hidden name="e" value="_decodedcompressedoptions_">
634
635<center>
636<table width=_pagewidth_>
637<tr><td>
638<div class="divbar">&nbsp;</div>
639}
640
641_messagefoot_ {
642<p>
643<a href="javascript:document.depositorform.submit();">_textretcoll_</a>
644<div class="divbar">&nbsp;</div>
645</td></tr>
646</table></center>
647</form>
648}
649
650_messagefootnolink_ {
651<div class="divbar">&nbsp;</div>
652</td></tr>
653</table></center>
654</form>
655}
656
657#_delpermissioncontent_ {
658#_messagehead_
659#<p>
660#_textdelperm_
661#_messagefoot_
662#}
663
664#_delinvalidcontent_ {
665#_messagehead_
666#<p>
667#_textdelinv_
668#_messagefoot_
669#}
670
671#_delsuccesscontent_ {
672#_messagehead_
673#<p>
674#_textdelsuc_
675#_messagefoot_
676#}
677
678#_clonefailcontent_ {
679#_messagehead_
680#<input type=hidden name="bc1clone" value="0">
681#<p>_textclonefail_
682#_messagefoot_
683#}
684
685_genericcontent_ {
686_messagehead_
687<p>_textcolerr_
688_messagefoot_
689}
690
691_tmpfailcontent_ {
692_messagehead_
693<p>
694_texttmpfail_
695_messagefoot_
696}
697
698#_mkcolfailcontent_ {
699#_messagehead_
700#<p>_textmkcolfail_
701#_messagefoot_
702#}
703
704_nocollectioncontent_ {
705_messagehead_
706<p>_textnocontent_
707<br><a href="_httppagedepositor_">_textrestart_</a>
708<p>
709_messagefootnolink_
710}
711
712#_reloaderrorcontent_ {
713#_messagehead_
714#<p>_textreloaderror_
715#<br><a href="_httppagedepositor_">_textrestart_</a>
716#<p>
717#_messagefootnolink_
718#}
719
720_exptscriptextra_ {}
721
722#_exptsuccesscontent_ {
723#_messagehead_
724#<input type=hidden name=p value=existing>
725#<p>_textexptsuc_
726#_messagefoot_
727#}
728
729#_exptfailcontent_ {
730#_messagehead_
731#<input type=hidden name=p value=existing>
732#_textexptfail_
733#_messagefoot_
734#}
735
736#######################################################################
737# depositonly
738#######################################################################
739
740_depositonlyscriptextra_ {}
741
742_depositonlycontent_ {
743
744<center>
745<em>Thanks for using the Depositor! Cick <a href="_gwcgi_">here</a> to return to the Greenstone home page. </em>
746<table width=_pagewidth_>
747<tr><td>
748<div class="divbar">&nbsp;</div>
749<center><h2>_textstep3_</h2></center>
750<div class="divbar">&nbsp;</div>
751<p>_textfilename_: _di1userfile_ </p>
752<p>_textfilesize_: _di1userfilesize_ </p> 
753<div class="divbar">&nbsp;</div>
754</td></tr>
755<tr><td></td></tr>
756</table>
757</center>
758
759}
760
761###################################################
762## text macros that are defined by another package
763###################################################
764
765
766_textbsupdate1_ {_wizard:textbsupdate1_}
767_textbsupdate2_ {_wizard:textbsupdate2_}
768_textseconds_ {_wizard:textseconds_}
769
770_textbildsuc_ {_wizard:textbildsuc_}
771_textviewbildsummary_ {_wizard:textviewbildsummary_}
772
773_textview_ {_wizard:textview_}
774_textbild1_ {_wizard:textbild1_}
775
776_textbild2_ {_wizard:textbild2_}
777
778_textstopbuild_ {_wizard:textstopbuild_}
779
780_textbild3_ {_wizard:textbild3_}
781
782_textbuildcancelled_ {_wizard:textbuildcancelled_}
783
784_textbildcancel1_ {_wizard:textbildcancel1_}
785
786_textfailmsg11_ {_wizard:textfailmsg11_}
787_textfailmsg21_ {_wizard:textfailmsg21_}
788_textblcont_ {_wizard:textblcont_}
789
790_textfailmsg31_ {_wizard:textfailmsg31_}
791_textfailmsg41_ {_wizard:textfailmsg41_}
792_textfailmsg71_ {_wizard:textfailmsg71_}
Note: See TracBrowser for help on using the browser.