Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » XML+XSL matters » Change XSLT based on role
Change XSLT based on role [message #1351] Wed, 28 May 2008 11:53 Go to next message
cpscdave is currently offline  cpscdave
Messages: 20
Registered: June 2006
Junior Member
Is there a way you can change which xsl file is used base on what role the current user is?

I realize that we could add a check in the screen file but then we'd have to make changes to every screen file. Ideally it be nice if there is a way to tell the framework to use xsl_role1/std.list1.xsl if you're role1 or xsl_role2/std.list1.xsl if you're role2.

Any hooks in the framework that will allow this?
Thanks
Re: Change XSLT based on role [message #1352 is a reply to message #1351] Wed, 28 May 2008 14:57 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
No, the XSL file is fixed for each transaction pattern. What parts of the screen layout are you trying to change based on the role, and why?

Re: Change XSLT based on role [message #1353 is a reply to message #1351] Wed, 28 May 2008 16:42 Go to previous messageGo to next message
cpscdave is currently offline  cpscdave
Messages: 20
Registered: June 2006
Junior Member
We want to integrate the end-user view into a pre-designed website.

But don't want to have do it for the admin level users. This is because the admin level users will be visiting more than subsystem that dont fit the template.

We want to present 2 views, an user view which is very stylized while the admin view remains sharp and clean.
Re: Change XSLT based on role [message #1354 is a reply to message #1353] Wed, 28 May 2008 18:43 Go to previous message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
If you want to change the 'look' of the output screens your first choice should really be use a different CSS file, as documented in http://www.tonymarston.net/php-mysql/cascading-style-sheets. html

If you really must switch to a different XSL file at runtme then this is possible. The contents of the screen structure file is read into a global variable called $structure at the start of each script, so its contents can be amended before being used to generate the HTML output. You will need to put code into each script similar to the following:
    if ($_SESSION['role_id'] == 'whatever') }
        $GLOBALS['structure']['xsl_file'] = 'whatever';
    }


Previous Topic: xsl transformation slow
Next Topic: Hacking into the XSLT process
Goto Forum:
  


Current Time: Fri Nov 08 17:30:57 EST 2024

Total time taken to generate the page: 0.01031 seconds