Add method set_current_page

apanag - July 5, 2009 - 22:05
Project:Views
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,

is it possible to add a new method in view.inc file?

function set_current_page($id){
$this->pager['current_page'] = $id;
}

I want it in order to set the $id page of a view with the pager enabled. Or is there another way to set the page without having to use the url and the GET method.

Thank you.
apanag

#1

dereine - July 6, 2009 - 16:20

you could also use hook_views_pre_query or something similar to change the $view object to what you need.

but sure if you create a patch its possible to add.

#2

apanag - July 6, 2009 - 21:38

Where hook_views_pre_query is defined?

#3

apanag - July 11, 2009 - 09:25

Hello,

here is the patch adding the above method.

AttachmentSize
views-510920.patch 645 bytes

#4

apanag - July 16, 2009 - 12:27

Hello,

i know that you are working hard to provide the best results with the views module, but i need that function to add functionality to my module.
Is it possible to review the patch?

Thanks in advanced,
apanag

#5

dereine - July 23, 2009 - 19:47
Status:active» needs review

lets first set it to needs review

ok reviewed it, two minor coding style issues, the rest is fine.

Also applies clean on 6.x-3.x

AttachmentSize
views-510920.patch 702 bytes

#6

apanag - July 24, 2009 - 10:57

Hello dereine,

thanks for reviewing my patch.

apanag

#7

merlinofchaos - September 15, 2009 - 17:00
Status:needs review» fixed

Works for me. Committed!

#8

apanag - September 15, 2009 - 18:04

Thank you very much.
apanag

#9

System Message - September 29, 2009 - 18:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.