video_cck.install in Embedded Media Field 5
File
contrib/video_cck/video_cck.install
View source
<?php
function video_cck_install() {
}
function video_cck_update_1() {
return _video_cck_update_reset_cache();
}
function video_cck_update_2() {
$ret = array();
include_once './' . drupal_get_path('module', 'content') . '/content.module';
include_once './' . drupal_get_path('module', 'content') . '/content_admin.inc';
content_clear_type_cache();
$fields = content_fields();
foreach ($fields as $field) {
switch ($field['type']) {
case 'video_cck':
$columns = array(
'data' => array(
'type' => 'longtext',
'not null' => TRUE,
'default' => "''",
'sortable' => false,
),
);
@content_alter_db_field(array(), array(), $field, $columns);
break;
}
}
$ret = _video_cck_update_reset_cache();
$ret[] = update_sql("DELETE FROM {cache}");
return $ret;
}
function _video_cck_update_reset_cache() {
$ret = _video_cck_update_reset_cache_views();
$ret[] = update_sql("DELETE FROM {cache_content}");
return $ret;
}
function video_cck_update_3() {
$ret = array();
foreach (emfield_system_list('video_cck') as $provider) {
$test = variable_get('video_cck_allow_' . $provider->name, NULL);
if (isset($test)) {
variable_set('emfield_' . $module . '_allow_' . $provider->name, variable_get('video_cck_allow_' . $provider->name, true));
}
}
$ret[] = array(
'query' => t('The Embedded Video Field allowed provider variables have been updated.'),
'success' => TRUE,
);
$ret = array_merge($ret, _video_cck_update_reset_cache());
return $ret;
}
function video_cck_update_4() {
$ret = array();
foreach (emfield_system_list('video_cck') as $provider) {
$test = variable_get('video_cck_allow_' . $provider->name, NULL);
if (isset($test)) {
variable_set('video_cck_allow_' . $provider->name, NULL);
}
}
$ret[] = array(
'query' => t('The old Embedded Video Field allowed provider variables have been cleaned up.'),
'success' => TRUE,
);
return $ret;
}
function video_cck_update_5() {
$ret = _video_cck_update_reset_cache();
$ret[] = update_sql("DELETE FROM {cache}");
return $ret;
}
function video_cck_update_6() {
$ret = _video_cck_update_reset_cache_views();
return $ret;
}
function video_cck_update_7() {
menu_rebuild();
return array();
}
function _video_cck_update_reset_cache_views() {
$ret = array();
$ret[] = update_sql("DELETE FROM {cache_views}");
return $ret;
}