if (get_site_preference('enablenotifications', 1) && get_preference($userid, 'enablenotifications', 1)) { foreach ($gCms->modules as $modulename => $ext) { if (in_array($modulename, $ignoredmodules)) { continue; } $mod =& $gCms->modules[$modulename]['object']; if (!is_object($mod)) { continue; } $data = $mod->GetNotificationOutput(3); // todo, priority user preference if (empty($data)) { continue; } if (is_object($data)) { $themeObject->AddNotification($data->priority, $mod->GetName(), $data->html); } else { // we have more than one item // for the dashboard from this module if (is_array($data)) { foreach ($data as $item) { $themeObject->AddNotification($item->priority, $mod->GetName(), $item->html); } } } } debug_buffer('before notifications'); // if the install directory still exists // add a priority 1 dashboard item if (file_exists(dirname(dirname(__FILE__)) . '/install')) { $themeObject->AddNotification(1, 'Core', lang('installdirwarning'));
$themeObject->DisplayHTMLStartTag(); $themeObject->DisplayHTMLHeader(false, isset($headtext) ? $headtext : ''); $themeObject->DisplayBodyTag(); $themeObject->DoTopMenu(); $themeObject->DisplayMainDivStart(); debug_buffer('after theme-y stuff'); // Display notification stuff from modules // should be controlled by preferences or something $ignoredmodules = explode(',', get_preference($userid, 'ignoredmodules')); if (get_site_preference('enablenotifications', 1) && get_preference($userid, 'enablenotifications', 1)) { debug_buffer('before notifications'); if ($data = get_site_preference('__NOTIFICATIONS__')) { $data = unserialize($data); if (is_array($data) && count($data)) { foreach ($data as $item) { $themeObject->AddNotification($item->priority, $item->name, $item->html); } } } $db = $gCms->GetDb(); $current_version = $CMS_SCHEMA_VERSION; $query = "SELECT version from " . cms_db_prefix() . "version"; $row = $db->GetRow($query); if ($row) { $current_version = $row["version"]; } if ($current_version < $CMS_SCHEMA_VERSION) { $warning_upgrade = lang('warning_upgrade') . "<br />" . lang('warning_upgrade_info1', $current_version, $CMS_SCHEMA_VERSION) . "<br /> " . lang('warning_upgrade_info2', '<a href="' . $config['root_url'] . '/install/upgrade.php">' . lang('start_upgrade_process') . '</a>'); $themeObject->AddNotification(1, 'Core', $warning_upgrade); } // if the install directory still existsx