View source
<?php
module_load_include('inc', 'expire_panels', 'expire_panels.admin');
define('EXPIRE_PANELS_DISPLAY_UPDATE', 1);
define('EXPIRE_PANELS_DISPLAY_DELETE', 2);
define('EXPIRE_PANELS_PANEL_PAGE', FALSE);
define('EXPIRE_PANELS_PANELIZER_PAGE', FALSE);
define('EXPIRE_PANELS_FRONT_PAGE', FALSE);
define('EXPIRE_PANELS_CUSTOM', FALSE);
function expire_panels_form_expire_admin_settings_form_alter(&$form, &$form_state, $form_id) {
expire_panels_admin_settings_form_elements($form, $form_state, $form_id);
}
function expire_panels_panels_display_save($display) {
expire_panels_execute_expiration('panels', $display, EXPIRE_PANELS_DISPLAY_UPDATE);
}
function expire_panels_panels_delete_display($did) {
$display = new stdClass();
$display->did = $did;
expire_panels_execute_expiration('panels', $display, EXPIRE_PANELS_DISPLAY_DELETE);
}
function expire_panels_execute_expiration($type, $object, $action) {
$status = variable_get('expire_status', EXPIRE_STATUS_DISABLED);
if ($status) {
if ($handler = _expire_get_expiration_handler($type)) {
$handler
->expire($object, $action);
}
}
return FALSE;
}
function expire_panels_entity_update($entity, $type) {
if (isset($entity->fpid)) {
$get_did = db_select('panels_pane', 'pp')
->fields('pp', array(
'did',
))
->condition('subtype', 'fpid:' . $entity->fpid)
->execute()
->fetchAll();
if (empty($get_did)) {
return;
}
foreach ($get_did as $did) {
$display = panels_load_display($did->did);
expire_panels_execute_expiration('panels', $display, EXPIRE_PANELS_DISPLAY_UPDATE);
}
}
}