added an extra parameter to frame generation, so I can mimic the custom
functionality alredy provided by the frame on Electric Minds
This commit is contained in:
parent
821a0be3eb
commit
ce6136ab9e
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
* Copyright (C) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
* Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
|
|
@ -297,8 +297,7 @@ public class FrameAssembler
|
|||
m_base_params = new BaseParams(); // create base parameter object
|
||||
|
||||
// Get the security reference monitor.
|
||||
m_srm =
|
||||
(SecurityReferenceMonitor)(GetObjectUtils.getDynamoComponent(services,SecurityReferenceMonitor.class,
|
||||
m_srm = (SecurityReferenceMonitor)(GetObjectUtils.getDynamoComponent(services,SecurityReferenceMonitor.class,
|
||||
name_srm));
|
||||
// Load the menu provider.
|
||||
m_menu_prov = (MenuProvider)(GetObjectUtils.getDynamoComponent(services,MenuProvider.class,name_menu));
|
||||
|
@ -309,8 +308,7 @@ public class FrameAssembler
|
|||
m_shut_event = reg.registerDynamicUpdateListener(GlobalPropertyUpdateEvent.class,this);
|
||||
|
||||
// Add an object to the standard objects available to Velocity.
|
||||
VelocityRendererConfig vrcon =
|
||||
(VelocityRendererConfig)(services.queryService(VelocityRendererConfig.class));
|
||||
VelocityRendererConfig vrcon = (VelocityRendererConfig)(services.queryService(VelocityRendererConfig.class));
|
||||
m_shut_vr = vrcon.addStandardComponentInstance("frame",new VelocityOps());
|
||||
|
||||
// Register this object as a filter for output.
|
||||
|
@ -356,12 +354,10 @@ public class FrameAssembler
|
|||
{ // get the user
|
||||
RequestHelper rh = new RequestHelper(r);
|
||||
SessionInfo session = rh.getSession();
|
||||
DynamoUser user = (DynamoUser)(session.getObject(SessionInfoParams.NAMESPACE,
|
||||
SessionInfoParams.ATTR_USER));
|
||||
DynamoUser user = (DynamoUser)(session.getObject(SessionInfoParams.NAMESPACE,SessionInfoParams.ATTR_USER));
|
||||
|
||||
// get the request-borne data
|
||||
String location = (String)(r.getObject(SessionInfoParams.REQ_NAMESPACE,
|
||||
SessionInfoParams.RATTR_LOCATION));
|
||||
String location = (String)(r.getObject(SessionInfoParams.REQ_NAMESPACE,SessionInfoParams.RATTR_LOCATION));
|
||||
Boolean display_login = (Boolean)(r.getObject(SessionInfoParams.REQ_NAMESPACE,
|
||||
SessionInfoParams.RATTR_DISPLAY_LOGIN));
|
||||
|
||||
|
@ -397,6 +393,7 @@ public class FrameAssembler
|
|||
} // end if
|
||||
|
||||
MenuRenderObject floating_menu = null;
|
||||
String floating_selector = null;
|
||||
if (reload)
|
||||
{ // which menu do we load?
|
||||
if (menusel.equals("top"))
|
||||
|
@ -418,14 +415,21 @@ public class FrameAssembler
|
|||
|
||||
} // end else if
|
||||
|
||||
floating_selector = menusel_full;
|
||||
|
||||
// save the menu and menu selector into the session
|
||||
session.setObject(SessionInfoParams.NAMESPACE,SessionInfoParams.ATTR_MENU,floating_menu);
|
||||
session.setObject(SessionInfoParams.NAMESPACE,SessionInfoParams.ATTR_MENU_SELECTOR,menusel_full);
|
||||
|
||||
} // end if
|
||||
else // get the current menu from the session
|
||||
else
|
||||
{ // get the current menu from the session
|
||||
floating_menu = (MenuRenderObject)(session.getObject(SessionInfoParams.NAMESPACE,
|
||||
SessionInfoParams.ATTR_MENU));
|
||||
floating_selector = session.getObject(SessionInfoParams.NAMESPACE,
|
||||
SessionInfoParams.ATTR_MENU_SELECTOR).toString();
|
||||
|
||||
} // end else
|
||||
|
||||
// get the footer and optionally insert line breaks
|
||||
String footer = (String)(m_blocks.getObject(NAMESPACE,BLOCK_FOOTER));
|
||||
|
@ -435,7 +439,7 @@ public class FrameAssembler
|
|||
|
||||
// return the FrameRendering!
|
||||
return new FrameRendering((FramedContent)input,m_frame_template,m_base_params,user,location,
|
||||
display_login,fixed_menu,floating_menu,footer);
|
||||
display_login,fixed_menu,floating_menu,floating_selector,footer);
|
||||
|
||||
} // end try
|
||||
catch (DatabaseException e)
|
||||
|
|
|
@ -32,9 +32,9 @@ class FrameRendering implements VelocityRenderable
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private String m_templ;
|
||||
private VelocityParamSupplier m_base_params;
|
||||
private HashMap m_local_vars = new HashMap();
|
||||
private String m_templ; // template to be used
|
||||
private VelocityParamSupplier m_base_params; // base variables common to all frames
|
||||
private HashMap m_local_vars = new HashMap(); // local variables
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
|
@ -43,7 +43,7 @@ class FrameRendering implements VelocityRenderable
|
|||
|
||||
FrameRendering(FramedContent content, String templ, VelocityParamSupplier base_params, DynamoUser user,
|
||||
String location, Boolean display_login, MenuRenderObject fixed_menu, MenuRenderObject floating_menu,
|
||||
String footer)
|
||||
String floating_selector, String footer)
|
||||
{
|
||||
m_templ = templ;
|
||||
m_base_params = base_params;
|
||||
|
@ -58,6 +58,7 @@ class FrameRendering implements VelocityRenderable
|
|||
m_local_vars.put("display_login",display_login);
|
||||
m_local_vars.put("fixed_menu",fixed_menu);
|
||||
m_local_vars.put("floating_menu",floating_menu);
|
||||
m_local_vars.put("floating_menu_selector",floating_selector);
|
||||
m_local_vars.put("footer_text",footer);
|
||||
|
||||
} // end constructor
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
display_login = True if we should display the "Log In | Create Account" or "Log Out | Profile" links
|
||||
fixed_menu = The "fixed" menu
|
||||
floating_menu = The "floating" menu
|
||||
floating_menu_selector = The string selector for the "floating" menu
|
||||
footer_text = The text of the page footer
|
||||
sitetitle = Site title (from global properties)
|
||||
siteurl = URL to the site
|
||||
|
@ -117,6 +118,7 @@
|
|||
<tr valign="top">
|
||||
<td align="left" width="$lbar_width" rowspan="2" class="frameleft">
|
||||
#comment( "BEGIN LEFT SIDEBAR" )
|
||||
#comment( "Floating menu selector: $!floating_menu_selector" )
|
||||
<div class="frameleft">#render( $floating_menu )</div>
|
||||
<div> </div>
|
||||
<div class="frameleft">#render( $fixed_menu )</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user