% '============================================================= '// '// Repeater '// '// version: 1.1 '// last modified: 09-May-2004 03:03 by Sasha Vukovic '============================================================= %> <% Class Repeater 'Private mobjAccessControl Private mTableName Private mRowId Private mEnabled Private mDisabled Private mControlObject Private mStartPosition Private mTotalRecords Private mLastRecord Private mNavigator Private MAX_ROWS Private objRs Private RS_NAME Public Property Let TableName ( sTableName ) mTableName = sTableName End Property Public Property Let RowId ( sRowId ) mRowId = sRowId End Property Public Property Let Row ( sRow ) mEnabled = ConstructRow( sRow ) End Property Public Property Let Enabled ( sEnabled ) mEnabled = sEnabled End Property Public Property Let Disabled ( sDisabled ) mDisabled = sDisabled End Property Public Property Let ControlObject ( sControlObject ) mControlObject = sControlObject End Property Public Property Let MaxRows ( nMaxRows ) MAX_ROWS = nMaxRows End Property Public Property Let RecordSet ( ByRef oRs ) Set objRs = oRs Call InitialiseNavigator() End Property '----------------------------------------------------------------------------------------------------------------- Public Sub Render ( ByRef oAccessControl ) '--- Exit if Control Object is not supplied --- If IsNull(mControlObject) Then Err.Raise 8, "Repeater requires Access Control object name before Render!", "" Exit Sub End If ' Access Control module supplied If oAccessControl.IsDataVisible ( mTableName, mRowId, mControlObject ) Then If oAccessControl.IsDataActive ( mTableName, mRowId, mControlObject ) Then Response.write mEnabled Else Response.write mDisabled End If End If End Sub '----------------------------------------------------------------------------------------------------------------- Public Sub RenderDataGrid () '--- Render rows --- Do While (NOT objRs.BOF) AND (NOT objRs.EOF) If objRs.RowPosition => (mStartPosition + MAX_ROWS) Then Exit Do ' Limit the number of rows displayed Response.write Eval( mEnabled ) objRs.MoveNext Loop End Sub '----------------------------------------------------------------------------------------------------------------- Public Sub Navigator ( bResults, bNavigator ) '== Definition == Dim sResults, sNavigator '-- Create Results String sResults = "" If bResults Then If mTotalRecords > 0 Then sResults = "Showing "& mStartPosition &" - "& mLastRecord &" of "& mTotalRecords Else sResults = "No Results." End If End If '-- Create Navigator String sNavigator = "" If bNavigator Then sNavigator = mNavigator End If '-- Display Navigator Response.write _ "
| "& sResults &" | "&_ ""& sNavigator &" | "&_ "