views_oai_pmh.module in Views OAI-PMH 7
File
views_oai_pmh.module
View source
<?php
define('OAI_TOKEN_LIFETIME', 24 * 3600);
function views_oai_pmh_init() {
module_load_include('inc', 'views_oai_pmh', 'theme/views_oai_pmh.theme');
}
function views_oai_pmh_views_api() {
return array(
'api' => 2,
);
}
function views_oai_pmh_theme() {
module_load_include('inc', 'views_oai_pmh', 'theme/views_oai_pmh.theme');
return array(
'oai_field_mapper_form' => array(
'file' => 'theme/views_oai_pmh.theme.inc',
'render element' => 'form',
),
);
}
function views_oai_pmh_flush_caches() {
return array(
'cache_views_oai_pmh',
);
}
function views_oai_pmh_cron() {
views_oai_pmh_garbage_collect();
}
function views_oai_pmh_garbage_collect() {
$cache_flush = time() - OAI_TOKEN_LIFETIME;
db_delete('cache_views_oai_pmh')
->condition('expire', $cache_flush, '<=')
->execute();
}