signaturefield.module in SignatureField 1.x
Same filename and directory in other branches
Main module file.
File
signaturefield.moduleView source
<?php
/**
* @file
* Main module file.
*/
/**
* Implements hook_theme().
*/
function signaturefield_theme($existing, $type, $theme, $path) {
return [
'signature_canvas' => [
'variables' => [
'id' => NULL,
'width' => NULL,
'height' => NULL,
],
],
];
}
/**
* Prepare the variables for the signature canvas template.
*
* @param array $variables
* An associative array of variables:
* - id: the canvas ID.
* - width: the canvas width in pixels.
* - height: the canvas height in pixels.
*/
function template_preprocess_signature_canvas(array &$variables) {
$variables['attributes']['id'] = $variables['id'];
$variables['attributes']['style'] = 'width: ' . $variables['width'] . 'px; height: ' . $variables['height'] . 'px;';
}
Functions
Name![]() |
Description |
---|---|
signaturefield_theme | Implements hook_theme(). |
template_preprocess_signature_canvas | Prepare the variables for the signature canvas template. |