/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at .
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox ,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.menu;
import java.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.security.SecurityReferenceMonitor;
public class MenuItemDefinition
{
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private String m_type;
private boolean m_enable;
private int m_indent;
private String m_text;
private String m_linktype;
private String m_link;
private String m_target;
private String m_title;
private String m_on_click;
private String m_perm_namespace;
private String m_perm_name;
private String m_ifdef_var;
private String m_ifndef_var;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
MenuItemDefinition(String type, boolean enable, int indent, String text, String linktype, String link,
String target, String title, String on_click, String perm_namespace, String perm_name,
String ifdef_var, String ifndef_var)
{
m_type = type;
m_enable = enable;
m_indent = indent;
m_text = text;
m_linktype = linktype;
m_link = link;
if ((m_link!=null) && (m_linktype==null))
m_linktype = "ABSOLUTE";
m_target = target;
m_title = title;
m_on_click = on_click;
m_perm_namespace = perm_namespace;
m_perm_name = perm_name;
m_ifdef_var = ifdef_var;
m_ifndef_var = ifndef_var;
} // end constructor
/*--------------------------------------------------------------------------------
* Internal operations
*--------------------------------------------------------------------------------
*/
boolean itemAppears(DynamoUser caller, SecurityReferenceMonitor srm, int[] acl_ids) throws DatabaseException
{
if ((m_perm_namespace==null) && (m_perm_name==null))
return true;
for (int i=0; i