From: John H. <j....@pl...> - 2003-11-24 14:25:33
|
Helo, Does anyone know if it is possible to add file links to a modules help file(s)? I want to add a link pointing to a dynamic text local file, such as: <A HREF=file: The problem is that whilst the file will be in the modules main directory (not in the help directory), that directory will have a different absolute path depending on the O/S being used. If I try using <A HREF=file:///../file_name it doesn't work. Something of a security risk of course with those '..'! The link will no doubt resolve to some initial directory, but what is needed is some generic way of saying' from this modules directory'. Any thoughts? Regards, John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |
From: Jamie C. <jca...@we...> - 2003-11-24 21:39:28
|
John Horne wrote: > Helo, > > Does anyone know if it is possible to add file links to a modules help > file(s)? I want to add a link pointing to a dynamic text local file, > such as: > > <A HREF=file: > > The problem is that whilst the file will be in the modules main > directory (not in the help directory), that directory will have a > different absolute path depending on the O/S being used. If I try using > > <A HREF=file:///../file_name > > it doesn't work. Something of a security risk of course with those '..'! > The link will no doubt resolve to some initial directory, but what is > needed is some generic way of saying' from this modules directory'. > > Any thoughts? Using file:// links like that is probably not a good idea, as they are interpreted by the web browser to refer to files on the *client* system. Unless the user is running a browser on the same box as webmin, files in the module directory will be inaccessble .. Help files can contain links to each other though, with HTML like : <a href=pagename>blah</a> which would link to help/pagename.html - Jamie |
From: John H. <j....@pl...> - 2003-11-25 10:56:30
|
On Mon, 2003-11-24 at 21:39, Jamie Cameron wrote: > > Using file:// links like that is probably not a good idea, as they are > interpreted by the web browser to refer to files on the *client* > system. > Yes, silly me. That's what comes from testing on the same box! > > Help files can contain links to each other though, with HTML like : > <a href=pagename>blah</a> which would link to help/pagename.html > Yes that is closer. The problem is these are text files, so the above gives a 'missing <header>' error message. Does html have a facility to 'include' files? I'll see if I can find out more. Thanks, John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |
From: Jamie C. <jca...@we...> - 2003-11-25 22:15:07
|
On Tue, 2003-11-25 at 21:56, John Horne wrote: > On Mon, 2003-11-24 at 21:39, Jamie Cameron wrote: > > > > Using file:// links like that is probably not a good idea, as they are > > interpreted by the web browser to refer to files on the *client* > > system. > > > Yes, silly me. That's what comes from testing on the same box! > > > > > Help files can contain links to each other though, with HTML like : > > <a href=pagename>blah</a> which would link to help/pagename.html > > > Yes that is closer. The problem is these are text files, so the above > gives a 'missing <header>' error message. Does html have a facility to > 'include' files? I'll see if I can find out more. Normal HTML doesn't, but webmin help files do :-) You can use pseudo-HTML like : <include pagename> to have help/pagename.html inserted at that point. I should really document this in the help section of the module developer's documentation! - Jamie |
From: John H. <j....@pl...> - 2003-11-26 09:57:47
|
On Tue, 2003-11-25 at 22:14, Jamie Cameron wrote: > > Normal HTML doesn't, but webmin help files do :-) > You can use pseudo-HTML like : > <include pagename> > to have help/pagename.html inserted at that point. > > I should really document this in the help section of the module > developer's documentation! > Wow, that is good. I looked at server-side includes and javascript but couldn't find quite what I wanted. In my case the above 'include' works fine when specifying a plain text file...but. It removed all the formatting, so I got a whole page of line after line of text - no blank lines, no space padding etc. I'll have a look to see if anything can be done about this. John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |
From: John H. <j....@pl...> - 2003-11-26 15:32:46
|
On Wed, 2003-11-26 at 09:57, John Horne wrote: > On Tue, 2003-11-25 at 22:14, Jamie Cameron wrote: > > > > Normal HTML doesn't, but webmin help files do :-) > > You can use pseudo-HTML like : > > <include pagename> > > to have help/pagename.html inserted at that point. > > > > I should really document this in the help section of the module > > developer's documentation! > > > Wow, that is good. I looked at server-side includes and javascript but > couldn't find quite what I wanted. > > In my case the above 'include' works fine when specifying a plain text > file...but. It removed all the formatting, so I got a whole page of line > after line of text - no blank lines, no space padding etc. I'll have a > look to see if anything can be done about this. > Okay, I have this all sussed now :-) >From my module the main help link is to a 'help.html' file in the help directory. Within this are other '<A HREF=' links, which webmin takes to be html files within the help directory. Within *these* files I simply put something like: <HEADER>xxx</HEADER> <pre> <include some_text_file> </pre> where 'some_text_file' is some plain text file. (Actually I have used soft links to the files which are in the modules main directory and not the help directory.) The 'include' inserts the file into the web page, and the 'pre' prevent the newlines, spaces, etc from being transformed. So from the module the user clicks on the 'help' link, and that displays a load of text (html) and some other links to plain text files. By clicking on those links they get the relevant plain text file displayed. Very nice :-) John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |
From: Jamie C. <jca...@we...> - 2003-11-26 21:33:57
|
John Horne wrote: > On Wed, 2003-11-26 at 09:57, John Horne wrote: > >>On Tue, 2003-11-25 at 22:14, Jamie Cameron wrote: >> >>>Normal HTML doesn't, but webmin help files do :-) >>>You can use pseudo-HTML like : >>><include pagename> >>>to have help/pagename.html inserted at that point. >>> >>>I should really document this in the help section of the module >>>developer's documentation! >>> >> >>Wow, that is good. I looked at server-side includes and javascript but >>couldn't find quite what I wanted. >> >>In my case the above 'include' works fine when specifying a plain text >>file...but. It removed all the formatting, so I got a whole page of line >>after line of text - no blank lines, no space padding etc. I'll have a >>look to see if anything can be done about this. >> > > Okay, I have this all sussed now :-) > >>From my module the main help link is to a 'help.html' file in the help > directory. Within this are other '<A HREF=' links, which webmin takes to > be html files within the help directory. Within *these* files I simply > put something like: > > <HEADER>xxx</HEADER> > > <pre> > <include some_text_file> > </pre> > > where 'some_text_file' is some plain text file. (Actually I have used > soft links to the files which are in the modules main directory and not > the help directory.) The 'include' inserts the file into the web page, > and the 'pre' prevent the newlines, spaces, etc from being transformed. > > So from the module the user clicks on the 'help' link, and that displays > a load of text (html) and some other links to plain text files. By > clicking on those links they get the relevant plain text file displayed. > Very nice :-) Yep, that's exactly right .. I have just added documentation for those special help file tags at http://fudu/demo/modules.html#help - Jamie |
From: John H. <j....@pl...> - 2003-11-27 10:46:26
|
On Wed, 2003-11-26 at 21:33, Jamie Cameron wrote: > > I have just added documentation for those special help file tags at > http://fudu/demo/modules.html#help > I got a 404 'not found' error with this url. But http://www.webmin.com/modules.html#help worked fine :-) John. -- --------------------------------------------------------------- John Horne, University of Plymouth, UK Tel: +44 (0)1752 233914 E-mail: Joh...@pl... Fax: +44 (0)1752 233839 |