Automatically set default account when adding or removing one
[tt-rss-micropub.git] / settings.phtml
1 <div dojoType="dijit.layout.AccordionPane" title="Micropub" id="micropub" <?= $accordionActive ?>>
2  <div>
3   <h2>Registered identities</h2>
4   <table width="100%">
5    <thead>
6     <tr class="title">
7      <td width="5%">Default</td>
8      <td>Identity URL</td>
9      <td width="5%"></td>
10     </tr>
11    </thead>
12    <tbody>
13     <?php foreach ($accounts as $accurl => $account) { ?>
14      <tr data-url="<?= htmlspecialchars($accurl) ?>">
15       <td align='center'>
16        <input type="radio" href="#" dojoType="dijit.form.RadioButton"
17               name="micropubDefaultIdentity"
18               value="<?= htmlspecialchars($accurl) ?>"
19               <?= $account['checked'] ?>
20               onchange='micropubMakeDefault(<?= json_encode($accurl) ?>, this)'
21           />
22       </td>
23       <td>
24        <a href="<?= htmlspecialchars($accurl) ?>"><?= htmlspecialchars($accurl) ?></a>
25       </td>
26       <td>
27        <a href="#" onclick='javascript:micropubDeleteIdentity(<?= json_encode($accurl) ?>)'>Remove</a>
28       </td>
29      </tr>
30     <?php } ?>
31    </tbody>
32   </table>
33  </div>
34
35  <div>
36   <h2>Add new identity</h2>
37   <form method="post" action="backend.php">
38    <input type="hidden" name="op" value="pluginhandler"/>
39    <input type="hidden" name="plugin" value="micropub"/>
40    <input type="hidden" name="method" value="action"/>
41    <input type="hidden" name="mode"   value="authorize"/>
42
43    <input name="url" type="url" size="40" dojoType="dijit.form.TextBox"
44      required="1" autocomplete="on"/>
45    <button type="submit">Authorize</button>
46   </form>
47  </div>
48 </div>