This commit is contained in:
joyqi 2021-09-09 14:09:19 +08:00
parent 4ad930a31d
commit eb77897ab6
3 changed files with 36 additions and 8 deletions

View File

@ -10,7 +10,11 @@ use Typecho\Widget\Terminal;
/**
* Typecho组件基类
*
* @package Widget
* @property $sequence
* @property $length
* @property-read $request
* @property-read $response
* @property-read $parameter
*/
abstract class Widget
{
@ -33,14 +37,14 @@ abstract class Widget
*
* @var WidgetRequest
*/
public $request;
protected $request;
/**
* response对象
*
* @var Response
* @var WidgetResponse
*/
public $response;
protected $response;
/**
* 数据堆栈
@ -436,4 +440,28 @@ abstract class Widget
{
return $this->length;
}
/**
* @return WidgetRequest
*/
public function ___request(): WidgetRequest
{
return $this->request;
}
/**
* @return WidgetRequest
*/
public function ___response(): WidgetRequest
{
return $this->request;
}
/**
* @return Config
*/
public function ___parameter(): Config
{
return $this->parameter;
}
}

View File

@ -86,10 +86,10 @@ class Admin extends Comments
if (!$this->user->pass('editor', true)) {
$select->where('table.comments.ownerId = ?', $this->user->uid);
} elseif (!isset($this->request->cid)) {
if ('on' == $this->request->_typecho_all_comments) {
if ('on' == $this->request->__typecho_all_comments) {
Cookie::set('__typecho_all_comments', 'on');
} else {
if ('off' == $this->request->_typecho_all_comments) {
if ('off' == $this->request->__typecho_all_comments) {
Cookie::set('__typecho_all_comments', 'off');
}

View File

@ -100,10 +100,10 @@ class Admin extends Contents
if (!$this->user->pass('editor', true)) {
$select->where('table.contents.authorId = ?', $this->user->uid);
} else {
if ('on' == $this->request->_typecho_all_posts) {
if ('on' == $this->request->__typecho_all_posts) {
Cookie::set('__typecho_all_posts', 'on');
} else {
if ('off' == $this->request->_typecho_all_posts) {
if ('off' == $this->request->__typecho_all_posts) {
Cookie::set('__typecho_all_posts', 'off');
}