Extensions
There are often situations, when more specific functionality is needed from
&name;. You will surely agree, that it will be really strange to hardcode all
these particular requirements into the core &name; class. For this reason the
extension mechanism is provided.
Overview
Extensions are &name;_<something> classes, where <something> is an
appropriate extension name. They not only extend base &name; class, but they
also add new functionality. But they may not only add new things. It is
possible also to disable such features, simply to get the desirable behaviour.
In addition to common &name; configuration options, extension configuration is
usually provided by $opts['ext'] associative array.
Possible keys are described on particular extension pages in this manual.
Please refer to them to get more information.
Extensions are currently not part of &name; distribution. They are only in
CVS
repository>, because they are still under development and they are changing
a lot. This manual chapter is provided for letting &name; users know, that
something like this exists. The only way how to get extension files is to
fetch them from CVS. All extensions need to be placed under the extensions/> subdirectory below the &name; core class
location.
Several new extensions are planned to create or handle more or less specific
tasks, especially those which are not appropriate for the &name; core class.
You can feel absolutely free to improve existing extensions, suggest new
improvements for them, or create new extensions to fit your own needs. We will
be happy to add them to repository.
&name;-slide
&name;-slide can create slideshow with ability to view and/or edit records.
Everytime is exactly one record shown. Record can be displayed in view or edit
mode. View mode looks like "view" functionality in normal &name;, change mode
looks like "change" functionality in normal &name;.
The only difference is that two buttons, Prev> and
Next>, are displayed in addition to common view/edit buttons to
provide ability of going to the next or previous record. This extension
purpously disable "add", "copy", "delete", and "table listing"
functionalities.
Here are configuration variables related to extension. All of these
&name;-slide options are optional.
$opts['ext']['rec']>>
-- primary key value of record to display initially>
$opts['ext']['next_disable']>>
-- disable Next> button>
$opts['ext']['prev_disable']>>
-- disable Prev> button>
Following variables are not options, but they are used internally by
extension. They can be used for getting some information for example in
triggers.
$opts['ext']['next']>>
-- primary key value of next record>
$opts['ext']['prev']>>
-- primary key value of previous record>
To use this extension you have to include
extensions/&name;-slide.class.php file and call
new &name;_slide($opts) instead of common &name; class
file.
&name;-report
&name;-report extension is provided for easy table report creation. There is
often a need for selecting particular fields from table with applying specific
filter options and finally write out chosen subset of data (report) to HTML
page.
Navigation is easy to use. Field selection menu would be displayed if
fields_select parameter is passed by GET or POST HTTP method
to PHP script and it has non-empty value. This field selection menu contains
list of checkboxes connected with columns, list of filtering input fields and
also button for report creation. Every report page has ability to return back
into field selection. It is possible to specify amount of records on report
page, what is by default set to unlimited.
Extension can completelly work without cookies. However it uses cookies to
have a memory, where last selected report is stored. When user leaves report
PHP script and comes back after some time, a last selected report should be
predefined in checkboxes and input fields on fields selection screen.
Detection for cookie usage is done automatically. If HTTP headers was already
sent, cookies are not used, because they will cause an ugly warning. Otherwise
cookies are used for described kind of memory.
To use this extension simply include
extensions/&name;-report.class.php file and call
new &name;_report($opts) instead of common &name; class
file. Extension specific configuration parameters currently do not exist, thus
all table columns are allowed to be selected in final report. This will surely
change in future, because table could have columns that need to be
unselectable for final report (such as password column or similar).
&name;-htmlarea
This extension is obsolete. Use integrated extension instead.
&name;-htmlarea extension provides support for htmlArea. htmlArea is a free
WYSIWYG editor replacement for <textarea> fields. For full source code
and documentation, visit http://www.interactivetools.com/
website.
htmlArea requires Microsoft Internet Explorer 5.5 or better on Windows to run.
This is because it makes use of some advanced features of IE5.5 that aren't
available in other browsers yet. It is backwards compatible with other
browsers, though. They will get a regular textarea field instead of a WYSIWYG
editor.
The extension requires a properly installed htmlArea script as it is described
on the metioned website. This extension enables WYSIWYG editing of a textarea
field. In order to use it, you should:
Load htmlArea script in the <head>...</head> section of
your &name; calling program as described in the htmlArea manual.
Call to &name;-htmlarea.class.php> instead of
&name;.class.php>.
htmlArea extension enabling
require_once 'extensions/&name;-htmlarea.class.php';
new &name;_htmlarea($opts);
Add 'html'=>true> parameter to the textarea field
definition in your &name; calling program.
htmlArea field enabling
'Column',
'select' => 'T',
'options' => 'ACPVD',
'required' => true,
'textarea' => array(
'html' => true,
'rows' => 11,
'cols' => 81)
);
]]>
This extension is contribution of Ezudin Kurtowich
ekurtovic@ieee.org from Sarajevo.
&name;-mce-cal
&name;-mce-cal is a merge of HTML textarea and calendar popup extensions. This
extension should be used instead of &name;-htmlarea and &name;-calpopup
extensions. See extension source code comments for full documentation.
To use this extension you have to include
extensions/&name;-mce-cal.class.php file and call
new &name;_mce_cal($opts) instead of common &name; class
file.
This extension is again contribution of Adam Hammond
ajh@phpmyedit.org from London.