phpLens
 home  products examples manual  faq support forum  contact news  login store


Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/lens/lensman/gen/propallpage.php on line 30
allowEmptyFilter
Filtering and Searching
allowEmptyFilter
When user performs an empty filter/search, show all records?
Default:
If set to false, when no filter/search criteria is defined, no query is performed.

Setting to true seems to be more natural, while false will improve database performance.

Syntax
$lens->allowEmptyFilter = Boolean;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

alwaysSave
Editing, Updating and Creating Records
alwaysSave
Always save even if record has not changed when set to true
Default:
Before saving a record, we check if the record has changed. If it is not changed, we normally do not save it again as an optimization. Setting

$lens->alwaysSave = true;

overrides this default behaviour. Useful when all records in editMultiple have to be saved in a specific sequence.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 4.0.1]

anchorTags
Editing, Updating and Creating Records
anchorTags
When saving, detect http://* and www.* and email addresses convert them to links
Default:
Only enabled when htmlLens is set for that column.

Syntax
$lens->anchorTags = Boolean;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.10beta]

attachment
Editing, Updating and Creating Records
attachment
Store blobs are downloadable attachments
Default:
Attachments are files which are stored in the database. These are stored using blob, image or bytea (for postgresql) types. When you store the attachment, phplens will also store the file name and file size in readable format in a separate varchar field. If the blob field is called myblob and the varchar field is called myfiledetails, then set

$lens->attachment = 'myblob;myfiledetails';


The second field (myfiledetails) is optional.

You need to configure your phplens SQL statement in a special manner when using attachments. If the table is called myfiles, and has a primary key id then the following SQL is required:

$lens->sql = 'select id, myfiledetails, 0 as "_ATTACHMENT_" from myfiles';

You do not directly access the attachment fields in your SQL because you don't want to retrieve the attachment data (it could be a several very large attachments) everytime you view the phpLens grid. _ATTACHMENT_ is a special alias to the actual field, with a dummy value (0 in this case, though it could be any constant value). PhpLens will detect the _ATTACHMENT_ field and will display a download link when viewing the grid or details. When editing or creating records, the standard upload field form will be shown.

The file info field, myfiledetails in the above example, is also special. You can make it visible in the grid or details. But make sure it is readonly or hidden in the edit/new record form. This field will be automatically filled with the file name and size on record update.

The maximum size of an upload is determined by the imageMaxSize property. There can only be 1 attachment field per record.

Blob Header Format

All BLOBs begin with a header. The first bytes of the header are defined by a constant LENS_ATTACH_HDR in phplens.inc.php. The final bytes of the header consists of '/'.LENS_ATTACH_HDR. Between the header and the end of the header is the header contents.

In phpLens 3.5.0, the header contents is the name of the attachment. In phpLens 3.5.1 and later, it is a MIME content-type definition that looks like this:

/Content-Type: application/octet-stream; name="some file name"

No double-quotes are allowed in the file-name. All double-quotes will be changed to dot (.).

Sample Header:

1@#Cm&NT/Content-Type: application/octet-stream; name="file.jpg"/1@#Cm&NT

Syntax
$lens->imageMaxSize = 1024*1024; // 1 Mb upload
$lens->attachment = 'myblob;myfiledetails';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 3.5]

attrDateTime
Editing, Updating and Creating Records
attrDateTime
Sets tag attributes for date and timestamp input fields
Default:
Typically used to set the CSS class selector of input fields for date and timestamp fields when editing or creating records.

Syntax
$lens->attrDateTime = 'class=small';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 2.5.2]

autoGenerateKey
Editing, Updating and Creating Records
autoGenerateKey
Makes phpLens autogenerate an integer to be stored into keyCol when inserting a new record
Default:
Set this property to true to enable generation of keys by phpLens. If you want to use a custom generator, set this property to the name of the PHP function that returns the key. The generated key is also passed to the eventPostInsertSQL property, and also stored in the generatedKey property after Render() is called.

