Jump to content


Photo

How to get admin page with certain Process assigned?


  • Please log in to reply
7 replies to this topic

#1 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 11 June 2012 - 06:31 AM

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}");


#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,194 posts
  • 1750

  • LocationSH, Switzerland

Posted 11 June 2012 - 06:49 AM

Not sure, have you tried adding "include=all" ?

@somartist | modules created | support me, flattr my work flattr.com


#3 Soma

Soma

    Hero Member

  • Moderators
  • 3,194 posts
  • 1750

  • LocationSH, Switzerland

Posted 11 June 2012 - 07:32 AM

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".

@somartist | modules created | support me, flattr my work flattr.com


#4 diogo

diogo

    Hero Member

  • Moderators
  • 2,006 posts
  • 1081

  • LocationPorto, Portugal

Posted 11 June 2012 - 07:56 AM

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

#5 ryan

ryan

    Hero Member

  • Administrators
  • 5,773 posts
  • 3122

  • LocationAtlanta, GA

Posted 11 June 2012 - 02:17 PM

Try this one:


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


#6 Soma

Soma

    Hero Member

  • Moderators
  • 3,194 posts
  • 1750

  • LocationSH, Switzerland

Posted 11 June 2012 - 04:01 PM

Weird when I tested this with getModuleID, It'd always return 0. ???

@somartist | modules created | support me, flattr my work flattr.com


#7 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 12 June 2012 - 02:28 AM

I haven't yet tested this, ended up using different method. Will test this soon.

#8 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,526 posts
  • 854

  • LocationVihti, Finland

Posted 15 June 2012 - 06:56 AM

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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users