Annotation of loncom/interface/lonmenu.pm, revision 1.40
1.1 www 1: # The LearningOnline Network with CAPA
2: # Routines to control the menu
3: #
1.40 ! www 4: # $Id: lonmenu.pm,v 1.39 2003/02/14 21:22:04 www Exp $
1.11 albertel 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
1.1 www 28: # (TeX Conversion Module
29: #
30: # 05/29/00,05/30 Gerd Kortemeyer)
31: #
1.8 www 32: # 10/05,05/28,05/30,06/01,06/08,06/09,07/04,08/07 Gerd Kortemeyer
1.17 matthew 33: # 02/15/02 Matthew Hall
1.1 www 34:
35: package Apache::lonmenu;
36:
37: use strict;
1.2 www 38: use Apache::lonnet;
1.33 www 39: use Apache::Constants qw(:common);
40: use Apache::loncommon;
1.2 www 41: use Apache::File;
42: use vars qw(@desklines $readdesk);
1.38 www 43:
1.40 ! www 44: # ============================= This gets called at the top of the body section
1.38 www 45:
46: sub menubuttons {
47: my $forcereg=shift;
48: my $target =shift;
1.40 ! www 49: my $registration=shift;
1.38 www 50: unless ($ENV{'browser.interface'} eq 'textual') { return ''; }
1.39 www 51: my $output='<a href="/adm/menu">Main Menu</a><br />';
1.40 ! www 52: if ($registration) { $output.=&innerregister($forcereg,$target); }
1.39 www 53: return $output."<hr />";
1.38 www 54: }
55:
1.40 ! www 56: # ====================================== This gets called in the header section
1.38 www 57:
58: sub registerurl {
59: my $forcereg=shift;
60: my $target = shift;
61: my $result = '';
62:
63: if ($target eq 'edit') {
64: $result .="<script type=\"text/javascrtipt\">\n".
65: "if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n".
66: &Apache::loncommon::browser_and_searcher_javascript().
67: "\n</script>\n";
68: }
69: if (($ENV{'browser.interface'} eq 'textual') ||
70: ((($ENV{'request.publicaccess'}) ||
71: (!&Apache::lonnet::is_on_map($ENV{'REQUEST_URI'}))) &&
72: (!$forcereg))) {
73: return $result.
74: '<script type="text/javascript">function LONCAPAreg(){;} function LONCAPAstale(){}</script>';
75: }
76: if ($Apache::lonxml::registered && !$forcereg) { return ''; }
1.40 ! www 77: $result.=&innerregister($forcereg,$target);
! 78: return $result;
! 79: }
! 80:
! 81: # =========== This gets called in order to register a URL, both with the Remote
! 82: # =========== and in the body of the document
! 83:
! 84: sub innerregister {
! 85: my $forcereg=shift;
! 86: my $target = shift;
! 87: my $result = '';
! 88:
1.38 www 89: $Apache::lonxml::registered=1;
1.40 ! www 90:
! 91: my $textual=($ENV{'browser.interface'} eq 'textual');
1.38 www 92: my $reopen=&Apache::lonmenu::reopenmenu();
1.40 ! www 93:
1.38 www 94: my $newmail='';
95: if (&Apache::lonmsg::newmail()) {
1.40 ! www 96: $newmail=($textual?'<b>You have messages</b><br />':
! 97: 'swmenu.setstatus("you have","messages");');
1.38 www 98: }
1.40 ! www 99: my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');');
! 100: # -- This is for URLs that actually can be registered
1.38 www 101: if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) {
1.40 ! www 102: # -- This applies to homework problems for users with grading privileges
1.38 www 103: my $hwkadd='';
1.40 ! www 104: if
! 105: ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {
1.38 www 106: if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {
1.40 ! www 107: $hwkadd.=&switch('','',7,1,'subm.gif','view sub','missions',
! 108: "gocmd('/adm/grades','submission')",
! 109: 'View user submissions for this assessment resource');
1.38 www 110: }
111: if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) {
1.40 ! www 112: $hwkadd.=&switch('','',7,2,'pgrd.gif','problem','grades',
! 113: "gocmd('/adm/grades','gradingmenu')",
! 114: 'Modify user grades for this assessment resource');
1.38 www 115: }
116: if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) {
1.40 ! www 117: $hwkadd.=&switch('','',7,3,'pparm.gif','problem','parms',
! 118: "gocmd('/adm/parmset','set')",
! 119: 'Modify deadlines, etc, for this assessment resource');
1.38 www 120: }
121: }
1.40 ! www 122: # -- End Homework
1.38 www 123: ###
124: ### Determine whether or not to display the 'cstr' button for this
125: ### resource
126: ###
127: my $editbutton = '';
128: if ($ENV{'user.author'}) {
129: if ($ENV{'request.role'}=~/^(ca|au)/) {
130: # Set defaults for authors
131: my ($top,$bottom) = ('con-','struct');
132: my $action = "go('/priv/".$ENV{'user.name'}."');";
133: my $cadom = $ENV{'request.role.domain'};
134: my $caname = $ENV{'user.name'};
135: my $desc = "Enter my resource construction space";
136: # Set defaults for co-authors
137: if ($ENV{'request.role'} =~ /^ca/) {
138: ($cadom,$caname)=($ENV{'request.role'}=~/(\w+)\/(\w+)$/);
139: ($top,$bottom) = ('co con-','struct');
140: $action = "go('/priv/".$caname."');";
141: $desc = "Enter construction space as co-author";
142: }
143: # Check that we are on the correct machine
144: my $home = &Apache::lonnet::homeserver($caname,$cadom);
145: if ($home eq $Apache::lonnet::perlvar{'lonHostID'}) {
1.40 ! www 146: $editbutton=&switch
1.38 www 147: ('','',6,1,$top,,$bottom,$action,$desc);
148: }
149: }
150: ##
151: ## Determine if user can edit url.
152: ##
153: my $cfile='';
154: my $cfuname='';
155: my $cfudom='';
156: if ($ENV{'request.filename'}) {
157: my $file=&Apache::lonnet::declutter($ENV{'request.filename'});
158: $file=~s/^(\w+)\/(\w+)/\/priv\/$2/;
159: # Chech that the user has permission to edit this resource
160: ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1);
161: if (defined($cfudom)) {
162: if (&Apache::lonnet::homeserver($cfuname,$cfudom)
163: eq $Apache::lonnet::perlvar{'lonHostID'}) {
164: $cfile=$file;
165: }
166: }
167: }
168: # Finally, turn the button on or off
169: if ($cfile) {
1.40 ! www 170: $editbutton=&switch
1.38 www 171: ('','',6,1,'cstr.gif','edit','resource',
172: "go('".$cfile."');","Edit this resource");
173: } elsif ($editbutton eq '') {
1.40 ! www 174: $editbutton=&clear(6,1);
1.38 www 175: }
176: }
177: ###
178: ###
179: $result = (<<ENDREGTHIS);
180:
181: <script language="JavaScript">
182: // BEGIN LON-CAPA Internal
183:
184: function LONCAPAreg() {
185: swmenu=$reopen;
186: swmenu.clearTimeout(swmenu.menucltim);
187: $timesync
188: $newmail
189: swmenu.currentURL=window.location.pathname;
190: swmenu.reloadURL=window.location.pathname;
191: swmenu.currentSymb="$ENV{'request.symb'}";
192: swmenu.reloadSymb="$ENV{'request.symb'}";
193: swmenu.currentStale=0;
194: swmenu.clearbut(3,1);
195: swmenu.switchbutton
196: (6,3,'catalog.gif','catalog','info','catalog_info()','Show catalog information');
197: swmenu.switchbutton
198: (8,1,'eval.gif','evaluate','this','gopost("/adm/evaluate",currentURL)','Provide my evaluation of this resource');
199: swmenu.switchbutton
200: (8,2,'fdbk.gif','feedback','discuss','gopost("/adm/feedback",currentURL)','Provide feedback messages or contribute to the course discussion about this resource');
201: swmenu.switchbutton
202: (8,3,'prt.gif','prepare','printout','gopost("/adm/printout",currentURL)','Prepare a printable document');
203: swmenu.switchbutton
204: (2,1,'back.gif','backward','','gopost("/adm/flip","back:"+currentURL)','Go to the previous resource in the course sequence');
205: swmenu.switchbutton
206: (2,3,'forw.gif','forward','','gopost("/adm/flip","forward:"+currentURL)','Go to the next resource in the course sequence');
207: swmenu.switchbutton
208: (9,1,'sbkm.gif','set','bookmark','set_bookmark()','Set a bookmark for this resource');
209: swmenu.switchbutton
210: (9,2,'vbkm.gif','view','bookmark','edit_bookmarks()','Use or edit my bookmark collection');
211: swmenu.switchbutton
212: (9,3,'anot.gif','anno-','tations','annotate()','Make notes and annotations about this resource');
213: $hwkadd
214: $editbutton
215: }
216:
217: function LONCAPAstale() {
218: swmenu=$reopen
219: swmenu.currentStale=1;
220: if (swmenu.reloadURL!='' && swmenu.reloadURL!= null) {
221: swmenu.switchbutton
222: (3,1,'reload.gif','return','location','go(reloadURL)','Return to the last known location in the course sequence');
223: }
224: swmenu.clearbut(7,1);
225: swmenu.clearbut(7,2);
226: swmenu.clearbut(7,3);
227: swmenu.menucltim=swmenu.setTimeout(
228: 'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+
229: 'clearbut(9,1);clearbut(9,2);clearbut(9,3);clearbut(6,3);clearbut(6,1)',
230: 2000);
231:
232: }
233:
234: // END LON-CAPA Internal
235: </script>
236: ENDREGTHIS
237:
238: } else {
239: $result = (<<ENDDONOTREGTHIS);
240:
241: <script language="JavaScript">
242: // BEGIN LON-CAPA Internal
243:
244: function LONCAPAreg() {
245: swmenu=$reopen
246: $timesync
247: swmenu.currentStale=1;
248: swmenu.clearbut(2,1);
249: swmenu.clearbut(2,3);
250: swmenu.clearbut(8,1);
251: swmenu.clearbut(8,2);
252: swmenu.clearbut(8,3);
253: if (swmenu.currentURL) {
254: swmenu.switchbutton
255: (3,1,'reload.gif','return','location','go(currentURL)');
256: } else {
257: swmenu.clearbut(3,1);
258: }
259: }
260:
261: function LONCAPAstale() {
262: }
263:
264: // END LON-CAPA Internal
265: </script>
266: ENDDONOTREGTHIS
267: }
268: return $result;
269: }
270:
271: sub loadevents() {
272: return 'LONCAPAreg();';
273: }
274:
275: sub unloadevents() {
276: return 'LONCAPAstale();';
277: }
1.30 www 278:
1.32 www 279: # ============================================================= Start up remote
280:
281: sub startupremote {
282: my ($lowerurl)=@_;
1.34 www 283: if ($ENV{'browser.interface'} eq 'textual') {
284: return ('<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'" />');
285: }
1.32 www 286: my $configmenu=&rawconfig();
287: return(<<ENDREMOTESTARTUP);
288: <script>
289:
1.35 www 290: function wheelswitch() {
291: if (window.status=='|') {
292: window.status='/';
293: } else {
294: if (window.status=='/') {
295: window.status='-';
296: } else {
297: if (window.status=='-') {
298: window.status='\\\\';
299: } else {
300: if (window.status=='\\\\') { window.status='|'; }
301: }
302: }
303: }
304: }
305:
1.32 www 306: // ---------------------------------------------------------- The wait function
307: var canceltim;
308: function wait() {
309: if ((menuloaded==1) || (tim==1)) {
1.35 www 310: window.status='Done.';
1.32 www 311: if (tim==0) {
312: clearTimeout(canceltim);
313: $configmenu
314: window.location='$lowerurl';
315: } else {
1.35 www 316: alert("Remote Control timed out. It is possible that it was blocked by pop-up window filters.");
1.32 www 317: }
318: } else {
1.35 www 319: wheelswitch();
320: setTimeout('wait();',200);
1.32 www 321: }
322: }
323:
324: function main() {
1.35 www 325: canceltim=setTimeout('tim=1;',60000);
326: window.status='-';
1.32 www 327: wait();
328: }
329:
330: </script>
331: ENDREMOTESTARTUP
332: }
333:
334: sub setflags() {
335: return(<<ENDSETFLAGS);
336: <script>
337: menuloaded=0;
338: tim=0;
339: </script>
340: ENDSETFLAGS
341: }
342:
343: sub maincall() {
1.34 www 344: if ($ENV{'browser.interface'} eq 'textual') { return ''; }
1.32 www 345: return(<<ENDMAINCALL);
346: <script>
347: main();
348: </script>
349: ENDMAINCALL
350: }
1.30 www 351: # ================================================================= Reopen menu
352:
353: sub reopenmenu {
354: my $nothing='';
1.34 www 355: if ($ENV{'browser.interface'} eq 'textual') { return ''; }
1.30 www 356: my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
357: if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; }
358: return('window.open("'.$nothing.'","'.$menuname.'","",false);');
359: }
360:
1.1 www 361: # =============================================================== Open the menu
362:
363: sub open {
1.22 www 364: my $returnval='';
1.34 www 365: if ($ENV{'browser.interface'} eq 'textual') { return ''; }
1.30 www 366: my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
1.22 www 367: unless (shift eq 'unix') {
368: # resizing does not work on linux because of virtual desktop sizes
369: $returnval.=(<<ENDRESIZE);
370: if (window.screen) {
1.28 www 371: self.resizeTo(screen.availWidth-215,screen.availHeight-55);
1.22 www 372: self.moveTo(190,15);
373: }
374: ENDRESIZE
375: }
376: $returnval.=(<<ENDOPEN);
1.35 www 377: window.status='Opening LON-CAPA Remote Control';
1.30 www 378: var menu=window.open("/res/adm/pages/menu.html","$menuname",
1.14 www 379: "height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5");
1.1 www 380: ENDOPEN
1.22 www 381: return '<script>'.$returnval.'</script>';
1.1 www 382: }
383:
1.2 www 384:
385: # ================================================================== Raw Config
386:
1.3 www 387: sub clear {
388: my ($row,$col)=@_;
1.34 www 389: unless ($ENV{'browser.interface'} eq 'textual') {
1.35 www 390: return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
1.34 www 391: } else { return ''; }
1.3 www 392: }
393:
1.40 ! www 394: # ============================================ Switch a button or create a link
1.25 matthew 395: # Switch acts on the javascript that is executed when a button is clicked.
396: # The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)".
1.40 ! www 397:
1.2 www 398: sub switch {
1.40 ! www 399: my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$nobreak)=@_;
1.2 www 400: $act=~s/\$uname/$uname/g;
401: $act=~s/\$udom/$udom/g;
1.34 www 402: unless ($ENV{'browser.interface'} eq 'textual') {
403: return "\n".
1.35 www 404: qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
1.34 www 405: } else {
406: my $text=$top.' '.$bot;
407: $text=~s/\- //;
1.40 ! www 408: return ($nobreak?'':'<br />').
! 409: '<a href="javascript:'.$act.';">'.$text.'</a> '.$desc;
1.34 www 410: }
1.2 www 411: }
412:
413: sub secondlevel {
414: my $output='';
415: my
1.27 www 416: ($uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc)=@_;
1.2 www 417: if ($prt eq 'any') {
1.27 www 418: $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
1.2 www 419: } elsif ($prt=~/^r(\w+)/) {
420: if ($rol eq $1) {
1.27 www 421: $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
1.2 www 422: }
423: }
424: return $output;
425: }
426:
1.18 www 427: sub openmenu {
1.30 www 428: my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
1.34 www 429: if ($ENV{'browser.interface'} eq 'textual') { return ''; }
1.18 www 430: if ($ENV{'browser.type'} eq 'explorer') {
1.30 www 431: return "window.open('javascript:void(0);','".$menuname."');";
1.18 www 432: } else {
1.30 www 433: return "window.open('','".$menuname."');";
1.18 www 434: }
435: }
436:
1.2 www 437: sub rawconfig {
1.34 www 438: my $textualoverride=shift;
439: my $output='';
440: unless ($ENV{'browser.interface'} eq 'textual') {
1.35 www 441: $output.=
442: "window.status='Opening Remote Control';var swmenu=".&openmenu().
443: "\nwindow.status='Configuring Remote Control ';";
1.34 www 444: } else {
445: unless ($textualoverride) { return ''; }
446: }
1.2 www 447: my $uname=$ENV{'user.name'};
448: my $udom=$ENV{'user.domain'};
449: my $adv=$ENV{'user.adv'};
1.4 www 450: my $author=$ENV{'user.author'};
1.5 www 451: my $crs='';
452: if ($ENV{'request.course.id'}) {
453: $crs='/'.$ENV{'request.course.id'};
1.7 www 454: if ($ENV{'request.course.sec'}) {
455: $crs.='_'.$ENV{'request.course.sec'};
456: }
1.8 www 457: $crs=~s/\_/\//g;
1.5 www 458: }
1.2 www 459: my $pub=($ENV{'request.state'} eq 'published');
460: my $con=($ENV{'request.state'} eq 'construct');
461: my $rol=$ENV{'request.role'};
1.25 matthew 462: my $requested_domain = $ENV{'request.role.domain'};
1.13 harris41 463: foreach (@desklines) {
1.27 www 464: my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc)=split(/\:/,$_);
1.3 www 465: $prt=~s/\$uname/$uname/g;
466: $prt=~s/\$udom/$udom/g;
1.5 www 467: $prt=~s/\$crs/$crs/g;
1.25 matthew 468: $prt=~s/\$requested_domain/$requested_domain/g;
1.3 www 469: if ($pro eq 'clear') {
1.4 www 470: $output.=&clear($row,$col);
1.3 www 471: } elsif ($pro eq 'any') {
1.2 www 472: $output.=&secondlevel(
1.27 www 473: $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
1.2 www 474: } elsif ($pro eq 'smp') {
475: unless ($adv) {
476: $output.=&secondlevel(
1.27 www 477: $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
1.2 www 478: }
479: } elsif ($pro eq 'adv') {
480: if ($adv) {
481: $output.=&secondlevel(
1.27 www 482: $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
1.2 www 483: }
484: } elsif (($pro=~/p(\w+)/) && ($prt)) {
485: if (&Apache::lonnet::allowed($1,$prt)) {
1.27 www 486: $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
1.4 www 487: }
1.26 www 488: } elsif ($pro eq 'course') {
489: if ($ENV{'request.course.fn'}) {
1.27 www 490: $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
1.26 www 491: }
1.4 www 492: } elsif ($pro eq 'author') {
493: if ($author) {
1.29 matthew 494: if ((($prt eq 'rca') && ($ENV{'request.role'}=~/^ca/)) ||
495: (($prt eq 'rau') && ($ENV{'request.role'}=~/^au/))) {
1.19 matthew 496: # Check that we are on the correct machine
1.29 matthew 497: my $cadom=$requested_domain;
498: my $caname=$ENV{'user.name'};
499: if ($prt eq 'rca') {
500: ($cadom,$caname)=
1.6 www 501: ($ENV{'request.role'}=~/(\w+)\/(\w+)$/);
1.29 matthew 502: }
503: $act =~ s/\$caname/$caname/g;
1.19 matthew 504: my $home = &Apache::lonnet::homeserver($caname,$cadom);
1.32 www 505: if ($home eq $Apache::lonnet::perlvar{'lonHostID'}) {
1.19 matthew 506: $output.=switch($caname,$cadom,
1.27 www 507: $row,$col,$img,$top,$bot,$act,$desc);
1.19 matthew 508: }
1.6 www 509: }
1.2 www 510: }
511: }
1.13 harris41 512: }
1.34 www 513: unless ($ENV{'browser.interface'} eq 'textual') {
1.35 www 514: $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";
1.34 www 515: }
1.2 www 516: return $output;
517: }
518:
519: # ======================================================================= Close
1.1 www 520:
521: sub close {
1.35 www 522: if ($ENV{'browser.interface'} eq 'textual') { return ''; }
1.30 www 523: my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
1.1 www 524: return(<<ENDCLOSE);
525: <script>
1.35 www 526: window.status='Accessing Remote Control';
1.30 www 527: menu=window.open("/adm/rat/empty.html","$menuname",
1.1 www 528: "height=350,width=150,scrollbars=no,menubar=no");
1.35 www 529: window.status='Disabling Remote Control';
530: menu.active=0;
1.31 www 531: menu.autologout=0;
1.35 www 532: window.status='Closing Remote Control';
1.1 www 533: menu.close();
1.35 www 534: window.status='Done.';
1.1 www 535: </script>
536: ENDCLOSE
537: }
538:
539: # ====================================================================== Footer
540:
541: sub footer {
542:
1.33 www 543: }
544:
545: # ================================================ Handler when called directly
546:
547:
548: sub handler {
549: my $r = shift;
550: $r->content_type('text/html');
551: $r->send_http_header;
552: return OK if $r->header_only;
553:
1.34 www 554: my $bodytag=&Apache::loncommon::bodytag('Main Menu');
1.33 www 555: # ------------------------------------------------------------ Print the screen
1.36 www 556: $r->print(<<ENDHEADER);
557: <html><head>
558: <title>LON-CAPA Main Menu</title>
559: <script>
560: function go(url) {
561: window.location=url;
562: }
563: function gopost(url) {
564: window.location=url;
565: }
566: </script>
567: </head>
568: $bodytag
569: ENDHEADER
1.34 www 570: $r->print(&rawconfig(1));
1.33 www 571: $r->print('</body></html>');
572: return OK;
1.1 www 573: }
574:
1.2 www 575: # ================================================================ Main Program
576:
1.16 harris41 577: BEGIN {
1.15 matthew 578: if (! defined($readdesk)) {
1.14 www 579: {
1.10 albertel 580: my $config=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.
581: '/mydesk.tab');
582: while (my $configline=<$config>) {
1.14 www 583: $configline=(split(/\#/,$configline))[0];
584: $configline=~s/^\s+//;
1.10 albertel 585: chomp($configline);
1.14 www 586: if ($configline) {
587: $desklines[$#desklines+1]=$configline;
588: }
1.2 www 589: }
1.14 www 590: }
591: $readdesk='done';
1.10 albertel 592: }
1.2 www 593: }
1.30 www 594:
1.1 www 595: 1;
596: __END__
597:
598:
599:
600:
601:
602:
603:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>