minisite.theme.inc in Mini site 7
File
includes/minisite.theme.inc
View source
<?php
function minisite_theme($existing, $type, $theme, $path) {
return array(
'minisite_widget' => array(
'render element' => 'element',
),
);
}
function minisite_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['html'])) {
$module_path = drupal_get_path('module', 'minisite');
$template_file_objects = drupal_find_theme_templates($theme_registry, '.tpl.php', $module_path);
foreach ($template_file_objects as $key => $template_file_object) {
if (!isset($theme_registry[$key]['theme path']) || !preg_match('#/themes/#', $theme_registry[$key]['theme path'])) {
$theme_registry[$key]['theme path'] = $module_path;
$theme_registry[$key] = array_merge($theme_registry[$key], $template_file_object);
$theme_registry[$key]['type'] = 'module';
}
}
}
}
function minisite_page_delivery_callback_alter(&$callback) {
$minisite_info = minisite_site_load(FALSE);
if (!empty($minisite_info) && $callback == 'drupal_deliver_html_page') {
$callback = 'minisite_deliver';
}
}
function minisite_deliver($page_callback_result) {
if (is_int($page_callback_result)) {
drupal_deliver_html_page($page_callback_result);
}
if (isset($page_callback_result) && is_null(drupal_get_http_header('Content-Type'))) {
drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
}
global $language;
drupal_add_http_header('Content-Language', $language->language);
$minisite_info = minisite_site_load();
$content = minisite_site_build($minisite_info);
print $content;
drupal_page_footer();
}