X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=40a6fbe5a1a5c6e0c2f1d3b06782617df2da9c54;hb=ba83317573a1477d731cbd3d974b601cf9afdba3;hp=0dd5829b6ace2eeed01a83ab87dd9b80178f5fd5;hpb=b373ddc1df5ce525996b6b373c4bb39b87640f1d;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php old mode 100755 new mode 100644 index 0dd5829b..40a6fbe5 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ /shaarli/ define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0))); @@ -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'); @@ -2459,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(); ?>