A configuration file is loaded.
Parameters: |
|
---|
<?php
// Listening to the event
Event::register_function('config|nos::controller/admin/page/page', function(&$config)
{
// ...
}
// Triggering the event
$config = Config::load('nos::controller/admin/page/page', true);
Also works with absolute paths :
<?php
// Listening to the event
Event::register_function('config|/data/www/novius-os/local/config/test.php', function(&$config)
{
// ...
}
// Triggering the event (file must exists)
$config = Config::load('/data/www/novius-os/local/config/test.php', true);
A configuration array is loaded.
Parameters: |
|
---|
<?php
// Listening to the event
Event::register_function('config|group', function(&$config)
{
// ...
}
// Triggering the event
Config::load(array(), 'group');
An .html page is requested.
Parameters: |
|
---|
<?php
Event::register_function('front.start', function($params)
{
$url =& $params['url'];
$cache_path =& $params['cache_path'];
// ...
});
Additional processing on a WYSIWYG (HTML content).
Parameters: |
|
---|
<?php
Event::register_function('front.parse_wysiwyg', function(&$content)
{
// ...
});
Additional processing on the page (HTML content).
Parameters: |
|
---|
<?php
Event::register_function('front.display', function(&$html)
{
// ...
});
Page to display have been found.
Parameters: |
|
---|
<?php
Event::register('front.pageFound', function($params)
{
$page = $params['page'];
// ...
});
Before that the response be sended.
Parameters: |
|
---|
<?php
Event::register_function('front.response', function($params)
{
$content =& $params['content'];
$status =& $params['status'];
$headers =& $params['headers'];
// ...
});
An .html page was requested, but not found.
Parameters: |
|
---|
<?php
Event::register('front.404NotFound', function($params)
{
$url = $params['url'];
// ...
});
New in version 0.2.0.2.
A inexistant file is requested. Can be media or attachment file.
Parameters: |
|
---|
<?php
Event::register_function('404.start', function($params)
{
$url =& $params['url'];
// ...
});
A inexistant media file is requested.
Parameters: |
|
---|
<?php
Event::register('404.mediaNotFound', function($url)
{
// ...
});
A inexistant attachment file is requested.
Parameters: |
|
---|
<?php
Event::register('404.attachmentNotFound', function($url)
{
// ...
});
A inexistant file is requested. No attachment or media file matched the URL.
Parameters: |
|
---|
<?php
Event::register('404.end', function($url)
{
// ...
});
Before sending an email.
Parameters: |
|
---|
<?php
Event::register('email.before_send', function($email)
{
// ...
}
After a mail was sent.
Parameters: |
|
---|
<?php
Event::register('email.after_send', function($email)
{
// ...
}
Triggered by the enhancer before displaying the form to the user.
Allows to modify the $fields and the $layout. The $item (Model_Form instance) and $enhancer_args (label_position, etc.) variables are read-only.
Parameters: |
|
---|
<?php
Event::register_function('noviusos_form::rendering', function(array &$args)
{
$fields =& $args['fields'];
$layout =& $args['layout'];
$form = $args['item']; // Instance of Nos\Form\Model_Form
$enhancer_args = $args['enhancer_args'];
// This is an exemple of what $layout contains
$layout = 'noviusos_form::foundation';
foreach ($fields as &$field) {
// This is an example of what $field contains
$field = array(
'label' => array(
'callback' => array('Form', 'label'),
'args' => array('Label:', 'technical_id', array(
'for' => 'field_technical_id',
)),
),
'field' => array(
'callback' => array('Form', 'input'),
'args' => array('field_name', 'field_value', array(
'id' => 'field_technical_id',
'class' => 'field_technical_css',
'title' => 'Label:',
'placeholder' => 'Label:',
'required' => 'required',
)),
),
'instructions' => array(
'callback' => 'html_tag',
'args' => array('p', array('class' => 'instructions'), 'Instructions for the user'),
),
'new_row' => true,
'new_page' => true,
'width' => 4,
'item' => $item, // Instance of Nos\Form\Model_Field
);
}
// ...
}
Same as noviusos_form::rendering, but only triggered for a form with the specified <virtual_name>.
warning ! This function must return an array containing the detected validation errors.
Additional data validation after submitting a form from the Form application.
Parameters: |
|
---|---|
Return array: | List of validation errors |
<?php
Event::register_function('noviusos_form::data_validation', function(&$data, $form) {
$errors = array();
// This will mark all fields as error
foreach ($data as $name => $value) {
$errors[$name] = '{{label}}: ‘{{value}}’ non valid.';
}
return $errors;
});
The messages can contain the {{label}} and {{value}} placeholders (they will be replaced appropriately).
Same as noviusos_form::data_validation, but only triggered for a form with the specified <virtual_name>.
Before saving the answer in the database
Parameters: |
|
---|---|
Return bool: | false to prevent saving the answer in the database |
<?php
Event::trigger_function('noviusos_form::before_submission', array(&$data, $form, $enhancer_args) {
// You can alter $data before saving them into the database
// Or you can return 'false' if you don't want the answer to be saved in the database
return false;
});
Same as noviusos_form::before_submission, but only triggered for a form with the specified <virtual_name>.
After the answer has been created (not saved in the DB yet)
Parameters: |
|
---|
<?php
Event::trigger_function('noviusos_form::after_submission', array(&$answer, $enhancer_args) {
// ...
});
Same as noviusos_form::after_submission, but only triggered for a form with the specified <virtual_name>.