Example #1
0
    /**
     * Template filter callback for OSBridge skin.
     * Takes an associative array of data set from a SkinTemplate-based
     * class, and a wrapper for MediaWiki's localization database, and
     * outputs a formatted page.
     *
     * @access private
     */
    function execute()
    {
        global $wgRequest;
        $this->skin = $skin = $this->data['skin'];
        $action = $wgRequest->getText('action');
        // Suppress warnings to prevent notices about missing indexes in $this->data
        wfSuppressWarnings();
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="<?php 
        $this->text('xhtmldefaultnamespace');
        ?>
" <?php 
        foreach ($this->data['xhtmlnamespaces'] as $tag => $ns) {
            ?>
xmlns:<?php 
            echo "{$tag}=\"{$ns}\" ";
        }
        ?>
xml:lang="<?php 
        $this->text('lang');
        ?>
" lang="<?php 
        $this->text('lang');
        ?>
" dir="<?php 
        $this->text('dir');
        ?>
">
  <head>
    <meta http-equiv="Content-Type" content="<?php 
        $this->text('mimetype');
        ?>
; charset=<?php 
        $this->text('charset');
        ?>
" />
    <?php 
        $this->html('headlinks');
        ?>
    <title><?php 
        $this->text('pagetitle');
        ?>
</title>
    <?php 
        $this->html('csslinks');
        ?>

    <!--[if lt IE 7]><script type="<?php 
        $this->text('jsmimetype');
        ?>
" src="<?php 
        $this->text('stylepath');
        ?>
/common/IEFixes.js?<?php 
        echo $GLOBALS['wgStyleVersion'];
        ?>
"></script>
    <meta http-equiv="imagetoolbar" content="no" /><![endif]-->

    <?php 
        print Skin::makeGlobalVariablesScript($this->data);
        ?>

    <script type="<?php 
        $this->text('jsmimetype');
        ?>
" src="<?php 
        $this->text('stylepath');
        ?>
/common/wikibits.js?<?php 
        echo $GLOBALS['wgStyleVersion'];
        ?>
"><!-- wikibits js --></script>
    <!-- Head Scripts -->
<?php 
        $this->html('headscripts');
        if ($this->data['jsvarurl']) {
            ?>
    <script type="<?php 
            $this->text('jsmimetype');
            ?>
" src="<?php 
            $this->text('jsvarurl');
            ?>
"><!-- site js --></script>
<?php 
        }
        if ($this->data['pagecss']) {
            ?>
    <style type="text/css"><?php 
            $this->html('pagecss');
            ?>
</style>
<?php 
        }
        if ($this->data['usercss']) {
            ?>
    <style type="text/css"><?php 
            $this->html('usercss');
            ?>
</style>
<?php 
        }
        if ($this->data['userjs']) {
            ?>
    <script type="<?php 
            $this->text('jsmimetype');
            ?>
" src="<?php 
            $this->text('userjs');
            ?>
"></script>
<?php 
        }
        if ($this->data['userjsprev']) {
            ?>
    <script type="<?php 
            $this->text('jsmimetype');
            ?>
"><?php 
            $this->html('userjsprev');
            ?>
</script>
<?php 
        }
        if ($this->data['trackbackhtml']) {
            print $this->data['trackbackhtml'];
        }
        ?>
    <script src="<?php 
        echo $this->text('stylepath');
        ?>
/osbridge/jquery.min.js" type="text/javascript" charset="utf-8"></script>

    <style type="text/css" media="screen">

    </style>

  </head>
<body<?php 
        if ($this->data['body_ondblclick']) {
            ?>
 ondblclick="<?php 
            $this->text('body_ondblclick');
            ?>
"<?php 
        }
        if ($this->data['body_onload']) {
            ?>
 onload="<?php 
            $this->text('body_onload');
            ?>
"<?php 
        }
        ?>
 class="mediawiki <?php 
        $this->text('dir');
        ?>
 <?php 
        $this->text('pageclass');
        ?>
 <?php 
        $this->text('skinnameclass');
        ?>
">
  <div id="wrapper">
    <!-- #header_fragment BEGIN -->
    <?php 
        require_once 'shared_fragments.php';
        ?>
    <?php 
        global $OSBRIDGE_EVENT_SLUG;
        if ($OSBRIDGE_EVENT_SLUG) {
            require_shared_fragment("header_{$OSBRIDGE_EVENT_SLUG}");
        } else {
            require_shared_fragment('header_current');
        }
        ?>
    <!-- #header_fragment END -->

    <div id="container">
      <div class='section_title'>
        <h2>Attendee Wiki</h2>
      </div>
      <div id="content">
        <a name="top" id="top"></a>
        <?php 
        if ($this->data['sitenotice']) {
            ?>
<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div><?php 
        }
        ?>

        <!-- page controls -->
        <?php 
        global $admin_sidebar_actions;
        ?>
        <div id="content-actions">
          <ul>
            <?php 
        # OSBRIDGE: Only show these actions
        $include_content_actions = array('edit', 'history', 'watch');
        foreach (array_diff_key($this->data['content_actions'], array_flip($admin_sidebar_actions)) as $key => $tab) {
            # echo "KEY($key)"; # Uncomment to show action names
            # OSBRIDGE: Skip unwanted actions
            if (!in_array($key, $include_content_actions)) {
                continue;
            }
            echo '
                <li id="' . Sanitizer::escapeId("ca-{$key}") . '"';
            if ($tab['class']) {
                echo ' class="' . htmlspecialchars($tab['class']) . '"';
            }
            echo '><a href="' . htmlspecialchars($tab['href']) . '"';
            # We don't want to give the watch tab an accesskey if the
            # page is being edited, because that conflicts with the
            # accesskey on the watch checkbox.  We also don't want to
            # give the edit tab an accesskey, because that's fairly su-
            # perfluous and conflicts with an accesskey (Ctrl-E) often
            # used for editing in Safari.
            if (in_array($action, array('edit', 'submit')) && in_array($key, array('edit', 'watch', 'unwatch'))) {
                echo $skin->tooltip("ca-{$key}");
            } else {
                echo $skin->tooltipAndAccesskey("ca-{$key}");
            }
            echo '>' . htmlspecialchars($tab['text']) . '</a></li>';
        }
        ?>
          </ul>
        </div>

        <!-- page content -->
        <h2 class="page_title"><?php 
        $this->data['displaytitle'] != "" ? $this->html('title') : $this->text('title');
        ?>
</h2>
        <div id="bodyContent">
          <h3 id="siteSub"><?php 
        $this->msg('tagline');
        ?>
</h3>
          <div id="contentSub"><?php 
        $this->html('subtitle');
        ?>
</div>
          <?php 
        if ($this->data['undelete']) {
            ?>
<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div><?php 
        }
        ?>
          <?php 
        if ($this->data['newtalk']) {
            ?>
<div class="usermessage"><?php 
            $this->html('newtalk');
            ?>
</div><?php 
        }
        ?>
          <?php 
        if ($this->data['showjumplinks']) {
            ?>
<div id="jump-to-nav"><?php 
            $this->msg('jumpto');
            ?>
 <a href="#column-one"><?php 
            $this->msg('jumptonavigation');
            ?>
</a>, <a href="#searchInput"><?php 
            $this->msg('jumptosearch');
            ?>
</a></div><?php 
        }
        ?>
          <!-- start content -->
          <?php 
        $this->html('bodytext');
        ?>
          <?php 
        if ($this->data['catlinks']) {
            $this->html('catlinks');
        }
        ?>
          <!-- end content -->
          <?php 
        if ($this->data['dataAfterContent']) {
            $this->html('dataAfterContent');
        }
        ?>
          <div class="visualClear"></div>
        </div>
      </div>
      <div class='sidebar'>
        <ul class="xoxo">

          <!-- User profile and actions -->

<?php 
        # OSBRIDGE: Display navigation here
        $sidebar = $this->data['sidebar'];
        foreach ($sidebar as $boxName => $cont) {
            if ($boxName == 'navigation') {
                $this->customBox($boxName, $cont);
            } else {
                continue;
            }
        }
        ?>


      <li class="portlet" id='personal-tools'>
        <div id='account-box'>
          <h3><?php 
        $this->msg('personaltools');
        ?>
</h3>
          <div class='user_actions'>
            <ul>
<?php 
        foreach ($this->data['personal_urls'] as $key => $item) {
            ?>
                <li id="<?php 
            echo Sanitizer::escapeId("pt-{$key}");
            ?>
"<?php 
            if ($item['active']) {
                ?>
 class="active"<?php 
            }
            ?>
><a href="<?php 
            echo htmlspecialchars($item['href']);
            ?>
"<?php 
            echo $skin->tooltipAndAccesskey('pt-' . $key);
            if (!empty($item['class'])) {
                ?>
 class="<?php 
                echo htmlspecialchars($item['class']);
                ?>
"<?php 
            }
            ?>
><?php 
            echo htmlspecialchars($item['text']);
            ?>
</a></li>
<?php 
        }
        ?>
            </ul>
          </div>
        </div>
      </li>


          <?php 
        $admin_sidebar_menu = array_intersect_key($this->data['content_actions'], array_flip($admin_sidebar_actions));
        if (count($admin_sidebar_menu) > 0) {
            ?>
          <li class='portlet'>
            <h3>Management</h3>
            <ul>
              <?php 
            foreach ($admin_sidebar_menu as $key => $tab) {
                echo '
                <li id="' . Sanitizer::escapeId("ca-{$key}") . '"';
                if ($tab['class']) {
                    echo ' class="' . htmlspecialchars($tab['class']) . '"';
                }
                echo '><a href="' . htmlspecialchars($tab['href']) . '"';
                # We don't want to give the watch tab an accesskey if the
                # page is being edited, because that conflicts with the
                # accesskey on the watch checkbox.  We also don't want to
                # give the edit tab an accesskey, because that's fairly su-
                # perfluous and conflicts with an accesskey (Ctrl-E) often
                # used for editing in Safari.
                if (in_array($action, array('edit', 'submit')) && in_array($key, array('edit', 'watch', 'unwatch'))) {
                    echo $skin->tooltip("ca-{$key}");
                } else {
                    echo $skin->tooltipAndAccesskey("ca-{$key}");
                }
                echo '>' . htmlspecialchars($tab['text']) . '</a></li>';
            }
            ?>

              <?php 
            # OSBRIDGE: Add an upload link here rather than in the silly Toolbox
            ?>
              <?php 
            $special = 'upload';
            ?>
              <li id="t-<?php 
            echo $special;
            ?>
"><a href="<?php 
            echo htmlspecialchars($this->data['nav_urls'][$special]['href']);
            ?>
"<?php 
            echo $this->skin->tooltipAndAccesskey('t-' . $special);
            ?>
><?php 
            $this->msg($special);
            ?>
</a></li>
              <?php 
            $special = Nil;
            ?>
            </ul>
          </li>
          <?php 
        }
        ?>

<?php 
        $sidebar = $this->data['sidebar'];
        if (!isset($sidebar['SEARCH'])) {
            $sidebar['SEARCH'] = true;
        }
        if (!isset($sidebar['TOOLBOX'])) {
            $sidebar['TOOLBOX'] = true;
        }
        if (!isset($sidebar['LANGUAGES'])) {
            $sidebar['LANGUAGES'] = true;
        }
        foreach ($sidebar as $boxName => $cont) {
            if ($boxName == 'SEARCH') {
                continue;
                $this->searchBox();
            } elseif ($boxName == 'TOOLBOX') {
                continue;
                $this->toolbox();
            } elseif ($boxName == 'LANGUAGES') {
                continue;
                # OSBRIDGE: Never display languages.
                $this->languageBox();
            } elseif ($boxName == 'navigation') {
                continue;
                # OSBRIDGE: We'll display the navigation elsewhere
            } else {
                $this->customBox($boxName, $cont);
            }
        }
        # OSBRIDGE: Always show these, ignoring the settings above
        $this->toolbox();
        $this->searchBox();
        ?>
          <li>
            <ul>
              <?php 
        if ($this->data['copyrightico']) {
            ?>
              <li><div id="f-copyrightico"><?php 
            $this->html('copyrightico');
            ?>
</div></li>
              <?php 
        }
        ?>

              <?php 
        // Generate additional footer links
        # ORIGINAL: $footerlinks = array('lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright', 'privacy', 'about', 'disclaimer', 'tagline');
        # OSBRIDGE: Don't display footer links
        $footerlinks = array();
        $validFooterLinks = array();
        foreach ($footerlinks as $aLink) {
            if (isset($this->data[$aLink]) && $this->data[$aLink]) {
                $validFooterLinks[] = $aLink;
            }
        }
        if (count($validFooterLinks) > 0) {
            foreach ($validFooterLinks as $aLink) {
                if (isset($this->data[$aLink]) && $this->data[$aLink]) {
                    ?>
              <li id="<?php 
                    echo $aLink;
                    ?>
"><?php 
                    $this->html($aLink);
                    ?>
</li>
                  <?php 
                }
            }
        }
        ?>
            </ul>
          </li>
        </ul>
      </div>
    </div>

    <div id="footer"></div>
</div>
<?php 
        $this->html('bottomscripts');
        /* JS call to runBodyOnloadHook */
        ?>
<script type="<?php 
        $this->text('jsmimetype');
        ?>
"> if (window.isMSIE55) fixalpha(); </script>
<?php 
        $this->html('reporttime');
        if ($this->data['debug']) {
            ?>
<!-- Debug output:
<?php 
            $this->text('debug');
            ?>
-->
<?php 
        }
        ?>

<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
  var pageTracker = _gat._getTracker("UA-168427-8");
  pageTracker._initData();
  pageTracker._trackPageview();
</script>

<script type="text/javascript">
    // Defer loading "getclicky" till after the page has loaded, because it's external and slow.
    $(document).ready(function () {
        var element = document.createElement("script");
        element.src = "http://static.getclicky.com/79611.js";
        element.type = "text/javascript";
        document.getElementsByTagName("head")[0].appendChild(element);
    });
</script>

</body></html>
<?php 
        wfRestoreWarnings();
    }
Example #2
0
    $parent = $wp_query->post->ID;
} else {
    $parent = $wp_query->post->post_parent;
}
?>

    <!-- #header_fragment BEGIN -->
    <?php 
require_once 'shared_fragments.php';
?>
    <?php 
$event_slug = get_post_meta($wp_query->post->ID, 'event_slug', true);
if ($event_slug) {
    require_shared_fragment("header_{$event_slug}");
} else {
    require_shared_fragment('header_current');
}
?>
    <!-- #header_fragment END -->

    <?php 
if (!is_front_page()) {
    if (is_page()) {
        $section_title = get_the_title($parent);
    } else {
        $section_title = "Blog";
    }
    ?>

	<div id="container">
    <div class="section_title">