diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-10-06 13:22:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-06 13:22:59 +0200 |
commit | 86e1bc713fd7fa74d6a17a7687428fa1c6d3c5f2 (patch) | |
tree | 4c9b6c8a550b928dc734de5c78d8403f5631e161 /index.php | |
parent | 10a7b5cee96a742fbe86edbea977f3c55c92e9aa (diff) | |
parent | d9bf5b31ff9e2d007ddfb7f7756184f0ca9676c8 (diff) | |
download | Shaarli-86e1bc713fd7fa74d6a17a7687428fa1c6d3c5f2.tar.gz Shaarli-86e1bc713fd7fa74d6a17a7687428fa1c6d3c5f2.tar.zst Shaarli-86e1bc713fd7fa74d6a17a7687428fa1c6d3c5f2.zip |
Merge pull request #1144 from ArthurHoaro/feature/sticky
Add a button to set links as sticky
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1353,6 +1353,25 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager, | |||
1353 | exit; | 1353 | exit; |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | if ($targetPage == Router::$PAGE_PINLINK) { | ||
1357 | if (! isset($_GET['id']) || empty($LINKSDB[$_GET['id']])) { | ||
1358 | // FIXME! Use a proper error system. | ||
1359 | $msg = t('Invalid link ID provided'); | ||
1360 | echo '<script>alert("'. $msg .'");document.location=\''. index_url($_SERVER) .'\';</script>'; | ||
1361 | exit; | ||
1362 | } | ||
1363 | if (! $sessionManager->checkToken($_GET['token'])) { | ||
1364 | die('Wrong token.'); | ||
1365 | } | ||
1366 | |||
1367 | $link = $LINKSDB[$_GET['id']]; | ||
1368 | $link['sticky'] = ! $link['sticky']; | ||
1369 | $LINKSDB[(int) $_GET['id']] = $link; | ||
1370 | $LINKSDB->save($conf->get('resource.page_cache')); | ||
1371 | header('Location: '.index_url($_SERVER)); | ||
1372 | exit; | ||
1373 | } | ||
1374 | |||
1356 | if ($targetPage == Router::$PAGE_EXPORT) { | 1375 | if ($targetPage == Router::$PAGE_EXPORT) { |
1357 | // Export links as a Netscape Bookmarks file | 1376 | // Export links as a Netscape Bookmarks file |
1358 | 1377 | ||