New module 'Autosave'

This commit is contained in:
Manuel Cillero 2017-07-26 12:44:49 +02:00
parent 136ce6a70c
commit e1764abfca
8 changed files with 1543 additions and 0 deletions

View file

@ -0,0 +1,63 @@
<?php
/**
* Implementation of hook_enable().
*/
function autosave_enable() {
drupal_set_message(t('Autosave module successfully installed. Please review the <a href="@settings">configuration settings</a>.', array('@settings' => url('admin/settings/autosave'))));
}
/**
* Implementation of hook_install().
*/
function autosave_install() {
drupal_install_schema('autosave');
}
/**
* Implementation of hook_uninstall().
*/
function autosave_uninstall() {
drupal_uninstall_schema('autosave');
}
/**
* Implementation of hook_schema()
*/
function autosave_schema() {
return array(
'autosaved_forms' => array(
'description' => 'Saves the input (POST) contents of partially filled forms for restoration by the autosave module.',
'fields' => array(
'form_id' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'path' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'uid' => array(
'type' => 'int',
'length' => 11,
'not null' => TRUE,
'default' => 0,
),
'timestamp' => array(
'type' => 'int',
'length' => 11,
'not null' => TRUE,
'default' => 0,
),
'serialized' => array(
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
),
),
'primary key' => array('form_id', 'path', 'uid'),
),
);
}