Bruce Van Horn
|
Posted: 09/22/2003, 11:55 AM |
|
Howdy from Texas y'all!
I have a javascript menu which is based on role. By this I mean managers see certain things on their menus that their subordinates do not.
The menu is all javascript and I want to kick it off when the page has loaded, but I need to use CCGetGroupID and pass that in. I'm working in PHP. If I were hand coding I could just put
<?php
echo("<script language='javascript'>showToolbar(" . CCGetGroupID() . ");</script>");
?>
At the bottom of the page and it would work. For those who don't know PHP, the . is the concatenation symbol similar to using + or & in other scripting languages.
I've tried putting it in the footer. I've tried attaching it to a before show event on something near the bottom of the page. In each case, the javascript appears at the very top of the outputted document above the first html tag.
How can I get an echo statement to work within the body of a document?
|
|
|
RonB
|
Posted: 09/22/2003, 11:54 PM |
|
You can't use echo. Use the template structure in CCS.
in before show:
global $Tpl;
$my_var=CCGetGroupID();
$Tpl->SetVar("group_id", $my_var);
In HTML view set {group_id} inside the javascript where you need it. when the page is generated CCS get's the group id and replaces {group_id} with thta value.
Ron
|
|
|
|