Annotation of doc/techtips/worktime-modify.html, revision 1.1
1.1 ! albertel 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
! 2: <html>
! 3: <head>
! 4: <title>Worktime, Modify Current Handler</title>
! 5: </head>
! 6:
! 7: <body>
! 8: <h1>Worktime, Modify Current Handler</h1>
! 9: <p>
! 10: We are going to add a requested feature to loncapa. We want the
! 11: name of the file being editted to show up while in CSTR and
! 12: editing an html Page
! 13: </p>
! 14: <ol>
! 15: <li>
! 16: First you will need to add the author role to domcc<br />
! 17: Use the
! 18: CUSR button on the remote, type in the username 'domcc' and then
! 19: add the author role. Logout, and log back in. (You will also need
! 20: to let the webserver have permission to enter domcc's home
! 21: directory, do this by having domcc do <tt>chmod a+x
! 22: </tt>
! 23: <br />
! 24: <br />
! 25: </li>
! 26: <li>
! 27: Next we need to find who controls HTML file creation. And
! 28: understand where to make a change.
! 29: <br />
! 30: <br />
! 31: </li>
! 32: <li>
! 33: First we check loncapa_apache.conf, and it says
! 34: <pre><tt>
! 35: <LocationMatch "^/(res|\~).*\.(xml|html|htm|xhtml|xhtm)$">
! 36: SetHandler perl-script
! 37: PerlHandler Apache::lonxml
! 38: </LocationMatch>
! 39: </tt></pre>
! 40: </li>
! 41: <li>
! 42: Next we check the lonxml.pm handler subroutine (line
! 43: 1180). And read the subrotine. Notice the comment:
! 44: <pre><tt>
! 45: #
! 46: # Edit action? Insert editing commands
! 47: #
! 48: </tt></pre>
! 49: <p> that make take a closer look at the surrounding
! 50: code. Looks like the line
! 51: <pre><tt>
! 52: $result='<html><body bgcolor="#FFFFFF"></body></html>';
! 53: </tt></pre>
! 54: Creates the webpage that has the edit field in it.
! 55: <br /> <br />
! 56: </li>
! 57: <li>
! 58: Lets change that line to be instead:
! 59: <pre><tt>
! 60: $result='<html><body bgcolor="#FFFFFF">';
! 61: $result.='<b>Hey is the correct location?</b>';
! 62: $result.='</body></html>';
! 63: </tt></pre>
! 64: And create a new .html file.
! 65: <br /> <br />
! 66: </li>
! 67: <li>
! 68: Looks like we were correct. So let us take a look around and
! 69: see if the file name is somewhere in a local variable. Notice
! 70: the line <pre>
! 71: my $file=&Apache::lonnet::filelocation("",$request->uri);
! 72: </pre>
! 73: and
! 74: <pre>
! 75: my $filecontents=&Apache::lonnet::getfile($file);
! 76: </pre>
! 77: Looks like $file contains the file name ,a $request->uri
! 78: would be the requested url.
! 79: <br /> <br />
! 80: </li>
! 81: <li>
! 82: Lets put the $request->uri in the message we print. Change
! 83: <pre>
! 84: $result.=';<b>Hey is the correct location?</b>';
! 85: </pre>
! 86: to
! 87: <pre>
! 88: $result.='<b>Editing file: '.$request->uri.'</b>';
! 89: </pre>
! 90: <br />
! 91: </li>
! 92: </ol>
! 93: <hr>
! 94: <address><a href="mailto:albertel@mileva.lite.msu.edu">Guy Albertelli</a></address>
! 95: <!-- Created: Tue Jun 11 11:22:10 EDT 2002 -->
! 96: <!-- hhmts start -->
! 97: Last modified: Tue Jun 11 12:02:22 EDT 2002
! 98: <!-- hhmts end -->
! 99: </body>
! 100: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>