]>
Commit | Line | Data |
---|---|---|
373266eb AD |
1 | <?php |
2 | function module_pref_instances($link) { | |
3 | ||
4 | $subop = $_REQUEST['subop']; | |
5 | ||
6 | if ($subop == "edit") { | |
7 | ||
8 | print "TODO: function not implemented."; | |
9 | ||
10 | ||
11 | return; | |
12 | } | |
13 | ||
14 | print "<div id=\"pref-instance-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">"; | |
15 | print "<div id=\"pref-instance-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">"; | |
16 | ||
17 | print "<div id=\"pref-instance-toolbar\" dojoType=\"dijit.Toolbar\">"; | |
18 | ||
19 | $sort = db_escape_string($_REQUEST["sort"]); | |
20 | ||
21 | if (!$sort || $sort == "undefined") { | |
22 | $sort = "access_url"; | |
23 | } | |
24 | ||
25 | print "<div dojoType=\"dijit.form.DropDownButton\">". | |
26 | "<span>" . __('Select')."</span>"; | |
27 | print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">"; | |
28 | print "<div onclick=\"selectTableRows('prefInstanceList', 'all')\" | |
29 | dojoType=\"dijit.MenuItem\">".__('All')."</div>"; | |
30 | print "<div onclick=\"selectTableRows('prefInstanceList', 'none')\" | |
31 | dojoType=\"dijit.MenuItem\">".__('None')."</div>"; | |
32 | print "</div></div>"; | |
33 | ||
34 | print "<button dojoType=\"dijit.form.Button\" onclick=\"addInstance()\">".__('Link instance')."</button>"; | |
35 | print "<button dojoType=\"dijit.form.Button\" onclick=\"editSelectedInstance()\">".__('Edit')."</button>"; | |
36 | print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedInstances()\">".__('Remove')."</button>"; | |
37 | ||
38 | print "</div>"; #toolbar | |
39 | ||
40 | $result = db_query($link, "SELECT * FROM ttrss_linked_instances | |
41 | ORDER BY $sort"); | |
42 | ||
43 | print "<p class=\"insensitive\" style='margin-left : 1em;'>" . __("You can connect other instances of Tiny Tiny RSS to this one to share Popular feeds. Link to this instance of Tiny Tiny RSS by using this URL:"); | |
44 | ||
45 | print " <a href=\"#\" onclick=\"alert('".htmlspecialchars(get_self_url_prefix())."')\">(display url)</a>"; | |
46 | ||
47 | print "<p><table width='100%' id='prefInstanceList' class='prefInstanceList' cellspacing='0'>"; | |
48 | ||
49 | print "<tr class=\"title\"> | |
50 | <td align='center' width=\"5%\"> </td> | |
51 | <td width=''><a href=\"#\" onclick=\"updateInstanceList('access_url')\">".__('Instance URL')."</a></td> | |
52 | <td width='20%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">".__('Last connected')."</a></td> | |
53 | </tr>"; | |
54 | ||
55 | $lnum = 0; | |
56 | ||
57 | while ($line = db_fetch_assoc($result)) { | |
58 | $class = ($lnum % 2) ? "even" : "odd"; | |
59 | ||
60 | $id = $line['id']; | |
61 | $this_row_id = "id=\"LIRR-$id\""; | |
62 | ||
63 | $line["last_connected"] = make_local_datetime($link, $line["last_connected"], false); | |
64 | ||
65 | print "<tr class=\"$class\" $this_row_id>"; | |
66 | ||
67 | print "<td align='center'><input onclick='toggleSelectRow(this);' | |
68 | type=\"checkbox\" id=\"LICHK-$id\"></td>"; | |
69 | ||
70 | $onclick = "onclick='editInstance($id, event)' title='".__('Click to edit')."'"; | |
71 | ||
72 | print "<td $onclick>" . htmlspecialchars($line['access_url']) . "</td>"; | |
73 | print "<td $onclick>" . htmlspecialchars($line['last_connected']) . "</td>"; | |
74 | ||
75 | print "</tr>"; | |
76 | ||
77 | ++$lnum; | |
78 | } | |
79 | ||
80 | print "</table>"; | |
81 | ||
82 | print "</div>"; #pane | |
83 | print "</div>"; #container | |
84 | ||
85 | } | |
86 | ?> |