<% project_name = File.basename(Compass.configuration.project_path) %><% project_js = Compass.configuration.javascripts_dir %><% project_css = Compass.configuration.css_dir %>_preprocess_maintenance_page(&$vars, $hook) { // When a variable is manipulated or added in preprocess_html or // preprocess_page, that same work is probably needed for the maintenance page // as well, so we can just re-use those functions to do that work here. <%= project_name %>_preprocess_html($variables, $hook); <%= project_name %>_preprocess_page($variables, $hook); // This preprocessor will also be used if the db is inactive. To ensure your // theme is used, add the following line to your settings.php file: // $conf['maintenance_theme'] = '<%= project_name %>'; // Also, check $vars['db_is_active'] before doing any db queries. } /** * Implements hook_preprocess_html() * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("html" in this case.) */ function <%= project_name %>_preprocess_html(&$vars) { if (!module_exists('modernizr')) { // Be sure replace this with a custom Modernizr build! drupal_add_js(drupal_get_path('theme', '<%= project_name %>') . '/<%= project_js %>/modernizr.js', array('force header' => true)); // yep/nope for conditional JS loading! drupal_add_js(drupal_get_path('theme', '<%= project_name %>') . '/<%= project_js %>/loader.js'); } } /** * Override or insert variables into the page template. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("page" in this case.) */ function <%= project_name %>_preprocess_page(&$vars) { // Leaving this on by default for the maintainance page preprocessor. } /** * Override or insert variables into the region templates. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("region" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_region(&$vars, $hook) { } // */ /** * Override or insert variables into the block templates. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("block" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_block(&$vars, $hook) { } // */ /** * Override or insert variables into the entity template. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("entity" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_entity(&$vars, $hook) { } // */ /** * Override or insert variables into the node template. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("node" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_node(&$vars, $hook) { $node = $vars['node']; } // */ /** * Override or insert variables into the field template. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("field" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_field(&$vars, $hook) { } // */ /** * Override or insert variables into the comment template. * * @param $vars * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("comment" in this case.) */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_comment(&$vars, $hook) { $comment = $vars['comment']; } // */ /** * Override or insert variables into the views template. * * @param $vars * An array of variables to pass to the theme template. */ /* -- Delete this line if you want to use this function function <%= project_name %>_preprocess_views_view(&$vars) { $view = $vars['view']; } // */ /** * Override or insert css on the site. * * @param $css * An array of all CSS items being requested on the page. */ /* -- Delete this line if you want to use this function function <%= project_name %>_css_alter(&$css) { } // */ /** * Override or insert javascript on the site. * * @param $js * An array of all JavaScript being presented on the page. */ /* -- Delete this line if you want to use this function function <%= project_name %>_js_alter(&$js) { } // */