First and Last CLinkPager links

CLinkPager always shows the first and last links as disabled. I submitted a ticket but it was marked invalid, probably because the heading was:

"CLinkPager First and Last links always hidden"

I wrote hidden because that’s the name of the style… I should have named it:

CLinkPager First and Last links always DISABLED

First I’m pretty sure this is a bug. Second I don’t know if I should resubmit with the better title or if someone can change the status of the current one marked invalid: Ticket 1163.

The bug is that, when visible, the last and first page links always have a disabled style. The style is the same as next and previous, which are shown as disabled when at the first or last record (the class is called hidden though). I believe the first and last links should be disabled at the same time the next and previous are.

i think is bug too~


// first page

$buttons[]=$this->createPageButton($this->firstPageLabel,0,self::CSS_FIRST_PAGE,$beginPage<=0,false);


// last page

$buttons[]=$this->createPageButton($this->lastPageLabel,$pageCount-1,self::CSS_LAST_PAGE,$endPage>=$pageCount-1,false);

must change to:


// first page

$buttons[]=$this->createPageButton($this->firstPageLabel,0,self::CSS_FIRST_PAGE,($beginPage<=0),false);


// last page

$buttons[]=$this->createPageButton($this->lastPageLabel,$pageCount-1,self::CSS_LAST_PAGE,($endPage>=$pageCount-1),false);

?

I don’t think that will work… $beginPage is always 0 and $endPage is always > pageCount - 1… so it always returns true. On the code site I posted the fix in a diff:


-		$buttons[]=$this->createPageButton($this->firstPageLabel,0,self::CSS_FIRST_PAGE,$beginPage<=0,false);

+		$buttons[]=$this->createPageButton($this->firstPageLabel,0,self::CSS_FIRST_PAGE,$currentPage<=0,false);


-		$buttons[]=$this->createPageButton($this->lastPageLabel,$pageCount-1,self::CSS_LAST_PAGE,$endPage>=$pageCount-1,false);

+		$buttons[]=$this->createPageButton($this->lastPageLabel,$pageCount-1,self::CSS_LAST_PAGE,$currentPage>=$pageCount-1,false);



Can someone verify the functionality of the CLinkPager? I made a fresh test site and I believe it’s wrong but my submitted bug says it can’t be reproduced. The top image is what I see and the bottom is what I expect.

Image of CLinkPager rendering

Can someone else that uses first and last links (or someone that likes testing ;) ) tell me what theirs looks like?

No need to test… thank you to all the volunteers… :D

It was originally intended to work that way, but what I expected to see seemed to be a better alternative and has been implemented. Thanks.