Jump to content

How to get admin page with certain Process assigned?


apeisa
 Share

Recommended Posts

I have feeling that I have asked (or at least read) answer to this one before, but couldn't find the answer anywhere. I have tried this kind of stuff without any luck:

$invoice = $this->modules->get('ProcessInvoice');
$invoicePage = $this->pages->get("template=admin, process=$invoice");
// OR
$invoicePage = $this->pages->get("template=admin, process={$invoice->name}");
Link to comment
Share on other sites

Well it seems it only works if you use the process module id. But no idea how to get that. As far as I know the process is handled through names. Look at admin.php in core.

Edit: So only solution I see for now is looping and checking for $page->process == "ProcessName".

Link to comment
Share on other sites

It's a bit strange...

echo $pages->get('3')->process; // returns "ProcessPageList"
echo $pages->get("process=ProcessPageList")->name; // returns nothing

This happens even in a visible, non admin, template

Link to comment
Share on other sites

Try this one:

$invoice = $this->modules->getModuleID('ProcessInvoice');
$invoicePage = $this->pages->get("template=admin, process=$invoice");

Had to use this in other situation and it works for me. Thanks Ryan!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...