This topic is locked

Assign session to admin rights & admin groups page

11/2/2011 9:04:30 AM
PHPRunner General questions
D
desparados author

I use this code in before display
$xt->assign('title', $_SESSION['title']);
and in every page I display the title in both <title>{$title}</title> and in the page layout.
They works for every pages except admin groups (add user to group) and admin right (permissions).
How do I assign the values in these pages?
Thanks.

Sergey Kornilov admin 11/2/2011

Your code looks good.
If you need additional help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

D
desparados author 11/2/2011

Thanks for the reply.
They don't work in admin groups & admin rights because I couldn't pass the session values. There are no events for these pages.
Is there any way to use $xt->assign for the whole pages without going to each page's Before Display event?
I tried putting them in AfterAppInit & the page breaks, later when I read in the manual , you're not supposed to add anything on the page to AfterAppInit()
Unrelated question: is there any URL where I can view the mobile template? It will be good justification to my boss. I much prefer this to CakePHP. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=61950&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />)
Thanks.

Sergey Kornilov admin 11/3/2011

Unfortunately we do not have a common BeforeDisplay event that can work across all tables. It's a great improvement and we'll implement it at some point.
If your title is going to be the same across all pages you may want to look into layouts and bricks:

http://xlinesoft.com/phprunner/docs/layouts.htm

Theoretically speaking you can create your own layout where header is located inside <title>...</title> tag. Then in include/header.php file you can use

echo $_SESSION["title"]


PS. We don't have a live demo of mobile version yet. You can see screenshots at http://xlinesoft.com/phprunner/docs/mobile_template.htm.