|
of_setcontrolarray
|
|
Full name
|
pfc_n_cst_security.of_setcontrolarray
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_setcontrolarray(string,graphicobject[],string)
|
Name
|
Datatype
|
l_tab
|
tab
|
li_count
|
integer
|
li_idx
|
integer
|
li_numset
|
integer
|
li_numsettemp
|
integer
|
li_rc
|
integer
|
li_tab_cnt
|
integer
|
li_tab_idx
|
integer
|
ls_name
|
string
|
ls_page_name
|
string
|
ls_tab_name
|
string
|
lu_uo
|
userobject
|
protected function integer of_setcontrolarray (string as_window, graphicobject ao_objects[], string as_objectname);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_SetControlArray
//
// Access: protected
//
// Arguments :
// as_window Name of window
// ao_objects[] control array
// as_objectname name of object that owns the control array.
// blank if the window if the owner of the array
//
// Returns: Integer
// The number of controls set
// 0 = Nothing set
//
// Description: Scans the passed control array and set the security as needed on the
// controls. If the control is a tab or User object then it is exploded into it's controls.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Updated to look for object specific settings if no window specific settings used
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
integer li_count, li_idx, li_tab_cnt, li_tab_idx, li_rc, li_numset, li_numsettemp
string ls_name, ls_tab_name, ls_page_name
userobject lu_uo
tab l_tab
// check for controls
li_count = upperbound(ao_objects[])
For li_idx = 1 To li_count
Choose Case typeof(ao_objects[li_idx])
Case userobject!
// set security for just the user object
lu_uo = ao_objects[li_idx]
li_numset = of_SetControlStatus(lu_uo, as_window, as_objectname, '')
If as_objectname = '' Then
ls_name = lower( classname(lu_uo))
Else
ls_name = as_objectname + '.' + lower( classname(lu_uo) )
End If
li_numset += of_SetControlArray(as_window, lu_uo.control, ls_name)
// check the user object for object level security if no window security
If li_numset = 0 Then
of_setsecurity(ao_objects[li_idx])
End If
Case tab!
// set security for just the tab
l_tab = ao_objects[li_idx]
li_numset = of_SetControlStatus(l_tab, as_window, as_objectname, '')
If as_objectname = '' Then
ls_tab_name = lower( classname(l_tab) )
Else
ls_tab_name = as_objectname + '.'+ lower( classname(l_tab) )
End If
li_tab_cnt = upperbound(l_tab.control)
For li_tab_idx = 1 To li_tab_cnt
// scan the tabpages
lu_uo = l_tab.control[li_tab_idx]
li_numset += of_SetControlStatus(lu_uo, as_window, ls_tab_name, '')
// check the tabpage for object level security if no window security
If li_numset = 0 Then
// do not keep track of the number of items set here
of_setsecurity(lu_uo)
End If
// now set security for the controls on the tabpage
ls_page_name = ls_tab_name + '.' + lower( classname(lu_uo) )
li_numsettemp = of_SetControlArray(as_window, lu_uo.control, ls_page_name)
// check the tabpage for object level security if no window security
If li_numsettemp = 0 Then
// do not keep track of the number of items set here
of_setsecurity(lu_uo)
End If
li_numset += li_numsettemp
Next
// check the tab for object level security if no window security
If li_numset = 0 Then
of_setsecurity(ao_objects[li_idx])
End If
Case mdiclient!
// do nothing as the mdiclient is not something that we would want
// to set security on anyway
Case Else
li_numset = of_SetControlStatus(ao_objects[li_idx], as_window, as_objectname, '')
// check the graphic object for object level security if no window security
If li_numset = 0 Then
of_setsecurity(ao_objects[li_idx])
End If
End Choose
Next
// reset the filter
of_loadsecurity(as_window)
Return li_numset
end function