function edit_form_rules(&$form, &$form_state)
 {
     // The 'access' UI passes everything via $form_state, unlike the 'context' UI.
     // The main difference is that one is about 3 years newer than the other.
     ctools_include('context');
     ctools_include('context-access-admin');
     $form_state['access'] = $form_state['item']->access;
     $form_state['contexts'] = ctools_context_load_contexts($form_state['item']);
     $form_state['module'] = 'ctools_export_ui';
     $form_state['callback argument'] = $form_state['object']->plugin['name'] . ':' . $form_state['object']->edit_cache_get_key($form_state['item'], $form_state['form type']);
     $form_state['no buttons'] = TRUE;
     $form = array_merge($form, ctools_access_admin_form($form_state));
 }
/**
 * Allow modules to provide their own caching mechanism for the display editor.
 *
 * @param string $argument
 *   The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME
 *   passed part: TASK_NAME:HANDLER_NAME
 *
 * @return stdClass|NULL
 *   The cached display or NULL if the cache wasn't hit.
 */
function hook_panels_cache_get($argument)
{
    ctools_include('common', 'panels');
    list($handler, $item) = _panels_mini_panels_cache_get($argument);
    if (isset($item->mini_panels_display_cache)) {
        return $item->mini_panels_display_cache;
    }
    $cache = new stdClass();
    $cache->display = $item->display;
    $cache->display->context = ctools_context_load_contexts($item);
    $cache->display->cache_key = 'panels_mini:' . $argument;
    $cache->content_types = panels_common_get_allowed_types('panels_mini', $cache->display->context);
    $cache->display_title = TRUE;
    // @TODO support locking.
    $cache->locked = FALSE;
    return $cache;
}
 /**
  * Fetch an object array of CTools contexts from panelizer information.
  */
 public function get_contexts($panelizer, $entity = NULL)
 {
     ctools_include('context');
     if (empty($panelizer->base_contexts)) {
         $panelizer->base_contexts = $this->get_base_contexts($entity);
     }
     $contexts = ctools_context_load_contexts($panelizer);
     return $contexts;
 }