本文整理汇总了PHP中FrontController::fc方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontController::fc方法的具体用法?PHP FrontController::fc怎么用?PHP FrontController::fc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrontController
的用法示例。
在下文中一共展示了FrontController::fc方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: make_pretty_hyperlink
function make_pretty_hyperlink($matches)
{
$uri = new Url(implode('', array_slice($matches, 1)));
$homeUri = new Url(FrontController::fc()->homeURL());
$isExternal = $uri->host() !== $homeUri->host();
if (!$isExternal) {
$uri->setScheme()->setHost();
}
return generateHyperlinkHTML($uri, $isExternal ? array('class' => 'link-external') : NULL, 40);
}
示例2: populateGraphTemplate
public function populateGraphTemplate(&$tpl)
{
if (!is_array($tpl)) {
throw new Exception('Invalid template argument, array expected');
}
parent::populateGraphTemplate($tpl);
$build = FrontController::fc()->findPlugin('BuildRepository')->buildByUniqueId($this->buildId);
if ($build instanceof BuildEvent) {
$tpl['build_startdate'] = date(DATE_ATOM, $build->startDate());
$tpl['build_uniqueid'] = $this->buildId;
}
}
示例3: execute
/**
* Implements Actioner.
*/
public function execute($args = NULL)
{
$fc =& FrontController::fc();
$fc->outputHeader($this->title(), 'masterserver');
$fc->beginPage($this->title(), 'masterserver');
?>
<div id="contentbox"><div class="masterbrowser block"><?php
// Output a "join us" foreword.
includeHTML('joinus', self::$name);
try {
FrontController::contentCache()->import(self::$serverSummaryCacheName);
$this->outputJavascript();
} catch (Exception $e) {
?>
<p>A master server listing is not presently available. Please try again later.</p><?php
}
// Output footnotes.
includeHTML('footnotes', self::$name);
?>
</div><?php
?>
<div class="block"><section><p>A server admin is not required to publish their server to this central list (located at <em>http://dengine.net/master.php</em>), however it will then only be findable by clients who enter the IP address manually. A server may be published here but remain "closed" (requiring a password to join). Further information about the master server is available <a href="/dew/index.php?title=Master_server" title="Documentation for the master server">here</a>.</p></section></div><?php
?>
</div><?php
$fc->endPage();
}
示例4: catch
/** @file index.php Entrypoint script for dengine.net
*
* @authors Copyright © 2009-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
require_once 'classes/frontcontroller.class.php';
try {
FrontController::fc()->interpretRequest();
} catch (Exception $e) {
// Last chance handler for uncaught exceptions.
?>
<h1>Unhandled exception</h1>
<p><?php
echo htmlspecialchars($e->getMessage());
?>
</p><?php
}
示例5: execute
/**
* Implements Actioner.
*/
public function execute($args = NULL)
{
$fc =& FrontController::fc();
// The autobuilder operates in Eastern European Time.
date_default_timezone_set('EET');
if (isset($args['getpackage'])) {
$this->outputPackageRedirect($args['getpackage']);
return;
} else {
if (isset($args['getgraph'])) {
$this->outputPackageGraph($args['getgraph']);
return;
}
}
// Determine whether we are detailing a single build event or listing all events.
$build = isset($args['build']) ? $this->buildByUniqueId($args['build']) : NULL;
$pageTitle = $build instanceof BuildEvent ? $build->composeName(true) : 'Build Repository';
// Output this page.
$fc->outputHeader($pageTitle);
$fc->beginPage($pageTitle);
?>
<div id="contentbox"><?php
if ($build instanceof BuildEvent) {
// Detailing a single build event.
$this->outputEventDetail($build);
} else {
// Show the entire build event index.
$this->outputEventIndex();
}
?>
</div><?php
$fc->endPage();
}
示例6: execute
/**
* Implements Actioner.
*/
public function execute($args = NULL)
{
$fc =& FrontController::fc();
// Build the add-ons collection.
$addonListXml = file_get_contents(nativePath("plugins/addonrepository/addons.xml"));
$this->addons = array();
AddonsParser::parse($addonListXml, $this->addons);
// Sort the collection.
uasort($this->addons, array('self', 'packageSorter'));
// Output the page.
$fc->outputHeader($this->title(), 'addons');
$fc->beginPage($this->title(), 'addons');
?>
<div id="contentbox" class="addons"><?php
includeHTML('overview', self::$name);
$this->outputFeaturedAddons();
?>
<div class="block"><article><h1>DOOM</h1>
<p>The following add-ons are for use with <a href="/doom" title="Tell me more about DOOM">DOOM</a> or a variant of it such as <strong>DOOM2</strong> and <strong>Final Doom: The Plutonia Experiment</strong>.</p>
<?php
$this->outputAddonList(self::$doomGameModes);
?>
</article></div><?php
?>
<div class="block"><article><h1>Heretic</h1>
<p>The following add-ons are for use with <a href="/heretic" title="Tell me more about Heretic">Heretic</a> and the <strong>Shadow of the Serpent Riders</strong> expansion pack.</p>
<?php
$this->outputAddonList(self::$hereticGameModes);
?>
</article></div><?php
?>
<div class="block"><article><h1>Hexen</h1>
<p>The following add-ons are for use with <a href="/hexen" title="Tell me more about Hexen">Hexen</a> and the <strong>Deathkings of the Dark Citadel</strong> expansion pack.</p>
<?php
$this->outputAddonList(self::$hexenGameModes);
?>
</article></div><?php
?>
</div><?php
$fc->endPage();
}
示例7: execute
/**
* Implements Actioner.
*/
public function execute($args = NULL)
{
$fc =& FrontController::fc();
if (!is_array($args) && !array_key_exists('page', $args)) {
throw new Exception('Unexpected arguments passed.');
}
$page = $args['page'];
$mainHeading = ucwords(mb_ereg_replace('_', ' ', $page));
$pageFile = 'pages/' . $args['page'] . '.html';
$fc->outputHeader($mainHeading);
$fc->beginPage($mainHeading, $page);
?>
<div id="contentbox"><?php
try {
FrontController::contentCache()->import($pageFile);
} catch (Exception $e) {
?>
<p>No content for this page</p>
<?php
}
?>
</div><?php
$fc->endPage();
}
示例8: execute
/**
* Implements Actioner.
*/
public function execute($args = NULL)
{
$fc =& FrontController::fc();
$fc->outputHeader($this->title());
$fc->beginPage($this->title());
?>
<div id="example_page" style="padding: 1em;background-color: white;"><p>Hello World!</p></div><?php
$fc->endPage();
}
示例9: execute
/**
* Implements Actioner.
*/
public function execute($args = NULL)
{
$fc =& FrontController::fc();
$fc->outputHeader($this->title());
$imgDir = '/images/screenshots';
$doomImages = array(array('url' => $imgDir . "/doom/1.jpg", 'caption' => "Title1"), array('url' => $imgDir . "/doom/2.jpg", 'caption' => "Title2"), array('url' => $imgDir . "/doom/3.jpg", 'caption' => "Title3"), array('url' => $imgDir . "/doom/4.jpg", 'caption' => "Title4"), array('url' => $imgDir . "/doom/5.jpg", 'caption' => "Title5"), array('url' => $imgDir . "/doom/6.jpg", 'caption' => "Title6"), array('url' => $imgDir . "/doom/7.jpg", 'caption' => "Title7"));
$this->generateJavascript($doomImages, 'doomCarousel');
$hereticImages = array(array('url' => $imgDir . "/heretic/1.jpg", 'caption' => "Title1"), array('url' => $imgDir . "/heretic/2.jpg", 'caption' => "Title2"), array('url' => $imgDir . "/heretic/3.jpg", 'caption' => "Title3"), array('url' => $imgDir . "/heretic/4.jpg", 'caption' => "Title4"));
$this->generateJavascript($hereticImages, 'hereticCarousel');
$hexenImages = array(array('url' => $imgDir . "/hexen/1.jpg", 'caption' => "Title1"));
$this->generateJavascript($hexenImages, 'hexenCarousel');
$fc->beginPage($this->title());
?>
<div id="screenshots">
<script type="text/javascript">
tb_pathToImage = "/external/thickbox/loading-thickbox.gif";
</script>
<?php
$this->generateHTML('Doom', 'doomCarousel');
$this->generateHTML('Heretic', 'hereticCarousel');
$this->generateHTML('Hexen', 'hexenCarousel');
?>
</div><?php
$fc->endPage();
}
示例10: execute
public function execute($args = NULL)
{
$fc =& FrontController::fc();
$fc->outputHeader();
$fc->beginPage($this->title());
includeHTML('latestversion', 'z#home');
?>
<div id="contentbox"><?php
//includeHTML('introduction', 'z#home');
?>
<script>
(function (e) {
e.fn.interpretMasterServerStatus = function (t) {
var n = {
serverUri: "http://dengine.net/master.php?xml",
maxItems: 3,
generateServerSummaryHtml: 0
};
if (t) {
e.extend(n, t);
}
var r = e(this).attr("id");
e.ajax({
url: n.serverUri,
dataType: 'xml',
success: function (t) {
e("#" + r).empty();
var root = $('masterserver', t);
var serverList = root.find('serverlist')[0];
var serverCount = serverList.attributes.getNamedItem('size').nodeValue;
var d = new Date(root.find('channel>pubdate').text());
var niceDate = $.datepicker.formatDate('MM d, yy', d);
var minItems = serverCount < n.maxItems? serverCount : n.maxItems;
var announceTime = d.toLocaleTimeString();
var html = '<header>'
+ '<h1><a href="/masterserver" title="View the complete list in the server browser">'
+ (serverCount > 0? ('Most active servers '
+ '<label title="Result limit">' + minItems + '</label>/<label title="Total number of servers">' + serverCount + '</label>')
: 'No active servers')
+ '</a></h1>'
+ '<p>' + niceDate + ' @ <label title="' + announceTime + ' (time of the last server announcement)">' + announceTime + '</label></p></header>';
if(serverCount) {
var idx = 0;
var playerCount = 0;
html += '<ol class="servers">';
for(var i = 0; i < serverList.childNodes.length; ++i) {
if(serverList.childNodes[i].nodeName != 'server')
continue;
var server = $(serverList.childNodes[i]);
if(n.maxItems <= 0 || idx < n.maxItems)
{
html += '<li>' + n.generateServerSummaryHtml(n, server) + '</li>';
}
playerCount += Number(server.find('gameinfo>numplayers').text());
idx++;
};
html += '</ol>';
//html += '<span class="summary"><a href="/masterserver" title="See the full listing in the server browser">' + serverCount + ' ' + (serverCount == 1? 'server':'servers') + ' in total, ' + playerCount + ' active ' + (playerCount == 1? 'player':'players') + '</a></span>';
}
e("#" + r).append(html);
}
})
}
})(jQuery)
$(document).ready(function () {
$('#activeservers').interpretMasterServerStatus({
generateServerSummaryHtml: function (n, info) {
var name = info.find('name').text();
var status = info.children('open').text() == 'yes'? 'open' : 'locked';
var serverMetadataLabel = 'I.P address ' + info.children('ip').text() + ', port ' + info.children('port').text()
+ ', ' + status;
// Any required addons?.
/*var addonArr = array_filter(explode(';', info['pwads']));
if(count(addonArr))
{
serverMetadataLabel .= 'Add-ons: '. implode(' ', addonArr);
}*/
var gameInfo = $(info.children('gameinfo'));
var gameMode = gameInfo.children('mode').text();
var mapId = gameInfo.children('map').text();
if(mapId.substring(0, 3) == 'MAP')
{
mapId = 'map ' + mapId.substring(3);
}
else if(mapId.substring(0, 1) == 'E' && mapId.substring(2, 3) == 'M')
//.........这里部分代码省略.........