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
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
Where hook_views_pre_query is defined?
#3
Hello,
here is the patch adding the above method.
#4
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
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
#6
Hello dereine,
thanks for reviewing my patch.
apanag
#7
Works for me. Committed!
#8
Thank you very much.
apanag
#9
Automatically closed -- issue fixed for 2 weeks with no activity.