Module: website Branch: master Commit: cfee2e26691dff8516dfd6d6a15eb8277b4ac4c9 URL: http://source.winehq.org/git/website.git/?a=commit;h=cfee2e26691dff8516dfd6d...
Author: Jeremy Newman jnewman@codeweavers.com Date: Tue Jan 19 09:54:14 2016 -0600
use icons from bootstrap for prev/next links
---
include/plugins/news.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/plugins/news.php b/include/plugins/news.php index a42c9fc..e78b0eb 100644 --- a/include/plugins/news.php +++ b/include/plugins/news.php @@ -7,7 +7,7 @@ */
// language override -if ($_GET['lang'] and in_array($_GET['lang'], $config->languages)) +if (!empty($_GET['lang']) and in_array($_GET['lang'], $config->languages)) $html->lang = $_GET['lang'];
// display news based on page params @@ -40,7 +40,7 @@ switch (true) $html->page_title .= " - {$html->meta_og['title']}";
// if link defined, use it in title - if ($vars['link']) + if (!empty($vars['link'])) { $vars['link'] = str_replace("{$root}", $html->_web_root, $vars['link']); $vars['title'] = '<a href="'.$vars['link'].'">'.$vars['title'].'</a>'; @@ -133,7 +133,7 @@ switch (true)
// where are we in news list $x = 0; - if (is_numeric(PAGE_PARAMS)) + if (defined('PAGE_PARAMS') and is_numeric(PAGE_PARAMS)) $x = PAGE_PARAMS;
// get list of news items @@ -160,7 +160,7 @@ switch (true) $vars = get_xml_tags($config->news_xml_path.'/'.$config->lang.'/'.$item, array('date', 'title', 'link', 'body'));
// if link defined, use it in title - if ($vars['link']) + if (!empty($vars['link'])) { $vars['link'] = str_replace("{$root}", $html->_web_root, $vars['link']); $vars['title'] = '<a href="'.$vars['link'].'">'.$vars['title'].'</a>'; @@ -190,19 +190,19 @@ switch (true) $next_link = ""; // add back to first page link when not first page if ($x != 0) - $prev_link .= $html->ahref("[First Page]", $_SERVER['PHP_SELF'], 'class="menuItem"')." "; + $prev_link .= $html->ahref('<span class="glyphicon glyphicon-fast-backward"></span>', $_SERVER['PHP_SELF'], 'class="menuItem"')." "; // display prev link if ($x > 0) - $prev_link .= $html->ahref("<< Previous Page","{$_SERVER['PHP_SELF']}".($x - $amax), 'class="menuItem"'); + $prev_link .= $html->ahref('<span class="glyphicon glyphicon-chevron-left"></span>', $_SERVER['PHP_SELF'].($x - $amax), 'class="menuItem"'); // display next link if (($x + $amax) < $total) { - $next_link .= $html->ahref("Next Page >>","{$_SERVER['PHP_SELF']}".($x + $amax) , 'class="menuItem"'); + $next_link .= $html->ahref('<span class="glyphicon glyphicon-chevron-right"></span>', $_SERVER['PHP_SELF'].($x + $amax) , 'class="menuItem"'); // add jump to last page link - $next_link .= " ".$html->ahref("[Last Page]","{$_SERVER['PHP_SELF']}".($pages * $amax) , 'class="menuItem"'); + $next_link .= " ".$html->ahref('<span class="glyphicon glyphicon-fast-forward"></span>', $_SERVER['PHP_SELF'].($pages * $amax) , 'class="menuItem"'); } // add prev/next links - echo $html->p($html->div($prev_link.' '.$next_link, 'align="center"')); + echo $html->p($html->div($prev_link.' '.$next_link, 'class="center"')); } // end default }