本文整理汇总了PHP中AbstractPage类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractPage类的具体用法?PHP AbstractPage怎么用?PHP AbstractPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignVariables
/**
* @see Page::assignVariables()
*/
public function assignVariables()
{
parent::assignVariables();
// get phpinfo() output
ob_start();
phpinfo();
$info = ob_get_contents();
ob_end_clean();
// parse output
$info = preg_replace('%^.*<body>(.*)</body>.*$%s', '$1', $info);
// style fixes
// remove first table
$info = preg_replace('%<table.*?</table><br />%s', '', $info, 1);
// fix tables
$info = preg_replace('%<h2>(.*?)</h2>\\s*<table border="0" cellpadding="3" width="600">%', '<div class="border titleBarPanel"><div class="containerHead"><h3>\\1</h3></div></div><div class="border borderMarginRemove"><table class="tableList">', $info);
$info = preg_replace('%<table border="0" cellpadding="3" width="600">%', '<div class="border titleBarPanel"><table class="tableList">', $info);
$info = str_replace('</table>', '</table></div>', $info);
$info = str_replace('<tr class="h">', '<thead><tr class="tableHead">', $info);
$info = str_replace('</th></tr>', '</th></tr></thead>', $info);
$info = preg_replace('%</td></tr>%', '</th></tr></thead>', $info, 1);
$info = str_replace('<tr class="tableHead"><td>', '<tr class="tableHead"><th>', $info);
$info = preg_replace('%<th(\\s+.*?)?>%', '<th\\1><div><span class="emptyHead">', $info);
$info = str_replace('</th>', '</span></div></th>', $info);
// fix row colors
$info = preg_replace_callback('%<tr>%', array($this, 'insertRowColorsCallback'), $info);
// h1, h2 fixes
$info = str_replace('</h2>', '</h3>', $info);
$info = str_replace('<h2>', '<h3>', $info);
$info = str_replace('</h1>', '</h2>', $info);
$info = str_replace('<h1', '<h2', $info);
WCF::getTPL()->assign(array('phpInfo' => $info));
}
示例2: show
/**
* Shows the IP-Adress page.
*/
public function show()
{
// check permission
WCF::getUser()->checkPermission('admin.general.canViewIpAddress');
// show page
parent::show();
}
示例3: show
/**
* @see Page::show()
*/
public function show()
{
parent::show();
header('Content-Type: application/json');
echo json_encode(array(array('name' => $this->subject, 'type' => 'contestPrice', 'message' => $this->message, 'subject' => $this->subject, 'id' => rand(1, 1000))));
exit;
}
示例4: show
/**
* @see Page::show()
*/
public function show()
{
parent::show();
if (in_array($this->action, self::$validFunctions)) {
$this->{$this->action}();
}
}
示例5: show
/**
* @see Page::show()
*/
public function show()
{
// enable menu item
WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.admintools.phpinfo');
// show page
parent::show();
}
示例6: assignVariables
/**
* @see Page::assignVariables()
*/
public function assignVariables()
{
parent::assignVariables();
if (empty($this->disabledFunctions) && empty($this->recommendFunctions)) {
$functionErrorType = 'success';
} else {
if (empty($this->disabledFunctions)) {
$functionErrorType = 'warning';
} else {
$functionErrorType = 'error';
}
}
$functions = array();
foreach ($this->disabledFunctions as $key => $val) {
if (isset($this->recommendFunctions[$key])) {
$functions[$key] = array_merge($this->disabledFunctions[$key], $this->recommendFunctions[$key]);
} else {
$functions[$key] = $this->disabledFunctions[$key];
}
}
foreach ($this->recommendFunctions as $key => $val) {
if (isset($this->disabledFunctions[$key])) {
$functions[$key] = array_merge($this->disabledFunctions[$key], $this->recommendFunctions[$key]);
} else {
$functions[$key] = $this->recommendFunctions[$key];
}
}
WCF::getTPL()->assign(array('disabledFunctions' => $functions, 'functionErrorType' => $functionErrorType, 'size' => $this->size));
}
示例7: show
/**
* @see Page::show()
*/
public function show()
{
// enable menu item
WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.template.view');
// check permission
WCF::getUser()->checkPermission(array('admin.template.canEditTemplate', 'admin.template.canDeleteTemplate'));
parent::show();
}
示例8: show
/**
* @see Page::show()
*/
public function show()
{
if (!MODULE_CHEAT_DATABASE) {
throw new IllegalLinkException();
}
PageMenu::setActiveMenuItem('wcf.header.menu.cheatDatabase');
parent::show();
}
示例9: show
/**
* @see Page::show()
*/
public function show()
{
// Set active header menu item
require_once WCF_DIR . 'lib/page/util/menu/PageMenu.class.php';
require_once WCF_DIR . 'lib/page/util/menu/HeaderMenu.class.php';
PageMenu::setActiveMenuItem('wcf.header.menu.aboutmepage');
parent::show();
}
示例10: __construct
public function __construct()
{
parent::__construct();
$columns = array();
$columns[] = new picon\PropertyColumn('Sample Value', 'value');
$provider = new SampleDataProvider();
$this->add(new \picon\DefaultDataTable('table', $provider, $columns));
}
示例11: show
/**
* @see Page::show()
*/
public function show()
{
// active default tab
UserCPMenu::getInstance()->setActiveMenuItem('wcf.user.usercp.menu.link.modcp.overview');
// check permission
WCF::getUser()->checkPermission(array('mod.board.canReadDeletedThread', 'mod.board.canEnableThread', 'mod.board.canReadDeletedPost', 'mod.board.canEnablePost'));
parent::show();
}
示例12: show
/**
* @see Page::show()
*/
public function show()
{
try {
// get attachment from database
$sql = "SELECT\t*\n\t\t\t\tFROM \twcf" . WCF_N . "_attachment\n\t\t\t\tWHERE \tattachmentID = " . $this->attachmentID . " \n\t\t\t\t\tAND packageID IN (\n\t\t\t\t\t\tSELECT\tdependency\n\t\t\t\t\t\tFROM\twcf" . WCF_N . "_package_dependency\n\t\t\t\t\t\tWHERE\tpackageID = " . PACKAGE_ID . "\n\t\t\t\t\t)";
$this->attachment = WCF::getDB()->getFirstRow($sql);
// check attachment id
if (!isset($this->attachment['attachmentID'])) {
throw new IllegalLinkException();
}
// check thumbnail status
if ($this->thumbnail && !$this->attachment['thumbnailType']) {
throw new IllegalLinkException();
}
parent::show();
// reset URI in session
if ($this->thumbnail && WCF::getSession()->lastRequestURI) {
WCF::getSession()->setRequestURI(WCF::getSession()->lastRequestURI);
}
// update download count
if (!$this->thumbnail) {
$sql = "UPDATE\twcf" . WCF_N . "_attachment\n\t\t\t\t\tSET\tdownloads = downloads + 1,\n\t\t\t\t\t\tlastDownloadTime = " . TIME_NOW . "\n\t\t\t\t\tWHERE\tattachmentID = " . $this->attachmentID;
WCF::getDB()->registerShutdownUpdate($sql);
}
// send headers
// file type
$mimeType = $this->thumbnail ? $this->attachment['thumbnailType'] : $this->attachment['fileType'];
if ($mimeType == 'image/x-png') {
$mimeType = 'image/png';
}
@header('Content-Type: ' . $mimeType);
// file name
@header('Content-disposition: ' . (!in_array($mimeType, self::$inlineMimeTypes) ? 'attachment; ' : 'inline; ') . 'filename="' . $this->attachment['attachmentName'] . '"');
// send file size
@header('Content-Length: ' . ($this->thumbnail ? $this->attachment['thumbnailSize'] : $this->attachment['attachmentSize']));
// no cache headers
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {
// internet explorer doesn't cache files downloaded from a https website, if 'Pragma: no-cache' was sent
// @see http://support.microsoft.com/kb/316431/en
@header('Pragma: public');
} else {
@header('Pragma: no-cache');
}
@header('Expires: 0');
// show attachment
readfile(WCF_DIR . 'attachments/' . ($this->thumbnail ? 'thumbnail' : 'attachment') . '-' . $this->attachment['attachmentID']);
exit;
} catch (Exception $e) {
if ($this->embedded == 1) {
@header('Content-Type: image/png');
@header('Content-disposition: filename="imageNoPermissionL.png"');
readfile(WCF_DIR . 'icon/imageNoPermissionL.png');
exit;
} else {
throw $e;
}
}
}
示例13: show
/**
* @see Page::show()
*/
public function show()
{
// check user
if (!WCF::getUser()->userID) {
require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
throw new PermissionDeniedException();
}
parent::show();
}
示例14: __construct
public function __construct()
{
parent::__construct();
$self = $this;
$this->add(new Link('login', function () use($self) {
$_SESSION['auth'] = true;
$self->setPage(HomePage::getIdentifier());
}));
}
示例15: show
/**
* @see Page::show();
*/
public function show()
{
$this->user->checkPermission('user.source.general.canViewSources');
parent::show();
WCF::getCache()->addResource('update-' . $this->source->sourceID . '-' . $this->type, PB_DIR . 'cache/cache.update-' . $this->source->sourceID . '-' . $this->type . '.php', PB_DIR . 'lib/system/cache/CacheBuilderUpdateServer.class.php', 0, 3600);
@header('Content-Type: text/xml');
echo WCF::getCache()->get('update-' . $this->source->sourceID . '-' . $this->type);
exit;
}