Browse Source

tryin to add syndication to view

main
jk 3 years ago
parent
commit
04373282fc
  1. 5
      controllers/editor.php
  2. 22
      views/editor.php

5
controllers/editor.php

@ -51,6 +51,11 @@ $app->post('/editor/publish', function() use($app) {
$micropub_request['post-status'] = $params['status'];
}
if(array_key_exists('syndicate', $params) && $params['syndicate']) {
if($params['syndicate'] == 'yes')
$micropub_request['mp_syndicate_to'] = "gts";
}
if(array_key_exists('publish', $params) && $params['publish'] != 'now') {
$micropub_request['published'] = $params['publish'];
}

22
views/editor.php

@ -107,27 +107,6 @@
</select>
</td>
</tr>
<tr class="form-group">
<td>
<label for="note_syndicate-to"><a href="javascript:reload_syndications()">Reload</a></label></td>
<td id="syndication-container">
<?php
if($this->syndication_targets) {
echo '<ul>';
foreach($this->syndication_targets as $syn) {
echo '<li>'
. '<button data-syndicate-to="'.(isset($syn['uid']) ? htmlspecialchars($syn['uid']) : htmlspecialchars($syn['target'])).'" class="btn btn-default btn-block">'
. ($syn['favicon'] ? '<img src="'.htmlspecialchars($syn['favicon']).'" width="16" height="16"> ' : '')
. htmlspecialchars($syn['target'])
. '</button>'
. '</li>';
}
echo '</ul>';
}
?>
</td>
</tr>
<tr>
<td>Publish:</td>
<td><input type="text" class="form-field-small" id="post-publish-date" value="now" placeholder="YYYY-MM-DD hh:mm:ss"></td>
@ -165,6 +144,5 @@
</div>
<script src="/editor-files/editor.js"></script>
<script><?= partial('partials/syndication-js') ?></script>
</body>
</html>
Loading…
Cancel
Save