Go to the first, previous, next, last section, table of contents.
Used by the sqledit package (sqledit.pm). This module implements an HTML interface to an SQL database. The instructions of this configuration file modifies the behavior of the interface.
"%s context is not allowed"See section Messages translation. Assuming that you want to give read-only access to your catalog, use the following:
context_allow = cbrowse
normalize and
match instructions in the check nested instruction.
The keyword is the name of the function and the value is the body of the
function. The body of the function must be a piece of Perl code
that returns a function pointer when evaluated. Most of the time it is
a simple lambda (sub { ... }). No parameters are passed to the function,
however the $_ variable contains the current value
of the field for which the function was called. See the description of
the match and check instructions for a description of the
return values expected from these functions.
Since the available libraries are not documented you can only rely on
the standard Perl libraries here.
functions
normalize_lc = sub { $_ = lc; return 1; }
check_alnum = sub { /[a-z0-9]+/ || "alphanumerical" }
end
check
table1
field1
normalize = <function>
match = <function>
mandatory = yes
end
field2
...
end
...
end
...
end
We will define bellow the instructions that may be associated with each field.
function section of this configuration file.
The $_ variable contains the value of the field for the current
record.
The normalize function is called when the value of the field is
updated or a new value is inserted.
The return value of the function must be
table %s : field %s : value %s normalize failed %sSee section Messages translation.
function section of this configuration file.
The $_ variable contains the value of the field for the current
record.
The match function is called when the value of the field is
updated or a new value is inserted.
The return value of the function must be
table %s : field %s : value %s match failed %sSee section Messages translation. where the last
%s is replaced by the string returned by the function,
thus providing precise error messages.
table %s : field %s must be setSee section Messages translation.
enum or set types of MySQL. This instruction allows to
control the display of such dictionaries.
dictionary
tablename1
where = <where clause1>
order = <order clause1>
end
tablename2
where = <where clause2>
order = <order clause2>
end
...
end
select * from tablename.
The values displayed to the user will only be those matching the
where clause, for more information on how to display a dictionary
See section Template files introduction.
select * from tablename. The menu
generated for this dictionary will show the values listed according to
this clause. If not provided, no specific order can be expected.
display
select
general
multiple = <number of lines>
labelnull = <HTML text>
end
tablename1
field1
multiple = <number of lines>
labelnull = <HTML text>
end
...
end
...
end
table
general
columns = <number of columns>
font = <font ...>
end
tablename1
field1
columns = <number of columns>
font = <font ...>
end
...
end
...
end
end
In both select and table, there is a special table name,
general, that provides the default for all the table names not
specifically listed.
Apache documentation and the CGI.pm documentation.
Go to the first, previous, next, last section, table of contents.