Using CGI variables
You can optionally append or overwrite individual variables returned from the
CGI environment (GET/POST HTTP protocol data). Use these two arrays for this
purpose, where array key means CGI variable name, and array value means CGI
variable value.
This will activate the search filter on script initialization. However, it is
still possible to turn it off by explicit click on Hide or
Clear button.
Example 3-29. CGI variables appending
$opts['cgi']['append']['PME_sys_fl'] = 1;
The next example shows how to cause descending sorting according first field in all
cases. Because ['overwrite']
is used, sorting column cannot
be altered by the user by clicking on column heading.
Example 3-30. CGI variables overwriting
$opts['cgi']['overwrite']['PME_sys_sfn'] = '-0';
Using the $opts['cgi']['persist']
option you can tell phpMyEdit names and
values of CGI variables which should be persistent during various pages
reloading and serving. They will be included into all links and also into all
forms as appropriate hidden inputs. This feature is provided especially for
advanced and experienced users using phpMyEdit in their medium-size and large-size
projects. If you do not understand what does this thing do, feel free to skip
it. You will surely do not need it.
Example 3-31. Persistent CGI variables
$opts['cgi']['persist'] = array(
'article_id' => $article_id,
'session_id' => $SESSION_ID
);
Prefixing CGI variables
The type of performed operation such as Add, Change, Delete and so on, is
passed using a CGI variable named operation
. When passed through a
link, for example when $opts['navigation']
is set
to 'G'
or 'T'
, the
value is an untranslated label prefixed with PME_op_
.
This prefix can be changed by setting the
$opts['cgi']['prefix']['operation']
variable in the calling
script.
Example 3-32. Custom prefix for operation links
$opts['cgi']['prefix']['operation'] = 'op-prefix-';
If you already use in your project some CGI variables used internally by phpMyEdit,
like 'operation
, you may want to prefix phpMyEdit's variables to avoid
collision. For the same reason, you may want to prefix the names of input
fields.
Example 3-33. Custom name prefix for CGI variables
$opts['cgi']['prefix']['sys'] = 'sys_prefix_';
$opts['cgi']['prefix']['data'] = 'data_prefix_';