- <?php
- /**
- * <b>Header</b><br />
- * This contains all of the business logic for displaying the site header.
- * Includes all of the site CSS and JavaScript.
- * If CSS cookie defined, it uses that CSS file for display (JavaScript).
- * Nav Bar includes:
- * - About
- * - Calendar
- * - Events/Studes
- * - Locations
- * - Contact
- * - Worship Music
- * - Audio Messages
- * - Pictures
- * - Multimedia
- * - Prayer Requests
- * - Help (Text Icon)
- * @author Kristen O'Brien <kristen_paristemi-com>
- * @copyright Copyright 2004, Kristen O'Brien
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @link http://www.paristemi.com Paristemi Main Site
- * @package paristemi
- * @subpackage paristemi_business_logic
- * @since Build 0.1
- * @version Build 0.7
- * @filesource
- */
- /**
- * Include the constants file and all of the files in the include list
- */
- if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
- if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
- else { require_once("../constants.php"); }
- }
- else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
- foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
-
- // For some reason in the header only these have to be explicitly declared
- // All other pages use the UtilSmarty::createSmarty() function
-
- $smarty = new Smarty;
- $smarty->template_dir = $SERVER_DIRECTORY.$INCLUDE_PATH.$SMARTY_TEMPLATE_DIR;
- $smarty->compile_dir = $SERVER_DIRECTORY.$INCLUDE_PATH.$SMARTY_DIR.$SMARTY_TEMPLATEC_DIR;
- $smarty->config_dir = $SERVER_DIRECTORY.$INCLUDE_PATH.$SMARTY_DIR.$SMARTY_CONFIG_DIR;
- $smarty->cache_dir = $SERVER_DIRECTORY.$INCLUDE_PATH.$SMARTY_DIR.$SMARTY_CACHE_DIR;
-
- $smarty->assign('metakeywords',$CHURCH_KEYWORDS);
- $pagetitle = ""; $pagedesc = ""; $pagesubtitle = "";
- if(getenv("QUERY_STRING")) {
- if(isset($HTTP_GET_VARS['pagetitle'])) { $pagetitle = $HTTP_GET_VARS['pagetitle']; }
- if(isset($HTTP_GET_VARS['pagesubtitle'])) { $pagesubtitle = $HTTP_GET_VARS['pagesubtitle']; }
- if(isset($HTTP_GET_VARS['pagedesc'])) { $pagedesc = $HTTP_GET_VARS['pagedesc']; }
- }
- if($pagedesc == "") { $smarty->assign('metadesc',$ABOUT_CHURCH); }
- else { $smarty->assign('metadesc',$pagedesc); }
- if($pagetitle == "") { $smarty->assign('metatitle',$CHURCH_NAME." - ".$MAIN_PAGE_TITLE); }
- else {
- $pagetitle = $CHURCH_NAME." - ".$pagetitle;
- if($pagesubtitle != "") { $pagetitle .= " : ".$pagesubtitle; }
- $smarty->assign('metatitle',$pagetitle);
- }
- $smarty->assign('jsfile',$HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$JAVASCRIPT_INCLUDE);
- $smarty->assign('stylesheets',
- array($HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$CSS_DIR.$CSS_TABLE,
- $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$CSS_DIR.$CSS_TEXT,
- $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$CSS_DIR.$CSS_PAGE));
-
- $smarty->assign('mainlink',$HTTP_DOCUMENT_ROOT);
- $smarty->assign('churchtitle',$CHURCH_TITLE);
- $smarty->assign('churchsubtitle',$CHURCH_SUB_TITLE);
-
- $navlinks = array();
- if($SHOW_MINISTRY) {
- $navlinks[$S_ABOUT] = $HTTP_DOCUMENT_ROOT.$MINISTRY_DIR.$MINISTRY_FILE;
- }
- if($SHOW_CALENDAR) {
- $navlinks[$S_CALENDAR] = $HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$DEFAULT_CAL_FILE;
- }
- if($SHOW_STUDIES) {
- $navlinks[$S_EVENTS] = $HTTP_DOCUMENT_ROOT.$STUDIES_DIR.$STUDIES_FILE;
- }
- if($SHOW_LOCATION) {
- $navlinks[$S_LOCATIONS] = $HTTP_DOCUMENT_ROOT.$LOCATION_DIR.$LOCATION_FILE;
- }
- if($SHOW_CONTACT) {
- $navlinks[$S_CONTACT] = $HTTP_DOCUMENT_ROOT.$CONTACT_DIR.$CONTACT_FILE;
- }
- if($SHOW_MUSIC) {
- $navlinks[$S_WORSHIP_MUSIC] = $HTTP_DOCUMENT_ROOT.$MUSIC_DIR.$MUSIC_FILE;
- }
- if($SHOW_MESSAGES) {
- $navlinks[$S_AUDIO_MESSAGES] = $HTTP_DOCUMENT_ROOT.$MESSAGES_DIR.$MESSAGES_FILE;
- }
- if($SHOW_PICTURES) {
- $navlinks[$S_PICTURES] = $HTTP_DOCUMENT_ROOT.$PICTURE_DIR.$PICTURE_FILE;
- }
- if($SHOW_MULTIMEDIA) {
- $navlinks[$S_MULTIMEDIA] = $HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE;
- }
- if($SHOW_PRAYER) {
- $navlinks[$S_PRAYER_REQUESTS] = $HTTP_DOCUMENT_ROOT.$PRAYER_DIR.$PRAYER_FILE;
- }
- if($SHOW_HELP_ICON) {
- $navlinks['?'] = $HTTP_DOCUMENT_ROOT.$HELP_FILE;
- }
- $smarty->assign('navarr',$navlinks);
-
- if(ltrim(dirname($_SERVER['SCRIPT_NAME'])).'/' != '/'.rtrim($PICTURE_DIR)) {
- if ($_SERVER['SCRIPT_NAME'] != $SITE_DIRECTORY.$MAIN_PAGE) {
- $smarty->assign('hassidebar','yes');
- }
- else { $smarty->assign('hassidebar','no'); }
- }
-
- $smarty->display($SMARTY_TPL_HEADER);
- ?>