diff --git a/stanford_jumpstart_home.context.inc b/stanford_jumpstart_home.context.inc index 32b7a96..b935236 100644 --- a/stanford_jumpstart_home.context.inc +++ b/stanford_jumpstart_home.context.inc @@ -30,19 +30,16 @@ function stanford_jumpstart_home_get_contexts($clear_cache = FALSE) { $cache = cache_get('jumpstart_home_context'); $contexts = array(); - if (!$clear_cache && is_object($cache) && !isset($cache->data[''])) { - //watchdog('stanford_jumpstart_home', 'Used cache information for context blob', array(), WATCHDOG_DEBUG); + if (!$clear_cache && is_object($cache) && !isset($cache->data['']) && count($cache->data)) { $contexts = $cache->data; } else { $dir = drupal_get_path('module', 'stanford_jumpstart_home') . '/layouts'; - //watchdog('stanford_jumpstart_home', 'Path to jumpstart_home: %dir' , array("%dir" => $dir), WATCHDOG_DEBUG); $mask = "/.*\.inc$/"; $options['key'] = 'name'; $files = file_scan_directory($dir, $mask, $options); foreach ($files as $name => $data) { - //watchdog('stanford_jumpstart_home', 'Path to context file: %dir' , array("%dir" => DRUPAL_ROOT . "/" . $data->uri), WATCHDOG_DEBUG); include DRUPAL_ROOT . "/" . $data->uri; $contexts[$context->name] = $context; } diff --git a/stanford_jumpstart_home.module b/stanford_jumpstart_home.module index 9aa9256..9380512 100644 --- a/stanford_jumpstart_home.module +++ b/stanford_jumpstart_home.module @@ -79,6 +79,23 @@ function stanford_jumpstart_home_menu() { return $items; } +/** + * Load up the cache! + */ +function stanford_jumpstart_home_init() { +// if (drupal_is_front_page()) { +// module_load_include("inc", "stanford_jumpstart_home", "stanford_jumpstart_home.context"); +// $jumpstart_contexts = stanford_jumpstart_home_context_default_contexts(); +// $contexts = context_get(); +// $keys = array_keys($jumpstart_contexts); +// if (!count($jumpstart_contexts) || !in_array($keys, $contexts->context)) { +// context_invalidate_cache(); +// stanford_jumpstart_home_get_contexts(TRUE); +// module_invoke_all("default_contexts"); +// } +// } +} + /** * The dashboard functionality for the home page. * @return [type] [description] @@ -439,9 +456,6 @@ function stanford_jumpstart_home_preprocess_html(&$vars) { $settings = variable_get('sjh_' . $context_name, null); $vars['classes_array'][] = "active-home-context"; - // foreach ($body_classes as $body_class) { - // $vars['classes_array'][] = drupal_clean_css_identifier($body_class); - // } if (!isset($vars['classes'])) { $vars['classes'] = ""; }