123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?php
- /**
- * @file styles/contrib/file_styles/file_styles.install
- * Install, update and uninstall functions for the file styles module.
- */
- /**
- * Implement hook_install().
- */
- function file_styles_install() {
- // Create the styles directory and ensure it's writable.
- $path = 'temporary://file-styles';
- file_prepare_directory($path, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
- }
- /**
- * Implement hook_uninstall().
- */
- function file_styles_uninstall() {
- // Remove the styles directory and generated images.
- $path = 'temporary://file-styles';
- file_unmanaged_delete_recursive($path);
- }
- /**
- * Implement hook_schema().
- */
- function file_styles_schema() {
- $schema = array();
- $schema['cache_file_styles'] = drupal_get_schema_unprocessed('system', 'cache');
- $schema['cache_file_styles']['description'] = 'Cache table used to store information file manipulations that are in-progress.';
- $schema['file_styles'] = array(
- 'description' => 'Stores configuration options for file styles.',
- 'fields' => array(
- 'msid' => array(
- 'description' => 'The primary identifier for a file style.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'name' => array(
- 'description' => 'The style name.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- ),
- 'primary key' => array('msid'),
- 'indexes' => array(
- 'name' => array('name'),
- ),
- );
- $schema['file_effects'] = array(
- 'description' => 'Stores configuration options for file effects.',
- 'fields' => array(
- 'meid' => array(
- 'description' => 'The primary identifier for an file effect.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'msid' => array(
- 'description' => 'The {file_styles}.isid for a file style.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'weight' => array(
- 'description' => 'The weight of the effect in the style.',
- 'type' => 'int',
- 'unsigned' => FALSE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'name' => array(
- 'description' => 'The unique name of the effect to be executed.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'data' => array(
- 'description' => 'The configuration data for the effect.',
- 'type' => 'text',
- 'not null' => TRUE,
- 'size' => 'big',
- 'serialize' => TRUE,
- ),
- ),
- 'primary key' => array('meid'),
- 'indexes' => array(
- 'msid' => array('msid'),
- 'weight' => array('weight'),
- ),
- 'foreign keys' => array(
- 'msid' => array('file_styles' => 'msid'),
- ),
- );
- return $schema;
- }
- /**
- * Add labels to file styles.
- */
- function file_styles_update_7202() {
- return array();
- }
- /**
- * Rebuild themes.
- */
- function file_styles_update_7203() {
- drupal_theme_rebuild();
- return array();
- }
- /**
- * Add new presets.
- */
- function file_styles_update_7206() {
- return array();
- }
- /**
- * Fix presets to use camelCase and honor links to media.
- */
- function file_styles_update_7207() {
- return array();
- }
- /**
- * Fetch any image styles for use as new presets and register new hooks.
- */
- function file_styles_update_7208() {
- return array();
- }
- /**
- * Fix any broken custom image styles.
- */
- function file_styles_update_7209() {
- return array();
- }
- /**
- * Add support for media objects.
- */
- function file_styles_update_7210() {
- return array();
- }
|