예제 #1
0
/**
 *
 * @param string $title Title to use in the browser
 * @param string $pagetitle Tittle to use on the page itself. By default the same as $title
 */
function darwinHeader($title = "Darwin", $pagetitle = NULL, $checkuser = TRUE, $lightweight = FALSE)
{
    if (getHeader("X-Darwin") !== NULL) {
        header("Content-Type: text/xml");
        echo '<?xml version="1.0" ?>';
        ?>
<root>
<title><?php 
        echo $title;
        ?>
</title>
<body>
<?php 
    } else {
        header("Content-Type: text/html");
        ?>
<!DOCTYPE html>


<html>
<head>
<title><?php 
        echo $title;
        ?>
</title>
<link rel="stylesheet" href="<?php 
        echo getAppRoot();
        ?>
css/darwin.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <?php 
        if (!$lightweight) {
            echo '      <script type="text/javascript" src="' . getAppRoot() . 'darwinjs/darwinjs.nocache.js"></script>' . "\n";
        }
        ?>
  </head>
<body>
  <!--div id="top">  -->
  <h1 id="header">
    <a href="<?php 
        echo getAppRoot();
        ?>
" id="logo">Darwin</a><span
      id="title"><?php 
        if ($pagetitle === NULL) {
            echo $title;
        } else {
            echo $pagetitle;
        }
        ?>
</span>
  </h1>
  <div id="menu">
      <?php 
        echo getDarwinMenu(FALSE, !$lightweight);
        ?>
    </div><?php 
        if ($checkuser !== FALSE) {
            if ($checkuser !== TRUE) {
                $user = $checkuser;
                // We have been given the user, not through the cookie/database yet;
            } else {
                $user = pollDarwinUser(!$lightweight);
            }
            if (!$lightweight && ($user !== NULL || function_exists('getDarwinUser'))) {
                if ($user === NULL) {
                    echo '    <div id="login"><a href="' . getAppRoot() . '/accounts/login.php" id="logout">login</a></div>';
                } else {
                    echo '    <div id="login"><a href="' . getAppRoot() . '/accounts/myaccount" id="username">' . $user . '</a><span class="hide">
                  </span><a href="' . getAppRoot() . '/accounts/logout.php" id="logout">logout</a></div>';
                }
            }
        }
        echo "      <div id='content'>\n";
    }
}
<?php

include 'util/util.php';
$siteRootPath = getAppRoot(__FILE__);
printPageDec($siteRootPath);
?>

<link href="http://fonts.googleapis.com/css?family=Didact+Gothic" rel="stylesheet" />
<link href="css/default.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/fonts.css" rel="stylesheet" type="text/css" media="all" />

<!--[if IE 6]><link href="default_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->

</head>
<body>
<div id="header-wrapper">
	<div id="header" class="container">
		<div id="logo">
			<h1><a href="#"> NEW PAGE BUDDY!</a></h1>
		</div>
		<div id="menu">
			<ul>
				<li class="active"><a href="#" accesskey="1" title="">Homepage</a></li>
				<li><a href="#" accesskey="2" title="">Sign in</a></li>
				<li><a href="#" accesskey="3" title="">About Create Your own Adventure</a></li>
				<li><a href="#" accesskey="5" title="">Contact Us</a></li>
			</ul>
		</div>
	</div>
	<div id="banner" class="container">
		<div class="title">