imce_unzip.install in IMCE unzip 7
Same filename and directory in other branches
Install, update and uninstall functions for the IMCE_unzip module.
File
imce_unzip.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the IMCE_unzip module.
*/
/**
* Implements hook_install().
*/
function imce_unzip_install() {
// Update profiles. add unzip settings.
$profiles = variable_get('imce_profiles', array());
foreach ($profiles as $i => $profile) {
foreach ($profile['directories'] as $j => $directory) {
$profiles[$i]['directories'][$j]['unzip'] = $i == 1 ? 1 : 0;
}
}
variable_set('imce_profiles', $profiles);
// Register custom content function.
$funcs = variable_get('imce_custom_content', array());
$funcs['imce_unzip_content'] = 1;
variable_set('imce_custom_content', $funcs);
// Register custom profile process.
$funcs = variable_get('imce_custom_process', array());
$funcs['imce_unzip_process_profile'] = 1;
variable_set('imce_custom_process', $funcs);
}
/**
* Implements hook_uninstall().
*/
function imce_unzip_uninstall() {
// Update profiles. delete mkdir settings.
$profiles = variable_get('imce_profiles', array());
foreach ($profiles as $i => $profile) {
foreach ($profile['directories'] as $j => $directory) {
unset($profiles[$i]['directories'][$j]['unzip']);
}
}
variable_set('imce_profiles', $profiles);
// Unregister custom content function.
$funcs = variable_get('imce_custom_content', array());
unset($funcs['imce_unzip_content']);
variable_set('imce_custom_content', $funcs);
// Unregister custom profile process.
$funcs = variable_get('imce_custom_process', array());
unset($funcs['imce_unzip_process_profile']);
variable_set('imce_custom_process', $funcs);
}
Functions
Name![]() |
Description |
---|---|
imce_unzip_install | Implements hook_install(). |
imce_unzip_uninstall | Implements hook_uninstall(). |