本文整理汇总了PHP中Module::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::run方法的具体用法?PHP Module::run怎么用?PHP Module::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::run方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderAction
public function renderAction()
{
$this->oSession->userdata['c'] = 2000;
$this->_view->title = 'Day la trang dung chuc nang renderAction --- ' . $this->oSession->userdata['test'];
$this->_view->part_render = Module::run(new Request('site/home/part-render', array('Title duoc truyen vao ' . $this->oSession->userdata['c'])));
$this->renderView('site/home/render');
}
示例2: dispatch
public function dispatch()
{
$request = new Request($_SERVER['QUERY_STRING']);
$this->_module = $request->getModule();
$this->_controller = $request->getController();
$this->_action = $request->getAction();
foreach ($this->pre_request as $pre_request) {
$result = Module::run($pre_request);
if ($result) {
$request = $result;
break;
}
}
while ($request) {
$request = Module::run($request);
}
}
示例3: sec_admin
function sec_admin()
{
global $rules, $settings, $DEA, $coach, $lng, $admin_menu;
global $leagues, $divisions, $tours;
if (!is_object($coach)) {
fatal('Please login.');
}
if (!isset($_GET['subsec'])) {
$_GET['subsec'] = '_NONE_';
}
$IS_GLOBAL_ADMIN = $coach->ring == Coach::T_RING_GLOBAL_ADMIN;
$ONLY_FOR_GLOBAL_ADMIN = "Note: This feature may only be used by <i>global</i> administrators.";
# Used string in a few common feature/action boxes.
// Deny un-authorized users.
if (!in_array($_GET['subsec'], array_keys($admin_menu))) {
fatal("Sorry. Your access level does not allow you opening the requested page.");
}
switch ($_GET['subsec']) {
case 'usr_man':
include 'admin/admin_usr_man.php';
break;
case 'ct_man':
include 'admin/admin_ct_man.php';
break;
case 'nodes':
include 'admin/admin_nodes.php';
break;
case 'schedule':
include 'admin/admin_schedule.php';
break;
case 'import':
include 'admin/admin_import.php';
break;
case 'log':
Module::run('LogSubSys', array('logViewPage'));
break;
case 'cpanel':
include 'admin/admin_cpanel.php';
break;
default:
fatal('The requested admin page does not exist.');
}
echo "<br><br>";
HTMLOUT::dnt();
}
示例4: _stats
private function _stats()
{
global $lng, $settings;
?>
<div class="row">
<div class="boxCoachPage">
<h3 class='boxTitle1'><?php
echo $lng->getTrn('common/general');
?>
</h3>
<div class='boxBody'>
<table class="boxTable">
<?php
echo "<tr><td>Played</td><td>{$this->mv_played}</td></tr>\n";
echo "<tr><td>WIN%</td><td>" . (sprintf("%1.1f", $this->rg_win_pct) . '%') . "</td></tr>\n";
echo "<tr><td>ELO</td><td>" . ($this->rg_elo ? sprintf("%1.2f", $this->rg_elo) : '<i>N/A</i>') . "</td></tr>\n";
echo "<tr><td>W/L/D</td><td>{$this->mv_won}/{$this->mv_lost}/{$this->mv_draw}</td></tr>\n";
echo "<tr><td>W/L/D " . $lng->getTrn('common/streaks') . "</td><td>{$this->mv_swon}/{$this->mv_slost}/{$this->mv_sdraw}</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('common/wontours') . "</td><td>{$this->wt_cnt}</td></tr>\n";
if (Module::isRegistered('Prize')) {
echo "<tr><td>" . $lng->getTrn('name', 'Prize') . "</td><td><small>" . Module::run('Prize', array('getPrizesString', T_OBJ_COACH, $this->coach_id)) . "</small></td></tr>\n";
}
echo "<tr><td colspan='2'><hr></td></tr>";
$result = mysql_query("\n SELECT \n COUNT(*) AS 'teams_total', \n IFNULL(SUM(IF(rdy IS TRUE AND retired IS FALSE,1,0)),0) AS 'teams_active', \n IFNULL(SUM(IF(rdy IS FALSE,1,0)),0) AS 'teams_notready',\n IFNULL(SUM(IF(retired IS TRUE,1,0)),0) AS 'teams_retired',\n IFNULL(AVG(elo),0) AS 'avg_elo',\n IFNULL(CAST(AVG(ff) AS SIGNED INT),0) AS 'avg_ff',\n IFNULL(CAST(AVG(tv)/1000 AS SIGNED INT),0) AS 'avg_tv'\n FROM teams WHERE owned_by_coach_id = {$this->coach_id}");
$row = mysql_fetch_assoc($result);
echo "<tr><td>" . $lng->getTrn('profile/coach/teams_total') . "</td><td>{$row['teams_total']}</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('profile/coach/teams_active') . "</td><td>{$row['teams_active']}</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('profile/coach/teams_notready') . "</td><td>{$row['teams_notready']}</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('profile/coach/teams_retired') . "</td><td>{$row['teams_retired']}</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('profile/coach/avgteam_elo') . "</td><td>" . ($row['avg_elo'] ? sprintf("%1.2f", $row['avg_elo']) : '<i>N/A</i>') . "</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('profile/coach/avgteam_tv') . "</td><td>{$row['avg_tv']}</td></tr>\n";
echo "<tr><td>" . $lng->getTrn('profile/coach/avgteam_ff') . "</td><td>{$row['avg_ff']}</td></tr>\n";
?>
</table>
</div>
</div>
<div class="boxCoachPage">
<h3 class='boxTitle1'><?php
echo $lng->getTrn('common/ach');
?>
</h3>
<div class='boxBody'>
<table class="boxTable">
<?php
$stats = array('CAS' => array('cas', 2), 'BH' => array('bh', 2), 'Ki' => array('ki', 2), 'Si' => array('si', 2), 'TD' => array('td', 2), 'Int' => array('intcpt', 2), 'Cp' => array('cp', 2), 'GF' => array('gf', 2), 'GA' => array('ga', 2), 'SMP' => array('smp', 2));
$thisAVG = clone $this;
$thisAVG->setStats(false, false, true);
echo "<tr><td>" . $lng->getTrn('common/stat') . "</td> <td>" . $lng->getTrn('common/amount') . "</td> <td>" . $lng->getTrn('common/matchavg') . "</td></tr>\n";
echo "<tr><td colspan='5'><hr></td></tr>\n";
foreach ($stats as $name => $d) {
echo "<tr><td><i>{$name}</i></td>";
echo "<td>" . $this->{"mv_{$d['0']}"} . "</td>";
echo "<td>" . sprintf("%1.{$d['1']}f", $thisAVG->{"mv_{$d['0']}"}) . "</td>";
echo "</tr>\n";
}
?>
</table>
</div>
</div>
</div>
<br>
<div class="row"></div>
<br>
<?php
if (!$settings['hide_ES_extensions']) {
?>
<div class="row">
<div class="boxWide">
<div class="boxTitle<?php
echo T_HTMLBOX_STATS;
?>
"><a href='javascript:void(0);' onClick="slideToggleFast('ES');"><b>[+/-]</b></a> <?php
echo $lng->getTrn('common/extrastats');
?>
</div>
<div class="boxBody" id="ES">
<?php
HTMLOUT::generateEStable($this);
?>
</div>
</div>
</div>
<?php
}
}
示例5: _actionBoxes
//.........这里部分代码省略.........
</tr>
<tr valign="top">
<td><?php
echo $lng->getTrn('common/playedtours');
?>
</td>
<td><small><?php
$tours = $team->getToursPlayedIn(false);
if (empty($tours)) {
echo $lng->getTrn('common/none');
} else {
$first = true;
foreach ($tours as $tour) {
if ($first) {
$first = false;
} else {
echo ", ";
}
echo $tour->getUrl();
}
}
?>
</small></td>
</tr>
<?php
if (Module::isRegistered('Prize')) {
?>
<tr valign="top">
<td><?php
echo $lng->getTrn('name', 'Prize');
?>
</td>
<td><small><?php
echo Module::run('Prize', array('getPrizesString', T_OBJ_TEAM, $team->team_id));
?>
</small></td>
</tr>
<?php
}
if (Module::isRegistered('FamousTeams')) {
?>
<tr>
<td><?php
echo $lng->getTrn('isfamous', 'FamousTeams');
?>
</td>
<td><?php
echo Module::run('FamousTeams', array('isInFT', $team->team_id)) ? '<b><font color="green">Yes</font></b>' : 'No';
?>
</td>
</tr>
<?php
}
?>
</table>
</div>
</div>
<?php
if ($ALLOW_EDIT) {
?>
<div class="boxTeamPage">
<div class="boxTitle<?php
echo T_HTMLBOX_COACH;
?>
"><?php
示例6: json_decode
case 'apa_generate_draw':
Scheduler::apa_generate_draw();
break;
case 'manual_draw':
Scheduler::show_manual_draw();
break;
case 'manual_schedule':
$teams = json_decode($_POST['teams']);
$draw = array();
foreach ($teams->teams as $team) {
$draw[] = str_replace("pool", "", $team);
}
Scheduler::apa_generate_schedule($draw);
break;
case 'custom_draw':
Scheduler::show_custom_draw();
break;
case 'custom_game':
Scheduler::schedule_custom_game();
break;
}
} else {
Module::run('Scheduler', array());
}
break;
case 'scheduler_apa_schedule_available':
break;
default:
fatal("Sorry. I don't know what the type '{$_GET['type']}' means.\n");
}
mysql_close($conn);
示例7: _about
//.........这里部分代码省略.........
} elseif ($p->is_sold) {
echo "<b>" . $lng->getTrn('common/sold') . "</b> ({$p->date_sold})";
} else {
global $T_INJS;
$status = ucfirst(strtolower($T_INJS[$p->status]));
echo $status == 'none' ? '<b><font color="green">' . $lng->getTrn('common/ready') . '</font></b>' : "<b><font color='blue'>{$status}</font></b>";
}
?>
</td>
</tr>
<tr>
<td><b><?php
echo $lng->getTrn('common/value');
?>
</b></td>
<td><?php
echo $p->value / 1000 . 'k';
?>
</td>
</tr>
<tr>
<td><b>SPP/extra</b></td>
<td><?php
echo "{$p->mv_spp}/{$p->extra_spp}";
?>
</td>
</tr>
<?php
if (Module::isRegistered('Wanted')) {
?>
<tr>
<td><b>Wanted</b></td>
<td><?php
echo Module::run('Wanted', array('isWanted', $p->player_id)) ? '<b><font color="red">Yes</font></b>' : 'No';
?>
</td>
</tr>
<?php
}
if (Module::isRegistered('HOF')) {
?>
<tr>
<td><b>In HoF</b></td>
<td><?php
echo Module::run('HOF', array('isInHOF', $p->player_id)) ? '<b><font color="green">Yes</font></b>' : 'No';
?>
</td>
</tr>
<?php
}
?>
<tr>
<td><b><?php
echo $lng->getTrn('common/played');
?>
</b></td>
<td><?php
echo $p->mv_played;
?>
</td>
</tr>
<tr>
<td><b>W/L/D</b></td>
<td><?php
echo "{$p->mv_won}/{$p->mv_lost}/{$p->mv_draw}";
?>
示例8: generateNewsRssFeed
/**
* Generates the newsfeed and writes it to disc.
*
*/
public function generateNewsRssFeed()
{
$dom = new DOMDocument();
$dom->formatOutput = true;
$el_root = $dom->appendChild($dom->createElement('rss'));
$el_root->setAttribute('version', '2.0');
$el_channel = $el_root->appendChild($dom->createElement('channel'));
$el_channel->appendChild($dom->createElement('title', $this->title));
$el_channel->appendChild($dom->createElement('link', $this->link));
$el_channel->appendChild($dom->createElement('description', $this->desc));
if ($this->lang != '') {
$el_channel->appendChild($dom->createElement('language', $this->lang));
}
$el_channel->appendChild($dom->createElement('docs', $this->docs));
$el_channel->appendChild($dom->createElement('lastBuildDate', date(DATE_RSS)));
$el_channel->appendChild($dom->createElement('generator', 'OBBLM ' . OBBLM_VERSION));
$entries = array();
foreach ($this->type as $t) {
$obj = (object) null;
switch ($t) {
case T_TEXT_MSG:
foreach (Message::getMessages(RSS_SIZE) as $item) {
$entries[] = (object) array('title' => "Announcement by " . get_alt_col('coaches', 'coach_id', $item->f_coach_id, 'name') . ": {$item->title}", 'desc' => $item->message, 'date' => $item->date);
}
break;
case 'HOF':
if (Module::isRegistered('HOF')) {
foreach (Module::run('HOF', array('getHOF', false, RSS_SIZE)) as $item) {
$item = $item['hof'];
$entries[] = (object) array('title' => "HOF entry for " . get_alt_col('players', 'player_id', $item->pid, 'name') . ": {$item->title}", 'desc' => $item->about, 'date' => $item->date);
}
}
break;
case 'Wanted':
if (Module::isRegistered('Wanted')) {
foreach (Module::run('Wanted', array('getWanted', false, RSS_SIZE)) as $item) {
$item = $item['wanted'];
$entries[] = (object) array('title' => "Wanted entry for " . get_alt_col('players', 'player_id', $item->pid, 'name') . ": {$item->bounty}", 'desc' => $item->why, 'date' => $item->date);
}
}
break;
case T_TEXT_MATCH_SUMMARY:
foreach (MatchSummary::getSummaries(RSS_SIZE) as $item) {
$m = new Match($item->match_id);
$entries[] = (object) array('title' => "Match: {$m->team1_name} ({$m->team1_score}) vs. {$m->team2_name} ({$m->team2_score})", 'desc' => $m->getText(), 'date' => $m->date_played);
}
break;
case T_TEXT_TNEWS:
foreach (TeamNews::getNews(false, RSS_SIZE) as $item) {
$entries[] = (object) array('title' => "Team news by " . get_alt_col('teams', 'team_id', $item->f_id, 'name'), 'desc' => $item->txt, 'date' => $item->date);
}
break;
}
}
objsort($entries, array('-date'));
foreach (array_slice($entries, 0, RSS_SIZE) as $item) {
$el_item = $dom->createElement('item');
$el_item->appendChild($dom->createElement('title', htmlspecialchars($item->title, ENT_NOQUOTES, "UTF-8")));
$el_item->appendChild($dom->createElement('description', htmlspecialchars($item->desc, ENT_NOQUOTES, "UTF-8")));
$el_item->appendChild($dom->createElement('link', $this->link));
# $el_item->appendChild($dom->createElement('pubDate', $item->date));
$el_item->appendChild($dom->createElement('pubDate', date('r', strtotime($item->date))));
$el_item->appendChild($dom->createElement('guid', $this->link . 'index.php?' . date('U', strtotime($item->date))));
# RSS 2.0 dirty workaround.
$el_channel->appendChild($el_item);
}
// Write the file
$handle = fopen("rss.xml", "w");
fwrite($handle, $dom->saveXML());
fclose($handle);
return $dom->saveXML();
}
示例9: _actionBoxes
//.........这里部分代码省略.........
</tr>
<tr valign="top">
<td><?php
echo $lng->getTrn('common/playedtours');
?>
</td>
<td><small><?php
$tours = $team->getToursPlayedIn(false);
if (empty($tours)) {
echo $lng->getTrn('common/none');
} else {
$first = true;
foreach ($tours as $tour) {
if ($first) {
$first = false;
} else {
echo ", ";
}
echo $tour->getUrl();
}
}
?>
</small></td>
</tr>
<?php
if (Module::isRegistered('Prize')) {
?>
<tr valign="top">
<td><?php
echo $lng->getTrn('name', 'Prize');
?>
</td>
<td><small><?php
echo Module::run('Prize', array('getPrizesString', T_OBJ_TEAM, $team->team_id));
?>
</small></td>
</tr>
<?php
}
if (Module::isRegistered('FamousTeams')) {
?>
<tr>
<td><?php
echo $lng->getTrn('isfamous', 'FamousTeams');
?>
</td>
<td><?php
echo Module::run('FamousTeams', array('isInFT', $team->team_id)) ? '<b><font color="green">Yes</font></b>' : 'No';
?>
</td>
</tr>
<?php
}
?>
</table>
</div>
</div>
<?php
if ($ALLOW_EDIT) {
$this->_teamManagementBox($players, $team);
if ($coach->isNodeCommish(T_NODE_LEAGUE, $team->f_lid)) {
?>
<div class="boxTeamPage">
<div class="boxTitle<?php
echo T_HTMLBOX_ADMIN;