コード例 #1
0
ファイル: html.php プロジェクト: Yoyoyozo/webDiplomacy
    /**
     * Print the HTML which comes before the main content; title, menu, notification bar.
     *
     * @param string|bool[optional] $title If a string is given it will be used as the page title
     */
    public static function starthtml($title = false)
    {
        global $User;
        self::$scriptname = $scriptname = basename($_SERVER['PHP_SELF']);
        $pages = libHTML::pages();
        if (isset($User) and !isset($pages[$scriptname])) {
            die(l_t('Access to this page denied for your account type.'));
        }
        print libHTML::prebody($title === FALSE ? l_t($pages[$scriptname]['name']) : $title) . '<body>' . libHTML::menu($pages, $scriptname);
        if (defined('FACEBOOKSCRIPT')) {
            ?>
			<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
			<script type="text/javascript">
			FB.init("b24f8dc93cdbf2ff1ee7db508ae14c6d");
			FB_RequireFeatures(["CanvasUtil"], function(){
				FB.XdComm.Server.init("xd_receiver.htm");
				FB.CanvasClient.startTimerToSizeToContent();
			});
			</script>
			<div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div>
			<?php 
        }
        print '<noscript><div class="content-notice">
					<p class="notice">' . l_t('You do not have JavaScript enabled. It is required to use webDiplomacy fully.') . '</p>
				</div></noscript>';
        print self::globalNotices();
        if (is_object($User) && $User->type['User']) {
            $gameNotifyBlock = libHTML::gameNotifyBlock();
            if ($gameNotifyBlock) {
                print '<div class="content-notice"><div class="gamelistings-tabs">' . $gameNotifyBlock . '</div></div>';
            }
        }
    }