From: VirtualTam Date: Wed, 9 Dec 2015 00:00:52 +0000 (+0100) Subject: Merge pull request #406 from ArthurHoaro/qrcode-style X-Git-Tag: v0.6.2~3 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=79851b489087f8a3027ecd805255cd13ee6fcf63;hp=6a6f6c32e5876a347a806cc43d25596b9257765b;p=github%2Fshaarli%2FShaarli.git Merge pull request #406 from ArthurHoaro/qrcode-style Fixes #403 : Remove QRCode in core CSS and fix plugin layout --- diff --git a/application/Router.php b/application/Router.php index 1e6a3983..0c813847 100644 --- a/application/Router.php +++ b/application/Router.php @@ -13,6 +13,8 @@ class Router public static $PAGE_TAGCLOUD = 'tagcloud'; + public static $PAGE_DAILY = 'daily'; + public static $PAGE_TOOLS = 'tools'; public static $PAGE_CHANGEPASSWORD = 'changepasswd'; @@ -69,6 +71,10 @@ class Router return self::$PAGE_OPENSEARCH; } + if (startsWith($query, 'do='. self::$PAGE_DAILY)) { + return self::$PAGE_DAILY; + } + // At this point, only loggedin pages. if (!$loggedIn) { return self::$PAGE_LINKLIST; diff --git a/index.php b/index.php index 81ab7676..d0876d95 100644 --- a/index.php +++ b/index.php @@ -995,8 +995,12 @@ function showDailyRSS() { exit; } -// "Daily" page. -function showDaily() +/** + * Show the 'Daily' page. + * + * @param PageBuilder $pageBuilder Template engine wrapper. + */ +function showDaily($pageBuilder) { $LINKSDB = new LinkDB( $GLOBALS['config']['DATASTORE'], @@ -1059,7 +1063,7 @@ function showDaily() array_push($columns[$index],$link); // Put entry in this column. $fill[$index]+=$length; } - $PAGE = new pageBuilder; + $data = array( 'linksToDisplay' => $linksToDisplay, 'linkcount' => count($LINKSDB), @@ -1072,10 +1076,10 @@ function showDaily() $pluginManager->executeHooks('render_daily', $data, array('loggedin' => isLoggedIn())); foreach ($data as $key => $value) { - $PAGE->assign($key, $value); + $pageBuilder->assign($key, $value); } - $PAGE->renderPage('daily'); + $pageBuilder->renderPage('daily'); exit; } @@ -1209,6 +1213,11 @@ function renderPage() exit; } + // Daily page. + if ($targetPage == Router::$PAGE_DAILY) { + showDaily($PAGE); + } + // Display openseach plugin (XML) if ($targetPage == Router::$PAGE_OPENSEARCH) { header('Content-Type: application/xml; charset=utf-8'); @@ -1948,7 +1957,6 @@ function buildLinkList($PAGE,$LINKSDB) // Fill all template fields. $data = array( - 'pagetitle' => $GLOBALS['pagetitle'], 'linkcount' => count($LINKSDB), 'previous_page_url' => $previous_page_url, 'next_page_url' => $next_page_url, @@ -1962,6 +1970,10 @@ function buildLinkList($PAGE,$LINKSDB) 'links' => $linkDisp, 'tags' => $LINKSDB->allTags(), ); + // FIXME! temporary fix - see #399. + if (!empty($GLOBALS['pagetitle']) && count($linkDisp) == 1) { + $data['pagetitle'] = $GLOBALS['pagetitle']; + } $pluginManager = PluginManager::getInstance(); $pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn())); @@ -2456,7 +2468,6 @@ if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=g if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=rss')) { showRSS(); exit; } if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=atom')) { showATOM(); exit; } if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=dailyrss')) { showDailyRSS(); exit; } -if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=daily')) { showDaily(); exit; } if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE']; renderPage(); ?> diff --git a/plugins/demo_plugin/custom_demo.css b/plugins/demo_plugin/custom_demo.css index ab1720b5..af5e8bf9 100644 --- a/plugins/demo_plugin/custom_demo.css +++ b/plugins/demo_plugin/custom_demo.css @@ -4,4 +4,10 @@ .upper_plugin_demo { float: left; +} + +#demo_marquee { + background: darkmagenta; + color: white; + font-weight: bold; } \ No newline at end of file diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index 84763c2b..f5f028e0 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php @@ -40,6 +40,8 @@ function hook_demo_plugin_render_header($data) // Fields in toolbar $data['fields_toolbar'][] = 'DEMO_fields_toolbar'; } + // Another button always displayed + $data['buttons_toolbar'][] = '
  • DEMO
  • '; return $data; } @@ -74,6 +76,7 @@ function hook_demo_plugin_render_includes($data) * * Template placeholders: * - text + * - endofpage * - js_files * * Data: @@ -89,6 +92,11 @@ function hook_demo_plugin_render_footer($data) // footer text $data['text'][] = 'Shaarli is now enhanced by the awesome demo_plugin.'; + // Free elements at the end of the page. + $data['endofpage'][] = '' . + 'DEMO: it\'s 1999 all over again!' . + ''; + // List of plugin's JS files. // Note that you just need to specify CSS path. $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/demo_plugin/demo_plugin.js'; diff --git a/tpl/page.footer.html b/tpl/page.footer.html index b20aae54..195dada0 100644 --- a/tpl/page.footer.html +++ b/tpl/page.footer.html @@ -4,6 +4,11 @@ {$value} {/loop} + +{loop="$plugins_footer.endofpage"} + {$value} +{/loop} + {if="$newVersion"}
    Shaarli {$newVersion} is diff --git a/tpl/tools.html b/tpl/tools.html old mode 100644 new mode 100755 index c9ada4ac..c13f4f16 --- a/tpl/tools.html +++ b/tpl/tools.html @@ -10,12 +10,50 @@ Rename/delete tags : Rename or delete a tag in all links

    Import : Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)

    Export : Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)

    - ✚Shaare link ⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).
        Then click "✚Shaare link" button in any page you want to share.


    - ✚Add Note ⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).
        Then click "✚Add Note" button anytime to start composing a (default private) Note (text post) to your Shaarli.


    - ✚Add to Firefox social ⇐ Click on this button to add Shaarli to the "Share this page" button in Firefox.

    - {loop="$tools_plugin"} + + ✚Shaare link + + + + ⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).
    +     Then click "✚Shaare link" button in any page you want to share. +
    +


    + + ✚Add Note + + + + ⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).
    +     Then click "✚Add Note" button anytime to start composing a private Note (text post) to your Shaarli. +
    +


    + + ✚Add to Firefox social + + + ⇐ Click on this button to add Shaarli to the "Share this page" button in Firefox. +

    + + {loop="$tools_plugin"} {$value} {/loop} +