projects / org / ezproject2010 / regexpline
Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
regexpline | Hans Melis | stable |
Version | Compatible with |
---|---|
3.0.1 | >= 4.0 |
Datatype extension for eZ publish 4.x (License: GPL)
----------------------------------------------------
Provides a regular expression datatype for eZ publish.
What is it?
-----------
For end users it will look like the standard "Text line" datatype that ships with eZ publish.
The biggest difference is that the input will be validated against a regular expression. This enables you to make sure the input meets certain criteria.
It can act like a regular "Text line" datatype by allowing all input (regexp: /.*/).
Features
--------
A number between square brackets denotes the version number where said feature has been introduced.
If no indication is present, version 1.0 contains the feature.
- Check user input against a regular expression (Perl-compatible)
- Ability to specify multiple regular expression [2.0]
- Use regular expression subpatterns to be able to use parts of the input in the object name pattern
- Ability to customise the text that will be used in the object name pattern [1.1]
- Ability to supply a help text for users
- Required checks compatible with newer eZ publish versions (drafts ignore required fields)
- Information collection support
- Attribute filtering support
- Ability to define preset regular expressions in an ini file
- Ability to select multiple presets [2.0]
- Ability to specify an error message per regular expression / preset [2.0]
- Ability to display the datatype as a single text line or as a textarea (object edit) [2.0]
- Ability to negate regular expressions and presets [2.1]
- Support for has_content in templates [2.1]
- Stripping of tags with possibility to disable the stripping via the ini file [2.2]
- Control the size of both a text line and a text area in content/edit [2.2]
- Error messages in case class validation fails [2.3]
- Contentclass import & export
- i18n support
- PHP5 support for eZ Publish 4.x [3.0]
Information
-----------
While editing a contentclass, you will be able to define how the content of a regexpline attribute will be validated.
You can choose two paths:
1. Enter regular expressions directly in the class.
2. Select one or more presets which have been defined in an INI file.
Path 1 is pretty straightforward. The interface will tell you what you can do. Each regular expression you enter can
have an error message that describes what should be done to meet the criteria. If you specify multiple regular expressions,
the input must match all three expressions.
Path 2 reads the settings from an INI file. You can define as many regular expressions provided you give each of them a
unique identifier. With that very same identifier, you can build and array of error messages too. This way, you can accomplish
the same thing as in Path 1 (custom messages per regular expression).
Something specific for Path 2 is if the regular expression is negated afterwards (input must NOT match the expression). The datatype
will then look for the error message identifier by the regular expression's unique identifier concatenated with '_negate'. This is of
course not needed if you take Path 1 (the regular expression will always be negated for that attribute and the error message can be
constructed to reflect that).
Any subpatterns in the regular expressions chosen for an attribute will be available for use in the object name pattern. The datatype
allows you to construct a custom string of these subpatterns. The custom string will then be used in real object name pattern if you
construct the contentclass to do so.
Useful extension!
Monday 23 November 2009 05:45
Ronan Guilloux