Note that is only required on selected databases which do not have an auto-incement primary key, including early-PostgreSQL versions, Interbase and Oracle (oci8) currently. Internally, phpLens will create sequences or tables to manage the integer generation.

If you are using autoincrement columns generated by the database (eg. mysql or mssql), you can get the last inserted value using $lens->connection->Insert_ID();

Syntax
# 1. generate integer key
$lens->autoGeneratedKey = true;
$lens->Render();



# 2. use a random function to generate the key.
function genrand()
{
return rand();
}

$lens->autoGenerateKey = 'genrand';
$lens->Render();
# now the generatedKey value is available after an insert
$id = $lens->generatedKey;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.3]

avgLens
Grouping and totaling of rows
avgLens
Display averages in the subtotal and total rows
Default:
Display averages for subtotals and totals.

Syntax
# display averages for the following 2 fields...
$lens->avgLens = 'UnitsInStock;UnitPrice';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 2.2]

bannedTags
Editing, Updating and Creating Records
bannedTags
Regular expression describing which tags are banned for data entry
Default:
Only works if htmlLens is set for that column. Otherwise all tags are converted by htmlspecialchars() to their html entities. Uses Perl compatible regular expressions.

Note: since phpLens 3.0, we no longer ban table, th, td. tr tags by default. This is because the new htmlEditLens allows HTML tables to be created.

Syntax
$lens->bannedTags = Regular Expression String;

Let's dissect the beginning of the default search:

  '/<\/*((SCRIPT)|(META)|(DIV)|(.../i

All Perl compatible regular expressions begin and end with /, so just ignore them.

First we search for < which is the beginning of a tag.

