You are here

function panels_mini_load_all in Panels 6.3

Same name and namespace in other branches
  1. 5.2 panels_mini/panels_mini.module \panels_mini_load_all()
  2. 6.2 panels_mini/panels_mini.module \panels_mini_load_all()
  3. 7.3 panels_mini/panels_mini.module \panels_mini_load_all()

Load all mini panels.

3 calls to panels_mini_load_all()
panels_mini_block in panels_mini/panels_mini.module
Implementation of hook_block().
panels_mini_panels_dashboard_blocks in panels_mini/panels_mini.module
Implementation of hook_panels_dashboard_blocks().
panels_mini_panels_mini_content_type_content_types in panels_mini/plugins/content_types/panels_mini.inc
Return each available mini panel available as a subtype.
2 string references to 'panels_mini_load_all'
panels_mini_load in panels_mini/panels_mini.module
Load a single mini panel.
panels_mini_schema_1 in panels_mini/panels_mini.install
Schema version 1 for Panels in D6.

File

panels_mini/panels_mini.module, line 157
panels_mini.module

Code

function panels_mini_load_all($reset = FALSE) {
  $cache =& ctools_static('panels_mini_load_all', array());
  static $all_loaded = FALSE;

  // We check our own private static because individual minis could have
  // been loaded prior to load all and we need to know that.
  if (!$all_loaded || $reset) {
    $all_loaded = TRUE;
    if ($reset) {
      $cache = array();
    }
    ctools_include('export');
    $minis = ctools_export_load_object('panels_mini');
    $dids = array();
    foreach ($minis as $mini) {
      if (empty($cache[$mini->name])) {
        if (!empty($mini->did)) {
          $dids[$mini->did] = $mini->name;
        }
        else {

          // Translate old style titles into new titles.
          if (!empty($mini->title) && empty($mini->display->title)) {
            $mini->display->title = $mini->title;
          }
        }

        // Translate old style titles into new titles.
        if (isset($mini->title) && empty($mini->admin_title)) {
          $mini->admin_title = $mini->title;
        }
        $cache[$mini->name] = $mini;
      }
    }
    $displays = panels_load_displays(array_keys($dids));
    foreach ($displays as $did => $display) {
      if (!empty($cache[$dids[$did]]->title) && empty($display->title)) {
        $display->title = $cache[$dids[$did]]->title;
      }
      $cache[$dids[$did]]->display = $display;
    }
  }
  return $cache;
}