| | 7 | Linker plugin displays a Tree where the user can select the file he wants to link. |
| | 8 | Currently there are two methods for filling this tree: |
| | 9 | |
| | 10 | === 1. using an external backend-file === |
| | 11 | (default, returns all files found in DOCUMENT_ROOT) |
| | 12 | {{{ |
| | 13 | editor.config.Linker.backend = _editor_url + 'plugins/Linker/scan.php'; |
| | 14 | }}} |
| | 15 | scan.php should return code like this one: |
| | 16 | {{{ |
| | 17 | // <<node-list>> = [ <<node>, <<node>>, ...] |
| | 18 | // <<node>> = one of the following four types |
| | 19 | // 1. "a.html" -- URL without children or title |
| | 20 | // 2. ["a.html", <<node-list>>] -- URL without title but with children |
| | 21 | // 3. {url:"a.html",title:"A URL"} -- URL with title |
| | 22 | // 4. {url:"a.html",title:"A File",children:<<node-list>>} -- URL with title, and children |
| | 23 | [ |
| | 24 | "e.html", |
| | 25 | ['f.html', ['g.html','h.html']], |
| | 26 | {url:'i.html',title:'I Html'}, |
| | 27 | {url:'j.html',title:'J Html', children:[{url:'k.html',name:"K Html"},'l.html',['m.html',['n.html']]]} |
| | 28 | ] |
| | 29 | }}} |
| | 30 | Type 3 and 4 nodes would be the preference, I'd go so far as to deprecate type 1 and 2. |
| | 31 | |
| | 32 | === 2. using configuration-variables === |
| | 33 | {{{ |
| | 34 | editor.config.Linker.backend = null; |
| | 35 | editor.config.Linker.files = [ |
| | 36 | "e.html", |
| | 37 | ['f.html', ['g.html','h.html']], |
| | 38 | {url:'i.html',title:'I Html'}, |
| | 39 | {url:'j.html',title:'J Html', children:[{url:'k.html',name:"K Html"},'l.html',['m.html',['n.html']]]} |
| | 40 | ]; |
| | 41 | }}} |
| | 42 | |