Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit b63b3bb3 authored by Michael Long's avatar Michael Long

Add ability to format the main external section menu like you can with the programs menus

parent cd15abe1
Pipeline #623 passed with stage
in 10 minutes and 51 seconds
......@@ -74,6 +74,11 @@
; eval_before_exec = alert('Running ' + prog.name);
; eval_after_exec = load('../xtrn/twitter/tweet.js', user.alias, 'ran', prog.name);
; uncomment and modify any of the below to change the look of the main external sections menu
; section_fmt: \1-\1g%3d:\1n\1g %s
; section_header_fmt: \1-\1gSelect \1hExternal Program Section\1-\1g:
; section_which: \r\n\1-\1gWhich, \1w\1h~Q\1n\1guit or [1]: \1h
; uncomment and modify any of the below to change the look of the external programs menu
; header_fmt: \1n\1c\1h%s \1n\1cExternal Programs:\r\n\r\n
; titles: \1n\1cNum \1h\xb3\1n\1c Name \1n\1c
......
......@@ -73,6 +73,16 @@ if(options.which === undefined)
if(options.clear_screen === undefined)
options.clear_screen = true;
if (options.section_fmt === undefined)
options.section_fmt = "\x01y\x01g%3d:\x01n\x01g %s"
if (options.section_header_fmt === undefined)
options.section_header_fmt = "\x01-\x01gSelect \x01hExternal Program Section\x01-\x01g:"
if(options.section_which === undefined)
options.section_which = "\r\n\x01-\x01gWhich, \x01w\x01h~Q\x01n\x01guit or [1]: \x01h"
function sort_by_name(a, b)
{
if(a.name.toLowerCase()>b.name.toLowerCase()) return 1;
......@@ -211,16 +221,32 @@ function external_section_menu()
xsec--;
}
else {
if(options.clear_screen)
console.clear(LIGHTGRAY);
if(options.sort)
sec_list.sort(sort_by_name);
for(i in sec_list)
console.uselect(Number(i),"External Program Section"
,sec_list[i].name);
xsec=console.uselect();
printf(options.section_header_fmt);
console.crlf();
console.crlf();
for (i in sec_list) {
printf(options.section_fmt, parseInt(i) + 1, sec_list[i].name);
console.crlf();
}
if(xsec<0)
bbs.node_sync();
console.mnemonics(options.section_which);
xsec = console.getnum(sec_list.length);
xsec--; // match array index
if(xsec == -1)
xsec = 0; // default option
else if(xsec == -2)
break;
}
external_program_menu(sec_list[xsec].index);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment