
The Choose dropdown menu that is currently selected in the picture above allows you to define settings that affect multiple columns. For example, selecting Grid Columns allows you to choose which columns are shown in the grid.
Just below the menu are a series of tabs that allow you to control different parts of phpLens. Note that you can make changes on multiple tabs before saving.
| Tab Name | Description |
| Colors | The first tab allows you to define the colors used by phpLens. You can also define your own color styles by adding new array entries to the Javascript array PHPLENS_styles in phplens/img/phplens-js.styles.js. |
| General | Allows you to set the first state of phpLens, debugging options, SQL, table to save to, and primary key. |
| Editing | Configure edit/insert/delete permissions, and record locking. |
| Display | Manage number of rows to display, table sizing, and other display options. |
| Formats | Date formating and captions to display when editing, inserting and searching. |
| Templates | Smarty template names to use. |
| Titles | Allows you to create multiple-level titles. |
| Menus | Menu display. |
The General tab is shown below:
Online help on each feature is available by clicking on the associated caption. Note that you can change settings in multiple tabs without having to save, and only when you are satisfied with your changes, do you click on Save Settings.
$lens->css = '/css/myphplens.css';
Then you can define styles for different parts of phpLens. For example, to configure the background of field titles, you could define in myphplens.css:
.lens-title {background:lightyellow}
and in your source code:
$lens->colorTitle = 'lightyellow class=lens-title'
For non-CSS compliant browsers, the field title will be lightyellow, which for CSS compliant ones, the lens-title class will be used. Note that the default non-CSS color must be defined first, before the CSS class selector is defined.
| Partial List of Properties that Support CSS after the color is specified |
| colorNavBorder |
| colorNav |
| colorOdd |
| colorEven |
| colorSelect |
| colorRecNo |
| colorGroup |
| colorSubFooter |
| colorFooter |
| detailLeftColor |
| detailRightColor |
| colorBackground |
Tips
You can configure the following things when creating records:
| How Do I... | Solution | Properties modified |
| Create scrolling links like google? | Enter the number of Scroll Links in global settings. Or set $lens->scrollLinks to the number of scroll links you want to see. An odd number is recommended. | scrollLinks |
| How do i debug phpLens | You can turn on debugging by setting $lens->debug = 1 (or 2 for more info), or selecting Debug from the global settings. This will output the SQL generated, any error messages, the current internal state of phpLens, and other useful information, | debug |
| Allow editing in the detail grid | Set the Child Editor in Detail Grid setting. | childLens |
| How do I enable editing? | Go to the Editing tab and define the Table data is saved to, and the Primary Key of Table. Then click on Save Settings. The next time you open global settings, you will be able to enable editing, creating new records and deleting. | keyCol, keyTable, canEdit, canDelete, canNew |
| How do i start phpLens in search mode | Set Start phpLens to "Search Form showing Records", or if you want to only show the search form when no search is running, select "Search Form". | firstState |
| Perform editing within the grid | Check the Edit Multiple Records checkbox, or set $lens->editMultiple = true. | editMultiple |
| I want to define my SQL dynamically | The SQL and Key Table fields support PHP global variables if the first character in the field is =. For example, suppose you have multiple tables that hold postcodes for specific countries, eg: usacodes, japancodes, ukcodes, malaysiacodes. You can store the country in a PHP global variable $COUNTRY and set the sql property to:
=SELECT * FROM {$COUNTRY}CODES
|
sql |
| I want to edit multiple records at one time | Define the table to save to, and the primary key of the table. Then set Edit Multiple Records in the Editing tab | editMultiple |
| I want the phpLens grid width to expand to 100%. | Set the Table Width 100% checkbox in the Display tab. This modifies the layoutTableHeader, gridTableHeader and detailTableHeader properties dynamically. | |
| Exporting to Excel | Click on the Choose dropdown menu at the top of the form. Select Columns to Export. The following properties are affected: exportLens and exportOptions. |
exportLens |