Skip to content

Commit

Permalink
Fixes shaarli#1450
Browse files Browse the repository at this point in the history
THis provides a richer export, incompatible with old browsers, but allowing nicer integration mechanisms into other systems.
I typically gonna use that to generate a lifestream including my Shaarli content.
  • Loading branch information
Riduidel committed May 19, 2020
1 parent 8f80821 commit e8443bf
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,10 @@ function ($item) {
} else {
$prependNoteUrl = false;
}
$extendExport = false;
if (isset($_GET['extend_export'])) {
$extendExport = $_GET['extend_export'];
}

try {
$factory = new FormatterFactory($conf, $loginManager->isLoggedIn());
Expand Down Expand Up @@ -1479,6 +1483,7 @@ function ($item) {
$PAGE->assign('date', $now->format(DateTime::RFC822));
$PAGE->assign('eol', PHP_EOL);
$PAGE->assign('selection', $selection);
$PAGE->assign('extend_export', $extendExport);
$PAGE->renderPage('export.bookmarks');
exit;
}
Expand Down
8 changes: 7 additions & 1 deletion tpl/default/export.bookmarks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tpl/default/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ <h2 class="window-title">{"Export Database"|t}</h2>
</div>
</div>

<div class="pure-g">
<div class="pure-u-lg-1-2 pure-u-7-8">
<div class="form-label">
<label for="extend_export">
<span class="label-name">{'Extend import to include thumbnail and permalink|t}</span><br>
<span class="label-desc">{'Provide a richer export, unfortunatly incompatible with browsers'|t}</span>
</label>
</div>
</div>
<div class="pure-u-lg-1-2 pure-u-1-8">
<div class="form-input">
<input type="checkbox" name="extend_export" id="extend_export">
</div>
</div>
</div>

<div class="center">
<input type="submit" value="{'Export'|t}">
</div>
Expand Down
8 changes: 7 additions & 1 deletion tpl/vintage/export.bookmarks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tpl/vintage/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
Prepend note permalinks with this Shaarli instance's URL
<em>(useful to import bookmarks in a web browser)</em>
</label>
<br/>
<input type="checkbox" name="extend_export" id="extend_export">
<label for="extend_export">
Extend export by adding thumbnails/permalinks
<em>(Can break import in browser)</em>
</label>
<br><br>
<input class="bigbutton" type="submit" value="Export">
</form>
Expand Down

0 comments on commit e8443bf

Please sign in to comment.