ENHANCEMENT: replaced deprecated Director::urlParams()

BUGFIX: tag working with nested urls
This commit is contained in:
Carlos Barberis 2010-05-27 23:30:14 +00:00
parent 606d526627
commit 5a5cdf1aaf
2 changed files with 8 additions and 7 deletions

View File

@ -199,8 +199,8 @@ class BlogHolder_Controller extends BlogTree_Controller {
$id = 0; $id = 0;
if(Director::urlParam('ID')) { if($this->request->latestParam('ID')) {
$id = (int) Director::urlParam('ID'); $id = (int) $this->request->latestParam('ID');
} }
$codeparser = new BBCodeParser(); $codeparser = new BBCodeParser();

View File

@ -152,6 +152,7 @@ class BlogTree extends Page {
* @return DataObjectSet * @return DataObjectSet
*/ */
public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') { public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') {
$tagCheck = ''; $tagCheck = '';
$dateCheck = ''; $dateCheck = '';
@ -290,7 +291,7 @@ class BlogTree_Controller extends Page_Controller {
* @return String * @return String
*/ */
function SelectedTag() { function SelectedTag() {
return (Director::urlParam('Action') == 'tag') ? Director::urlParam('ID') : ''; return ($this->request->latestParam('Action') == 'tag') ? $this->request->latestParam('ID') : '';
} }
/** /**
@ -299,9 +300,9 @@ class BlogTree_Controller extends Page_Controller {
* @return Date * @return Date
*/ */
function SelectedDate() { function SelectedDate() {
if(Director::urlParam('Action') == 'date') { if($this->request->latestParam('Action') == 'date') {
$year = Director::urlParam('ID'); $year = $this->request->latestParam('ID');
$month = Director::urlParam('OtherID'); $month = $this->request->latestParam('OtherID');
if(is_numeric($year) && is_numeric($month) && $month < 13) { if(is_numeric($year) && is_numeric($month) && $month < 13) {
$date = new Date(); $date = new Date();