Add option for saving bookmarks as "unread" to pinboard (PR #694)

This commit is contained in:
Alexander Steinhöfer 2017-06-12 23:59:51 +02:00 committed by Frédéric Guillot
parent 43efe30442
commit e047408826
4 changed files with 7 additions and 2 deletions

View File

@ -26,10 +26,11 @@ Router\get_action('services', function () {
Router\post_action('services', function () { Router\post_action('services', function () {
$user_id = SessionStorage::getInstance()->getUserId(); $user_id = SessionStorage::getInstance()->getUserId();
$values = Request\values() + array('pinboard_enabled' => 0, $values = Request\values() + array('pinboard_enabled' => 0,
'pinboard_mark_unread' => 0,
'instapaper_enabled' => 0, 'instapaper_enabled' => 0,
'wallabag_enabled' => 0, 'wallabag_enabled' => 0,
'shaarli_enabled' => 0, 'shaarli_enabled' => 0,
'shaarli_private' => 0,); 'shaarli_private' => 0);
Helper\check_csrf_values($values); Helper\check_csrf_values($values);
if (Model\Config\save($user_id, $values)) { if (Model\Config\save($user_id, $values)) {

View File

@ -56,6 +56,7 @@ function pinboard_sync(array $item)
'url' => $item['url'], 'url' => $item['url'],
'description' => $item['title'], 'description' => $item['title'],
'tags' => Helper\config('pinboard_tags'), 'tags' => Helper\config('pinboard_tags'),
'toread' => Helper\bool_config('pinboard_mark_unread') ? 'yes' : 'no',
); );
$url = 'https://api.pinboard.in/v1/posts/add?'.http_build_query($params); $url = 'https://api.pinboard.in/v1/posts/add?'.http_build_query($params);

View File

@ -188,6 +188,7 @@ return array(
'Send bookmarks to Pinboard' => 'Sende Lesezeichen an Pinboard', 'Send bookmarks to Pinboard' => 'Sende Lesezeichen an Pinboard',
'Pinboard API token' => 'Pinboard API Token', 'Pinboard API token' => 'Pinboard API Token',
'Pinboard tags' => 'Pinboard Tags', 'Pinboard tags' => 'Pinboard Tags',
'Mark bookmarks as unread' => 'Lesezeichen als ungelesen markieren',
'Instapaper username' => 'Instapaper Benutzername', 'Instapaper username' => 'Instapaper Benutzername',
'Instapaper password' => 'Instapaper Passwort', 'Instapaper password' => 'Instapaper Passwort',
'Instapaper' => 'Instapaper', 'Instapaper' => 'Instapaper',

View File

@ -28,7 +28,9 @@
<?php echo Miniflux\Helper\form_text('pinboard_token', $values, $errors) ?><br/> <?php echo Miniflux\Helper\form_text('pinboard_token', $values, $errors) ?><br/>
<?php echo Miniflux\Helper\form_label(t('Pinboard tags'), 'pinboard_tags') ?> <?php echo Miniflux\Helper\form_label(t('Pinboard tags'), 'pinboard_tags') ?>
<?php echo Miniflux\Helper\form_text('pinboard_tags', $values, $errors) ?> <?php echo Miniflux\Helper\form_text('pinboard_tags', $values, $errors) ?><br/>
<?php echo Miniflux\Helper\form_checkbox('pinboard_mark_unread', t('Mark bookmarks as unread'), 1, isset($values['pinboard_mark_unread']) && $values['pinboard_mark_unread'] == 1) ?>
</div> </div>