home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / TOP / USR / MAN / mmenu.prf < prev    next >
Text File  |  2009-11-06  |  17KB  |  642 lines

  1. .fill
  2. .justify
  3. .offset 5
  4. .rightmargin 70
  5. .pagesize 72
  6. .m1 3
  7. .m2 2
  8. .m3 2
  9. .m4 5
  10. .ec \
  11. .header /Mmenu/Tools/Mmenu
  12. .footer /Page #//Printed (%)/
  13. .in +5
  14. .define topic
  15. .bold
  16. .in -5
  17. $1 $2 $3 $4 $5
  18. .in +5
  19. .en
  20. .define endtopic
  21.  
  22. .en
  23. .define noform
  24. .nojustify
  25. .nofill
  26. .en
  27. .define noformend
  28. .justify
  29. .fill
  30. .en
  31. .! Manual created with MWB
  32. .! END-OF-MACRO
  33. .topic NAME
  34. Mmenu - A very friendly Userinterface
  35. .endtopic
  36. .topic SYNOPSIS
  37. .noform
  38. mmenu <-f=startmenu> [<-k>] [<-l=logoff_command>] [<-c=mark>]
  39.       [<-m=left_right>] [<-p=prompt>] [<-s=logon_command>]
  40.       [<-a>] [<-r>] [<-z=logfile>]
  41. .noformend
  42. .endtopic
  43. .topic DESCRIPTION
  44.     MMenu offers you a simple to handle and powerful userinterface.
  45. If a user shouldn't have access to system functions is it a good idea
  46. not to give her/him a shell. A typical usage of such menus is a BBS.
  47. You can give several options for this menu, these are
  48. .in +5
  49. -f=startmenu
  50. .in +5
  51. This option must be given and tells
  52. .bold
  53. MMenu
  54. which menu it should use at startup time. The directory where the menu
  55. files are located are specified by 
  56. .bold
  57. sysinfo
  58. and/or the enviroment. The firstmenu (from now called mainmenu) will be 
  59. displayed and the user can choose whatever you gave her/him.
  60.  
  61. .in -5
  62. -k
  63. .in +5
  64. .bold
  65. MMenu
  66. offers a special form of displaying the menu, called shortmenu. This
  67. means that the user gets only the name of the current menu and the
  68. prompt. The user can switch everwhere in
  69. .bold
  70. MMenu
  71. between these display forms. If someone uses 
  72. .bold
  73. MMenu
  74. the first time it is not very good to give her/him shortmenus.
  75.  
  76. .in -5
  77. -l=logoff command
  78. .in +5
  79. When a user logs off incorrect (e.g. hang up) then there is perhaps some
  80. work to clear up his session. This can be done by this option.
  81.  
  82. .in -5
  83. -c=mark
  84. .in +5
  85. All selectable menuentries are marked by an asterik. if you want to
  86. change this to another character you can use this option.
  87.  
  88. .in -5
  89. -m=right_left
  90. .in +5
  91. If you use entries which may be tagged, here you can give the two
  92. tag-charackter, the left and the right, e.g. you start mmenu using -m=()
  93. and you have an entry to be taged, the `*` is marked as `(*)`.
  94.  
  95. .in -5
  96. -p=prompt
  97. .in +5
  98. If you don't like the defaultprompt or if some user should get a special
  99. prompt, use this option.
  100.  
  101. .in -5
  102. -s=logon command
  103. .in +5
  104. When logging on in
  105. .bold
  106. MMenu
  107. you want perhaps execute a program, e.g. to show the user that she/he
  108. has new mail etc.
  109.  
  110. .in -5
  111. -a
  112. .in +5
  113. When you offer a BBS or a user often changes her/his terminal type you
  114. can
  115. .bold
  116. MMenu
  117. make to ask every time for her/his terminal when starting up.
  118.  
  119. .in -5
  120. -r
  121. .in +5
  122. This is for restricted mode. The only feature that is implemented is
  123. that the user can't save his settings when displaying a directory.
  124.  
  125. .in -5
  126. -z=logfile
  127. .in +5
  128. If you want a logfile of all executed programs by the user you can start
  129. mmenu with this option. While the user is logged on, his logfile is
  130. written to a temp-file and is appended to
  131. .ul
  132. logfile
  133. before mmneu exits. To use this, a directory
  134. .ul
  135. /dd/TMP
  136. must exist to stroe the temp file.
  137. .in -10
  138.  
  139.     On startup time mmenu examines the user's .login file in her/his
  140. home directory to get various settings (such as terminaltype, menu
  141. directory, etc.). There is also a system wide file for enviroment
  142. settings. This is placed in /dd/SYS and called
  143. .ul
  144. mmenu.environ
  145. each line has the form <variable>=<value>, e.g. EDITOR=smile. This is
  146. also read on startup time.
  147.  
  148.     Let's assume you want to create a new menu. First edit your
  149. .bold
  150. sysinfo
  151. file to add the entry
  152. .ul
  153. mmenu.datadir
  154. and set it to a directory to which you like. Or set your
  155. enviroment variable
  156. .ul
  157. MENUDATA
  158. just for testing. Decide the name of your mainmenu, in this example call
  159. it main. So you edit first the files
  160. .ul
  161. main, main.cfg, main.cmd, main.hlp
  162. and
  163. .ul
  164. main.jmp
  165. to create a base. An example for the file 'main':
  166. .nf
  167. .nj
  168. .in +10
  169. Main Menu
  170. This is the main menu
  171. Online,#online
  172. Information,#info
  173. System,#system
  174.  
  175. Help,:help
  176. Logoff,:logoff
  177. .in -10
  178. .fill
  179. .justify
  180.  
  181.     The first line is the title of this menu and will be displayed
  182. at the headline of the menu. The next line is a short explanation of
  183. the contents of the menu. This line can be left empty. Then there are the
  184. selectable menuentries. For an exact description of all possibilities
  185. see later. 
  186.  
  187.     Next create main.cfg. In this file you can put in a lot of
  188. messages which will be displayed under some circumstance. If you don't
  189. mind you can skip this file. For details see later.
  190.  
  191.     Now have a look at main.cmd. In there you can put some commands
  192. which should be available in the whole menu tree. As an example:
  193. .in +10
  194. .nf
  195. .nj
  196. date
  197. who=who -s
  198. .fill
  199. .ju
  200. .in -10
  201.  
  202.     When writing a line like 'date' then the command date will be
  203. executed everytime the user types it. When the user now types who then
  204. 'who -s' will be executed.
  205.  
  206.     In main.hlp you can write some help information. It is a simple
  207. textfile.
  208.  
  209.     When you have created a lot of menus it may be a bit boring for
  210. the user to go through to whole menu tree. So you can create the file
  211. menu.jmp. In there are all menus listen which can be called direct by
  212. name.
  213.  
  214.     Every other submenu of main needs an own file, but only the file
  215. for that menu, no extra files like .jmp etc. Every menu is build as
  216. shown above. Every selectable entry can have a maximum of five commands.
  217. Commands can be a normal program. As a program has been executed and
  218. returns to
  219. .bold
  220. MMenu
  221. then there is displayed a line like 'Press Return..' or so and the user
  222. have to hit the RETURN key. If the command don't makes any screenoutput
  223. you can prefix a minus '-' to the program.
  224.  
  225.     But there are also a lot of built-in commands. You can access
  226. them by giving one of the following commands:
  227.  
  228. .in +5
  229. #<menu>
  230. .in +5
  231. This command will call the menu <menu> to be displayed. Any further
  232. commands will be ignored.
  233.  
  234. .in -5
  235. :logoff
  236. .in +5
  237. When executing this command the user will leave the
  238. .bold
  239. MMenu
  240. and normally the system. This command should be available in every
  241. system. Without this option there is no way to leave the system.
  242.  
  243. .in -5
  244. :help
  245. .in +5
  246. This is normally the entry for a help file. The help file for this menu
  247. have to have the same name as the menu with a postfix
  248. .ul
  249. \.hlp
  250. and have to be public readable.
  251.  
  252. .in -5
  253. :back
  254. .in +5
  255. With this option this menu is left and the previous is displayed again.
  256. If you are yet in the mainmenu nothing will happen.
  257.  
  258. .in -5
  259. :quit
  260. .in +5
  261. This will drop you back in the mainmenu. This can be
  262. reached form every part of the menu by typing quit.
  263.  
  264. .in -5
  265. :setup
  266. .in +5
  267. With this option you can change the enviroment of the user. This
  268. implicits that the change is saved in his homedirectory in the file
  269. \.login. As an example:
  270. .br
  271. Termtype VT100,:setup TERM vt100
  272.  
  273. .in -5
  274. :relogin
  275. .in +5
  276. If you want to offer a way that the user can make a second login then
  277. you can use this command. But this includes that you are have the program
  278. .ul
  279. logon
  280. which will be called.
  281.  
  282. .in -5
  283. :dir
  284. .in +5
  285. This is the most powerful built-in command. For example, you want to
  286. display in a menu all the Files in a homedirectory and give the user the
  287. chance to tack some entries and then download or delete them this option
  288. has been added. The command looks like this:
  289. .br
  290. :dir <directory>|<action> or
  291. .br
  292. :dir <directory>|:flag|<entry>|<action>
  293. .br
  294.  
  295. The first version will generate a menu with every filename and as
  296. command <action>.  The second will generate a menu with all filenames
  297. and the possibilitiy of toggling each filename as on or off.  Then there
  298. is a new menuentry be added, titeled <entry> and the command <action>. 
  299. To insert a choosen (or even several) filenames in the <action> line you
  300. can insert expressions in '[' and ']'.  The expression [dir] will insert
  301. all selected filenames without the full path, [fulldir] will include the
  302. full path in front of every filename.  There are some more commands in
  303. '[', ']', see below.  If there are some more files you want to ignore
  304. you can create a file in the menudata directory named
  305. .ul
  306. mmenu.<dir>
  307. where <dir> is the last component of the path to that direcotry, e.g.
  308. when using the path /h0/SPOOL/NOTES the file is called mmenu.notes.
  309.  
  310. .in -5
  311. :chd [<dir>]
  312. .in +5
  313. After mmenu has started the user's data directory is his home directory.
  314. If you like to change it to access files without full pathname, you can
  315. use this command. The line
  316. .br
  317. Databases,:chd /h0/USR/DATABASES/EXAMPLE,database culture,:chd
  318. .br
  319. will first change ths user's data directory to the database directory,
  320. then execute the database program and the return to the user's home
  321. directory.
  322.  
  323. .in -5
  324. :more <file>
  325. .in +5
  326. Shows <file> using the very simple builtin pager. To continue viewing
  327. the file, just type return, to stop it, just type 'q' and return while
  328. you are prompted for input.
  329. .in -10
  330.  
  331. In every command line you can make 
  332. .bold
  333. MMenu
  334. insert some enviroment variables. If you set a string between '\$' then
  335. this will be replaced by th value or none if this variable is not
  336. definied.
  337.  
  338.     There are also some direct commands which the user can invoke
  339. from whereever she/he wants. The first one has been mentioned is the
  340. .ul
  341. quit
  342. command which will put the user in the mainmenu. The other powerful
  343. built-in command starts with a '!' and you can send a message to another
  344. user using the syste, at the same time as you. The syntax is
  345. .ul
  346. !<user> <msg>
  347. which will send the message <msg> to the user <user> if she/he is logged
  348. on and is allowing flashing. Three other commands are implemented as
  349. control codes. The first is control-k to switch between short- and
  350. fullmenus, the second is control-l and control-r which redraws the
  351. screen. Using control-u will switch between using an emulation or not
  352. using it. This may be useful if you log on and you are now using a
  353. complete different terminal. Now the menu will be shown as if it is
  354. corrupted.
  355.  
  356.     You may have different userlevel in your system. And you don't
  357. want to create more than one menutree. Therefor you can put in front of
  358. each line in the mneuentries and <main>.cmd a permission word. These
  359. permissions are enclosed by brackets '[' and ']'. You can make the
  360. different userlevel using enviroment variables or the special words
  361. .ul
  362. group
  363. and
  364. .ul
  365. user
  366. looking at the uid/gid of the user. There is alsoa special entry if you
  367. want to offer some entries at a specified time. With the
  368. .ul
  369. hour
  370. and
  371. .ul
  372. time
  373. expressions is this possible, e.g. [(time > 20.30) && (time < 23.00)].
  374. A permission word is a boolean expression which may be as complex as you
  375. want (or the stack).  Enviroment variuables can be compared to a string
  376. or only if they exists, e.g.  you want to enable the games only if the
  377. user has TERM definied and TERM have to be other than dumb.  So you will
  378. put an expression like
  379. .ul
  380. [TERM & TERM!=dumb] Games,#games
  381. to make this clear. If you put a '1' in front of an expression, the
  382. expression will be inverted, e.g.
  383. .ul
  384. [!(TERM & TERM!=dumb)]
  385. is the exact oposite of the expression above. When using the special
  386. words
  387. .ul
  388. group
  389. and
  390. .ul
  391. user
  392. you have more features. You can use the operaters '<' (less), '<=' (less
  393. or equal), '=' (equal), '>=' (greater or equal) and '>' (greater). As
  394. the second argument you can put a number (as the group- or userid) or a
  395. valid group- or username, e.g.
  396. .ul
  397. [group<=stff] Adm,#adm
  398. will only allow the members of the group adm or less (in groupid) to
  399. access this menu.
  400.  
  401.     You can also combinate the expressions with the boolean
  402. operators '&' (and), '|' (or) and '^' (exclusive or). And you should use
  403. brackets '(' and ')' set the priorities of working down the expressions.
  404.  
  405.     When a user chooses an entry and appended to this command a
  406. space and some other arguments you can get them to insert in the
  407. command. all these commands are enclosed in '[' and ']'. Following
  408. expressions are possible:
  409. .in +5
  410. [dir]
  411. .in +5
  412. This is used when examinig a directory. All taged directory entries of
  413. the last examined directory are inserted (just the filenames).
  414. .in -5
  415. [fulldir]
  416. .in +5
  417. Like [dir], but the absolute pathname is inserted instead of just the
  418. filenames.
  419. .in -5
  420. [opt]
  421. .in +5
  422. The user may just type in an option beginning with a dash ('-').
  423. .in -5
  424. [filename]
  425. .in +5
  426. Just a filename without slashes is allowed.
  427. .in -5
  428. [relpath]
  429. .in +5
  430. A relative path is accepted.
  431. .in -5
  432. [fullpath]
  433. .in +5
  434. A complete valid pathname is accepted.
  435. .in -5
  436. [everything]
  437. .in +5
  438. Every kind of input is accepted.
  439. .in -5
  440. []
  441. .in +5
  442. Just alphanumeric input is accepted.
  443. .in -10
  444. In every case where input is accepted only one argument (terminated by
  445. the end-of-line or a space) will be used. If you want to allow to use
  446. all arguments in the inputline you can insert a `M` in fornt of every
  447. expression, e.g. [Meverything].
  448.  
  449.     The next chapter explains the valid values for the <main>.cfg.
  450. The following expressions are allowed (the '=' must be follow directly
  451. to the value) :
  452. .in +5
  453. return=
  454. .in +5
  455. This string will be displayed when the user should press the RETURN key.
  456. .in -5
  457. previous=
  458. .in +5
  459. Using the ':dir' command, this string will be displayed for the
  460. automatic generated entry to go back to the previous menu.
  461. .in -5
  462. +page=
  463. .in +5
  464. Using ':dir', this text is displayed to go to the next page of the
  465. directory menu.
  466. .in -5
  467. -page=
  468. .in +5
  469. Like '+page', but to select the previous page (NOT the previous menu!).
  470. .in -5
  471. save_sel=
  472. .in +5
  473. Using ':dir' and ':flag', you can tack some files and save your setting
  474. for later use. This is the text to be shown for this option.
  475. .in -5
  476. prompt=
  477. .in +5
  478. This is the prompt for that menu if you require an own one.
  479. .in -5
  480. clear=
  481. .in +5
  482. Using ':dir' and ':flag', with this optin you can clear out all marks
  483. yet set, this will NOT affect the saved setting.
  484. .in -5
  485. nohelp=
  486. .in +5
  487. If you have anywgere the command ':help' included, but there isn't any
  488. help file for this menu, this text will be displayed.
  489. .in -5
  490. non_selected=
  491. .in +5
  492. Using the expressions [dir] or [fulldir] you have to select at least
  493. one. This will be displayed, it none is selected. 
  494. .in -5
  495. no_argument=
  496. .in +5
  497. If you want some input using a '[', ']' expression and the user doesn't
  498. typed in any, this message is displayed.
  499. .in -5
  500. no_receiver=
  501. .in +5
  502. Using the built-in message system this is the errormessage if no
  503. receiver is given.
  504. .in -5
  505. no_message=
  506. .in +5
  507. This is if no message had been written.
  508. .in -5
  509. cant_send=
  510. .in +5
  511. If the receiver had disabled the reception of a message, this text is to
  512. be shown.
  513. .in -5
  514. not_logged_on=
  515. .in +5
  516. If the user is not logged on now.
  517. .in -5
  518. send_msg=
  519. .in +5
  520. As a confirmation for you.
  521. .in -5
  522. empty_dir=
  523. .in +5
  524. Using ':dir' and the directory is empty, this text is displayed to give
  525. the user a hint.
  526. .in -5
  527. full_dir=
  528. .in +5
  529. If there are some entries in the directory, this message is displayed in
  530. the second line. It is in a 'printf' format such as
  531. .ul
  532. %d file (%d %%)
  533. to get a well output.
  534. .in -5
  535. no_slash=
  536. .in +5
  537. When giving an pathname, the user isn't allowed to put slashes in his
  538. arguments. This is the errormessage.
  539. .in -5
  540. online=
  541. .in +5
  542. When the user logs off correct his online time will be displayed. To
  543. change the message, use this entry. It is in the printf fromat with two
  544. integer variables.
  545. .in -5
  546. termtypes=
  547. .in +5
  548. When using the command line option -a for mmenu you are asked for your
  549. terminaltype. You can change the prompt for the input wuth this line. If
  550. you insert a '%s', then the actual terminaltype is displayed as a
  551. default value.
  552. .in -5
  553. missdash=
  554. .in +5
  555. If you want to force the user to type in only an option starting with a
  556. dash ('-') and he didn't, this message will be displayed.
  557. .in -5
  558. goon=
  559. .in +5
  560. This is the prompt for the internal pager.
  561. .in -5
  562. no_file=
  563. .in +5
  564. This will be displayed when the builtin pager couldn't access the given
  565. file.
  566. .in -10
  567. .endtopic
  568. .topic FILES
  569. .noform
  570. <menudir>/main
  571. <menudir>/main.cfg
  572. <menudir>/main.jmp
  573. <menudir>/main.hlp
  574. <menudir>/main.cmd
  575. <homedir>/.login
  576. /dd/SYS/mmenu.environ
  577. .noformend
  578. .endtopic
  579. .topic SYSINFO
  580. .noform
  581. mmenu.datadir
  582. .in +5
  583. The directory where the menus are located
  584. .in -5
  585. .noformend
  586. .endtopic
  587. .topic ENVIROMENT
  588. .noform
  589. MENUDATA=<directory>
  590. .in +5
  591. In this directory are the menu descriptions.
  592. .in -5
  593. MENUFORM=<form>
  594. .in +5
  595. If <form> is "short" then shortmenues are selected as default.
  596. .in -5
  597. TERM=<terminaltype>
  598. .in +5
  599. The terminal of the user.
  600. .in -5
  601. HOME=<directory>
  602. .in +5
  603. The home directory of the user.
  604. .in -5
  605.  
  606. .noformend
  607. .endtopic
  608. .topic EXAMPLES
  609. .noform
  610. .fill
  611. .justify
  612. To start the
  613. .ul
  614. MMenu
  615. it is a good idea to put this line as the user's shell in the password
  616. file:
  617. .br
  618. shell ex mmenu -f=main
  619. .br
  620. to be sure that the .login will be read in.
  621. .br
  622. A possible mainmenu may look like this:
  623. .nf
  624. .nj
  625. .in +10
  626. Mainmenu
  627. System of gladness
  628. [group=guests] Order Account,acc_order
  629. [group!=guests] Change Enviroment,#change_env
  630. [TERM!=dumb] Games,#games
  631. [group<=user_l2] Local Mail,loc_mail
  632. [group<=user_l1] Remote and Local Mail,oxm
  633. [group=staff] Shell escape,shell
  634.  
  635. Help,:help
  636. Logoff,:logoff
  637. .in -10
  638. .fill
  639. .justify
  640. .noformend
  641. .endtopic
  642.