Then we search for an optional slash (/) using \/*.

Next we check for tags (which are separated by the |, which is the OR-operator) such as SCRIPT or META or DIV etc.

The /i at the end means that the regular expression search is case-insensitive.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

border0
Table Cell formating
border0
Set table borders to 0
Default:
0 = use table borders set to border="0"
1 = no borders in cells nor around table
2 = no borders between cells, but place a border around table

It is recommended you do not manually modify this property in an editor, but use the Dynamic Editor as phpLens does special processing on this property.

If you want to manually change the borders, phpLens will not modify the border if you set the border without the quotes, or uppercase the attribute, eg.

border=0
BORDER="1"

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 3.2]

cacheData
Programming
cacheData
Cache data in $ADODB_CACHE_DIR for cacheData seconds
Default:
Make sure that the global variable $ADODB_CACHE_DIR points to the correct directory. See cacheLookups property for more examples.

Data is only cached if the data is set to readonly (no editing/deleting/inserting). Do not set this to true when you have multiple Web servers accessing the same data.

And if scrollLinks is set, then the number of links to display is also cached. This occurs whether or not the data is readonly. In other words, the SELECT COUNT(*) performed by scrollLinks is cached.

Syntax
$ADODB_CACHE_DIR = '/tmp';
$lens->cacheData = 60; # cache 60 secs

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

cacheLookups
Programming
cacheLookups
Cache lookup values for cacheLookups seconds in the $ADODB_CACHE_DIR directory.
Default:
PhpLens uses the ADODB database library internally. ADODB has the ability to cache queries and recordsets in a directory defined by the variable $ADODB_CACHE_DIR. You should define this constant at the top of your script.

This property can speed up phpLens significantly by reducing queries to the database.

Syntax
$ADODB_CACHE_DIR='/path/to/dir';

include('phplens.inc.php');
$conn = NewADOConnection('mysql');
$conn->PConnect('server','user','pwd','db');
$sql = 'select * from table';

$lens = new phpLens('someid',$conn,$sql);
$lens->cacheLookups = 120;

$lens->Render();

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

canDelete
Editing, Updating and Creating Records
canDelete
Show Delete button and allow deletes
Default:
Clicking on the button will ask for confirmation from the user if Javascript is enabled on the browser.

The icon can be modified. It is configured in the language class $lens->lang->iconDel.

Also requires the keyTable and keyCol properties to be defined.

If you want only selected rows to be deletable, you can define an additional column called "_CANDELETE_" and set the value to 0 or 1. Non-zero values means that the row can be deleted. This is available since 2.2.0.

For example, set $lens->sql to the following if you want the user to only be able to delete products that begin with 'A' (assuming your database supports CASE)

SELECT productname, supplier, unitinstock, unitprice,
  CASE
    WHEN substr(productname,1,1) = 'A' THEN 1
    ELSE 0
  END "_CANDELETE_"
FROM products

Syntax
$lens->canDelete = Boolean;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

canEdit
Editing, Updating and Creating Records
canEdit
Show Edit button and allow record updates
Default:
Also requires the keyTable and keyCol properties to be defined.

The icon can be modified in $lens->lang->iconEdit.

If you want only selected rows to be editable, you can define an additional column called "_CANEDIT_" and set the value to 0 or 1. Non-zero values means that the row is editable. Available since 2.2.0.

For example, set $lens->sql to the following if you want the user to be able to only edit products that begin with 'A' (assuming your database supports CASE)

SELECT productname, supplier, unitinstock, unitprice,
  CASE
    WHEN substr(productname,1,1) = 'A' THEN 1
    ELSE 0
  END "_CANEDIT_"
FROM products

Syntax
$lens->canEdit = Boolean;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

canNew
Editing, Updating and Creating Records
canNew
Show New Record button and allow record creation
Default:
The icon can be modified. It is configured in the language class $lens->lang->iconNew.

Also requires the keyTable and keyCol properties to be defined.

Syntax
$lens->canNew = Boolean;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

cellFontPrefix
Table Cell formating
cellFontPrefix
Tags to prefix to data cell text
Default:
Tags must match cellFontSuffix.

Syntax
$lens->cellFontPrefix = String;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

cellFontSuffix
Table Cell formating
cellFontSuffix
Tags to append to cell data
Default:
Must match cellFontPrefix.

Syntax
$lens->cellFontSuffix = String;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

chartFontPrefix
Charting
chartFontPrefix
Tags to prefix chart numbers
Default:
Chart numbers must always be monospaced so that they align properly.

Syntax
$lens->chartFontPrefix = String;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

chartFontSuffix
Charting
chartFontSuffix
Tags to append to chart numbers
Default:
Must match chartFontPrefix.

Syntax
$chartFontSuffix = string

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

chartLens
Charting
chartLens
Fields listed in this lens are displayed as charts
Default:
The field must be of type integer or numeric. There are two types of charts you can create.

Bar Charts
The first is a horizontal bar chart. If the chart has both negative and positive numbers, you can choose two different colors for the negative and positive values.

Chart dimensions must be set for bar charts. This is the maximum size of a chart. Set the width and height.

To fit the chart into the chart dimensions, phpLens needs to estimate the maximum and minimum values of the field. You can provide an SQL statement to calculate it here, or hard-code numeric values (this is faster).

Icon Chart
The other chart is the icon chart, which shows a picture for every Scale units (rounded up).

Setting Chart Min/Max
The scale of the chart is determined by these settings. Chart Min is the smallest possible value and Chart Max is the largest possible value in that column. You can set this value manually (default), or execute an SQL statement to do this, normally:
select min(col),max(col) from table
From these values and the Chart Dimensions, phpLens is able to scale the chart correctly.

Syntax
$lens->chartLens = 'Col1;Col2;Col3';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

chartParams
Charting
chartParams
Stores charting parameters set when dynamic editing enabled
Default:
If you need to save the chart settings as source code, set your charting parameters using dynamic editing, generate the PHP code, then copy and save the chartParms and chartLens properties.

Syntax
Not documented currently because the format will change in future versions.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

checkBoxes
Table Rows and Columns
checkBoxes
Display checkboxes in each row, and menu to act on items checked.
Default:
The following example:

$lens->checkBoxes = 'move^Move Records;del^Hide Records';

Will make a set of checkboxes appear on the grid, one for each row. There will be a menu to select "Move Records" and "Hide Records". Make sure that the keyCol property (defines the primary key) is also set to ensure that the checkboxes return something meaningful.

To process records, check multiple records, then select an item from the menu, say "Move Records", then click on Go. This will cause a POST to occur, with $id being the applet id:

$_POST[$id.'__cbopt'] set to 'move'
$_POST[$id.'__cbstr'] Primary keys of the checked records stored as a string, delimited by the value of $lens->checkBoxesSep, eg. '!#@'.
$_POST[$id.'__cbnotstr']Primary keys of the unchecked records stored as a string, delimited by the value of $lens->checkBoxesSep, eg. '!#@'.

Then you will have to write some PHP code to process this $_POST yourself, eg.

if (isset($_POST[$id.'__cbopt']) && $_POST[$id.'__cbopt'] == 'move') {
  $arr = explode('!#@', $_POST[$id.'__cbstr'];
  foreach($arr as $primkey) {
    # some code to move records based on $primkey ...
  }
}

The checkbox posting code uses javascript to post the data, so will not interfere with any form tags you have embedded inside the grid, or the editMultiple property form tags.

Special Flags

_auto_

The default dropdown menu has a Go button that needs to be pressed before the form results are submitted. Setting this flag will cause selecting from the dropdown menu to submit the results.

$lens->checkBoxes = 'move^Move Records;del^Hide Records;_auto_';


_update_^$colname[^$updateflds]

In the following example:

$lens->checkBoxes = 'move^Move Records;del^Hide Records;_update_^statusfld';

When a user selects 'move', then all checked records will be updated with 'move':

UPDATE $keyTable SET statusfld='move' where (statusfld != 'move' or statusfld) is null and $keyCol=$checkedPrimaryKey


The $updateflds parameter is useful when you need to update additional information. For example:

$lens->checkBoxes = 'move^Move Records;del^Hide Records;_update_^statusfld^modified=sysdate';

Will cause the following sql to be generated:


UPDATE $keyTable SET statusfld='move',modified=sysdate where (statusfld != 'move' or statusfld) is null and $keyCol=$checkedPrimaryKey


_col_^$colname[^$emptyval][^$updateflds]

This ties the checkbox to a database column. Useful for approvals and similar functionality. When the user changes the field, the database is also updated.

If the value of the field satisfies the PHP empty() function [null or 0 or '' or '0' or false], then the checkbox is unchecked, otherwise the checkbox is checked.

In this mode, only the records that are changed (clicked on by the user) are POSTed to the server.

$lens->checkBoxes = '1^Approve Records;_col_^select_field^0';

So records that are checked will be updated with:

UPDATE $keyTable SET select_field=1 WHERE (select_field!=1 or select_field is null) and $keyCol=$checkedPrimaryKey

and records that are unchecked:

UPDATE $keyTable SET select_field=0 WHERE (select_field!=0 or select_field is null) and $keyCol=$uncheckedPrimaryKey

The _update_ flag is ignored in when _col_ is defined.

The $updateflds parameter is useful when you need to update additional information, and is used in the same way as in _update_.

Syntax
$lens->checkBoxes = 'move^Move Records;del^Hide Records';
$lens->keyCol = 'PrimaryKeyField'; ## required

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 4.1]

checkBoxesSep
Table Rows and Columns
checkBoxesSep
Separator/delimiter to string of primary keys
Default:
Separator used when posting checkbox values, eg. $_POST[$id.'__cbstr'].

So if the primary keys selected are 22,44,60 and the applet id is $id, then

$_POST[$id.'__cbstr'] = '22!#@44!#@60';

will be posted. Also see checkBoxes property.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 4.1]

childLens
Editing, Updating and Creating Records
childLens
Replaces the details grid with an editor to create/edit records
Default:
Legal settings:

Create and EditNew record form is the default, unless a record is selected for editing
Edit OnlyAlways show the edit record form for the current record
Create OnlyAlways show the new record form
Edit and CreateShow edit record form for the current record is the default. When the new record icon is clicked, show the new record form in details


This is called childLens because internally, it creates a second phpLens object(the child) to do the editing.

Syntax:

$lens->childLens = '{id of child phplens}[;editdetail][;newdetail][;editfirst]';

The string editdetail is a constant that specifies editing is allowed in the detail grid.

The string newdetail is optional and when defined, will display the create new record screen in the detail grid when no record has been clicked on. The editdetail constant must also be set for newdetail to work.

The id of the child phpLens should be a unique value that is not used by other phpLens objects.

Since phpLens 2.4, both editdetail and newdetail are optional.

Since phpLens 2.4.8, a new optional setting, editfirst is available. When makes editing the default instead of creating a new record if both editdetail and newdetail are defined.

Syntax
Example 1: Simple Example

include_once('./phplens.inc.php');
session_start();

$db = &ADONewConnection('mysql');
if (!$db->PConnect('localhost','root','','db')) print 'Error:'.$db->ErrorMsg();
$lens = new PHPLens('editdet',$db,' select * from products order by 1 ');
$lens->childLens = 'editdet2;editdetail';
$lens->canEdit = true;
$lens->canDelete = true;
$lens->canNew = true;
$lens->Render();
$lens->Close();


Example 2: You want to modify the child phplens object so the top border is green.
You will need to extend the Clone() method:

include_once('./phplens.inc.php');
session_start();

class PhpLens2 extends PhpLens {
function &Clone()
{
$lens = PhpLens::Clone();
$lens->colorNavBorder = 'green';
return $lens;
}
}

$db = &ADONewConnection('mysql');
if (!$db->PConnect('localhost','root','','db')) print 'Error:'.$db->ErrorMsg();
$lens = new PHPLens2('editdt',$db,' select * from products order by 1 ');
$lens->childLens = 'editdt2;editdetail';
$lens->canEdit = true;
$lens->canDelete = true;
$lens->canNew = true;
$lens->Render();
$lens->Close();

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.2]

colorBackground
Colors
colorBackground
Color of the background area outside the grid and detail table
Default:

Syntax
$lens->colorBackground = Color String;

$lens->colorBackground = 'black';
$lens->colorBackground = '#000000';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorEven
Colors
colorEven
Color of even rows in grid
Default:
Set the bgcolor in the TR tag. Addional TR properties can be placed after the color, for example:

$lens->colorEven = 'yellow valign=bottom';

See also colorOdd.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorFooter
Colors
colorFooter
Color of any totals at bottom of grid
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorGroup
Colors
colorGroup
Color of any column grouping rows
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorLens
Table Cell formating
colorLens
Dynamicly change color of column or cell, and column attributes too.
Default:
You can use this property to enter a grid background color such as 'white' or 'black', or use the numeric RGB values where #000000 and #FFFFFF is white.

To set dynamic colors in your columns, set the first character to an equals (=), then you can use the PHP's ternary logical operator or your own pre-defined function to perform checks and comparisons.

PHP has a nice way of allowing you to choose between multiple values in one line of code:
= (expr) ?
"value if expr is true" : "value if expr is false"



An example is given a column named UnitsInStock, and we want to color the column red if the units are less than 10:
=({UnitsInStock} < 10)? "red" : ""

You can also use any global variables defined in the $GLOBALS array using {$VARNAME}, for example {$PHP_SELF}.

The colorLens property can access any column in the current row using the {columnname} syntax just like the powerLens.

Additional Macro Variables Available
{NBSP} = ' '
{SEMICOLON} = ';'
{_HILITE_RECNO_} = current record number
{_LENSID_} = the phpLens object's id
{_ODDC_} = the odd row color
{_EVENC_} = the even row color
{_SELECTC_} = the hilite color for the current line
{_HASDETAILS_} = whether the detail grid is visible

Changing Column Attributes

You can also change column widths with this property by taking advantage of a side-effect. Any attribute can be added to the TD tag using colorLens. See example in syntax. Note that setting the column width is discretionary. The browser can override this setting if it wants to.

However since phpLens 2.6, we have the tdLens property, which allows you direct access to all td attributes. Note however that tdLens does not do column interpolation (eg {col1}) nor php code processing (with =).

Title and Input Background Colors

Since phpLens 4.9, you can control the background color of the detail, edit and new titles, and the input background colors. To set the title background color for field FIELD1 to black, the title font to white, and the input background to lightyellow, use

$lens->colorLens = 'field1^^black style='color:white'^lightyellow';

To set the grid cell color to pink too, use

$lens->colorLens = 'field1^pink^black style='color:white'^lightyellow';

For title and input cells, the dynamic colors using the = prefix is NOT available.

Syntax
$lens->colorLens = 'totals^yellow'; // color the totals column yellow

$lens->colorLens = 'totals^yellow width=200px'; // ... sets the width too


$lens->colorLens = 'totals^yellow;name^#0000FF'; // and name is blue

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorNav
Colors
colorNav
Color of the navigation bar cells
Default:
This property determines the color inside the menu option cells. ColorNavBorder sets the border color of the cells.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorNavBorder
Colors
colorNavBorder
Color of background behind captions and navigation bar
Default:

Syntax
$lens->colorNavBorder = '#C0C0C0';


# to use with CSS
# assuming the following is defined:
# .navcss {background: #C0C0C0}

$lens->colorNavBorder = '#C0C0C0 class=navcss';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorOdd
Colors
colorOdd
Color of odd rows in grid
Default:
Set the bgcolor in the TR tag. Addional TR properties can be placed after the color, for example:

$lens->colorOdd = 'yellow valign=bottom';

See also colorEven.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorRecNo
Colors
colorRecNo
Color of background of RecNo column
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorSelect
Colors
colorSelect
Color of selected sort column and selected recno
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorSubFooter
Colors
colorSubFooter
Color of subtotals when groupLens enabled
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

colorTitle
Colors
colorTitle
Color of column/field title cell
Default:
Set the bgcolor in the TH tag. Addional TH properties can be placed after the color, for example:

$lens->colorTitle = 'yellow align=right';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

columns
Table Rows and Columns
columns
Number of columns to display in grid
Default:
Auto-Resizing

If $lens->columns > 1 and $this->pageSize >= 1000, then phpLens will auto-resize the grid to fit all records in one page by adjusting the number of records per column.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

compat
Programming
compat
Compatibility mode, defaults to 2.0
Default:
When set to 2.0, phpLens uses the default behaviour for the following:

a. Filtering lookups use =1/2/3/4/5 and no mapping is allowed.

When $lens->compat = 2.5 or greater

a. Filtering lookups behave like powerLens. Eg. =1/One/2/Two for mapping lookups, or ==1/2/3/4/5 for no mapping.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 2.5.1]

connection
Programming
connection
Holds the ADOdb connection object
Default:
This represents the connection to the database. You can access access the connection resource directly using $lens->connection->_connectionID.

See also rs, the recordset property, and the ADOdb manual.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

connectionLookups
Programming
connectionLookups
Instead of using the default connection, use this connection for sql lookups
Default:
There are 2 ways to use it. First is to set it to an existing database connection:

$db =& NewADOConnection('mysql');
$db->PConnect($host,$user,$pwd,$db);
$lens->connectionLookups =& $db;

Alternatively, define a database connection string (defined in $PHPLENS_DATABASES, in the phplens/config/phplens.config.inc.php file).

$lens->connectionLookups = 'mysql_db2';

PHPLens will create a persistent connection.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

css
Colors
css
CSS include file.
Default:
CSS file to include that contains CSS definitions. Should be the absolute path if defined. See the CSS Blue and CSS Red examples, which make use of the default phplens/img/phplens.css file.

Syntax
$lens->css = '/css/site.css';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 2.4.10]

curState
Programming
curState
Current phpLens state.
Default:
Legal states:

'VIEW' means view the normal grid
'EDIT' means edit a record
'FILTER' is when we are in the search screen but have not initiated a search.
'FILTERVIEW' means we have initiated a search
'NEW' is when we are creating a new record
'EDITSAVE', see below, has been available since phpLens 2.4.2.
'HIDE' hides the phplens object. Available since phpLens 3.2.

This property is read-only and should not be changed directly. To force a record edit or to create a new record or to force a search, use GET variables instead, as documented in the FAQ at http://phplens.com/lens/faq/faq.php?#402

New to phpLens 2.4.2 is the EDITSAVE state. Set firstState = 'EDITSAVE' when we want to display an EDIT screen in firstState, but after we successfully save, we want switch to VIEW.

Also if firstState is EDIT and we click on Save and save was successful, we set curState to EDITSAVE. This is a state that is otherwise identical to EDIT. To maintain backward compatiblity, to detect EDIT state, we suggest using

substr($this->curState,0,4) == 'EDIT'

HIDE
The curState property is normally read-only, but you can hide the phpLens object for 1 page request by setting $lens->curState = 'HIDE'.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

dataVers
Information and Debugging
dataVers
Version number of phpLens internal data format
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

debug
Information and Debugging
debug
Debug level. 0=none, 1=show SQL, 2=detailed view
Default:
The settings are

-1 = show template skeletons
0 = no debugging
1 = show SQL and phpLens state
2 = show lots of information

Syntax
$lens->debug = Integer;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

debugDie
Information and Debugging
debugDie
Print SQL generated by phpLens and halt execution.
Default:
Useful for debugging poorly optimized SQL that is running too long. The SQL is not executed.

Syntax
$lens->debugDie = 1;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 2.0]

defaultLens
Editing, Updating and Creating Records
defaultLens
On new record, these are the default values of specified fields
Default:
When creating a new record, you might want a default value to be automatically entered. You can enter a normal string (without quotes) or number, or generate the value dynamicly using PHP or your RDBMS.

Default values can be hard-coded values, or you can execute PHP code if you prefix with the equals(=) character.

Dates can either be generated in Unix timestamp format provided you return the value as an integer, or in 'Y-m-d H:i:s' format.

Executing PHP Code
When you want the value to be dynamically generated by PHP, set the first character to an equals (=) to treat the following text as PHP code.

To generate the current date, use the PHP time function like this:
=time()

PHP Globals
To access global variables, before 3.2, you needed to use the following:

=$GLOBALS['PHP_SELF']

Since 3.2, you can use this directly:

=$PHP_SELF

Database Example
To access the ADODB connection from here, use the following example, which passes the connection object to the getvalue function:

$lens->defaultLens = 'col1^=getvalue($this->lens->connection)';


Executing SQL Code
Sometimes, you have a read-only field whose value is generated by your SQL server and not by the user. You can do this by setting the first character to percentage (%) to treat the following text as SQL code. Since 2.5.2, you can also put PHP global variables in the SQL string.

To set a column to a random number in Microsoft SQL server, use the rand function like this:
%rand()

Syntax
To set a field called thetime to the current datetime:

$lens->defaultLens = 'thetime^=time()'


To execute a standard SQL function for a field called rr:

$lens->defaultLens = 'rr^%rand()';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailFontPrefix
Table Cell formating
detailFontPrefix
Tags to prefix to cell data for detail, new and edit tables
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailFontSuffix
Table Cell formating
detailFontSuffix
Tags to append to cell data for detail, new and edit tables
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailHdr
Table and Grid formating
detailHdr
Attributes of <TR> tag for detail table
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailLeftColor
Colors
detailLeftColor
Color of left column of detail grid and edit/new record
Default:
Color of left column of edit form, new record form, and detail grid.

Syntax
$lens->detailLeftColor='red';

# with alternative CSS
$lens->detailLeftColor='red class=redcss';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailLens
Table Rows and Columns
detailLens
This lens sets which fields are shown in the detail table
Default:

Syntax
$lens->detailLens = 'FieldName1;FieldName2;FieldName3';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailRightColor
Colors
detailRightColor
Color of right column of detail grid or edit/new record
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailTableHeader
Table and Grid formating
detailTableHeader
Attributes of detail <table> tag
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailTitle
Table and Grid formating
detailTitle
Display title in detail grid
Default:

Syntax
$lens->detailTitle = '<b>Current Record</b>';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 3.5]

detailTitleFontPrefix
Table Column/Field Titles
detailTitleFontPrefix
Tags to prefix to detail, edit, new, filter table column titles
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailTitleFontSuffix
Table Column/Field Titles
detailTitleFontSuffix
Tags to append to detail table column titles
Default:

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

detailTitleHeader
Table and Grid formating
detailTitleHeader
Attributes of TD tag for field titles
Default:
Sets the TD tag attributes of the detail grid for titles.

Syntax
$lens->detailTitleHeader = 'class=title';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 3]

detailValueHeader
Table and Grid formating
detailValueHeader
Attributes of TD tag for field values in detail grid
Default:

Syntax
$lens->detailValueHeader = 'class=detailvals';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 3]

displaySep
Programming
displaySep
The separator used to display the checkbox choices
Default:
When selecting multiple checkboxes, the choices selected are stored in the field, using the displaySep as the separator. For example, you have a set of checkboxes storing the following values: "Giraffe", "Lion", "Zebra". The user selects the first two values, so we store in the database "Giraffe, Lion".

If the displaySep was '||', then we would store "Giraffe||Lion".

The default is comma-space (', ').

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.1]

dynEdit
Essential
dynEdit
Turn on dynamic editing
Default:
Use this to determine whether users can modify phpLens dynamic settings.

When dynEdit is disabled, all dynamic edit settings are not loaded from the phpLens table. So make sure you Generate PHP Code and paste your changes into your .php file before turning off dynEdit.

Sometimes the phpLens source code settings are in conflict with the dynamic editing settings. In this case you should Generate PHP Code and save it as a backup. Then click on the Remove Settings to wipe out all dynamic editing settings that might be in conflict with your PHP source code. Finally, manually merge any settings from the backup to that are missing in the original source code.

Syntax
$lens->dynEdit = Boolean;

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

dynUseSessions
Programming
dynUseSessions
Use dynamic editing settings
Default:
Set this to false if you want to ignore dynamic editing settings. This will speed up phpLens because phpLens will not query the phpLens table to get configuration settings.

This means that all dynamic editor settings are ignored. When using applets, dynUseSession is always set to false.

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

editClick
Editing, Updating and Creating Records
editClick
Set to true to edit a record when you click anywhere in a row
Default:
Due to problems with browser incompatibilities, this property is no longer supported. Though we will leave it available for backward compatibility, we will not entertain any support requests regarding using this property.

Set to true to enable.

This only works when the keyCol property is defined (eg. the primary key is known), editMultiple = false and no child editor is configured (childLens property).

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 2.4]

editHiddenTags
Editing, Updating and Creating Records
editHiddenTags
Define hidden input tags to be included in edit form
Default:
Any invisible tag can be defined here. These tags can be used to embed any additional information that you require for your own processing.

Syntax
$lens->editHiddenTags = '<input type=hidden name=test2 value=22>';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]

editLens
Editing, Updating and Creating Records
editLens
This lens sets which fields are shown when editing
Default:
This is normally combined with readonlyLens for fields that are viewable but not modifiable.

Syntax
$lens->editLens = 'FieldName1;FieldName2;FieldName3';

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]